testapi.c revision 99dd7636a44208a14bc71614120f8ef4b8123016
1/*
2 * testapi.c: libxml2 API tester program.
3 *
4 * Automatically generated by gentest.py from libxml2-api.xml
5 *
6 * See Copyright for the status of this software.
7 *
8 * daniel@veillard.com
9 */
10
11#include <stdio.h>
12#include <string.h>
13#include <libxml/xmlerror.h>
14#include <libxml/relaxng.h>
15
16static int testlibxml2(void);
17static int test_module(const char *module);
18
19static int generic_errors = 0;
20static int call_tests = 0;
21static int function_tests = 0;
22
23static xmlChar chartab[1024];
24static int inttab[1024];
25static unsigned long longtab[1024];
26
27static xmlDocPtr api_doc = NULL;
28static xmlDtdPtr api_dtd = NULL;
29static xmlNodePtr api_root = NULL;
30static xmlAttrPtr api_attr = NULL;
31static xmlNsPtr api_ns = NULL;
32
33static void
34structured_errors(void *userData ATTRIBUTE_UNUSED,
35                  xmlErrorPtr error ATTRIBUTE_UNUSED) {
36    generic_errors++;
37}
38
39static void
40free_api_doc(void) {
41    xmlFreeDoc(api_doc);
42    api_doc = NULL;
43    api_dtd = NULL;
44    api_root = NULL;
45    api_attr = NULL;
46    api_ns = NULL;
47}
48
49static xmlDocPtr
50get_api_doc(void) {
51    if (api_doc == NULL) {
52        api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
53	api_root = NULL;
54	api_attr = NULL;
55    }
56    return(api_doc);
57}
58
59static xmlDtdPtr
60get_api_dtd(void) {
61    if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
62        get_api_doc();
63	if ((api_doc != NULL) && (api_doc->children != NULL) &&
64	    (api_doc->children->type == XML_DTD_NODE))
65	    api_dtd = (xmlDtdPtr) api_doc->children;
66    }
67    return(api_dtd);
68}
69
70static xmlNodePtr
71get_api_root(void) {
72    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
73        get_api_doc();
74	if ((api_doc != NULL) && (api_doc->children != NULL) &&
75	    (api_doc->children->next != NULL) &&
76	    (api_doc->children->next->type == XML_ELEMENT_NODE))
77	    api_root = api_doc->children->next;
78    }
79    return(api_root);
80}
81
82static xmlNsPtr
83get_api_ns(void) {
84    get_api_root();
85    if (api_root != NULL)
86        api_ns = api_root->nsDef;
87    return(api_ns);
88}
89
90static xmlAttrPtr
91get_api_attr(void) {
92#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
93    static int nr = 0;
94    xmlChar name[20];
95#endif
96
97    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
98        get_api_root();
99    }
100    if (api_root == NULL)
101        return(NULL);
102    if (api_root->properties != NULL) {
103        api_attr = api_root->properties;
104        return(api_root->properties);
105    }
106    api_attr = NULL;
107#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
108    snprintf((char *) name, 20, "foo%d", nr++);
109    api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
110#endif
111    return(api_attr);
112}
113
114static int quiet = 0;
115
116int main(int argc, char **argv) {
117    int ret;
118    int blocks, mem;
119
120    memset(chartab, 0, sizeof(chartab));
121    strncpy((char *) chartab, "  chartab\n", 20);
122    memset(inttab, 0, sizeof(inttab));
123    memset(longtab, 0, sizeof(longtab));
124
125    xmlInitParser();
126#ifdef LIBXML_SCHEMAS_ENABLED
127    xmlRelaxNGInitTypes();
128#endif
129
130    LIBXML_TEST_VERSION
131
132    xmlSetStructuredErrorFunc(NULL, structured_errors);
133
134    if (argc >= 2) {
135        if (!strcmp(argv[1], "-q")) {
136	    quiet = 1;
137	    if (argc >= 3)
138	        ret = test_module(argv[2]);
139	    else
140		ret = testlibxml2();
141        } else {
142	   ret = test_module(argv[1]);
143	}
144    } else
145	ret = testlibxml2();
146
147    xmlCleanupParser();
148    blocks = xmlMemBlocks();
149    mem = xmlMemUsed();
150    if ((blocks != 0) || (mem != 0)) {
151        printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
152    }
153    xmlMemoryDump();
154
155    return (ret != 0);
156}
157
158#include <libxml/HTMLparser.h>
159#include <libxml/HTMLtree.h>
160#include <libxml/catalog.h>
161#include <libxml/chvalid.h>
162#include <libxml/dict.h>
163#include <libxml/encoding.h>
164#include <libxml/entities.h>
165#include <libxml/hash.h>
166#include <libxml/list.h>
167#include <libxml/nanoftp.h>
168#include <libxml/nanohttp.h>
169#include <libxml/parser.h>
170#include <libxml/parserInternals.h>
171#include <libxml/pattern.h>
172#include <libxml/relaxng.h>
173#include <libxml/schemasInternals.h>
174#include <libxml/tree.h>
175#include <libxml/uri.h>
176#include <libxml/valid.h>
177#include <libxml/xinclude.h>
178#include <libxml/xmlIO.h>
179#include <libxml/xmlerror.h>
180#include <libxml/xmlreader.h>
181#include <libxml/xmlsave.h>
182#include <libxml/xmlschemas.h>
183#include <libxml/xmlschemastypes.h>
184#include <libxml/xmlstring.h>
185#include <libxml/xmlwriter.h>
186#include <libxml/xpath.h>
187#include <libxml/xpointer.h>
188#include <libxml/debugXML.h>
189
190/*
191  We manually define xmlErrMemory because it's normal declaration
192  is "hidden" by #ifdef IN_LIBXML
193*/
194void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
195
196/*
197 We need some "remote" addresses, but want to avoid getting into
198 name resolution delays, so we use these
199*/
200#define	REMOTE1GOOD	"http://localhost/"
201#define	REMOTE1BAD	"http://missing. example.org/"
202#define	REMOTE2GOOD	"ftp://localhost/foo"
203
204#define gen_nb_void_ptr 2
205
206static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
207    return(NULL);
208}
209static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
210}
211
212#if 0
213#define gen_nb_const_void_ptr 2
214
215static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
216    if (no == 0) return((const void *) "immutable string");
217    return(NULL);
218}
219static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
220}
221#endif
222
223#define gen_nb_userdata 3
224
225static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
226    if (no == 0) return((void *) &call_tests);
227    if (no == 1) return((void *) -1);
228    return(NULL);
229}
230static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
231}
232
233
234#define gen_nb_int 4
235
236static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
237    if (no == 0) return(0);
238    if (no == 1) return(1);
239    if (no == 2) return(-1);
240    if (no == 3) return(122);
241    return(-1);
242}
243
244static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
245}
246
247#define gen_nb_parseroptions 5
248
249static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
250    if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
251    if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
252    if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
253    if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
254    return(XML_PARSE_SAX1);
255}
256
257static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
258}
259
260#if 0
261#define gen_nb_long 5
262
263static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
264    if (no == 0) return(0);
265    if (no == 1) return(1);
266    if (no == 2) return(-1);
267    if (no == 3) return(122);
268    return(-1);
269}
270
271static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
272}
273#endif
274
275#define gen_nb_xmlChar 4
276
277static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
278    if (no == 0) return('a');
279    if (no == 1) return(' ');
280    if (no == 2) return('�');
281    return(0);
282}
283
284static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
285}
286
287#define gen_nb_unsigned_int 3
288
289static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
290    if (no == 0) return(0);
291    if (no == 1) return(1);
292    if (no == 2) return(122);
293    return(-1);
294}
295
296static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
297}
298
299#define gen_nb_unsigned_long 4
300
301static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
302    if (no == 0) return(0);
303    if (no == 1) return(1);
304    if (no == 2) return(122);
305    return(-1);
306}
307
308static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
309}
310
311#define gen_nb_double 4
312
313static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
314    if (no == 0) return(0);
315    if (no == 1) return(-1.1);
316#if defined(LIBXML_XPATH_ENABLED)
317    if (no == 2) return(xmlXPathNAN);
318#endif
319    return(-1);
320}
321
322static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
323}
324
325#define gen_nb_unsigned_long_ptr 2
326
327static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
328    if (no == 0) return(&longtab[nr]);
329    return(NULL);
330}
331
332static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
333}
334
335#define gen_nb_int_ptr 2
336
337static int *gen_int_ptr(int no, int nr) {
338    if (no == 0) return(&inttab[nr]);
339    return(NULL);
340}
341
342static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
343}
344
345#define gen_nb_const_char_ptr 4
346
347static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
348    if (no == 0) return((char *) "foo");
349    if (no == 1) return((char *) "<foo/>");
350    if (no == 2) return((char *) "test/ent2");
351    return(NULL);
352}
353static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
354}
355
356#define gen_nb_xmlChar_ptr 2
357
358static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
359    if (no == 0) return(&chartab[0]);
360    return(NULL);
361}
362static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
363}
364
365#define gen_nb_FILE_ptr 2
366
367static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
368    if (no == 0) return(fopen("test.out", "a+"));
369    return(NULL);
370}
371static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
372    if (val != NULL) fclose(val);
373}
374
375#define gen_nb_debug_FILE_ptr 2
376static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
377    return(fopen("test.out", "a+"));
378}
379static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
380    if (val != NULL) fclose(val);
381}
382
383#define gen_nb_const_xmlChar_ptr 5
384
385static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
386    if (no == 0) return((xmlChar *) "foo");
387    if (no == 1) return((xmlChar *) "<foo/>");
388    if (no == 2) return((xmlChar *) "n�ne");
389    if (no == 3) return((xmlChar *) " 2ab ");
390    return(NULL);
391}
392static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
393}
394
395#define gen_nb_filepath 8
396
397static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
398    if (no == 0) return("missing.xml");
399    if (no == 1) return("<foo/>");
400    if (no == 2) return("test/ent2");
401    if (no == 3) return("test/valid/REC-xml-19980210.xml");
402    if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
403    if (no == 5) return(REMOTE1GOOD);
404    if (no == 6) return(REMOTE1BAD);
405    return(NULL);
406}
407static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
408}
409
410#define gen_nb_eaten_name 2
411
412static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
413    if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
414    return(NULL);
415}
416static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
417}
418
419#define gen_nb_fileoutput 6
420
421static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
422    if (no == 0) return("/missing.xml");
423    if (no == 1) return("<foo/>");
424    if (no == 2) return(REMOTE2GOOD);
425    if (no == 3) return(REMOTE1GOOD);
426    if (no == 4) return(REMOTE1BAD);
427    return(NULL);
428}
429static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
430}
431
432#define gen_nb_xmlParserCtxtPtr 3
433static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
434    if (no == 0) return(xmlNewParserCtxt());
435    if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
436    return(NULL);
437}
438static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
439    if (val != NULL)
440        xmlFreeParserCtxt(val);
441}
442
443#define gen_nb_xmlSAXHandlerPtr 2
444static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
445#ifdef LIBXML_SAX1_ENABLED
446    if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
447#endif
448    return(NULL);
449}
450static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
451}
452
453#define gen_nb_xmlValidCtxtPtr 2
454static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
455#ifdef LIBXML_VALID_ENABLED
456    if (no == 0) return(xmlNewValidCtxt());
457#endif
458    return(NULL);
459}
460static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
461#ifdef LIBXML_VALID_ENABLED
462    if (val != NULL)
463        xmlFreeValidCtxt(val);
464#endif
465}
466
467#define gen_nb_xmlParserInputBufferPtr 8
468
469static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
470    if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
471    if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
472    if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
473    if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
474    if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
475    if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
476    if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
477    return(NULL);
478}
479static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
480    xmlFreeParserInputBuffer(val);
481}
482
483#define gen_nb_xmlDocPtr 3
484static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
485    if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
486    if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
487    return(NULL);
488}
489static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
490    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
491        xmlFreeDoc(val);
492}
493
494#define gen_nb_xmlAttrPtr 2
495static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
496    if (no == 0) return(get_api_attr());
497    return(NULL);
498}
499static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
500    if (no == 0) free_api_doc();
501}
502
503#define gen_nb_xmlDictPtr 2
504static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
505    if (no == 0) return(xmlDictCreate());
506    return(NULL);
507}
508static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
509    if (val != NULL)
510        xmlDictFree(val);
511}
512
513#define gen_nb_xmlNodePtr 3
514static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
515    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
516    if (no == 1) return(get_api_root());
517    return(NULL);
518/*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
519}
520static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
521    if (no == 1) free_api_doc();
522    else if (val != NULL) {
523        xmlUnlinkNode(val);
524        xmlFreeNode(val);
525    }
526}
527
528#define gen_nb_xmlDtdPtr 3
529static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
530    if (no == 0)
531        return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
532    if (no == 1) return(get_api_dtd());
533    return(NULL);
534}
535static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
536    if (no == 1) free_api_doc();
537    else if (val != NULL) {
538        xmlUnlinkNode((xmlNodePtr) val);
539        xmlFreeNode((xmlNodePtr) val);
540    }
541}
542
543#define gen_nb_xmlNsPtr 2
544static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
545    if (no == 0) return(get_api_ns());
546    return(NULL);
547}
548static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
549    if (no == 0) free_api_doc();
550}
551
552#define gen_nb_xmlNodePtr_in 3
553static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
554    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
555    if (no == 0) return(xmlNewText(BAD_CAST "text"));
556    return(NULL);
557}
558static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
559}
560
561#ifdef LIBXML_WRITER_ENABLED
562#define gen_nb_xmlTextWriterPtr 2
563static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
564    if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
565    return(NULL);
566}
567static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
568    if (val != NULL) xmlFreeTextWriter(val);
569}
570#endif
571
572#ifdef LIBXML_READER_ENABLED
573#define gen_nb_xmlTextReaderPtr 4
574static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
575    if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
576    if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
577    if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
578    return(NULL);
579}
580static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
581    if (val != NULL) xmlFreeTextReader(val);
582}
583#endif
584
585#define gen_nb_xmlBufferPtr 3
586static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
587    if (no == 0) return(xmlBufferCreate());
588    if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
589    return(NULL);
590}
591static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
592    if (val != NULL) {
593        xmlBufferFree(val);
594    }
595}
596
597#define gen_nb_xmlListPtr 2
598static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
599    if (no == 0) return(xmlListCreate(NULL, NULL));
600    return(NULL);
601}
602static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
603    if (val != NULL) {
604        xmlListDelete(val);
605    }
606}
607
608#define gen_nb_xmlHashTablePtr 2
609static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
610    if (no == 0) return(xmlHashCreate(10));
611    return(NULL);
612}
613static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
614    if (val != NULL) {
615        xmlHashFree(val, NULL);
616    }
617}
618
619#include <libxml/xpathInternals.h>
620
621#ifdef LIBXML_XPATH_ENABLED
622#define gen_nb_xmlXPathObjectPtr 5
623static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
624    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
625    if (no == 1) return(xmlXPathNewFloat(1.1));
626    if (no == 2) return(xmlXPathNewBoolean(1));
627    if (no == 3) return(xmlXPathNewNodeSet(NULL));
628    return(NULL);
629}
630static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
631    if (val != NULL) {
632        xmlXPathFreeObject(val);
633    }
634}
635#endif
636
637#ifdef LIBXML_OUTPUT_ENABLED
638#define gen_nb_xmlOutputBufferPtr 2
639static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
640    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
641    return(NULL);
642}
643static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
644    if (val != NULL) {
645        xmlOutputBufferClose(val);
646    }
647}
648#endif
649
650#ifdef LIBXML_FTP_ENABLED
651#define gen_nb_xmlNanoFTPCtxtPtr 4
652static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
653    if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
654    if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
655    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
656    return(NULL);
657}
658static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
659    if (val != NULL) {
660        xmlNanoFTPFreeCtxt(val);
661    }
662}
663#endif
664
665#ifdef LIBXML_HTTP_ENABLED
666#define gen_nb_xmlNanoHTTPCtxtPtr 1
667static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
668    if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
669    if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
670    if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
671    return(NULL);
672}
673static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
674    if (val != NULL) {
675	xmlNanoHTTPClose(val);
676    }
677}
678#endif
679
680#define gen_nb_xmlCharEncoding 4
681static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
682    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
683    if (no == 1) return(XML_CHAR_ENCODING_NONE);
684    if (no == 2) return(XML_CHAR_ENCODING_8859_1);
685    return(XML_CHAR_ENCODING_ERROR);
686}
687static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
688}
689
690#define gen_nb_xmlHashDeallocator 2
691static void
692test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
693}
694
695static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
696    if (no == 0) return(test_xmlHashDeallocator);
697    return(NULL);
698}
699static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
700}
701
702
703static void desret_int(int val ATTRIBUTE_UNUSED) {
704}
705static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
706}
707static void desret_long(long val ATTRIBUTE_UNUSED) {
708}
709static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
710}
711static void desret_double(double val ATTRIBUTE_UNUSED) {
712}
713static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
714}
715#if 0
716static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
717}
718#endif
719static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
720}
721static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
722}
723static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
724}
725static void desret_xmlChar_ptr(xmlChar *val) {
726    if (val != NULL)
727	xmlFree(val);
728}
729static void desret_xmlDocPtr(xmlDocPtr val) {
730    if (val != api_doc)
731	xmlFreeDoc(val);
732}
733static void desret_xmlDictPtr(xmlDictPtr val) {
734    xmlDictFree(val);
735}
736#ifdef LIBXML_OUTPUT_ENABLED
737static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
738    xmlOutputBufferClose(val);
739}
740#endif
741#ifdef LIBXML_READER_ENABLED
742static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
743    xmlFreeTextReader(val);
744}
745#endif
746static void desret_xmlNodePtr(xmlNodePtr val) {
747    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
748	xmlUnlinkNode(val);
749	xmlFreeNode(val);
750    }
751}
752static void desret_xmlAttrPtr(xmlAttrPtr val) {
753    if (val != NULL) {
754	xmlUnlinkNode((xmlNodePtr) val);
755	xmlFreeNode((xmlNodePtr) val);
756    }
757}
758static void desret_xmlEntityPtr(xmlEntityPtr val) {
759    if (val != NULL) {
760	xmlUnlinkNode((xmlNodePtr) val);
761	xmlFreeNode((xmlNodePtr) val);
762    }
763}
764static void desret_xmlElementPtr(xmlElementPtr val) {
765    if (val != NULL) {
766	xmlUnlinkNode((xmlNodePtr) val);
767    }
768}
769static void desret_xmlAttributePtr(xmlAttributePtr val) {
770    if (val != NULL) {
771	xmlUnlinkNode((xmlNodePtr) val);
772    }
773}
774static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
775}
776static void desret_xmlDtdPtr(xmlDtdPtr val) {
777    desret_xmlNodePtr((xmlNodePtr)val);
778}
779#ifdef LIBXML_XPATH_ENABLED
780static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
781    xmlXPathFreeObject(val);
782}
783static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
784    xmlXPathFreeNodeSet(val);
785}
786#endif
787static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
788    xmlFreeParserCtxt(val);
789}
790static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
791    xmlFreeParserInputBuffer(val);
792}
793static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
794    xmlFreeInputStream(val);
795}
796#ifdef LIBXML_WRITER_ENABLED
797static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
798    xmlFreeTextWriter(val);
799}
800#endif
801static void desret_xmlBufferPtr(xmlBufferPtr val) {
802    xmlBufferFree(val);
803}
804#ifdef LIBXML_SCHEMAS_ENABLED
805static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
806    xmlSchemaFreeParserCtxt(val);
807}
808static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
809}
810static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
811    xmlRelaxNGFreeParserCtxt(val);
812}
813#endif
814#ifdef LIBXML_HTML_ENABLED
815static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
816}
817static void desret_xmlNanoHTTPCtxtPtr(void *val) {
818    xmlNanoHTTPClose(val);
819}
820#endif
821#ifdef LIBXML_FTP_ENABLED
822static void desret_xmlNanoFTPCtxtPtr(void *val) {
823    xmlNanoFTPClose(val);
824}
825#endif
826/* cut and pasted from autogenerated to avoid troubles */
827#define gen_nb_const_xmlChar_ptr_ptr 1
828static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
829    return(NULL);
830}
831static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
832}
833
834#define gen_nb_unsigned_char_ptr 1
835static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
836    return(NULL);
837}
838static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
839}
840
841#define gen_nb_const_unsigned_char_ptr 1
842static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
843    return(NULL);
844}
845static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
846}
847
848#ifdef LIBXML_HTML_ENABLED
849#define gen_nb_const_htmlNodePtr 1
850static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
851    return(NULL);
852}
853static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
854}
855#endif
856
857#ifdef LIBXML_HTML_ENABLED
858#define gen_nb_htmlDocPtr 3
859static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
860    if (no == 0) return(htmlNewDoc(NULL, NULL));
861    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
862    return(NULL);
863}
864static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
865    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
866        xmlFreeDoc(val);
867}
868static void desret_htmlDocPtr(htmlDocPtr val) {
869    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
870        xmlFreeDoc(val);
871}
872#define gen_nb_htmlParserCtxtPtr 3
873static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
874    if (no == 0) return(xmlNewParserCtxt());
875    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
876    return(NULL);
877}
878static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
879    if (val != NULL)
880        htmlFreeParserCtxt(val);
881}
882static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
883    if (val != NULL)
884        htmlFreeParserCtxt(val);
885}
886#endif
887
888#ifdef LIBXML_XPATH_ENABLED
889#define gen_nb_xmlNodeSetPtr 1
890static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
891    return(NULL);
892}
893static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
894}
895#endif
896
897#ifdef LIBXML_DEBUG_ENABLED
898#ifdef LIBXML_XPATH_ENABLED
899#define gen_nb_xmlShellCtxtPtr 1
900static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
901    return(NULL);
902}
903static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
904}
905#endif
906#endif
907
908#ifdef LIBXML_PATTERN_ENABLED
909#define gen_nb_xmlPatternPtr 1
910static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
911    return(NULL);
912}
913static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
914}
915#endif
916
917#define gen_nb_xmlElementContentPtr 1
918static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
919    return(NULL);
920}
921static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
922    if (val != NULL)
923        xmlFreeElementContent(val);
924}
925static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
926    if (val != NULL)
927        xmlFreeElementContent(val);
928}
929
930#define gen_nb_xmlParserNodeInfoSeqPtr 1
931static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
932    return(NULL);
933}
934static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
935}
936
937static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
938}
939
940/************************************************************************
941 *									*
942 *   WARNING: end of the manually maintained part of the test code	*
943 *            do not remove or alter the CUT HERE line			*
944 *									*
945 ************************************************************************/
946
947/* CUT HERE: everything below that line is generated */
948#ifdef LIBXML_HTML_ENABLED
949static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
950}
951
952#endif
953
954#define gen_nb_xmlAttributeDefault 4
955static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
956    if (no == 1) return(XML_ATTRIBUTE_FIXED);
957    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
958    if (no == 3) return(XML_ATTRIBUTE_NONE);
959    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
960    return(0);
961}
962
963static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
964}
965
966#define gen_nb_xmlAttributeType 4
967static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
968    if (no == 1) return(XML_ATTRIBUTE_CDATA);
969    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
970    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
971    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
972    return(0);
973}
974
975static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
976}
977
978#define gen_nb_xmlBufferAllocationScheme 3
979static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
980    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
981    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
982    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
983    return(0);
984}
985
986static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
987}
988
989static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
990}
991
992#ifdef LIBXML_CATALOG_ENABLED
993#define gen_nb_xmlCatalogAllow 4
994static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
995    if (no == 1) return(XML_CATA_ALLOW_ALL);
996    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
997    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
998    if (no == 4) return(XML_CATA_ALLOW_NONE);
999    return(0);
1000}
1001
1002static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1003}
1004
1005static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1006}
1007
1008#endif
1009
1010#ifdef LIBXML_CATALOG_ENABLED
1011#define gen_nb_xmlCatalogPrefer 3
1012static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1013    if (no == 1) return(XML_CATA_PREFER_NONE);
1014    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1015    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1016    return(0);
1017}
1018
1019static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1020}
1021
1022static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1023}
1024
1025#endif
1026
1027#define gen_nb_xmlElementContentType 4
1028static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1029    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1030    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1031    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1032    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1033    return(0);
1034}
1035
1036static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1037}
1038
1039#define gen_nb_xmlElementTypeVal 4
1040static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1041    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1042    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1043    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1044    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1045    return(0);
1046}
1047
1048static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1049}
1050
1051static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1052}
1053
1054#ifdef LIBXML_SCHEMAS_ENABLED
1055#define gen_nb_xmlSchemaValType 4
1056static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1057    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1058    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1059    if (no == 3) return(XML_SCHEMAS_ANYURI);
1060    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1061    return(0);
1062}
1063
1064static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1065}
1066
1067static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1068}
1069
1070#endif
1071
1072#ifdef LIBXML_SCHEMAS_ENABLED
1073#define gen_nb_xmlSchemaWhitespaceValueType 4
1074static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1075    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1076    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1077    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1078    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1079    return(0);
1080}
1081
1082static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1083}
1084
1085#endif
1086
1087#include <libxml/HTMLparser.h>
1088#include <libxml/HTMLtree.h>
1089#include <libxml/SAX2.h>
1090#include <libxml/c14n.h>
1091#include <libxml/catalog.h>
1092#include <libxml/chvalid.h>
1093#include <libxml/debugXML.h>
1094#include <libxml/dict.h>
1095#include <libxml/encoding.h>
1096#include <libxml/entities.h>
1097#include <libxml/hash.h>
1098#include <libxml/list.h>
1099#include <libxml/nanoftp.h>
1100#include <libxml/nanohttp.h>
1101#include <libxml/parser.h>
1102#include <libxml/parserInternals.h>
1103#include <libxml/pattern.h>
1104#include <libxml/relaxng.h>
1105#include <libxml/schemasInternals.h>
1106#include <libxml/tree.h>
1107#include <libxml/uri.h>
1108#include <libxml/valid.h>
1109#include <libxml/xinclude.h>
1110#include <libxml/xmlIO.h>
1111#include <libxml/xmlautomata.h>
1112#include <libxml/xmlerror.h>
1113#include <libxml/xmlmodule.h>
1114#include <libxml/xmlreader.h>
1115#include <libxml/xmlregexp.h>
1116#include <libxml/xmlsave.h>
1117#include <libxml/xmlschemas.h>
1118#include <libxml/xmlschemastypes.h>
1119#include <libxml/xmlstring.h>
1120#include <libxml/xmlunicode.h>
1121#include <libxml/xmlwriter.h>
1122#include <libxml/xpath.h>
1123#include <libxml/xpathInternals.h>
1124#include <libxml/xpointer.h>
1125static int test_HTMLparser(void);
1126static int test_HTMLtree(void);
1127static int test_SAX2(void);
1128static int test_c14n(void);
1129static int test_catalog(void);
1130static int test_chvalid(void);
1131static int test_debugXML(void);
1132static int test_dict(void);
1133static int test_encoding(void);
1134static int test_entities(void);
1135static int test_hash(void);
1136static int test_list(void);
1137static int test_nanoftp(void);
1138static int test_nanohttp(void);
1139static int test_parser(void);
1140static int test_parserInternals(void);
1141static int test_pattern(void);
1142static int test_relaxng(void);
1143static int test_schemasInternals(void);
1144static int test_tree(void);
1145static int test_uri(void);
1146static int test_valid(void);
1147static int test_xinclude(void);
1148static int test_xmlIO(void);
1149static int test_xmlautomata(void);
1150static int test_xmlerror(void);
1151static int test_xmlmodule(void);
1152static int test_xmlreader(void);
1153static int test_xmlregexp(void);
1154static int test_xmlsave(void);
1155static int test_xmlschemas(void);
1156static int test_xmlschemastypes(void);
1157static int test_xmlstring(void);
1158static int test_xmlunicode(void);
1159static int test_xmlwriter(void);
1160static int test_xpath(void);
1161static int test_xpathInternals(void);
1162static int test_xpointer(void);
1163
1164/**
1165 * testlibxml2:
1166 *
1167 * Main entry point of the tester for the full libxml2 module,
1168 * it calls all the tester entry point for each module.
1169 *
1170 * Returns the number of error found
1171 */
1172static int
1173testlibxml2(void)
1174{
1175    int test_ret = 0;
1176
1177    test_ret += test_HTMLparser();
1178    test_ret += test_HTMLtree();
1179    test_ret += test_SAX2();
1180    test_ret += test_c14n();
1181    test_ret += test_catalog();
1182    test_ret += test_chvalid();
1183    test_ret += test_debugXML();
1184    test_ret += test_dict();
1185    test_ret += test_encoding();
1186    test_ret += test_entities();
1187    test_ret += test_hash();
1188    test_ret += test_list();
1189    test_ret += test_nanoftp();
1190    test_ret += test_nanohttp();
1191    test_ret += test_parser();
1192    test_ret += test_parserInternals();
1193    test_ret += test_pattern();
1194    test_ret += test_relaxng();
1195    test_ret += test_schemasInternals();
1196    test_ret += test_tree();
1197    test_ret += test_uri();
1198    test_ret += test_valid();
1199    test_ret += test_xinclude();
1200    test_ret += test_xmlIO();
1201    test_ret += test_xmlautomata();
1202    test_ret += test_xmlerror();
1203    test_ret += test_xmlmodule();
1204    test_ret += test_xmlreader();
1205    test_ret += test_xmlregexp();
1206    test_ret += test_xmlsave();
1207    test_ret += test_xmlschemas();
1208    test_ret += test_xmlschemastypes();
1209    test_ret += test_xmlstring();
1210    test_ret += test_xmlunicode();
1211    test_ret += test_xmlwriter();
1212    test_ret += test_xpath();
1213    test_ret += test_xpathInternals();
1214    test_ret += test_xpointer();
1215
1216    printf("Total: %d functions, %d tests, %d errors\n",
1217           function_tests, call_tests, test_ret);
1218    return(test_ret);
1219}
1220
1221
1222static int
1223test_UTF8ToHtml(void) {
1224    int test_ret = 0;
1225
1226#if defined(LIBXML_HTML_ENABLED)
1227    int mem_base;
1228    int ret_val;
1229    unsigned char * out; /* a pointer to an array of bytes to store the result */
1230    int n_out;
1231    int * outlen; /* the length of @out */
1232    int n_outlen;
1233    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1234    int n_in;
1235    int * inlen; /* the length of @in */
1236    int n_inlen;
1237
1238    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1239    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1240    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1241    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1242        mem_base = xmlMemBlocks();
1243        out = gen_unsigned_char_ptr(n_out, 0);
1244        outlen = gen_int_ptr(n_outlen, 1);
1245        in = gen_const_unsigned_char_ptr(n_in, 2);
1246        inlen = gen_int_ptr(n_inlen, 3);
1247
1248        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1249        desret_int(ret_val);
1250        call_tests++;
1251        des_unsigned_char_ptr(n_out, out, 0);
1252        des_int_ptr(n_outlen, outlen, 1);
1253        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1254        des_int_ptr(n_inlen, inlen, 3);
1255        xmlResetLastError();
1256        if (mem_base != xmlMemBlocks()) {
1257            printf("Leak of %d blocks found in UTF8ToHtml",
1258	           xmlMemBlocks() - mem_base);
1259	    test_ret++;
1260            printf(" %d", n_out);
1261            printf(" %d", n_outlen);
1262            printf(" %d", n_in);
1263            printf(" %d", n_inlen);
1264            printf("\n");
1265        }
1266    }
1267    }
1268    }
1269    }
1270    function_tests++;
1271#endif
1272
1273    return(test_ret);
1274}
1275
1276#ifdef LIBXML_HTML_ENABLED
1277
1278#define gen_nb_const_htmlElemDesc_ptr 1
1279static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1280    return(NULL);
1281}
1282static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1283}
1284#endif
1285
1286
1287static int
1288test_htmlAttrAllowed(void) {
1289    int test_ret = 0;
1290
1291#if defined(LIBXML_HTML_ENABLED)
1292    int mem_base;
1293    htmlStatus ret_val;
1294    htmlElemDesc * elt; /* HTML element */
1295    int n_elt;
1296    xmlChar * attr; /* HTML attribute */
1297    int n_attr;
1298    int legacy; /* whether to allow deprecated attributes */
1299    int n_legacy;
1300
1301    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1302    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1303    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1304        mem_base = xmlMemBlocks();
1305        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1306        attr = gen_const_xmlChar_ptr(n_attr, 1);
1307        legacy = gen_int(n_legacy, 2);
1308
1309        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1310        desret_htmlStatus(ret_val);
1311        call_tests++;
1312        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1313        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1314        des_int(n_legacy, legacy, 2);
1315        xmlResetLastError();
1316        if (mem_base != xmlMemBlocks()) {
1317            printf("Leak of %d blocks found in htmlAttrAllowed",
1318	           xmlMemBlocks() - mem_base);
1319	    test_ret++;
1320            printf(" %d", n_elt);
1321            printf(" %d", n_attr);
1322            printf(" %d", n_legacy);
1323            printf("\n");
1324        }
1325    }
1326    }
1327    }
1328    function_tests++;
1329#endif
1330
1331    return(test_ret);
1332}
1333
1334#ifdef LIBXML_HTML_ENABLED
1335
1336#define gen_nb_htmlNodePtr 1
1337static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1338    return(NULL);
1339}
1340static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1341}
1342#endif
1343
1344
1345static int
1346test_htmlAutoCloseTag(void) {
1347    int test_ret = 0;
1348
1349#if defined(LIBXML_HTML_ENABLED)
1350    int mem_base;
1351    int ret_val;
1352    htmlDocPtr doc; /* the HTML document */
1353    int n_doc;
1354    xmlChar * name; /* The tag name */
1355    int n_name;
1356    htmlNodePtr elem; /* the HTML element */
1357    int n_elem;
1358
1359    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1360    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1361    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1362        mem_base = xmlMemBlocks();
1363        doc = gen_htmlDocPtr(n_doc, 0);
1364        name = gen_const_xmlChar_ptr(n_name, 1);
1365        elem = gen_htmlNodePtr(n_elem, 2);
1366
1367        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1368        desret_int(ret_val);
1369        call_tests++;
1370        des_htmlDocPtr(n_doc, doc, 0);
1371        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1372        des_htmlNodePtr(n_elem, elem, 2);
1373        xmlResetLastError();
1374        if (mem_base != xmlMemBlocks()) {
1375            printf("Leak of %d blocks found in htmlAutoCloseTag",
1376	           xmlMemBlocks() - mem_base);
1377	    test_ret++;
1378            printf(" %d", n_doc);
1379            printf(" %d", n_name);
1380            printf(" %d", n_elem);
1381            printf("\n");
1382        }
1383    }
1384    }
1385    }
1386    function_tests++;
1387#endif
1388
1389    return(test_ret);
1390}
1391
1392
1393static int
1394test_htmlCreateMemoryParserCtxt(void) {
1395    int test_ret = 0;
1396
1397#if defined(LIBXML_HTML_ENABLED)
1398    int mem_base;
1399    htmlParserCtxtPtr ret_val;
1400    char * buffer; /* a pointer to a char array */
1401    int n_buffer;
1402    int size; /* the size of the array */
1403    int n_size;
1404
1405    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1406    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1407        mem_base = xmlMemBlocks();
1408        buffer = gen_const_char_ptr(n_buffer, 0);
1409        size = gen_int(n_size, 1);
1410
1411        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1412        desret_htmlParserCtxtPtr(ret_val);
1413        call_tests++;
1414        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1415        des_int(n_size, size, 1);
1416        xmlResetLastError();
1417        if (mem_base != xmlMemBlocks()) {
1418            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1419	           xmlMemBlocks() - mem_base);
1420	    test_ret++;
1421            printf(" %d", n_buffer);
1422            printf(" %d", n_size);
1423            printf("\n");
1424        }
1425    }
1426    }
1427    function_tests++;
1428#endif
1429
1430    return(test_ret);
1431}
1432
1433#ifdef LIBXML_HTML_ENABLED
1434
1435#define gen_nb_htmlSAXHandlerPtr 1
1436static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1437    return(NULL);
1438}
1439static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1440}
1441#endif
1442
1443
1444static int
1445test_htmlCreatePushParserCtxt(void) {
1446    int test_ret = 0;
1447
1448#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1449    int mem_base;
1450    htmlParserCtxtPtr ret_val;
1451    htmlSAXHandlerPtr sax; /* a SAX handler */
1452    int n_sax;
1453    void * user_data; /* The user data returned on SAX callbacks */
1454    int n_user_data;
1455    char * chunk; /* a pointer to an array of chars */
1456    int n_chunk;
1457    int size; /* number of chars in the array */
1458    int n_size;
1459    const char * filename; /* an optional file name or URI */
1460    int n_filename;
1461    xmlCharEncoding enc; /* an optional encoding */
1462    int n_enc;
1463
1464    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1465    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1466    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1467    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1468    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1469    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1470        mem_base = xmlMemBlocks();
1471        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1472        user_data = gen_userdata(n_user_data, 1);
1473        chunk = gen_const_char_ptr(n_chunk, 2);
1474        size = gen_int(n_size, 3);
1475        filename = gen_fileoutput(n_filename, 4);
1476        enc = gen_xmlCharEncoding(n_enc, 5);
1477
1478        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1479        desret_htmlParserCtxtPtr(ret_val);
1480        call_tests++;
1481        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1482        des_userdata(n_user_data, user_data, 1);
1483        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1484        des_int(n_size, size, 3);
1485        des_fileoutput(n_filename, filename, 4);
1486        des_xmlCharEncoding(n_enc, enc, 5);
1487        xmlResetLastError();
1488        if (mem_base != xmlMemBlocks()) {
1489            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1490	           xmlMemBlocks() - mem_base);
1491	    test_ret++;
1492            printf(" %d", n_sax);
1493            printf(" %d", n_user_data);
1494            printf(" %d", n_chunk);
1495            printf(" %d", n_size);
1496            printf(" %d", n_filename);
1497            printf(" %d", n_enc);
1498            printf("\n");
1499        }
1500    }
1501    }
1502    }
1503    }
1504    }
1505    }
1506    function_tests++;
1507#endif
1508
1509    return(test_ret);
1510}
1511
1512
1513static int
1514test_htmlCtxtReadDoc(void) {
1515    int test_ret = 0;
1516
1517#if defined(LIBXML_HTML_ENABLED)
1518    int mem_base;
1519    htmlDocPtr ret_val;
1520    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1521    int n_ctxt;
1522    xmlChar * cur; /* a pointer to a zero terminated string */
1523    int n_cur;
1524    const char * URL; /* the base URL to use for the document */
1525    int n_URL;
1526    char * encoding; /* the document encoding, or NULL */
1527    int n_encoding;
1528    int options; /* a combination of htmlParserOption(s) */
1529    int n_options;
1530
1531    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1532    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1533    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1534    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1535    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1536        mem_base = xmlMemBlocks();
1537        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1538        cur = gen_const_xmlChar_ptr(n_cur, 1);
1539        URL = gen_filepath(n_URL, 2);
1540        encoding = gen_const_char_ptr(n_encoding, 3);
1541        options = gen_int(n_options, 4);
1542
1543        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1544        desret_htmlDocPtr(ret_val);
1545        call_tests++;
1546        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1547        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1548        des_filepath(n_URL, URL, 2);
1549        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1550        des_int(n_options, options, 4);
1551        xmlResetLastError();
1552        if (mem_base != xmlMemBlocks()) {
1553            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1554	           xmlMemBlocks() - mem_base);
1555	    test_ret++;
1556            printf(" %d", n_ctxt);
1557            printf(" %d", n_cur);
1558            printf(" %d", n_URL);
1559            printf(" %d", n_encoding);
1560            printf(" %d", n_options);
1561            printf("\n");
1562        }
1563    }
1564    }
1565    }
1566    }
1567    }
1568    function_tests++;
1569#endif
1570
1571    return(test_ret);
1572}
1573
1574
1575static int
1576test_htmlCtxtReadFile(void) {
1577    int test_ret = 0;
1578
1579#if defined(LIBXML_HTML_ENABLED)
1580    htmlDocPtr ret_val;
1581    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1582    int n_ctxt;
1583    const char * filename; /* a file or URL */
1584    int n_filename;
1585    char * encoding; /* the document encoding, or NULL */
1586    int n_encoding;
1587    int options; /* a combination of htmlParserOption(s) */
1588    int n_options;
1589
1590    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1591    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1592    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1593    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1594        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1595        filename = gen_filepath(n_filename, 1);
1596        encoding = gen_const_char_ptr(n_encoding, 2);
1597        options = gen_int(n_options, 3);
1598
1599        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1600        desret_htmlDocPtr(ret_val);
1601        call_tests++;
1602        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1603        des_filepath(n_filename, filename, 1);
1604        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1605        des_int(n_options, options, 3);
1606        xmlResetLastError();
1607    }
1608    }
1609    }
1610    }
1611    function_tests++;
1612#endif
1613
1614    return(test_ret);
1615}
1616
1617
1618static int
1619test_htmlCtxtReadMemory(void) {
1620    int test_ret = 0;
1621
1622#if defined(LIBXML_HTML_ENABLED)
1623    int mem_base;
1624    htmlDocPtr ret_val;
1625    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1626    int n_ctxt;
1627    char * buffer; /* a pointer to a char array */
1628    int n_buffer;
1629    int size; /* the size of the array */
1630    int n_size;
1631    const char * URL; /* the base URL to use for the document */
1632    int n_URL;
1633    char * encoding; /* the document encoding, or NULL */
1634    int n_encoding;
1635    int options; /* a combination of htmlParserOption(s) */
1636    int n_options;
1637
1638    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1639    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1640    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1641    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1642    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1643    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1644        mem_base = xmlMemBlocks();
1645        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1646        buffer = gen_const_char_ptr(n_buffer, 1);
1647        size = gen_int(n_size, 2);
1648        URL = gen_filepath(n_URL, 3);
1649        encoding = gen_const_char_ptr(n_encoding, 4);
1650        options = gen_int(n_options, 5);
1651
1652        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1653        desret_htmlDocPtr(ret_val);
1654        call_tests++;
1655        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1656        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1657        des_int(n_size, size, 2);
1658        des_filepath(n_URL, URL, 3);
1659        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1660        des_int(n_options, options, 5);
1661        xmlResetLastError();
1662        if (mem_base != xmlMemBlocks()) {
1663            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1664	           xmlMemBlocks() - mem_base);
1665	    test_ret++;
1666            printf(" %d", n_ctxt);
1667            printf(" %d", n_buffer);
1668            printf(" %d", n_size);
1669            printf(" %d", n_URL);
1670            printf(" %d", n_encoding);
1671            printf(" %d", n_options);
1672            printf("\n");
1673        }
1674    }
1675    }
1676    }
1677    }
1678    }
1679    }
1680    function_tests++;
1681#endif
1682
1683    return(test_ret);
1684}
1685
1686
1687static int
1688test_htmlCtxtReset(void) {
1689    int test_ret = 0;
1690
1691#if defined(LIBXML_HTML_ENABLED)
1692    int mem_base;
1693    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1694    int n_ctxt;
1695
1696    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1697        mem_base = xmlMemBlocks();
1698        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1699
1700        htmlCtxtReset(ctxt);
1701        call_tests++;
1702        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1703        xmlResetLastError();
1704        if (mem_base != xmlMemBlocks()) {
1705            printf("Leak of %d blocks found in htmlCtxtReset",
1706	           xmlMemBlocks() - mem_base);
1707	    test_ret++;
1708            printf(" %d", n_ctxt);
1709            printf("\n");
1710        }
1711    }
1712    function_tests++;
1713#endif
1714
1715    return(test_ret);
1716}
1717
1718
1719static int
1720test_htmlCtxtUseOptions(void) {
1721    int test_ret = 0;
1722
1723#if defined(LIBXML_HTML_ENABLED)
1724    int mem_base;
1725    int ret_val;
1726    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1727    int n_ctxt;
1728    int options; /* a combination of htmlParserOption(s) */
1729    int n_options;
1730
1731    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1732    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1733        mem_base = xmlMemBlocks();
1734        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1735        options = gen_int(n_options, 1);
1736
1737        ret_val = htmlCtxtUseOptions(ctxt, options);
1738        desret_int(ret_val);
1739        call_tests++;
1740        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1741        des_int(n_options, options, 1);
1742        xmlResetLastError();
1743        if (mem_base != xmlMemBlocks()) {
1744            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1745	           xmlMemBlocks() - mem_base);
1746	    test_ret++;
1747            printf(" %d", n_ctxt);
1748            printf(" %d", n_options);
1749            printf("\n");
1750        }
1751    }
1752    }
1753    function_tests++;
1754#endif
1755
1756    return(test_ret);
1757}
1758
1759
1760static int
1761test_htmlElementAllowedHere(void) {
1762    int test_ret = 0;
1763
1764#if defined(LIBXML_HTML_ENABLED)
1765    int mem_base;
1766    int ret_val;
1767    htmlElemDesc * parent; /* HTML parent element */
1768    int n_parent;
1769    xmlChar * elt; /* HTML element */
1770    int n_elt;
1771
1772    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1773    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1774        mem_base = xmlMemBlocks();
1775        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1776        elt = gen_const_xmlChar_ptr(n_elt, 1);
1777
1778        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1779        desret_int(ret_val);
1780        call_tests++;
1781        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1782        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1783        xmlResetLastError();
1784        if (mem_base != xmlMemBlocks()) {
1785            printf("Leak of %d blocks found in htmlElementAllowedHere",
1786	           xmlMemBlocks() - mem_base);
1787	    test_ret++;
1788            printf(" %d", n_parent);
1789            printf(" %d", n_elt);
1790            printf("\n");
1791        }
1792    }
1793    }
1794    function_tests++;
1795#endif
1796
1797    return(test_ret);
1798}
1799
1800
1801static int
1802test_htmlElementStatusHere(void) {
1803    int test_ret = 0;
1804
1805#if defined(LIBXML_HTML_ENABLED)
1806    int mem_base;
1807    htmlStatus ret_val;
1808    htmlElemDesc * parent; /* HTML parent element */
1809    int n_parent;
1810    htmlElemDesc * elt; /* HTML element */
1811    int n_elt;
1812
1813    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1814    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1815        mem_base = xmlMemBlocks();
1816        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1817        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1818
1819        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1820        desret_htmlStatus(ret_val);
1821        call_tests++;
1822        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1823        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1824        xmlResetLastError();
1825        if (mem_base != xmlMemBlocks()) {
1826            printf("Leak of %d blocks found in htmlElementStatusHere",
1827	           xmlMemBlocks() - mem_base);
1828	    test_ret++;
1829            printf(" %d", n_parent);
1830            printf(" %d", n_elt);
1831            printf("\n");
1832        }
1833    }
1834    }
1835    function_tests++;
1836#endif
1837
1838    return(test_ret);
1839}
1840
1841
1842static int
1843test_htmlEncodeEntities(void) {
1844    int test_ret = 0;
1845
1846#if defined(LIBXML_HTML_ENABLED)
1847    int mem_base;
1848    int ret_val;
1849    unsigned char * out; /* a pointer to an array of bytes to store the result */
1850    int n_out;
1851    int * outlen; /* the length of @out */
1852    int n_outlen;
1853    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1854    int n_in;
1855    int * inlen; /* the length of @in */
1856    int n_inlen;
1857    int quoteChar; /* the quote character to escape (' or ") or zero. */
1858    int n_quoteChar;
1859
1860    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1861    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1862    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1863    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1864    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1865        mem_base = xmlMemBlocks();
1866        out = gen_unsigned_char_ptr(n_out, 0);
1867        outlen = gen_int_ptr(n_outlen, 1);
1868        in = gen_const_unsigned_char_ptr(n_in, 2);
1869        inlen = gen_int_ptr(n_inlen, 3);
1870        quoteChar = gen_int(n_quoteChar, 4);
1871
1872        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1873        desret_int(ret_val);
1874        call_tests++;
1875        des_unsigned_char_ptr(n_out, out, 0);
1876        des_int_ptr(n_outlen, outlen, 1);
1877        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1878        des_int_ptr(n_inlen, inlen, 3);
1879        des_int(n_quoteChar, quoteChar, 4);
1880        xmlResetLastError();
1881        if (mem_base != xmlMemBlocks()) {
1882            printf("Leak of %d blocks found in htmlEncodeEntities",
1883	           xmlMemBlocks() - mem_base);
1884	    test_ret++;
1885            printf(" %d", n_out);
1886            printf(" %d", n_outlen);
1887            printf(" %d", n_in);
1888            printf(" %d", n_inlen);
1889            printf(" %d", n_quoteChar);
1890            printf("\n");
1891        }
1892    }
1893    }
1894    }
1895    }
1896    }
1897    function_tests++;
1898#endif
1899
1900    return(test_ret);
1901}
1902
1903
1904static int
1905test_htmlEntityLookup(void) {
1906    int test_ret = 0;
1907
1908#if defined(LIBXML_HTML_ENABLED)
1909    int mem_base;
1910    const htmlEntityDesc * ret_val;
1911    xmlChar * name; /* the entity name */
1912    int n_name;
1913
1914    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1915        mem_base = xmlMemBlocks();
1916        name = gen_const_xmlChar_ptr(n_name, 0);
1917
1918        ret_val = htmlEntityLookup((const xmlChar *)name);
1919        desret_const_htmlEntityDesc_ptr(ret_val);
1920        call_tests++;
1921        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1922        xmlResetLastError();
1923        if (mem_base != xmlMemBlocks()) {
1924            printf("Leak of %d blocks found in htmlEntityLookup",
1925	           xmlMemBlocks() - mem_base);
1926	    test_ret++;
1927            printf(" %d", n_name);
1928            printf("\n");
1929        }
1930    }
1931    function_tests++;
1932#endif
1933
1934    return(test_ret);
1935}
1936
1937
1938static int
1939test_htmlEntityValueLookup(void) {
1940    int test_ret = 0;
1941
1942#if defined(LIBXML_HTML_ENABLED)
1943    int mem_base;
1944    const htmlEntityDesc * ret_val;
1945    unsigned int value; /* the entity's unicode value */
1946    int n_value;
1947
1948    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
1949        mem_base = xmlMemBlocks();
1950        value = gen_unsigned_int(n_value, 0);
1951
1952        ret_val = htmlEntityValueLookup(value);
1953        desret_const_htmlEntityDesc_ptr(ret_val);
1954        call_tests++;
1955        des_unsigned_int(n_value, value, 0);
1956        xmlResetLastError();
1957        if (mem_base != xmlMemBlocks()) {
1958            printf("Leak of %d blocks found in htmlEntityValueLookup",
1959	           xmlMemBlocks() - mem_base);
1960	    test_ret++;
1961            printf(" %d", n_value);
1962            printf("\n");
1963        }
1964    }
1965    function_tests++;
1966#endif
1967
1968    return(test_ret);
1969}
1970
1971
1972static int
1973test_htmlHandleOmittedElem(void) {
1974    int test_ret = 0;
1975
1976#if defined(LIBXML_HTML_ENABLED)
1977    int mem_base;
1978    int ret_val;
1979    int val; /* int 0 or 1 */
1980    int n_val;
1981
1982    for (n_val = 0;n_val < gen_nb_int;n_val++) {
1983        mem_base = xmlMemBlocks();
1984        val = gen_int(n_val, 0);
1985
1986        ret_val = htmlHandleOmittedElem(val);
1987        desret_int(ret_val);
1988        call_tests++;
1989        des_int(n_val, val, 0);
1990        xmlResetLastError();
1991        if (mem_base != xmlMemBlocks()) {
1992            printf("Leak of %d blocks found in htmlHandleOmittedElem",
1993	           xmlMemBlocks() - mem_base);
1994	    test_ret++;
1995            printf(" %d", n_val);
1996            printf("\n");
1997        }
1998    }
1999    function_tests++;
2000#endif
2001
2002    return(test_ret);
2003}
2004
2005
2006static int
2007test_htmlIsAutoClosed(void) {
2008    int test_ret = 0;
2009
2010#if defined(LIBXML_HTML_ENABLED)
2011    int mem_base;
2012    int ret_val;
2013    htmlDocPtr doc; /* the HTML document */
2014    int n_doc;
2015    htmlNodePtr elem; /* the HTML element */
2016    int n_elem;
2017
2018    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2019    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2020        mem_base = xmlMemBlocks();
2021        doc = gen_htmlDocPtr(n_doc, 0);
2022        elem = gen_htmlNodePtr(n_elem, 1);
2023
2024        ret_val = htmlIsAutoClosed(doc, elem);
2025        desret_int(ret_val);
2026        call_tests++;
2027        des_htmlDocPtr(n_doc, doc, 0);
2028        des_htmlNodePtr(n_elem, elem, 1);
2029        xmlResetLastError();
2030        if (mem_base != xmlMemBlocks()) {
2031            printf("Leak of %d blocks found in htmlIsAutoClosed",
2032	           xmlMemBlocks() - mem_base);
2033	    test_ret++;
2034            printf(" %d", n_doc);
2035            printf(" %d", n_elem);
2036            printf("\n");
2037        }
2038    }
2039    }
2040    function_tests++;
2041#endif
2042
2043    return(test_ret);
2044}
2045
2046
2047static int
2048test_htmlIsScriptAttribute(void) {
2049    int test_ret = 0;
2050
2051#if defined(LIBXML_HTML_ENABLED)
2052    int mem_base;
2053    int ret_val;
2054    xmlChar * name; /* an attribute name */
2055    int n_name;
2056
2057    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2058        mem_base = xmlMemBlocks();
2059        name = gen_const_xmlChar_ptr(n_name, 0);
2060
2061        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2062        desret_int(ret_val);
2063        call_tests++;
2064        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2065        xmlResetLastError();
2066        if (mem_base != xmlMemBlocks()) {
2067            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2068	           xmlMemBlocks() - mem_base);
2069	    test_ret++;
2070            printf(" %d", n_name);
2071            printf("\n");
2072        }
2073    }
2074    function_tests++;
2075#endif
2076
2077    return(test_ret);
2078}
2079
2080
2081static int
2082test_htmlNodeStatus(void) {
2083    int test_ret = 0;
2084
2085#if defined(LIBXML_HTML_ENABLED)
2086    int mem_base;
2087    htmlStatus ret_val;
2088    htmlNodePtr node; /* an htmlNodePtr in a tree */
2089    int n_node;
2090    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2091    int n_legacy;
2092
2093    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2094    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2095        mem_base = xmlMemBlocks();
2096        node = gen_const_htmlNodePtr(n_node, 0);
2097        legacy = gen_int(n_legacy, 1);
2098
2099        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2100        desret_htmlStatus(ret_val);
2101        call_tests++;
2102        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2103        des_int(n_legacy, legacy, 1);
2104        xmlResetLastError();
2105        if (mem_base != xmlMemBlocks()) {
2106            printf("Leak of %d blocks found in htmlNodeStatus",
2107	           xmlMemBlocks() - mem_base);
2108	    test_ret++;
2109            printf(" %d", n_node);
2110            printf(" %d", n_legacy);
2111            printf("\n");
2112        }
2113    }
2114    }
2115    function_tests++;
2116#endif
2117
2118    return(test_ret);
2119}
2120
2121
2122static int
2123test_htmlParseCharRef(void) {
2124    int test_ret = 0;
2125
2126#if defined(LIBXML_HTML_ENABLED)
2127    int mem_base;
2128    int ret_val;
2129    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2130    int n_ctxt;
2131
2132    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2133        mem_base = xmlMemBlocks();
2134        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2135
2136        ret_val = htmlParseCharRef(ctxt);
2137        desret_int(ret_val);
2138        call_tests++;
2139        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2140        xmlResetLastError();
2141        if (mem_base != xmlMemBlocks()) {
2142            printf("Leak of %d blocks found in htmlParseCharRef",
2143	           xmlMemBlocks() - mem_base);
2144	    test_ret++;
2145            printf(" %d", n_ctxt);
2146            printf("\n");
2147        }
2148    }
2149    function_tests++;
2150#endif
2151
2152    return(test_ret);
2153}
2154
2155
2156static int
2157test_htmlParseChunk(void) {
2158    int test_ret = 0;
2159
2160#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2161    int mem_base;
2162    int ret_val;
2163    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2164    int n_ctxt;
2165    char * chunk; /* an char array */
2166    int n_chunk;
2167    int size; /* the size in byte of the chunk */
2168    int n_size;
2169    int terminate; /* last chunk indicator */
2170    int n_terminate;
2171
2172    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2173    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2174    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2175    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2176        mem_base = xmlMemBlocks();
2177        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2178        chunk = gen_const_char_ptr(n_chunk, 1);
2179        size = gen_int(n_size, 2);
2180        terminate = gen_int(n_terminate, 3);
2181
2182        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2183        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2184        desret_int(ret_val);
2185        call_tests++;
2186        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2187        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2188        des_int(n_size, size, 2);
2189        des_int(n_terminate, terminate, 3);
2190        xmlResetLastError();
2191        if (mem_base != xmlMemBlocks()) {
2192            printf("Leak of %d blocks found in htmlParseChunk",
2193	           xmlMemBlocks() - mem_base);
2194	    test_ret++;
2195            printf(" %d", n_ctxt);
2196            printf(" %d", n_chunk);
2197            printf(" %d", n_size);
2198            printf(" %d", n_terminate);
2199            printf("\n");
2200        }
2201    }
2202    }
2203    }
2204    }
2205    function_tests++;
2206#endif
2207
2208    return(test_ret);
2209}
2210
2211
2212static int
2213test_htmlParseDoc(void) {
2214    int test_ret = 0;
2215
2216#if defined(LIBXML_HTML_ENABLED)
2217    int mem_base;
2218    htmlDocPtr ret_val;
2219    xmlChar * cur; /* a pointer to an array of xmlChar */
2220    int n_cur;
2221    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2222    int n_encoding;
2223
2224    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2225    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2226        mem_base = xmlMemBlocks();
2227        cur = gen_xmlChar_ptr(n_cur, 0);
2228        encoding = gen_const_char_ptr(n_encoding, 1);
2229
2230        ret_val = htmlParseDoc(cur, (const char *)encoding);
2231        desret_htmlDocPtr(ret_val);
2232        call_tests++;
2233        des_xmlChar_ptr(n_cur, cur, 0);
2234        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2235        xmlResetLastError();
2236        if (mem_base != xmlMemBlocks()) {
2237            printf("Leak of %d blocks found in htmlParseDoc",
2238	           xmlMemBlocks() - mem_base);
2239	    test_ret++;
2240            printf(" %d", n_cur);
2241            printf(" %d", n_encoding);
2242            printf("\n");
2243        }
2244    }
2245    }
2246    function_tests++;
2247#endif
2248
2249    return(test_ret);
2250}
2251
2252
2253static int
2254test_htmlParseDocument(void) {
2255    int test_ret = 0;
2256
2257#if defined(LIBXML_HTML_ENABLED)
2258    int mem_base;
2259    int ret_val;
2260    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2261    int n_ctxt;
2262
2263    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2264        mem_base = xmlMemBlocks();
2265        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2266
2267        ret_val = htmlParseDocument(ctxt);
2268        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2269        desret_int(ret_val);
2270        call_tests++;
2271        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2272        xmlResetLastError();
2273        if (mem_base != xmlMemBlocks()) {
2274            printf("Leak of %d blocks found in htmlParseDocument",
2275	           xmlMemBlocks() - mem_base);
2276	    test_ret++;
2277            printf(" %d", n_ctxt);
2278            printf("\n");
2279        }
2280    }
2281    function_tests++;
2282#endif
2283
2284    return(test_ret);
2285}
2286
2287
2288static int
2289test_htmlParseElement(void) {
2290    int test_ret = 0;
2291
2292#if defined(LIBXML_HTML_ENABLED)
2293    int mem_base;
2294    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2295    int n_ctxt;
2296
2297    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2298        mem_base = xmlMemBlocks();
2299        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2300
2301        htmlParseElement(ctxt);
2302        call_tests++;
2303        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2304        xmlResetLastError();
2305        if (mem_base != xmlMemBlocks()) {
2306            printf("Leak of %d blocks found in htmlParseElement",
2307	           xmlMemBlocks() - mem_base);
2308	    test_ret++;
2309            printf(" %d", n_ctxt);
2310            printf("\n");
2311        }
2312    }
2313    function_tests++;
2314#endif
2315
2316    return(test_ret);
2317}
2318
2319
2320static int
2321test_htmlParseEntityRef(void) {
2322    int test_ret = 0;
2323
2324#if defined(LIBXML_HTML_ENABLED)
2325    int mem_base;
2326    const htmlEntityDesc * ret_val;
2327    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2328    int n_ctxt;
2329    xmlChar ** str; /* location to store the entity name */
2330    int n_str;
2331
2332    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2333    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2334        mem_base = xmlMemBlocks();
2335        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2336        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2337
2338        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2339        desret_const_htmlEntityDesc_ptr(ret_val);
2340        call_tests++;
2341        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2342        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2343        xmlResetLastError();
2344        if (mem_base != xmlMemBlocks()) {
2345            printf("Leak of %d blocks found in htmlParseEntityRef",
2346	           xmlMemBlocks() - mem_base);
2347	    test_ret++;
2348            printf(" %d", n_ctxt);
2349            printf(" %d", n_str);
2350            printf("\n");
2351        }
2352    }
2353    }
2354    function_tests++;
2355#endif
2356
2357    return(test_ret);
2358}
2359
2360
2361static int
2362test_htmlParseFile(void) {
2363    int test_ret = 0;
2364
2365#if defined(LIBXML_HTML_ENABLED)
2366    htmlDocPtr ret_val;
2367    const char * filename; /* the filename */
2368    int n_filename;
2369    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2370    int n_encoding;
2371
2372    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2373    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2374        filename = gen_filepath(n_filename, 0);
2375        encoding = gen_const_char_ptr(n_encoding, 1);
2376
2377        ret_val = htmlParseFile(filename, (const char *)encoding);
2378        desret_htmlDocPtr(ret_val);
2379        call_tests++;
2380        des_filepath(n_filename, filename, 0);
2381        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2382        xmlResetLastError();
2383    }
2384    }
2385    function_tests++;
2386#endif
2387
2388    return(test_ret);
2389}
2390
2391
2392static int
2393test_htmlReadDoc(void) {
2394    int test_ret = 0;
2395
2396#if defined(LIBXML_HTML_ENABLED)
2397    int mem_base;
2398    htmlDocPtr ret_val;
2399    xmlChar * cur; /* a pointer to a zero terminated string */
2400    int n_cur;
2401    const char * URL; /* the base URL to use for the document */
2402    int n_URL;
2403    char * encoding; /* the document encoding, or NULL */
2404    int n_encoding;
2405    int options; /* a combination of htmlParserOption(s) */
2406    int n_options;
2407
2408    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2409    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2410    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2411    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2412        mem_base = xmlMemBlocks();
2413        cur = gen_const_xmlChar_ptr(n_cur, 0);
2414        URL = gen_filepath(n_URL, 1);
2415        encoding = gen_const_char_ptr(n_encoding, 2);
2416        options = gen_int(n_options, 3);
2417
2418        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2419        desret_htmlDocPtr(ret_val);
2420        call_tests++;
2421        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2422        des_filepath(n_URL, URL, 1);
2423        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2424        des_int(n_options, options, 3);
2425        xmlResetLastError();
2426        if (mem_base != xmlMemBlocks()) {
2427            printf("Leak of %d blocks found in htmlReadDoc",
2428	           xmlMemBlocks() - mem_base);
2429	    test_ret++;
2430            printf(" %d", n_cur);
2431            printf(" %d", n_URL);
2432            printf(" %d", n_encoding);
2433            printf(" %d", n_options);
2434            printf("\n");
2435        }
2436    }
2437    }
2438    }
2439    }
2440    function_tests++;
2441#endif
2442
2443    return(test_ret);
2444}
2445
2446
2447static int
2448test_htmlReadFile(void) {
2449    int test_ret = 0;
2450
2451#if defined(LIBXML_HTML_ENABLED)
2452    int mem_base;
2453    htmlDocPtr ret_val;
2454    const char * filename; /* a file or URL */
2455    int n_filename;
2456    char * encoding; /* the document encoding, or NULL */
2457    int n_encoding;
2458    int options; /* a combination of htmlParserOption(s) */
2459    int n_options;
2460
2461    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2462    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2463    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2464        mem_base = xmlMemBlocks();
2465        filename = gen_filepath(n_filename, 0);
2466        encoding = gen_const_char_ptr(n_encoding, 1);
2467        options = gen_int(n_options, 2);
2468
2469        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2470        desret_htmlDocPtr(ret_val);
2471        call_tests++;
2472        des_filepath(n_filename, filename, 0);
2473        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2474        des_int(n_options, options, 2);
2475        xmlResetLastError();
2476        if (mem_base != xmlMemBlocks()) {
2477            printf("Leak of %d blocks found in htmlReadFile",
2478	           xmlMemBlocks() - mem_base);
2479	    test_ret++;
2480            printf(" %d", n_filename);
2481            printf(" %d", n_encoding);
2482            printf(" %d", n_options);
2483            printf("\n");
2484        }
2485    }
2486    }
2487    }
2488    function_tests++;
2489#endif
2490
2491    return(test_ret);
2492}
2493
2494
2495static int
2496test_htmlReadMemory(void) {
2497    int test_ret = 0;
2498
2499#if defined(LIBXML_HTML_ENABLED)
2500    int mem_base;
2501    htmlDocPtr ret_val;
2502    char * buffer; /* a pointer to a char array */
2503    int n_buffer;
2504    int size; /* the size of the array */
2505    int n_size;
2506    const char * URL; /* the base URL to use for the document */
2507    int n_URL;
2508    char * encoding; /* the document encoding, or NULL */
2509    int n_encoding;
2510    int options; /* a combination of htmlParserOption(s) */
2511    int n_options;
2512
2513    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2514    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2515    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2516    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2517    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2518        mem_base = xmlMemBlocks();
2519        buffer = gen_const_char_ptr(n_buffer, 0);
2520        size = gen_int(n_size, 1);
2521        URL = gen_filepath(n_URL, 2);
2522        encoding = gen_const_char_ptr(n_encoding, 3);
2523        options = gen_int(n_options, 4);
2524
2525        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2526        desret_htmlDocPtr(ret_val);
2527        call_tests++;
2528        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2529        des_int(n_size, size, 1);
2530        des_filepath(n_URL, URL, 2);
2531        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2532        des_int(n_options, options, 4);
2533        xmlResetLastError();
2534        if (mem_base != xmlMemBlocks()) {
2535            printf("Leak of %d blocks found in htmlReadMemory",
2536	           xmlMemBlocks() - mem_base);
2537	    test_ret++;
2538            printf(" %d", n_buffer);
2539            printf(" %d", n_size);
2540            printf(" %d", n_URL);
2541            printf(" %d", n_encoding);
2542            printf(" %d", n_options);
2543            printf("\n");
2544        }
2545    }
2546    }
2547    }
2548    }
2549    }
2550    function_tests++;
2551#endif
2552
2553    return(test_ret);
2554}
2555
2556
2557static int
2558test_htmlSAXParseDoc(void) {
2559    int test_ret = 0;
2560
2561#if defined(LIBXML_HTML_ENABLED)
2562    int mem_base;
2563    htmlDocPtr ret_val;
2564    xmlChar * cur; /* a pointer to an array of xmlChar */
2565    int n_cur;
2566    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2567    int n_encoding;
2568    htmlSAXHandlerPtr sax; /* the SAX handler block */
2569    int n_sax;
2570    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2571    int n_userData;
2572
2573    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2574    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2575    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2576    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2577        mem_base = xmlMemBlocks();
2578        cur = gen_xmlChar_ptr(n_cur, 0);
2579        encoding = gen_const_char_ptr(n_encoding, 1);
2580        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2581        userData = gen_userdata(n_userData, 3);
2582
2583        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2584        desret_htmlDocPtr(ret_val);
2585        call_tests++;
2586        des_xmlChar_ptr(n_cur, cur, 0);
2587        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2588        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2589        des_userdata(n_userData, userData, 3);
2590        xmlResetLastError();
2591        if (mem_base != xmlMemBlocks()) {
2592            printf("Leak of %d blocks found in htmlSAXParseDoc",
2593	           xmlMemBlocks() - mem_base);
2594	    test_ret++;
2595            printf(" %d", n_cur);
2596            printf(" %d", n_encoding);
2597            printf(" %d", n_sax);
2598            printf(" %d", n_userData);
2599            printf("\n");
2600        }
2601    }
2602    }
2603    }
2604    }
2605    function_tests++;
2606#endif
2607
2608    return(test_ret);
2609}
2610
2611
2612static int
2613test_htmlSAXParseFile(void) {
2614    int test_ret = 0;
2615
2616#if defined(LIBXML_HTML_ENABLED)
2617    int mem_base;
2618    htmlDocPtr ret_val;
2619    const char * filename; /* the filename */
2620    int n_filename;
2621    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2622    int n_encoding;
2623    htmlSAXHandlerPtr sax; /* the SAX handler block */
2624    int n_sax;
2625    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2626    int n_userData;
2627
2628    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2629    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2630    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2631    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2632        mem_base = xmlMemBlocks();
2633        filename = gen_filepath(n_filename, 0);
2634        encoding = gen_const_char_ptr(n_encoding, 1);
2635        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2636        userData = gen_userdata(n_userData, 3);
2637
2638        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2639        desret_htmlDocPtr(ret_val);
2640        call_tests++;
2641        des_filepath(n_filename, filename, 0);
2642        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2643        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2644        des_userdata(n_userData, userData, 3);
2645        xmlResetLastError();
2646        if (mem_base != xmlMemBlocks()) {
2647            printf("Leak of %d blocks found in htmlSAXParseFile",
2648	           xmlMemBlocks() - mem_base);
2649	    test_ret++;
2650            printf(" %d", n_filename);
2651            printf(" %d", n_encoding);
2652            printf(" %d", n_sax);
2653            printf(" %d", n_userData);
2654            printf("\n");
2655        }
2656    }
2657    }
2658    }
2659    }
2660    function_tests++;
2661#endif
2662
2663    return(test_ret);
2664}
2665
2666
2667static int
2668test_htmlTagLookup(void) {
2669    int test_ret = 0;
2670
2671
2672    /* missing type support */
2673    return(test_ret);
2674}
2675
2676static int
2677test_HTMLparser(void) {
2678    int test_ret = 0;
2679
2680    if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n");
2681    test_ret += test_UTF8ToHtml();
2682    test_ret += test_htmlAttrAllowed();
2683    test_ret += test_htmlAutoCloseTag();
2684    test_ret += test_htmlCreateMemoryParserCtxt();
2685    test_ret += test_htmlCreatePushParserCtxt();
2686    test_ret += test_htmlCtxtReadDoc();
2687    test_ret += test_htmlCtxtReadFile();
2688    test_ret += test_htmlCtxtReadMemory();
2689    test_ret += test_htmlCtxtReset();
2690    test_ret += test_htmlCtxtUseOptions();
2691    test_ret += test_htmlElementAllowedHere();
2692    test_ret += test_htmlElementStatusHere();
2693    test_ret += test_htmlEncodeEntities();
2694    test_ret += test_htmlEntityLookup();
2695    test_ret += test_htmlEntityValueLookup();
2696    test_ret += test_htmlHandleOmittedElem();
2697    test_ret += test_htmlIsAutoClosed();
2698    test_ret += test_htmlIsScriptAttribute();
2699    test_ret += test_htmlNodeStatus();
2700    test_ret += test_htmlParseCharRef();
2701    test_ret += test_htmlParseChunk();
2702    test_ret += test_htmlParseDoc();
2703    test_ret += test_htmlParseDocument();
2704    test_ret += test_htmlParseElement();
2705    test_ret += test_htmlParseEntityRef();
2706    test_ret += test_htmlParseFile();
2707    test_ret += test_htmlReadDoc();
2708    test_ret += test_htmlReadFile();
2709    test_ret += test_htmlReadMemory();
2710    test_ret += test_htmlSAXParseDoc();
2711    test_ret += test_htmlSAXParseFile();
2712    test_ret += test_htmlTagLookup();
2713
2714    if (test_ret != 0)
2715	printf("Module HTMLparser: %d errors\n", test_ret);
2716    return(test_ret);
2717}
2718
2719static int
2720test_htmlDocContentDumpFormatOutput(void) {
2721    int test_ret = 0;
2722
2723#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2724    int mem_base;
2725    xmlOutputBufferPtr buf; /* the HTML buffer output */
2726    int n_buf;
2727    xmlDocPtr cur; /* the document */
2728    int n_cur;
2729    char * encoding; /* the encoding string */
2730    int n_encoding;
2731    int format; /* should formatting spaces been added */
2732    int n_format;
2733
2734    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2735    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2736    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2737    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2738        mem_base = xmlMemBlocks();
2739        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2740        cur = gen_xmlDocPtr(n_cur, 1);
2741        encoding = gen_const_char_ptr(n_encoding, 2);
2742        format = gen_int(n_format, 3);
2743
2744        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2745        call_tests++;
2746        des_xmlOutputBufferPtr(n_buf, buf, 0);
2747        des_xmlDocPtr(n_cur, cur, 1);
2748        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2749        des_int(n_format, format, 3);
2750        xmlResetLastError();
2751        if (mem_base != xmlMemBlocks()) {
2752            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2753	           xmlMemBlocks() - mem_base);
2754	    test_ret++;
2755            printf(" %d", n_buf);
2756            printf(" %d", n_cur);
2757            printf(" %d", n_encoding);
2758            printf(" %d", n_format);
2759            printf("\n");
2760        }
2761    }
2762    }
2763    }
2764    }
2765    function_tests++;
2766#endif
2767
2768    return(test_ret);
2769}
2770
2771
2772static int
2773test_htmlDocContentDumpOutput(void) {
2774    int test_ret = 0;
2775
2776#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2777    int mem_base;
2778    xmlOutputBufferPtr buf; /* the HTML buffer output */
2779    int n_buf;
2780    xmlDocPtr cur; /* the document */
2781    int n_cur;
2782    char * encoding; /* the encoding string */
2783    int n_encoding;
2784
2785    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2786    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2787    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2788        mem_base = xmlMemBlocks();
2789        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2790        cur = gen_xmlDocPtr(n_cur, 1);
2791        encoding = gen_const_char_ptr(n_encoding, 2);
2792
2793        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2794        call_tests++;
2795        des_xmlOutputBufferPtr(n_buf, buf, 0);
2796        des_xmlDocPtr(n_cur, cur, 1);
2797        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2798        xmlResetLastError();
2799        if (mem_base != xmlMemBlocks()) {
2800            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2801	           xmlMemBlocks() - mem_base);
2802	    test_ret++;
2803            printf(" %d", n_buf);
2804            printf(" %d", n_cur);
2805            printf(" %d", n_encoding);
2806            printf("\n");
2807        }
2808    }
2809    }
2810    }
2811    function_tests++;
2812#endif
2813
2814    return(test_ret);
2815}
2816
2817
2818static int
2819test_htmlDocDump(void) {
2820    int test_ret = 0;
2821
2822#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2823    int mem_base;
2824    int ret_val;
2825    FILE * f; /* the FILE* */
2826    int n_f;
2827    xmlDocPtr cur; /* the document */
2828    int n_cur;
2829
2830    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2831    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2832        mem_base = xmlMemBlocks();
2833        f = gen_FILE_ptr(n_f, 0);
2834        cur = gen_xmlDocPtr(n_cur, 1);
2835
2836        ret_val = htmlDocDump(f, cur);
2837        desret_int(ret_val);
2838        call_tests++;
2839        des_FILE_ptr(n_f, f, 0);
2840        des_xmlDocPtr(n_cur, cur, 1);
2841        xmlResetLastError();
2842        if (mem_base != xmlMemBlocks()) {
2843            printf("Leak of %d blocks found in htmlDocDump",
2844	           xmlMemBlocks() - mem_base);
2845	    test_ret++;
2846            printf(" %d", n_f);
2847            printf(" %d", n_cur);
2848            printf("\n");
2849        }
2850    }
2851    }
2852    function_tests++;
2853#endif
2854
2855    return(test_ret);
2856}
2857
2858
2859#define gen_nb_xmlChar_ptr_ptr 1
2860static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2861    return(NULL);
2862}
2863static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2864}
2865
2866static int
2867test_htmlDocDumpMemory(void) {
2868    int test_ret = 0;
2869
2870#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2871    int mem_base;
2872    xmlDocPtr cur; /* the document */
2873    int n_cur;
2874    xmlChar ** mem; /* OUT: the memory pointer */
2875    int n_mem;
2876    int * size; /* OUT: the memory length */
2877    int n_size;
2878
2879    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2880    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2881    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2882        mem_base = xmlMemBlocks();
2883        cur = gen_xmlDocPtr(n_cur, 0);
2884        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2885        size = gen_int_ptr(n_size, 2);
2886
2887        htmlDocDumpMemory(cur, mem, size);
2888        call_tests++;
2889        des_xmlDocPtr(n_cur, cur, 0);
2890        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2891        des_int_ptr(n_size, size, 2);
2892        xmlResetLastError();
2893        if (mem_base != xmlMemBlocks()) {
2894            printf("Leak of %d blocks found in htmlDocDumpMemory",
2895	           xmlMemBlocks() - mem_base);
2896	    test_ret++;
2897            printf(" %d", n_cur);
2898            printf(" %d", n_mem);
2899            printf(" %d", n_size);
2900            printf("\n");
2901        }
2902    }
2903    }
2904    }
2905    function_tests++;
2906#endif
2907
2908    return(test_ret);
2909}
2910
2911
2912static int
2913test_htmlGetMetaEncoding(void) {
2914    int test_ret = 0;
2915
2916#if defined(LIBXML_HTML_ENABLED)
2917    int mem_base;
2918    const xmlChar * ret_val;
2919    htmlDocPtr doc; /* the document */
2920    int n_doc;
2921
2922    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2923        mem_base = xmlMemBlocks();
2924        doc = gen_htmlDocPtr(n_doc, 0);
2925
2926        ret_val = htmlGetMetaEncoding(doc);
2927        desret_const_xmlChar_ptr(ret_val);
2928        call_tests++;
2929        des_htmlDocPtr(n_doc, doc, 0);
2930        xmlResetLastError();
2931        if (mem_base != xmlMemBlocks()) {
2932            printf("Leak of %d blocks found in htmlGetMetaEncoding",
2933	           xmlMemBlocks() - mem_base);
2934	    test_ret++;
2935            printf(" %d", n_doc);
2936            printf("\n");
2937        }
2938    }
2939    function_tests++;
2940#endif
2941
2942    return(test_ret);
2943}
2944
2945
2946static int
2947test_htmlIsBooleanAttr(void) {
2948    int test_ret = 0;
2949
2950#if defined(LIBXML_HTML_ENABLED)
2951    int mem_base;
2952    int ret_val;
2953    xmlChar * name; /* the name of the attribute to check */
2954    int n_name;
2955
2956    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2957        mem_base = xmlMemBlocks();
2958        name = gen_const_xmlChar_ptr(n_name, 0);
2959
2960        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
2961        desret_int(ret_val);
2962        call_tests++;
2963        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2964        xmlResetLastError();
2965        if (mem_base != xmlMemBlocks()) {
2966            printf("Leak of %d blocks found in htmlIsBooleanAttr",
2967	           xmlMemBlocks() - mem_base);
2968	    test_ret++;
2969            printf(" %d", n_name);
2970            printf("\n");
2971        }
2972    }
2973    function_tests++;
2974#endif
2975
2976    return(test_ret);
2977}
2978
2979
2980static int
2981test_htmlNewDoc(void) {
2982    int test_ret = 0;
2983
2984#if defined(LIBXML_HTML_ENABLED)
2985    int mem_base;
2986    htmlDocPtr ret_val;
2987    xmlChar * URI; /* URI for the dtd, or NULL */
2988    int n_URI;
2989    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
2990    int n_ExternalID;
2991
2992    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
2993    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
2994        mem_base = xmlMemBlocks();
2995        URI = gen_const_xmlChar_ptr(n_URI, 0);
2996        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
2997
2998        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
2999        desret_htmlDocPtr(ret_val);
3000        call_tests++;
3001        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3002        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3003        xmlResetLastError();
3004        if (mem_base != xmlMemBlocks()) {
3005            printf("Leak of %d blocks found in htmlNewDoc",
3006	           xmlMemBlocks() - mem_base);
3007	    test_ret++;
3008            printf(" %d", n_URI);
3009            printf(" %d", n_ExternalID);
3010            printf("\n");
3011        }
3012    }
3013    }
3014    function_tests++;
3015#endif
3016
3017    return(test_ret);
3018}
3019
3020
3021static int
3022test_htmlNewDocNoDtD(void) {
3023    int test_ret = 0;
3024
3025#if defined(LIBXML_HTML_ENABLED)
3026    int mem_base;
3027    htmlDocPtr ret_val;
3028    xmlChar * URI; /* URI for the dtd, or NULL */
3029    int n_URI;
3030    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3031    int n_ExternalID;
3032
3033    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3034    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3035        mem_base = xmlMemBlocks();
3036        URI = gen_const_xmlChar_ptr(n_URI, 0);
3037        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3038
3039        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3040        desret_htmlDocPtr(ret_val);
3041        call_tests++;
3042        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3043        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3044        xmlResetLastError();
3045        if (mem_base != xmlMemBlocks()) {
3046            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3047	           xmlMemBlocks() - mem_base);
3048	    test_ret++;
3049            printf(" %d", n_URI);
3050            printf(" %d", n_ExternalID);
3051            printf("\n");
3052        }
3053    }
3054    }
3055    function_tests++;
3056#endif
3057
3058    return(test_ret);
3059}
3060
3061
3062static int
3063test_htmlNodeDump(void) {
3064    int test_ret = 0;
3065
3066#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3067    int mem_base;
3068    int ret_val;
3069    xmlBufferPtr buf; /* the HTML buffer output */
3070    int n_buf;
3071    xmlDocPtr doc; /* the document */
3072    int n_doc;
3073    xmlNodePtr cur; /* the current node */
3074    int n_cur;
3075
3076    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3077    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3078    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3079        mem_base = xmlMemBlocks();
3080        buf = gen_xmlBufferPtr(n_buf, 0);
3081        doc = gen_xmlDocPtr(n_doc, 1);
3082        cur = gen_xmlNodePtr(n_cur, 2);
3083
3084        ret_val = htmlNodeDump(buf, doc, cur);
3085        desret_int(ret_val);
3086        call_tests++;
3087        des_xmlBufferPtr(n_buf, buf, 0);
3088        des_xmlDocPtr(n_doc, doc, 1);
3089        des_xmlNodePtr(n_cur, cur, 2);
3090        xmlResetLastError();
3091        if (mem_base != xmlMemBlocks()) {
3092            printf("Leak of %d blocks found in htmlNodeDump",
3093	           xmlMemBlocks() - mem_base);
3094	    test_ret++;
3095            printf(" %d", n_buf);
3096            printf(" %d", n_doc);
3097            printf(" %d", n_cur);
3098            printf("\n");
3099        }
3100    }
3101    }
3102    }
3103    function_tests++;
3104#endif
3105
3106    return(test_ret);
3107}
3108
3109
3110static int
3111test_htmlNodeDumpFile(void) {
3112    int test_ret = 0;
3113
3114#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3115    int mem_base;
3116    FILE * out; /* the FILE pointer */
3117    int n_out;
3118    xmlDocPtr doc; /* the document */
3119    int n_doc;
3120    xmlNodePtr cur; /* the current node */
3121    int n_cur;
3122
3123    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3124    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3125    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3126        mem_base = xmlMemBlocks();
3127        out = gen_FILE_ptr(n_out, 0);
3128        doc = gen_xmlDocPtr(n_doc, 1);
3129        cur = gen_xmlNodePtr(n_cur, 2);
3130
3131        htmlNodeDumpFile(out, doc, cur);
3132        call_tests++;
3133        des_FILE_ptr(n_out, out, 0);
3134        des_xmlDocPtr(n_doc, doc, 1);
3135        des_xmlNodePtr(n_cur, cur, 2);
3136        xmlResetLastError();
3137        if (mem_base != xmlMemBlocks()) {
3138            printf("Leak of %d blocks found in htmlNodeDumpFile",
3139	           xmlMemBlocks() - mem_base);
3140	    test_ret++;
3141            printf(" %d", n_out);
3142            printf(" %d", n_doc);
3143            printf(" %d", n_cur);
3144            printf("\n");
3145        }
3146    }
3147    }
3148    }
3149    function_tests++;
3150#endif
3151
3152    return(test_ret);
3153}
3154
3155
3156static int
3157test_htmlNodeDumpFileFormat(void) {
3158    int test_ret = 0;
3159
3160#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3161    int mem_base;
3162    int ret_val;
3163    FILE * out; /* the FILE pointer */
3164    int n_out;
3165    xmlDocPtr doc; /* the document */
3166    int n_doc;
3167    xmlNodePtr cur; /* the current node */
3168    int n_cur;
3169    char * encoding; /* the document encoding */
3170    int n_encoding;
3171    int format; /* should formatting spaces been added */
3172    int n_format;
3173
3174    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3175    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3176    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3177    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3178    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3179        mem_base = xmlMemBlocks();
3180        out = gen_FILE_ptr(n_out, 0);
3181        doc = gen_xmlDocPtr(n_doc, 1);
3182        cur = gen_xmlNodePtr(n_cur, 2);
3183        encoding = gen_const_char_ptr(n_encoding, 3);
3184        format = gen_int(n_format, 4);
3185
3186        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3187        desret_int(ret_val);
3188        call_tests++;
3189        des_FILE_ptr(n_out, out, 0);
3190        des_xmlDocPtr(n_doc, doc, 1);
3191        des_xmlNodePtr(n_cur, cur, 2);
3192        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3193        des_int(n_format, format, 4);
3194        xmlResetLastError();
3195        if (mem_base != xmlMemBlocks()) {
3196            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3197	           xmlMemBlocks() - mem_base);
3198	    test_ret++;
3199            printf(" %d", n_out);
3200            printf(" %d", n_doc);
3201            printf(" %d", n_cur);
3202            printf(" %d", n_encoding);
3203            printf(" %d", n_format);
3204            printf("\n");
3205        }
3206    }
3207    }
3208    }
3209    }
3210    }
3211    function_tests++;
3212#endif
3213
3214    return(test_ret);
3215}
3216
3217
3218static int
3219test_htmlNodeDumpFormatOutput(void) {
3220    int test_ret = 0;
3221
3222#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3223    int mem_base;
3224    xmlOutputBufferPtr buf; /* the HTML buffer output */
3225    int n_buf;
3226    xmlDocPtr doc; /* the document */
3227    int n_doc;
3228    xmlNodePtr cur; /* the current node */
3229    int n_cur;
3230    char * encoding; /* the encoding string */
3231    int n_encoding;
3232    int format; /* should formatting spaces been added */
3233    int n_format;
3234
3235    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3236    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3237    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3238    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3239    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3240        mem_base = xmlMemBlocks();
3241        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3242        doc = gen_xmlDocPtr(n_doc, 1);
3243        cur = gen_xmlNodePtr(n_cur, 2);
3244        encoding = gen_const_char_ptr(n_encoding, 3);
3245        format = gen_int(n_format, 4);
3246
3247        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3248        call_tests++;
3249        des_xmlOutputBufferPtr(n_buf, buf, 0);
3250        des_xmlDocPtr(n_doc, doc, 1);
3251        des_xmlNodePtr(n_cur, cur, 2);
3252        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3253        des_int(n_format, format, 4);
3254        xmlResetLastError();
3255        if (mem_base != xmlMemBlocks()) {
3256            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3257	           xmlMemBlocks() - mem_base);
3258	    test_ret++;
3259            printf(" %d", n_buf);
3260            printf(" %d", n_doc);
3261            printf(" %d", n_cur);
3262            printf(" %d", n_encoding);
3263            printf(" %d", n_format);
3264            printf("\n");
3265        }
3266    }
3267    }
3268    }
3269    }
3270    }
3271    function_tests++;
3272#endif
3273
3274    return(test_ret);
3275}
3276
3277
3278static int
3279test_htmlNodeDumpOutput(void) {
3280    int test_ret = 0;
3281
3282#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3283    int mem_base;
3284    xmlOutputBufferPtr buf; /* the HTML buffer output */
3285    int n_buf;
3286    xmlDocPtr doc; /* the document */
3287    int n_doc;
3288    xmlNodePtr cur; /* the current node */
3289    int n_cur;
3290    char * encoding; /* the encoding string */
3291    int n_encoding;
3292
3293    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3294    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3295    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3296    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3297        mem_base = xmlMemBlocks();
3298        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3299        doc = gen_xmlDocPtr(n_doc, 1);
3300        cur = gen_xmlNodePtr(n_cur, 2);
3301        encoding = gen_const_char_ptr(n_encoding, 3);
3302
3303        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3304        call_tests++;
3305        des_xmlOutputBufferPtr(n_buf, buf, 0);
3306        des_xmlDocPtr(n_doc, doc, 1);
3307        des_xmlNodePtr(n_cur, cur, 2);
3308        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3309        xmlResetLastError();
3310        if (mem_base != xmlMemBlocks()) {
3311            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3312	           xmlMemBlocks() - mem_base);
3313	    test_ret++;
3314            printf(" %d", n_buf);
3315            printf(" %d", n_doc);
3316            printf(" %d", n_cur);
3317            printf(" %d", n_encoding);
3318            printf("\n");
3319        }
3320    }
3321    }
3322    }
3323    }
3324    function_tests++;
3325#endif
3326
3327    return(test_ret);
3328}
3329
3330
3331static int
3332test_htmlSaveFile(void) {
3333    int test_ret = 0;
3334
3335#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3336    int mem_base;
3337    int ret_val;
3338    const char * filename; /* the filename (or URL) */
3339    int n_filename;
3340    xmlDocPtr cur; /* the document */
3341    int n_cur;
3342
3343    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3344    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3345        mem_base = xmlMemBlocks();
3346        filename = gen_fileoutput(n_filename, 0);
3347        cur = gen_xmlDocPtr(n_cur, 1);
3348
3349        ret_val = htmlSaveFile(filename, cur);
3350        desret_int(ret_val);
3351        call_tests++;
3352        des_fileoutput(n_filename, filename, 0);
3353        des_xmlDocPtr(n_cur, cur, 1);
3354        xmlResetLastError();
3355        if (mem_base != xmlMemBlocks()) {
3356            printf("Leak of %d blocks found in htmlSaveFile",
3357	           xmlMemBlocks() - mem_base);
3358	    test_ret++;
3359            printf(" %d", n_filename);
3360            printf(" %d", n_cur);
3361            printf("\n");
3362        }
3363    }
3364    }
3365    function_tests++;
3366#endif
3367
3368    return(test_ret);
3369}
3370
3371
3372static int
3373test_htmlSaveFileEnc(void) {
3374    int test_ret = 0;
3375
3376#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3377    int mem_base;
3378    int ret_val;
3379    const char * filename; /* the filename */
3380    int n_filename;
3381    xmlDocPtr cur; /* the document */
3382    int n_cur;
3383    char * encoding; /* the document encoding */
3384    int n_encoding;
3385
3386    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3387    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3388    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3389        mem_base = xmlMemBlocks();
3390        filename = gen_fileoutput(n_filename, 0);
3391        cur = gen_xmlDocPtr(n_cur, 1);
3392        encoding = gen_const_char_ptr(n_encoding, 2);
3393
3394        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3395        desret_int(ret_val);
3396        call_tests++;
3397        des_fileoutput(n_filename, filename, 0);
3398        des_xmlDocPtr(n_cur, cur, 1);
3399        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3400        xmlResetLastError();
3401        if (mem_base != xmlMemBlocks()) {
3402            printf("Leak of %d blocks found in htmlSaveFileEnc",
3403	           xmlMemBlocks() - mem_base);
3404	    test_ret++;
3405            printf(" %d", n_filename);
3406            printf(" %d", n_cur);
3407            printf(" %d", n_encoding);
3408            printf("\n");
3409        }
3410    }
3411    }
3412    }
3413    function_tests++;
3414#endif
3415
3416    return(test_ret);
3417}
3418
3419
3420static int
3421test_htmlSaveFileFormat(void) {
3422    int test_ret = 0;
3423
3424#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3425    int mem_base;
3426    int ret_val;
3427    const char * filename; /* the filename */
3428    int n_filename;
3429    xmlDocPtr cur; /* the document */
3430    int n_cur;
3431    char * encoding; /* the document encoding */
3432    int n_encoding;
3433    int format; /* should formatting spaces been added */
3434    int n_format;
3435
3436    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3437    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3438    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3439    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3440        mem_base = xmlMemBlocks();
3441        filename = gen_fileoutput(n_filename, 0);
3442        cur = gen_xmlDocPtr(n_cur, 1);
3443        encoding = gen_const_char_ptr(n_encoding, 2);
3444        format = gen_int(n_format, 3);
3445
3446        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3447        desret_int(ret_val);
3448        call_tests++;
3449        des_fileoutput(n_filename, filename, 0);
3450        des_xmlDocPtr(n_cur, cur, 1);
3451        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3452        des_int(n_format, format, 3);
3453        xmlResetLastError();
3454        if (mem_base != xmlMemBlocks()) {
3455            printf("Leak of %d blocks found in htmlSaveFileFormat",
3456	           xmlMemBlocks() - mem_base);
3457	    test_ret++;
3458            printf(" %d", n_filename);
3459            printf(" %d", n_cur);
3460            printf(" %d", n_encoding);
3461            printf(" %d", n_format);
3462            printf("\n");
3463        }
3464    }
3465    }
3466    }
3467    }
3468    function_tests++;
3469#endif
3470
3471    return(test_ret);
3472}
3473
3474
3475static int
3476test_htmlSetMetaEncoding(void) {
3477    int test_ret = 0;
3478
3479#if defined(LIBXML_HTML_ENABLED)
3480    int mem_base;
3481    int ret_val;
3482    htmlDocPtr doc; /* the document */
3483    int n_doc;
3484    xmlChar * encoding; /* the encoding string */
3485    int n_encoding;
3486
3487    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3488    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3489        mem_base = xmlMemBlocks();
3490        doc = gen_htmlDocPtr(n_doc, 0);
3491        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3492
3493        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3494        desret_int(ret_val);
3495        call_tests++;
3496        des_htmlDocPtr(n_doc, doc, 0);
3497        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3498        xmlResetLastError();
3499        if (mem_base != xmlMemBlocks()) {
3500            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3501	           xmlMemBlocks() - mem_base);
3502	    test_ret++;
3503            printf(" %d", n_doc);
3504            printf(" %d", n_encoding);
3505            printf("\n");
3506        }
3507    }
3508    }
3509    function_tests++;
3510#endif
3511
3512    return(test_ret);
3513}
3514
3515static int
3516test_HTMLtree(void) {
3517    int test_ret = 0;
3518
3519    if (quiet == 0) printf("Testing HTMLtree : 17 of 17 functions ...\n");
3520    test_ret += test_htmlDocContentDumpFormatOutput();
3521    test_ret += test_htmlDocContentDumpOutput();
3522    test_ret += test_htmlDocDump();
3523    test_ret += test_htmlDocDumpMemory();
3524    test_ret += test_htmlGetMetaEncoding();
3525    test_ret += test_htmlIsBooleanAttr();
3526    test_ret += test_htmlNewDoc();
3527    test_ret += test_htmlNewDocNoDtD();
3528    test_ret += test_htmlNodeDump();
3529    test_ret += test_htmlNodeDumpFile();
3530    test_ret += test_htmlNodeDumpFileFormat();
3531    test_ret += test_htmlNodeDumpFormatOutput();
3532    test_ret += test_htmlNodeDumpOutput();
3533    test_ret += test_htmlSaveFile();
3534    test_ret += test_htmlSaveFileEnc();
3535    test_ret += test_htmlSaveFileFormat();
3536    test_ret += test_htmlSetMetaEncoding();
3537
3538    if (test_ret != 0)
3539	printf("Module HTMLtree: %d errors\n", test_ret);
3540    return(test_ret);
3541}
3542
3543static int
3544test_docbDefaultSAXHandlerInit(void) {
3545    int test_ret = 0;
3546
3547#if defined(LIBXML_DOCB_ENABLED)
3548#ifdef LIBXML_DOCB_ENABLED
3549    int mem_base;
3550
3551        mem_base = xmlMemBlocks();
3552
3553        docbDefaultSAXHandlerInit();
3554        call_tests++;
3555        xmlResetLastError();
3556        if (mem_base != xmlMemBlocks()) {
3557            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3558	           xmlMemBlocks() - mem_base);
3559	    test_ret++;
3560            printf("\n");
3561        }
3562    function_tests++;
3563#endif
3564#endif
3565
3566    return(test_ret);
3567}
3568
3569
3570static int
3571test_htmlDefaultSAXHandlerInit(void) {
3572    int test_ret = 0;
3573
3574#if defined(LIBXML_HTML_ENABLED)
3575#ifdef LIBXML_HTML_ENABLED
3576    int mem_base;
3577
3578        mem_base = xmlMemBlocks();
3579
3580        htmlDefaultSAXHandlerInit();
3581        call_tests++;
3582        xmlResetLastError();
3583        if (mem_base != xmlMemBlocks()) {
3584            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3585	           xmlMemBlocks() - mem_base);
3586	    test_ret++;
3587            printf("\n");
3588        }
3589    function_tests++;
3590#endif
3591#endif
3592
3593    return(test_ret);
3594}
3595
3596
3597static int
3598test_xmlDefaultSAXHandlerInit(void) {
3599    int test_ret = 0;
3600
3601    int mem_base;
3602
3603        mem_base = xmlMemBlocks();
3604
3605        xmlDefaultSAXHandlerInit();
3606        call_tests++;
3607        xmlResetLastError();
3608        if (mem_base != xmlMemBlocks()) {
3609            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3610	           xmlMemBlocks() - mem_base);
3611	    test_ret++;
3612            printf("\n");
3613        }
3614    function_tests++;
3615
3616    return(test_ret);
3617}
3618
3619
3620#define gen_nb_xmlEnumerationPtr 1
3621static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3622    return(NULL);
3623}
3624static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3625}
3626
3627static int
3628test_xmlSAX2AttributeDecl(void) {
3629    int test_ret = 0;
3630
3631    int mem_base;
3632    void * ctx; /* the user data (XML parser context) */
3633    int n_ctx;
3634    xmlChar * elem; /* the name of the element */
3635    int n_elem;
3636    xmlChar * fullname; /* the attribute name */
3637    int n_fullname;
3638    int type; /* the attribute type */
3639    int n_type;
3640    int def; /* the type of default value */
3641    int n_def;
3642    xmlChar * defaultValue; /* the attribute default value */
3643    int n_defaultValue;
3644    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3645    int n_tree;
3646
3647    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3648    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3649    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3650    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3651    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3652    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3653    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3654        mem_base = xmlMemBlocks();
3655        ctx = gen_void_ptr(n_ctx, 0);
3656        elem = gen_const_xmlChar_ptr(n_elem, 1);
3657        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3658        type = gen_int(n_type, 3);
3659        def = gen_int(n_def, 4);
3660        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3661        tree = gen_xmlEnumerationPtr(n_tree, 6);
3662
3663        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3664        call_tests++;
3665        des_void_ptr(n_ctx, ctx, 0);
3666        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3667        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3668        des_int(n_type, type, 3);
3669        des_int(n_def, def, 4);
3670        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3671        des_xmlEnumerationPtr(n_tree, tree, 6);
3672        xmlResetLastError();
3673        if (mem_base != xmlMemBlocks()) {
3674            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3675	           xmlMemBlocks() - mem_base);
3676	    test_ret++;
3677            printf(" %d", n_ctx);
3678            printf(" %d", n_elem);
3679            printf(" %d", n_fullname);
3680            printf(" %d", n_type);
3681            printf(" %d", n_def);
3682            printf(" %d", n_defaultValue);
3683            printf(" %d", n_tree);
3684            printf("\n");
3685        }
3686    }
3687    }
3688    }
3689    }
3690    }
3691    }
3692    }
3693    function_tests++;
3694
3695    return(test_ret);
3696}
3697
3698
3699static int
3700test_xmlSAX2CDataBlock(void) {
3701    int test_ret = 0;
3702
3703    int mem_base;
3704    void * ctx; /* the user data (XML parser context) */
3705    int n_ctx;
3706    xmlChar * value; /* The pcdata content */
3707    int n_value;
3708    int len; /* the block length */
3709    int n_len;
3710
3711    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3712    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3713    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3714        mem_base = xmlMemBlocks();
3715        ctx = gen_void_ptr(n_ctx, 0);
3716        value = gen_const_xmlChar_ptr(n_value, 1);
3717        len = gen_int(n_len, 2);
3718
3719        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3720        call_tests++;
3721        des_void_ptr(n_ctx, ctx, 0);
3722        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3723        des_int(n_len, len, 2);
3724        xmlResetLastError();
3725        if (mem_base != xmlMemBlocks()) {
3726            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3727	           xmlMemBlocks() - mem_base);
3728	    test_ret++;
3729            printf(" %d", n_ctx);
3730            printf(" %d", n_value);
3731            printf(" %d", n_len);
3732            printf("\n");
3733        }
3734    }
3735    }
3736    }
3737    function_tests++;
3738
3739    return(test_ret);
3740}
3741
3742
3743static int
3744test_xmlSAX2Characters(void) {
3745    int test_ret = 0;
3746
3747    int mem_base;
3748    void * ctx; /* the user data (XML parser context) */
3749    int n_ctx;
3750    xmlChar * ch; /* a xmlChar string */
3751    int n_ch;
3752    int len; /* the number of xmlChar */
3753    int n_len;
3754
3755    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3756    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3757    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3758        mem_base = xmlMemBlocks();
3759        ctx = gen_void_ptr(n_ctx, 0);
3760        ch = gen_const_xmlChar_ptr(n_ch, 1);
3761        len = gen_int(n_len, 2);
3762
3763        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3764        call_tests++;
3765        des_void_ptr(n_ctx, ctx, 0);
3766        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3767        des_int(n_len, len, 2);
3768        xmlResetLastError();
3769        if (mem_base != xmlMemBlocks()) {
3770            printf("Leak of %d blocks found in xmlSAX2Characters",
3771	           xmlMemBlocks() - mem_base);
3772	    test_ret++;
3773            printf(" %d", n_ctx);
3774            printf(" %d", n_ch);
3775            printf(" %d", n_len);
3776            printf("\n");
3777        }
3778    }
3779    }
3780    }
3781    function_tests++;
3782
3783    return(test_ret);
3784}
3785
3786
3787static int
3788test_xmlSAX2Comment(void) {
3789    int test_ret = 0;
3790
3791    int mem_base;
3792    void * ctx; /* the user data (XML parser context) */
3793    int n_ctx;
3794    xmlChar * value; /* the xmlSAX2Comment content */
3795    int n_value;
3796
3797    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3798    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3799        mem_base = xmlMemBlocks();
3800        ctx = gen_void_ptr(n_ctx, 0);
3801        value = gen_const_xmlChar_ptr(n_value, 1);
3802
3803        xmlSAX2Comment(ctx, (const xmlChar *)value);
3804        call_tests++;
3805        des_void_ptr(n_ctx, ctx, 0);
3806        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3807        xmlResetLastError();
3808        if (mem_base != xmlMemBlocks()) {
3809            printf("Leak of %d blocks found in xmlSAX2Comment",
3810	           xmlMemBlocks() - mem_base);
3811	    test_ret++;
3812            printf(" %d", n_ctx);
3813            printf(" %d", n_value);
3814            printf("\n");
3815        }
3816    }
3817    }
3818    function_tests++;
3819
3820    return(test_ret);
3821}
3822
3823
3824static int
3825test_xmlSAX2ElementDecl(void) {
3826    int test_ret = 0;
3827
3828    int mem_base;
3829    void * ctx; /* the user data (XML parser context) */
3830    int n_ctx;
3831    xmlChar * name; /* the element name */
3832    int n_name;
3833    int type; /* the element type */
3834    int n_type;
3835    xmlElementContentPtr content; /* the element value tree */
3836    int n_content;
3837
3838    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3839    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3840    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3841    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3842        mem_base = xmlMemBlocks();
3843        ctx = gen_void_ptr(n_ctx, 0);
3844        name = gen_const_xmlChar_ptr(n_name, 1);
3845        type = gen_int(n_type, 2);
3846        content = gen_xmlElementContentPtr(n_content, 3);
3847
3848        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3849        call_tests++;
3850        des_void_ptr(n_ctx, ctx, 0);
3851        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3852        des_int(n_type, type, 2);
3853        des_xmlElementContentPtr(n_content, content, 3);
3854        xmlResetLastError();
3855        if (mem_base != xmlMemBlocks()) {
3856            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
3857	           xmlMemBlocks() - mem_base);
3858	    test_ret++;
3859            printf(" %d", n_ctx);
3860            printf(" %d", n_name);
3861            printf(" %d", n_type);
3862            printf(" %d", n_content);
3863            printf("\n");
3864        }
3865    }
3866    }
3867    }
3868    }
3869    function_tests++;
3870
3871    return(test_ret);
3872}
3873
3874
3875static int
3876test_xmlSAX2EndDocument(void) {
3877    int test_ret = 0;
3878
3879    int mem_base;
3880    void * ctx; /* the user data (XML parser context) */
3881    int n_ctx;
3882
3883    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3884        mem_base = xmlMemBlocks();
3885        ctx = gen_void_ptr(n_ctx, 0);
3886
3887        xmlSAX2EndDocument(ctx);
3888        call_tests++;
3889        des_void_ptr(n_ctx, ctx, 0);
3890        xmlResetLastError();
3891        if (mem_base != xmlMemBlocks()) {
3892            printf("Leak of %d blocks found in xmlSAX2EndDocument",
3893	           xmlMemBlocks() - mem_base);
3894	    test_ret++;
3895            printf(" %d", n_ctx);
3896            printf("\n");
3897        }
3898    }
3899    function_tests++;
3900
3901    return(test_ret);
3902}
3903
3904
3905static int
3906test_xmlSAX2EndElement(void) {
3907    int test_ret = 0;
3908
3909#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
3910#ifdef LIBXML_SAX1_ENABLED
3911    int mem_base;
3912    void * ctx; /* the user data (XML parser context) */
3913    int n_ctx;
3914    xmlChar * name; /* The element name */
3915    int n_name;
3916
3917    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3918    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3919        mem_base = xmlMemBlocks();
3920        ctx = gen_void_ptr(n_ctx, 0);
3921        name = gen_const_xmlChar_ptr(n_name, 1);
3922
3923        xmlSAX2EndElement(ctx, (const xmlChar *)name);
3924        call_tests++;
3925        des_void_ptr(n_ctx, ctx, 0);
3926        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3927        xmlResetLastError();
3928        if (mem_base != xmlMemBlocks()) {
3929            printf("Leak of %d blocks found in xmlSAX2EndElement",
3930	           xmlMemBlocks() - mem_base);
3931	    test_ret++;
3932            printf(" %d", n_ctx);
3933            printf(" %d", n_name);
3934            printf("\n");
3935        }
3936    }
3937    }
3938    function_tests++;
3939#endif
3940#endif
3941
3942    return(test_ret);
3943}
3944
3945
3946static int
3947test_xmlSAX2EndElementNs(void) {
3948    int test_ret = 0;
3949
3950    int mem_base;
3951    void * ctx; /* the user data (XML parser context) */
3952    int n_ctx;
3953    xmlChar * localname; /* the local name of the element */
3954    int n_localname;
3955    xmlChar * prefix; /* the element namespace prefix if available */
3956    int n_prefix;
3957    xmlChar * URI; /* the element namespace name if available */
3958    int n_URI;
3959
3960    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3961    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
3962    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
3963    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3964        mem_base = xmlMemBlocks();
3965        ctx = gen_void_ptr(n_ctx, 0);
3966        localname = gen_const_xmlChar_ptr(n_localname, 1);
3967        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
3968        URI = gen_const_xmlChar_ptr(n_URI, 3);
3969
3970        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
3971        call_tests++;
3972        des_void_ptr(n_ctx, ctx, 0);
3973        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
3974        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
3975        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
3976        xmlResetLastError();
3977        if (mem_base != xmlMemBlocks()) {
3978            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
3979	           xmlMemBlocks() - mem_base);
3980	    test_ret++;
3981            printf(" %d", n_ctx);
3982            printf(" %d", n_localname);
3983            printf(" %d", n_prefix);
3984            printf(" %d", n_URI);
3985            printf("\n");
3986        }
3987    }
3988    }
3989    }
3990    }
3991    function_tests++;
3992
3993    return(test_ret);
3994}
3995
3996
3997static int
3998test_xmlSAX2EntityDecl(void) {
3999    int test_ret = 0;
4000
4001    int mem_base;
4002    void * ctx; /* the user data (XML parser context) */
4003    int n_ctx;
4004    xmlChar * name; /* the entity name */
4005    int n_name;
4006    int type; /* the entity type */
4007    int n_type;
4008    xmlChar * publicId; /* The public ID of the entity */
4009    int n_publicId;
4010    xmlChar * systemId; /* The system ID of the entity */
4011    int n_systemId;
4012    xmlChar * content; /* the entity value (without processing). */
4013    int n_content;
4014
4015    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4016    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4017    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4018    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4019    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4020    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4021        mem_base = xmlMemBlocks();
4022        ctx = gen_void_ptr(n_ctx, 0);
4023        name = gen_const_xmlChar_ptr(n_name, 1);
4024        type = gen_int(n_type, 2);
4025        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4026        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4027        content = gen_xmlChar_ptr(n_content, 5);
4028
4029        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4030        call_tests++;
4031        des_void_ptr(n_ctx, ctx, 0);
4032        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4033        des_int(n_type, type, 2);
4034        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4035        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4036        des_xmlChar_ptr(n_content, content, 5);
4037        xmlResetLastError();
4038        if (mem_base != xmlMemBlocks()) {
4039            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4040	           xmlMemBlocks() - mem_base);
4041	    test_ret++;
4042            printf(" %d", n_ctx);
4043            printf(" %d", n_name);
4044            printf(" %d", n_type);
4045            printf(" %d", n_publicId);
4046            printf(" %d", n_systemId);
4047            printf(" %d", n_content);
4048            printf("\n");
4049        }
4050    }
4051    }
4052    }
4053    }
4054    }
4055    }
4056    function_tests++;
4057
4058    return(test_ret);
4059}
4060
4061
4062static int
4063test_xmlSAX2ExternalSubset(void) {
4064    int test_ret = 0;
4065
4066    int mem_base;
4067    void * ctx; /* the user data (XML parser context) */
4068    int n_ctx;
4069    xmlChar * name; /* the root element name */
4070    int n_name;
4071    xmlChar * ExternalID; /* the external ID */
4072    int n_ExternalID;
4073    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4074    int n_SystemID;
4075
4076    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4077    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4078    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4079    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4080        mem_base = xmlMemBlocks();
4081        ctx = gen_void_ptr(n_ctx, 0);
4082        name = gen_const_xmlChar_ptr(n_name, 1);
4083        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4084        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4085
4086        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4087        call_tests++;
4088        des_void_ptr(n_ctx, ctx, 0);
4089        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4090        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4091        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4092        xmlResetLastError();
4093        if (mem_base != xmlMemBlocks()) {
4094            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4095	           xmlMemBlocks() - mem_base);
4096	    test_ret++;
4097            printf(" %d", n_ctx);
4098            printf(" %d", n_name);
4099            printf(" %d", n_ExternalID);
4100            printf(" %d", n_SystemID);
4101            printf("\n");
4102        }
4103    }
4104    }
4105    }
4106    }
4107    function_tests++;
4108
4109    return(test_ret);
4110}
4111
4112
4113static int
4114test_xmlSAX2GetColumnNumber(void) {
4115    int test_ret = 0;
4116
4117    int mem_base;
4118    int ret_val;
4119    void * ctx; /* the user data (XML parser context) */
4120    int n_ctx;
4121
4122    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4123        mem_base = xmlMemBlocks();
4124        ctx = gen_void_ptr(n_ctx, 0);
4125
4126        ret_val = xmlSAX2GetColumnNumber(ctx);
4127        desret_int(ret_val);
4128        call_tests++;
4129        des_void_ptr(n_ctx, ctx, 0);
4130        xmlResetLastError();
4131        if (mem_base != xmlMemBlocks()) {
4132            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4133	           xmlMemBlocks() - mem_base);
4134	    test_ret++;
4135            printf(" %d", n_ctx);
4136            printf("\n");
4137        }
4138    }
4139    function_tests++;
4140
4141    return(test_ret);
4142}
4143
4144
4145static int
4146test_xmlSAX2GetEntity(void) {
4147    int test_ret = 0;
4148
4149    int mem_base;
4150    xmlEntityPtr ret_val;
4151    void * ctx; /* the user data (XML parser context) */
4152    int n_ctx;
4153    xmlChar * name; /* The entity name */
4154    int n_name;
4155
4156    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4157    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4158        mem_base = xmlMemBlocks();
4159        ctx = gen_void_ptr(n_ctx, 0);
4160        name = gen_const_xmlChar_ptr(n_name, 1);
4161
4162        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4163        desret_xmlEntityPtr(ret_val);
4164        call_tests++;
4165        des_void_ptr(n_ctx, ctx, 0);
4166        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4167        xmlResetLastError();
4168        if (mem_base != xmlMemBlocks()) {
4169            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4170	           xmlMemBlocks() - mem_base);
4171	    test_ret++;
4172            printf(" %d", n_ctx);
4173            printf(" %d", n_name);
4174            printf("\n");
4175        }
4176    }
4177    }
4178    function_tests++;
4179
4180    return(test_ret);
4181}
4182
4183
4184static int
4185test_xmlSAX2GetLineNumber(void) {
4186    int test_ret = 0;
4187
4188    int mem_base;
4189    int ret_val;
4190    void * ctx; /* the user data (XML parser context) */
4191    int n_ctx;
4192
4193    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4194        mem_base = xmlMemBlocks();
4195        ctx = gen_void_ptr(n_ctx, 0);
4196
4197        ret_val = xmlSAX2GetLineNumber(ctx);
4198        desret_int(ret_val);
4199        call_tests++;
4200        des_void_ptr(n_ctx, ctx, 0);
4201        xmlResetLastError();
4202        if (mem_base != xmlMemBlocks()) {
4203            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4204	           xmlMemBlocks() - mem_base);
4205	    test_ret++;
4206            printf(" %d", n_ctx);
4207            printf("\n");
4208        }
4209    }
4210    function_tests++;
4211
4212    return(test_ret);
4213}
4214
4215
4216static int
4217test_xmlSAX2GetParameterEntity(void) {
4218    int test_ret = 0;
4219
4220    int mem_base;
4221    xmlEntityPtr ret_val;
4222    void * ctx; /* the user data (XML parser context) */
4223    int n_ctx;
4224    xmlChar * name; /* The entity name */
4225    int n_name;
4226
4227    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4228    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4229        mem_base = xmlMemBlocks();
4230        ctx = gen_void_ptr(n_ctx, 0);
4231        name = gen_const_xmlChar_ptr(n_name, 1);
4232
4233        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4234        desret_xmlEntityPtr(ret_val);
4235        call_tests++;
4236        des_void_ptr(n_ctx, ctx, 0);
4237        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4238        xmlResetLastError();
4239        if (mem_base != xmlMemBlocks()) {
4240            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4241	           xmlMemBlocks() - mem_base);
4242	    test_ret++;
4243            printf(" %d", n_ctx);
4244            printf(" %d", n_name);
4245            printf("\n");
4246        }
4247    }
4248    }
4249    function_tests++;
4250
4251    return(test_ret);
4252}
4253
4254
4255static int
4256test_xmlSAX2GetPublicId(void) {
4257    int test_ret = 0;
4258
4259    int mem_base;
4260    const xmlChar * ret_val;
4261    void * ctx; /* the user data (XML parser context) */
4262    int n_ctx;
4263
4264    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4265        mem_base = xmlMemBlocks();
4266        ctx = gen_void_ptr(n_ctx, 0);
4267
4268        ret_val = xmlSAX2GetPublicId(ctx);
4269        desret_const_xmlChar_ptr(ret_val);
4270        call_tests++;
4271        des_void_ptr(n_ctx, ctx, 0);
4272        xmlResetLastError();
4273        if (mem_base != xmlMemBlocks()) {
4274            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4275	           xmlMemBlocks() - mem_base);
4276	    test_ret++;
4277            printf(" %d", n_ctx);
4278            printf("\n");
4279        }
4280    }
4281    function_tests++;
4282
4283    return(test_ret);
4284}
4285
4286
4287static int
4288test_xmlSAX2GetSystemId(void) {
4289    int test_ret = 0;
4290
4291    int mem_base;
4292    const xmlChar * ret_val;
4293    void * ctx; /* the user data (XML parser context) */
4294    int n_ctx;
4295
4296    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4297        mem_base = xmlMemBlocks();
4298        ctx = gen_void_ptr(n_ctx, 0);
4299
4300        ret_val = xmlSAX2GetSystemId(ctx);
4301        desret_const_xmlChar_ptr(ret_val);
4302        call_tests++;
4303        des_void_ptr(n_ctx, ctx, 0);
4304        xmlResetLastError();
4305        if (mem_base != xmlMemBlocks()) {
4306            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4307	           xmlMemBlocks() - mem_base);
4308	    test_ret++;
4309            printf(" %d", n_ctx);
4310            printf("\n");
4311        }
4312    }
4313    function_tests++;
4314
4315    return(test_ret);
4316}
4317
4318
4319static int
4320test_xmlSAX2HasExternalSubset(void) {
4321    int test_ret = 0;
4322
4323    int mem_base;
4324    int ret_val;
4325    void * ctx; /* the user data (XML parser context) */
4326    int n_ctx;
4327
4328    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4329        mem_base = xmlMemBlocks();
4330        ctx = gen_void_ptr(n_ctx, 0);
4331
4332        ret_val = xmlSAX2HasExternalSubset(ctx);
4333        desret_int(ret_val);
4334        call_tests++;
4335        des_void_ptr(n_ctx, ctx, 0);
4336        xmlResetLastError();
4337        if (mem_base != xmlMemBlocks()) {
4338            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4339	           xmlMemBlocks() - mem_base);
4340	    test_ret++;
4341            printf(" %d", n_ctx);
4342            printf("\n");
4343        }
4344    }
4345    function_tests++;
4346
4347    return(test_ret);
4348}
4349
4350
4351static int
4352test_xmlSAX2HasInternalSubset(void) {
4353    int test_ret = 0;
4354
4355    int mem_base;
4356    int ret_val;
4357    void * ctx; /* the user data (XML parser context) */
4358    int n_ctx;
4359
4360    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4361        mem_base = xmlMemBlocks();
4362        ctx = gen_void_ptr(n_ctx, 0);
4363
4364        ret_val = xmlSAX2HasInternalSubset(ctx);
4365        desret_int(ret_val);
4366        call_tests++;
4367        des_void_ptr(n_ctx, ctx, 0);
4368        xmlResetLastError();
4369        if (mem_base != xmlMemBlocks()) {
4370            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4371	           xmlMemBlocks() - mem_base);
4372	    test_ret++;
4373            printf(" %d", n_ctx);
4374            printf("\n");
4375        }
4376    }
4377    function_tests++;
4378
4379    return(test_ret);
4380}
4381
4382
4383static int
4384test_xmlSAX2IgnorableWhitespace(void) {
4385    int test_ret = 0;
4386
4387    int mem_base;
4388    void * ctx; /* the user data (XML parser context) */
4389    int n_ctx;
4390    xmlChar * ch; /* a xmlChar string */
4391    int n_ch;
4392    int len; /* the number of xmlChar */
4393    int n_len;
4394
4395    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4396    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4397    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4398        mem_base = xmlMemBlocks();
4399        ctx = gen_void_ptr(n_ctx, 0);
4400        ch = gen_const_xmlChar_ptr(n_ch, 1);
4401        len = gen_int(n_len, 2);
4402
4403        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4404        call_tests++;
4405        des_void_ptr(n_ctx, ctx, 0);
4406        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4407        des_int(n_len, len, 2);
4408        xmlResetLastError();
4409        if (mem_base != xmlMemBlocks()) {
4410            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4411	           xmlMemBlocks() - mem_base);
4412	    test_ret++;
4413            printf(" %d", n_ctx);
4414            printf(" %d", n_ch);
4415            printf(" %d", n_len);
4416            printf("\n");
4417        }
4418    }
4419    }
4420    }
4421    function_tests++;
4422
4423    return(test_ret);
4424}
4425
4426
4427#define gen_nb_xmlSAXHandler_ptr 1
4428static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4429    return(NULL);
4430}
4431static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4432}
4433
4434static int
4435test_xmlSAX2InitDefaultSAXHandler(void) {
4436    int test_ret = 0;
4437
4438    int mem_base;
4439    xmlSAXHandler * hdlr; /* the SAX handler */
4440    int n_hdlr;
4441    int warning; /* flag if non-zero sets the handler warning procedure */
4442    int n_warning;
4443
4444    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4445    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4446        mem_base = xmlMemBlocks();
4447        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4448        warning = gen_int(n_warning, 1);
4449
4450        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4451        call_tests++;
4452        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4453        des_int(n_warning, warning, 1);
4454        xmlResetLastError();
4455        if (mem_base != xmlMemBlocks()) {
4456            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4457	           xmlMemBlocks() - mem_base);
4458	    test_ret++;
4459            printf(" %d", n_hdlr);
4460            printf(" %d", n_warning);
4461            printf("\n");
4462        }
4463    }
4464    }
4465    function_tests++;
4466
4467    return(test_ret);
4468}
4469
4470
4471static int
4472test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4473    int test_ret = 0;
4474
4475#if defined(LIBXML_DOCB_ENABLED)
4476    int mem_base;
4477    xmlSAXHandler * hdlr; /* the SAX handler */
4478    int n_hdlr;
4479
4480    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4481        mem_base = xmlMemBlocks();
4482        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4483
4484        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4485        call_tests++;
4486        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4487        xmlResetLastError();
4488        if (mem_base != xmlMemBlocks()) {
4489            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4490	           xmlMemBlocks() - mem_base);
4491	    test_ret++;
4492            printf(" %d", n_hdlr);
4493            printf("\n");
4494        }
4495    }
4496    function_tests++;
4497#endif
4498
4499    return(test_ret);
4500}
4501
4502
4503static int
4504test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4505    int test_ret = 0;
4506
4507#if defined(LIBXML_HTML_ENABLED)
4508    int mem_base;
4509    xmlSAXHandler * hdlr; /* the SAX handler */
4510    int n_hdlr;
4511
4512    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4513        mem_base = xmlMemBlocks();
4514        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4515
4516        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4517        call_tests++;
4518        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4519        xmlResetLastError();
4520        if (mem_base != xmlMemBlocks()) {
4521            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4522	           xmlMemBlocks() - mem_base);
4523	    test_ret++;
4524            printf(" %d", n_hdlr);
4525            printf("\n");
4526        }
4527    }
4528    function_tests++;
4529#endif
4530
4531    return(test_ret);
4532}
4533
4534
4535static int
4536test_xmlSAX2InternalSubset(void) {
4537    int test_ret = 0;
4538
4539    int mem_base;
4540    void * ctx; /* the user data (XML parser context) */
4541    int n_ctx;
4542    xmlChar * name; /* the root element name */
4543    int n_name;
4544    xmlChar * ExternalID; /* the external ID */
4545    int n_ExternalID;
4546    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4547    int n_SystemID;
4548
4549    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4550    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4551    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4552    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4553        mem_base = xmlMemBlocks();
4554        ctx = gen_void_ptr(n_ctx, 0);
4555        name = gen_const_xmlChar_ptr(n_name, 1);
4556        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4557        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4558
4559        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4560        call_tests++;
4561        des_void_ptr(n_ctx, ctx, 0);
4562        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4563        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4564        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4565        xmlResetLastError();
4566        if (mem_base != xmlMemBlocks()) {
4567            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4568	           xmlMemBlocks() - mem_base);
4569	    test_ret++;
4570            printf(" %d", n_ctx);
4571            printf(" %d", n_name);
4572            printf(" %d", n_ExternalID);
4573            printf(" %d", n_SystemID);
4574            printf("\n");
4575        }
4576    }
4577    }
4578    }
4579    }
4580    function_tests++;
4581
4582    return(test_ret);
4583}
4584
4585
4586static int
4587test_xmlSAX2IsStandalone(void) {
4588    int test_ret = 0;
4589
4590    int mem_base;
4591    int ret_val;
4592    void * ctx; /* the user data (XML parser context) */
4593    int n_ctx;
4594
4595    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4596        mem_base = xmlMemBlocks();
4597        ctx = gen_void_ptr(n_ctx, 0);
4598
4599        ret_val = xmlSAX2IsStandalone(ctx);
4600        desret_int(ret_val);
4601        call_tests++;
4602        des_void_ptr(n_ctx, ctx, 0);
4603        xmlResetLastError();
4604        if (mem_base != xmlMemBlocks()) {
4605            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4606	           xmlMemBlocks() - mem_base);
4607	    test_ret++;
4608            printf(" %d", n_ctx);
4609            printf("\n");
4610        }
4611    }
4612    function_tests++;
4613
4614    return(test_ret);
4615}
4616
4617
4618static int
4619test_xmlSAX2NotationDecl(void) {
4620    int test_ret = 0;
4621
4622    int mem_base;
4623    void * ctx; /* the user data (XML parser context) */
4624    int n_ctx;
4625    xmlChar * name; /* The name of the notation */
4626    int n_name;
4627    xmlChar * publicId; /* The public ID of the entity */
4628    int n_publicId;
4629    xmlChar * systemId; /* The system ID of the entity */
4630    int n_systemId;
4631
4632    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4633    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4634    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4635    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4636        mem_base = xmlMemBlocks();
4637        ctx = gen_void_ptr(n_ctx, 0);
4638        name = gen_const_xmlChar_ptr(n_name, 1);
4639        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4640        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4641
4642        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4643        call_tests++;
4644        des_void_ptr(n_ctx, ctx, 0);
4645        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4646        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4647        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4648        xmlResetLastError();
4649        if (mem_base != xmlMemBlocks()) {
4650            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4651	           xmlMemBlocks() - mem_base);
4652	    test_ret++;
4653            printf(" %d", n_ctx);
4654            printf(" %d", n_name);
4655            printf(" %d", n_publicId);
4656            printf(" %d", n_systemId);
4657            printf("\n");
4658        }
4659    }
4660    }
4661    }
4662    }
4663    function_tests++;
4664
4665    return(test_ret);
4666}
4667
4668
4669static int
4670test_xmlSAX2ProcessingInstruction(void) {
4671    int test_ret = 0;
4672
4673    int mem_base;
4674    void * ctx; /* the user data (XML parser context) */
4675    int n_ctx;
4676    xmlChar * target; /* the target name */
4677    int n_target;
4678    xmlChar * data; /* the PI data's */
4679    int n_data;
4680
4681    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4682    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4683    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4684        mem_base = xmlMemBlocks();
4685        ctx = gen_void_ptr(n_ctx, 0);
4686        target = gen_const_xmlChar_ptr(n_target, 1);
4687        data = gen_const_xmlChar_ptr(n_data, 2);
4688
4689        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4690        call_tests++;
4691        des_void_ptr(n_ctx, ctx, 0);
4692        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4693        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4694        xmlResetLastError();
4695        if (mem_base != xmlMemBlocks()) {
4696            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4697	           xmlMemBlocks() - mem_base);
4698	    test_ret++;
4699            printf(" %d", n_ctx);
4700            printf(" %d", n_target);
4701            printf(" %d", n_data);
4702            printf("\n");
4703        }
4704    }
4705    }
4706    }
4707    function_tests++;
4708
4709    return(test_ret);
4710}
4711
4712
4713static int
4714test_xmlSAX2Reference(void) {
4715    int test_ret = 0;
4716
4717    int mem_base;
4718    void * ctx; /* the user data (XML parser context) */
4719    int n_ctx;
4720    xmlChar * name; /* The entity name */
4721    int n_name;
4722
4723    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4724    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4725        mem_base = xmlMemBlocks();
4726        ctx = gen_void_ptr(n_ctx, 0);
4727        name = gen_const_xmlChar_ptr(n_name, 1);
4728
4729        xmlSAX2Reference(ctx, (const xmlChar *)name);
4730        call_tests++;
4731        des_void_ptr(n_ctx, ctx, 0);
4732        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4733        xmlResetLastError();
4734        if (mem_base != xmlMemBlocks()) {
4735            printf("Leak of %d blocks found in xmlSAX2Reference",
4736	           xmlMemBlocks() - mem_base);
4737	    test_ret++;
4738            printf(" %d", n_ctx);
4739            printf(" %d", n_name);
4740            printf("\n");
4741        }
4742    }
4743    }
4744    function_tests++;
4745
4746    return(test_ret);
4747}
4748
4749
4750static int
4751test_xmlSAX2ResolveEntity(void) {
4752    int test_ret = 0;
4753
4754    int mem_base;
4755    xmlParserInputPtr ret_val;
4756    void * ctx; /* the user data (XML parser context) */
4757    int n_ctx;
4758    xmlChar * publicId; /* The public ID of the entity */
4759    int n_publicId;
4760    xmlChar * systemId; /* The system ID of the entity */
4761    int n_systemId;
4762
4763    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4764    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4765    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4766        mem_base = xmlMemBlocks();
4767        ctx = gen_void_ptr(n_ctx, 0);
4768        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4769        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4770
4771        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4772        desret_xmlParserInputPtr(ret_val);
4773        call_tests++;
4774        des_void_ptr(n_ctx, ctx, 0);
4775        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4776        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4777        xmlResetLastError();
4778        if (mem_base != xmlMemBlocks()) {
4779            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4780	           xmlMemBlocks() - mem_base);
4781	    test_ret++;
4782            printf(" %d", n_ctx);
4783            printf(" %d", n_publicId);
4784            printf(" %d", n_systemId);
4785            printf("\n");
4786        }
4787    }
4788    }
4789    }
4790    function_tests++;
4791
4792    return(test_ret);
4793}
4794
4795
4796#define gen_nb_xmlSAXLocatorPtr 1
4797static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4798    return(NULL);
4799}
4800static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4801}
4802
4803static int
4804test_xmlSAX2SetDocumentLocator(void) {
4805    int test_ret = 0;
4806
4807    int mem_base;
4808    void * ctx; /* the user data (XML parser context) */
4809    int n_ctx;
4810    xmlSAXLocatorPtr loc; /* A SAX Locator */
4811    int n_loc;
4812
4813    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4814    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4815        mem_base = xmlMemBlocks();
4816        ctx = gen_void_ptr(n_ctx, 0);
4817        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4818
4819        xmlSAX2SetDocumentLocator(ctx, loc);
4820        call_tests++;
4821        des_void_ptr(n_ctx, ctx, 0);
4822        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4823        xmlResetLastError();
4824        if (mem_base != xmlMemBlocks()) {
4825            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4826	           xmlMemBlocks() - mem_base);
4827	    test_ret++;
4828            printf(" %d", n_ctx);
4829            printf(" %d", n_loc);
4830            printf("\n");
4831        }
4832    }
4833    }
4834    function_tests++;
4835
4836    return(test_ret);
4837}
4838
4839
4840static int
4841test_xmlSAX2StartDocument(void) {
4842    int test_ret = 0;
4843
4844    int mem_base;
4845    void * ctx; /* the user data (XML parser context) */
4846    int n_ctx;
4847
4848    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4849        mem_base = xmlMemBlocks();
4850        ctx = gen_void_ptr(n_ctx, 0);
4851
4852        xmlSAX2StartDocument(ctx);
4853        call_tests++;
4854        des_void_ptr(n_ctx, ctx, 0);
4855        xmlResetLastError();
4856        if (mem_base != xmlMemBlocks()) {
4857            printf("Leak of %d blocks found in xmlSAX2StartDocument",
4858	           xmlMemBlocks() - mem_base);
4859	    test_ret++;
4860            printf(" %d", n_ctx);
4861            printf("\n");
4862        }
4863    }
4864    function_tests++;
4865
4866    return(test_ret);
4867}
4868
4869
4870static int
4871test_xmlSAX2StartElement(void) {
4872    int test_ret = 0;
4873
4874#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
4875#ifdef LIBXML_SAX1_ENABLED
4876    int mem_base;
4877    void * ctx; /* the user data (XML parser context) */
4878    int n_ctx;
4879    xmlChar * fullname; /* The element name, including namespace prefix */
4880    int n_fullname;
4881    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
4882    int n_atts;
4883
4884    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4885    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
4886    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
4887        mem_base = xmlMemBlocks();
4888        ctx = gen_void_ptr(n_ctx, 0);
4889        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
4890        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
4891
4892        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
4893        call_tests++;
4894        des_void_ptr(n_ctx, ctx, 0);
4895        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
4896        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
4897        xmlResetLastError();
4898        if (mem_base != xmlMemBlocks()) {
4899            printf("Leak of %d blocks found in xmlSAX2StartElement",
4900	           xmlMemBlocks() - mem_base);
4901	    test_ret++;
4902            printf(" %d", n_ctx);
4903            printf(" %d", n_fullname);
4904            printf(" %d", n_atts);
4905            printf("\n");
4906        }
4907    }
4908    }
4909    }
4910    function_tests++;
4911#endif
4912#endif
4913
4914    return(test_ret);
4915}
4916
4917
4918static int
4919test_xmlSAX2StartElementNs(void) {
4920    int test_ret = 0;
4921
4922    int mem_base;
4923    void * ctx; /* the user data (XML parser context) */
4924    int n_ctx;
4925    xmlChar * localname; /* the local name of the element */
4926    int n_localname;
4927    xmlChar * prefix; /* the element namespace prefix if available */
4928    int n_prefix;
4929    xmlChar * URI; /* the element namespace name if available */
4930    int n_URI;
4931    int nb_namespaces; /* number of namespace definitions on that node */
4932    int n_nb_namespaces;
4933    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
4934    int n_namespaces;
4935    int nb_attributes; /* the number of attributes on that node */
4936    int n_nb_attributes;
4937    int nb_defaulted; /* the number of defaulted attributes. */
4938    int n_nb_defaulted;
4939    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
4940    int n_attributes;
4941
4942    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4943    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4944    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4945    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4946    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
4947    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
4948    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
4949    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
4950    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
4951        mem_base = xmlMemBlocks();
4952        ctx = gen_void_ptr(n_ctx, 0);
4953        localname = gen_const_xmlChar_ptr(n_localname, 1);
4954        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4955        URI = gen_const_xmlChar_ptr(n_URI, 3);
4956        nb_namespaces = gen_int(n_nb_namespaces, 4);
4957        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
4958        nb_attributes = gen_int(n_nb_attributes, 6);
4959        nb_defaulted = gen_int(n_nb_defaulted, 7);
4960        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
4961
4962        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
4963        call_tests++;
4964        des_void_ptr(n_ctx, ctx, 0);
4965        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4966        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4967        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4968        des_int(n_nb_namespaces, nb_namespaces, 4);
4969        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
4970        des_int(n_nb_attributes, nb_attributes, 6);
4971        des_int(n_nb_defaulted, nb_defaulted, 7);
4972        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
4973        xmlResetLastError();
4974        if (mem_base != xmlMemBlocks()) {
4975            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
4976	           xmlMemBlocks() - mem_base);
4977	    test_ret++;
4978            printf(" %d", n_ctx);
4979            printf(" %d", n_localname);
4980            printf(" %d", n_prefix);
4981            printf(" %d", n_URI);
4982            printf(" %d", n_nb_namespaces);
4983            printf(" %d", n_namespaces);
4984            printf(" %d", n_nb_attributes);
4985            printf(" %d", n_nb_defaulted);
4986            printf(" %d", n_attributes);
4987            printf("\n");
4988        }
4989    }
4990    }
4991    }
4992    }
4993    }
4994    }
4995    }
4996    }
4997    }
4998    function_tests++;
4999
5000    return(test_ret);
5001}
5002
5003
5004static int
5005test_xmlSAX2UnparsedEntityDecl(void) {
5006    int test_ret = 0;
5007
5008    int mem_base;
5009    void * ctx; /* the user data (XML parser context) */
5010    int n_ctx;
5011    xmlChar * name; /* The name of the entity */
5012    int n_name;
5013    xmlChar * publicId; /* The public ID of the entity */
5014    int n_publicId;
5015    xmlChar * systemId; /* The system ID of the entity */
5016    int n_systemId;
5017    xmlChar * notationName; /* the name of the notation */
5018    int n_notationName;
5019
5020    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5021    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5022    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5023    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5024    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5025        mem_base = xmlMemBlocks();
5026        ctx = gen_void_ptr(n_ctx, 0);
5027        name = gen_const_xmlChar_ptr(n_name, 1);
5028        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5029        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5030        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5031
5032        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5033        call_tests++;
5034        des_void_ptr(n_ctx, ctx, 0);
5035        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5036        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5037        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5038        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5039        xmlResetLastError();
5040        if (mem_base != xmlMemBlocks()) {
5041            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5042	           xmlMemBlocks() - mem_base);
5043	    test_ret++;
5044            printf(" %d", n_ctx);
5045            printf(" %d", n_name);
5046            printf(" %d", n_publicId);
5047            printf(" %d", n_systemId);
5048            printf(" %d", n_notationName);
5049            printf("\n");
5050        }
5051    }
5052    }
5053    }
5054    }
5055    }
5056    function_tests++;
5057
5058    return(test_ret);
5059}
5060
5061
5062static int
5063test_xmlSAXDefaultVersion(void) {
5064    int test_ret = 0;
5065
5066#if defined(LIBXML_SAX1_ENABLED)
5067#ifdef LIBXML_SAX1_ENABLED
5068    int mem_base;
5069    int ret_val;
5070    int version; /* the version, 1 or 2 */
5071    int n_version;
5072
5073    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5074        mem_base = xmlMemBlocks();
5075        version = gen_int(n_version, 0);
5076
5077        ret_val = xmlSAXDefaultVersion(version);
5078        desret_int(ret_val);
5079        call_tests++;
5080        des_int(n_version, version, 0);
5081        xmlResetLastError();
5082        if (mem_base != xmlMemBlocks()) {
5083            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5084	           xmlMemBlocks() - mem_base);
5085	    test_ret++;
5086            printf(" %d", n_version);
5087            printf("\n");
5088        }
5089    }
5090    function_tests++;
5091#endif
5092#endif
5093
5094    return(test_ret);
5095}
5096
5097
5098static int
5099test_xmlSAXVersion(void) {
5100    int test_ret = 0;
5101
5102    int mem_base;
5103    int ret_val;
5104    xmlSAXHandler * hdlr; /* the SAX handler */
5105    int n_hdlr;
5106    int version; /* the version, 1 or 2 */
5107    int n_version;
5108
5109    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5110    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5111        mem_base = xmlMemBlocks();
5112        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5113        version = gen_int(n_version, 1);
5114
5115        ret_val = xmlSAXVersion(hdlr, version);
5116        desret_int(ret_val);
5117        call_tests++;
5118        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5119        des_int(n_version, version, 1);
5120        xmlResetLastError();
5121        if (mem_base != xmlMemBlocks()) {
5122            printf("Leak of %d blocks found in xmlSAXVersion",
5123	           xmlMemBlocks() - mem_base);
5124	    test_ret++;
5125            printf(" %d", n_hdlr);
5126            printf(" %d", n_version);
5127            printf("\n");
5128        }
5129    }
5130    }
5131    function_tests++;
5132
5133    return(test_ret);
5134}
5135
5136static int
5137test_SAX2(void) {
5138    int test_ret = 0;
5139
5140    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5141    test_ret += test_docbDefaultSAXHandlerInit();
5142    test_ret += test_htmlDefaultSAXHandlerInit();
5143    test_ret += test_xmlDefaultSAXHandlerInit();
5144    test_ret += test_xmlSAX2AttributeDecl();
5145    test_ret += test_xmlSAX2CDataBlock();
5146    test_ret += test_xmlSAX2Characters();
5147    test_ret += test_xmlSAX2Comment();
5148    test_ret += test_xmlSAX2ElementDecl();
5149    test_ret += test_xmlSAX2EndDocument();
5150    test_ret += test_xmlSAX2EndElement();
5151    test_ret += test_xmlSAX2EndElementNs();
5152    test_ret += test_xmlSAX2EntityDecl();
5153    test_ret += test_xmlSAX2ExternalSubset();
5154    test_ret += test_xmlSAX2GetColumnNumber();
5155    test_ret += test_xmlSAX2GetEntity();
5156    test_ret += test_xmlSAX2GetLineNumber();
5157    test_ret += test_xmlSAX2GetParameterEntity();
5158    test_ret += test_xmlSAX2GetPublicId();
5159    test_ret += test_xmlSAX2GetSystemId();
5160    test_ret += test_xmlSAX2HasExternalSubset();
5161    test_ret += test_xmlSAX2HasInternalSubset();
5162    test_ret += test_xmlSAX2IgnorableWhitespace();
5163    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5164    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5165    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5166    test_ret += test_xmlSAX2InternalSubset();
5167    test_ret += test_xmlSAX2IsStandalone();
5168    test_ret += test_xmlSAX2NotationDecl();
5169    test_ret += test_xmlSAX2ProcessingInstruction();
5170    test_ret += test_xmlSAX2Reference();
5171    test_ret += test_xmlSAX2ResolveEntity();
5172    test_ret += test_xmlSAX2SetDocumentLocator();
5173    test_ret += test_xmlSAX2StartDocument();
5174    test_ret += test_xmlSAX2StartElement();
5175    test_ret += test_xmlSAX2StartElementNs();
5176    test_ret += test_xmlSAX2UnparsedEntityDecl();
5177    test_ret += test_xmlSAXDefaultVersion();
5178    test_ret += test_xmlSAXVersion();
5179
5180    if (test_ret != 0)
5181	printf("Module SAX2: %d errors\n", test_ret);
5182    return(test_ret);
5183}
5184
5185static int
5186test_xmlC14NDocDumpMemory(void) {
5187    int test_ret = 0;
5188
5189#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5190    int mem_base;
5191    int ret_val;
5192    xmlDocPtr doc; /* the XML document for canonization */
5193    int n_doc;
5194    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5195    int n_nodes;
5196    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5197    int n_exclusive;
5198    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) */
5199    int n_inclusive_ns_prefixes;
5200    int with_comments; /* include comments in the result (!=0) or not (==0) */
5201    int n_with_comments;
5202    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 */
5203    int n_doc_txt_ptr;
5204
5205    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5206    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5207    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5208    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5209    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5210    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5211        mem_base = xmlMemBlocks();
5212        doc = gen_xmlDocPtr(n_doc, 0);
5213        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5214        exclusive = gen_int(n_exclusive, 2);
5215        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5216        with_comments = gen_int(n_with_comments, 4);
5217        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5218
5219        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5220        desret_int(ret_val);
5221        call_tests++;
5222        des_xmlDocPtr(n_doc, doc, 0);
5223        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5224        des_int(n_exclusive, exclusive, 2);
5225        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5226        des_int(n_with_comments, with_comments, 4);
5227        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5228        xmlResetLastError();
5229        if (mem_base != xmlMemBlocks()) {
5230            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5231	           xmlMemBlocks() - mem_base);
5232	    test_ret++;
5233            printf(" %d", n_doc);
5234            printf(" %d", n_nodes);
5235            printf(" %d", n_exclusive);
5236            printf(" %d", n_inclusive_ns_prefixes);
5237            printf(" %d", n_with_comments);
5238            printf(" %d", n_doc_txt_ptr);
5239            printf("\n");
5240        }
5241    }
5242    }
5243    }
5244    }
5245    }
5246    }
5247    function_tests++;
5248#endif
5249
5250    return(test_ret);
5251}
5252
5253
5254static int
5255test_xmlC14NDocSave(void) {
5256    int test_ret = 0;
5257
5258#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5259    int mem_base;
5260    int ret_val;
5261    xmlDocPtr doc; /* the XML document for canonization */
5262    int n_doc;
5263    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5264    int n_nodes;
5265    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5266    int n_exclusive;
5267    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) */
5268    int n_inclusive_ns_prefixes;
5269    int with_comments; /* include comments in the result (!=0) or not (==0) */
5270    int n_with_comments;
5271    const char * filename; /* the filename to store canonical XML image */
5272    int n_filename;
5273    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5274    int n_compression;
5275
5276    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5277    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5278    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5279    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5280    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5281    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5282    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5283        mem_base = xmlMemBlocks();
5284        doc = gen_xmlDocPtr(n_doc, 0);
5285        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5286        exclusive = gen_int(n_exclusive, 2);
5287        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5288        with_comments = gen_int(n_with_comments, 4);
5289        filename = gen_fileoutput(n_filename, 5);
5290        compression = gen_int(n_compression, 6);
5291
5292        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5293        desret_int(ret_val);
5294        call_tests++;
5295        des_xmlDocPtr(n_doc, doc, 0);
5296        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5297        des_int(n_exclusive, exclusive, 2);
5298        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5299        des_int(n_with_comments, with_comments, 4);
5300        des_fileoutput(n_filename, filename, 5);
5301        des_int(n_compression, compression, 6);
5302        xmlResetLastError();
5303        if (mem_base != xmlMemBlocks()) {
5304            printf("Leak of %d blocks found in xmlC14NDocSave",
5305	           xmlMemBlocks() - mem_base);
5306	    test_ret++;
5307            printf(" %d", n_doc);
5308            printf(" %d", n_nodes);
5309            printf(" %d", n_exclusive);
5310            printf(" %d", n_inclusive_ns_prefixes);
5311            printf(" %d", n_with_comments);
5312            printf(" %d", n_filename);
5313            printf(" %d", n_compression);
5314            printf("\n");
5315        }
5316    }
5317    }
5318    }
5319    }
5320    }
5321    }
5322    }
5323    function_tests++;
5324#endif
5325
5326    return(test_ret);
5327}
5328
5329
5330static int
5331test_xmlC14NDocSaveTo(void) {
5332    int test_ret = 0;
5333
5334#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5335    int mem_base;
5336    int ret_val;
5337    xmlDocPtr doc; /* the XML document for canonization */
5338    int n_doc;
5339    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5340    int n_nodes;
5341    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5342    int n_exclusive;
5343    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) */
5344    int n_inclusive_ns_prefixes;
5345    int with_comments; /* include comments in the result (!=0) or not (==0) */
5346    int n_with_comments;
5347    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5348    int n_buf;
5349
5350    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5351    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5352    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5353    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5354    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5355    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5356        mem_base = xmlMemBlocks();
5357        doc = gen_xmlDocPtr(n_doc, 0);
5358        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5359        exclusive = gen_int(n_exclusive, 2);
5360        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5361        with_comments = gen_int(n_with_comments, 4);
5362        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5363
5364        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5365        desret_int(ret_val);
5366        call_tests++;
5367        des_xmlDocPtr(n_doc, doc, 0);
5368        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5369        des_int(n_exclusive, exclusive, 2);
5370        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5371        des_int(n_with_comments, with_comments, 4);
5372        des_xmlOutputBufferPtr(n_buf, buf, 5);
5373        xmlResetLastError();
5374        if (mem_base != xmlMemBlocks()) {
5375            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5376	           xmlMemBlocks() - mem_base);
5377	    test_ret++;
5378            printf(" %d", n_doc);
5379            printf(" %d", n_nodes);
5380            printf(" %d", n_exclusive);
5381            printf(" %d", n_inclusive_ns_prefixes);
5382            printf(" %d", n_with_comments);
5383            printf(" %d", n_buf);
5384            printf("\n");
5385        }
5386    }
5387    }
5388    }
5389    }
5390    }
5391    }
5392    function_tests++;
5393#endif
5394
5395    return(test_ret);
5396}
5397
5398
5399static int
5400test_xmlC14NExecute(void) {
5401    int test_ret = 0;
5402
5403
5404    /* missing type support */
5405    return(test_ret);
5406}
5407
5408static int
5409test_c14n(void) {
5410    int test_ret = 0;
5411
5412    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5413    test_ret += test_xmlC14NDocDumpMemory();
5414    test_ret += test_xmlC14NDocSave();
5415    test_ret += test_xmlC14NDocSaveTo();
5416    test_ret += test_xmlC14NExecute();
5417
5418    if (test_ret != 0)
5419	printf("Module c14n: %d errors\n", test_ret);
5420    return(test_ret);
5421}
5422#ifdef LIBXML_CATALOG_ENABLED
5423
5424#define gen_nb_xmlCatalogPtr 1
5425static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5426    return(NULL);
5427}
5428static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5429}
5430#endif
5431
5432
5433static int
5434test_xmlACatalogAdd(void) {
5435    int test_ret = 0;
5436
5437#if defined(LIBXML_CATALOG_ENABLED)
5438    int mem_base;
5439    int ret_val;
5440    xmlCatalogPtr catal; /* a Catalog */
5441    int n_catal;
5442    xmlChar * type; /* the type of record to add to the catalog */
5443    int n_type;
5444    xmlChar * orig; /* the system, public or prefix to match */
5445    int n_orig;
5446    xmlChar * replace; /* the replacement value for the match */
5447    int n_replace;
5448
5449    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5450    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5451    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5452    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5453        mem_base = xmlMemBlocks();
5454        catal = gen_xmlCatalogPtr(n_catal, 0);
5455        type = gen_const_xmlChar_ptr(n_type, 1);
5456        orig = gen_const_xmlChar_ptr(n_orig, 2);
5457        replace = gen_const_xmlChar_ptr(n_replace, 3);
5458
5459        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5460        desret_int(ret_val);
5461        call_tests++;
5462        des_xmlCatalogPtr(n_catal, catal, 0);
5463        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5464        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5465        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5466        xmlResetLastError();
5467        if (mem_base != xmlMemBlocks()) {
5468            printf("Leak of %d blocks found in xmlACatalogAdd",
5469	           xmlMemBlocks() - mem_base);
5470	    test_ret++;
5471            printf(" %d", n_catal);
5472            printf(" %d", n_type);
5473            printf(" %d", n_orig);
5474            printf(" %d", n_replace);
5475            printf("\n");
5476        }
5477    }
5478    }
5479    }
5480    }
5481    function_tests++;
5482#endif
5483
5484    return(test_ret);
5485}
5486
5487
5488static int
5489test_xmlACatalogDump(void) {
5490    int test_ret = 0;
5491
5492#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5493    int mem_base;
5494    xmlCatalogPtr catal; /* a Catalog */
5495    int n_catal;
5496    FILE * out; /* the file. */
5497    int n_out;
5498
5499    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5500    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5501        mem_base = xmlMemBlocks();
5502        catal = gen_xmlCatalogPtr(n_catal, 0);
5503        out = gen_FILE_ptr(n_out, 1);
5504
5505        xmlACatalogDump(catal, out);
5506        call_tests++;
5507        des_xmlCatalogPtr(n_catal, catal, 0);
5508        des_FILE_ptr(n_out, out, 1);
5509        xmlResetLastError();
5510        if (mem_base != xmlMemBlocks()) {
5511            printf("Leak of %d blocks found in xmlACatalogDump",
5512	           xmlMemBlocks() - mem_base);
5513	    test_ret++;
5514            printf(" %d", n_catal);
5515            printf(" %d", n_out);
5516            printf("\n");
5517        }
5518    }
5519    }
5520    function_tests++;
5521#endif
5522
5523    return(test_ret);
5524}
5525
5526
5527static int
5528test_xmlACatalogRemove(void) {
5529    int test_ret = 0;
5530
5531#if defined(LIBXML_CATALOG_ENABLED)
5532    int mem_base;
5533    int ret_val;
5534    xmlCatalogPtr catal; /* a Catalog */
5535    int n_catal;
5536    xmlChar * value; /* the value to remove */
5537    int n_value;
5538
5539    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5540    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5541        mem_base = xmlMemBlocks();
5542        catal = gen_xmlCatalogPtr(n_catal, 0);
5543        value = gen_const_xmlChar_ptr(n_value, 1);
5544
5545        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5546        desret_int(ret_val);
5547        call_tests++;
5548        des_xmlCatalogPtr(n_catal, catal, 0);
5549        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5550        xmlResetLastError();
5551        if (mem_base != xmlMemBlocks()) {
5552            printf("Leak of %d blocks found in xmlACatalogRemove",
5553	           xmlMemBlocks() - mem_base);
5554	    test_ret++;
5555            printf(" %d", n_catal);
5556            printf(" %d", n_value);
5557            printf("\n");
5558        }
5559    }
5560    }
5561    function_tests++;
5562#endif
5563
5564    return(test_ret);
5565}
5566
5567
5568static int
5569test_xmlACatalogResolve(void) {
5570    int test_ret = 0;
5571
5572#if defined(LIBXML_CATALOG_ENABLED)
5573    int mem_base;
5574    xmlChar * ret_val;
5575    xmlCatalogPtr catal; /* a Catalog */
5576    int n_catal;
5577    xmlChar * pubID; /* the public ID string */
5578    int n_pubID;
5579    xmlChar * sysID; /* the system ID string */
5580    int n_sysID;
5581
5582    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5583    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5584    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5585        mem_base = xmlMemBlocks();
5586        catal = gen_xmlCatalogPtr(n_catal, 0);
5587        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5588        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5589
5590        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5591        desret_xmlChar_ptr(ret_val);
5592        call_tests++;
5593        des_xmlCatalogPtr(n_catal, catal, 0);
5594        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5595        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5596        xmlResetLastError();
5597        if (mem_base != xmlMemBlocks()) {
5598            printf("Leak of %d blocks found in xmlACatalogResolve",
5599	           xmlMemBlocks() - mem_base);
5600	    test_ret++;
5601            printf(" %d", n_catal);
5602            printf(" %d", n_pubID);
5603            printf(" %d", n_sysID);
5604            printf("\n");
5605        }
5606    }
5607    }
5608    }
5609    function_tests++;
5610#endif
5611
5612    return(test_ret);
5613}
5614
5615
5616static int
5617test_xmlACatalogResolvePublic(void) {
5618    int test_ret = 0;
5619
5620#if defined(LIBXML_CATALOG_ENABLED)
5621    int mem_base;
5622    xmlChar * ret_val;
5623    xmlCatalogPtr catal; /* a Catalog */
5624    int n_catal;
5625    xmlChar * pubID; /* the public ID string */
5626    int n_pubID;
5627
5628    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5629    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5630        mem_base = xmlMemBlocks();
5631        catal = gen_xmlCatalogPtr(n_catal, 0);
5632        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5633
5634        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5635        desret_xmlChar_ptr(ret_val);
5636        call_tests++;
5637        des_xmlCatalogPtr(n_catal, catal, 0);
5638        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5639        xmlResetLastError();
5640        if (mem_base != xmlMemBlocks()) {
5641            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5642	           xmlMemBlocks() - mem_base);
5643	    test_ret++;
5644            printf(" %d", n_catal);
5645            printf(" %d", n_pubID);
5646            printf("\n");
5647        }
5648    }
5649    }
5650    function_tests++;
5651#endif
5652
5653    return(test_ret);
5654}
5655
5656
5657static int
5658test_xmlACatalogResolveSystem(void) {
5659    int test_ret = 0;
5660
5661#if defined(LIBXML_CATALOG_ENABLED)
5662    int mem_base;
5663    xmlChar * ret_val;
5664    xmlCatalogPtr catal; /* a Catalog */
5665    int n_catal;
5666    xmlChar * sysID; /* the system ID string */
5667    int n_sysID;
5668
5669    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5670    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5671        mem_base = xmlMemBlocks();
5672        catal = gen_xmlCatalogPtr(n_catal, 0);
5673        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5674
5675        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5676        desret_xmlChar_ptr(ret_val);
5677        call_tests++;
5678        des_xmlCatalogPtr(n_catal, catal, 0);
5679        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5680        xmlResetLastError();
5681        if (mem_base != xmlMemBlocks()) {
5682            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5683	           xmlMemBlocks() - mem_base);
5684	    test_ret++;
5685            printf(" %d", n_catal);
5686            printf(" %d", n_sysID);
5687            printf("\n");
5688        }
5689    }
5690    }
5691    function_tests++;
5692#endif
5693
5694    return(test_ret);
5695}
5696
5697
5698static int
5699test_xmlACatalogResolveURI(void) {
5700    int test_ret = 0;
5701
5702#if defined(LIBXML_CATALOG_ENABLED)
5703    int mem_base;
5704    xmlChar * ret_val;
5705    xmlCatalogPtr catal; /* a Catalog */
5706    int n_catal;
5707    xmlChar * URI; /* the URI */
5708    int n_URI;
5709
5710    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5711    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5712        mem_base = xmlMemBlocks();
5713        catal = gen_xmlCatalogPtr(n_catal, 0);
5714        URI = gen_const_xmlChar_ptr(n_URI, 1);
5715
5716        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5717        desret_xmlChar_ptr(ret_val);
5718        call_tests++;
5719        des_xmlCatalogPtr(n_catal, catal, 0);
5720        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5721        xmlResetLastError();
5722        if (mem_base != xmlMemBlocks()) {
5723            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5724	           xmlMemBlocks() - mem_base);
5725	    test_ret++;
5726            printf(" %d", n_catal);
5727            printf(" %d", n_URI);
5728            printf("\n");
5729        }
5730    }
5731    }
5732    function_tests++;
5733#endif
5734
5735    return(test_ret);
5736}
5737
5738
5739static int
5740test_xmlCatalogAdd(void) {
5741    int test_ret = 0;
5742
5743#if defined(LIBXML_CATALOG_ENABLED)
5744    int mem_base;
5745    int ret_val;
5746    xmlChar * type; /* the type of record to add to the catalog */
5747    int n_type;
5748    xmlChar * orig; /* the system, public or prefix to match */
5749    int n_orig;
5750    xmlChar * replace; /* the replacement value for the match */
5751    int n_replace;
5752
5753    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5754    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5755    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5756        mem_base = xmlMemBlocks();
5757        type = gen_const_xmlChar_ptr(n_type, 0);
5758        orig = gen_const_xmlChar_ptr(n_orig, 1);
5759        replace = gen_const_xmlChar_ptr(n_replace, 2);
5760
5761        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5762        desret_int(ret_val);
5763        call_tests++;
5764        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5765        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5766        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5767        xmlResetLastError();
5768        if (mem_base != xmlMemBlocks()) {
5769            printf("Leak of %d blocks found in xmlCatalogAdd",
5770	           xmlMemBlocks() - mem_base);
5771	    test_ret++;
5772            printf(" %d", n_type);
5773            printf(" %d", n_orig);
5774            printf(" %d", n_replace);
5775            printf("\n");
5776        }
5777    }
5778    }
5779    }
5780    function_tests++;
5781#endif
5782
5783    return(test_ret);
5784}
5785
5786
5787static int
5788test_xmlCatalogCleanup(void) {
5789    int test_ret = 0;
5790
5791#if defined(LIBXML_CATALOG_ENABLED)
5792
5793
5794        xmlCatalogCleanup();
5795        call_tests++;
5796        xmlResetLastError();
5797    function_tests++;
5798#endif
5799
5800    return(test_ret);
5801}
5802
5803
5804static int
5805test_xmlCatalogConvert(void) {
5806    int test_ret = 0;
5807
5808#if defined(LIBXML_CATALOG_ENABLED)
5809    int ret_val;
5810
5811
5812        ret_val = xmlCatalogConvert();
5813        desret_int(ret_val);
5814        call_tests++;
5815        xmlResetLastError();
5816    function_tests++;
5817#endif
5818
5819    return(test_ret);
5820}
5821
5822
5823static int
5824test_xmlCatalogDump(void) {
5825    int test_ret = 0;
5826
5827#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5828    int mem_base;
5829    FILE * out; /* the file. */
5830    int n_out;
5831
5832    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5833        mem_base = xmlMemBlocks();
5834        out = gen_FILE_ptr(n_out, 0);
5835
5836        xmlCatalogDump(out);
5837        call_tests++;
5838        des_FILE_ptr(n_out, out, 0);
5839        xmlResetLastError();
5840        if (mem_base != xmlMemBlocks()) {
5841            printf("Leak of %d blocks found in xmlCatalogDump",
5842	           xmlMemBlocks() - mem_base);
5843	    test_ret++;
5844            printf(" %d", n_out);
5845            printf("\n");
5846        }
5847    }
5848    function_tests++;
5849#endif
5850
5851    return(test_ret);
5852}
5853
5854
5855static int
5856test_xmlCatalogGetDefaults(void) {
5857    int test_ret = 0;
5858
5859#if defined(LIBXML_CATALOG_ENABLED)
5860    int mem_base;
5861    xmlCatalogAllow ret_val;
5862
5863        mem_base = xmlMemBlocks();
5864
5865        ret_val = xmlCatalogGetDefaults();
5866        desret_xmlCatalogAllow(ret_val);
5867        call_tests++;
5868        xmlResetLastError();
5869        if (mem_base != xmlMemBlocks()) {
5870            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
5871	           xmlMemBlocks() - mem_base);
5872	    test_ret++;
5873            printf("\n");
5874        }
5875    function_tests++;
5876#endif
5877
5878    return(test_ret);
5879}
5880
5881
5882static int
5883test_xmlCatalogIsEmpty(void) {
5884    int test_ret = 0;
5885
5886#if defined(LIBXML_CATALOG_ENABLED)
5887    int mem_base;
5888    int ret_val;
5889    xmlCatalogPtr catal; /* should this create an SGML catalog */
5890    int n_catal;
5891
5892    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5893        mem_base = xmlMemBlocks();
5894        catal = gen_xmlCatalogPtr(n_catal, 0);
5895
5896        ret_val = xmlCatalogIsEmpty(catal);
5897        desret_int(ret_val);
5898        call_tests++;
5899        des_xmlCatalogPtr(n_catal, catal, 0);
5900        xmlResetLastError();
5901        if (mem_base != xmlMemBlocks()) {
5902            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
5903	           xmlMemBlocks() - mem_base);
5904	    test_ret++;
5905            printf(" %d", n_catal);
5906            printf("\n");
5907        }
5908    }
5909    function_tests++;
5910#endif
5911
5912    return(test_ret);
5913}
5914
5915
5916static int
5917test_xmlCatalogLocalResolve(void) {
5918    int test_ret = 0;
5919
5920#if defined(LIBXML_CATALOG_ENABLED)
5921    int mem_base;
5922    xmlChar * ret_val;
5923    void * catalogs; /* a document's list of catalogs */
5924    int n_catalogs;
5925    xmlChar * pubID; /* the public ID string */
5926    int n_pubID;
5927    xmlChar * sysID; /* the system ID string */
5928    int n_sysID;
5929
5930    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5931    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5932    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5933        mem_base = xmlMemBlocks();
5934        catalogs = gen_void_ptr(n_catalogs, 0);
5935        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5936        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5937
5938        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
5939        desret_xmlChar_ptr(ret_val);
5940        call_tests++;
5941        des_void_ptr(n_catalogs, catalogs, 0);
5942        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5943        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5944        xmlResetLastError();
5945        if (mem_base != xmlMemBlocks()) {
5946            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
5947	           xmlMemBlocks() - mem_base);
5948	    test_ret++;
5949            printf(" %d", n_catalogs);
5950            printf(" %d", n_pubID);
5951            printf(" %d", n_sysID);
5952            printf("\n");
5953        }
5954    }
5955    }
5956    }
5957    function_tests++;
5958#endif
5959
5960    return(test_ret);
5961}
5962
5963
5964static int
5965test_xmlCatalogLocalResolveURI(void) {
5966    int test_ret = 0;
5967
5968#if defined(LIBXML_CATALOG_ENABLED)
5969    int mem_base;
5970    xmlChar * ret_val;
5971    void * catalogs; /* a document's list of catalogs */
5972    int n_catalogs;
5973    xmlChar * URI; /* the URI */
5974    int n_URI;
5975
5976    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5977    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5978        mem_base = xmlMemBlocks();
5979        catalogs = gen_void_ptr(n_catalogs, 0);
5980        URI = gen_const_xmlChar_ptr(n_URI, 1);
5981
5982        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
5983        desret_xmlChar_ptr(ret_val);
5984        call_tests++;
5985        des_void_ptr(n_catalogs, catalogs, 0);
5986        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5987        xmlResetLastError();
5988        if (mem_base != xmlMemBlocks()) {
5989            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
5990	           xmlMemBlocks() - mem_base);
5991	    test_ret++;
5992            printf(" %d", n_catalogs);
5993            printf(" %d", n_URI);
5994            printf("\n");
5995        }
5996    }
5997    }
5998    function_tests++;
5999#endif
6000
6001    return(test_ret);
6002}
6003
6004
6005static int
6006test_xmlCatalogRemove(void) {
6007    int test_ret = 0;
6008
6009#if defined(LIBXML_CATALOG_ENABLED)
6010    int ret_val;
6011    xmlChar * value; /* the value to remove */
6012    int n_value;
6013
6014    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6015        value = gen_const_xmlChar_ptr(n_value, 0);
6016
6017        ret_val = xmlCatalogRemove((const xmlChar *)value);
6018        desret_int(ret_val);
6019        call_tests++;
6020        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6021        xmlResetLastError();
6022    }
6023    function_tests++;
6024#endif
6025
6026    return(test_ret);
6027}
6028
6029
6030static int
6031test_xmlCatalogResolve(void) {
6032    int test_ret = 0;
6033
6034#if defined(LIBXML_CATALOG_ENABLED)
6035    int mem_base;
6036    xmlChar * ret_val;
6037    xmlChar * pubID; /* the public ID string */
6038    int n_pubID;
6039    xmlChar * sysID; /* the system ID string */
6040    int n_sysID;
6041
6042    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6043    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6044        mem_base = xmlMemBlocks();
6045        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6046        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6047
6048        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6049        desret_xmlChar_ptr(ret_val);
6050        call_tests++;
6051        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6052        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6053        xmlResetLastError();
6054        if (mem_base != xmlMemBlocks()) {
6055            printf("Leak of %d blocks found in xmlCatalogResolve",
6056	           xmlMemBlocks() - mem_base);
6057	    test_ret++;
6058            printf(" %d", n_pubID);
6059            printf(" %d", n_sysID);
6060            printf("\n");
6061        }
6062    }
6063    }
6064    function_tests++;
6065#endif
6066
6067    return(test_ret);
6068}
6069
6070
6071static int
6072test_xmlCatalogResolvePublic(void) {
6073    int test_ret = 0;
6074
6075#if defined(LIBXML_CATALOG_ENABLED)
6076    int mem_base;
6077    xmlChar * ret_val;
6078    xmlChar * pubID; /* the public ID string */
6079    int n_pubID;
6080
6081    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6082        mem_base = xmlMemBlocks();
6083        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6084
6085        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6086        desret_xmlChar_ptr(ret_val);
6087        call_tests++;
6088        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6089        xmlResetLastError();
6090        if (mem_base != xmlMemBlocks()) {
6091            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6092	           xmlMemBlocks() - mem_base);
6093	    test_ret++;
6094            printf(" %d", n_pubID);
6095            printf("\n");
6096        }
6097    }
6098    function_tests++;
6099#endif
6100
6101    return(test_ret);
6102}
6103
6104
6105static int
6106test_xmlCatalogResolveSystem(void) {
6107    int test_ret = 0;
6108
6109#if defined(LIBXML_CATALOG_ENABLED)
6110    int mem_base;
6111    xmlChar * ret_val;
6112    xmlChar * sysID; /* the system ID string */
6113    int n_sysID;
6114
6115    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6116        mem_base = xmlMemBlocks();
6117        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6118
6119        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6120        desret_xmlChar_ptr(ret_val);
6121        call_tests++;
6122        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6123        xmlResetLastError();
6124        if (mem_base != xmlMemBlocks()) {
6125            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6126	           xmlMemBlocks() - mem_base);
6127	    test_ret++;
6128            printf(" %d", n_sysID);
6129            printf("\n");
6130        }
6131    }
6132    function_tests++;
6133#endif
6134
6135    return(test_ret);
6136}
6137
6138
6139static int
6140test_xmlCatalogResolveURI(void) {
6141    int test_ret = 0;
6142
6143#if defined(LIBXML_CATALOG_ENABLED)
6144    int mem_base;
6145    xmlChar * ret_val;
6146    xmlChar * URI; /* the URI */
6147    int n_URI;
6148
6149    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6150        mem_base = xmlMemBlocks();
6151        URI = gen_const_xmlChar_ptr(n_URI, 0);
6152
6153        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6154        desret_xmlChar_ptr(ret_val);
6155        call_tests++;
6156        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6157        xmlResetLastError();
6158        if (mem_base != xmlMemBlocks()) {
6159            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6160	           xmlMemBlocks() - mem_base);
6161	    test_ret++;
6162            printf(" %d", n_URI);
6163            printf("\n");
6164        }
6165    }
6166    function_tests++;
6167#endif
6168
6169    return(test_ret);
6170}
6171
6172
6173static int
6174test_xmlCatalogSetDefaultPrefer(void) {
6175    int test_ret = 0;
6176
6177#if defined(LIBXML_CATALOG_ENABLED)
6178    int mem_base;
6179    xmlCatalogPrefer ret_val;
6180    xmlCatalogPrefer prefer; /* the default preference for delegation */
6181    int n_prefer;
6182
6183    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6184        mem_base = xmlMemBlocks();
6185        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6186
6187        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6188        desret_xmlCatalogPrefer(ret_val);
6189        call_tests++;
6190        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6191        xmlResetLastError();
6192        if (mem_base != xmlMemBlocks()) {
6193            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6194	           xmlMemBlocks() - mem_base);
6195	    test_ret++;
6196            printf(" %d", n_prefer);
6197            printf("\n");
6198        }
6199    }
6200    function_tests++;
6201#endif
6202
6203    return(test_ret);
6204}
6205
6206
6207static int
6208test_xmlCatalogSetDefaults(void) {
6209    int test_ret = 0;
6210
6211#if defined(LIBXML_CATALOG_ENABLED)
6212    int mem_base;
6213    xmlCatalogAllow allow; /* what catalogs should be accepted */
6214    int n_allow;
6215
6216    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6217        mem_base = xmlMemBlocks();
6218        allow = gen_xmlCatalogAllow(n_allow, 0);
6219
6220        xmlCatalogSetDefaults(allow);
6221        call_tests++;
6222        des_xmlCatalogAllow(n_allow, allow, 0);
6223        xmlResetLastError();
6224        if (mem_base != xmlMemBlocks()) {
6225            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6226	           xmlMemBlocks() - mem_base);
6227	    test_ret++;
6228            printf(" %d", n_allow);
6229            printf("\n");
6230        }
6231    }
6232    function_tests++;
6233#endif
6234
6235    return(test_ret);
6236}
6237
6238
6239static int
6240test_xmlConvertSGMLCatalog(void) {
6241    int test_ret = 0;
6242
6243#if defined(LIBXML_CATALOG_ENABLED)
6244    int mem_base;
6245    int ret_val;
6246    xmlCatalogPtr catal; /* the catalog */
6247    int n_catal;
6248
6249    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6250        mem_base = xmlMemBlocks();
6251        catal = gen_xmlCatalogPtr(n_catal, 0);
6252
6253        ret_val = xmlConvertSGMLCatalog(catal);
6254        desret_int(ret_val);
6255        call_tests++;
6256        des_xmlCatalogPtr(n_catal, catal, 0);
6257        xmlResetLastError();
6258        if (mem_base != xmlMemBlocks()) {
6259            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6260	           xmlMemBlocks() - mem_base);
6261	    test_ret++;
6262            printf(" %d", n_catal);
6263            printf("\n");
6264        }
6265    }
6266    function_tests++;
6267#endif
6268
6269    return(test_ret);
6270}
6271
6272
6273static int
6274test_xmlInitializeCatalog(void) {
6275    int test_ret = 0;
6276
6277#if defined(LIBXML_CATALOG_ENABLED)
6278    int mem_base;
6279
6280        mem_base = xmlMemBlocks();
6281
6282        xmlInitializeCatalog();
6283        call_tests++;
6284        xmlResetLastError();
6285        if (mem_base != xmlMemBlocks()) {
6286            printf("Leak of %d blocks found in xmlInitializeCatalog",
6287	           xmlMemBlocks() - mem_base);
6288	    test_ret++;
6289            printf("\n");
6290        }
6291    function_tests++;
6292#endif
6293
6294    return(test_ret);
6295}
6296
6297
6298static int
6299test_xmlLoadACatalog(void) {
6300    int test_ret = 0;
6301
6302
6303    /* missing type support */
6304    return(test_ret);
6305}
6306
6307
6308static int
6309test_xmlLoadCatalog(void) {
6310    int test_ret = 0;
6311
6312#if defined(LIBXML_CATALOG_ENABLED)
6313    int ret_val;
6314    const char * filename; /* a file path */
6315    int n_filename;
6316
6317    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6318        filename = gen_filepath(n_filename, 0);
6319
6320        ret_val = xmlLoadCatalog(filename);
6321        desret_int(ret_val);
6322        call_tests++;
6323        des_filepath(n_filename, filename, 0);
6324        xmlResetLastError();
6325    }
6326    function_tests++;
6327#endif
6328
6329    return(test_ret);
6330}
6331
6332
6333static int
6334test_xmlLoadCatalogs(void) {
6335    int test_ret = 0;
6336
6337#if defined(LIBXML_CATALOG_ENABLED)
6338    char * pathss; /* a list of directories separated by a colon or a space. */
6339    int n_pathss;
6340
6341    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6342        pathss = gen_const_char_ptr(n_pathss, 0);
6343
6344        xmlLoadCatalogs((const char *)pathss);
6345        call_tests++;
6346        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6347        xmlResetLastError();
6348    }
6349    function_tests++;
6350#endif
6351
6352    return(test_ret);
6353}
6354
6355
6356static int
6357test_xmlLoadSGMLSuperCatalog(void) {
6358    int test_ret = 0;
6359
6360
6361    /* missing type support */
6362    return(test_ret);
6363}
6364
6365
6366static int
6367test_xmlNewCatalog(void) {
6368    int test_ret = 0;
6369
6370
6371    /* missing type support */
6372    return(test_ret);
6373}
6374
6375
6376static int
6377test_xmlParseCatalogFile(void) {
6378    int test_ret = 0;
6379
6380#if defined(LIBXML_CATALOG_ENABLED)
6381    int mem_base;
6382    xmlDocPtr ret_val;
6383    const char * filename; /* the filename */
6384    int n_filename;
6385
6386    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6387        mem_base = xmlMemBlocks();
6388        filename = gen_filepath(n_filename, 0);
6389
6390        ret_val = xmlParseCatalogFile(filename);
6391        desret_xmlDocPtr(ret_val);
6392        call_tests++;
6393        des_filepath(n_filename, filename, 0);
6394        xmlResetLastError();
6395        if (mem_base != xmlMemBlocks()) {
6396            printf("Leak of %d blocks found in xmlParseCatalogFile",
6397	           xmlMemBlocks() - mem_base);
6398	    test_ret++;
6399            printf(" %d", n_filename);
6400            printf("\n");
6401        }
6402    }
6403    function_tests++;
6404#endif
6405
6406    return(test_ret);
6407}
6408
6409static int
6410test_catalog(void) {
6411    int test_ret = 0;
6412
6413    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6414    test_ret += test_xmlACatalogAdd();
6415    test_ret += test_xmlACatalogDump();
6416    test_ret += test_xmlACatalogRemove();
6417    test_ret += test_xmlACatalogResolve();
6418    test_ret += test_xmlACatalogResolvePublic();
6419    test_ret += test_xmlACatalogResolveSystem();
6420    test_ret += test_xmlACatalogResolveURI();
6421    test_ret += test_xmlCatalogAdd();
6422    test_ret += test_xmlCatalogCleanup();
6423    test_ret += test_xmlCatalogConvert();
6424    test_ret += test_xmlCatalogDump();
6425    test_ret += test_xmlCatalogGetDefaults();
6426    test_ret += test_xmlCatalogIsEmpty();
6427    test_ret += test_xmlCatalogLocalResolve();
6428    test_ret += test_xmlCatalogLocalResolveURI();
6429    test_ret += test_xmlCatalogRemove();
6430    test_ret += test_xmlCatalogResolve();
6431    test_ret += test_xmlCatalogResolvePublic();
6432    test_ret += test_xmlCatalogResolveSystem();
6433    test_ret += test_xmlCatalogResolveURI();
6434    test_ret += test_xmlCatalogSetDefaultPrefer();
6435    test_ret += test_xmlCatalogSetDefaults();
6436    test_ret += test_xmlConvertSGMLCatalog();
6437    test_ret += test_xmlInitializeCatalog();
6438    test_ret += test_xmlLoadACatalog();
6439    test_ret += test_xmlLoadCatalog();
6440    test_ret += test_xmlLoadCatalogs();
6441    test_ret += test_xmlLoadSGMLSuperCatalog();
6442    test_ret += test_xmlNewCatalog();
6443    test_ret += test_xmlParseCatalogFile();
6444
6445    if (test_ret != 0)
6446	printf("Module catalog: %d errors\n", test_ret);
6447    return(test_ret);
6448}
6449
6450#define gen_nb_const_xmlChRangeGroupPtr 1
6451static xmlChRangeGroupPtr gen_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6452    return(NULL);
6453}
6454static void des_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroupPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6455}
6456
6457static int
6458test_xmlCharInRange(void) {
6459    int test_ret = 0;
6460
6461    int mem_base;
6462    int ret_val;
6463    unsigned int val; /* character to be validated */
6464    int n_val;
6465    xmlChRangeGroupPtr rptr; /* pointer to range to be used to validate */
6466    int n_rptr;
6467
6468    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6469    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroupPtr;n_rptr++) {
6470        mem_base = xmlMemBlocks();
6471        val = gen_unsigned_int(n_val, 0);
6472        rptr = gen_const_xmlChRangeGroupPtr(n_rptr, 1);
6473
6474        ret_val = xmlCharInRange(val, (const xmlChRangeGroupPtr)rptr);
6475        desret_int(ret_val);
6476        call_tests++;
6477        des_unsigned_int(n_val, val, 0);
6478        des_const_xmlChRangeGroupPtr(n_rptr, (const xmlChRangeGroupPtr)rptr, 1);
6479        xmlResetLastError();
6480        if (mem_base != xmlMemBlocks()) {
6481            printf("Leak of %d blocks found in xmlCharInRange",
6482	           xmlMemBlocks() - mem_base);
6483	    test_ret++;
6484            printf(" %d", n_val);
6485            printf(" %d", n_rptr);
6486            printf("\n");
6487        }
6488    }
6489    }
6490    function_tests++;
6491
6492    return(test_ret);
6493}
6494
6495
6496static int
6497test_xmlIsBaseChar(void) {
6498    int test_ret = 0;
6499
6500    int mem_base;
6501    int ret_val;
6502    unsigned int ch; /* character to validate */
6503    int n_ch;
6504
6505    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6506        mem_base = xmlMemBlocks();
6507        ch = gen_unsigned_int(n_ch, 0);
6508
6509        ret_val = xmlIsBaseChar(ch);
6510        desret_int(ret_val);
6511        call_tests++;
6512        des_unsigned_int(n_ch, ch, 0);
6513        xmlResetLastError();
6514        if (mem_base != xmlMemBlocks()) {
6515            printf("Leak of %d blocks found in xmlIsBaseChar",
6516	           xmlMemBlocks() - mem_base);
6517	    test_ret++;
6518            printf(" %d", n_ch);
6519            printf("\n");
6520        }
6521    }
6522    function_tests++;
6523
6524    return(test_ret);
6525}
6526
6527
6528static int
6529test_xmlIsBlank(void) {
6530    int test_ret = 0;
6531
6532    int mem_base;
6533    int ret_val;
6534    unsigned int ch; /* character to validate */
6535    int n_ch;
6536
6537    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6538        mem_base = xmlMemBlocks();
6539        ch = gen_unsigned_int(n_ch, 0);
6540
6541        ret_val = xmlIsBlank(ch);
6542        desret_int(ret_val);
6543        call_tests++;
6544        des_unsigned_int(n_ch, ch, 0);
6545        xmlResetLastError();
6546        if (mem_base != xmlMemBlocks()) {
6547            printf("Leak of %d blocks found in xmlIsBlank",
6548	           xmlMemBlocks() - mem_base);
6549	    test_ret++;
6550            printf(" %d", n_ch);
6551            printf("\n");
6552        }
6553    }
6554    function_tests++;
6555
6556    return(test_ret);
6557}
6558
6559
6560static int
6561test_xmlIsChar(void) {
6562    int test_ret = 0;
6563
6564    int mem_base;
6565    int ret_val;
6566    unsigned int ch; /* character to validate */
6567    int n_ch;
6568
6569    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6570        mem_base = xmlMemBlocks();
6571        ch = gen_unsigned_int(n_ch, 0);
6572
6573        ret_val = xmlIsChar(ch);
6574        desret_int(ret_val);
6575        call_tests++;
6576        des_unsigned_int(n_ch, ch, 0);
6577        xmlResetLastError();
6578        if (mem_base != xmlMemBlocks()) {
6579            printf("Leak of %d blocks found in xmlIsChar",
6580	           xmlMemBlocks() - mem_base);
6581	    test_ret++;
6582            printf(" %d", n_ch);
6583            printf("\n");
6584        }
6585    }
6586    function_tests++;
6587
6588    return(test_ret);
6589}
6590
6591
6592static int
6593test_xmlIsCombining(void) {
6594    int test_ret = 0;
6595
6596    int mem_base;
6597    int ret_val;
6598    unsigned int ch; /* character to validate */
6599    int n_ch;
6600
6601    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6602        mem_base = xmlMemBlocks();
6603        ch = gen_unsigned_int(n_ch, 0);
6604
6605        ret_val = xmlIsCombining(ch);
6606        desret_int(ret_val);
6607        call_tests++;
6608        des_unsigned_int(n_ch, ch, 0);
6609        xmlResetLastError();
6610        if (mem_base != xmlMemBlocks()) {
6611            printf("Leak of %d blocks found in xmlIsCombining",
6612	           xmlMemBlocks() - mem_base);
6613	    test_ret++;
6614            printf(" %d", n_ch);
6615            printf("\n");
6616        }
6617    }
6618    function_tests++;
6619
6620    return(test_ret);
6621}
6622
6623
6624static int
6625test_xmlIsDigit(void) {
6626    int test_ret = 0;
6627
6628    int mem_base;
6629    int ret_val;
6630    unsigned int ch; /* character to validate */
6631    int n_ch;
6632
6633    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6634        mem_base = xmlMemBlocks();
6635        ch = gen_unsigned_int(n_ch, 0);
6636
6637        ret_val = xmlIsDigit(ch);
6638        desret_int(ret_val);
6639        call_tests++;
6640        des_unsigned_int(n_ch, ch, 0);
6641        xmlResetLastError();
6642        if (mem_base != xmlMemBlocks()) {
6643            printf("Leak of %d blocks found in xmlIsDigit",
6644	           xmlMemBlocks() - mem_base);
6645	    test_ret++;
6646            printf(" %d", n_ch);
6647            printf("\n");
6648        }
6649    }
6650    function_tests++;
6651
6652    return(test_ret);
6653}
6654
6655
6656static int
6657test_xmlIsExtender(void) {
6658    int test_ret = 0;
6659
6660    int mem_base;
6661    int ret_val;
6662    unsigned int ch; /* character to validate */
6663    int n_ch;
6664
6665    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6666        mem_base = xmlMemBlocks();
6667        ch = gen_unsigned_int(n_ch, 0);
6668
6669        ret_val = xmlIsExtender(ch);
6670        desret_int(ret_val);
6671        call_tests++;
6672        des_unsigned_int(n_ch, ch, 0);
6673        xmlResetLastError();
6674        if (mem_base != xmlMemBlocks()) {
6675            printf("Leak of %d blocks found in xmlIsExtender",
6676	           xmlMemBlocks() - mem_base);
6677	    test_ret++;
6678            printf(" %d", n_ch);
6679            printf("\n");
6680        }
6681    }
6682    function_tests++;
6683
6684    return(test_ret);
6685}
6686
6687
6688static int
6689test_xmlIsIdeographic(void) {
6690    int test_ret = 0;
6691
6692    int mem_base;
6693    int ret_val;
6694    unsigned int ch; /* character to validate */
6695    int n_ch;
6696
6697    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6698        mem_base = xmlMemBlocks();
6699        ch = gen_unsigned_int(n_ch, 0);
6700
6701        ret_val = xmlIsIdeographic(ch);
6702        desret_int(ret_val);
6703        call_tests++;
6704        des_unsigned_int(n_ch, ch, 0);
6705        xmlResetLastError();
6706        if (mem_base != xmlMemBlocks()) {
6707            printf("Leak of %d blocks found in xmlIsIdeographic",
6708	           xmlMemBlocks() - mem_base);
6709	    test_ret++;
6710            printf(" %d", n_ch);
6711            printf("\n");
6712        }
6713    }
6714    function_tests++;
6715
6716    return(test_ret);
6717}
6718
6719
6720static int
6721test_xmlIsPubidChar(void) {
6722    int test_ret = 0;
6723
6724    int mem_base;
6725    int ret_val;
6726    unsigned int ch; /* character to validate */
6727    int n_ch;
6728
6729    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6730        mem_base = xmlMemBlocks();
6731        ch = gen_unsigned_int(n_ch, 0);
6732
6733        ret_val = xmlIsPubidChar(ch);
6734        desret_int(ret_val);
6735        call_tests++;
6736        des_unsigned_int(n_ch, ch, 0);
6737        xmlResetLastError();
6738        if (mem_base != xmlMemBlocks()) {
6739            printf("Leak of %d blocks found in xmlIsPubidChar",
6740	           xmlMemBlocks() - mem_base);
6741	    test_ret++;
6742            printf(" %d", n_ch);
6743            printf("\n");
6744        }
6745    }
6746    function_tests++;
6747
6748    return(test_ret);
6749}
6750
6751static int
6752test_chvalid(void) {
6753    int test_ret = 0;
6754
6755    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6756    test_ret += test_xmlCharInRange();
6757    test_ret += test_xmlIsBaseChar();
6758    test_ret += test_xmlIsBlank();
6759    test_ret += test_xmlIsChar();
6760    test_ret += test_xmlIsCombining();
6761    test_ret += test_xmlIsDigit();
6762    test_ret += test_xmlIsExtender();
6763    test_ret += test_xmlIsIdeographic();
6764    test_ret += test_xmlIsPubidChar();
6765
6766    if (test_ret != 0)
6767	printf("Module chvalid: %d errors\n", test_ret);
6768    return(test_ret);
6769}
6770
6771static int
6772test_xmlBoolToText(void) {
6773    int test_ret = 0;
6774
6775#if defined(LIBXML_DEBUG_ENABLED)
6776    int mem_base;
6777    const char * ret_val;
6778    int boolval; /* a bool to turn into text */
6779    int n_boolval;
6780
6781    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6782        mem_base = xmlMemBlocks();
6783        boolval = gen_int(n_boolval, 0);
6784
6785        ret_val = xmlBoolToText(boolval);
6786        desret_const_char_ptr(ret_val);
6787        call_tests++;
6788        des_int(n_boolval, boolval, 0);
6789        xmlResetLastError();
6790        if (mem_base != xmlMemBlocks()) {
6791            printf("Leak of %d blocks found in xmlBoolToText",
6792	           xmlMemBlocks() - mem_base);
6793	    test_ret++;
6794            printf(" %d", n_boolval);
6795            printf("\n");
6796        }
6797    }
6798    function_tests++;
6799#endif
6800
6801    return(test_ret);
6802}
6803
6804
6805static int
6806test_xmlDebugCheckDocument(void) {
6807    int test_ret = 0;
6808
6809#if defined(LIBXML_DEBUG_ENABLED)
6810    int mem_base;
6811    int ret_val;
6812    FILE * output; /* the FILE * for the output */
6813    int n_output;
6814    xmlDocPtr doc; /* the document */
6815    int n_doc;
6816
6817    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6818    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6819        mem_base = xmlMemBlocks();
6820        output = gen_debug_FILE_ptr(n_output, 0);
6821        doc = gen_xmlDocPtr(n_doc, 1);
6822
6823        ret_val = xmlDebugCheckDocument(output, doc);
6824        desret_int(ret_val);
6825        call_tests++;
6826        des_debug_FILE_ptr(n_output, output, 0);
6827        des_xmlDocPtr(n_doc, doc, 1);
6828        xmlResetLastError();
6829        if (mem_base != xmlMemBlocks()) {
6830            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6831	           xmlMemBlocks() - mem_base);
6832	    test_ret++;
6833            printf(" %d", n_output);
6834            printf(" %d", n_doc);
6835            printf("\n");
6836        }
6837    }
6838    }
6839    function_tests++;
6840#endif
6841
6842    return(test_ret);
6843}
6844
6845
6846static int
6847test_xmlDebugDumpAttr(void) {
6848    int test_ret = 0;
6849
6850#if defined(LIBXML_DEBUG_ENABLED)
6851    int mem_base;
6852    FILE * output; /* the FILE * for the output */
6853    int n_output;
6854    xmlAttrPtr attr; /* the attribute */
6855    int n_attr;
6856    int depth; /* the indentation level. */
6857    int n_depth;
6858
6859    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6860    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6861    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6862        mem_base = xmlMemBlocks();
6863        output = gen_debug_FILE_ptr(n_output, 0);
6864        attr = gen_xmlAttrPtr(n_attr, 1);
6865        depth = gen_int(n_depth, 2);
6866
6867        xmlDebugDumpAttr(output, attr, depth);
6868        call_tests++;
6869        des_debug_FILE_ptr(n_output, output, 0);
6870        des_xmlAttrPtr(n_attr, attr, 1);
6871        des_int(n_depth, depth, 2);
6872        xmlResetLastError();
6873        if (mem_base != xmlMemBlocks()) {
6874            printf("Leak of %d blocks found in xmlDebugDumpAttr",
6875	           xmlMemBlocks() - mem_base);
6876	    test_ret++;
6877            printf(" %d", n_output);
6878            printf(" %d", n_attr);
6879            printf(" %d", n_depth);
6880            printf("\n");
6881        }
6882    }
6883    }
6884    }
6885    function_tests++;
6886#endif
6887
6888    return(test_ret);
6889}
6890
6891
6892static int
6893test_xmlDebugDumpAttrList(void) {
6894    int test_ret = 0;
6895
6896#if defined(LIBXML_DEBUG_ENABLED)
6897    int mem_base;
6898    FILE * output; /* the FILE * for the output */
6899    int n_output;
6900    xmlAttrPtr attr; /* the attribute list */
6901    int n_attr;
6902    int depth; /* the indentation level. */
6903    int n_depth;
6904
6905    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6906    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6907    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6908        mem_base = xmlMemBlocks();
6909        output = gen_debug_FILE_ptr(n_output, 0);
6910        attr = gen_xmlAttrPtr(n_attr, 1);
6911        depth = gen_int(n_depth, 2);
6912
6913        xmlDebugDumpAttrList(output, attr, depth);
6914        call_tests++;
6915        des_debug_FILE_ptr(n_output, output, 0);
6916        des_xmlAttrPtr(n_attr, attr, 1);
6917        des_int(n_depth, depth, 2);
6918        xmlResetLastError();
6919        if (mem_base != xmlMemBlocks()) {
6920            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
6921	           xmlMemBlocks() - mem_base);
6922	    test_ret++;
6923            printf(" %d", n_output);
6924            printf(" %d", n_attr);
6925            printf(" %d", n_depth);
6926            printf("\n");
6927        }
6928    }
6929    }
6930    }
6931    function_tests++;
6932#endif
6933
6934    return(test_ret);
6935}
6936
6937
6938static int
6939test_xmlDebugDumpDTD(void) {
6940    int test_ret = 0;
6941
6942#if defined(LIBXML_DEBUG_ENABLED)
6943    int mem_base;
6944    FILE * output; /* the FILE * for the output */
6945    int n_output;
6946    xmlDtdPtr dtd; /* the DTD */
6947    int n_dtd;
6948
6949    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6950    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
6951        mem_base = xmlMemBlocks();
6952        output = gen_debug_FILE_ptr(n_output, 0);
6953        dtd = gen_xmlDtdPtr(n_dtd, 1);
6954
6955        xmlDebugDumpDTD(output, dtd);
6956        call_tests++;
6957        des_debug_FILE_ptr(n_output, output, 0);
6958        des_xmlDtdPtr(n_dtd, dtd, 1);
6959        xmlResetLastError();
6960        if (mem_base != xmlMemBlocks()) {
6961            printf("Leak of %d blocks found in xmlDebugDumpDTD",
6962	           xmlMemBlocks() - mem_base);
6963	    test_ret++;
6964            printf(" %d", n_output);
6965            printf(" %d", n_dtd);
6966            printf("\n");
6967        }
6968    }
6969    }
6970    function_tests++;
6971#endif
6972
6973    return(test_ret);
6974}
6975
6976
6977static int
6978test_xmlDebugDumpDocument(void) {
6979    int test_ret = 0;
6980
6981#if defined(LIBXML_DEBUG_ENABLED)
6982    int mem_base;
6983    FILE * output; /* the FILE * for the output */
6984    int n_output;
6985    xmlDocPtr doc; /* the document */
6986    int n_doc;
6987
6988    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6989    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6990        mem_base = xmlMemBlocks();
6991        output = gen_debug_FILE_ptr(n_output, 0);
6992        doc = gen_xmlDocPtr(n_doc, 1);
6993
6994        xmlDebugDumpDocument(output, doc);
6995        call_tests++;
6996        des_debug_FILE_ptr(n_output, output, 0);
6997        des_xmlDocPtr(n_doc, doc, 1);
6998        xmlResetLastError();
6999        if (mem_base != xmlMemBlocks()) {
7000            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7001	           xmlMemBlocks() - mem_base);
7002	    test_ret++;
7003            printf(" %d", n_output);
7004            printf(" %d", n_doc);
7005            printf("\n");
7006        }
7007    }
7008    }
7009    function_tests++;
7010#endif
7011
7012    return(test_ret);
7013}
7014
7015
7016static int
7017test_xmlDebugDumpDocumentHead(void) {
7018    int test_ret = 0;
7019
7020#if defined(LIBXML_DEBUG_ENABLED)
7021    int mem_base;
7022    FILE * output; /* the FILE * for the output */
7023    int n_output;
7024    xmlDocPtr doc; /* the document */
7025    int n_doc;
7026
7027    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7028    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7029        mem_base = xmlMemBlocks();
7030        output = gen_debug_FILE_ptr(n_output, 0);
7031        doc = gen_xmlDocPtr(n_doc, 1);
7032
7033        xmlDebugDumpDocumentHead(output, doc);
7034        call_tests++;
7035        des_debug_FILE_ptr(n_output, output, 0);
7036        des_xmlDocPtr(n_doc, doc, 1);
7037        xmlResetLastError();
7038        if (mem_base != xmlMemBlocks()) {
7039            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7040	           xmlMemBlocks() - mem_base);
7041	    test_ret++;
7042            printf(" %d", n_output);
7043            printf(" %d", n_doc);
7044            printf("\n");
7045        }
7046    }
7047    }
7048    function_tests++;
7049#endif
7050
7051    return(test_ret);
7052}
7053
7054
7055static int
7056test_xmlDebugDumpEntities(void) {
7057    int test_ret = 0;
7058
7059#if defined(LIBXML_DEBUG_ENABLED)
7060    int mem_base;
7061    FILE * output; /* the FILE * for the output */
7062    int n_output;
7063    xmlDocPtr doc; /* the document */
7064    int n_doc;
7065
7066    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7067    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7068        mem_base = xmlMemBlocks();
7069        output = gen_debug_FILE_ptr(n_output, 0);
7070        doc = gen_xmlDocPtr(n_doc, 1);
7071
7072        xmlDebugDumpEntities(output, doc);
7073        call_tests++;
7074        des_debug_FILE_ptr(n_output, output, 0);
7075        des_xmlDocPtr(n_doc, doc, 1);
7076        xmlResetLastError();
7077        if (mem_base != xmlMemBlocks()) {
7078            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7079	           xmlMemBlocks() - mem_base);
7080	    test_ret++;
7081            printf(" %d", n_output);
7082            printf(" %d", n_doc);
7083            printf("\n");
7084        }
7085    }
7086    }
7087    function_tests++;
7088#endif
7089
7090    return(test_ret);
7091}
7092
7093
7094static int
7095test_xmlDebugDumpNode(void) {
7096    int test_ret = 0;
7097
7098#if defined(LIBXML_DEBUG_ENABLED)
7099    int mem_base;
7100    FILE * output; /* the FILE * for the output */
7101    int n_output;
7102    xmlNodePtr node; /* the node */
7103    int n_node;
7104    int depth; /* the indentation level. */
7105    int n_depth;
7106
7107    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7108    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7109    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7110        mem_base = xmlMemBlocks();
7111        output = gen_debug_FILE_ptr(n_output, 0);
7112        node = gen_xmlNodePtr(n_node, 1);
7113        depth = gen_int(n_depth, 2);
7114
7115        xmlDebugDumpNode(output, node, depth);
7116        call_tests++;
7117        des_debug_FILE_ptr(n_output, output, 0);
7118        des_xmlNodePtr(n_node, node, 1);
7119        des_int(n_depth, depth, 2);
7120        xmlResetLastError();
7121        if (mem_base != xmlMemBlocks()) {
7122            printf("Leak of %d blocks found in xmlDebugDumpNode",
7123	           xmlMemBlocks() - mem_base);
7124	    test_ret++;
7125            printf(" %d", n_output);
7126            printf(" %d", n_node);
7127            printf(" %d", n_depth);
7128            printf("\n");
7129        }
7130    }
7131    }
7132    }
7133    function_tests++;
7134#endif
7135
7136    return(test_ret);
7137}
7138
7139
7140static int
7141test_xmlDebugDumpNodeList(void) {
7142    int test_ret = 0;
7143
7144#if defined(LIBXML_DEBUG_ENABLED)
7145    int mem_base;
7146    FILE * output; /* the FILE * for the output */
7147    int n_output;
7148    xmlNodePtr node; /* the node list */
7149    int n_node;
7150    int depth; /* the indentation level. */
7151    int n_depth;
7152
7153    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7154    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7155    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7156        mem_base = xmlMemBlocks();
7157        output = gen_debug_FILE_ptr(n_output, 0);
7158        node = gen_xmlNodePtr(n_node, 1);
7159        depth = gen_int(n_depth, 2);
7160
7161        xmlDebugDumpNodeList(output, node, depth);
7162        call_tests++;
7163        des_debug_FILE_ptr(n_output, output, 0);
7164        des_xmlNodePtr(n_node, node, 1);
7165        des_int(n_depth, depth, 2);
7166        xmlResetLastError();
7167        if (mem_base != xmlMemBlocks()) {
7168            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7169	           xmlMemBlocks() - mem_base);
7170	    test_ret++;
7171            printf(" %d", n_output);
7172            printf(" %d", n_node);
7173            printf(" %d", n_depth);
7174            printf("\n");
7175        }
7176    }
7177    }
7178    }
7179    function_tests++;
7180#endif
7181
7182    return(test_ret);
7183}
7184
7185
7186static int
7187test_xmlDebugDumpOneNode(void) {
7188    int test_ret = 0;
7189
7190#if defined(LIBXML_DEBUG_ENABLED)
7191    int mem_base;
7192    FILE * output; /* the FILE * for the output */
7193    int n_output;
7194    xmlNodePtr node; /* the node */
7195    int n_node;
7196    int depth; /* the indentation level. */
7197    int n_depth;
7198
7199    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7200    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7201    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7202        mem_base = xmlMemBlocks();
7203        output = gen_debug_FILE_ptr(n_output, 0);
7204        node = gen_xmlNodePtr(n_node, 1);
7205        depth = gen_int(n_depth, 2);
7206
7207        xmlDebugDumpOneNode(output, node, depth);
7208        call_tests++;
7209        des_debug_FILE_ptr(n_output, output, 0);
7210        des_xmlNodePtr(n_node, node, 1);
7211        des_int(n_depth, depth, 2);
7212        xmlResetLastError();
7213        if (mem_base != xmlMemBlocks()) {
7214            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7215	           xmlMemBlocks() - mem_base);
7216	    test_ret++;
7217            printf(" %d", n_output);
7218            printf(" %d", n_node);
7219            printf(" %d", n_depth);
7220            printf("\n");
7221        }
7222    }
7223    }
7224    }
7225    function_tests++;
7226#endif
7227
7228    return(test_ret);
7229}
7230
7231
7232static int
7233test_xmlDebugDumpString(void) {
7234    int test_ret = 0;
7235
7236#if defined(LIBXML_DEBUG_ENABLED)
7237    int mem_base;
7238    FILE * output; /* the FILE * for the output */
7239    int n_output;
7240    xmlChar * str; /* the string */
7241    int n_str;
7242
7243    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7244    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7245        mem_base = xmlMemBlocks();
7246        output = gen_debug_FILE_ptr(n_output, 0);
7247        str = gen_const_xmlChar_ptr(n_str, 1);
7248
7249        xmlDebugDumpString(output, (const xmlChar *)str);
7250        call_tests++;
7251        des_debug_FILE_ptr(n_output, output, 0);
7252        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7253        xmlResetLastError();
7254        if (mem_base != xmlMemBlocks()) {
7255            printf("Leak of %d blocks found in xmlDebugDumpString",
7256	           xmlMemBlocks() - mem_base);
7257	    test_ret++;
7258            printf(" %d", n_output);
7259            printf(" %d", n_str);
7260            printf("\n");
7261        }
7262    }
7263    }
7264    function_tests++;
7265#endif
7266
7267    return(test_ret);
7268}
7269
7270
7271static int
7272test_xmlLsCountNode(void) {
7273    int test_ret = 0;
7274
7275#if defined(LIBXML_DEBUG_ENABLED)
7276    int mem_base;
7277    int ret_val;
7278    xmlNodePtr node; /* the node to count */
7279    int n_node;
7280
7281    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7282        mem_base = xmlMemBlocks();
7283        node = gen_xmlNodePtr(n_node, 0);
7284
7285        ret_val = xmlLsCountNode(node);
7286        desret_int(ret_val);
7287        call_tests++;
7288        des_xmlNodePtr(n_node, node, 0);
7289        xmlResetLastError();
7290        if (mem_base != xmlMemBlocks()) {
7291            printf("Leak of %d blocks found in xmlLsCountNode",
7292	           xmlMemBlocks() - mem_base);
7293	    test_ret++;
7294            printf(" %d", n_node);
7295            printf("\n");
7296        }
7297    }
7298    function_tests++;
7299#endif
7300
7301    return(test_ret);
7302}
7303
7304
7305static int
7306test_xmlLsOneNode(void) {
7307    int test_ret = 0;
7308
7309#if defined(LIBXML_DEBUG_ENABLED)
7310    int mem_base;
7311    FILE * output; /* the FILE * for the output */
7312    int n_output;
7313    xmlNodePtr node; /* the node to dump */
7314    int n_node;
7315
7316    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7317    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7318        mem_base = xmlMemBlocks();
7319        output = gen_debug_FILE_ptr(n_output, 0);
7320        node = gen_xmlNodePtr(n_node, 1);
7321
7322        xmlLsOneNode(output, node);
7323        call_tests++;
7324        des_debug_FILE_ptr(n_output, output, 0);
7325        des_xmlNodePtr(n_node, node, 1);
7326        xmlResetLastError();
7327        if (mem_base != xmlMemBlocks()) {
7328            printf("Leak of %d blocks found in xmlLsOneNode",
7329	           xmlMemBlocks() - mem_base);
7330	    test_ret++;
7331            printf(" %d", n_output);
7332            printf(" %d", n_node);
7333            printf("\n");
7334        }
7335    }
7336    }
7337    function_tests++;
7338#endif
7339
7340    return(test_ret);
7341}
7342
7343
7344#define gen_nb_char_ptr 1
7345static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7346    return(NULL);
7347}
7348static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7349}
7350
7351static int
7352test_xmlShell(void) {
7353    int test_ret = 0;
7354
7355
7356    /* missing type support */
7357    return(test_ret);
7358}
7359
7360
7361static int
7362test_xmlShellBase(void) {
7363    int test_ret = 0;
7364
7365#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7366    int mem_base;
7367    int ret_val;
7368    xmlShellCtxtPtr ctxt; /* the shell context */
7369    int n_ctxt;
7370    char * arg; /* unused */
7371    int n_arg;
7372    xmlNodePtr node; /* a node */
7373    int n_node;
7374    xmlNodePtr node2; /* unused */
7375    int n_node2;
7376
7377    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7378    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7379    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7380    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7381        mem_base = xmlMemBlocks();
7382        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7383        arg = gen_char_ptr(n_arg, 1);
7384        node = gen_xmlNodePtr(n_node, 2);
7385        node2 = gen_xmlNodePtr(n_node2, 3);
7386
7387        ret_val = xmlShellBase(ctxt, arg, node, node2);
7388        desret_int(ret_val);
7389        call_tests++;
7390        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7391        des_char_ptr(n_arg, arg, 1);
7392        des_xmlNodePtr(n_node, node, 2);
7393        des_xmlNodePtr(n_node2, node2, 3);
7394        xmlResetLastError();
7395        if (mem_base != xmlMemBlocks()) {
7396            printf("Leak of %d blocks found in xmlShellBase",
7397	           xmlMemBlocks() - mem_base);
7398	    test_ret++;
7399            printf(" %d", n_ctxt);
7400            printf(" %d", n_arg);
7401            printf(" %d", n_node);
7402            printf(" %d", n_node2);
7403            printf("\n");
7404        }
7405    }
7406    }
7407    }
7408    }
7409    function_tests++;
7410#endif
7411
7412    return(test_ret);
7413}
7414
7415
7416static int
7417test_xmlShellCat(void) {
7418    int test_ret = 0;
7419
7420#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7421    int mem_base;
7422    int ret_val;
7423    xmlShellCtxtPtr ctxt; /* the shell context */
7424    int n_ctxt;
7425    char * arg; /* unused */
7426    int n_arg;
7427    xmlNodePtr node; /* a node */
7428    int n_node;
7429    xmlNodePtr node2; /* unused */
7430    int n_node2;
7431
7432    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7433    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7434    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7435    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7436        mem_base = xmlMemBlocks();
7437        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7438        arg = gen_char_ptr(n_arg, 1);
7439        node = gen_xmlNodePtr(n_node, 2);
7440        node2 = gen_xmlNodePtr(n_node2, 3);
7441
7442        ret_val = xmlShellCat(ctxt, arg, node, node2);
7443        desret_int(ret_val);
7444        call_tests++;
7445        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7446        des_char_ptr(n_arg, arg, 1);
7447        des_xmlNodePtr(n_node, node, 2);
7448        des_xmlNodePtr(n_node2, node2, 3);
7449        xmlResetLastError();
7450        if (mem_base != xmlMemBlocks()) {
7451            printf("Leak of %d blocks found in xmlShellCat",
7452	           xmlMemBlocks() - mem_base);
7453	    test_ret++;
7454            printf(" %d", n_ctxt);
7455            printf(" %d", n_arg);
7456            printf(" %d", n_node);
7457            printf(" %d", n_node2);
7458            printf("\n");
7459        }
7460    }
7461    }
7462    }
7463    }
7464    function_tests++;
7465#endif
7466
7467    return(test_ret);
7468}
7469
7470
7471static int
7472test_xmlShellDir(void) {
7473    int test_ret = 0;
7474
7475#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7476    int mem_base;
7477    int ret_val;
7478    xmlShellCtxtPtr ctxt; /* the shell context */
7479    int n_ctxt;
7480    char * arg; /* unused */
7481    int n_arg;
7482    xmlNodePtr node; /* a node */
7483    int n_node;
7484    xmlNodePtr node2; /* unused */
7485    int n_node2;
7486
7487    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7488    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7489    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7490    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7491        mem_base = xmlMemBlocks();
7492        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7493        arg = gen_char_ptr(n_arg, 1);
7494        node = gen_xmlNodePtr(n_node, 2);
7495        node2 = gen_xmlNodePtr(n_node2, 3);
7496
7497        ret_val = xmlShellDir(ctxt, arg, node, node2);
7498        desret_int(ret_val);
7499        call_tests++;
7500        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7501        des_char_ptr(n_arg, arg, 1);
7502        des_xmlNodePtr(n_node, node, 2);
7503        des_xmlNodePtr(n_node2, node2, 3);
7504        xmlResetLastError();
7505        if (mem_base != xmlMemBlocks()) {
7506            printf("Leak of %d blocks found in xmlShellDir",
7507	           xmlMemBlocks() - mem_base);
7508	    test_ret++;
7509            printf(" %d", n_ctxt);
7510            printf(" %d", n_arg);
7511            printf(" %d", n_node);
7512            printf(" %d", n_node2);
7513            printf("\n");
7514        }
7515    }
7516    }
7517    }
7518    }
7519    function_tests++;
7520#endif
7521
7522    return(test_ret);
7523}
7524
7525
7526static int
7527test_xmlShellDu(void) {
7528    int test_ret = 0;
7529
7530#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7531    int mem_base;
7532    int ret_val;
7533    xmlShellCtxtPtr ctxt; /* the shell context */
7534    int n_ctxt;
7535    char * arg; /* unused */
7536    int n_arg;
7537    xmlNodePtr tree; /* a node defining a subtree */
7538    int n_tree;
7539    xmlNodePtr node2; /* unused */
7540    int n_node2;
7541
7542    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7543    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7544    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7545    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7546        mem_base = xmlMemBlocks();
7547        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7548        arg = gen_char_ptr(n_arg, 1);
7549        tree = gen_xmlNodePtr(n_tree, 2);
7550        node2 = gen_xmlNodePtr(n_node2, 3);
7551
7552        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7553        desret_int(ret_val);
7554        call_tests++;
7555        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7556        des_char_ptr(n_arg, arg, 1);
7557        des_xmlNodePtr(n_tree, tree, 2);
7558        des_xmlNodePtr(n_node2, node2, 3);
7559        xmlResetLastError();
7560        if (mem_base != xmlMemBlocks()) {
7561            printf("Leak of %d blocks found in xmlShellDu",
7562	           xmlMemBlocks() - mem_base);
7563	    test_ret++;
7564            printf(" %d", n_ctxt);
7565            printf(" %d", n_arg);
7566            printf(" %d", n_tree);
7567            printf(" %d", n_node2);
7568            printf("\n");
7569        }
7570    }
7571    }
7572    }
7573    }
7574    function_tests++;
7575#endif
7576
7577    return(test_ret);
7578}
7579
7580
7581static int
7582test_xmlShellList(void) {
7583    int test_ret = 0;
7584
7585#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7586    int mem_base;
7587    int ret_val;
7588    xmlShellCtxtPtr ctxt; /* the shell context */
7589    int n_ctxt;
7590    char * arg; /* unused */
7591    int n_arg;
7592    xmlNodePtr node; /* a node */
7593    int n_node;
7594    xmlNodePtr node2; /* unused */
7595    int n_node2;
7596
7597    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7598    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7599    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7600    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7601        mem_base = xmlMemBlocks();
7602        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7603        arg = gen_char_ptr(n_arg, 1);
7604        node = gen_xmlNodePtr(n_node, 2);
7605        node2 = gen_xmlNodePtr(n_node2, 3);
7606
7607        ret_val = xmlShellList(ctxt, arg, node, node2);
7608        desret_int(ret_val);
7609        call_tests++;
7610        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7611        des_char_ptr(n_arg, arg, 1);
7612        des_xmlNodePtr(n_node, node, 2);
7613        des_xmlNodePtr(n_node2, node2, 3);
7614        xmlResetLastError();
7615        if (mem_base != xmlMemBlocks()) {
7616            printf("Leak of %d blocks found in xmlShellList",
7617	           xmlMemBlocks() - mem_base);
7618	    test_ret++;
7619            printf(" %d", n_ctxt);
7620            printf(" %d", n_arg);
7621            printf(" %d", n_node);
7622            printf(" %d", n_node2);
7623            printf("\n");
7624        }
7625    }
7626    }
7627    }
7628    }
7629    function_tests++;
7630#endif
7631
7632    return(test_ret);
7633}
7634
7635
7636static int
7637test_xmlShellLoad(void) {
7638    int test_ret = 0;
7639
7640#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7641    int mem_base;
7642    int ret_val;
7643    xmlShellCtxtPtr ctxt; /* the shell context */
7644    int n_ctxt;
7645    char * filename; /* the file name */
7646    int n_filename;
7647    xmlNodePtr node; /* unused */
7648    int n_node;
7649    xmlNodePtr node2; /* unused */
7650    int n_node2;
7651
7652    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7653    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7654    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7655    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7656        mem_base = xmlMemBlocks();
7657        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7658        filename = gen_char_ptr(n_filename, 1);
7659        node = gen_xmlNodePtr(n_node, 2);
7660        node2 = gen_xmlNodePtr(n_node2, 3);
7661
7662        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7663        desret_int(ret_val);
7664        call_tests++;
7665        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7666        des_char_ptr(n_filename, filename, 1);
7667        des_xmlNodePtr(n_node, node, 2);
7668        des_xmlNodePtr(n_node2, node2, 3);
7669        xmlResetLastError();
7670        if (mem_base != xmlMemBlocks()) {
7671            printf("Leak of %d blocks found in xmlShellLoad",
7672	           xmlMemBlocks() - mem_base);
7673	    test_ret++;
7674            printf(" %d", n_ctxt);
7675            printf(" %d", n_filename);
7676            printf(" %d", n_node);
7677            printf(" %d", n_node2);
7678            printf("\n");
7679        }
7680    }
7681    }
7682    }
7683    }
7684    function_tests++;
7685#endif
7686
7687    return(test_ret);
7688}
7689
7690
7691static int
7692test_xmlShellPrintXPathResult(void) {
7693    int test_ret = 0;
7694
7695#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7696    int mem_base;
7697    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7698    int n_list;
7699
7700    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7701        mem_base = xmlMemBlocks();
7702        list = gen_xmlXPathObjectPtr(n_list, 0);
7703
7704        xmlShellPrintXPathResult(list);
7705        call_tests++;
7706        des_xmlXPathObjectPtr(n_list, list, 0);
7707        xmlResetLastError();
7708        if (mem_base != xmlMemBlocks()) {
7709            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7710	           xmlMemBlocks() - mem_base);
7711	    test_ret++;
7712            printf(" %d", n_list);
7713            printf("\n");
7714        }
7715    }
7716    function_tests++;
7717#endif
7718
7719    return(test_ret);
7720}
7721
7722
7723static int
7724test_xmlShellPwd(void) {
7725    int test_ret = 0;
7726
7727#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7728    int mem_base;
7729    int ret_val;
7730    xmlShellCtxtPtr ctxt; /* the shell context */
7731    int n_ctxt;
7732    char * buffer; /* the output buffer */
7733    int n_buffer;
7734    xmlNodePtr node; /* a node */
7735    int n_node;
7736    xmlNodePtr node2; /* unused */
7737    int n_node2;
7738
7739    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7740    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7741    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7742    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7743        mem_base = xmlMemBlocks();
7744        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7745        buffer = gen_char_ptr(n_buffer, 1);
7746        node = gen_xmlNodePtr(n_node, 2);
7747        node2 = gen_xmlNodePtr(n_node2, 3);
7748
7749        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7750        desret_int(ret_val);
7751        call_tests++;
7752        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7753        des_char_ptr(n_buffer, buffer, 1);
7754        des_xmlNodePtr(n_node, node, 2);
7755        des_xmlNodePtr(n_node2, node2, 3);
7756        xmlResetLastError();
7757        if (mem_base != xmlMemBlocks()) {
7758            printf("Leak of %d blocks found in xmlShellPwd",
7759	           xmlMemBlocks() - mem_base);
7760	    test_ret++;
7761            printf(" %d", n_ctxt);
7762            printf(" %d", n_buffer);
7763            printf(" %d", n_node);
7764            printf(" %d", n_node2);
7765            printf("\n");
7766        }
7767    }
7768    }
7769    }
7770    }
7771    function_tests++;
7772#endif
7773
7774    return(test_ret);
7775}
7776
7777
7778static int
7779test_xmlShellSave(void) {
7780    int test_ret = 0;
7781
7782#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7783    int mem_base;
7784    int ret_val;
7785    xmlShellCtxtPtr ctxt; /* the shell context */
7786    int n_ctxt;
7787    char * filename; /* the file name (optional) */
7788    int n_filename;
7789    xmlNodePtr node; /* unused */
7790    int n_node;
7791    xmlNodePtr node2; /* unused */
7792    int n_node2;
7793
7794    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7795    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7796    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7797    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7798        mem_base = xmlMemBlocks();
7799        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7800        filename = gen_char_ptr(n_filename, 1);
7801        node = gen_xmlNodePtr(n_node, 2);
7802        node2 = gen_xmlNodePtr(n_node2, 3);
7803
7804        ret_val = xmlShellSave(ctxt, filename, node, node2);
7805        desret_int(ret_val);
7806        call_tests++;
7807        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7808        des_char_ptr(n_filename, filename, 1);
7809        des_xmlNodePtr(n_node, node, 2);
7810        des_xmlNodePtr(n_node2, node2, 3);
7811        xmlResetLastError();
7812        if (mem_base != xmlMemBlocks()) {
7813            printf("Leak of %d blocks found in xmlShellSave",
7814	           xmlMemBlocks() - mem_base);
7815	    test_ret++;
7816            printf(" %d", n_ctxt);
7817            printf(" %d", n_filename);
7818            printf(" %d", n_node);
7819            printf(" %d", n_node2);
7820            printf("\n");
7821        }
7822    }
7823    }
7824    }
7825    }
7826    function_tests++;
7827#endif
7828
7829    return(test_ret);
7830}
7831
7832
7833static int
7834test_xmlShellValidate(void) {
7835    int test_ret = 0;
7836
7837#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7838    int mem_base;
7839    int ret_val;
7840    xmlShellCtxtPtr ctxt; /* the shell context */
7841    int n_ctxt;
7842    char * dtd; /* the DTD URI (optional) */
7843    int n_dtd;
7844    xmlNodePtr node; /* unused */
7845    int n_node;
7846    xmlNodePtr node2; /* unused */
7847    int n_node2;
7848
7849    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7850    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7851    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7852    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7853        mem_base = xmlMemBlocks();
7854        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7855        dtd = gen_char_ptr(n_dtd, 1);
7856        node = gen_xmlNodePtr(n_node, 2);
7857        node2 = gen_xmlNodePtr(n_node2, 3);
7858
7859        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
7860        desret_int(ret_val);
7861        call_tests++;
7862        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7863        des_char_ptr(n_dtd, dtd, 1);
7864        des_xmlNodePtr(n_node, node, 2);
7865        des_xmlNodePtr(n_node2, node2, 3);
7866        xmlResetLastError();
7867        if (mem_base != xmlMemBlocks()) {
7868            printf("Leak of %d blocks found in xmlShellValidate",
7869	           xmlMemBlocks() - mem_base);
7870	    test_ret++;
7871            printf(" %d", n_ctxt);
7872            printf(" %d", n_dtd);
7873            printf(" %d", n_node);
7874            printf(" %d", n_node2);
7875            printf("\n");
7876        }
7877    }
7878    }
7879    }
7880    }
7881    function_tests++;
7882#endif
7883
7884    return(test_ret);
7885}
7886
7887
7888static int
7889test_xmlShellWrite(void) {
7890    int test_ret = 0;
7891
7892#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7893    int mem_base;
7894    int ret_val;
7895    xmlShellCtxtPtr ctxt; /* the shell context */
7896    int n_ctxt;
7897    char * filename; /* the file name */
7898    int n_filename;
7899    xmlNodePtr node; /* a node in the tree */
7900    int n_node;
7901    xmlNodePtr node2; /* unused */
7902    int n_node2;
7903
7904    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7905    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7906    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7907    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7908        mem_base = xmlMemBlocks();
7909        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7910        filename = gen_char_ptr(n_filename, 1);
7911        node = gen_xmlNodePtr(n_node, 2);
7912        node2 = gen_xmlNodePtr(n_node2, 3);
7913
7914        ret_val = xmlShellWrite(ctxt, filename, node, node2);
7915        desret_int(ret_val);
7916        call_tests++;
7917        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7918        des_char_ptr(n_filename, filename, 1);
7919        des_xmlNodePtr(n_node, node, 2);
7920        des_xmlNodePtr(n_node2, node2, 3);
7921        xmlResetLastError();
7922        if (mem_base != xmlMemBlocks()) {
7923            printf("Leak of %d blocks found in xmlShellWrite",
7924	           xmlMemBlocks() - mem_base);
7925	    test_ret++;
7926            printf(" %d", n_ctxt);
7927            printf(" %d", n_filename);
7928            printf(" %d", n_node);
7929            printf(" %d", n_node2);
7930            printf("\n");
7931        }
7932    }
7933    }
7934    }
7935    }
7936    function_tests++;
7937#endif
7938
7939    return(test_ret);
7940}
7941
7942static int
7943test_debugXML(void) {
7944    int test_ret = 0;
7945
7946    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
7947    test_ret += test_xmlBoolToText();
7948    test_ret += test_xmlDebugCheckDocument();
7949    test_ret += test_xmlDebugDumpAttr();
7950    test_ret += test_xmlDebugDumpAttrList();
7951    test_ret += test_xmlDebugDumpDTD();
7952    test_ret += test_xmlDebugDumpDocument();
7953    test_ret += test_xmlDebugDumpDocumentHead();
7954    test_ret += test_xmlDebugDumpEntities();
7955    test_ret += test_xmlDebugDumpNode();
7956    test_ret += test_xmlDebugDumpNodeList();
7957    test_ret += test_xmlDebugDumpOneNode();
7958    test_ret += test_xmlDebugDumpString();
7959    test_ret += test_xmlLsCountNode();
7960    test_ret += test_xmlLsOneNode();
7961    test_ret += test_xmlShell();
7962    test_ret += test_xmlShellBase();
7963    test_ret += test_xmlShellCat();
7964    test_ret += test_xmlShellDir();
7965    test_ret += test_xmlShellDu();
7966    test_ret += test_xmlShellList();
7967    test_ret += test_xmlShellLoad();
7968    test_ret += test_xmlShellPrintXPathResult();
7969    test_ret += test_xmlShellPwd();
7970    test_ret += test_xmlShellSave();
7971    test_ret += test_xmlShellValidate();
7972    test_ret += test_xmlShellWrite();
7973
7974    if (test_ret != 0)
7975	printf("Module debugXML: %d errors\n", test_ret);
7976    return(test_ret);
7977}
7978
7979static int
7980test_xmlDictCleanup(void) {
7981    int test_ret = 0;
7982
7983    int mem_base;
7984
7985        mem_base = xmlMemBlocks();
7986
7987        xmlDictCleanup();
7988        call_tests++;
7989        xmlResetLastError();
7990        if (mem_base != xmlMemBlocks()) {
7991            printf("Leak of %d blocks found in xmlDictCleanup",
7992	           xmlMemBlocks() - mem_base);
7993	    test_ret++;
7994            printf("\n");
7995        }
7996    function_tests++;
7997
7998    return(test_ret);
7999}
8000
8001
8002static int
8003test_xmlDictCreate(void) {
8004    int test_ret = 0;
8005
8006    int mem_base;
8007    xmlDictPtr ret_val;
8008
8009        mem_base = xmlMemBlocks();
8010
8011        ret_val = xmlDictCreate();
8012        desret_xmlDictPtr(ret_val);
8013        call_tests++;
8014        xmlResetLastError();
8015        if (mem_base != xmlMemBlocks()) {
8016            printf("Leak of %d blocks found in xmlDictCreate",
8017	           xmlMemBlocks() - mem_base);
8018	    test_ret++;
8019            printf("\n");
8020        }
8021    function_tests++;
8022
8023    return(test_ret);
8024}
8025
8026
8027static int
8028test_xmlDictCreateSub(void) {
8029    int test_ret = 0;
8030
8031    int mem_base;
8032    xmlDictPtr ret_val;
8033    xmlDictPtr sub; /* an existing dictionnary */
8034    int n_sub;
8035
8036    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8037        mem_base = xmlMemBlocks();
8038        sub = gen_xmlDictPtr(n_sub, 0);
8039
8040        ret_val = xmlDictCreateSub(sub);
8041        desret_xmlDictPtr(ret_val);
8042        call_tests++;
8043        des_xmlDictPtr(n_sub, sub, 0);
8044        xmlResetLastError();
8045        if (mem_base != xmlMemBlocks()) {
8046            printf("Leak of %d blocks found in xmlDictCreateSub",
8047	           xmlMemBlocks() - mem_base);
8048	    test_ret++;
8049            printf(" %d", n_sub);
8050            printf("\n");
8051        }
8052    }
8053    function_tests++;
8054
8055    return(test_ret);
8056}
8057
8058
8059static int
8060test_xmlDictExists(void) {
8061    int test_ret = 0;
8062
8063    int mem_base;
8064    const xmlChar * ret_val;
8065    xmlDictPtr dict; /* the dictionnary */
8066    int n_dict;
8067    xmlChar * name; /* the name of the userdata */
8068    int n_name;
8069    int len; /* the length of the name, if -1 it is recomputed */
8070    int n_len;
8071
8072    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8073    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8074    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8075        mem_base = xmlMemBlocks();
8076        dict = gen_xmlDictPtr(n_dict, 0);
8077        name = gen_const_xmlChar_ptr(n_name, 1);
8078        len = gen_int(n_len, 2);
8079
8080        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8081        desret_const_xmlChar_ptr(ret_val);
8082        call_tests++;
8083        des_xmlDictPtr(n_dict, dict, 0);
8084        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8085        des_int(n_len, len, 2);
8086        xmlResetLastError();
8087        if (mem_base != xmlMemBlocks()) {
8088            printf("Leak of %d blocks found in xmlDictExists",
8089	           xmlMemBlocks() - mem_base);
8090	    test_ret++;
8091            printf(" %d", n_dict);
8092            printf(" %d", n_name);
8093            printf(" %d", n_len);
8094            printf("\n");
8095        }
8096    }
8097    }
8098    }
8099    function_tests++;
8100
8101    return(test_ret);
8102}
8103
8104
8105static int
8106test_xmlDictLookup(void) {
8107    int test_ret = 0;
8108
8109    int mem_base;
8110    const xmlChar * ret_val;
8111    xmlDictPtr dict; /* the dictionnary */
8112    int n_dict;
8113    xmlChar * name; /* the name of the userdata */
8114    int n_name;
8115    int len; /* the length of the name, if -1 it is recomputed */
8116    int n_len;
8117
8118    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8119    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8120    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8121        mem_base = xmlMemBlocks();
8122        dict = gen_xmlDictPtr(n_dict, 0);
8123        name = gen_const_xmlChar_ptr(n_name, 1);
8124        len = gen_int(n_len, 2);
8125
8126        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8127        desret_const_xmlChar_ptr(ret_val);
8128        call_tests++;
8129        des_xmlDictPtr(n_dict, dict, 0);
8130        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8131        des_int(n_len, len, 2);
8132        xmlResetLastError();
8133        if (mem_base != xmlMemBlocks()) {
8134            printf("Leak of %d blocks found in xmlDictLookup",
8135	           xmlMemBlocks() - mem_base);
8136	    test_ret++;
8137            printf(" %d", n_dict);
8138            printf(" %d", n_name);
8139            printf(" %d", n_len);
8140            printf("\n");
8141        }
8142    }
8143    }
8144    }
8145    function_tests++;
8146
8147    return(test_ret);
8148}
8149
8150
8151static int
8152test_xmlDictOwns(void) {
8153    int test_ret = 0;
8154
8155    int mem_base;
8156    int ret_val;
8157    xmlDictPtr dict; /* the dictionnary */
8158    int n_dict;
8159    xmlChar * str; /* the string */
8160    int n_str;
8161
8162    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8163    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8164        mem_base = xmlMemBlocks();
8165        dict = gen_xmlDictPtr(n_dict, 0);
8166        str = gen_const_xmlChar_ptr(n_str, 1);
8167
8168        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8169        desret_int(ret_val);
8170        call_tests++;
8171        des_xmlDictPtr(n_dict, dict, 0);
8172        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8173        xmlResetLastError();
8174        if (mem_base != xmlMemBlocks()) {
8175            printf("Leak of %d blocks found in xmlDictOwns",
8176	           xmlMemBlocks() - mem_base);
8177	    test_ret++;
8178            printf(" %d", n_dict);
8179            printf(" %d", n_str);
8180            printf("\n");
8181        }
8182    }
8183    }
8184    function_tests++;
8185
8186    return(test_ret);
8187}
8188
8189
8190static int
8191test_xmlDictQLookup(void) {
8192    int test_ret = 0;
8193
8194    int mem_base;
8195    const xmlChar * ret_val;
8196    xmlDictPtr dict; /* the dictionnary */
8197    int n_dict;
8198    xmlChar * prefix; /* the prefix */
8199    int n_prefix;
8200    xmlChar * name; /* the name */
8201    int n_name;
8202
8203    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8204    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8205    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8206        mem_base = xmlMemBlocks();
8207        dict = gen_xmlDictPtr(n_dict, 0);
8208        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8209        name = gen_const_xmlChar_ptr(n_name, 2);
8210
8211        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8212        desret_const_xmlChar_ptr(ret_val);
8213        call_tests++;
8214        des_xmlDictPtr(n_dict, dict, 0);
8215        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8216        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8217        xmlResetLastError();
8218        if (mem_base != xmlMemBlocks()) {
8219            printf("Leak of %d blocks found in xmlDictQLookup",
8220	           xmlMemBlocks() - mem_base);
8221	    test_ret++;
8222            printf(" %d", n_dict);
8223            printf(" %d", n_prefix);
8224            printf(" %d", n_name);
8225            printf("\n");
8226        }
8227    }
8228    }
8229    }
8230    function_tests++;
8231
8232    return(test_ret);
8233}
8234
8235
8236static int
8237test_xmlDictReference(void) {
8238    int test_ret = 0;
8239
8240    int mem_base;
8241    int ret_val;
8242    xmlDictPtr dict; /* the dictionnary */
8243    int n_dict;
8244
8245    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8246        mem_base = xmlMemBlocks();
8247        dict = gen_xmlDictPtr(n_dict, 0);
8248
8249        ret_val = xmlDictReference(dict);
8250        xmlDictFree(dict);
8251        desret_int(ret_val);
8252        call_tests++;
8253        des_xmlDictPtr(n_dict, dict, 0);
8254        xmlResetLastError();
8255        if (mem_base != xmlMemBlocks()) {
8256            printf("Leak of %d blocks found in xmlDictReference",
8257	           xmlMemBlocks() - mem_base);
8258	    test_ret++;
8259            printf(" %d", n_dict);
8260            printf("\n");
8261        }
8262    }
8263    function_tests++;
8264
8265    return(test_ret);
8266}
8267
8268
8269static int
8270test_xmlDictSize(void) {
8271    int test_ret = 0;
8272
8273    int mem_base;
8274    int ret_val;
8275    xmlDictPtr dict; /* the dictionnary */
8276    int n_dict;
8277
8278    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8279        mem_base = xmlMemBlocks();
8280        dict = gen_xmlDictPtr(n_dict, 0);
8281
8282        ret_val = xmlDictSize(dict);
8283        desret_int(ret_val);
8284        call_tests++;
8285        des_xmlDictPtr(n_dict, dict, 0);
8286        xmlResetLastError();
8287        if (mem_base != xmlMemBlocks()) {
8288            printf("Leak of %d blocks found in xmlDictSize",
8289	           xmlMemBlocks() - mem_base);
8290	    test_ret++;
8291            printf(" %d", n_dict);
8292            printf("\n");
8293        }
8294    }
8295    function_tests++;
8296
8297    return(test_ret);
8298}
8299
8300static int
8301test_dict(void) {
8302    int test_ret = 0;
8303
8304    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8305    test_ret += test_xmlDictCleanup();
8306    test_ret += test_xmlDictCreate();
8307    test_ret += test_xmlDictCreateSub();
8308    test_ret += test_xmlDictExists();
8309    test_ret += test_xmlDictLookup();
8310    test_ret += test_xmlDictOwns();
8311    test_ret += test_xmlDictQLookup();
8312    test_ret += test_xmlDictReference();
8313    test_ret += test_xmlDictSize();
8314
8315    if (test_ret != 0)
8316	printf("Module dict: %d errors\n", test_ret);
8317    return(test_ret);
8318}
8319
8320static int
8321test_UTF8Toisolat1(void) {
8322    int test_ret = 0;
8323
8324#if defined(LIBXML_OUTPUT_ENABLED)
8325#ifdef LIBXML_OUTPUT_ENABLED
8326    int mem_base;
8327    int ret_val;
8328    unsigned char * out; /* a pointer to an array of bytes to store the result */
8329    int n_out;
8330    int * outlen; /* the length of @out */
8331    int n_outlen;
8332    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8333    int n_in;
8334    int * inlen; /* the length of @in */
8335    int n_inlen;
8336
8337    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8338    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8339    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8340    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8341        mem_base = xmlMemBlocks();
8342        out = gen_unsigned_char_ptr(n_out, 0);
8343        outlen = gen_int_ptr(n_outlen, 1);
8344        in = gen_const_unsigned_char_ptr(n_in, 2);
8345        inlen = gen_int_ptr(n_inlen, 3);
8346
8347        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8348        desret_int(ret_val);
8349        call_tests++;
8350        des_unsigned_char_ptr(n_out, out, 0);
8351        des_int_ptr(n_outlen, outlen, 1);
8352        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8353        des_int_ptr(n_inlen, inlen, 3);
8354        xmlResetLastError();
8355        if (mem_base != xmlMemBlocks()) {
8356            printf("Leak of %d blocks found in UTF8Toisolat1",
8357	           xmlMemBlocks() - mem_base);
8358	    test_ret++;
8359            printf(" %d", n_out);
8360            printf(" %d", n_outlen);
8361            printf(" %d", n_in);
8362            printf(" %d", n_inlen);
8363            printf("\n");
8364        }
8365    }
8366    }
8367    }
8368    }
8369    function_tests++;
8370#endif
8371#endif
8372
8373    return(test_ret);
8374}
8375
8376
8377static int
8378test_isolat1ToUTF8(void) {
8379    int test_ret = 0;
8380
8381    int mem_base;
8382    int ret_val;
8383    unsigned char * out; /* a pointer to an array of bytes to store the result */
8384    int n_out;
8385    int * outlen; /* the length of @out */
8386    int n_outlen;
8387    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8388    int n_in;
8389    int * inlen; /* the length of @in */
8390    int n_inlen;
8391
8392    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8393    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8394    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8395    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8396        mem_base = xmlMemBlocks();
8397        out = gen_unsigned_char_ptr(n_out, 0);
8398        outlen = gen_int_ptr(n_outlen, 1);
8399        in = gen_const_unsigned_char_ptr(n_in, 2);
8400        inlen = gen_int_ptr(n_inlen, 3);
8401
8402        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8403        desret_int(ret_val);
8404        call_tests++;
8405        des_unsigned_char_ptr(n_out, out, 0);
8406        des_int_ptr(n_outlen, outlen, 1);
8407        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8408        des_int_ptr(n_inlen, inlen, 3);
8409        xmlResetLastError();
8410        if (mem_base != xmlMemBlocks()) {
8411            printf("Leak of %d blocks found in isolat1ToUTF8",
8412	           xmlMemBlocks() - mem_base);
8413	    test_ret++;
8414            printf(" %d", n_out);
8415            printf(" %d", n_outlen);
8416            printf(" %d", n_in);
8417            printf(" %d", n_inlen);
8418            printf("\n");
8419        }
8420    }
8421    }
8422    }
8423    }
8424    function_tests++;
8425
8426    return(test_ret);
8427}
8428
8429
8430static int
8431test_xmlAddEncodingAlias(void) {
8432    int test_ret = 0;
8433
8434    int ret_val;
8435    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8436    int n_name;
8437    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8438    int n_alias;
8439
8440    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8441    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8442        name = gen_const_char_ptr(n_name, 0);
8443        alias = gen_const_char_ptr(n_alias, 1);
8444
8445        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8446        desret_int(ret_val);
8447        call_tests++;
8448        des_const_char_ptr(n_name, (const char *)name, 0);
8449        des_const_char_ptr(n_alias, (const char *)alias, 1);
8450        xmlResetLastError();
8451    }
8452    }
8453    function_tests++;
8454
8455    return(test_ret);
8456}
8457
8458
8459#define gen_nb_xmlCharEncodingHandler_ptr 1
8460static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8461    return(NULL);
8462}
8463static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8464}
8465
8466static int
8467test_xmlCharEncCloseFunc(void) {
8468    int test_ret = 0;
8469
8470    int mem_base;
8471    int ret_val;
8472    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8473    int n_handler;
8474
8475    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8476        mem_base = xmlMemBlocks();
8477        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8478
8479        ret_val = xmlCharEncCloseFunc(handler);
8480        desret_int(ret_val);
8481        call_tests++;
8482        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8483        xmlResetLastError();
8484        if (mem_base != xmlMemBlocks()) {
8485            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8486	           xmlMemBlocks() - mem_base);
8487	    test_ret++;
8488            printf(" %d", n_handler);
8489            printf("\n");
8490        }
8491    }
8492    function_tests++;
8493
8494    return(test_ret);
8495}
8496
8497
8498static int
8499test_xmlCharEncFirstLine(void) {
8500    int test_ret = 0;
8501
8502    int mem_base;
8503    int ret_val;
8504    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8505    int n_handler;
8506    xmlBufferPtr out; /* an xmlBuffer for the output. */
8507    int n_out;
8508    xmlBufferPtr in; /* an xmlBuffer for the input */
8509    int n_in;
8510
8511    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8512    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8513    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8514        mem_base = xmlMemBlocks();
8515        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8516        out = gen_xmlBufferPtr(n_out, 1);
8517        in = gen_xmlBufferPtr(n_in, 2);
8518
8519        ret_val = xmlCharEncFirstLine(handler, out, in);
8520        desret_int(ret_val);
8521        call_tests++;
8522        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8523        des_xmlBufferPtr(n_out, out, 1);
8524        des_xmlBufferPtr(n_in, in, 2);
8525        xmlResetLastError();
8526        if (mem_base != xmlMemBlocks()) {
8527            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8528	           xmlMemBlocks() - mem_base);
8529	    test_ret++;
8530            printf(" %d", n_handler);
8531            printf(" %d", n_out);
8532            printf(" %d", n_in);
8533            printf("\n");
8534        }
8535    }
8536    }
8537    }
8538    function_tests++;
8539
8540    return(test_ret);
8541}
8542
8543
8544static int
8545test_xmlCharEncInFunc(void) {
8546    int test_ret = 0;
8547
8548    int mem_base;
8549    int ret_val;
8550    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8551    int n_handler;
8552    xmlBufferPtr out; /* an xmlBuffer for the output. */
8553    int n_out;
8554    xmlBufferPtr in; /* an xmlBuffer for the input */
8555    int n_in;
8556
8557    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8558    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8559    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8560        mem_base = xmlMemBlocks();
8561        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8562        out = gen_xmlBufferPtr(n_out, 1);
8563        in = gen_xmlBufferPtr(n_in, 2);
8564
8565        ret_val = xmlCharEncInFunc(handler, out, in);
8566        desret_int(ret_val);
8567        call_tests++;
8568        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8569        des_xmlBufferPtr(n_out, out, 1);
8570        des_xmlBufferPtr(n_in, in, 2);
8571        xmlResetLastError();
8572        if (mem_base != xmlMemBlocks()) {
8573            printf("Leak of %d blocks found in xmlCharEncInFunc",
8574	           xmlMemBlocks() - mem_base);
8575	    test_ret++;
8576            printf(" %d", n_handler);
8577            printf(" %d", n_out);
8578            printf(" %d", n_in);
8579            printf("\n");
8580        }
8581    }
8582    }
8583    }
8584    function_tests++;
8585
8586    return(test_ret);
8587}
8588
8589
8590static int
8591test_xmlCharEncOutFunc(void) {
8592    int test_ret = 0;
8593
8594    int mem_base;
8595    int ret_val;
8596    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8597    int n_handler;
8598    xmlBufferPtr out; /* an xmlBuffer for the output. */
8599    int n_out;
8600    xmlBufferPtr in; /* an xmlBuffer for the input */
8601    int n_in;
8602
8603    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8604    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8605    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8606        mem_base = xmlMemBlocks();
8607        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8608        out = gen_xmlBufferPtr(n_out, 1);
8609        in = gen_xmlBufferPtr(n_in, 2);
8610
8611        ret_val = xmlCharEncOutFunc(handler, out, in);
8612        desret_int(ret_val);
8613        call_tests++;
8614        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8615        des_xmlBufferPtr(n_out, out, 1);
8616        des_xmlBufferPtr(n_in, in, 2);
8617        xmlResetLastError();
8618        if (mem_base != xmlMemBlocks()) {
8619            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8620	           xmlMemBlocks() - mem_base);
8621	    test_ret++;
8622            printf(" %d", n_handler);
8623            printf(" %d", n_out);
8624            printf(" %d", n_in);
8625            printf("\n");
8626        }
8627    }
8628    }
8629    }
8630    function_tests++;
8631
8632    return(test_ret);
8633}
8634
8635
8636static int
8637test_xmlCleanupCharEncodingHandlers(void) {
8638    int test_ret = 0;
8639
8640
8641
8642        xmlCleanupCharEncodingHandlers();
8643        call_tests++;
8644        xmlResetLastError();
8645    function_tests++;
8646
8647    return(test_ret);
8648}
8649
8650
8651static int
8652test_xmlCleanupEncodingAliases(void) {
8653    int test_ret = 0;
8654
8655    int mem_base;
8656
8657        mem_base = xmlMemBlocks();
8658
8659        xmlCleanupEncodingAliases();
8660        call_tests++;
8661        xmlResetLastError();
8662        if (mem_base != xmlMemBlocks()) {
8663            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8664	           xmlMemBlocks() - mem_base);
8665	    test_ret++;
8666            printf("\n");
8667        }
8668    function_tests++;
8669
8670    return(test_ret);
8671}
8672
8673
8674static int
8675test_xmlDelEncodingAlias(void) {
8676    int test_ret = 0;
8677
8678    int mem_base;
8679    int ret_val;
8680    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8681    int n_alias;
8682
8683    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8684        mem_base = xmlMemBlocks();
8685        alias = gen_const_char_ptr(n_alias, 0);
8686
8687        ret_val = xmlDelEncodingAlias((const char *)alias);
8688        desret_int(ret_val);
8689        call_tests++;
8690        des_const_char_ptr(n_alias, (const char *)alias, 0);
8691        xmlResetLastError();
8692        if (mem_base != xmlMemBlocks()) {
8693            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8694	           xmlMemBlocks() - mem_base);
8695	    test_ret++;
8696            printf(" %d", n_alias);
8697            printf("\n");
8698        }
8699    }
8700    function_tests++;
8701
8702    return(test_ret);
8703}
8704
8705
8706static int
8707test_xmlDetectCharEncoding(void) {
8708    int test_ret = 0;
8709
8710    int mem_base;
8711    xmlCharEncoding ret_val;
8712    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). */
8713    int n_in;
8714    int len; /* pointer to the length of the buffer */
8715    int n_len;
8716
8717    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8718    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8719        mem_base = xmlMemBlocks();
8720        in = gen_const_unsigned_char_ptr(n_in, 0);
8721        len = gen_int(n_len, 1);
8722
8723        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8724        desret_xmlCharEncoding(ret_val);
8725        call_tests++;
8726        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8727        des_int(n_len, len, 1);
8728        xmlResetLastError();
8729        if (mem_base != xmlMemBlocks()) {
8730            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8731	           xmlMemBlocks() - mem_base);
8732	    test_ret++;
8733            printf(" %d", n_in);
8734            printf(" %d", n_len);
8735            printf("\n");
8736        }
8737    }
8738    }
8739    function_tests++;
8740
8741    return(test_ret);
8742}
8743
8744
8745static int
8746test_xmlFindCharEncodingHandler(void) {
8747    int test_ret = 0;
8748
8749
8750    /* missing type support */
8751    return(test_ret);
8752}
8753
8754
8755static int
8756test_xmlGetCharEncodingHandler(void) {
8757    int test_ret = 0;
8758
8759
8760    /* missing type support */
8761    return(test_ret);
8762}
8763
8764
8765static int
8766test_xmlGetCharEncodingName(void) {
8767    int test_ret = 0;
8768
8769    int mem_base;
8770    const char * ret_val;
8771    xmlCharEncoding enc; /* the encoding */
8772    int n_enc;
8773
8774    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8775        mem_base = xmlMemBlocks();
8776        enc = gen_xmlCharEncoding(n_enc, 0);
8777
8778        ret_val = xmlGetCharEncodingName(enc);
8779        desret_const_char_ptr(ret_val);
8780        call_tests++;
8781        des_xmlCharEncoding(n_enc, enc, 0);
8782        xmlResetLastError();
8783        if (mem_base != xmlMemBlocks()) {
8784            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8785	           xmlMemBlocks() - mem_base);
8786	    test_ret++;
8787            printf(" %d", n_enc);
8788            printf("\n");
8789        }
8790    }
8791    function_tests++;
8792
8793    return(test_ret);
8794}
8795
8796
8797static int
8798test_xmlGetEncodingAlias(void) {
8799    int test_ret = 0;
8800
8801    int mem_base;
8802    const char * ret_val;
8803    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8804    int n_alias;
8805
8806    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8807        mem_base = xmlMemBlocks();
8808        alias = gen_const_char_ptr(n_alias, 0);
8809
8810        ret_val = xmlGetEncodingAlias((const char *)alias);
8811        desret_const_char_ptr(ret_val);
8812        call_tests++;
8813        des_const_char_ptr(n_alias, (const char *)alias, 0);
8814        xmlResetLastError();
8815        if (mem_base != xmlMemBlocks()) {
8816            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8817	           xmlMemBlocks() - mem_base);
8818	    test_ret++;
8819            printf(" %d", n_alias);
8820            printf("\n");
8821        }
8822    }
8823    function_tests++;
8824
8825    return(test_ret);
8826}
8827
8828
8829static int
8830test_xmlInitCharEncodingHandlers(void) {
8831    int test_ret = 0;
8832
8833
8834
8835        xmlInitCharEncodingHandlers();
8836        call_tests++;
8837        xmlResetLastError();
8838    function_tests++;
8839
8840    return(test_ret);
8841}
8842
8843
8844static int
8845test_xmlNewCharEncodingHandler(void) {
8846    int test_ret = 0;
8847
8848
8849    /* missing type support */
8850    return(test_ret);
8851}
8852
8853
8854static int
8855test_xmlParseCharEncoding(void) {
8856    int test_ret = 0;
8857
8858    int mem_base;
8859    xmlCharEncoding ret_val;
8860    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8861    int n_name;
8862
8863    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8864        mem_base = xmlMemBlocks();
8865        name = gen_const_char_ptr(n_name, 0);
8866
8867        ret_val = xmlParseCharEncoding((const char *)name);
8868        desret_xmlCharEncoding(ret_val);
8869        call_tests++;
8870        des_const_char_ptr(n_name, (const char *)name, 0);
8871        xmlResetLastError();
8872        if (mem_base != xmlMemBlocks()) {
8873            printf("Leak of %d blocks found in xmlParseCharEncoding",
8874	           xmlMemBlocks() - mem_base);
8875	    test_ret++;
8876            printf(" %d", n_name);
8877            printf("\n");
8878        }
8879    }
8880    function_tests++;
8881
8882    return(test_ret);
8883}
8884
8885
8886#define gen_nb_xmlCharEncodingHandlerPtr 1
8887static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8888    return(NULL);
8889}
8890static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8891}
8892
8893static int
8894test_xmlRegisterCharEncodingHandler(void) {
8895    int test_ret = 0;
8896
8897    int mem_base;
8898    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
8899    int n_handler;
8900
8901    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
8902        mem_base = xmlMemBlocks();
8903        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
8904
8905        xmlRegisterCharEncodingHandler(handler);
8906        call_tests++;
8907        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
8908        xmlResetLastError();
8909        if (mem_base != xmlMemBlocks()) {
8910            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
8911	           xmlMemBlocks() - mem_base);
8912	    test_ret++;
8913            printf(" %d", n_handler);
8914            printf("\n");
8915        }
8916    }
8917    function_tests++;
8918
8919    return(test_ret);
8920}
8921
8922static int
8923test_encoding(void) {
8924    int test_ret = 0;
8925
8926    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
8927    test_ret += test_UTF8Toisolat1();
8928    test_ret += test_isolat1ToUTF8();
8929    test_ret += test_xmlAddEncodingAlias();
8930    test_ret += test_xmlCharEncCloseFunc();
8931    test_ret += test_xmlCharEncFirstLine();
8932    test_ret += test_xmlCharEncInFunc();
8933    test_ret += test_xmlCharEncOutFunc();
8934    test_ret += test_xmlCleanupCharEncodingHandlers();
8935    test_ret += test_xmlCleanupEncodingAliases();
8936    test_ret += test_xmlDelEncodingAlias();
8937    test_ret += test_xmlDetectCharEncoding();
8938    test_ret += test_xmlFindCharEncodingHandler();
8939    test_ret += test_xmlGetCharEncodingHandler();
8940    test_ret += test_xmlGetCharEncodingName();
8941    test_ret += test_xmlGetEncodingAlias();
8942    test_ret += test_xmlInitCharEncodingHandlers();
8943    test_ret += test_xmlNewCharEncodingHandler();
8944    test_ret += test_xmlParseCharEncoding();
8945    test_ret += test_xmlRegisterCharEncodingHandler();
8946
8947    if (test_ret != 0)
8948	printf("Module encoding: %d errors\n", test_ret);
8949    return(test_ret);
8950}
8951
8952static int
8953test_xmlAddDocEntity(void) {
8954    int test_ret = 0;
8955
8956    int mem_base;
8957    xmlEntityPtr ret_val;
8958    xmlDocPtr doc; /* the document */
8959    int n_doc;
8960    xmlChar * name; /* the entity name */
8961    int n_name;
8962    int type; /* the entity type XML_xxx_yyy_ENTITY */
8963    int n_type;
8964    xmlChar * ExternalID; /* the entity external ID if available */
8965    int n_ExternalID;
8966    xmlChar * SystemID; /* the entity system ID if available */
8967    int n_SystemID;
8968    xmlChar * content; /* the entity content */
8969    int n_content;
8970
8971    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
8972    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8973    for (n_type = 0;n_type < gen_nb_int;n_type++) {
8974    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
8975    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
8976    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
8977        mem_base = xmlMemBlocks();
8978        doc = gen_xmlDocPtr(n_doc, 0);
8979        name = gen_const_xmlChar_ptr(n_name, 1);
8980        type = gen_int(n_type, 2);
8981        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
8982        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
8983        content = gen_const_xmlChar_ptr(n_content, 5);
8984
8985        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
8986        desret_xmlEntityPtr(ret_val);
8987        call_tests++;
8988        des_xmlDocPtr(n_doc, doc, 0);
8989        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8990        des_int(n_type, type, 2);
8991        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
8992        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
8993        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
8994        xmlResetLastError();
8995        if (mem_base != xmlMemBlocks()) {
8996            printf("Leak of %d blocks found in xmlAddDocEntity",
8997	           xmlMemBlocks() - mem_base);
8998	    test_ret++;
8999            printf(" %d", n_doc);
9000            printf(" %d", n_name);
9001            printf(" %d", n_type);
9002            printf(" %d", n_ExternalID);
9003            printf(" %d", n_SystemID);
9004            printf(" %d", n_content);
9005            printf("\n");
9006        }
9007    }
9008    }
9009    }
9010    }
9011    }
9012    }
9013    function_tests++;
9014
9015    return(test_ret);
9016}
9017
9018
9019static int
9020test_xmlAddDtdEntity(void) {
9021    int test_ret = 0;
9022
9023    int mem_base;
9024    xmlEntityPtr ret_val;
9025    xmlDocPtr doc; /* the document */
9026    int n_doc;
9027    xmlChar * name; /* the entity name */
9028    int n_name;
9029    int type; /* the entity type XML_xxx_yyy_ENTITY */
9030    int n_type;
9031    xmlChar * ExternalID; /* the entity external ID if available */
9032    int n_ExternalID;
9033    xmlChar * SystemID; /* the entity system ID if available */
9034    int n_SystemID;
9035    xmlChar * content; /* the entity content */
9036    int n_content;
9037
9038    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9039    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9040    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9041    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9042    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9043    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9044        mem_base = xmlMemBlocks();
9045        doc = gen_xmlDocPtr(n_doc, 0);
9046        name = gen_const_xmlChar_ptr(n_name, 1);
9047        type = gen_int(n_type, 2);
9048        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9049        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9050        content = gen_const_xmlChar_ptr(n_content, 5);
9051
9052        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9053        desret_xmlEntityPtr(ret_val);
9054        call_tests++;
9055        des_xmlDocPtr(n_doc, doc, 0);
9056        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9057        des_int(n_type, type, 2);
9058        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9059        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9060        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9061        xmlResetLastError();
9062        if (mem_base != xmlMemBlocks()) {
9063            printf("Leak of %d blocks found in xmlAddDtdEntity",
9064	           xmlMemBlocks() - mem_base);
9065	    test_ret++;
9066            printf(" %d", n_doc);
9067            printf(" %d", n_name);
9068            printf(" %d", n_type);
9069            printf(" %d", n_ExternalID);
9070            printf(" %d", n_SystemID);
9071            printf(" %d", n_content);
9072            printf("\n");
9073        }
9074    }
9075    }
9076    }
9077    }
9078    }
9079    }
9080    function_tests++;
9081
9082    return(test_ret);
9083}
9084
9085
9086static int
9087test_xmlCleanupPredefinedEntities(void) {
9088    int test_ret = 0;
9089
9090#if defined(LIBXML_LEGACY_ENABLED)
9091#ifdef LIBXML_LEGACY_ENABLED
9092    int mem_base;
9093
9094        mem_base = xmlMemBlocks();
9095
9096        xmlCleanupPredefinedEntities();
9097        call_tests++;
9098        xmlResetLastError();
9099        if (mem_base != xmlMemBlocks()) {
9100            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9101	           xmlMemBlocks() - mem_base);
9102	    test_ret++;
9103            printf("\n");
9104        }
9105    function_tests++;
9106#endif
9107#endif
9108
9109    return(test_ret);
9110}
9111
9112
9113#define gen_nb_xmlEntitiesTablePtr 1
9114static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9115    return(NULL);
9116}
9117static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9118}
9119
9120static int
9121test_xmlCopyEntitiesTable(void) {
9122    int test_ret = 0;
9123
9124
9125    /* missing type support */
9126    return(test_ret);
9127}
9128
9129
9130static int
9131test_xmlCreateEntitiesTable(void) {
9132    int test_ret = 0;
9133
9134
9135    /* missing type support */
9136    return(test_ret);
9137}
9138
9139
9140static int
9141test_xmlDumpEntitiesTable(void) {
9142    int test_ret = 0;
9143
9144#if defined(LIBXML_OUTPUT_ENABLED)
9145    int mem_base;
9146    xmlBufferPtr buf; /* An XML buffer. */
9147    int n_buf;
9148    xmlEntitiesTablePtr table; /* An entity table */
9149    int n_table;
9150
9151    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9152    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9153        mem_base = xmlMemBlocks();
9154        buf = gen_xmlBufferPtr(n_buf, 0);
9155        table = gen_xmlEntitiesTablePtr(n_table, 1);
9156
9157        xmlDumpEntitiesTable(buf, table);
9158        call_tests++;
9159        des_xmlBufferPtr(n_buf, buf, 0);
9160        des_xmlEntitiesTablePtr(n_table, table, 1);
9161        xmlResetLastError();
9162        if (mem_base != xmlMemBlocks()) {
9163            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9164	           xmlMemBlocks() - mem_base);
9165	    test_ret++;
9166            printf(" %d", n_buf);
9167            printf(" %d", n_table);
9168            printf("\n");
9169        }
9170    }
9171    }
9172    function_tests++;
9173#endif
9174
9175    return(test_ret);
9176}
9177
9178
9179#define gen_nb_xmlEntityPtr 1
9180static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9181    return(NULL);
9182}
9183static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9184}
9185
9186static int
9187test_xmlDumpEntityDecl(void) {
9188    int test_ret = 0;
9189
9190#if defined(LIBXML_OUTPUT_ENABLED)
9191    int mem_base;
9192    xmlBufferPtr buf; /* An XML buffer. */
9193    int n_buf;
9194    xmlEntityPtr ent; /* An entity table */
9195    int n_ent;
9196
9197    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9198    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9199        mem_base = xmlMemBlocks();
9200        buf = gen_xmlBufferPtr(n_buf, 0);
9201        ent = gen_xmlEntityPtr(n_ent, 1);
9202
9203        xmlDumpEntityDecl(buf, ent);
9204        call_tests++;
9205        des_xmlBufferPtr(n_buf, buf, 0);
9206        des_xmlEntityPtr(n_ent, ent, 1);
9207        xmlResetLastError();
9208        if (mem_base != xmlMemBlocks()) {
9209            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9210	           xmlMemBlocks() - mem_base);
9211	    test_ret++;
9212            printf(" %d", n_buf);
9213            printf(" %d", n_ent);
9214            printf("\n");
9215        }
9216    }
9217    }
9218    function_tests++;
9219#endif
9220
9221    return(test_ret);
9222}
9223
9224
9225static int
9226test_xmlEncodeEntitiesReentrant(void) {
9227    int test_ret = 0;
9228
9229    int mem_base;
9230    xmlChar * ret_val;
9231    xmlDocPtr doc; /* the document containing the string */
9232    int n_doc;
9233    xmlChar * input; /* A string to convert to XML. */
9234    int n_input;
9235
9236    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9237    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9238        mem_base = xmlMemBlocks();
9239        doc = gen_xmlDocPtr(n_doc, 0);
9240        input = gen_const_xmlChar_ptr(n_input, 1);
9241
9242        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9243        desret_xmlChar_ptr(ret_val);
9244        call_tests++;
9245        des_xmlDocPtr(n_doc, doc, 0);
9246        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9247        xmlResetLastError();
9248        if (mem_base != xmlMemBlocks()) {
9249            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9250	           xmlMemBlocks() - mem_base);
9251	    test_ret++;
9252            printf(" %d", n_doc);
9253            printf(" %d", n_input);
9254            printf("\n");
9255        }
9256    }
9257    }
9258    function_tests++;
9259
9260    return(test_ret);
9261}
9262
9263
9264static int
9265test_xmlEncodeSpecialChars(void) {
9266    int test_ret = 0;
9267
9268    int mem_base;
9269    xmlChar * ret_val;
9270    xmlDocPtr doc; /* the document containing the string */
9271    int n_doc;
9272    xmlChar * input; /* A string to convert to XML. */
9273    int n_input;
9274
9275    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9276    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9277        mem_base = xmlMemBlocks();
9278        doc = gen_xmlDocPtr(n_doc, 0);
9279        input = gen_const_xmlChar_ptr(n_input, 1);
9280
9281        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9282        desret_xmlChar_ptr(ret_val);
9283        call_tests++;
9284        des_xmlDocPtr(n_doc, doc, 0);
9285        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9286        xmlResetLastError();
9287        if (mem_base != xmlMemBlocks()) {
9288            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9289	           xmlMemBlocks() - mem_base);
9290	    test_ret++;
9291            printf(" %d", n_doc);
9292            printf(" %d", n_input);
9293            printf("\n");
9294        }
9295    }
9296    }
9297    function_tests++;
9298
9299    return(test_ret);
9300}
9301
9302
9303static int
9304test_xmlGetDocEntity(void) {
9305    int test_ret = 0;
9306
9307    int mem_base;
9308    xmlEntityPtr ret_val;
9309    xmlDocPtr doc; /* the document referencing the entity */
9310    int n_doc;
9311    xmlChar * name; /* the entity name */
9312    int n_name;
9313
9314    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9315    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9316        mem_base = xmlMemBlocks();
9317        doc = gen_xmlDocPtr(n_doc, 0);
9318        name = gen_const_xmlChar_ptr(n_name, 1);
9319
9320        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9321        desret_xmlEntityPtr(ret_val);
9322        call_tests++;
9323        des_xmlDocPtr(n_doc, doc, 0);
9324        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9325        xmlResetLastError();
9326        if (mem_base != xmlMemBlocks()) {
9327            printf("Leak of %d blocks found in xmlGetDocEntity",
9328	           xmlMemBlocks() - mem_base);
9329	    test_ret++;
9330            printf(" %d", n_doc);
9331            printf(" %d", n_name);
9332            printf("\n");
9333        }
9334    }
9335    }
9336    function_tests++;
9337
9338    return(test_ret);
9339}
9340
9341
9342static int
9343test_xmlGetDtdEntity(void) {
9344    int test_ret = 0;
9345
9346    int mem_base;
9347    xmlEntityPtr ret_val;
9348    xmlDocPtr doc; /* the document referencing the entity */
9349    int n_doc;
9350    xmlChar * name; /* the entity name */
9351    int n_name;
9352
9353    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9354    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9355        mem_base = xmlMemBlocks();
9356        doc = gen_xmlDocPtr(n_doc, 0);
9357        name = gen_const_xmlChar_ptr(n_name, 1);
9358
9359        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9360        desret_xmlEntityPtr(ret_val);
9361        call_tests++;
9362        des_xmlDocPtr(n_doc, doc, 0);
9363        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9364        xmlResetLastError();
9365        if (mem_base != xmlMemBlocks()) {
9366            printf("Leak of %d blocks found in xmlGetDtdEntity",
9367	           xmlMemBlocks() - mem_base);
9368	    test_ret++;
9369            printf(" %d", n_doc);
9370            printf(" %d", n_name);
9371            printf("\n");
9372        }
9373    }
9374    }
9375    function_tests++;
9376
9377    return(test_ret);
9378}
9379
9380
9381static int
9382test_xmlGetParameterEntity(void) {
9383    int test_ret = 0;
9384
9385    int mem_base;
9386    xmlEntityPtr ret_val;
9387    xmlDocPtr doc; /* the document referencing the entity */
9388    int n_doc;
9389    xmlChar * name; /* the entity name */
9390    int n_name;
9391
9392    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9393    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9394        mem_base = xmlMemBlocks();
9395        doc = gen_xmlDocPtr(n_doc, 0);
9396        name = gen_const_xmlChar_ptr(n_name, 1);
9397
9398        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9399        desret_xmlEntityPtr(ret_val);
9400        call_tests++;
9401        des_xmlDocPtr(n_doc, doc, 0);
9402        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9403        xmlResetLastError();
9404        if (mem_base != xmlMemBlocks()) {
9405            printf("Leak of %d blocks found in xmlGetParameterEntity",
9406	           xmlMemBlocks() - mem_base);
9407	    test_ret++;
9408            printf(" %d", n_doc);
9409            printf(" %d", n_name);
9410            printf("\n");
9411        }
9412    }
9413    }
9414    function_tests++;
9415
9416    return(test_ret);
9417}
9418
9419
9420static int
9421test_xmlGetPredefinedEntity(void) {
9422    int test_ret = 0;
9423
9424    int mem_base;
9425    xmlEntityPtr ret_val;
9426    xmlChar * name; /* the entity name */
9427    int n_name;
9428
9429    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9430        mem_base = xmlMemBlocks();
9431        name = gen_const_xmlChar_ptr(n_name, 0);
9432
9433        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9434        desret_xmlEntityPtr(ret_val);
9435        call_tests++;
9436        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9437        xmlResetLastError();
9438        if (mem_base != xmlMemBlocks()) {
9439            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9440	           xmlMemBlocks() - mem_base);
9441	    test_ret++;
9442            printf(" %d", n_name);
9443            printf("\n");
9444        }
9445    }
9446    function_tests++;
9447
9448    return(test_ret);
9449}
9450
9451
9452static int
9453test_xmlInitializePredefinedEntities(void) {
9454    int test_ret = 0;
9455
9456#if defined(LIBXML_LEGACY_ENABLED)
9457#ifdef LIBXML_LEGACY_ENABLED
9458    int mem_base;
9459
9460        mem_base = xmlMemBlocks();
9461
9462        xmlInitializePredefinedEntities();
9463        call_tests++;
9464        xmlResetLastError();
9465        if (mem_base != xmlMemBlocks()) {
9466            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9467	           xmlMemBlocks() - mem_base);
9468	    test_ret++;
9469            printf("\n");
9470        }
9471    function_tests++;
9472#endif
9473#endif
9474
9475    return(test_ret);
9476}
9477
9478static int
9479test_entities(void) {
9480    int test_ret = 0;
9481
9482    if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
9483    test_ret += test_xmlAddDocEntity();
9484    test_ret += test_xmlAddDtdEntity();
9485    test_ret += test_xmlCleanupPredefinedEntities();
9486    test_ret += test_xmlCopyEntitiesTable();
9487    test_ret += test_xmlCreateEntitiesTable();
9488    test_ret += test_xmlDumpEntitiesTable();
9489    test_ret += test_xmlDumpEntityDecl();
9490    test_ret += test_xmlEncodeEntitiesReentrant();
9491    test_ret += test_xmlEncodeSpecialChars();
9492    test_ret += test_xmlGetDocEntity();
9493    test_ret += test_xmlGetDtdEntity();
9494    test_ret += test_xmlGetParameterEntity();
9495    test_ret += test_xmlGetPredefinedEntity();
9496    test_ret += test_xmlInitializePredefinedEntities();
9497
9498    if (test_ret != 0)
9499	printf("Module entities: %d errors\n", test_ret);
9500    return(test_ret);
9501}
9502
9503static int
9504test_xmlHashAddEntry(void) {
9505    int test_ret = 0;
9506
9507    int mem_base;
9508    int ret_val;
9509    xmlHashTablePtr table; /* the hash table */
9510    int n_table;
9511    xmlChar * name; /* the name of the userdata */
9512    int n_name;
9513    void * userdata; /* a pointer to the userdata */
9514    int n_userdata;
9515
9516    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9517    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9518    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9519        mem_base = xmlMemBlocks();
9520        table = gen_xmlHashTablePtr(n_table, 0);
9521        name = gen_const_xmlChar_ptr(n_name, 1);
9522        userdata = gen_userdata(n_userdata, 2);
9523
9524        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9525        desret_int(ret_val);
9526        call_tests++;
9527        des_xmlHashTablePtr(n_table, table, 0);
9528        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9529        des_userdata(n_userdata, userdata, 2);
9530        xmlResetLastError();
9531        if (mem_base != xmlMemBlocks()) {
9532            printf("Leak of %d blocks found in xmlHashAddEntry",
9533	           xmlMemBlocks() - mem_base);
9534	    test_ret++;
9535            printf(" %d", n_table);
9536            printf(" %d", n_name);
9537            printf(" %d", n_userdata);
9538            printf("\n");
9539        }
9540    }
9541    }
9542    }
9543    function_tests++;
9544
9545    return(test_ret);
9546}
9547
9548
9549static int
9550test_xmlHashAddEntry2(void) {
9551    int test_ret = 0;
9552
9553    int mem_base;
9554    int ret_val;
9555    xmlHashTablePtr table; /* the hash table */
9556    int n_table;
9557    xmlChar * name; /* the name of the userdata */
9558    int n_name;
9559    xmlChar * name2; /* a second name of the userdata */
9560    int n_name2;
9561    void * userdata; /* a pointer to the userdata */
9562    int n_userdata;
9563
9564    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9565    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9566    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9567    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9568        mem_base = xmlMemBlocks();
9569        table = gen_xmlHashTablePtr(n_table, 0);
9570        name = gen_const_xmlChar_ptr(n_name, 1);
9571        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9572        userdata = gen_userdata(n_userdata, 3);
9573
9574        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9575        desret_int(ret_val);
9576        call_tests++;
9577        des_xmlHashTablePtr(n_table, table, 0);
9578        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9579        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9580        des_userdata(n_userdata, userdata, 3);
9581        xmlResetLastError();
9582        if (mem_base != xmlMemBlocks()) {
9583            printf("Leak of %d blocks found in xmlHashAddEntry2",
9584	           xmlMemBlocks() - mem_base);
9585	    test_ret++;
9586            printf(" %d", n_table);
9587            printf(" %d", n_name);
9588            printf(" %d", n_name2);
9589            printf(" %d", n_userdata);
9590            printf("\n");
9591        }
9592    }
9593    }
9594    }
9595    }
9596    function_tests++;
9597
9598    return(test_ret);
9599}
9600
9601
9602static int
9603test_xmlHashAddEntry3(void) {
9604    int test_ret = 0;
9605
9606    int mem_base;
9607    int ret_val;
9608    xmlHashTablePtr table; /* the hash table */
9609    int n_table;
9610    xmlChar * name; /* the name of the userdata */
9611    int n_name;
9612    xmlChar * name2; /* a second name of the userdata */
9613    int n_name2;
9614    xmlChar * name3; /* a third name of the userdata */
9615    int n_name3;
9616    void * userdata; /* a pointer to the userdata */
9617    int n_userdata;
9618
9619    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9620    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9621    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9622    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9623    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9624        mem_base = xmlMemBlocks();
9625        table = gen_xmlHashTablePtr(n_table, 0);
9626        name = gen_const_xmlChar_ptr(n_name, 1);
9627        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9628        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9629        userdata = gen_userdata(n_userdata, 4);
9630
9631        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9632        desret_int(ret_val);
9633        call_tests++;
9634        des_xmlHashTablePtr(n_table, table, 0);
9635        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9636        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9637        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9638        des_userdata(n_userdata, userdata, 4);
9639        xmlResetLastError();
9640        if (mem_base != xmlMemBlocks()) {
9641            printf("Leak of %d blocks found in xmlHashAddEntry3",
9642	           xmlMemBlocks() - mem_base);
9643	    test_ret++;
9644            printf(" %d", n_table);
9645            printf(" %d", n_name);
9646            printf(" %d", n_name2);
9647            printf(" %d", n_name3);
9648            printf(" %d", n_userdata);
9649            printf("\n");
9650        }
9651    }
9652    }
9653    }
9654    }
9655    }
9656    function_tests++;
9657
9658    return(test_ret);
9659}
9660
9661
9662static int
9663test_xmlHashCopy(void) {
9664    int test_ret = 0;
9665
9666
9667    /* missing type support */
9668    return(test_ret);
9669}
9670
9671
9672static int
9673test_xmlHashCreate(void) {
9674    int test_ret = 0;
9675
9676
9677    /* missing type support */
9678    return(test_ret);
9679}
9680
9681
9682static int
9683test_xmlHashCreateDict(void) {
9684    int test_ret = 0;
9685
9686
9687    /* missing type support */
9688    return(test_ret);
9689}
9690
9691
9692static int
9693test_xmlHashLookup(void) {
9694    int test_ret = 0;
9695
9696    int mem_base;
9697    void * ret_val;
9698    xmlHashTablePtr table; /* the hash table */
9699    int n_table;
9700    xmlChar * name; /* the name of the userdata */
9701    int n_name;
9702
9703    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9704    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9705        mem_base = xmlMemBlocks();
9706        table = gen_xmlHashTablePtr(n_table, 0);
9707        name = gen_const_xmlChar_ptr(n_name, 1);
9708
9709        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9710        desret_void_ptr(ret_val);
9711        call_tests++;
9712        des_xmlHashTablePtr(n_table, table, 0);
9713        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9714        xmlResetLastError();
9715        if (mem_base != xmlMemBlocks()) {
9716            printf("Leak of %d blocks found in xmlHashLookup",
9717	           xmlMemBlocks() - mem_base);
9718	    test_ret++;
9719            printf(" %d", n_table);
9720            printf(" %d", n_name);
9721            printf("\n");
9722        }
9723    }
9724    }
9725    function_tests++;
9726
9727    return(test_ret);
9728}
9729
9730
9731static int
9732test_xmlHashLookup2(void) {
9733    int test_ret = 0;
9734
9735    int mem_base;
9736    void * ret_val;
9737    xmlHashTablePtr table; /* the hash table */
9738    int n_table;
9739    xmlChar * name; /* the name of the userdata */
9740    int n_name;
9741    xmlChar * name2; /* a second name of the userdata */
9742    int n_name2;
9743
9744    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9745    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9746    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9747        mem_base = xmlMemBlocks();
9748        table = gen_xmlHashTablePtr(n_table, 0);
9749        name = gen_const_xmlChar_ptr(n_name, 1);
9750        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9751
9752        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9753        desret_void_ptr(ret_val);
9754        call_tests++;
9755        des_xmlHashTablePtr(n_table, table, 0);
9756        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9757        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9758        xmlResetLastError();
9759        if (mem_base != xmlMemBlocks()) {
9760            printf("Leak of %d blocks found in xmlHashLookup2",
9761	           xmlMemBlocks() - mem_base);
9762	    test_ret++;
9763            printf(" %d", n_table);
9764            printf(" %d", n_name);
9765            printf(" %d", n_name2);
9766            printf("\n");
9767        }
9768    }
9769    }
9770    }
9771    function_tests++;
9772
9773    return(test_ret);
9774}
9775
9776
9777static int
9778test_xmlHashLookup3(void) {
9779    int test_ret = 0;
9780
9781    int mem_base;
9782    void * ret_val;
9783    xmlHashTablePtr table; /* the hash table */
9784    int n_table;
9785    xmlChar * name; /* the name of the userdata */
9786    int n_name;
9787    xmlChar * name2; /* a second name of the userdata */
9788    int n_name2;
9789    xmlChar * name3; /* a third name of the userdata */
9790    int n_name3;
9791
9792    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9793    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9794    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9795    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9796        mem_base = xmlMemBlocks();
9797        table = gen_xmlHashTablePtr(n_table, 0);
9798        name = gen_const_xmlChar_ptr(n_name, 1);
9799        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9800        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9801
9802        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
9803        desret_void_ptr(ret_val);
9804        call_tests++;
9805        des_xmlHashTablePtr(n_table, table, 0);
9806        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9807        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9808        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9809        xmlResetLastError();
9810        if (mem_base != xmlMemBlocks()) {
9811            printf("Leak of %d blocks found in xmlHashLookup3",
9812	           xmlMemBlocks() - mem_base);
9813	    test_ret++;
9814            printf(" %d", n_table);
9815            printf(" %d", n_name);
9816            printf(" %d", n_name2);
9817            printf(" %d", n_name3);
9818            printf("\n");
9819        }
9820    }
9821    }
9822    }
9823    }
9824    function_tests++;
9825
9826    return(test_ret);
9827}
9828
9829
9830static int
9831test_xmlHashQLookup(void) {
9832    int test_ret = 0;
9833
9834    int mem_base;
9835    void * ret_val;
9836    xmlHashTablePtr table; /* the hash table */
9837    int n_table;
9838    xmlChar * prefix; /* the prefix of the userdata */
9839    int n_prefix;
9840    xmlChar * name; /* the name of the userdata */
9841    int n_name;
9842
9843    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9844    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9845    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9846        mem_base = xmlMemBlocks();
9847        table = gen_xmlHashTablePtr(n_table, 0);
9848        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9849        name = gen_const_xmlChar_ptr(n_name, 2);
9850
9851        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
9852        desret_void_ptr(ret_val);
9853        call_tests++;
9854        des_xmlHashTablePtr(n_table, table, 0);
9855        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9856        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9857        xmlResetLastError();
9858        if (mem_base != xmlMemBlocks()) {
9859            printf("Leak of %d blocks found in xmlHashQLookup",
9860	           xmlMemBlocks() - mem_base);
9861	    test_ret++;
9862            printf(" %d", n_table);
9863            printf(" %d", n_prefix);
9864            printf(" %d", n_name);
9865            printf("\n");
9866        }
9867    }
9868    }
9869    }
9870    function_tests++;
9871
9872    return(test_ret);
9873}
9874
9875
9876static int
9877test_xmlHashQLookup2(void) {
9878    int test_ret = 0;
9879
9880    int mem_base;
9881    void * ret_val;
9882    xmlHashTablePtr table; /* the hash table */
9883    int n_table;
9884    xmlChar * prefix; /* the prefix of the userdata */
9885    int n_prefix;
9886    xmlChar * name; /* the name of the userdata */
9887    int n_name;
9888    xmlChar * prefix2; /* the second prefix of the userdata */
9889    int n_prefix2;
9890    xmlChar * name2; /* a second name of the userdata */
9891    int n_name2;
9892
9893    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9894    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9895    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9896    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9897    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9898        mem_base = xmlMemBlocks();
9899        table = gen_xmlHashTablePtr(n_table, 0);
9900        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9901        name = gen_const_xmlChar_ptr(n_name, 2);
9902        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9903        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9904
9905        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
9906        desret_void_ptr(ret_val);
9907        call_tests++;
9908        des_xmlHashTablePtr(n_table, table, 0);
9909        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9910        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9911        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9912        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9913        xmlResetLastError();
9914        if (mem_base != xmlMemBlocks()) {
9915            printf("Leak of %d blocks found in xmlHashQLookup2",
9916	           xmlMemBlocks() - mem_base);
9917	    test_ret++;
9918            printf(" %d", n_table);
9919            printf(" %d", n_prefix);
9920            printf(" %d", n_name);
9921            printf(" %d", n_prefix2);
9922            printf(" %d", n_name2);
9923            printf("\n");
9924        }
9925    }
9926    }
9927    }
9928    }
9929    }
9930    function_tests++;
9931
9932    return(test_ret);
9933}
9934
9935
9936static int
9937test_xmlHashQLookup3(void) {
9938    int test_ret = 0;
9939
9940    int mem_base;
9941    void * ret_val;
9942    xmlHashTablePtr table; /* the hash table */
9943    int n_table;
9944    xmlChar * prefix; /* the prefix of the userdata */
9945    int n_prefix;
9946    xmlChar * name; /* the name of the userdata */
9947    int n_name;
9948    xmlChar * prefix2; /* the second prefix of the userdata */
9949    int n_prefix2;
9950    xmlChar * name2; /* a second name of the userdata */
9951    int n_name2;
9952    xmlChar * prefix3; /* the third prefix of the userdata */
9953    int n_prefix3;
9954    xmlChar * name3; /* a third name of the userdata */
9955    int n_name3;
9956
9957    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9958    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9959    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9960    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9961    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9962    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
9963    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9964        mem_base = xmlMemBlocks();
9965        table = gen_xmlHashTablePtr(n_table, 0);
9966        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9967        name = gen_const_xmlChar_ptr(n_name, 2);
9968        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9969        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9970        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
9971        name3 = gen_const_xmlChar_ptr(n_name3, 6);
9972
9973        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
9974        desret_void_ptr(ret_val);
9975        call_tests++;
9976        des_xmlHashTablePtr(n_table, table, 0);
9977        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9978        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9979        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9980        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9981        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
9982        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
9983        xmlResetLastError();
9984        if (mem_base != xmlMemBlocks()) {
9985            printf("Leak of %d blocks found in xmlHashQLookup3",
9986	           xmlMemBlocks() - mem_base);
9987	    test_ret++;
9988            printf(" %d", n_table);
9989            printf(" %d", n_prefix);
9990            printf(" %d", n_name);
9991            printf(" %d", n_prefix2);
9992            printf(" %d", n_name2);
9993            printf(" %d", n_prefix3);
9994            printf(" %d", n_name3);
9995            printf("\n");
9996        }
9997    }
9998    }
9999    }
10000    }
10001    }
10002    }
10003    }
10004    function_tests++;
10005
10006    return(test_ret);
10007}
10008
10009
10010static int
10011test_xmlHashRemoveEntry(void) {
10012    int test_ret = 0;
10013
10014    int mem_base;
10015    int ret_val;
10016    xmlHashTablePtr table; /* the hash table */
10017    int n_table;
10018    xmlChar * name; /* the name of the userdata */
10019    int n_name;
10020    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10021    int n_f;
10022
10023    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10024    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10025    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10026        mem_base = xmlMemBlocks();
10027        table = gen_xmlHashTablePtr(n_table, 0);
10028        name = gen_const_xmlChar_ptr(n_name, 1);
10029        f = gen_xmlHashDeallocator(n_f, 2);
10030
10031        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10032        desret_int(ret_val);
10033        call_tests++;
10034        des_xmlHashTablePtr(n_table, table, 0);
10035        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10036        des_xmlHashDeallocator(n_f, f, 2);
10037        xmlResetLastError();
10038        if (mem_base != xmlMemBlocks()) {
10039            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10040	           xmlMemBlocks() - mem_base);
10041	    test_ret++;
10042            printf(" %d", n_table);
10043            printf(" %d", n_name);
10044            printf(" %d", n_f);
10045            printf("\n");
10046        }
10047    }
10048    }
10049    }
10050    function_tests++;
10051
10052    return(test_ret);
10053}
10054
10055
10056static int
10057test_xmlHashRemoveEntry2(void) {
10058    int test_ret = 0;
10059
10060    int mem_base;
10061    int ret_val;
10062    xmlHashTablePtr table; /* the hash table */
10063    int n_table;
10064    xmlChar * name; /* the name of the userdata */
10065    int n_name;
10066    xmlChar * name2; /* a second name of the userdata */
10067    int n_name2;
10068    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10069    int n_f;
10070
10071    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10072    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10073    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10074    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10075        mem_base = xmlMemBlocks();
10076        table = gen_xmlHashTablePtr(n_table, 0);
10077        name = gen_const_xmlChar_ptr(n_name, 1);
10078        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10079        f = gen_xmlHashDeallocator(n_f, 3);
10080
10081        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10082        desret_int(ret_val);
10083        call_tests++;
10084        des_xmlHashTablePtr(n_table, table, 0);
10085        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10086        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10087        des_xmlHashDeallocator(n_f, f, 3);
10088        xmlResetLastError();
10089        if (mem_base != xmlMemBlocks()) {
10090            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10091	           xmlMemBlocks() - mem_base);
10092	    test_ret++;
10093            printf(" %d", n_table);
10094            printf(" %d", n_name);
10095            printf(" %d", n_name2);
10096            printf(" %d", n_f);
10097            printf("\n");
10098        }
10099    }
10100    }
10101    }
10102    }
10103    function_tests++;
10104
10105    return(test_ret);
10106}
10107
10108
10109static int
10110test_xmlHashRemoveEntry3(void) {
10111    int test_ret = 0;
10112
10113    int mem_base;
10114    int ret_val;
10115    xmlHashTablePtr table; /* the hash table */
10116    int n_table;
10117    xmlChar * name; /* the name of the userdata */
10118    int n_name;
10119    xmlChar * name2; /* a second name of the userdata */
10120    int n_name2;
10121    xmlChar * name3; /* a third name of the userdata */
10122    int n_name3;
10123    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10124    int n_f;
10125
10126    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10127    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10128    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10129    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10130    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10131        mem_base = xmlMemBlocks();
10132        table = gen_xmlHashTablePtr(n_table, 0);
10133        name = gen_const_xmlChar_ptr(n_name, 1);
10134        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10135        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10136        f = gen_xmlHashDeallocator(n_f, 4);
10137
10138        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10139        desret_int(ret_val);
10140        call_tests++;
10141        des_xmlHashTablePtr(n_table, table, 0);
10142        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10143        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10144        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10145        des_xmlHashDeallocator(n_f, f, 4);
10146        xmlResetLastError();
10147        if (mem_base != xmlMemBlocks()) {
10148            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10149	           xmlMemBlocks() - mem_base);
10150	    test_ret++;
10151            printf(" %d", n_table);
10152            printf(" %d", n_name);
10153            printf(" %d", n_name2);
10154            printf(" %d", n_name3);
10155            printf(" %d", n_f);
10156            printf("\n");
10157        }
10158    }
10159    }
10160    }
10161    }
10162    }
10163    function_tests++;
10164
10165    return(test_ret);
10166}
10167
10168
10169static int
10170test_xmlHashScan(void) {
10171    int test_ret = 0;
10172
10173
10174    /* missing type support */
10175    return(test_ret);
10176}
10177
10178
10179static int
10180test_xmlHashScan3(void) {
10181    int test_ret = 0;
10182
10183
10184    /* missing type support */
10185    return(test_ret);
10186}
10187
10188
10189static int
10190test_xmlHashScanFull(void) {
10191    int test_ret = 0;
10192
10193
10194    /* missing type support */
10195    return(test_ret);
10196}
10197
10198
10199static int
10200test_xmlHashScanFull3(void) {
10201    int test_ret = 0;
10202
10203
10204    /* missing type support */
10205    return(test_ret);
10206}
10207
10208
10209static int
10210test_xmlHashSize(void) {
10211    int test_ret = 0;
10212
10213    int mem_base;
10214    int ret_val;
10215    xmlHashTablePtr table; /* the hash table */
10216    int n_table;
10217
10218    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10219        mem_base = xmlMemBlocks();
10220        table = gen_xmlHashTablePtr(n_table, 0);
10221
10222        ret_val = xmlHashSize(table);
10223        desret_int(ret_val);
10224        call_tests++;
10225        des_xmlHashTablePtr(n_table, table, 0);
10226        xmlResetLastError();
10227        if (mem_base != xmlMemBlocks()) {
10228            printf("Leak of %d blocks found in xmlHashSize",
10229	           xmlMemBlocks() - mem_base);
10230	    test_ret++;
10231            printf(" %d", n_table);
10232            printf("\n");
10233        }
10234    }
10235    function_tests++;
10236
10237    return(test_ret);
10238}
10239
10240
10241static int
10242test_xmlHashUpdateEntry(void) {
10243    int test_ret = 0;
10244
10245    int mem_base;
10246    int ret_val;
10247    xmlHashTablePtr table; /* the hash table */
10248    int n_table;
10249    xmlChar * name; /* the name of the userdata */
10250    int n_name;
10251    void * userdata; /* a pointer to the userdata */
10252    int n_userdata;
10253    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10254    int n_f;
10255
10256    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10257    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10258    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10259    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10260        mem_base = xmlMemBlocks();
10261        table = gen_xmlHashTablePtr(n_table, 0);
10262        name = gen_const_xmlChar_ptr(n_name, 1);
10263        userdata = gen_userdata(n_userdata, 2);
10264        f = gen_xmlHashDeallocator(n_f, 3);
10265
10266        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10267        desret_int(ret_val);
10268        call_tests++;
10269        des_xmlHashTablePtr(n_table, table, 0);
10270        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10271        des_userdata(n_userdata, userdata, 2);
10272        des_xmlHashDeallocator(n_f, f, 3);
10273        xmlResetLastError();
10274        if (mem_base != xmlMemBlocks()) {
10275            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10276	           xmlMemBlocks() - mem_base);
10277	    test_ret++;
10278            printf(" %d", n_table);
10279            printf(" %d", n_name);
10280            printf(" %d", n_userdata);
10281            printf(" %d", n_f);
10282            printf("\n");
10283        }
10284    }
10285    }
10286    }
10287    }
10288    function_tests++;
10289
10290    return(test_ret);
10291}
10292
10293
10294static int
10295test_xmlHashUpdateEntry2(void) {
10296    int test_ret = 0;
10297
10298    int mem_base;
10299    int ret_val;
10300    xmlHashTablePtr table; /* the hash table */
10301    int n_table;
10302    xmlChar * name; /* the name of the userdata */
10303    int n_name;
10304    xmlChar * name2; /* a second name of the userdata */
10305    int n_name2;
10306    void * userdata; /* a pointer to the userdata */
10307    int n_userdata;
10308    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10309    int n_f;
10310
10311    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10312    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10313    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10314    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10315    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10316        mem_base = xmlMemBlocks();
10317        table = gen_xmlHashTablePtr(n_table, 0);
10318        name = gen_const_xmlChar_ptr(n_name, 1);
10319        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10320        userdata = gen_userdata(n_userdata, 3);
10321        f = gen_xmlHashDeallocator(n_f, 4);
10322
10323        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10324        desret_int(ret_val);
10325        call_tests++;
10326        des_xmlHashTablePtr(n_table, table, 0);
10327        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10328        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10329        des_userdata(n_userdata, userdata, 3);
10330        des_xmlHashDeallocator(n_f, f, 4);
10331        xmlResetLastError();
10332        if (mem_base != xmlMemBlocks()) {
10333            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10334	           xmlMemBlocks() - mem_base);
10335	    test_ret++;
10336            printf(" %d", n_table);
10337            printf(" %d", n_name);
10338            printf(" %d", n_name2);
10339            printf(" %d", n_userdata);
10340            printf(" %d", n_f);
10341            printf("\n");
10342        }
10343    }
10344    }
10345    }
10346    }
10347    }
10348    function_tests++;
10349
10350    return(test_ret);
10351}
10352
10353
10354static int
10355test_xmlHashUpdateEntry3(void) {
10356    int test_ret = 0;
10357
10358    int mem_base;
10359    int ret_val;
10360    xmlHashTablePtr table; /* the hash table */
10361    int n_table;
10362    xmlChar * name; /* the name of the userdata */
10363    int n_name;
10364    xmlChar * name2; /* a second name of the userdata */
10365    int n_name2;
10366    xmlChar * name3; /* a third name of the userdata */
10367    int n_name3;
10368    void * userdata; /* a pointer to the userdata */
10369    int n_userdata;
10370    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10371    int n_f;
10372
10373    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10374    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10375    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10376    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10377    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10378    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10379        mem_base = xmlMemBlocks();
10380        table = gen_xmlHashTablePtr(n_table, 0);
10381        name = gen_const_xmlChar_ptr(n_name, 1);
10382        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10383        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10384        userdata = gen_userdata(n_userdata, 4);
10385        f = gen_xmlHashDeallocator(n_f, 5);
10386
10387        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10388        desret_int(ret_val);
10389        call_tests++;
10390        des_xmlHashTablePtr(n_table, table, 0);
10391        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10392        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10393        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10394        des_userdata(n_userdata, userdata, 4);
10395        des_xmlHashDeallocator(n_f, f, 5);
10396        xmlResetLastError();
10397        if (mem_base != xmlMemBlocks()) {
10398            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10399	           xmlMemBlocks() - mem_base);
10400	    test_ret++;
10401            printf(" %d", n_table);
10402            printf(" %d", n_name);
10403            printf(" %d", n_name2);
10404            printf(" %d", n_name3);
10405            printf(" %d", n_userdata);
10406            printf(" %d", n_f);
10407            printf("\n");
10408        }
10409    }
10410    }
10411    }
10412    }
10413    }
10414    }
10415    function_tests++;
10416
10417    return(test_ret);
10418}
10419
10420static int
10421test_hash(void) {
10422    int test_ret = 0;
10423
10424    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10425    test_ret += test_xmlHashAddEntry();
10426    test_ret += test_xmlHashAddEntry2();
10427    test_ret += test_xmlHashAddEntry3();
10428    test_ret += test_xmlHashCopy();
10429    test_ret += test_xmlHashCreate();
10430    test_ret += test_xmlHashCreateDict();
10431    test_ret += test_xmlHashLookup();
10432    test_ret += test_xmlHashLookup2();
10433    test_ret += test_xmlHashLookup3();
10434    test_ret += test_xmlHashQLookup();
10435    test_ret += test_xmlHashQLookup2();
10436    test_ret += test_xmlHashQLookup3();
10437    test_ret += test_xmlHashRemoveEntry();
10438    test_ret += test_xmlHashRemoveEntry2();
10439    test_ret += test_xmlHashRemoveEntry3();
10440    test_ret += test_xmlHashScan();
10441    test_ret += test_xmlHashScan3();
10442    test_ret += test_xmlHashScanFull();
10443    test_ret += test_xmlHashScanFull3();
10444    test_ret += test_xmlHashSize();
10445    test_ret += test_xmlHashUpdateEntry();
10446    test_ret += test_xmlHashUpdateEntry2();
10447    test_ret += test_xmlHashUpdateEntry3();
10448
10449    if (test_ret != 0)
10450	printf("Module hash: %d errors\n", test_ret);
10451    return(test_ret);
10452}
10453
10454#define gen_nb_xmlLinkPtr 1
10455static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10456    return(NULL);
10457}
10458static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10459}
10460
10461static int
10462test_xmlLinkGetData(void) {
10463    int test_ret = 0;
10464
10465    int mem_base;
10466    void * ret_val;
10467    xmlLinkPtr lk; /* a link */
10468    int n_lk;
10469
10470    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10471        mem_base = xmlMemBlocks();
10472        lk = gen_xmlLinkPtr(n_lk, 0);
10473
10474        ret_val = xmlLinkGetData(lk);
10475        desret_void_ptr(ret_val);
10476        call_tests++;
10477        des_xmlLinkPtr(n_lk, lk, 0);
10478        xmlResetLastError();
10479        if (mem_base != xmlMemBlocks()) {
10480            printf("Leak of %d blocks found in xmlLinkGetData",
10481	           xmlMemBlocks() - mem_base);
10482	    test_ret++;
10483            printf(" %d", n_lk);
10484            printf("\n");
10485        }
10486    }
10487    function_tests++;
10488
10489    return(test_ret);
10490}
10491
10492
10493static int
10494test_xmlListAppend(void) {
10495    int test_ret = 0;
10496
10497    int mem_base;
10498    int ret_val;
10499    xmlListPtr l; /* a list */
10500    int n_l;
10501    void * data; /* the data */
10502    int n_data;
10503
10504    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10505    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10506        mem_base = xmlMemBlocks();
10507        l = gen_xmlListPtr(n_l, 0);
10508        data = gen_userdata(n_data, 1);
10509
10510        ret_val = xmlListAppend(l, data);
10511        desret_int(ret_val);
10512        call_tests++;
10513        des_xmlListPtr(n_l, l, 0);
10514        des_userdata(n_data, data, 1);
10515        xmlResetLastError();
10516        if (mem_base != xmlMemBlocks()) {
10517            printf("Leak of %d blocks found in xmlListAppend",
10518	           xmlMemBlocks() - mem_base);
10519	    test_ret++;
10520            printf(" %d", n_l);
10521            printf(" %d", n_data);
10522            printf("\n");
10523        }
10524    }
10525    }
10526    function_tests++;
10527
10528    return(test_ret);
10529}
10530
10531
10532static int
10533test_xmlListClear(void) {
10534    int test_ret = 0;
10535
10536    int mem_base;
10537    xmlListPtr l; /* a list */
10538    int n_l;
10539
10540    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10541        mem_base = xmlMemBlocks();
10542        l = gen_xmlListPtr(n_l, 0);
10543
10544        xmlListClear(l);
10545        call_tests++;
10546        des_xmlListPtr(n_l, l, 0);
10547        xmlResetLastError();
10548        if (mem_base != xmlMemBlocks()) {
10549            printf("Leak of %d blocks found in xmlListClear",
10550	           xmlMemBlocks() - mem_base);
10551	    test_ret++;
10552            printf(" %d", n_l);
10553            printf("\n");
10554        }
10555    }
10556    function_tests++;
10557
10558    return(test_ret);
10559}
10560
10561
10562#define gen_nb_const_xmlListPtr 1
10563static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10564    return(NULL);
10565}
10566static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10567}
10568
10569static int
10570test_xmlListCopy(void) {
10571    int test_ret = 0;
10572
10573    int mem_base;
10574    int ret_val;
10575    xmlListPtr cur; /* the new list */
10576    int n_cur;
10577    xmlListPtr old; /* the old list */
10578    int n_old;
10579
10580    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10581    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10582        mem_base = xmlMemBlocks();
10583        cur = gen_xmlListPtr(n_cur, 0);
10584        old = gen_const_xmlListPtr(n_old, 1);
10585
10586        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10587        desret_int(ret_val);
10588        call_tests++;
10589        des_xmlListPtr(n_cur, cur, 0);
10590        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10591        xmlResetLastError();
10592        if (mem_base != xmlMemBlocks()) {
10593            printf("Leak of %d blocks found in xmlListCopy",
10594	           xmlMemBlocks() - mem_base);
10595	    test_ret++;
10596            printf(" %d", n_cur);
10597            printf(" %d", n_old);
10598            printf("\n");
10599        }
10600    }
10601    }
10602    function_tests++;
10603
10604    return(test_ret);
10605}
10606
10607
10608static int
10609test_xmlListCreate(void) {
10610    int test_ret = 0;
10611
10612
10613    /* missing type support */
10614    return(test_ret);
10615}
10616
10617
10618static int
10619test_xmlListDup(void) {
10620    int test_ret = 0;
10621
10622
10623    /* missing type support */
10624    return(test_ret);
10625}
10626
10627
10628static int
10629test_xmlListEmpty(void) {
10630    int test_ret = 0;
10631
10632    int mem_base;
10633    int ret_val;
10634    xmlListPtr l; /* a list */
10635    int n_l;
10636
10637    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10638        mem_base = xmlMemBlocks();
10639        l = gen_xmlListPtr(n_l, 0);
10640
10641        ret_val = xmlListEmpty(l);
10642        desret_int(ret_val);
10643        call_tests++;
10644        des_xmlListPtr(n_l, l, 0);
10645        xmlResetLastError();
10646        if (mem_base != xmlMemBlocks()) {
10647            printf("Leak of %d blocks found in xmlListEmpty",
10648	           xmlMemBlocks() - mem_base);
10649	    test_ret++;
10650            printf(" %d", n_l);
10651            printf("\n");
10652        }
10653    }
10654    function_tests++;
10655
10656    return(test_ret);
10657}
10658
10659
10660static int
10661test_xmlListEnd(void) {
10662    int test_ret = 0;
10663
10664
10665    /* missing type support */
10666    return(test_ret);
10667}
10668
10669
10670static int
10671test_xmlListFront(void) {
10672    int test_ret = 0;
10673
10674
10675    /* missing type support */
10676    return(test_ret);
10677}
10678
10679
10680static int
10681test_xmlListInsert(void) {
10682    int test_ret = 0;
10683
10684    int mem_base;
10685    int ret_val;
10686    xmlListPtr l; /* a list */
10687    int n_l;
10688    void * data; /* the data */
10689    int n_data;
10690
10691    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10692    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10693        mem_base = xmlMemBlocks();
10694        l = gen_xmlListPtr(n_l, 0);
10695        data = gen_userdata(n_data, 1);
10696
10697        ret_val = xmlListInsert(l, data);
10698        desret_int(ret_val);
10699        call_tests++;
10700        des_xmlListPtr(n_l, l, 0);
10701        des_userdata(n_data, data, 1);
10702        xmlResetLastError();
10703        if (mem_base != xmlMemBlocks()) {
10704            printf("Leak of %d blocks found in xmlListInsert",
10705	           xmlMemBlocks() - mem_base);
10706	    test_ret++;
10707            printf(" %d", n_l);
10708            printf(" %d", n_data);
10709            printf("\n");
10710        }
10711    }
10712    }
10713    function_tests++;
10714
10715    return(test_ret);
10716}
10717
10718
10719static int
10720test_xmlListMerge(void) {
10721    int test_ret = 0;
10722
10723    int mem_base;
10724    xmlListPtr l1; /* the original list */
10725    int n_l1;
10726    xmlListPtr l2; /* the new list */
10727    int n_l2;
10728
10729    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10730    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10731        mem_base = xmlMemBlocks();
10732        l1 = gen_xmlListPtr(n_l1, 0);
10733        l2 = gen_xmlListPtr(n_l2, 1);
10734
10735        xmlListMerge(l1, l2);
10736        call_tests++;
10737        des_xmlListPtr(n_l1, l1, 0);
10738        des_xmlListPtr(n_l2, l2, 1);
10739        xmlResetLastError();
10740        if (mem_base != xmlMemBlocks()) {
10741            printf("Leak of %d blocks found in xmlListMerge",
10742	           xmlMemBlocks() - mem_base);
10743	    test_ret++;
10744            printf(" %d", n_l1);
10745            printf(" %d", n_l2);
10746            printf("\n");
10747        }
10748    }
10749    }
10750    function_tests++;
10751
10752    return(test_ret);
10753}
10754
10755
10756static int
10757test_xmlListPopBack(void) {
10758    int test_ret = 0;
10759
10760    int mem_base;
10761    xmlListPtr l; /* a list */
10762    int n_l;
10763
10764    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10765        mem_base = xmlMemBlocks();
10766        l = gen_xmlListPtr(n_l, 0);
10767
10768        xmlListPopBack(l);
10769        call_tests++;
10770        des_xmlListPtr(n_l, l, 0);
10771        xmlResetLastError();
10772        if (mem_base != xmlMemBlocks()) {
10773            printf("Leak of %d blocks found in xmlListPopBack",
10774	           xmlMemBlocks() - mem_base);
10775	    test_ret++;
10776            printf(" %d", n_l);
10777            printf("\n");
10778        }
10779    }
10780    function_tests++;
10781
10782    return(test_ret);
10783}
10784
10785
10786static int
10787test_xmlListPopFront(void) {
10788    int test_ret = 0;
10789
10790    int mem_base;
10791    xmlListPtr l; /* a list */
10792    int n_l;
10793
10794    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10795        mem_base = xmlMemBlocks();
10796        l = gen_xmlListPtr(n_l, 0);
10797
10798        xmlListPopFront(l);
10799        call_tests++;
10800        des_xmlListPtr(n_l, l, 0);
10801        xmlResetLastError();
10802        if (mem_base != xmlMemBlocks()) {
10803            printf("Leak of %d blocks found in xmlListPopFront",
10804	           xmlMemBlocks() - mem_base);
10805	    test_ret++;
10806            printf(" %d", n_l);
10807            printf("\n");
10808        }
10809    }
10810    function_tests++;
10811
10812    return(test_ret);
10813}
10814
10815
10816static int
10817test_xmlListPushBack(void) {
10818    int test_ret = 0;
10819
10820    int mem_base;
10821    int ret_val;
10822    xmlListPtr l; /* a list */
10823    int n_l;
10824    void * data; /* new data */
10825    int n_data;
10826
10827    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10828    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10829        mem_base = xmlMemBlocks();
10830        l = gen_xmlListPtr(n_l, 0);
10831        data = gen_userdata(n_data, 1);
10832
10833        ret_val = xmlListPushBack(l, data);
10834        desret_int(ret_val);
10835        call_tests++;
10836        des_xmlListPtr(n_l, l, 0);
10837        des_userdata(n_data, data, 1);
10838        xmlResetLastError();
10839        if (mem_base != xmlMemBlocks()) {
10840            printf("Leak of %d blocks found in xmlListPushBack",
10841	           xmlMemBlocks() - mem_base);
10842	    test_ret++;
10843            printf(" %d", n_l);
10844            printf(" %d", n_data);
10845            printf("\n");
10846        }
10847    }
10848    }
10849    function_tests++;
10850
10851    return(test_ret);
10852}
10853
10854
10855static int
10856test_xmlListPushFront(void) {
10857    int test_ret = 0;
10858
10859    int mem_base;
10860    int ret_val;
10861    xmlListPtr l; /* a list */
10862    int n_l;
10863    void * data; /* new data */
10864    int n_data;
10865
10866    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10867    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10868        mem_base = xmlMemBlocks();
10869        l = gen_xmlListPtr(n_l, 0);
10870        data = gen_userdata(n_data, 1);
10871
10872        ret_val = xmlListPushFront(l, data);
10873        desret_int(ret_val);
10874        call_tests++;
10875        des_xmlListPtr(n_l, l, 0);
10876        des_userdata(n_data, data, 1);
10877        xmlResetLastError();
10878        if (mem_base != xmlMemBlocks()) {
10879            printf("Leak of %d blocks found in xmlListPushFront",
10880	           xmlMemBlocks() - mem_base);
10881	    test_ret++;
10882            printf(" %d", n_l);
10883            printf(" %d", n_data);
10884            printf("\n");
10885        }
10886    }
10887    }
10888    function_tests++;
10889
10890    return(test_ret);
10891}
10892
10893
10894static int
10895test_xmlListRemoveAll(void) {
10896    int test_ret = 0;
10897
10898    int mem_base;
10899    int ret_val;
10900    xmlListPtr l; /* a list */
10901    int n_l;
10902    void * data; /* list data */
10903    int n_data;
10904
10905    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10906    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10907        mem_base = xmlMemBlocks();
10908        l = gen_xmlListPtr(n_l, 0);
10909        data = gen_userdata(n_data, 1);
10910
10911        ret_val = xmlListRemoveAll(l, data);
10912        desret_int(ret_val);
10913        call_tests++;
10914        des_xmlListPtr(n_l, l, 0);
10915        des_userdata(n_data, data, 1);
10916        xmlResetLastError();
10917        if (mem_base != xmlMemBlocks()) {
10918            printf("Leak of %d blocks found in xmlListRemoveAll",
10919	           xmlMemBlocks() - mem_base);
10920	    test_ret++;
10921            printf(" %d", n_l);
10922            printf(" %d", n_data);
10923            printf("\n");
10924        }
10925    }
10926    }
10927    function_tests++;
10928
10929    return(test_ret);
10930}
10931
10932
10933static int
10934test_xmlListRemoveFirst(void) {
10935    int test_ret = 0;
10936
10937    int mem_base;
10938    int ret_val;
10939    xmlListPtr l; /* a list */
10940    int n_l;
10941    void * data; /* list data */
10942    int n_data;
10943
10944    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10945    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10946        mem_base = xmlMemBlocks();
10947        l = gen_xmlListPtr(n_l, 0);
10948        data = gen_userdata(n_data, 1);
10949
10950        ret_val = xmlListRemoveFirst(l, data);
10951        desret_int(ret_val);
10952        call_tests++;
10953        des_xmlListPtr(n_l, l, 0);
10954        des_userdata(n_data, data, 1);
10955        xmlResetLastError();
10956        if (mem_base != xmlMemBlocks()) {
10957            printf("Leak of %d blocks found in xmlListRemoveFirst",
10958	           xmlMemBlocks() - mem_base);
10959	    test_ret++;
10960            printf(" %d", n_l);
10961            printf(" %d", n_data);
10962            printf("\n");
10963        }
10964    }
10965    }
10966    function_tests++;
10967
10968    return(test_ret);
10969}
10970
10971
10972static int
10973test_xmlListRemoveLast(void) {
10974    int test_ret = 0;
10975
10976    int mem_base;
10977    int ret_val;
10978    xmlListPtr l; /* a list */
10979    int n_l;
10980    void * data; /* list data */
10981    int n_data;
10982
10983    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10984    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10985        mem_base = xmlMemBlocks();
10986        l = gen_xmlListPtr(n_l, 0);
10987        data = gen_userdata(n_data, 1);
10988
10989        ret_val = xmlListRemoveLast(l, data);
10990        desret_int(ret_val);
10991        call_tests++;
10992        des_xmlListPtr(n_l, l, 0);
10993        des_userdata(n_data, data, 1);
10994        xmlResetLastError();
10995        if (mem_base != xmlMemBlocks()) {
10996            printf("Leak of %d blocks found in xmlListRemoveLast",
10997	           xmlMemBlocks() - mem_base);
10998	    test_ret++;
10999            printf(" %d", n_l);
11000            printf(" %d", n_data);
11001            printf("\n");
11002        }
11003    }
11004    }
11005    function_tests++;
11006
11007    return(test_ret);
11008}
11009
11010
11011static int
11012test_xmlListReverse(void) {
11013    int test_ret = 0;
11014
11015    int mem_base;
11016    xmlListPtr l; /* a list */
11017    int n_l;
11018
11019    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11020        mem_base = xmlMemBlocks();
11021        l = gen_xmlListPtr(n_l, 0);
11022
11023        xmlListReverse(l);
11024        call_tests++;
11025        des_xmlListPtr(n_l, l, 0);
11026        xmlResetLastError();
11027        if (mem_base != xmlMemBlocks()) {
11028            printf("Leak of %d blocks found in xmlListReverse",
11029	           xmlMemBlocks() - mem_base);
11030	    test_ret++;
11031            printf(" %d", n_l);
11032            printf("\n");
11033        }
11034    }
11035    function_tests++;
11036
11037    return(test_ret);
11038}
11039
11040
11041static int
11042test_xmlListReverseSearch(void) {
11043    int test_ret = 0;
11044
11045    int mem_base;
11046    void * ret_val;
11047    xmlListPtr l; /* a list */
11048    int n_l;
11049    void * data; /* a search value */
11050    int n_data;
11051
11052    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11053    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11054        mem_base = xmlMemBlocks();
11055        l = gen_xmlListPtr(n_l, 0);
11056        data = gen_userdata(n_data, 1);
11057
11058        ret_val = xmlListReverseSearch(l, data);
11059        desret_void_ptr(ret_val);
11060        call_tests++;
11061        des_xmlListPtr(n_l, l, 0);
11062        des_userdata(n_data, data, 1);
11063        xmlResetLastError();
11064        if (mem_base != xmlMemBlocks()) {
11065            printf("Leak of %d blocks found in xmlListReverseSearch",
11066	           xmlMemBlocks() - mem_base);
11067	    test_ret++;
11068            printf(" %d", n_l);
11069            printf(" %d", n_data);
11070            printf("\n");
11071        }
11072    }
11073    }
11074    function_tests++;
11075
11076    return(test_ret);
11077}
11078
11079
11080static int
11081test_xmlListReverseWalk(void) {
11082    int test_ret = 0;
11083
11084
11085    /* missing type support */
11086    return(test_ret);
11087}
11088
11089
11090static int
11091test_xmlListSearch(void) {
11092    int test_ret = 0;
11093
11094    int mem_base;
11095    void * ret_val;
11096    xmlListPtr l; /* a list */
11097    int n_l;
11098    void * data; /* a search value */
11099    int n_data;
11100
11101    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11102    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11103        mem_base = xmlMemBlocks();
11104        l = gen_xmlListPtr(n_l, 0);
11105        data = gen_userdata(n_data, 1);
11106
11107        ret_val = xmlListSearch(l, data);
11108        desret_void_ptr(ret_val);
11109        call_tests++;
11110        des_xmlListPtr(n_l, l, 0);
11111        des_userdata(n_data, data, 1);
11112        xmlResetLastError();
11113        if (mem_base != xmlMemBlocks()) {
11114            printf("Leak of %d blocks found in xmlListSearch",
11115	           xmlMemBlocks() - mem_base);
11116	    test_ret++;
11117            printf(" %d", n_l);
11118            printf(" %d", n_data);
11119            printf("\n");
11120        }
11121    }
11122    }
11123    function_tests++;
11124
11125    return(test_ret);
11126}
11127
11128
11129static int
11130test_xmlListSize(void) {
11131    int test_ret = 0;
11132
11133    int mem_base;
11134    int ret_val;
11135    xmlListPtr l; /* a list */
11136    int n_l;
11137
11138    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11139        mem_base = xmlMemBlocks();
11140        l = gen_xmlListPtr(n_l, 0);
11141
11142        ret_val = xmlListSize(l);
11143        desret_int(ret_val);
11144        call_tests++;
11145        des_xmlListPtr(n_l, l, 0);
11146        xmlResetLastError();
11147        if (mem_base != xmlMemBlocks()) {
11148            printf("Leak of %d blocks found in xmlListSize",
11149	           xmlMemBlocks() - mem_base);
11150	    test_ret++;
11151            printf(" %d", n_l);
11152            printf("\n");
11153        }
11154    }
11155    function_tests++;
11156
11157    return(test_ret);
11158}
11159
11160
11161static int
11162test_xmlListSort(void) {
11163    int test_ret = 0;
11164
11165    int mem_base;
11166    xmlListPtr l; /* a list */
11167    int n_l;
11168
11169    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11170        mem_base = xmlMemBlocks();
11171        l = gen_xmlListPtr(n_l, 0);
11172
11173        xmlListSort(l);
11174        call_tests++;
11175        des_xmlListPtr(n_l, l, 0);
11176        xmlResetLastError();
11177        if (mem_base != xmlMemBlocks()) {
11178            printf("Leak of %d blocks found in xmlListSort",
11179	           xmlMemBlocks() - mem_base);
11180	    test_ret++;
11181            printf(" %d", n_l);
11182            printf("\n");
11183        }
11184    }
11185    function_tests++;
11186
11187    return(test_ret);
11188}
11189
11190
11191static int
11192test_xmlListWalk(void) {
11193    int test_ret = 0;
11194
11195
11196    /* missing type support */
11197    return(test_ret);
11198}
11199
11200static int
11201test_list(void) {
11202    int test_ret = 0;
11203
11204    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11205    test_ret += test_xmlLinkGetData();
11206    test_ret += test_xmlListAppend();
11207    test_ret += test_xmlListClear();
11208    test_ret += test_xmlListCopy();
11209    test_ret += test_xmlListCreate();
11210    test_ret += test_xmlListDup();
11211    test_ret += test_xmlListEmpty();
11212    test_ret += test_xmlListEnd();
11213    test_ret += test_xmlListFront();
11214    test_ret += test_xmlListInsert();
11215    test_ret += test_xmlListMerge();
11216    test_ret += test_xmlListPopBack();
11217    test_ret += test_xmlListPopFront();
11218    test_ret += test_xmlListPushBack();
11219    test_ret += test_xmlListPushFront();
11220    test_ret += test_xmlListRemoveAll();
11221    test_ret += test_xmlListRemoveFirst();
11222    test_ret += test_xmlListRemoveLast();
11223    test_ret += test_xmlListReverse();
11224    test_ret += test_xmlListReverseSearch();
11225    test_ret += test_xmlListReverseWalk();
11226    test_ret += test_xmlListSearch();
11227    test_ret += test_xmlListSize();
11228    test_ret += test_xmlListSort();
11229    test_ret += test_xmlListWalk();
11230
11231    if (test_ret != 0)
11232	printf("Module list: %d errors\n", test_ret);
11233    return(test_ret);
11234}
11235
11236static int
11237test_xmlNanoFTPCheckResponse(void) {
11238    int test_ret = 0;
11239
11240#if defined(LIBXML_FTP_ENABLED)
11241    int mem_base;
11242    int ret_val;
11243    void * ctx; /* an FTP context */
11244    int n_ctx;
11245
11246    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11247        mem_base = xmlMemBlocks();
11248        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11249
11250        ret_val = xmlNanoFTPCheckResponse(ctx);
11251        desret_int(ret_val);
11252        call_tests++;
11253        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11254        xmlResetLastError();
11255        if (mem_base != xmlMemBlocks()) {
11256            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11257	           xmlMemBlocks() - mem_base);
11258	    test_ret++;
11259            printf(" %d", n_ctx);
11260            printf("\n");
11261        }
11262    }
11263    function_tests++;
11264#endif
11265
11266    return(test_ret);
11267}
11268
11269
11270static int
11271test_xmlNanoFTPCleanup(void) {
11272    int test_ret = 0;
11273
11274#if defined(LIBXML_FTP_ENABLED)
11275    int mem_base;
11276
11277        mem_base = xmlMemBlocks();
11278
11279        xmlNanoFTPCleanup();
11280        call_tests++;
11281        xmlResetLastError();
11282        if (mem_base != xmlMemBlocks()) {
11283            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11284	           xmlMemBlocks() - mem_base);
11285	    test_ret++;
11286            printf("\n");
11287        }
11288    function_tests++;
11289#endif
11290
11291    return(test_ret);
11292}
11293
11294
11295static int
11296test_xmlNanoFTPCloseConnection(void) {
11297    int test_ret = 0;
11298
11299#if defined(LIBXML_FTP_ENABLED)
11300    int mem_base;
11301    int ret_val;
11302    void * ctx; /* an FTP context */
11303    int n_ctx;
11304
11305    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11306        mem_base = xmlMemBlocks();
11307        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11308
11309        ret_val = xmlNanoFTPCloseConnection(ctx);
11310        desret_int(ret_val);
11311        call_tests++;
11312        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11313        xmlResetLastError();
11314        if (mem_base != xmlMemBlocks()) {
11315            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11316	           xmlMemBlocks() - mem_base);
11317	    test_ret++;
11318            printf(" %d", n_ctx);
11319            printf("\n");
11320        }
11321    }
11322    function_tests++;
11323#endif
11324
11325    return(test_ret);
11326}
11327
11328
11329static int
11330test_xmlNanoFTPCwd(void) {
11331    int test_ret = 0;
11332
11333#if defined(LIBXML_FTP_ENABLED)
11334    int mem_base;
11335    int ret_val;
11336    void * ctx; /* an FTP context */
11337    int n_ctx;
11338    char * directory; /* a directory on the server */
11339    int n_directory;
11340
11341    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11342    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11343        mem_base = xmlMemBlocks();
11344        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11345        directory = gen_const_char_ptr(n_directory, 1);
11346
11347        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11348        desret_int(ret_val);
11349        call_tests++;
11350        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11351        des_const_char_ptr(n_directory, (const char *)directory, 1);
11352        xmlResetLastError();
11353        if (mem_base != xmlMemBlocks()) {
11354            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11355	           xmlMemBlocks() - mem_base);
11356	    test_ret++;
11357            printf(" %d", n_ctx);
11358            printf(" %d", n_directory);
11359            printf("\n");
11360        }
11361    }
11362    }
11363    function_tests++;
11364#endif
11365
11366    return(test_ret);
11367}
11368
11369
11370static int
11371test_xmlNanoFTPDele(void) {
11372    int test_ret = 0;
11373
11374#if defined(LIBXML_FTP_ENABLED)
11375    int mem_base;
11376    int ret_val;
11377    void * ctx; /* an FTP context */
11378    int n_ctx;
11379    const char * file; /* a file or directory on the server */
11380    int n_file;
11381
11382    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11383    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11384        mem_base = xmlMemBlocks();
11385        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11386        file = gen_filepath(n_file, 1);
11387
11388        ret_val = xmlNanoFTPDele(ctx, file);
11389        desret_int(ret_val);
11390        call_tests++;
11391        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11392        des_filepath(n_file, file, 1);
11393        xmlResetLastError();
11394        if (mem_base != xmlMemBlocks()) {
11395            printf("Leak of %d blocks found in xmlNanoFTPDele",
11396	           xmlMemBlocks() - mem_base);
11397	    test_ret++;
11398            printf(" %d", n_ctx);
11399            printf(" %d", n_file);
11400            printf("\n");
11401        }
11402    }
11403    }
11404    function_tests++;
11405#endif
11406
11407    return(test_ret);
11408}
11409
11410
11411static int
11412test_xmlNanoFTPGet(void) {
11413    int test_ret = 0;
11414
11415
11416    /* missing type support */
11417    return(test_ret);
11418}
11419
11420
11421static int
11422test_xmlNanoFTPGetConnection(void) {
11423    int test_ret = 0;
11424
11425#if defined(LIBXML_FTP_ENABLED)
11426    int mem_base;
11427    int ret_val;
11428    void * ctx; /* an FTP context */
11429    int n_ctx;
11430
11431    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11432        mem_base = xmlMemBlocks();
11433        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11434
11435        ret_val = xmlNanoFTPGetConnection(ctx);
11436        desret_int(ret_val);
11437        call_tests++;
11438        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11439        xmlResetLastError();
11440        if (mem_base != xmlMemBlocks()) {
11441            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11442	           xmlMemBlocks() - mem_base);
11443	    test_ret++;
11444            printf(" %d", n_ctx);
11445            printf("\n");
11446        }
11447    }
11448    function_tests++;
11449#endif
11450
11451    return(test_ret);
11452}
11453
11454
11455static int
11456test_xmlNanoFTPGetResponse(void) {
11457    int test_ret = 0;
11458
11459#if defined(LIBXML_FTP_ENABLED)
11460    int mem_base;
11461    int ret_val;
11462    void * ctx; /* an FTP context */
11463    int n_ctx;
11464
11465    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11466        mem_base = xmlMemBlocks();
11467        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11468
11469        ret_val = xmlNanoFTPGetResponse(ctx);
11470        desret_int(ret_val);
11471        call_tests++;
11472        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11473        xmlResetLastError();
11474        if (mem_base != xmlMemBlocks()) {
11475            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11476	           xmlMemBlocks() - mem_base);
11477	    test_ret++;
11478            printf(" %d", n_ctx);
11479            printf("\n");
11480        }
11481    }
11482    function_tests++;
11483#endif
11484
11485    return(test_ret);
11486}
11487
11488
11489static int
11490test_xmlNanoFTPGetSocket(void) {
11491    int test_ret = 0;
11492
11493#if defined(LIBXML_FTP_ENABLED)
11494    int mem_base;
11495    int ret_val;
11496    void * ctx; /* an FTP context */
11497    int n_ctx;
11498    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11499    int n_filename;
11500
11501    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11502    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11503        mem_base = xmlMemBlocks();
11504        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11505        filename = gen_filepath(n_filename, 1);
11506
11507        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11508        desret_int(ret_val);
11509        call_tests++;
11510        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11511        des_filepath(n_filename, filename, 1);
11512        xmlResetLastError();
11513        if (mem_base != xmlMemBlocks()) {
11514            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11515	           xmlMemBlocks() - mem_base);
11516	    test_ret++;
11517            printf(" %d", n_ctx);
11518            printf(" %d", n_filename);
11519            printf("\n");
11520        }
11521    }
11522    }
11523    function_tests++;
11524#endif
11525
11526    return(test_ret);
11527}
11528
11529
11530static int
11531test_xmlNanoFTPInit(void) {
11532    int test_ret = 0;
11533
11534#if defined(LIBXML_FTP_ENABLED)
11535    int mem_base;
11536
11537        mem_base = xmlMemBlocks();
11538
11539        xmlNanoFTPInit();
11540        call_tests++;
11541        xmlResetLastError();
11542        if (mem_base != xmlMemBlocks()) {
11543            printf("Leak of %d blocks found in xmlNanoFTPInit",
11544	           xmlMemBlocks() - mem_base);
11545	    test_ret++;
11546            printf("\n");
11547        }
11548    function_tests++;
11549#endif
11550
11551    return(test_ret);
11552}
11553
11554
11555static int
11556test_xmlNanoFTPList(void) {
11557    int test_ret = 0;
11558
11559
11560    /* missing type support */
11561    return(test_ret);
11562}
11563
11564
11565static int
11566test_xmlNanoFTPNewCtxt(void) {
11567    int test_ret = 0;
11568
11569#if defined(LIBXML_FTP_ENABLED)
11570    int mem_base;
11571    void * ret_val;
11572    const char * URL; /* The URL used to initialize the context */
11573    int n_URL;
11574
11575    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11576        mem_base = xmlMemBlocks();
11577        URL = gen_filepath(n_URL, 0);
11578
11579        ret_val = xmlNanoFTPNewCtxt(URL);
11580        desret_xmlNanoFTPCtxtPtr(ret_val);
11581        call_tests++;
11582        des_filepath(n_URL, URL, 0);
11583        xmlResetLastError();
11584        if (mem_base != xmlMemBlocks()) {
11585            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11586	           xmlMemBlocks() - mem_base);
11587	    test_ret++;
11588            printf(" %d", n_URL);
11589            printf("\n");
11590        }
11591    }
11592    function_tests++;
11593#endif
11594
11595    return(test_ret);
11596}
11597
11598
11599static int
11600test_xmlNanoFTPOpen(void) {
11601    int test_ret = 0;
11602
11603#if defined(LIBXML_FTP_ENABLED)
11604    int mem_base;
11605    void * ret_val;
11606    const char * URL; /* the URL to the resource */
11607    int n_URL;
11608
11609    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11610        mem_base = xmlMemBlocks();
11611        URL = gen_filepath(n_URL, 0);
11612
11613        ret_val = xmlNanoFTPOpen(URL);
11614        desret_xmlNanoFTPCtxtPtr(ret_val);
11615        call_tests++;
11616        des_filepath(n_URL, URL, 0);
11617        xmlResetLastError();
11618        if (mem_base != xmlMemBlocks()) {
11619            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11620	           xmlMemBlocks() - mem_base);
11621	    test_ret++;
11622            printf(" %d", n_URL);
11623            printf("\n");
11624        }
11625    }
11626    function_tests++;
11627#endif
11628
11629    return(test_ret);
11630}
11631
11632
11633static int
11634test_xmlNanoFTPProxy(void) {
11635    int test_ret = 0;
11636
11637#if defined(LIBXML_FTP_ENABLED)
11638    char * host; /* the proxy host name */
11639    int n_host;
11640    int port; /* the proxy port */
11641    int n_port;
11642    char * user; /* the proxy user name */
11643    int n_user;
11644    char * passwd; /* the proxy password */
11645    int n_passwd;
11646    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11647    int n_type;
11648
11649    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11650    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11651    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11652    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11653    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11654        host = gen_const_char_ptr(n_host, 0);
11655        port = gen_int(n_port, 1);
11656        user = gen_const_char_ptr(n_user, 2);
11657        passwd = gen_const_char_ptr(n_passwd, 3);
11658        type = gen_int(n_type, 4);
11659
11660        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11661        call_tests++;
11662        des_const_char_ptr(n_host, (const char *)host, 0);
11663        des_int(n_port, port, 1);
11664        des_const_char_ptr(n_user, (const char *)user, 2);
11665        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11666        des_int(n_type, type, 4);
11667        xmlResetLastError();
11668    }
11669    }
11670    }
11671    }
11672    }
11673    function_tests++;
11674#endif
11675
11676    return(test_ret);
11677}
11678
11679
11680static int
11681test_xmlNanoFTPQuit(void) {
11682    int test_ret = 0;
11683
11684#if defined(LIBXML_FTP_ENABLED)
11685    int mem_base;
11686    int ret_val;
11687    void * ctx; /* an FTP context */
11688    int n_ctx;
11689
11690    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11691        mem_base = xmlMemBlocks();
11692        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11693
11694        ret_val = xmlNanoFTPQuit(ctx);
11695        desret_int(ret_val);
11696        call_tests++;
11697        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11698        xmlResetLastError();
11699        if (mem_base != xmlMemBlocks()) {
11700            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11701	           xmlMemBlocks() - mem_base);
11702	    test_ret++;
11703            printf(" %d", n_ctx);
11704            printf("\n");
11705        }
11706    }
11707    function_tests++;
11708#endif
11709
11710    return(test_ret);
11711}
11712
11713
11714static int
11715test_xmlNanoFTPRead(void) {
11716    int test_ret = 0;
11717
11718#if defined(LIBXML_FTP_ENABLED)
11719    int mem_base;
11720    int ret_val;
11721    void * ctx; /* the FTP context */
11722    int n_ctx;
11723    void * dest; /* a buffer */
11724    int n_dest;
11725    int len; /* the buffer length */
11726    int n_len;
11727
11728    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11729    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11730    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11731        mem_base = xmlMemBlocks();
11732        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11733        dest = gen_void_ptr(n_dest, 1);
11734        len = gen_int(n_len, 2);
11735
11736        ret_val = xmlNanoFTPRead(ctx, dest, len);
11737        desret_int(ret_val);
11738        call_tests++;
11739        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11740        des_void_ptr(n_dest, dest, 1);
11741        des_int(n_len, len, 2);
11742        xmlResetLastError();
11743        if (mem_base != xmlMemBlocks()) {
11744            printf("Leak of %d blocks found in xmlNanoFTPRead",
11745	           xmlMemBlocks() - mem_base);
11746	    test_ret++;
11747            printf(" %d", n_ctx);
11748            printf(" %d", n_dest);
11749            printf(" %d", n_len);
11750            printf("\n");
11751        }
11752    }
11753    }
11754    }
11755    function_tests++;
11756#endif
11757
11758    return(test_ret);
11759}
11760
11761
11762static int
11763test_xmlNanoFTPScanProxy(void) {
11764    int test_ret = 0;
11765
11766#if defined(LIBXML_FTP_ENABLED)
11767    const char * URL; /* The proxy URL used to initialize the proxy context */
11768    int n_URL;
11769
11770    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11771        URL = gen_filepath(n_URL, 0);
11772
11773        xmlNanoFTPScanProxy(URL);
11774        call_tests++;
11775        des_filepath(n_URL, URL, 0);
11776        xmlResetLastError();
11777    }
11778    function_tests++;
11779#endif
11780
11781    return(test_ret);
11782}
11783
11784
11785static int
11786test_xmlNanoFTPUpdateURL(void) {
11787    int test_ret = 0;
11788
11789#if defined(LIBXML_FTP_ENABLED)
11790    int mem_base;
11791    int ret_val;
11792    void * ctx; /* an FTP context */
11793    int n_ctx;
11794    const char * URL; /* The URL used to update the context */
11795    int n_URL;
11796
11797    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11798    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11799        mem_base = xmlMemBlocks();
11800        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11801        URL = gen_filepath(n_URL, 1);
11802
11803        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11804        desret_int(ret_val);
11805        call_tests++;
11806        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11807        des_filepath(n_URL, URL, 1);
11808        xmlResetLastError();
11809        if (mem_base != xmlMemBlocks()) {
11810            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11811	           xmlMemBlocks() - mem_base);
11812	    test_ret++;
11813            printf(" %d", n_ctx);
11814            printf(" %d", n_URL);
11815            printf("\n");
11816        }
11817    }
11818    }
11819    function_tests++;
11820#endif
11821
11822    return(test_ret);
11823}
11824
11825static int
11826test_nanoftp(void) {
11827    int test_ret = 0;
11828
11829    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
11830    test_ret += test_xmlNanoFTPCheckResponse();
11831    test_ret += test_xmlNanoFTPCleanup();
11832    test_ret += test_xmlNanoFTPCloseConnection();
11833    test_ret += test_xmlNanoFTPCwd();
11834    test_ret += test_xmlNanoFTPDele();
11835    test_ret += test_xmlNanoFTPGet();
11836    test_ret += test_xmlNanoFTPGetConnection();
11837    test_ret += test_xmlNanoFTPGetResponse();
11838    test_ret += test_xmlNanoFTPGetSocket();
11839    test_ret += test_xmlNanoFTPInit();
11840    test_ret += test_xmlNanoFTPList();
11841    test_ret += test_xmlNanoFTPNewCtxt();
11842    test_ret += test_xmlNanoFTPOpen();
11843    test_ret += test_xmlNanoFTPProxy();
11844    test_ret += test_xmlNanoFTPQuit();
11845    test_ret += test_xmlNanoFTPRead();
11846    test_ret += test_xmlNanoFTPScanProxy();
11847    test_ret += test_xmlNanoFTPUpdateURL();
11848
11849    if (test_ret != 0)
11850	printf("Module nanoftp: %d errors\n", test_ret);
11851    return(test_ret);
11852}
11853
11854static int
11855test_xmlNanoHTTPAuthHeader(void) {
11856    int test_ret = 0;
11857
11858#if defined(LIBXML_HTTP_ENABLED)
11859    int mem_base;
11860    const char * ret_val;
11861    void * ctx; /* the HTTP context */
11862    int n_ctx;
11863
11864    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11865        mem_base = xmlMemBlocks();
11866        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11867
11868        ret_val = xmlNanoHTTPAuthHeader(ctx);
11869        desret_const_char_ptr(ret_val);
11870        call_tests++;
11871        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11872        xmlResetLastError();
11873        if (mem_base != xmlMemBlocks()) {
11874            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11875	           xmlMemBlocks() - mem_base);
11876	    test_ret++;
11877            printf(" %d", n_ctx);
11878            printf("\n");
11879        }
11880    }
11881    function_tests++;
11882#endif
11883
11884    return(test_ret);
11885}
11886
11887
11888static int
11889test_xmlNanoHTTPCleanup(void) {
11890    int test_ret = 0;
11891
11892#if defined(LIBXML_HTTP_ENABLED)
11893    int mem_base;
11894
11895        mem_base = xmlMemBlocks();
11896
11897        xmlNanoHTTPCleanup();
11898        call_tests++;
11899        xmlResetLastError();
11900        if (mem_base != xmlMemBlocks()) {
11901            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
11902	           xmlMemBlocks() - mem_base);
11903	    test_ret++;
11904            printf("\n");
11905        }
11906    function_tests++;
11907#endif
11908
11909    return(test_ret);
11910}
11911
11912
11913static int
11914test_xmlNanoHTTPContentLength(void) {
11915    int test_ret = 0;
11916
11917#if defined(LIBXML_HTTP_ENABLED)
11918    int mem_base;
11919    int ret_val;
11920    void * ctx; /* the HTTP context */
11921    int n_ctx;
11922
11923    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11924        mem_base = xmlMemBlocks();
11925        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11926
11927        ret_val = xmlNanoHTTPContentLength(ctx);
11928        desret_int(ret_val);
11929        call_tests++;
11930        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11931        xmlResetLastError();
11932        if (mem_base != xmlMemBlocks()) {
11933            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
11934	           xmlMemBlocks() - mem_base);
11935	    test_ret++;
11936            printf(" %d", n_ctx);
11937            printf("\n");
11938        }
11939    }
11940    function_tests++;
11941#endif
11942
11943    return(test_ret);
11944}
11945
11946
11947static int
11948test_xmlNanoHTTPEncoding(void) {
11949    int test_ret = 0;
11950
11951#if defined(LIBXML_HTTP_ENABLED)
11952    int mem_base;
11953    const char * ret_val;
11954    void * ctx; /* the HTTP context */
11955    int n_ctx;
11956
11957    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11958        mem_base = xmlMemBlocks();
11959        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11960
11961        ret_val = xmlNanoHTTPEncoding(ctx);
11962        desret_const_char_ptr(ret_val);
11963        call_tests++;
11964        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11965        xmlResetLastError();
11966        if (mem_base != xmlMemBlocks()) {
11967            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
11968	           xmlMemBlocks() - mem_base);
11969	    test_ret++;
11970            printf(" %d", n_ctx);
11971            printf("\n");
11972        }
11973    }
11974    function_tests++;
11975#endif
11976
11977    return(test_ret);
11978}
11979
11980
11981#define gen_nb_char_ptr_ptr 1
11982static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11983    return(NULL);
11984}
11985static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11986}
11987
11988static int
11989test_xmlNanoHTTPFetch(void) {
11990    int test_ret = 0;
11991
11992#if defined(LIBXML_HTTP_ENABLED)
11993    int mem_base;
11994    int ret_val;
11995    const char * URL; /* The URL to load */
11996    int n_URL;
11997    const char * filename; /* the filename where the content should be saved */
11998    int n_filename;
11999    char ** contentType; /* if available the Content-Type information will be returned at that location */
12000    int n_contentType;
12001
12002    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12003    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12004    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12005        mem_base = xmlMemBlocks();
12006        URL = gen_fileoutput(n_URL, 0);
12007        filename = gen_fileoutput(n_filename, 1);
12008        contentType = gen_char_ptr_ptr(n_contentType, 2);
12009
12010        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12011        desret_int(ret_val);
12012        call_tests++;
12013        des_fileoutput(n_URL, URL, 0);
12014        des_fileoutput(n_filename, filename, 1);
12015        des_char_ptr_ptr(n_contentType, contentType, 2);
12016        xmlResetLastError();
12017        if (mem_base != xmlMemBlocks()) {
12018            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12019	           xmlMemBlocks() - mem_base);
12020	    test_ret++;
12021            printf(" %d", n_URL);
12022            printf(" %d", n_filename);
12023            printf(" %d", n_contentType);
12024            printf("\n");
12025        }
12026    }
12027    }
12028    }
12029    function_tests++;
12030#endif
12031
12032    return(test_ret);
12033}
12034
12035
12036static int
12037test_xmlNanoHTTPInit(void) {
12038    int test_ret = 0;
12039
12040#if defined(LIBXML_HTTP_ENABLED)
12041    int mem_base;
12042
12043        mem_base = xmlMemBlocks();
12044
12045        xmlNanoHTTPInit();
12046        call_tests++;
12047        xmlResetLastError();
12048        if (mem_base != xmlMemBlocks()) {
12049            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12050	           xmlMemBlocks() - mem_base);
12051	    test_ret++;
12052            printf("\n");
12053        }
12054    function_tests++;
12055#endif
12056
12057    return(test_ret);
12058}
12059
12060
12061static int
12062test_xmlNanoHTTPMimeType(void) {
12063    int test_ret = 0;
12064
12065#if defined(LIBXML_HTTP_ENABLED)
12066    int mem_base;
12067    const char * ret_val;
12068    void * ctx; /* the HTTP context */
12069    int n_ctx;
12070
12071    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12072        mem_base = xmlMemBlocks();
12073        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12074
12075        ret_val = xmlNanoHTTPMimeType(ctx);
12076        desret_const_char_ptr(ret_val);
12077        call_tests++;
12078        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12079        xmlResetLastError();
12080        if (mem_base != xmlMemBlocks()) {
12081            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12082	           xmlMemBlocks() - mem_base);
12083	    test_ret++;
12084            printf(" %d", n_ctx);
12085            printf("\n");
12086        }
12087    }
12088    function_tests++;
12089#endif
12090
12091    return(test_ret);
12092}
12093
12094
12095static int
12096test_xmlNanoHTTPOpen(void) {
12097    int test_ret = 0;
12098
12099#if defined(LIBXML_HTTP_ENABLED)
12100    int mem_base;
12101    void * ret_val;
12102    const char * URL; /* The URL to load */
12103    int n_URL;
12104    char ** contentType; /* if available the Content-Type information will be returned at that location */
12105    int n_contentType;
12106
12107    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12108    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12109        mem_base = xmlMemBlocks();
12110        URL = gen_filepath(n_URL, 0);
12111        contentType = gen_char_ptr_ptr(n_contentType, 1);
12112
12113        ret_val = xmlNanoHTTPOpen(URL, contentType);
12114        desret_xmlNanoHTTPCtxtPtr(ret_val);
12115        call_tests++;
12116        des_filepath(n_URL, URL, 0);
12117        des_char_ptr_ptr(n_contentType, contentType, 1);
12118        xmlResetLastError();
12119        if (mem_base != xmlMemBlocks()) {
12120            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12121	           xmlMemBlocks() - mem_base);
12122	    test_ret++;
12123            printf(" %d", n_URL);
12124            printf(" %d", n_contentType);
12125            printf("\n");
12126        }
12127    }
12128    }
12129    function_tests++;
12130#endif
12131
12132    return(test_ret);
12133}
12134
12135
12136static int
12137test_xmlNanoHTTPOpenRedir(void) {
12138    int test_ret = 0;
12139
12140#if defined(LIBXML_HTTP_ENABLED)
12141    int mem_base;
12142    void * ret_val;
12143    const char * URL; /* The URL to load */
12144    int n_URL;
12145    char ** contentType; /* if available the Content-Type information will be returned at that location */
12146    int n_contentType;
12147    char ** redir; /* if available the redirected URL will be returned */
12148    int n_redir;
12149
12150    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12151    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12152    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12153        mem_base = xmlMemBlocks();
12154        URL = gen_filepath(n_URL, 0);
12155        contentType = gen_char_ptr_ptr(n_contentType, 1);
12156        redir = gen_char_ptr_ptr(n_redir, 2);
12157
12158        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12159        desret_xmlNanoHTTPCtxtPtr(ret_val);
12160        call_tests++;
12161        des_filepath(n_URL, URL, 0);
12162        des_char_ptr_ptr(n_contentType, contentType, 1);
12163        des_char_ptr_ptr(n_redir, redir, 2);
12164        xmlResetLastError();
12165        if (mem_base != xmlMemBlocks()) {
12166            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12167	           xmlMemBlocks() - mem_base);
12168	    test_ret++;
12169            printf(" %d", n_URL);
12170            printf(" %d", n_contentType);
12171            printf(" %d", n_redir);
12172            printf("\n");
12173        }
12174    }
12175    }
12176    }
12177    function_tests++;
12178#endif
12179
12180    return(test_ret);
12181}
12182
12183
12184static int
12185test_xmlNanoHTTPRead(void) {
12186    int test_ret = 0;
12187
12188#if defined(LIBXML_HTTP_ENABLED)
12189    int mem_base;
12190    int ret_val;
12191    void * ctx; /* the HTTP context */
12192    int n_ctx;
12193    void * dest; /* a buffer */
12194    int n_dest;
12195    int len; /* the buffer length */
12196    int n_len;
12197
12198    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12199    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12200    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12201        mem_base = xmlMemBlocks();
12202        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12203        dest = gen_void_ptr(n_dest, 1);
12204        len = gen_int(n_len, 2);
12205
12206        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12207        desret_int(ret_val);
12208        call_tests++;
12209        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12210        des_void_ptr(n_dest, dest, 1);
12211        des_int(n_len, len, 2);
12212        xmlResetLastError();
12213        if (mem_base != xmlMemBlocks()) {
12214            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12215	           xmlMemBlocks() - mem_base);
12216	    test_ret++;
12217            printf(" %d", n_ctx);
12218            printf(" %d", n_dest);
12219            printf(" %d", n_len);
12220            printf("\n");
12221        }
12222    }
12223    }
12224    }
12225    function_tests++;
12226#endif
12227
12228    return(test_ret);
12229}
12230
12231
12232static int
12233test_xmlNanoHTTPRedir(void) {
12234    int test_ret = 0;
12235
12236
12237    /* missing type support */
12238    return(test_ret);
12239}
12240
12241
12242static int
12243test_xmlNanoHTTPReturnCode(void) {
12244    int test_ret = 0;
12245
12246#if defined(LIBXML_HTTP_ENABLED)
12247    int mem_base;
12248    int ret_val;
12249    void * ctx; /* the HTTP context */
12250    int n_ctx;
12251
12252    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12253        mem_base = xmlMemBlocks();
12254        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12255
12256        ret_val = xmlNanoHTTPReturnCode(ctx);
12257        desret_int(ret_val);
12258        call_tests++;
12259        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12260        xmlResetLastError();
12261        if (mem_base != xmlMemBlocks()) {
12262            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12263	           xmlMemBlocks() - mem_base);
12264	    test_ret++;
12265            printf(" %d", n_ctx);
12266            printf("\n");
12267        }
12268    }
12269    function_tests++;
12270#endif
12271
12272    return(test_ret);
12273}
12274
12275
12276static int
12277test_xmlNanoHTTPSave(void) {
12278    int test_ret = 0;
12279
12280#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12281    int mem_base;
12282    int ret_val;
12283    void * ctxt; /* the HTTP context */
12284    int n_ctxt;
12285    const char * filename; /* the filename where the content should be saved */
12286    int n_filename;
12287
12288    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12289    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12290        mem_base = xmlMemBlocks();
12291        ctxt = gen_void_ptr(n_ctxt, 0);
12292        filename = gen_fileoutput(n_filename, 1);
12293
12294        ret_val = xmlNanoHTTPSave(ctxt, filename);
12295        desret_int(ret_val);
12296        call_tests++;
12297        des_void_ptr(n_ctxt, ctxt, 0);
12298        des_fileoutput(n_filename, filename, 1);
12299        xmlResetLastError();
12300        if (mem_base != xmlMemBlocks()) {
12301            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12302	           xmlMemBlocks() - mem_base);
12303	    test_ret++;
12304            printf(" %d", n_ctxt);
12305            printf(" %d", n_filename);
12306            printf("\n");
12307        }
12308    }
12309    }
12310    function_tests++;
12311#endif
12312
12313    return(test_ret);
12314}
12315
12316
12317static int
12318test_xmlNanoHTTPScanProxy(void) {
12319    int test_ret = 0;
12320
12321#if defined(LIBXML_HTTP_ENABLED)
12322    const char * URL; /* The proxy URL used to initialize the proxy context */
12323    int n_URL;
12324
12325    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12326        URL = gen_filepath(n_URL, 0);
12327
12328        xmlNanoHTTPScanProxy(URL);
12329        call_tests++;
12330        des_filepath(n_URL, URL, 0);
12331        xmlResetLastError();
12332    }
12333    function_tests++;
12334#endif
12335
12336    return(test_ret);
12337}
12338
12339static int
12340test_nanohttp(void) {
12341    int test_ret = 0;
12342
12343    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12344    test_ret += test_xmlNanoHTTPAuthHeader();
12345    test_ret += test_xmlNanoHTTPCleanup();
12346    test_ret += test_xmlNanoHTTPContentLength();
12347    test_ret += test_xmlNanoHTTPEncoding();
12348    test_ret += test_xmlNanoHTTPFetch();
12349    test_ret += test_xmlNanoHTTPInit();
12350    test_ret += test_xmlNanoHTTPMimeType();
12351    test_ret += test_xmlNanoHTTPOpen();
12352    test_ret += test_xmlNanoHTTPOpenRedir();
12353    test_ret += test_xmlNanoHTTPRead();
12354    test_ret += test_xmlNanoHTTPRedir();
12355    test_ret += test_xmlNanoHTTPReturnCode();
12356    test_ret += test_xmlNanoHTTPSave();
12357    test_ret += test_xmlNanoHTTPScanProxy();
12358
12359    if (test_ret != 0)
12360	printf("Module nanohttp: %d errors\n", test_ret);
12361    return(test_ret);
12362}
12363
12364static int
12365test_xmlByteConsumed(void) {
12366    int test_ret = 0;
12367
12368    int mem_base;
12369    long ret_val;
12370    xmlParserCtxtPtr ctxt; /* an XML parser context */
12371    int n_ctxt;
12372
12373    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12374        mem_base = xmlMemBlocks();
12375        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12376
12377        ret_val = xmlByteConsumed(ctxt);
12378        desret_long(ret_val);
12379        call_tests++;
12380        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12381        xmlResetLastError();
12382        if (mem_base != xmlMemBlocks()) {
12383            printf("Leak of %d blocks found in xmlByteConsumed",
12384	           xmlMemBlocks() - mem_base);
12385	    test_ret++;
12386            printf(" %d", n_ctxt);
12387            printf("\n");
12388        }
12389    }
12390    function_tests++;
12391
12392    return(test_ret);
12393}
12394
12395
12396static int
12397test_xmlClearNodeInfoSeq(void) {
12398    int test_ret = 0;
12399
12400    int mem_base;
12401    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12402    int n_seq;
12403
12404    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12405        mem_base = xmlMemBlocks();
12406        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12407
12408        xmlClearNodeInfoSeq(seq);
12409        call_tests++;
12410        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12411        xmlResetLastError();
12412        if (mem_base != xmlMemBlocks()) {
12413            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12414	           xmlMemBlocks() - mem_base);
12415	    test_ret++;
12416            printf(" %d", n_seq);
12417            printf("\n");
12418        }
12419    }
12420    function_tests++;
12421
12422    return(test_ret);
12423}
12424
12425
12426static int
12427test_xmlClearParserCtxt(void) {
12428    int test_ret = 0;
12429
12430    int mem_base;
12431    xmlParserCtxtPtr ctxt; /* an XML parser context */
12432    int n_ctxt;
12433
12434    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12435        mem_base = xmlMemBlocks();
12436        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12437
12438        xmlClearParserCtxt(ctxt);
12439        call_tests++;
12440        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12441        xmlResetLastError();
12442        if (mem_base != xmlMemBlocks()) {
12443            printf("Leak of %d blocks found in xmlClearParserCtxt",
12444	           xmlMemBlocks() - mem_base);
12445	    test_ret++;
12446            printf(" %d", n_ctxt);
12447            printf("\n");
12448        }
12449    }
12450    function_tests++;
12451
12452    return(test_ret);
12453}
12454
12455
12456static int
12457test_xmlCreateDocParserCtxt(void) {
12458    int test_ret = 0;
12459
12460    int mem_base;
12461    xmlParserCtxtPtr ret_val;
12462    xmlChar * cur; /* a pointer to an array of xmlChar */
12463    int n_cur;
12464
12465    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12466        mem_base = xmlMemBlocks();
12467        cur = gen_const_xmlChar_ptr(n_cur, 0);
12468
12469        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12470        desret_xmlParserCtxtPtr(ret_val);
12471        call_tests++;
12472        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12473        xmlResetLastError();
12474        if (mem_base != xmlMemBlocks()) {
12475            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12476	           xmlMemBlocks() - mem_base);
12477	    test_ret++;
12478            printf(" %d", n_cur);
12479            printf("\n");
12480        }
12481    }
12482    function_tests++;
12483
12484    return(test_ret);
12485}
12486
12487
12488static int
12489test_xmlCreatePushParserCtxt(void) {
12490    int test_ret = 0;
12491
12492#if defined(LIBXML_PUSH_ENABLED)
12493    int mem_base;
12494    xmlParserCtxtPtr ret_val;
12495    xmlSAXHandlerPtr sax; /* a SAX handler */
12496    int n_sax;
12497    void * user_data; /* The user data returned on SAX callbacks */
12498    int n_user_data;
12499    char * chunk; /* a pointer to an array of chars */
12500    int n_chunk;
12501    int size; /* number of chars in the array */
12502    int n_size;
12503    const char * filename; /* an optional file name or URI */
12504    int n_filename;
12505
12506    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12507    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12508    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12509    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12510    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12511        mem_base = xmlMemBlocks();
12512        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12513        user_data = gen_userdata(n_user_data, 1);
12514        chunk = gen_const_char_ptr(n_chunk, 2);
12515        size = gen_int(n_size, 3);
12516        filename = gen_fileoutput(n_filename, 4);
12517
12518        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12519        desret_xmlParserCtxtPtr(ret_val);
12520        call_tests++;
12521        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12522        des_userdata(n_user_data, user_data, 1);
12523        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12524        des_int(n_size, size, 3);
12525        des_fileoutput(n_filename, filename, 4);
12526        xmlResetLastError();
12527        if (mem_base != xmlMemBlocks()) {
12528            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12529	           xmlMemBlocks() - mem_base);
12530	    test_ret++;
12531            printf(" %d", n_sax);
12532            printf(" %d", n_user_data);
12533            printf(" %d", n_chunk);
12534            printf(" %d", n_size);
12535            printf(" %d", n_filename);
12536            printf("\n");
12537        }
12538    }
12539    }
12540    }
12541    }
12542    }
12543    function_tests++;
12544#endif
12545
12546    return(test_ret);
12547}
12548
12549
12550static int
12551test_xmlCtxtReadDoc(void) {
12552    int test_ret = 0;
12553
12554    int mem_base;
12555    xmlDocPtr ret_val;
12556    xmlParserCtxtPtr ctxt; /* an XML parser context */
12557    int n_ctxt;
12558    xmlChar * cur; /* a pointer to a zero terminated string */
12559    int n_cur;
12560    const char * URL; /* the base URL to use for the document */
12561    int n_URL;
12562    char * encoding; /* the document encoding, or NULL */
12563    int n_encoding;
12564    int options; /* a combination of xmlParserOption */
12565    int n_options;
12566
12567    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12568    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12569    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12570    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12571    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12572        mem_base = xmlMemBlocks();
12573        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12574        cur = gen_const_xmlChar_ptr(n_cur, 1);
12575        URL = gen_filepath(n_URL, 2);
12576        encoding = gen_const_char_ptr(n_encoding, 3);
12577        options = gen_parseroptions(n_options, 4);
12578
12579        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12580        desret_xmlDocPtr(ret_val);
12581        call_tests++;
12582        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12583        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12584        des_filepath(n_URL, URL, 2);
12585        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12586        des_parseroptions(n_options, options, 4);
12587        xmlResetLastError();
12588        if (mem_base != xmlMemBlocks()) {
12589            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12590	           xmlMemBlocks() - mem_base);
12591	    test_ret++;
12592            printf(" %d", n_ctxt);
12593            printf(" %d", n_cur);
12594            printf(" %d", n_URL);
12595            printf(" %d", n_encoding);
12596            printf(" %d", n_options);
12597            printf("\n");
12598        }
12599    }
12600    }
12601    }
12602    }
12603    }
12604    function_tests++;
12605
12606    return(test_ret);
12607}
12608
12609
12610static int
12611test_xmlCtxtReadFile(void) {
12612    int test_ret = 0;
12613
12614    int mem_base;
12615    xmlDocPtr ret_val;
12616    xmlParserCtxtPtr ctxt; /* an XML parser context */
12617    int n_ctxt;
12618    const char * filename; /* a file or URL */
12619    int n_filename;
12620    char * encoding; /* the document encoding, or NULL */
12621    int n_encoding;
12622    int options; /* a combination of xmlParserOption */
12623    int n_options;
12624
12625    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12626    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12627    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12628    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12629        mem_base = xmlMemBlocks();
12630        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12631        filename = gen_filepath(n_filename, 1);
12632        encoding = gen_const_char_ptr(n_encoding, 2);
12633        options = gen_parseroptions(n_options, 3);
12634
12635        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12636        desret_xmlDocPtr(ret_val);
12637        call_tests++;
12638        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12639        des_filepath(n_filename, filename, 1);
12640        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12641        des_parseroptions(n_options, options, 3);
12642        xmlResetLastError();
12643        if (mem_base != xmlMemBlocks()) {
12644            printf("Leak of %d blocks found in xmlCtxtReadFile",
12645	           xmlMemBlocks() - mem_base);
12646	    test_ret++;
12647            printf(" %d", n_ctxt);
12648            printf(" %d", n_filename);
12649            printf(" %d", n_encoding);
12650            printf(" %d", n_options);
12651            printf("\n");
12652        }
12653    }
12654    }
12655    }
12656    }
12657    function_tests++;
12658
12659    return(test_ret);
12660}
12661
12662
12663static int
12664test_xmlCtxtReadMemory(void) {
12665    int test_ret = 0;
12666
12667    int mem_base;
12668    xmlDocPtr ret_val;
12669    xmlParserCtxtPtr ctxt; /* an XML parser context */
12670    int n_ctxt;
12671    char * buffer; /* a pointer to a char array */
12672    int n_buffer;
12673    int size; /* the size of the array */
12674    int n_size;
12675    const char * URL; /* the base URL to use for the document */
12676    int n_URL;
12677    char * encoding; /* the document encoding, or NULL */
12678    int n_encoding;
12679    int options; /* a combination of xmlParserOption */
12680    int n_options;
12681
12682    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12683    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12684    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12685    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12686    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12687    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12688        mem_base = xmlMemBlocks();
12689        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12690        buffer = gen_const_char_ptr(n_buffer, 1);
12691        size = gen_int(n_size, 2);
12692        URL = gen_filepath(n_URL, 3);
12693        encoding = gen_const_char_ptr(n_encoding, 4);
12694        options = gen_parseroptions(n_options, 5);
12695
12696        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12697        desret_xmlDocPtr(ret_val);
12698        call_tests++;
12699        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12700        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12701        des_int(n_size, size, 2);
12702        des_filepath(n_URL, URL, 3);
12703        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12704        des_parseroptions(n_options, options, 5);
12705        xmlResetLastError();
12706        if (mem_base != xmlMemBlocks()) {
12707            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12708	           xmlMemBlocks() - mem_base);
12709	    test_ret++;
12710            printf(" %d", n_ctxt);
12711            printf(" %d", n_buffer);
12712            printf(" %d", n_size);
12713            printf(" %d", n_URL);
12714            printf(" %d", n_encoding);
12715            printf(" %d", n_options);
12716            printf("\n");
12717        }
12718    }
12719    }
12720    }
12721    }
12722    }
12723    }
12724    function_tests++;
12725
12726    return(test_ret);
12727}
12728
12729
12730static int
12731test_xmlCtxtReset(void) {
12732    int test_ret = 0;
12733
12734    int mem_base;
12735    xmlParserCtxtPtr ctxt; /* an XML parser context */
12736    int n_ctxt;
12737
12738    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12739        mem_base = xmlMemBlocks();
12740        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12741
12742        xmlCtxtReset(ctxt);
12743        call_tests++;
12744        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12745        xmlResetLastError();
12746        if (mem_base != xmlMemBlocks()) {
12747            printf("Leak of %d blocks found in xmlCtxtReset",
12748	           xmlMemBlocks() - mem_base);
12749	    test_ret++;
12750            printf(" %d", n_ctxt);
12751            printf("\n");
12752        }
12753    }
12754    function_tests++;
12755
12756    return(test_ret);
12757}
12758
12759
12760static int
12761test_xmlCtxtResetPush(void) {
12762    int test_ret = 0;
12763
12764    int mem_base;
12765    int ret_val;
12766    xmlParserCtxtPtr ctxt; /* an XML parser context */
12767    int n_ctxt;
12768    char * chunk; /* a pointer to an array of chars */
12769    int n_chunk;
12770    int size; /* number of chars in the array */
12771    int n_size;
12772    const char * filename; /* an optional file name or URI */
12773    int n_filename;
12774    char * encoding; /* the document encoding, or NULL */
12775    int n_encoding;
12776
12777    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12778    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12779    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12780    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12781    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12782        mem_base = xmlMemBlocks();
12783        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12784        chunk = gen_const_char_ptr(n_chunk, 1);
12785        size = gen_int(n_size, 2);
12786        filename = gen_filepath(n_filename, 3);
12787        encoding = gen_const_char_ptr(n_encoding, 4);
12788
12789        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12790        desret_int(ret_val);
12791        call_tests++;
12792        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12793        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12794        des_int(n_size, size, 2);
12795        des_filepath(n_filename, filename, 3);
12796        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12797        xmlResetLastError();
12798        if (mem_base != xmlMemBlocks()) {
12799            printf("Leak of %d blocks found in xmlCtxtResetPush",
12800	           xmlMemBlocks() - mem_base);
12801	    test_ret++;
12802            printf(" %d", n_ctxt);
12803            printf(" %d", n_chunk);
12804            printf(" %d", n_size);
12805            printf(" %d", n_filename);
12806            printf(" %d", n_encoding);
12807            printf("\n");
12808        }
12809    }
12810    }
12811    }
12812    }
12813    }
12814    function_tests++;
12815
12816    return(test_ret);
12817}
12818
12819
12820static int
12821test_xmlCtxtUseOptions(void) {
12822    int test_ret = 0;
12823
12824    int mem_base;
12825    int ret_val;
12826    xmlParserCtxtPtr ctxt; /* an XML parser context */
12827    int n_ctxt;
12828    int options; /* a combination of xmlParserOption */
12829    int n_options;
12830
12831    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12832    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12833        mem_base = xmlMemBlocks();
12834        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12835        options = gen_parseroptions(n_options, 1);
12836
12837        ret_val = xmlCtxtUseOptions(ctxt, options);
12838        desret_int(ret_val);
12839        call_tests++;
12840        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12841        des_parseroptions(n_options, options, 1);
12842        xmlResetLastError();
12843        if (mem_base != xmlMemBlocks()) {
12844            printf("Leak of %d blocks found in xmlCtxtUseOptions",
12845	           xmlMemBlocks() - mem_base);
12846	    test_ret++;
12847            printf(" %d", n_ctxt);
12848            printf(" %d", n_options);
12849            printf("\n");
12850        }
12851    }
12852    }
12853    function_tests++;
12854
12855    return(test_ret);
12856}
12857
12858
12859static int
12860test_xmlGetExternalEntityLoader(void) {
12861    int test_ret = 0;
12862
12863
12864    /* missing type support */
12865    return(test_ret);
12866}
12867
12868
12869static int
12870test_xmlGetFeature(void) {
12871    int test_ret = 0;
12872
12873#if defined(LIBXML_LEGACY_ENABLED)
12874#ifdef LIBXML_LEGACY_ENABLED
12875    int mem_base;
12876    int ret_val;
12877    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
12878    int n_ctxt;
12879    char * name; /* the feature name */
12880    int n_name;
12881    void * result; /* location to store the result */
12882    int n_result;
12883
12884    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12885    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
12886    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
12887        mem_base = xmlMemBlocks();
12888        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12889        name = gen_const_char_ptr(n_name, 1);
12890        result = gen_void_ptr(n_result, 2);
12891
12892        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
12893        desret_int(ret_val);
12894        call_tests++;
12895        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12896        des_const_char_ptr(n_name, (const char *)name, 1);
12897        des_void_ptr(n_result, result, 2);
12898        xmlResetLastError();
12899        if (mem_base != xmlMemBlocks()) {
12900            printf("Leak of %d blocks found in xmlGetFeature",
12901	           xmlMemBlocks() - mem_base);
12902	    test_ret++;
12903            printf(" %d", n_ctxt);
12904            printf(" %d", n_name);
12905            printf(" %d", n_result);
12906            printf("\n");
12907        }
12908    }
12909    }
12910    }
12911    function_tests++;
12912#endif
12913#endif
12914
12915    return(test_ret);
12916}
12917
12918
12919#define gen_nb_const_char_ptr_ptr 1
12920static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12921    return(NULL);
12922}
12923static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12924}
12925
12926static int
12927test_xmlGetFeaturesList(void) {
12928    int test_ret = 0;
12929
12930#if defined(LIBXML_LEGACY_ENABLED)
12931#ifdef LIBXML_LEGACY_ENABLED
12932    int mem_base;
12933    int ret_val;
12934    int * len; /* the length of the features name array (input/output) */
12935    int n_len;
12936    char ** result; /* an array of string to be filled with the features name. */
12937    int n_result;
12938
12939    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
12940    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
12941        mem_base = xmlMemBlocks();
12942        len = gen_int_ptr(n_len, 0);
12943        result = gen_const_char_ptr_ptr(n_result, 1);
12944
12945        ret_val = xmlGetFeaturesList(len, (const char **)result);
12946        desret_int(ret_val);
12947        call_tests++;
12948        des_int_ptr(n_len, len, 0);
12949        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
12950        xmlResetLastError();
12951        if (mem_base != xmlMemBlocks()) {
12952            printf("Leak of %d blocks found in xmlGetFeaturesList",
12953	           xmlMemBlocks() - mem_base);
12954	    test_ret++;
12955            printf(" %d", n_len);
12956            printf(" %d", n_result);
12957            printf("\n");
12958        }
12959    }
12960    }
12961    function_tests++;
12962#endif
12963#endif
12964
12965    return(test_ret);
12966}
12967
12968
12969static int
12970test_xmlIOParseDTD(void) {
12971    int test_ret = 0;
12972
12973#if defined(LIBXML_VALID_ENABLED)
12974#ifdef LIBXML_VALID_ENABLED
12975    int mem_base;
12976    xmlDtdPtr ret_val;
12977    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
12978    int n_sax;
12979    xmlParserInputBufferPtr input; /* an Input Buffer */
12980    int n_input;
12981    xmlCharEncoding enc; /* the charset encoding if known */
12982    int n_enc;
12983
12984    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12985    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
12986    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
12987        mem_base = xmlMemBlocks();
12988        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12989        input = gen_xmlParserInputBufferPtr(n_input, 1);
12990        enc = gen_xmlCharEncoding(n_enc, 2);
12991
12992        ret_val = xmlIOParseDTD(sax, input, enc);
12993        input = NULL;
12994        desret_xmlDtdPtr(ret_val);
12995        call_tests++;
12996        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12997        des_xmlParserInputBufferPtr(n_input, input, 1);
12998        des_xmlCharEncoding(n_enc, enc, 2);
12999        xmlResetLastError();
13000        if (mem_base != xmlMemBlocks()) {
13001            printf("Leak of %d blocks found in xmlIOParseDTD",
13002	           xmlMemBlocks() - mem_base);
13003	    test_ret++;
13004            printf(" %d", n_sax);
13005            printf(" %d", n_input);
13006            printf(" %d", n_enc);
13007            printf("\n");
13008        }
13009    }
13010    }
13011    }
13012    function_tests++;
13013#endif
13014#endif
13015
13016    return(test_ret);
13017}
13018
13019
13020static int
13021test_xmlInitNodeInfoSeq(void) {
13022    int test_ret = 0;
13023
13024    int mem_base;
13025    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13026    int n_seq;
13027
13028    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13029        mem_base = xmlMemBlocks();
13030        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13031
13032        xmlInitNodeInfoSeq(seq);
13033        call_tests++;
13034        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13035        xmlResetLastError();
13036        if (mem_base != xmlMemBlocks()) {
13037            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13038	           xmlMemBlocks() - mem_base);
13039	    test_ret++;
13040            printf(" %d", n_seq);
13041            printf("\n");
13042        }
13043    }
13044    function_tests++;
13045
13046    return(test_ret);
13047}
13048
13049
13050static int
13051test_xmlInitParser(void) {
13052    int test_ret = 0;
13053
13054    int mem_base;
13055
13056        mem_base = xmlMemBlocks();
13057
13058        xmlInitParser();
13059        call_tests++;
13060        xmlResetLastError();
13061        if (mem_base != xmlMemBlocks()) {
13062            printf("Leak of %d blocks found in xmlInitParser",
13063	           xmlMemBlocks() - mem_base);
13064	    test_ret++;
13065            printf("\n");
13066        }
13067    function_tests++;
13068
13069    return(test_ret);
13070}
13071
13072
13073static int
13074test_xmlInitParserCtxt(void) {
13075    int test_ret = 0;
13076
13077    int mem_base;
13078    int ret_val;
13079    xmlParserCtxtPtr ctxt; /* an XML parser context */
13080    int n_ctxt;
13081
13082    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13083        mem_base = xmlMemBlocks();
13084        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13085
13086        ret_val = xmlInitParserCtxt(ctxt);
13087        desret_int(ret_val);
13088        call_tests++;
13089        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13090        xmlResetLastError();
13091        if (mem_base != xmlMemBlocks()) {
13092            printf("Leak of %d blocks found in xmlInitParserCtxt",
13093	           xmlMemBlocks() - mem_base);
13094	    test_ret++;
13095            printf(" %d", n_ctxt);
13096            printf("\n");
13097        }
13098    }
13099    function_tests++;
13100
13101    return(test_ret);
13102}
13103
13104
13105static int
13106test_xmlKeepBlanksDefault(void) {
13107    int test_ret = 0;
13108
13109    int mem_base;
13110    int ret_val;
13111    int val; /* int 0 or 1 */
13112    int n_val;
13113
13114    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13115        mem_base = xmlMemBlocks();
13116        val = gen_int(n_val, 0);
13117
13118        ret_val = xmlKeepBlanksDefault(val);
13119        desret_int(ret_val);
13120        call_tests++;
13121        des_int(n_val, val, 0);
13122        xmlResetLastError();
13123        if (mem_base != xmlMemBlocks()) {
13124            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13125	           xmlMemBlocks() - mem_base);
13126	    test_ret++;
13127            printf(" %d", n_val);
13128            printf("\n");
13129        }
13130    }
13131    function_tests++;
13132
13133    return(test_ret);
13134}
13135
13136
13137static int
13138test_xmlLineNumbersDefault(void) {
13139    int test_ret = 0;
13140
13141    int mem_base;
13142    int ret_val;
13143    int val; /* int 0 or 1 */
13144    int n_val;
13145
13146    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13147        mem_base = xmlMemBlocks();
13148        val = gen_int(n_val, 0);
13149
13150        ret_val = xmlLineNumbersDefault(val);
13151        desret_int(ret_val);
13152        call_tests++;
13153        des_int(n_val, val, 0);
13154        xmlResetLastError();
13155        if (mem_base != xmlMemBlocks()) {
13156            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13157	           xmlMemBlocks() - mem_base);
13158	    test_ret++;
13159            printf(" %d", n_val);
13160            printf("\n");
13161        }
13162    }
13163    function_tests++;
13164
13165    return(test_ret);
13166}
13167
13168
13169static int
13170test_xmlLoadExternalEntity(void) {
13171    int test_ret = 0;
13172
13173    int mem_base;
13174    xmlParserInputPtr ret_val;
13175    const char * URL; /* the URL for the entity to load */
13176    int n_URL;
13177    char * ID; /* the Public ID for the entity to load */
13178    int n_ID;
13179    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13180    int n_ctxt;
13181
13182    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13183    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13184    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13185        mem_base = xmlMemBlocks();
13186        URL = gen_filepath(n_URL, 0);
13187        ID = gen_const_char_ptr(n_ID, 1);
13188        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13189
13190        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13191        desret_xmlParserInputPtr(ret_val);
13192        call_tests++;
13193        des_filepath(n_URL, URL, 0);
13194        des_const_char_ptr(n_ID, (const char *)ID, 1);
13195        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13196        xmlResetLastError();
13197        if (mem_base != xmlMemBlocks()) {
13198            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13199	           xmlMemBlocks() - mem_base);
13200	    test_ret++;
13201            printf(" %d", n_URL);
13202            printf(" %d", n_ID);
13203            printf(" %d", n_ctxt);
13204            printf("\n");
13205        }
13206    }
13207    }
13208    }
13209    function_tests++;
13210
13211    return(test_ret);
13212}
13213
13214
13215static int
13216test_xmlNewIOInputStream(void) {
13217    int test_ret = 0;
13218
13219    int mem_base;
13220    xmlParserInputPtr ret_val;
13221    xmlParserCtxtPtr ctxt; /* an XML parser context */
13222    int n_ctxt;
13223    xmlParserInputBufferPtr input; /* an I/O Input */
13224    int n_input;
13225    xmlCharEncoding enc; /* the charset encoding if known */
13226    int n_enc;
13227
13228    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13229    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13230    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13231        mem_base = xmlMemBlocks();
13232        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13233        input = gen_xmlParserInputBufferPtr(n_input, 1);
13234        enc = gen_xmlCharEncoding(n_enc, 2);
13235
13236        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13237        if (ret_val != NULL) input = NULL;
13238        desret_xmlParserInputPtr(ret_val);
13239        call_tests++;
13240        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13241        des_xmlParserInputBufferPtr(n_input, input, 1);
13242        des_xmlCharEncoding(n_enc, enc, 2);
13243        xmlResetLastError();
13244        if (mem_base != xmlMemBlocks()) {
13245            printf("Leak of %d blocks found in xmlNewIOInputStream",
13246	           xmlMemBlocks() - mem_base);
13247	    test_ret++;
13248            printf(" %d", n_ctxt);
13249            printf(" %d", n_input);
13250            printf(" %d", n_enc);
13251            printf("\n");
13252        }
13253    }
13254    }
13255    }
13256    function_tests++;
13257
13258    return(test_ret);
13259}
13260
13261
13262static int
13263test_xmlNewParserCtxt(void) {
13264    int test_ret = 0;
13265
13266    int mem_base;
13267    xmlParserCtxtPtr ret_val;
13268
13269        mem_base = xmlMemBlocks();
13270
13271        ret_val = xmlNewParserCtxt();
13272        desret_xmlParserCtxtPtr(ret_val);
13273        call_tests++;
13274        xmlResetLastError();
13275        if (mem_base != xmlMemBlocks()) {
13276            printf("Leak of %d blocks found in xmlNewParserCtxt",
13277	           xmlMemBlocks() - mem_base);
13278	    test_ret++;
13279            printf("\n");
13280        }
13281    function_tests++;
13282
13283    return(test_ret);
13284}
13285
13286
13287#define gen_nb_xmlNodePtr_ptr 1
13288static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13289    return(NULL);
13290}
13291static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13292}
13293
13294static int
13295test_xmlParseBalancedChunkMemory(void) {
13296    int test_ret = 0;
13297
13298#if defined(LIBXML_SAX1_ENABLED)
13299#ifdef LIBXML_SAX1_ENABLED
13300    int mem_base;
13301    int ret_val;
13302    xmlDocPtr doc; /* the document the chunk pertains to */
13303    int n_doc;
13304    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13305    int n_sax;
13306    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13307    int n_user_data;
13308    int depth; /* Used for loop detection, use 0 */
13309    int n_depth;
13310    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13311    int n_string;
13312    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13313    int n_lst;
13314
13315    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13316    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13317    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13318    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13319    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13320    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13321        mem_base = xmlMemBlocks();
13322        doc = gen_xmlDocPtr(n_doc, 0);
13323        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13324        user_data = gen_userdata(n_user_data, 2);
13325        depth = gen_int(n_depth, 3);
13326        string = gen_const_xmlChar_ptr(n_string, 4);
13327        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13328
13329#ifdef LIBXML_SAX1_ENABLED
13330        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13331#endif
13332
13333
13334        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13335        desret_int(ret_val);
13336        call_tests++;
13337        des_xmlDocPtr(n_doc, doc, 0);
13338        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13339        des_userdata(n_user_data, user_data, 2);
13340        des_int(n_depth, depth, 3);
13341        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13342        des_xmlNodePtr_ptr(n_lst, lst, 5);
13343        xmlResetLastError();
13344        if (mem_base != xmlMemBlocks()) {
13345            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13346	           xmlMemBlocks() - mem_base);
13347	    test_ret++;
13348            printf(" %d", n_doc);
13349            printf(" %d", n_sax);
13350            printf(" %d", n_user_data);
13351            printf(" %d", n_depth);
13352            printf(" %d", n_string);
13353            printf(" %d", n_lst);
13354            printf("\n");
13355        }
13356    }
13357    }
13358    }
13359    }
13360    }
13361    }
13362    function_tests++;
13363#endif
13364#endif
13365
13366    return(test_ret);
13367}
13368
13369
13370static int
13371test_xmlParseBalancedChunkMemoryRecover(void) {
13372    int test_ret = 0;
13373
13374#if defined(LIBXML_SAX1_ENABLED)
13375#ifdef LIBXML_SAX1_ENABLED
13376    int mem_base;
13377    int ret_val;
13378    xmlDocPtr doc; /* the document the chunk pertains to */
13379    int n_doc;
13380    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13381    int n_sax;
13382    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13383    int n_user_data;
13384    int depth; /* Used for loop detection, use 0 */
13385    int n_depth;
13386    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13387    int n_string;
13388    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13389    int n_lst;
13390    int recover; /* return nodes even if the data is broken (use 0) */
13391    int n_recover;
13392
13393    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13394    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13395    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13396    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13397    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13398    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13399    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13400        mem_base = xmlMemBlocks();
13401        doc = gen_xmlDocPtr(n_doc, 0);
13402        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13403        user_data = gen_userdata(n_user_data, 2);
13404        depth = gen_int(n_depth, 3);
13405        string = gen_const_xmlChar_ptr(n_string, 4);
13406        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13407        recover = gen_int(n_recover, 6);
13408
13409#ifdef LIBXML_SAX1_ENABLED
13410        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13411#endif
13412
13413
13414        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13415        desret_int(ret_val);
13416        call_tests++;
13417        des_xmlDocPtr(n_doc, doc, 0);
13418        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13419        des_userdata(n_user_data, user_data, 2);
13420        des_int(n_depth, depth, 3);
13421        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13422        des_xmlNodePtr_ptr(n_lst, lst, 5);
13423        des_int(n_recover, recover, 6);
13424        xmlResetLastError();
13425        if (mem_base != xmlMemBlocks()) {
13426            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13427	           xmlMemBlocks() - mem_base);
13428	    test_ret++;
13429            printf(" %d", n_doc);
13430            printf(" %d", n_sax);
13431            printf(" %d", n_user_data);
13432            printf(" %d", n_depth);
13433            printf(" %d", n_string);
13434            printf(" %d", n_lst);
13435            printf(" %d", n_recover);
13436            printf("\n");
13437        }
13438    }
13439    }
13440    }
13441    }
13442    }
13443    }
13444    }
13445    function_tests++;
13446#endif
13447#endif
13448
13449    return(test_ret);
13450}
13451
13452
13453static int
13454test_xmlParseChunk(void) {
13455    int test_ret = 0;
13456
13457#if defined(LIBXML_PUSH_ENABLED)
13458    int mem_base;
13459    int ret_val;
13460    xmlParserCtxtPtr ctxt; /* an XML parser context */
13461    int n_ctxt;
13462    char * chunk; /* an char array */
13463    int n_chunk;
13464    int size; /* the size in byte of the chunk */
13465    int n_size;
13466    int terminate; /* last chunk indicator */
13467    int n_terminate;
13468
13469    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13470    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13471    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13472    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13473        mem_base = xmlMemBlocks();
13474        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13475        chunk = gen_const_char_ptr(n_chunk, 1);
13476        size = gen_int(n_size, 2);
13477        terminate = gen_int(n_terminate, 3);
13478
13479        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13480        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13481        desret_int(ret_val);
13482        call_tests++;
13483        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13484        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13485        des_int(n_size, size, 2);
13486        des_int(n_terminate, terminate, 3);
13487        xmlResetLastError();
13488        if (mem_base != xmlMemBlocks()) {
13489            printf("Leak of %d blocks found in xmlParseChunk",
13490	           xmlMemBlocks() - mem_base);
13491	    test_ret++;
13492            printf(" %d", n_ctxt);
13493            printf(" %d", n_chunk);
13494            printf(" %d", n_size);
13495            printf(" %d", n_terminate);
13496            printf("\n");
13497        }
13498    }
13499    }
13500    }
13501    }
13502    function_tests++;
13503#endif
13504
13505    return(test_ret);
13506}
13507
13508
13509static int
13510test_xmlParseCtxtExternalEntity(void) {
13511    int test_ret = 0;
13512
13513    int mem_base;
13514    int ret_val;
13515    xmlParserCtxtPtr ctx; /* the existing parsing context */
13516    int n_ctx;
13517    xmlChar * URL; /* the URL for the entity to load */
13518    int n_URL;
13519    xmlChar * ID; /* the System ID for the entity to load */
13520    int n_ID;
13521    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13522    int n_lst;
13523
13524    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13525    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13526    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13527    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13528        mem_base = xmlMemBlocks();
13529        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13530        URL = gen_const_xmlChar_ptr(n_URL, 1);
13531        ID = gen_const_xmlChar_ptr(n_ID, 2);
13532        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13533
13534        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13535        desret_int(ret_val);
13536        call_tests++;
13537        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13538        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13539        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13540        des_xmlNodePtr_ptr(n_lst, lst, 3);
13541        xmlResetLastError();
13542        if (mem_base != xmlMemBlocks()) {
13543            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13544	           xmlMemBlocks() - mem_base);
13545	    test_ret++;
13546            printf(" %d", n_ctx);
13547            printf(" %d", n_URL);
13548            printf(" %d", n_ID);
13549            printf(" %d", n_lst);
13550            printf("\n");
13551        }
13552    }
13553    }
13554    }
13555    }
13556    function_tests++;
13557
13558    return(test_ret);
13559}
13560
13561
13562static int
13563test_xmlParseDTD(void) {
13564    int test_ret = 0;
13565
13566#if defined(LIBXML_VALID_ENABLED)
13567#ifdef LIBXML_VALID_ENABLED
13568    int mem_base;
13569    xmlDtdPtr ret_val;
13570    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13571    int n_ExternalID;
13572    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13573    int n_SystemID;
13574
13575    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13576    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13577        mem_base = xmlMemBlocks();
13578        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13579        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13580
13581        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13582        desret_xmlDtdPtr(ret_val);
13583        call_tests++;
13584        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13585        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13586        xmlResetLastError();
13587        if (mem_base != xmlMemBlocks()) {
13588            printf("Leak of %d blocks found in xmlParseDTD",
13589	           xmlMemBlocks() - mem_base);
13590	    test_ret++;
13591            printf(" %d", n_ExternalID);
13592            printf(" %d", n_SystemID);
13593            printf("\n");
13594        }
13595    }
13596    }
13597    function_tests++;
13598#endif
13599#endif
13600
13601    return(test_ret);
13602}
13603
13604
13605static int
13606test_xmlParseDoc(void) {
13607    int test_ret = 0;
13608
13609#if defined(LIBXML_SAX1_ENABLED)
13610#ifdef LIBXML_SAX1_ENABLED
13611    int mem_base;
13612    xmlDocPtr ret_val;
13613    xmlChar * cur; /* a pointer to an array of xmlChar */
13614    int n_cur;
13615
13616    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13617        mem_base = xmlMemBlocks();
13618        cur = gen_const_xmlChar_ptr(n_cur, 0);
13619
13620        ret_val = xmlParseDoc((const xmlChar *)cur);
13621        desret_xmlDocPtr(ret_val);
13622        call_tests++;
13623        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13624        xmlResetLastError();
13625        if (mem_base != xmlMemBlocks()) {
13626            printf("Leak of %d blocks found in xmlParseDoc",
13627	           xmlMemBlocks() - mem_base);
13628	    test_ret++;
13629            printf(" %d", n_cur);
13630            printf("\n");
13631        }
13632    }
13633    function_tests++;
13634#endif
13635#endif
13636
13637    return(test_ret);
13638}
13639
13640
13641static int
13642test_xmlParseDocument(void) {
13643    int test_ret = 0;
13644
13645    int mem_base;
13646    int ret_val;
13647    xmlParserCtxtPtr ctxt; /* an XML parser context */
13648    int n_ctxt;
13649
13650    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13651        mem_base = xmlMemBlocks();
13652        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13653
13654        ret_val = xmlParseDocument(ctxt);
13655        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13656        desret_int(ret_val);
13657        call_tests++;
13658        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13659        xmlResetLastError();
13660        if (mem_base != xmlMemBlocks()) {
13661            printf("Leak of %d blocks found in xmlParseDocument",
13662	           xmlMemBlocks() - mem_base);
13663	    test_ret++;
13664            printf(" %d", n_ctxt);
13665            printf("\n");
13666        }
13667    }
13668    function_tests++;
13669
13670    return(test_ret);
13671}
13672
13673
13674static int
13675test_xmlParseEntity(void) {
13676    int test_ret = 0;
13677
13678#if defined(LIBXML_SAX1_ENABLED)
13679#ifdef LIBXML_SAX1_ENABLED
13680    int mem_base;
13681    xmlDocPtr ret_val;
13682    const char * filename; /* the filename */
13683    int n_filename;
13684
13685    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13686        mem_base = xmlMemBlocks();
13687        filename = gen_filepath(n_filename, 0);
13688
13689        ret_val = xmlParseEntity(filename);
13690        desret_xmlDocPtr(ret_val);
13691        call_tests++;
13692        des_filepath(n_filename, filename, 0);
13693        xmlResetLastError();
13694        if (mem_base != xmlMemBlocks()) {
13695            printf("Leak of %d blocks found in xmlParseEntity",
13696	           xmlMemBlocks() - mem_base);
13697	    test_ret++;
13698            printf(" %d", n_filename);
13699            printf("\n");
13700        }
13701    }
13702    function_tests++;
13703#endif
13704#endif
13705
13706    return(test_ret);
13707}
13708
13709
13710static int
13711test_xmlParseExtParsedEnt(void) {
13712    int test_ret = 0;
13713
13714    int mem_base;
13715    int ret_val;
13716    xmlParserCtxtPtr ctxt; /* an XML parser context */
13717    int n_ctxt;
13718
13719    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13720        mem_base = xmlMemBlocks();
13721        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13722
13723        ret_val = xmlParseExtParsedEnt(ctxt);
13724        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13725        desret_int(ret_val);
13726        call_tests++;
13727        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13728        xmlResetLastError();
13729        if (mem_base != xmlMemBlocks()) {
13730            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13731	           xmlMemBlocks() - mem_base);
13732	    test_ret++;
13733            printf(" %d", n_ctxt);
13734            printf("\n");
13735        }
13736    }
13737    function_tests++;
13738
13739    return(test_ret);
13740}
13741
13742
13743static int
13744test_xmlParseExternalEntity(void) {
13745    int test_ret = 0;
13746
13747#if defined(LIBXML_SAX1_ENABLED)
13748#ifdef LIBXML_SAX1_ENABLED
13749    int mem_base;
13750    int ret_val;
13751    xmlDocPtr doc; /* the document the chunk pertains to */
13752    int n_doc;
13753    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13754    int n_sax;
13755    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13756    int n_user_data;
13757    int depth; /* Used for loop detection, use 0 */
13758    int n_depth;
13759    xmlChar * URL; /* the URL for the entity to load */
13760    int n_URL;
13761    xmlChar * ID; /* the System ID for the entity to load */
13762    int n_ID;
13763    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13764    int n_lst;
13765
13766    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13767    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13768    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13769    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13770    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13771    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13772    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13773        mem_base = xmlMemBlocks();
13774        doc = gen_xmlDocPtr(n_doc, 0);
13775        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13776        user_data = gen_userdata(n_user_data, 2);
13777        depth = gen_int(n_depth, 3);
13778        URL = gen_const_xmlChar_ptr(n_URL, 4);
13779        ID = gen_const_xmlChar_ptr(n_ID, 5);
13780        lst = gen_xmlNodePtr_ptr(n_lst, 6);
13781
13782        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13783        desret_int(ret_val);
13784        call_tests++;
13785        des_xmlDocPtr(n_doc, doc, 0);
13786        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13787        des_userdata(n_user_data, user_data, 2);
13788        des_int(n_depth, depth, 3);
13789        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13790        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13791        des_xmlNodePtr_ptr(n_lst, lst, 6);
13792        xmlResetLastError();
13793        if (mem_base != xmlMemBlocks()) {
13794            printf("Leak of %d blocks found in xmlParseExternalEntity",
13795	           xmlMemBlocks() - mem_base);
13796	    test_ret++;
13797            printf(" %d", n_doc);
13798            printf(" %d", n_sax);
13799            printf(" %d", n_user_data);
13800            printf(" %d", n_depth);
13801            printf(" %d", n_URL);
13802            printf(" %d", n_ID);
13803            printf(" %d", n_lst);
13804            printf("\n");
13805        }
13806    }
13807    }
13808    }
13809    }
13810    }
13811    }
13812    }
13813    function_tests++;
13814#endif
13815#endif
13816
13817    return(test_ret);
13818}
13819
13820
13821static int
13822test_xmlParseFile(void) {
13823    int test_ret = 0;
13824
13825#if defined(LIBXML_SAX1_ENABLED)
13826#ifdef LIBXML_SAX1_ENABLED
13827    int mem_base;
13828    xmlDocPtr ret_val;
13829    const char * filename; /* the filename */
13830    int n_filename;
13831
13832    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13833        mem_base = xmlMemBlocks();
13834        filename = gen_filepath(n_filename, 0);
13835
13836        ret_val = xmlParseFile(filename);
13837        desret_xmlDocPtr(ret_val);
13838        call_tests++;
13839        des_filepath(n_filename, filename, 0);
13840        xmlResetLastError();
13841        if (mem_base != xmlMemBlocks()) {
13842            printf("Leak of %d blocks found in xmlParseFile",
13843	           xmlMemBlocks() - mem_base);
13844	    test_ret++;
13845            printf(" %d", n_filename);
13846            printf("\n");
13847        }
13848    }
13849    function_tests++;
13850#endif
13851#endif
13852
13853    return(test_ret);
13854}
13855
13856
13857static int
13858test_xmlParseInNodeContext(void) {
13859    int test_ret = 0;
13860
13861    int mem_base;
13862    xmlParserErrors ret_val;
13863    xmlNodePtr node; /* the context node */
13864    int n_node;
13865    char * data; /* the input string */
13866    int n_data;
13867    int datalen; /* the input string length in bytes */
13868    int n_datalen;
13869    int options; /* a combination of xmlParserOption */
13870    int n_options;
13871    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13872    int n_lst;
13873
13874    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13875    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
13876    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
13877    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13878    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13879        mem_base = xmlMemBlocks();
13880        node = gen_xmlNodePtr(n_node, 0);
13881        data = gen_const_char_ptr(n_data, 1);
13882        datalen = gen_int(n_datalen, 2);
13883        options = gen_parseroptions(n_options, 3);
13884        lst = gen_xmlNodePtr_ptr(n_lst, 4);
13885
13886        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
13887        desret_xmlParserErrors(ret_val);
13888        call_tests++;
13889        des_xmlNodePtr(n_node, node, 0);
13890        des_const_char_ptr(n_data, (const char *)data, 1);
13891        des_int(n_datalen, datalen, 2);
13892        des_parseroptions(n_options, options, 3);
13893        des_xmlNodePtr_ptr(n_lst, lst, 4);
13894        xmlResetLastError();
13895        if (mem_base != xmlMemBlocks()) {
13896            printf("Leak of %d blocks found in xmlParseInNodeContext",
13897	           xmlMemBlocks() - mem_base);
13898	    test_ret++;
13899            printf(" %d", n_node);
13900            printf(" %d", n_data);
13901            printf(" %d", n_datalen);
13902            printf(" %d", n_options);
13903            printf(" %d", n_lst);
13904            printf("\n");
13905        }
13906    }
13907    }
13908    }
13909    }
13910    }
13911    function_tests++;
13912
13913    return(test_ret);
13914}
13915
13916
13917static int
13918test_xmlParseMemory(void) {
13919    int test_ret = 0;
13920
13921#if defined(LIBXML_SAX1_ENABLED)
13922#ifdef LIBXML_SAX1_ENABLED
13923    int mem_base;
13924    xmlDocPtr ret_val;
13925    char * buffer; /* an pointer to a char array */
13926    int n_buffer;
13927    int size; /* the size of the array */
13928    int n_size;
13929
13930    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
13931    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13932        mem_base = xmlMemBlocks();
13933        buffer = gen_const_char_ptr(n_buffer, 0);
13934        size = gen_int(n_size, 1);
13935
13936        ret_val = xmlParseMemory((const char *)buffer, size);
13937        desret_xmlDocPtr(ret_val);
13938        call_tests++;
13939        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
13940        des_int(n_size, size, 1);
13941        xmlResetLastError();
13942        if (mem_base != xmlMemBlocks()) {
13943            printf("Leak of %d blocks found in xmlParseMemory",
13944	           xmlMemBlocks() - mem_base);
13945	    test_ret++;
13946            printf(" %d", n_buffer);
13947            printf(" %d", n_size);
13948            printf("\n");
13949        }
13950    }
13951    }
13952    function_tests++;
13953#endif
13954#endif
13955
13956    return(test_ret);
13957}
13958
13959
13960#define gen_nb_const_xmlParserNodeInfoPtr 1
13961static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13962    return(NULL);
13963}
13964static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13965}
13966
13967static int
13968test_xmlParserAddNodeInfo(void) {
13969    int test_ret = 0;
13970
13971    int mem_base;
13972    xmlParserCtxtPtr ctxt; /* an XML parser context */
13973    int n_ctxt;
13974    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
13975    int n_info;
13976
13977    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13978    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
13979        mem_base = xmlMemBlocks();
13980        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13981        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
13982
13983        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
13984        call_tests++;
13985        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13986        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
13987        xmlResetLastError();
13988        if (mem_base != xmlMemBlocks()) {
13989            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
13990	           xmlMemBlocks() - mem_base);
13991	    test_ret++;
13992            printf(" %d", n_ctxt);
13993            printf(" %d", n_info);
13994            printf("\n");
13995        }
13996    }
13997    }
13998    function_tests++;
13999
14000    return(test_ret);
14001}
14002
14003
14004#define gen_nb_const_xmlParserCtxtPtr 1
14005static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14006    return(NULL);
14007}
14008static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14009}
14010
14011#define gen_nb_const_xmlNodePtr 1
14012static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14013    return(NULL);
14014}
14015static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14016}
14017
14018static int
14019test_xmlParserFindNodeInfo(void) {
14020    int test_ret = 0;
14021
14022    int mem_base;
14023    const xmlParserNodeInfo * ret_val;
14024    xmlParserCtxtPtr ctx; /* an XML parser context */
14025    int n_ctx;
14026    xmlNodePtr node; /* an XML node within the tree */
14027    int n_node;
14028
14029    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14030    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14031        mem_base = xmlMemBlocks();
14032        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14033        node = gen_const_xmlNodePtr(n_node, 1);
14034
14035        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14036        desret_const_xmlParserNodeInfo_ptr(ret_val);
14037        call_tests++;
14038        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14039        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14040        xmlResetLastError();
14041        if (mem_base != xmlMemBlocks()) {
14042            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14043	           xmlMemBlocks() - mem_base);
14044	    test_ret++;
14045            printf(" %d", n_ctx);
14046            printf(" %d", n_node);
14047            printf("\n");
14048        }
14049    }
14050    }
14051    function_tests++;
14052
14053    return(test_ret);
14054}
14055
14056
14057#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14058static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14059    return(NULL);
14060}
14061static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14062}
14063
14064static int
14065test_xmlParserFindNodeInfoIndex(void) {
14066    int test_ret = 0;
14067
14068    int mem_base;
14069    unsigned long ret_val;
14070    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14071    int n_seq;
14072    xmlNodePtr node; /* an XML node pointer */
14073    int n_node;
14074
14075    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14076    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14077        mem_base = xmlMemBlocks();
14078        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14079        node = gen_const_xmlNodePtr(n_node, 1);
14080
14081        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14082        desret_unsigned_long(ret_val);
14083        call_tests++;
14084        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14085        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14086        xmlResetLastError();
14087        if (mem_base != xmlMemBlocks()) {
14088            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14089	           xmlMemBlocks() - mem_base);
14090	    test_ret++;
14091            printf(" %d", n_seq);
14092            printf(" %d", n_node);
14093            printf("\n");
14094        }
14095    }
14096    }
14097    function_tests++;
14098
14099    return(test_ret);
14100}
14101
14102
14103#define gen_nb_xmlParserInputPtr 1
14104static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14105    return(NULL);
14106}
14107static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14108}
14109
14110static int
14111test_xmlParserInputGrow(void) {
14112    int test_ret = 0;
14113
14114    int mem_base;
14115    int ret_val;
14116    xmlParserInputPtr in; /* an XML parser input */
14117    int n_in;
14118    int len; /* an indicative size for the lookahead */
14119    int n_len;
14120
14121    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14122    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14123        mem_base = xmlMemBlocks();
14124        in = gen_xmlParserInputPtr(n_in, 0);
14125        len = gen_int(n_len, 1);
14126
14127        ret_val = xmlParserInputGrow(in, len);
14128        desret_int(ret_val);
14129        call_tests++;
14130        des_xmlParserInputPtr(n_in, in, 0);
14131        des_int(n_len, len, 1);
14132        xmlResetLastError();
14133        if (mem_base != xmlMemBlocks()) {
14134            printf("Leak of %d blocks found in xmlParserInputGrow",
14135	           xmlMemBlocks() - mem_base);
14136	    test_ret++;
14137            printf(" %d", n_in);
14138            printf(" %d", n_len);
14139            printf("\n");
14140        }
14141    }
14142    }
14143    function_tests++;
14144
14145    return(test_ret);
14146}
14147
14148
14149static int
14150test_xmlParserInputRead(void) {
14151    int test_ret = 0;
14152
14153    int mem_base;
14154    int ret_val;
14155    xmlParserInputPtr in; /* an XML parser input */
14156    int n_in;
14157    int len; /* an indicative size for the lookahead */
14158    int n_len;
14159
14160    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14161    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14162        mem_base = xmlMemBlocks();
14163        in = gen_xmlParserInputPtr(n_in, 0);
14164        len = gen_int(n_len, 1);
14165
14166        ret_val = xmlParserInputRead(in, len);
14167        desret_int(ret_val);
14168        call_tests++;
14169        des_xmlParserInputPtr(n_in, in, 0);
14170        des_int(n_len, len, 1);
14171        xmlResetLastError();
14172        if (mem_base != xmlMemBlocks()) {
14173            printf("Leak of %d blocks found in xmlParserInputRead",
14174	           xmlMemBlocks() - mem_base);
14175	    test_ret++;
14176            printf(" %d", n_in);
14177            printf(" %d", n_len);
14178            printf("\n");
14179        }
14180    }
14181    }
14182    function_tests++;
14183
14184    return(test_ret);
14185}
14186
14187
14188static int
14189test_xmlPedanticParserDefault(void) {
14190    int test_ret = 0;
14191
14192    int mem_base;
14193    int ret_val;
14194    int val; /* int 0 or 1 */
14195    int n_val;
14196
14197    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14198        mem_base = xmlMemBlocks();
14199        val = gen_int(n_val, 0);
14200
14201        ret_val = xmlPedanticParserDefault(val);
14202        desret_int(ret_val);
14203        call_tests++;
14204        des_int(n_val, val, 0);
14205        xmlResetLastError();
14206        if (mem_base != xmlMemBlocks()) {
14207            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14208	           xmlMemBlocks() - mem_base);
14209	    test_ret++;
14210            printf(" %d", n_val);
14211            printf("\n");
14212        }
14213    }
14214    function_tests++;
14215
14216    return(test_ret);
14217}
14218
14219
14220static int
14221test_xmlReadDoc(void) {
14222    int test_ret = 0;
14223
14224    int mem_base;
14225    xmlDocPtr ret_val;
14226    xmlChar * cur; /* a pointer to a zero terminated string */
14227    int n_cur;
14228    const char * URL; /* the base URL to use for the document */
14229    int n_URL;
14230    char * encoding; /* the document encoding, or NULL */
14231    int n_encoding;
14232    int options; /* a combination of xmlParserOption */
14233    int n_options;
14234
14235    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14236    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14237    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14238    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14239        mem_base = xmlMemBlocks();
14240        cur = gen_const_xmlChar_ptr(n_cur, 0);
14241        URL = gen_filepath(n_URL, 1);
14242        encoding = gen_const_char_ptr(n_encoding, 2);
14243        options = gen_parseroptions(n_options, 3);
14244
14245        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14246        desret_xmlDocPtr(ret_val);
14247        call_tests++;
14248        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14249        des_filepath(n_URL, URL, 1);
14250        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14251        des_parseroptions(n_options, options, 3);
14252        xmlResetLastError();
14253        if (mem_base != xmlMemBlocks()) {
14254            printf("Leak of %d blocks found in xmlReadDoc",
14255	           xmlMemBlocks() - mem_base);
14256	    test_ret++;
14257            printf(" %d", n_cur);
14258            printf(" %d", n_URL);
14259            printf(" %d", n_encoding);
14260            printf(" %d", n_options);
14261            printf("\n");
14262        }
14263    }
14264    }
14265    }
14266    }
14267    function_tests++;
14268
14269    return(test_ret);
14270}
14271
14272
14273static int
14274test_xmlReadFile(void) {
14275    int test_ret = 0;
14276
14277    int mem_base;
14278    xmlDocPtr ret_val;
14279    const char * filename; /* a file or URL */
14280    int n_filename;
14281    char * encoding; /* the document encoding, or NULL */
14282    int n_encoding;
14283    int options; /* a combination of xmlParserOption */
14284    int n_options;
14285
14286    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14287    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14288    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14289        mem_base = xmlMemBlocks();
14290        filename = gen_filepath(n_filename, 0);
14291        encoding = gen_const_char_ptr(n_encoding, 1);
14292        options = gen_parseroptions(n_options, 2);
14293
14294        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14295        desret_xmlDocPtr(ret_val);
14296        call_tests++;
14297        des_filepath(n_filename, filename, 0);
14298        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14299        des_parseroptions(n_options, options, 2);
14300        xmlResetLastError();
14301        if (mem_base != xmlMemBlocks()) {
14302            printf("Leak of %d blocks found in xmlReadFile",
14303	           xmlMemBlocks() - mem_base);
14304	    test_ret++;
14305            printf(" %d", n_filename);
14306            printf(" %d", n_encoding);
14307            printf(" %d", n_options);
14308            printf("\n");
14309        }
14310    }
14311    }
14312    }
14313    function_tests++;
14314
14315    return(test_ret);
14316}
14317
14318
14319static int
14320test_xmlReadMemory(void) {
14321    int test_ret = 0;
14322
14323    int mem_base;
14324    xmlDocPtr ret_val;
14325    char * buffer; /* a pointer to a char array */
14326    int n_buffer;
14327    int size; /* the size of the array */
14328    int n_size;
14329    const char * URL; /* the base URL to use for the document */
14330    int n_URL;
14331    char * encoding; /* the document encoding, or NULL */
14332    int n_encoding;
14333    int options; /* a combination of xmlParserOption */
14334    int n_options;
14335
14336    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14337    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14338    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14339    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14340    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14341        mem_base = xmlMemBlocks();
14342        buffer = gen_const_char_ptr(n_buffer, 0);
14343        size = gen_int(n_size, 1);
14344        URL = gen_filepath(n_URL, 2);
14345        encoding = gen_const_char_ptr(n_encoding, 3);
14346        options = gen_parseroptions(n_options, 4);
14347
14348        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14349        desret_xmlDocPtr(ret_val);
14350        call_tests++;
14351        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14352        des_int(n_size, size, 1);
14353        des_filepath(n_URL, URL, 2);
14354        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14355        des_parseroptions(n_options, options, 4);
14356        xmlResetLastError();
14357        if (mem_base != xmlMemBlocks()) {
14358            printf("Leak of %d blocks found in xmlReadMemory",
14359	           xmlMemBlocks() - mem_base);
14360	    test_ret++;
14361            printf(" %d", n_buffer);
14362            printf(" %d", n_size);
14363            printf(" %d", n_URL);
14364            printf(" %d", n_encoding);
14365            printf(" %d", n_options);
14366            printf("\n");
14367        }
14368    }
14369    }
14370    }
14371    }
14372    }
14373    function_tests++;
14374
14375    return(test_ret);
14376}
14377
14378
14379static int
14380test_xmlRecoverDoc(void) {
14381    int test_ret = 0;
14382
14383#if defined(LIBXML_SAX1_ENABLED)
14384#ifdef LIBXML_SAX1_ENABLED
14385    int mem_base;
14386    xmlDocPtr ret_val;
14387    xmlChar * cur; /* a pointer to an array of xmlChar */
14388    int n_cur;
14389
14390    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14391        mem_base = xmlMemBlocks();
14392        cur = gen_xmlChar_ptr(n_cur, 0);
14393
14394        ret_val = xmlRecoverDoc(cur);
14395        desret_xmlDocPtr(ret_val);
14396        call_tests++;
14397        des_xmlChar_ptr(n_cur, cur, 0);
14398        xmlResetLastError();
14399        if (mem_base != xmlMemBlocks()) {
14400            printf("Leak of %d blocks found in xmlRecoverDoc",
14401	           xmlMemBlocks() - mem_base);
14402	    test_ret++;
14403            printf(" %d", n_cur);
14404            printf("\n");
14405        }
14406    }
14407    function_tests++;
14408#endif
14409#endif
14410
14411    return(test_ret);
14412}
14413
14414
14415static int
14416test_xmlRecoverFile(void) {
14417    int test_ret = 0;
14418
14419#if defined(LIBXML_SAX1_ENABLED)
14420#ifdef LIBXML_SAX1_ENABLED
14421    int mem_base;
14422    xmlDocPtr ret_val;
14423    const char * filename; /* the filename */
14424    int n_filename;
14425
14426    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14427        mem_base = xmlMemBlocks();
14428        filename = gen_filepath(n_filename, 0);
14429
14430        ret_val = xmlRecoverFile(filename);
14431        desret_xmlDocPtr(ret_val);
14432        call_tests++;
14433        des_filepath(n_filename, filename, 0);
14434        xmlResetLastError();
14435        if (mem_base != xmlMemBlocks()) {
14436            printf("Leak of %d blocks found in xmlRecoverFile",
14437	           xmlMemBlocks() - mem_base);
14438	    test_ret++;
14439            printf(" %d", n_filename);
14440            printf("\n");
14441        }
14442    }
14443    function_tests++;
14444#endif
14445#endif
14446
14447    return(test_ret);
14448}
14449
14450
14451static int
14452test_xmlRecoverMemory(void) {
14453    int test_ret = 0;
14454
14455#if defined(LIBXML_SAX1_ENABLED)
14456#ifdef LIBXML_SAX1_ENABLED
14457    int mem_base;
14458    xmlDocPtr ret_val;
14459    char * buffer; /* an pointer to a char array */
14460    int n_buffer;
14461    int size; /* the size of the array */
14462    int n_size;
14463
14464    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14465    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14466        mem_base = xmlMemBlocks();
14467        buffer = gen_const_char_ptr(n_buffer, 0);
14468        size = gen_int(n_size, 1);
14469
14470        ret_val = xmlRecoverMemory((const char *)buffer, size);
14471        desret_xmlDocPtr(ret_val);
14472        call_tests++;
14473        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14474        des_int(n_size, size, 1);
14475        xmlResetLastError();
14476        if (mem_base != xmlMemBlocks()) {
14477            printf("Leak of %d blocks found in xmlRecoverMemory",
14478	           xmlMemBlocks() - mem_base);
14479	    test_ret++;
14480            printf(" %d", n_buffer);
14481            printf(" %d", n_size);
14482            printf("\n");
14483        }
14484    }
14485    }
14486    function_tests++;
14487#endif
14488#endif
14489
14490    return(test_ret);
14491}
14492
14493
14494static int
14495test_xmlSAXParseDTD(void) {
14496    int test_ret = 0;
14497
14498#if defined(LIBXML_VALID_ENABLED)
14499#ifdef LIBXML_SAX1_ENABLED
14500    int mem_base;
14501    xmlDtdPtr ret_val;
14502    xmlSAXHandlerPtr sax; /* the SAX handler block */
14503    int n_sax;
14504    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14505    int n_ExternalID;
14506    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14507    int n_SystemID;
14508
14509    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14510    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14511    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14512        mem_base = xmlMemBlocks();
14513        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14514        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14515        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14516
14517        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14518        desret_xmlDtdPtr(ret_val);
14519        call_tests++;
14520        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14521        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14522        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14523        xmlResetLastError();
14524        if (mem_base != xmlMemBlocks()) {
14525            printf("Leak of %d blocks found in xmlSAXParseDTD",
14526	           xmlMemBlocks() - mem_base);
14527	    test_ret++;
14528            printf(" %d", n_sax);
14529            printf(" %d", n_ExternalID);
14530            printf(" %d", n_SystemID);
14531            printf("\n");
14532        }
14533    }
14534    }
14535    }
14536    function_tests++;
14537#endif
14538#endif
14539
14540    return(test_ret);
14541}
14542
14543
14544static int
14545test_xmlSAXParseDoc(void) {
14546    int test_ret = 0;
14547
14548#if defined(LIBXML_SAX1_ENABLED)
14549#ifdef LIBXML_SAX1_ENABLED
14550    int mem_base;
14551    xmlDocPtr ret_val;
14552    xmlSAXHandlerPtr sax; /* the SAX handler block */
14553    int n_sax;
14554    xmlChar * cur; /* a pointer to an array of xmlChar */
14555    int n_cur;
14556    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14557    int n_recovery;
14558
14559    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14560    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14561    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14562        mem_base = xmlMemBlocks();
14563        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14564        cur = gen_const_xmlChar_ptr(n_cur, 1);
14565        recovery = gen_int(n_recovery, 2);
14566
14567        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14568        desret_xmlDocPtr(ret_val);
14569        call_tests++;
14570        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14571        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14572        des_int(n_recovery, recovery, 2);
14573        xmlResetLastError();
14574        if (mem_base != xmlMemBlocks()) {
14575            printf("Leak of %d blocks found in xmlSAXParseDoc",
14576	           xmlMemBlocks() - mem_base);
14577	    test_ret++;
14578            printf(" %d", n_sax);
14579            printf(" %d", n_cur);
14580            printf(" %d", n_recovery);
14581            printf("\n");
14582        }
14583    }
14584    }
14585    }
14586    function_tests++;
14587#endif
14588#endif
14589
14590    return(test_ret);
14591}
14592
14593
14594static int
14595test_xmlSAXParseEntity(void) {
14596    int test_ret = 0;
14597
14598#if defined(LIBXML_SAX1_ENABLED)
14599#ifdef LIBXML_SAX1_ENABLED
14600    int mem_base;
14601    xmlDocPtr ret_val;
14602    xmlSAXHandlerPtr sax; /* the SAX handler block */
14603    int n_sax;
14604    const char * filename; /* the filename */
14605    int n_filename;
14606
14607    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14608    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14609        mem_base = xmlMemBlocks();
14610        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14611        filename = gen_filepath(n_filename, 1);
14612
14613        ret_val = xmlSAXParseEntity(sax, filename);
14614        desret_xmlDocPtr(ret_val);
14615        call_tests++;
14616        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14617        des_filepath(n_filename, filename, 1);
14618        xmlResetLastError();
14619        if (mem_base != xmlMemBlocks()) {
14620            printf("Leak of %d blocks found in xmlSAXParseEntity",
14621	           xmlMemBlocks() - mem_base);
14622	    test_ret++;
14623            printf(" %d", n_sax);
14624            printf(" %d", n_filename);
14625            printf("\n");
14626        }
14627    }
14628    }
14629    function_tests++;
14630#endif
14631#endif
14632
14633    return(test_ret);
14634}
14635
14636
14637static int
14638test_xmlSAXParseFile(void) {
14639    int test_ret = 0;
14640
14641#if defined(LIBXML_SAX1_ENABLED)
14642#ifdef LIBXML_SAX1_ENABLED
14643    int mem_base;
14644    xmlDocPtr ret_val;
14645    xmlSAXHandlerPtr sax; /* the SAX handler block */
14646    int n_sax;
14647    const char * filename; /* the filename */
14648    int n_filename;
14649    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14650    int n_recovery;
14651
14652    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14653    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14654    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14655        mem_base = xmlMemBlocks();
14656        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14657        filename = gen_filepath(n_filename, 1);
14658        recovery = gen_int(n_recovery, 2);
14659
14660        ret_val = xmlSAXParseFile(sax, filename, recovery);
14661        desret_xmlDocPtr(ret_val);
14662        call_tests++;
14663        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14664        des_filepath(n_filename, filename, 1);
14665        des_int(n_recovery, recovery, 2);
14666        xmlResetLastError();
14667        if (mem_base != xmlMemBlocks()) {
14668            printf("Leak of %d blocks found in xmlSAXParseFile",
14669	           xmlMemBlocks() - mem_base);
14670	    test_ret++;
14671            printf(" %d", n_sax);
14672            printf(" %d", n_filename);
14673            printf(" %d", n_recovery);
14674            printf("\n");
14675        }
14676    }
14677    }
14678    }
14679    function_tests++;
14680#endif
14681#endif
14682
14683    return(test_ret);
14684}
14685
14686
14687static int
14688test_xmlSAXParseFileWithData(void) {
14689    int test_ret = 0;
14690
14691#if defined(LIBXML_SAX1_ENABLED)
14692#ifdef LIBXML_SAX1_ENABLED
14693    int mem_base;
14694    xmlDocPtr ret_val;
14695    xmlSAXHandlerPtr sax; /* the SAX handler block */
14696    int n_sax;
14697    const char * filename; /* the filename */
14698    int n_filename;
14699    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14700    int n_recovery;
14701    void * data; /* the userdata */
14702    int n_data;
14703
14704    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14705    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14706    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14707    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14708        mem_base = xmlMemBlocks();
14709        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14710        filename = gen_filepath(n_filename, 1);
14711        recovery = gen_int(n_recovery, 2);
14712        data = gen_userdata(n_data, 3);
14713
14714        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14715        desret_xmlDocPtr(ret_val);
14716        call_tests++;
14717        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14718        des_filepath(n_filename, filename, 1);
14719        des_int(n_recovery, recovery, 2);
14720        des_userdata(n_data, data, 3);
14721        xmlResetLastError();
14722        if (mem_base != xmlMemBlocks()) {
14723            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14724	           xmlMemBlocks() - mem_base);
14725	    test_ret++;
14726            printf(" %d", n_sax);
14727            printf(" %d", n_filename);
14728            printf(" %d", n_recovery);
14729            printf(" %d", n_data);
14730            printf("\n");
14731        }
14732    }
14733    }
14734    }
14735    }
14736    function_tests++;
14737#endif
14738#endif
14739
14740    return(test_ret);
14741}
14742
14743
14744static int
14745test_xmlSAXParseMemory(void) {
14746    int test_ret = 0;
14747
14748#if defined(LIBXML_SAX1_ENABLED)
14749#ifdef LIBXML_SAX1_ENABLED
14750    int mem_base;
14751    xmlDocPtr ret_val;
14752    xmlSAXHandlerPtr sax; /* the SAX handler block */
14753    int n_sax;
14754    char * buffer; /* an pointer to a char array */
14755    int n_buffer;
14756    int size; /* the size of the array */
14757    int n_size;
14758    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14759    int n_recovery;
14760
14761    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14762    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14763    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14764    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14765        mem_base = xmlMemBlocks();
14766        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14767        buffer = gen_const_char_ptr(n_buffer, 1);
14768        size = gen_int(n_size, 2);
14769        recovery = gen_int(n_recovery, 3);
14770
14771        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14772        desret_xmlDocPtr(ret_val);
14773        call_tests++;
14774        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14775        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14776        des_int(n_size, size, 2);
14777        des_int(n_recovery, recovery, 3);
14778        xmlResetLastError();
14779        if (mem_base != xmlMemBlocks()) {
14780            printf("Leak of %d blocks found in xmlSAXParseMemory",
14781	           xmlMemBlocks() - mem_base);
14782	    test_ret++;
14783            printf(" %d", n_sax);
14784            printf(" %d", n_buffer);
14785            printf(" %d", n_size);
14786            printf(" %d", n_recovery);
14787            printf("\n");
14788        }
14789    }
14790    }
14791    }
14792    }
14793    function_tests++;
14794#endif
14795#endif
14796
14797    return(test_ret);
14798}
14799
14800
14801static int
14802test_xmlSAXParseMemoryWithData(void) {
14803    int test_ret = 0;
14804
14805#if defined(LIBXML_SAX1_ENABLED)
14806#ifdef LIBXML_SAX1_ENABLED
14807    int mem_base;
14808    xmlDocPtr ret_val;
14809    xmlSAXHandlerPtr sax; /* the SAX handler block */
14810    int n_sax;
14811    char * buffer; /* an pointer to a char array */
14812    int n_buffer;
14813    int size; /* the size of the array */
14814    int n_size;
14815    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14816    int n_recovery;
14817    void * data; /* the userdata */
14818    int n_data;
14819
14820    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14821    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14822    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14823    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14824    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14825        mem_base = xmlMemBlocks();
14826        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14827        buffer = gen_const_char_ptr(n_buffer, 1);
14828        size = gen_int(n_size, 2);
14829        recovery = gen_int(n_recovery, 3);
14830        data = gen_userdata(n_data, 4);
14831
14832        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
14833        desret_xmlDocPtr(ret_val);
14834        call_tests++;
14835        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14836        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14837        des_int(n_size, size, 2);
14838        des_int(n_recovery, recovery, 3);
14839        des_userdata(n_data, data, 4);
14840        xmlResetLastError();
14841        if (mem_base != xmlMemBlocks()) {
14842            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14843	           xmlMemBlocks() - mem_base);
14844	    test_ret++;
14845            printf(" %d", n_sax);
14846            printf(" %d", n_buffer);
14847            printf(" %d", n_size);
14848            printf(" %d", n_recovery);
14849            printf(" %d", n_data);
14850            printf("\n");
14851        }
14852    }
14853    }
14854    }
14855    }
14856    }
14857    function_tests++;
14858#endif
14859#endif
14860
14861    return(test_ret);
14862}
14863
14864
14865static int
14866test_xmlSAXUserParseFile(void) {
14867    int test_ret = 0;
14868
14869#if defined(LIBXML_SAX1_ENABLED)
14870#ifdef LIBXML_SAX1_ENABLED
14871    int mem_base;
14872    int ret_val;
14873    xmlSAXHandlerPtr sax; /* a SAX handler */
14874    int n_sax;
14875    void * user_data; /* The user data returned on SAX callbacks */
14876    int n_user_data;
14877    const char * filename; /* a file name */
14878    int n_filename;
14879
14880    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14881    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14882    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14883        mem_base = xmlMemBlocks();
14884        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14885        user_data = gen_userdata(n_user_data, 1);
14886        filename = gen_filepath(n_filename, 2);
14887
14888#ifdef LIBXML_SAX1_ENABLED
14889        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14890#endif
14891
14892
14893        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
14894        desret_int(ret_val);
14895        call_tests++;
14896        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14897        des_userdata(n_user_data, user_data, 1);
14898        des_filepath(n_filename, filename, 2);
14899        xmlResetLastError();
14900        if (mem_base != xmlMemBlocks()) {
14901            printf("Leak of %d blocks found in xmlSAXUserParseFile",
14902	           xmlMemBlocks() - mem_base);
14903	    test_ret++;
14904            printf(" %d", n_sax);
14905            printf(" %d", n_user_data);
14906            printf(" %d", n_filename);
14907            printf("\n");
14908        }
14909    }
14910    }
14911    }
14912    function_tests++;
14913#endif
14914#endif
14915
14916    return(test_ret);
14917}
14918
14919
14920static int
14921test_xmlSAXUserParseMemory(void) {
14922    int test_ret = 0;
14923
14924#if defined(LIBXML_SAX1_ENABLED)
14925#ifdef LIBXML_SAX1_ENABLED
14926    int mem_base;
14927    int ret_val;
14928    xmlSAXHandlerPtr sax; /* a SAX handler */
14929    int n_sax;
14930    void * user_data; /* The user data returned on SAX callbacks */
14931    int n_user_data;
14932    char * buffer; /* an in-memory XML document input */
14933    int n_buffer;
14934    int size; /* the length of the XML document in bytes */
14935    int n_size;
14936
14937    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14938    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14939    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14940    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14941        mem_base = xmlMemBlocks();
14942        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14943        user_data = gen_userdata(n_user_data, 1);
14944        buffer = gen_const_char_ptr(n_buffer, 2);
14945        size = gen_int(n_size, 3);
14946
14947#ifdef LIBXML_SAX1_ENABLED
14948        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14949#endif
14950
14951
14952        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
14953        desret_int(ret_val);
14954        call_tests++;
14955        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14956        des_userdata(n_user_data, user_data, 1);
14957        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
14958        des_int(n_size, size, 3);
14959        xmlResetLastError();
14960        if (mem_base != xmlMemBlocks()) {
14961            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
14962	           xmlMemBlocks() - mem_base);
14963	    test_ret++;
14964            printf(" %d", n_sax);
14965            printf(" %d", n_user_data);
14966            printf(" %d", n_buffer);
14967            printf(" %d", n_size);
14968            printf("\n");
14969        }
14970    }
14971    }
14972    }
14973    }
14974    function_tests++;
14975#endif
14976#endif
14977
14978    return(test_ret);
14979}
14980
14981
14982static int
14983test_xmlSetExternalEntityLoader(void) {
14984    int test_ret = 0;
14985
14986
14987    /* missing type support */
14988    return(test_ret);
14989}
14990
14991
14992static int
14993test_xmlSetFeature(void) {
14994    int test_ret = 0;
14995
14996#if defined(LIBXML_LEGACY_ENABLED)
14997#ifdef LIBXML_LEGACY_ENABLED
14998    int mem_base;
14999    int ret_val;
15000    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15001    int n_ctxt;
15002    char * name; /* the feature name */
15003    int n_name;
15004    void * value; /* pointer to the location of the new value */
15005    int n_value;
15006
15007    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15008    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15009    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15010        mem_base = xmlMemBlocks();
15011        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15012        name = gen_const_char_ptr(n_name, 1);
15013        value = gen_void_ptr(n_value, 2);
15014
15015        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15016        desret_int(ret_val);
15017        call_tests++;
15018        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15019        des_const_char_ptr(n_name, (const char *)name, 1);
15020        des_void_ptr(n_value, value, 2);
15021        xmlResetLastError();
15022        if (mem_base != xmlMemBlocks()) {
15023            printf("Leak of %d blocks found in xmlSetFeature",
15024	           xmlMemBlocks() - mem_base);
15025	    test_ret++;
15026            printf(" %d", n_ctxt);
15027            printf(" %d", n_name);
15028            printf(" %d", n_value);
15029            printf("\n");
15030        }
15031    }
15032    }
15033    }
15034    function_tests++;
15035#endif
15036#endif
15037
15038    return(test_ret);
15039}
15040
15041
15042static int
15043test_xmlSetupParserForBuffer(void) {
15044    int test_ret = 0;
15045
15046#if defined(LIBXML_SAX1_ENABLED)
15047#ifdef LIBXML_SAX1_ENABLED
15048    int mem_base;
15049    xmlParserCtxtPtr ctxt; /* an XML parser context */
15050    int n_ctxt;
15051    xmlChar * buffer; /* a xmlChar * buffer */
15052    int n_buffer;
15053    const char * filename; /* a file name */
15054    int n_filename;
15055
15056    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15057    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15058    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15059        mem_base = xmlMemBlocks();
15060        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15061        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15062        filename = gen_filepath(n_filename, 2);
15063
15064        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15065        call_tests++;
15066        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15067        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15068        des_filepath(n_filename, filename, 2);
15069        xmlResetLastError();
15070        if (mem_base != xmlMemBlocks()) {
15071            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15072	           xmlMemBlocks() - mem_base);
15073	    test_ret++;
15074            printf(" %d", n_ctxt);
15075            printf(" %d", n_buffer);
15076            printf(" %d", n_filename);
15077            printf("\n");
15078        }
15079    }
15080    }
15081    }
15082    function_tests++;
15083#endif
15084#endif
15085
15086    return(test_ret);
15087}
15088
15089
15090static int
15091test_xmlStopParser(void) {
15092    int test_ret = 0;
15093
15094#if defined(LIBXML_PUSH_ENABLED)
15095#ifdef LIBXML_PUSH_ENABLED
15096    int mem_base;
15097    xmlParserCtxtPtr ctxt; /* an XML parser context */
15098    int n_ctxt;
15099
15100    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15101        mem_base = xmlMemBlocks();
15102        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15103
15104        xmlStopParser(ctxt);
15105        call_tests++;
15106        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15107        xmlResetLastError();
15108        if (mem_base != xmlMemBlocks()) {
15109            printf("Leak of %d blocks found in xmlStopParser",
15110	           xmlMemBlocks() - mem_base);
15111	    test_ret++;
15112            printf(" %d", n_ctxt);
15113            printf("\n");
15114        }
15115    }
15116    function_tests++;
15117#endif
15118#endif
15119
15120    return(test_ret);
15121}
15122
15123
15124static int
15125test_xmlSubstituteEntitiesDefault(void) {
15126    int test_ret = 0;
15127
15128    int mem_base;
15129    int ret_val;
15130    int val; /* int 0 or 1 */
15131    int n_val;
15132
15133    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15134        mem_base = xmlMemBlocks();
15135        val = gen_int(n_val, 0);
15136
15137        ret_val = xmlSubstituteEntitiesDefault(val);
15138        desret_int(ret_val);
15139        call_tests++;
15140        des_int(n_val, val, 0);
15141        xmlResetLastError();
15142        if (mem_base != xmlMemBlocks()) {
15143            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15144	           xmlMemBlocks() - mem_base);
15145	    test_ret++;
15146            printf(" %d", n_val);
15147            printf("\n");
15148        }
15149    }
15150    function_tests++;
15151
15152    return(test_ret);
15153}
15154
15155static int
15156test_parser(void) {
15157    int test_ret = 0;
15158
15159    if (quiet == 0) printf("Testing parser : 60 of 69 functions ...\n");
15160    test_ret += test_xmlByteConsumed();
15161    test_ret += test_xmlClearNodeInfoSeq();
15162    test_ret += test_xmlClearParserCtxt();
15163    test_ret += test_xmlCreateDocParserCtxt();
15164    test_ret += test_xmlCreatePushParserCtxt();
15165    test_ret += test_xmlCtxtReadDoc();
15166    test_ret += test_xmlCtxtReadFile();
15167    test_ret += test_xmlCtxtReadMemory();
15168    test_ret += test_xmlCtxtReset();
15169    test_ret += test_xmlCtxtResetPush();
15170    test_ret += test_xmlCtxtUseOptions();
15171    test_ret += test_xmlGetExternalEntityLoader();
15172    test_ret += test_xmlGetFeature();
15173    test_ret += test_xmlGetFeaturesList();
15174    test_ret += test_xmlIOParseDTD();
15175    test_ret += test_xmlInitNodeInfoSeq();
15176    test_ret += test_xmlInitParser();
15177    test_ret += test_xmlInitParserCtxt();
15178    test_ret += test_xmlKeepBlanksDefault();
15179    test_ret += test_xmlLineNumbersDefault();
15180    test_ret += test_xmlLoadExternalEntity();
15181    test_ret += test_xmlNewIOInputStream();
15182    test_ret += test_xmlNewParserCtxt();
15183    test_ret += test_xmlParseBalancedChunkMemory();
15184    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15185    test_ret += test_xmlParseChunk();
15186    test_ret += test_xmlParseCtxtExternalEntity();
15187    test_ret += test_xmlParseDTD();
15188    test_ret += test_xmlParseDoc();
15189    test_ret += test_xmlParseDocument();
15190    test_ret += test_xmlParseEntity();
15191    test_ret += test_xmlParseExtParsedEnt();
15192    test_ret += test_xmlParseExternalEntity();
15193    test_ret += test_xmlParseFile();
15194    test_ret += test_xmlParseInNodeContext();
15195    test_ret += test_xmlParseMemory();
15196    test_ret += test_xmlParserAddNodeInfo();
15197    test_ret += test_xmlParserFindNodeInfo();
15198    test_ret += test_xmlParserFindNodeInfoIndex();
15199    test_ret += test_xmlParserInputGrow();
15200    test_ret += test_xmlParserInputRead();
15201    test_ret += test_xmlPedanticParserDefault();
15202    test_ret += test_xmlReadDoc();
15203    test_ret += test_xmlReadFile();
15204    test_ret += test_xmlReadMemory();
15205    test_ret += test_xmlRecoverDoc();
15206    test_ret += test_xmlRecoverFile();
15207    test_ret += test_xmlRecoverMemory();
15208    test_ret += test_xmlSAXParseDTD();
15209    test_ret += test_xmlSAXParseDoc();
15210    test_ret += test_xmlSAXParseEntity();
15211    test_ret += test_xmlSAXParseFile();
15212    test_ret += test_xmlSAXParseFileWithData();
15213    test_ret += test_xmlSAXParseMemory();
15214    test_ret += test_xmlSAXParseMemoryWithData();
15215    test_ret += test_xmlSAXUserParseFile();
15216    test_ret += test_xmlSAXUserParseMemory();
15217    test_ret += test_xmlSetExternalEntityLoader();
15218    test_ret += test_xmlSetFeature();
15219    test_ret += test_xmlSetupParserForBuffer();
15220    test_ret += test_xmlStopParser();
15221    test_ret += test_xmlSubstituteEntitiesDefault();
15222
15223    if (test_ret != 0)
15224	printf("Module parser: %d errors\n", test_ret);
15225    return(test_ret);
15226}
15227
15228static int
15229test_htmlCreateFileParserCtxt(void) {
15230    int test_ret = 0;
15231
15232#if defined(LIBXML_HTML_ENABLED)
15233    int mem_base;
15234    htmlParserCtxtPtr ret_val;
15235    const char * filename; /* the filename */
15236    int n_filename;
15237    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15238    int n_encoding;
15239
15240    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15241    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15242        mem_base = xmlMemBlocks();
15243        filename = gen_fileoutput(n_filename, 0);
15244        encoding = gen_const_char_ptr(n_encoding, 1);
15245
15246        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15247        desret_htmlParserCtxtPtr(ret_val);
15248        call_tests++;
15249        des_fileoutput(n_filename, filename, 0);
15250        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15251        xmlResetLastError();
15252        if (mem_base != xmlMemBlocks()) {
15253            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15254	           xmlMemBlocks() - mem_base);
15255	    test_ret++;
15256            printf(" %d", n_filename);
15257            printf(" %d", n_encoding);
15258            printf("\n");
15259        }
15260    }
15261    }
15262    function_tests++;
15263#endif
15264
15265    return(test_ret);
15266}
15267
15268
15269static int
15270test_htmlInitAutoClose(void) {
15271    int test_ret = 0;
15272
15273#if defined(LIBXML_HTML_ENABLED)
15274    int mem_base;
15275
15276        mem_base = xmlMemBlocks();
15277
15278        htmlInitAutoClose();
15279        call_tests++;
15280        xmlResetLastError();
15281        if (mem_base != xmlMemBlocks()) {
15282            printf("Leak of %d blocks found in htmlInitAutoClose",
15283	           xmlMemBlocks() - mem_base);
15284	    test_ret++;
15285            printf("\n");
15286        }
15287    function_tests++;
15288#endif
15289
15290    return(test_ret);
15291}
15292
15293
15294static int
15295test_inputPop(void) {
15296    int test_ret = 0;
15297
15298    int mem_base;
15299    xmlParserInputPtr ret_val;
15300    xmlParserCtxtPtr ctxt; /* an XML parser context */
15301    int n_ctxt;
15302
15303    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15304        mem_base = xmlMemBlocks();
15305        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15306
15307        ret_val = inputPop(ctxt);
15308        desret_xmlParserInputPtr(ret_val);
15309        call_tests++;
15310        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15311        xmlResetLastError();
15312        if (mem_base != xmlMemBlocks()) {
15313            printf("Leak of %d blocks found in inputPop",
15314	           xmlMemBlocks() - mem_base);
15315	    test_ret++;
15316            printf(" %d", n_ctxt);
15317            printf("\n");
15318        }
15319    }
15320    function_tests++;
15321
15322    return(test_ret);
15323}
15324
15325
15326static int
15327test_inputPush(void) {
15328    int test_ret = 0;
15329
15330    int mem_base;
15331    int ret_val;
15332    xmlParserCtxtPtr ctxt; /* an XML parser context */
15333    int n_ctxt;
15334    xmlParserInputPtr value; /* the parser input */
15335    int n_value;
15336
15337    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15338    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15339        mem_base = xmlMemBlocks();
15340        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15341        value = gen_xmlParserInputPtr(n_value, 1);
15342
15343        ret_val = inputPush(ctxt, value);
15344        desret_int(ret_val);
15345        call_tests++;
15346        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15347        des_xmlParserInputPtr(n_value, value, 1);
15348        xmlResetLastError();
15349        if (mem_base != xmlMemBlocks()) {
15350            printf("Leak of %d blocks found in inputPush",
15351	           xmlMemBlocks() - mem_base);
15352	    test_ret++;
15353            printf(" %d", n_ctxt);
15354            printf(" %d", n_value);
15355            printf("\n");
15356        }
15357    }
15358    }
15359    function_tests++;
15360
15361    return(test_ret);
15362}
15363
15364
15365static int
15366test_namePop(void) {
15367    int test_ret = 0;
15368
15369    int mem_base;
15370    const xmlChar * ret_val;
15371    xmlParserCtxtPtr ctxt; /* an XML parser context */
15372    int n_ctxt;
15373
15374    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15375        mem_base = xmlMemBlocks();
15376        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15377
15378        ret_val = namePop(ctxt);
15379        desret_const_xmlChar_ptr(ret_val);
15380        call_tests++;
15381        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15382        xmlResetLastError();
15383        if (mem_base != xmlMemBlocks()) {
15384            printf("Leak of %d blocks found in namePop",
15385	           xmlMemBlocks() - mem_base);
15386	    test_ret++;
15387            printf(" %d", n_ctxt);
15388            printf("\n");
15389        }
15390    }
15391    function_tests++;
15392
15393    return(test_ret);
15394}
15395
15396
15397static int
15398test_namePush(void) {
15399    int test_ret = 0;
15400
15401    int mem_base;
15402    int ret_val;
15403    xmlParserCtxtPtr ctxt; /* an XML parser context */
15404    int n_ctxt;
15405    xmlChar * value; /* the element name */
15406    int n_value;
15407
15408    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15409    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15410        mem_base = xmlMemBlocks();
15411        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15412        value = gen_const_xmlChar_ptr(n_value, 1);
15413
15414        ret_val = namePush(ctxt, (const xmlChar *)value);
15415        desret_int(ret_val);
15416        call_tests++;
15417        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15418        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15419        xmlResetLastError();
15420        if (mem_base != xmlMemBlocks()) {
15421            printf("Leak of %d blocks found in namePush",
15422	           xmlMemBlocks() - mem_base);
15423	    test_ret++;
15424            printf(" %d", n_ctxt);
15425            printf(" %d", n_value);
15426            printf("\n");
15427        }
15428    }
15429    }
15430    function_tests++;
15431
15432    return(test_ret);
15433}
15434
15435
15436static int
15437test_nodePop(void) {
15438    int test_ret = 0;
15439
15440    int mem_base;
15441    xmlNodePtr ret_val;
15442    xmlParserCtxtPtr ctxt; /* an XML parser context */
15443    int n_ctxt;
15444
15445    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15446        mem_base = xmlMemBlocks();
15447        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15448
15449        ret_val = nodePop(ctxt);
15450        desret_xmlNodePtr(ret_val);
15451        call_tests++;
15452        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15453        xmlResetLastError();
15454        if (mem_base != xmlMemBlocks()) {
15455            printf("Leak of %d blocks found in nodePop",
15456	           xmlMemBlocks() - mem_base);
15457	    test_ret++;
15458            printf(" %d", n_ctxt);
15459            printf("\n");
15460        }
15461    }
15462    function_tests++;
15463
15464    return(test_ret);
15465}
15466
15467
15468static int
15469test_nodePush(void) {
15470    int test_ret = 0;
15471
15472    int mem_base;
15473    int ret_val;
15474    xmlParserCtxtPtr ctxt; /* an XML parser context */
15475    int n_ctxt;
15476    xmlNodePtr value; /* the element node */
15477    int n_value;
15478
15479    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15480    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15481        mem_base = xmlMemBlocks();
15482        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15483        value = gen_xmlNodePtr(n_value, 1);
15484
15485        ret_val = nodePush(ctxt, value);
15486        desret_int(ret_val);
15487        call_tests++;
15488        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15489        des_xmlNodePtr(n_value, value, 1);
15490        xmlResetLastError();
15491        if (mem_base != xmlMemBlocks()) {
15492            printf("Leak of %d blocks found in nodePush",
15493	           xmlMemBlocks() - mem_base);
15494	    test_ret++;
15495            printf(" %d", n_ctxt);
15496            printf(" %d", n_value);
15497            printf("\n");
15498        }
15499    }
15500    }
15501    function_tests++;
15502
15503    return(test_ret);
15504}
15505
15506
15507static int
15508test_xmlCheckLanguageID(void) {
15509    int test_ret = 0;
15510
15511    int mem_base;
15512    int ret_val;
15513    xmlChar * lang; /* pointer to the string value */
15514    int n_lang;
15515
15516    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15517        mem_base = xmlMemBlocks();
15518        lang = gen_const_xmlChar_ptr(n_lang, 0);
15519
15520        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15521        desret_int(ret_val);
15522        call_tests++;
15523        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15524        xmlResetLastError();
15525        if (mem_base != xmlMemBlocks()) {
15526            printf("Leak of %d blocks found in xmlCheckLanguageID",
15527	           xmlMemBlocks() - mem_base);
15528	    test_ret++;
15529            printf(" %d", n_lang);
15530            printf("\n");
15531        }
15532    }
15533    function_tests++;
15534
15535    return(test_ret);
15536}
15537
15538
15539static int
15540test_xmlCopyChar(void) {
15541    int test_ret = 0;
15542
15543    int mem_base;
15544    int ret_val;
15545    int len; /* Ignored, compatibility */
15546    int n_len;
15547    xmlChar * out; /* pointer to an array of xmlChar */
15548    int n_out;
15549    int val; /* the char value */
15550    int n_val;
15551
15552    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15553    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15554    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15555        mem_base = xmlMemBlocks();
15556        len = gen_int(n_len, 0);
15557        out = gen_xmlChar_ptr(n_out, 1);
15558        val = gen_int(n_val, 2);
15559
15560        ret_val = xmlCopyChar(len, out, val);
15561        desret_int(ret_val);
15562        call_tests++;
15563        des_int(n_len, len, 0);
15564        des_xmlChar_ptr(n_out, out, 1);
15565        des_int(n_val, val, 2);
15566        xmlResetLastError();
15567        if (mem_base != xmlMemBlocks()) {
15568            printf("Leak of %d blocks found in xmlCopyChar",
15569	           xmlMemBlocks() - mem_base);
15570	    test_ret++;
15571            printf(" %d", n_len);
15572            printf(" %d", n_out);
15573            printf(" %d", n_val);
15574            printf("\n");
15575        }
15576    }
15577    }
15578    }
15579    function_tests++;
15580
15581    return(test_ret);
15582}
15583
15584
15585static int
15586test_xmlCopyCharMultiByte(void) {
15587    int test_ret = 0;
15588
15589    int mem_base;
15590    int ret_val;
15591    xmlChar * out; /* pointer to an array of xmlChar */
15592    int n_out;
15593    int val; /* the char value */
15594    int n_val;
15595
15596    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15597    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15598        mem_base = xmlMemBlocks();
15599        out = gen_xmlChar_ptr(n_out, 0);
15600        val = gen_int(n_val, 1);
15601
15602        ret_val = xmlCopyCharMultiByte(out, val);
15603        desret_int(ret_val);
15604        call_tests++;
15605        des_xmlChar_ptr(n_out, out, 0);
15606        des_int(n_val, val, 1);
15607        xmlResetLastError();
15608        if (mem_base != xmlMemBlocks()) {
15609            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15610	           xmlMemBlocks() - mem_base);
15611	    test_ret++;
15612            printf(" %d", n_out);
15613            printf(" %d", n_val);
15614            printf("\n");
15615        }
15616    }
15617    }
15618    function_tests++;
15619
15620    return(test_ret);
15621}
15622
15623
15624static int
15625test_xmlCreateEntityParserCtxt(void) {
15626    int test_ret = 0;
15627
15628    int mem_base;
15629    xmlParserCtxtPtr ret_val;
15630    xmlChar * URL; /* the entity URL */
15631    int n_URL;
15632    xmlChar * ID; /* the entity PUBLIC ID */
15633    int n_ID;
15634    xmlChar * base; /* a possible base for the target URI */
15635    int n_base;
15636
15637    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15638    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15639    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15640        mem_base = xmlMemBlocks();
15641        URL = gen_const_xmlChar_ptr(n_URL, 0);
15642        ID = gen_const_xmlChar_ptr(n_ID, 1);
15643        base = gen_const_xmlChar_ptr(n_base, 2);
15644
15645        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15646        desret_xmlParserCtxtPtr(ret_val);
15647        call_tests++;
15648        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15649        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15650        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15651        xmlResetLastError();
15652        if (mem_base != xmlMemBlocks()) {
15653            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15654	           xmlMemBlocks() - mem_base);
15655	    test_ret++;
15656            printf(" %d", n_URL);
15657            printf(" %d", n_ID);
15658            printf(" %d", n_base);
15659            printf("\n");
15660        }
15661    }
15662    }
15663    }
15664    function_tests++;
15665
15666    return(test_ret);
15667}
15668
15669
15670static int
15671test_xmlCreateFileParserCtxt(void) {
15672    int test_ret = 0;
15673
15674    int mem_base;
15675    xmlParserCtxtPtr ret_val;
15676    const char * filename; /* the filename */
15677    int n_filename;
15678
15679    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15680        mem_base = xmlMemBlocks();
15681        filename = gen_fileoutput(n_filename, 0);
15682
15683        ret_val = xmlCreateFileParserCtxt(filename);
15684        desret_xmlParserCtxtPtr(ret_val);
15685        call_tests++;
15686        des_fileoutput(n_filename, filename, 0);
15687        xmlResetLastError();
15688        if (mem_base != xmlMemBlocks()) {
15689            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15690	           xmlMemBlocks() - mem_base);
15691	    test_ret++;
15692            printf(" %d", n_filename);
15693            printf("\n");
15694        }
15695    }
15696    function_tests++;
15697
15698    return(test_ret);
15699}
15700
15701
15702static int
15703test_xmlCreateMemoryParserCtxt(void) {
15704    int test_ret = 0;
15705
15706    int mem_base;
15707    xmlParserCtxtPtr ret_val;
15708    char * buffer; /* a pointer to a char array */
15709    int n_buffer;
15710    int size; /* the size of the array */
15711    int n_size;
15712
15713    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15714    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15715        mem_base = xmlMemBlocks();
15716        buffer = gen_const_char_ptr(n_buffer, 0);
15717        size = gen_int(n_size, 1);
15718
15719        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15720        desret_xmlParserCtxtPtr(ret_val);
15721        call_tests++;
15722        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15723        des_int(n_size, size, 1);
15724        xmlResetLastError();
15725        if (mem_base != xmlMemBlocks()) {
15726            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15727	           xmlMemBlocks() - mem_base);
15728	    test_ret++;
15729            printf(" %d", n_buffer);
15730            printf(" %d", n_size);
15731            printf("\n");
15732        }
15733    }
15734    }
15735    function_tests++;
15736
15737    return(test_ret);
15738}
15739
15740
15741static int
15742test_xmlCreateURLParserCtxt(void) {
15743    int test_ret = 0;
15744
15745    int mem_base;
15746    xmlParserCtxtPtr ret_val;
15747    const char * filename; /* the filename or URL */
15748    int n_filename;
15749    int options; /* a combination of xmlParserOption */
15750    int n_options;
15751
15752    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15753    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15754        mem_base = xmlMemBlocks();
15755        filename = gen_fileoutput(n_filename, 0);
15756        options = gen_int(n_options, 1);
15757
15758        ret_val = xmlCreateURLParserCtxt(filename, options);
15759        desret_xmlParserCtxtPtr(ret_val);
15760        call_tests++;
15761        des_fileoutput(n_filename, filename, 0);
15762        des_int(n_options, options, 1);
15763        xmlResetLastError();
15764        if (mem_base != xmlMemBlocks()) {
15765            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15766	           xmlMemBlocks() - mem_base);
15767	    test_ret++;
15768            printf(" %d", n_filename);
15769            printf(" %d", n_options);
15770            printf("\n");
15771        }
15772    }
15773    }
15774    function_tests++;
15775
15776    return(test_ret);
15777}
15778
15779
15780static int
15781test_xmlCurrentChar(void) {
15782    int test_ret = 0;
15783
15784    int mem_base;
15785    int ret_val;
15786    xmlParserCtxtPtr ctxt; /* the XML parser context */
15787    int n_ctxt;
15788    int * len; /* pointer to the length of the char read */
15789    int n_len;
15790
15791    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15792    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15793        mem_base = xmlMemBlocks();
15794        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15795        len = gen_int_ptr(n_len, 1);
15796
15797        ret_val = xmlCurrentChar(ctxt, len);
15798        desret_int(ret_val);
15799        call_tests++;
15800        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15801        des_int_ptr(n_len, len, 1);
15802        xmlResetLastError();
15803        if (mem_base != xmlMemBlocks()) {
15804            printf("Leak of %d blocks found in xmlCurrentChar",
15805	           xmlMemBlocks() - mem_base);
15806	    test_ret++;
15807            printf(" %d", n_ctxt);
15808            printf(" %d", n_len);
15809            printf("\n");
15810        }
15811    }
15812    }
15813    function_tests++;
15814
15815    return(test_ret);
15816}
15817
15818
15819static int
15820test_xmlErrMemory(void) {
15821    int test_ret = 0;
15822
15823    int mem_base;
15824    xmlParserCtxtPtr ctxt; /* an XML parser context */
15825    int n_ctxt;
15826    char * extra; /* extra informations */
15827    int n_extra;
15828
15829    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15830    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15831        mem_base = xmlMemBlocks();
15832        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15833        extra = gen_const_char_ptr(n_extra, 1);
15834
15835        xmlErrMemory(ctxt, (const char *)extra);
15836        call_tests++;
15837        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15838        des_const_char_ptr(n_extra, (const char *)extra, 1);
15839        xmlResetLastError();
15840        if (mem_base != xmlMemBlocks()) {
15841            printf("Leak of %d blocks found in xmlErrMemory",
15842	           xmlMemBlocks() - mem_base);
15843	    test_ret++;
15844            printf(" %d", n_ctxt);
15845            printf(" %d", n_extra);
15846            printf("\n");
15847        }
15848    }
15849    }
15850    function_tests++;
15851
15852    return(test_ret);
15853}
15854
15855
15856static int
15857test_xmlIsLetter(void) {
15858    int test_ret = 0;
15859
15860    int mem_base;
15861    int ret_val;
15862    int c; /* an unicode character (int) */
15863    int n_c;
15864
15865    for (n_c = 0;n_c < gen_nb_int;n_c++) {
15866        mem_base = xmlMemBlocks();
15867        c = gen_int(n_c, 0);
15868
15869        ret_val = xmlIsLetter(c);
15870        desret_int(ret_val);
15871        call_tests++;
15872        des_int(n_c, c, 0);
15873        xmlResetLastError();
15874        if (mem_base != xmlMemBlocks()) {
15875            printf("Leak of %d blocks found in xmlIsLetter",
15876	           xmlMemBlocks() - mem_base);
15877	    test_ret++;
15878            printf(" %d", n_c);
15879            printf("\n");
15880        }
15881    }
15882    function_tests++;
15883
15884    return(test_ret);
15885}
15886
15887
15888static int
15889test_xmlNewEntityInputStream(void) {
15890    int test_ret = 0;
15891
15892    int mem_base;
15893    xmlParserInputPtr ret_val;
15894    xmlParserCtxtPtr ctxt; /* an XML parser context */
15895    int n_ctxt;
15896    xmlEntityPtr entity; /* an Entity pointer */
15897    int n_entity;
15898
15899    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15900    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
15901        mem_base = xmlMemBlocks();
15902        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15903        entity = gen_xmlEntityPtr(n_entity, 1);
15904
15905        ret_val = xmlNewEntityInputStream(ctxt, entity);
15906        desret_xmlParserInputPtr(ret_val);
15907        call_tests++;
15908        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15909        des_xmlEntityPtr(n_entity, entity, 1);
15910        xmlResetLastError();
15911        if (mem_base != xmlMemBlocks()) {
15912            printf("Leak of %d blocks found in xmlNewEntityInputStream",
15913	           xmlMemBlocks() - mem_base);
15914	    test_ret++;
15915            printf(" %d", n_ctxt);
15916            printf(" %d", n_entity);
15917            printf("\n");
15918        }
15919    }
15920    }
15921    function_tests++;
15922
15923    return(test_ret);
15924}
15925
15926
15927static int
15928test_xmlNewInputFromFile(void) {
15929    int test_ret = 0;
15930
15931    int mem_base;
15932    xmlParserInputPtr ret_val;
15933    xmlParserCtxtPtr ctxt; /* an XML parser context */
15934    int n_ctxt;
15935    const char * filename; /* the filename to use as entity */
15936    int n_filename;
15937
15938    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15939    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15940        mem_base = xmlMemBlocks();
15941        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15942        filename = gen_filepath(n_filename, 1);
15943
15944        ret_val = xmlNewInputFromFile(ctxt, filename);
15945        desret_xmlParserInputPtr(ret_val);
15946        call_tests++;
15947        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15948        des_filepath(n_filename, filename, 1);
15949        xmlResetLastError();
15950        if (mem_base != xmlMemBlocks()) {
15951            printf("Leak of %d blocks found in xmlNewInputFromFile",
15952	           xmlMemBlocks() - mem_base);
15953	    test_ret++;
15954            printf(" %d", n_ctxt);
15955            printf(" %d", n_filename);
15956            printf("\n");
15957        }
15958    }
15959    }
15960    function_tests++;
15961
15962    return(test_ret);
15963}
15964
15965
15966static int
15967test_xmlNewInputStream(void) {
15968    int test_ret = 0;
15969
15970    int mem_base;
15971    xmlParserInputPtr ret_val;
15972    xmlParserCtxtPtr ctxt; /* an XML parser context */
15973    int n_ctxt;
15974
15975    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15976        mem_base = xmlMemBlocks();
15977        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15978
15979        ret_val = xmlNewInputStream(ctxt);
15980        desret_xmlParserInputPtr(ret_val);
15981        call_tests++;
15982        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15983        xmlResetLastError();
15984        if (mem_base != xmlMemBlocks()) {
15985            printf("Leak of %d blocks found in xmlNewInputStream",
15986	           xmlMemBlocks() - mem_base);
15987	    test_ret++;
15988            printf(" %d", n_ctxt);
15989            printf("\n");
15990        }
15991    }
15992    function_tests++;
15993
15994    return(test_ret);
15995}
15996
15997
15998static int
15999test_xmlNewStringInputStream(void) {
16000    int test_ret = 0;
16001
16002    int mem_base;
16003    xmlParserInputPtr ret_val;
16004    xmlParserCtxtPtr ctxt; /* an XML parser context */
16005    int n_ctxt;
16006    xmlChar * buffer; /* an memory buffer */
16007    int n_buffer;
16008
16009    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16010    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16011        mem_base = xmlMemBlocks();
16012        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16013        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16014
16015        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16016        desret_xmlParserInputPtr(ret_val);
16017        call_tests++;
16018        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16019        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16020        xmlResetLastError();
16021        if (mem_base != xmlMemBlocks()) {
16022            printf("Leak of %d blocks found in xmlNewStringInputStream",
16023	           xmlMemBlocks() - mem_base);
16024	    test_ret++;
16025            printf(" %d", n_ctxt);
16026            printf(" %d", n_buffer);
16027            printf("\n");
16028        }
16029    }
16030    }
16031    function_tests++;
16032
16033    return(test_ret);
16034}
16035
16036
16037static int
16038test_xmlNextChar(void) {
16039    int test_ret = 0;
16040
16041    int mem_base;
16042    xmlParserCtxtPtr ctxt; /* the XML parser context */
16043    int n_ctxt;
16044
16045    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16046        mem_base = xmlMemBlocks();
16047        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16048
16049        xmlNextChar(ctxt);
16050        call_tests++;
16051        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16052        xmlResetLastError();
16053        if (mem_base != xmlMemBlocks()) {
16054            printf("Leak of %d blocks found in xmlNextChar",
16055	           xmlMemBlocks() - mem_base);
16056	    test_ret++;
16057            printf(" %d", n_ctxt);
16058            printf("\n");
16059        }
16060    }
16061    function_tests++;
16062
16063    return(test_ret);
16064}
16065
16066
16067static int
16068test_xmlParserInputShrink(void) {
16069    int test_ret = 0;
16070
16071    int mem_base;
16072    xmlParserInputPtr in; /* an XML parser input */
16073    int n_in;
16074
16075    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16076        mem_base = xmlMemBlocks();
16077        in = gen_xmlParserInputPtr(n_in, 0);
16078
16079        xmlParserInputShrink(in);
16080        call_tests++;
16081        des_xmlParserInputPtr(n_in, in, 0);
16082        xmlResetLastError();
16083        if (mem_base != xmlMemBlocks()) {
16084            printf("Leak of %d blocks found in xmlParserInputShrink",
16085	           xmlMemBlocks() - mem_base);
16086	    test_ret++;
16087            printf(" %d", n_in);
16088            printf("\n");
16089        }
16090    }
16091    function_tests++;
16092
16093    return(test_ret);
16094}
16095
16096
16097static int
16098test_xmlPopInput(void) {
16099    int test_ret = 0;
16100
16101    int mem_base;
16102    xmlChar ret_val;
16103    xmlParserCtxtPtr ctxt; /* an XML parser context */
16104    int n_ctxt;
16105
16106    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16107        mem_base = xmlMemBlocks();
16108        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16109
16110        ret_val = xmlPopInput(ctxt);
16111        desret_xmlChar(ret_val);
16112        call_tests++;
16113        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16114        xmlResetLastError();
16115        if (mem_base != xmlMemBlocks()) {
16116            printf("Leak of %d blocks found in xmlPopInput",
16117	           xmlMemBlocks() - mem_base);
16118	    test_ret++;
16119            printf(" %d", n_ctxt);
16120            printf("\n");
16121        }
16122    }
16123    function_tests++;
16124
16125    return(test_ret);
16126}
16127
16128
16129static int
16130test_xmlPushInput(void) {
16131    int test_ret = 0;
16132
16133    int mem_base;
16134    xmlParserCtxtPtr ctxt; /* an XML parser context */
16135    int n_ctxt;
16136    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16137    int n_input;
16138
16139    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16140    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16141        mem_base = xmlMemBlocks();
16142        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16143        input = gen_xmlParserInputPtr(n_input, 1);
16144
16145        xmlPushInput(ctxt, input);
16146        call_tests++;
16147        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16148        des_xmlParserInputPtr(n_input, input, 1);
16149        xmlResetLastError();
16150        if (mem_base != xmlMemBlocks()) {
16151            printf("Leak of %d blocks found in xmlPushInput",
16152	           xmlMemBlocks() - mem_base);
16153	    test_ret++;
16154            printf(" %d", n_ctxt);
16155            printf(" %d", n_input);
16156            printf("\n");
16157        }
16158    }
16159    }
16160    function_tests++;
16161
16162    return(test_ret);
16163}
16164
16165
16166static int
16167test_xmlSetEntityReferenceFunc(void) {
16168    int test_ret = 0;
16169
16170
16171    /* missing type support */
16172    return(test_ret);
16173}
16174
16175
16176static int
16177test_xmlSplitQName(void) {
16178    int test_ret = 0;
16179
16180    int mem_base;
16181    xmlChar * ret_val;
16182    xmlParserCtxtPtr ctxt; /* an XML parser context */
16183    int n_ctxt;
16184    xmlChar * name; /* an XML parser context */
16185    int n_name;
16186    xmlChar ** prefix; /* a xmlChar ** */
16187    int n_prefix;
16188
16189    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16190    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16191    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16192        mem_base = xmlMemBlocks();
16193        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16194        name = gen_const_xmlChar_ptr(n_name, 1);
16195        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16196
16197        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16198        desret_xmlChar_ptr(ret_val);
16199        call_tests++;
16200        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16201        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16202        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16203        xmlResetLastError();
16204        if (mem_base != xmlMemBlocks()) {
16205            printf("Leak of %d blocks found in xmlSplitQName",
16206	           xmlMemBlocks() - mem_base);
16207	    test_ret++;
16208            printf(" %d", n_ctxt);
16209            printf(" %d", n_name);
16210            printf(" %d", n_prefix);
16211            printf("\n");
16212        }
16213    }
16214    }
16215    }
16216    function_tests++;
16217
16218    return(test_ret);
16219}
16220
16221
16222static int
16223test_xmlStringCurrentChar(void) {
16224    int test_ret = 0;
16225
16226    int mem_base;
16227    int ret_val;
16228    xmlParserCtxtPtr ctxt; /* the XML parser context */
16229    int n_ctxt;
16230    xmlChar * cur; /* pointer to the beginning of the char */
16231    int n_cur;
16232    int * len; /* pointer to the length of the char read */
16233    int n_len;
16234
16235    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16236    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16237    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16238        mem_base = xmlMemBlocks();
16239        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16240        cur = gen_const_xmlChar_ptr(n_cur, 1);
16241        len = gen_int_ptr(n_len, 2);
16242
16243        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16244        desret_int(ret_val);
16245        call_tests++;
16246        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16247        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16248        des_int_ptr(n_len, len, 2);
16249        xmlResetLastError();
16250        if (mem_base != xmlMemBlocks()) {
16251            printf("Leak of %d blocks found in xmlStringCurrentChar",
16252	           xmlMemBlocks() - mem_base);
16253	    test_ret++;
16254            printf(" %d", n_ctxt);
16255            printf(" %d", n_cur);
16256            printf(" %d", n_len);
16257            printf("\n");
16258        }
16259    }
16260    }
16261    }
16262    function_tests++;
16263
16264    return(test_ret);
16265}
16266
16267
16268static int
16269test_xmlStringDecodeEntities(void) {
16270    int test_ret = 0;
16271
16272    int mem_base;
16273    xmlChar * ret_val;
16274    xmlParserCtxtPtr ctxt; /* the parser context */
16275    int n_ctxt;
16276    xmlChar * str; /* the input string */
16277    int n_str;
16278    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16279    int n_what;
16280    xmlChar end; /* an end marker xmlChar, 0 if none */
16281    int n_end;
16282    xmlChar end2; /* an end marker xmlChar, 0 if none */
16283    int n_end2;
16284    xmlChar end3; /* an end marker xmlChar, 0 if none */
16285    int n_end3;
16286
16287    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16288    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16289    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16290    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16291    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16292    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16293        mem_base = xmlMemBlocks();
16294        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16295        str = gen_const_xmlChar_ptr(n_str, 1);
16296        what = gen_int(n_what, 2);
16297        end = gen_xmlChar(n_end, 3);
16298        end2 = gen_xmlChar(n_end2, 4);
16299        end3 = gen_xmlChar(n_end3, 5);
16300
16301        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16302        desret_xmlChar_ptr(ret_val);
16303        call_tests++;
16304        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16305        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16306        des_int(n_what, what, 2);
16307        des_xmlChar(n_end, end, 3);
16308        des_xmlChar(n_end2, end2, 4);
16309        des_xmlChar(n_end3, end3, 5);
16310        xmlResetLastError();
16311        if (mem_base != xmlMemBlocks()) {
16312            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16313	           xmlMemBlocks() - mem_base);
16314	    test_ret++;
16315            printf(" %d", n_ctxt);
16316            printf(" %d", n_str);
16317            printf(" %d", n_what);
16318            printf(" %d", n_end);
16319            printf(" %d", n_end2);
16320            printf(" %d", n_end3);
16321            printf("\n");
16322        }
16323    }
16324    }
16325    }
16326    }
16327    }
16328    }
16329    function_tests++;
16330
16331    return(test_ret);
16332}
16333
16334
16335static int
16336test_xmlStringLenDecodeEntities(void) {
16337    int test_ret = 0;
16338
16339    int mem_base;
16340    xmlChar * ret_val;
16341    xmlParserCtxtPtr ctxt; /* the parser context */
16342    int n_ctxt;
16343    xmlChar * str; /* the input string */
16344    int n_str;
16345    int len; /* the string length */
16346    int n_len;
16347    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16348    int n_what;
16349    xmlChar end; /* an end marker xmlChar, 0 if none */
16350    int n_end;
16351    xmlChar end2; /* an end marker xmlChar, 0 if none */
16352    int n_end2;
16353    xmlChar end3; /* an end marker xmlChar, 0 if none */
16354    int n_end3;
16355
16356    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16357    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16358    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16359    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16360    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16361    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16362    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16363        mem_base = xmlMemBlocks();
16364        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16365        str = gen_const_xmlChar_ptr(n_str, 1);
16366        len = gen_int(n_len, 2);
16367        what = gen_int(n_what, 3);
16368        end = gen_xmlChar(n_end, 4);
16369        end2 = gen_xmlChar(n_end2, 5);
16370        end3 = gen_xmlChar(n_end3, 6);
16371
16372        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16373        desret_xmlChar_ptr(ret_val);
16374        call_tests++;
16375        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16376        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16377        des_int(n_len, len, 2);
16378        des_int(n_what, what, 3);
16379        des_xmlChar(n_end, end, 4);
16380        des_xmlChar(n_end2, end2, 5);
16381        des_xmlChar(n_end3, end3, 6);
16382        xmlResetLastError();
16383        if (mem_base != xmlMemBlocks()) {
16384            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16385	           xmlMemBlocks() - mem_base);
16386	    test_ret++;
16387            printf(" %d", n_ctxt);
16388            printf(" %d", n_str);
16389            printf(" %d", n_len);
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    }
16403    function_tests++;
16404
16405    return(test_ret);
16406}
16407
16408
16409static int
16410test_xmlSwitchEncoding(void) {
16411    int test_ret = 0;
16412
16413    int mem_base;
16414    int ret_val;
16415    xmlParserCtxtPtr ctxt; /* the parser context */
16416    int n_ctxt;
16417    xmlCharEncoding enc; /* the encoding value (number) */
16418    int n_enc;
16419
16420    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16421    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16422        mem_base = xmlMemBlocks();
16423        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16424        enc = gen_xmlCharEncoding(n_enc, 1);
16425
16426        ret_val = xmlSwitchEncoding(ctxt, enc);
16427        desret_int(ret_val);
16428        call_tests++;
16429        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16430        des_xmlCharEncoding(n_enc, enc, 1);
16431        xmlResetLastError();
16432        if (mem_base != xmlMemBlocks()) {
16433            printf("Leak of %d blocks found in xmlSwitchEncoding",
16434	           xmlMemBlocks() - mem_base);
16435	    test_ret++;
16436            printf(" %d", n_ctxt);
16437            printf(" %d", n_enc);
16438            printf("\n");
16439        }
16440    }
16441    }
16442    function_tests++;
16443
16444    return(test_ret);
16445}
16446
16447
16448static int
16449test_xmlSwitchInputEncoding(void) {
16450    int test_ret = 0;
16451
16452    int mem_base;
16453    int ret_val;
16454    xmlParserCtxtPtr ctxt; /* the parser context */
16455    int n_ctxt;
16456    xmlParserInputPtr input; /* the input stream */
16457    int n_input;
16458    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16459    int n_handler;
16460
16461    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16462    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16463    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16464        mem_base = xmlMemBlocks();
16465        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16466        input = gen_xmlParserInputPtr(n_input, 1);
16467        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16468
16469        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16470        desret_int(ret_val);
16471        call_tests++;
16472        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16473        des_xmlParserInputPtr(n_input, input, 1);
16474        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16475        xmlResetLastError();
16476        if (mem_base != xmlMemBlocks()) {
16477            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16478	           xmlMemBlocks() - mem_base);
16479	    test_ret++;
16480            printf(" %d", n_ctxt);
16481            printf(" %d", n_input);
16482            printf(" %d", n_handler);
16483            printf("\n");
16484        }
16485    }
16486    }
16487    }
16488    function_tests++;
16489
16490    return(test_ret);
16491}
16492
16493
16494static int
16495test_xmlSwitchToEncoding(void) {
16496    int test_ret = 0;
16497
16498    int mem_base;
16499    int ret_val;
16500    xmlParserCtxtPtr ctxt; /* the parser context */
16501    int n_ctxt;
16502    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16503    int n_handler;
16504
16505    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16506    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16507        mem_base = xmlMemBlocks();
16508        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16509        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16510
16511        ret_val = xmlSwitchToEncoding(ctxt, handler);
16512        desret_int(ret_val);
16513        call_tests++;
16514        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16515        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16516        xmlResetLastError();
16517        if (mem_base != xmlMemBlocks()) {
16518            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16519	           xmlMemBlocks() - mem_base);
16520	    test_ret++;
16521            printf(" %d", n_ctxt);
16522            printf(" %d", n_handler);
16523            printf("\n");
16524        }
16525    }
16526    }
16527    function_tests++;
16528
16529    return(test_ret);
16530}
16531
16532static int
16533test_parserInternals(void) {
16534    int test_ret = 0;
16535
16536    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16537    test_ret += test_htmlCreateFileParserCtxt();
16538    test_ret += test_htmlInitAutoClose();
16539    test_ret += test_inputPop();
16540    test_ret += test_inputPush();
16541    test_ret += test_namePop();
16542    test_ret += test_namePush();
16543    test_ret += test_nodePop();
16544    test_ret += test_nodePush();
16545    test_ret += test_xmlCheckLanguageID();
16546    test_ret += test_xmlCopyChar();
16547    test_ret += test_xmlCopyCharMultiByte();
16548    test_ret += test_xmlCreateEntityParserCtxt();
16549    test_ret += test_xmlCreateFileParserCtxt();
16550    test_ret += test_xmlCreateMemoryParserCtxt();
16551    test_ret += test_xmlCreateURLParserCtxt();
16552    test_ret += test_xmlCurrentChar();
16553    test_ret += test_xmlErrMemory();
16554    test_ret += test_xmlIsLetter();
16555    test_ret += test_xmlNewEntityInputStream();
16556    test_ret += test_xmlNewInputFromFile();
16557    test_ret += test_xmlNewInputStream();
16558    test_ret += test_xmlNewStringInputStream();
16559    test_ret += test_xmlNextChar();
16560    test_ret += test_xmlParserInputShrink();
16561    test_ret += test_xmlPopInput();
16562    test_ret += test_xmlPushInput();
16563    test_ret += test_xmlSetEntityReferenceFunc();
16564    test_ret += test_xmlSplitQName();
16565    test_ret += test_xmlStringCurrentChar();
16566    test_ret += test_xmlStringDecodeEntities();
16567    test_ret += test_xmlStringLenDecodeEntities();
16568    test_ret += test_xmlSwitchEncoding();
16569    test_ret += test_xmlSwitchInputEncoding();
16570    test_ret += test_xmlSwitchToEncoding();
16571
16572    if (test_ret != 0)
16573	printf("Module parserInternals: %d errors\n", test_ret);
16574    return(test_ret);
16575}
16576
16577static int
16578test_xmlPatternFromRoot(void) {
16579    int test_ret = 0;
16580
16581#if defined(LIBXML_PATTERN_ENABLED)
16582    int mem_base;
16583    int ret_val;
16584    xmlPatternPtr comp; /* the precompiled pattern */
16585    int n_comp;
16586
16587    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16588        mem_base = xmlMemBlocks();
16589        comp = gen_xmlPatternPtr(n_comp, 0);
16590
16591        ret_val = xmlPatternFromRoot(comp);
16592        desret_int(ret_val);
16593        call_tests++;
16594        des_xmlPatternPtr(n_comp, comp, 0);
16595        xmlResetLastError();
16596        if (mem_base != xmlMemBlocks()) {
16597            printf("Leak of %d blocks found in xmlPatternFromRoot",
16598	           xmlMemBlocks() - mem_base);
16599	    test_ret++;
16600            printf(" %d", n_comp);
16601            printf("\n");
16602        }
16603    }
16604    function_tests++;
16605#endif
16606
16607    return(test_ret);
16608}
16609
16610
16611static int
16612test_xmlPatternGetStreamCtxt(void) {
16613    int test_ret = 0;
16614
16615
16616    /* missing type support */
16617    return(test_ret);
16618}
16619
16620
16621static int
16622test_xmlPatternMatch(void) {
16623    int test_ret = 0;
16624
16625#if defined(LIBXML_PATTERN_ENABLED)
16626    int mem_base;
16627    int ret_val;
16628    xmlPatternPtr comp; /* the precompiled pattern */
16629    int n_comp;
16630    xmlNodePtr node; /* a node */
16631    int n_node;
16632
16633    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16634    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16635        mem_base = xmlMemBlocks();
16636        comp = gen_xmlPatternPtr(n_comp, 0);
16637        node = gen_xmlNodePtr(n_node, 1);
16638
16639        ret_val = xmlPatternMatch(comp, node);
16640        desret_int(ret_val);
16641        call_tests++;
16642        des_xmlPatternPtr(n_comp, comp, 0);
16643        des_xmlNodePtr(n_node, node, 1);
16644        xmlResetLastError();
16645        if (mem_base != xmlMemBlocks()) {
16646            printf("Leak of %d blocks found in xmlPatternMatch",
16647	           xmlMemBlocks() - mem_base);
16648	    test_ret++;
16649            printf(" %d", n_comp);
16650            printf(" %d", n_node);
16651            printf("\n");
16652        }
16653    }
16654    }
16655    function_tests++;
16656#endif
16657
16658    return(test_ret);
16659}
16660
16661
16662static int
16663test_xmlPatternMaxDepth(void) {
16664    int test_ret = 0;
16665
16666#if defined(LIBXML_PATTERN_ENABLED)
16667    int mem_base;
16668    int ret_val;
16669    xmlPatternPtr comp; /* the precompiled pattern */
16670    int n_comp;
16671
16672    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16673        mem_base = xmlMemBlocks();
16674        comp = gen_xmlPatternPtr(n_comp, 0);
16675
16676        ret_val = xmlPatternMaxDepth(comp);
16677        desret_int(ret_val);
16678        call_tests++;
16679        des_xmlPatternPtr(n_comp, comp, 0);
16680        xmlResetLastError();
16681        if (mem_base != xmlMemBlocks()) {
16682            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16683	           xmlMemBlocks() - mem_base);
16684	    test_ret++;
16685            printf(" %d", n_comp);
16686            printf("\n");
16687        }
16688    }
16689    function_tests++;
16690#endif
16691
16692    return(test_ret);
16693}
16694
16695
16696static int
16697test_xmlPatternStreamable(void) {
16698    int test_ret = 0;
16699
16700#if defined(LIBXML_PATTERN_ENABLED)
16701    int mem_base;
16702    int ret_val;
16703    xmlPatternPtr comp; /* the precompiled pattern */
16704    int n_comp;
16705
16706    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16707        mem_base = xmlMemBlocks();
16708        comp = gen_xmlPatternPtr(n_comp, 0);
16709
16710        ret_val = xmlPatternStreamable(comp);
16711        desret_int(ret_val);
16712        call_tests++;
16713        des_xmlPatternPtr(n_comp, comp, 0);
16714        xmlResetLastError();
16715        if (mem_base != xmlMemBlocks()) {
16716            printf("Leak of %d blocks found in xmlPatternStreamable",
16717	           xmlMemBlocks() - mem_base);
16718	    test_ret++;
16719            printf(" %d", n_comp);
16720            printf("\n");
16721        }
16722    }
16723    function_tests++;
16724#endif
16725
16726    return(test_ret);
16727}
16728
16729
16730static int
16731test_xmlPatterncompile(void) {
16732    int test_ret = 0;
16733
16734
16735    /* missing type support */
16736    return(test_ret);
16737}
16738
16739#ifdef LIBXML_PATTERN_ENABLED
16740
16741#define gen_nb_xmlStreamCtxtPtr 1
16742static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16743    return(NULL);
16744}
16745static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16746}
16747#endif
16748
16749
16750static int
16751test_xmlStreamPop(void) {
16752    int test_ret = 0;
16753
16754#if defined(LIBXML_PATTERN_ENABLED)
16755    int mem_base;
16756    int ret_val;
16757    xmlStreamCtxtPtr stream; /* the stream context */
16758    int n_stream;
16759
16760    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16761        mem_base = xmlMemBlocks();
16762        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16763
16764        ret_val = xmlStreamPop(stream);
16765        desret_int(ret_val);
16766        call_tests++;
16767        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16768        xmlResetLastError();
16769        if (mem_base != xmlMemBlocks()) {
16770            printf("Leak of %d blocks found in xmlStreamPop",
16771	           xmlMemBlocks() - mem_base);
16772	    test_ret++;
16773            printf(" %d", n_stream);
16774            printf("\n");
16775        }
16776    }
16777    function_tests++;
16778#endif
16779
16780    return(test_ret);
16781}
16782
16783
16784static int
16785test_xmlStreamPush(void) {
16786    int test_ret = 0;
16787
16788#if defined(LIBXML_PATTERN_ENABLED)
16789    int mem_base;
16790    int ret_val;
16791    xmlStreamCtxtPtr stream; /* the stream context */
16792    int n_stream;
16793    xmlChar * name; /* the current name */
16794    int n_name;
16795    xmlChar * ns; /* the namespace name */
16796    int n_ns;
16797
16798    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16799    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16800    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16801        mem_base = xmlMemBlocks();
16802        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16803        name = gen_const_xmlChar_ptr(n_name, 1);
16804        ns = gen_const_xmlChar_ptr(n_ns, 2);
16805
16806        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
16807        desret_int(ret_val);
16808        call_tests++;
16809        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16810        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16811        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16812        xmlResetLastError();
16813        if (mem_base != xmlMemBlocks()) {
16814            printf("Leak of %d blocks found in xmlStreamPush",
16815	           xmlMemBlocks() - mem_base);
16816	    test_ret++;
16817            printf(" %d", n_stream);
16818            printf(" %d", n_name);
16819            printf(" %d", n_ns);
16820            printf("\n");
16821        }
16822    }
16823    }
16824    }
16825    function_tests++;
16826#endif
16827
16828    return(test_ret);
16829}
16830
16831
16832static int
16833test_xmlStreamPushAttr(void) {
16834    int test_ret = 0;
16835
16836#if defined(LIBXML_PATTERN_ENABLED)
16837    int mem_base;
16838    int ret_val;
16839    xmlStreamCtxtPtr stream; /* the stream context */
16840    int n_stream;
16841    xmlChar * name; /* the current name */
16842    int n_name;
16843    xmlChar * ns; /* the namespace name */
16844    int n_ns;
16845
16846    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16847    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16848    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16849        mem_base = xmlMemBlocks();
16850        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16851        name = gen_const_xmlChar_ptr(n_name, 1);
16852        ns = gen_const_xmlChar_ptr(n_ns, 2);
16853
16854        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
16855        desret_int(ret_val);
16856        call_tests++;
16857        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16858        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16859        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16860        xmlResetLastError();
16861        if (mem_base != xmlMemBlocks()) {
16862            printf("Leak of %d blocks found in xmlStreamPushAttr",
16863	           xmlMemBlocks() - mem_base);
16864	    test_ret++;
16865            printf(" %d", n_stream);
16866            printf(" %d", n_name);
16867            printf(" %d", n_ns);
16868            printf("\n");
16869        }
16870    }
16871    }
16872    }
16873    function_tests++;
16874#endif
16875
16876    return(test_ret);
16877}
16878
16879static int
16880test_pattern(void) {
16881    int test_ret = 0;
16882
16883    if (quiet == 0) printf("Testing pattern : 7 of 12 functions ...\n");
16884    test_ret += test_xmlPatternFromRoot();
16885    test_ret += test_xmlPatternGetStreamCtxt();
16886    test_ret += test_xmlPatternMatch();
16887    test_ret += test_xmlPatternMaxDepth();
16888    test_ret += test_xmlPatternStreamable();
16889    test_ret += test_xmlPatterncompile();
16890    test_ret += test_xmlStreamPop();
16891    test_ret += test_xmlStreamPush();
16892    test_ret += test_xmlStreamPushAttr();
16893
16894    if (test_ret != 0)
16895	printf("Module pattern: %d errors\n", test_ret);
16896    return(test_ret);
16897}
16898#ifdef LIBXML_SCHEMAS_ENABLED
16899
16900#define gen_nb_xmlRelaxNGPtr 1
16901static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16902    return(NULL);
16903}
16904static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16905}
16906#endif
16907
16908
16909static int
16910test_xmlRelaxNGDump(void) {
16911    int test_ret = 0;
16912
16913#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16914    int mem_base;
16915    FILE * output; /* the file output */
16916    int n_output;
16917    xmlRelaxNGPtr schema; /* a schema structure */
16918    int n_schema;
16919
16920    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16921    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16922        mem_base = xmlMemBlocks();
16923        output = gen_FILE_ptr(n_output, 0);
16924        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16925
16926        xmlRelaxNGDump(output, schema);
16927        call_tests++;
16928        des_FILE_ptr(n_output, output, 0);
16929        des_xmlRelaxNGPtr(n_schema, schema, 1);
16930        xmlResetLastError();
16931        if (mem_base != xmlMemBlocks()) {
16932            printf("Leak of %d blocks found in xmlRelaxNGDump",
16933	           xmlMemBlocks() - mem_base);
16934	    test_ret++;
16935            printf(" %d", n_output);
16936            printf(" %d", n_schema);
16937            printf("\n");
16938        }
16939    }
16940    }
16941    function_tests++;
16942#endif
16943
16944    return(test_ret);
16945}
16946
16947
16948static int
16949test_xmlRelaxNGDumpTree(void) {
16950    int test_ret = 0;
16951
16952#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16953    int mem_base;
16954    FILE * output; /* the file output */
16955    int n_output;
16956    xmlRelaxNGPtr schema; /* a schema structure */
16957    int n_schema;
16958
16959    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16960    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16961        mem_base = xmlMemBlocks();
16962        output = gen_FILE_ptr(n_output, 0);
16963        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16964
16965        xmlRelaxNGDumpTree(output, schema);
16966        call_tests++;
16967        des_FILE_ptr(n_output, output, 0);
16968        des_xmlRelaxNGPtr(n_schema, schema, 1);
16969        xmlResetLastError();
16970        if (mem_base != xmlMemBlocks()) {
16971            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
16972	           xmlMemBlocks() - mem_base);
16973	    test_ret++;
16974            printf(" %d", n_output);
16975            printf(" %d", n_schema);
16976            printf("\n");
16977        }
16978    }
16979    }
16980    function_tests++;
16981#endif
16982
16983    return(test_ret);
16984}
16985
16986#ifdef LIBXML_SCHEMAS_ENABLED
16987
16988#define gen_nb_xmlRelaxNGParserCtxtPtr 1
16989static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16990    return(NULL);
16991}
16992static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16993}
16994#endif
16995
16996#ifdef LIBXML_SCHEMAS_ENABLED
16997
16998#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
16999static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17000    return(NULL);
17001}
17002static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17003}
17004#endif
17005
17006#ifdef LIBXML_SCHEMAS_ENABLED
17007
17008#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17009static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17010    return(NULL);
17011}
17012static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17013}
17014#endif
17015
17016#ifdef LIBXML_SCHEMAS_ENABLED
17017
17018#define gen_nb_void_ptr_ptr 1
17019static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17020    return(NULL);
17021}
17022static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17023}
17024#endif
17025
17026
17027static int
17028test_xmlRelaxNGGetParserErrors(void) {
17029    int test_ret = 0;
17030
17031#if defined(LIBXML_SCHEMAS_ENABLED)
17032    int mem_base;
17033    int ret_val;
17034    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17035    int n_ctxt;
17036    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17037    int n_err;
17038    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17039    int n_warn;
17040    void ** ctx; /* contextual data for the callbacks result */
17041    int n_ctx;
17042
17043    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17044    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17045    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17046    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17047        mem_base = xmlMemBlocks();
17048        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17049        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17050        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17051        ctx = gen_void_ptr_ptr(n_ctx, 3);
17052
17053        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17054        desret_int(ret_val);
17055        call_tests++;
17056        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17057        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17058        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17059        des_void_ptr_ptr(n_ctx, ctx, 3);
17060        xmlResetLastError();
17061        if (mem_base != xmlMemBlocks()) {
17062            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17063	           xmlMemBlocks() - mem_base);
17064	    test_ret++;
17065            printf(" %d", n_ctxt);
17066            printf(" %d", n_err);
17067            printf(" %d", n_warn);
17068            printf(" %d", n_ctx);
17069            printf("\n");
17070        }
17071    }
17072    }
17073    }
17074    }
17075    function_tests++;
17076#endif
17077
17078    return(test_ret);
17079}
17080
17081#ifdef LIBXML_SCHEMAS_ENABLED
17082
17083#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17084static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17085    return(NULL);
17086}
17087static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17088}
17089#endif
17090
17091
17092static int
17093test_xmlRelaxNGGetValidErrors(void) {
17094    int test_ret = 0;
17095
17096#if defined(LIBXML_SCHEMAS_ENABLED)
17097    int mem_base;
17098    int ret_val;
17099    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17100    int n_ctxt;
17101    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17102    int n_err;
17103    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17104    int n_warn;
17105    void ** ctx; /* the functions context result */
17106    int n_ctx;
17107
17108    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17109    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17110    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17111    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17112        mem_base = xmlMemBlocks();
17113        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17114        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17115        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17116        ctx = gen_void_ptr_ptr(n_ctx, 3);
17117
17118        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17119        desret_int(ret_val);
17120        call_tests++;
17121        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17122        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17123        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17124        des_void_ptr_ptr(n_ctx, ctx, 3);
17125        xmlResetLastError();
17126        if (mem_base != xmlMemBlocks()) {
17127            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17128	           xmlMemBlocks() - mem_base);
17129	    test_ret++;
17130            printf(" %d", n_ctxt);
17131            printf(" %d", n_err);
17132            printf(" %d", n_warn);
17133            printf(" %d", n_ctx);
17134            printf("\n");
17135        }
17136    }
17137    }
17138    }
17139    }
17140    function_tests++;
17141#endif
17142
17143    return(test_ret);
17144}
17145
17146
17147static int
17148test_xmlRelaxNGInitTypes(void) {
17149    int test_ret = 0;
17150
17151#if defined(LIBXML_SCHEMAS_ENABLED)
17152    int mem_base;
17153    int ret_val;
17154
17155        mem_base = xmlMemBlocks();
17156
17157        ret_val = xmlRelaxNGInitTypes();
17158        desret_int(ret_val);
17159        call_tests++;
17160        xmlResetLastError();
17161        if (mem_base != xmlMemBlocks()) {
17162            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17163	           xmlMemBlocks() - mem_base);
17164	    test_ret++;
17165            printf("\n");
17166        }
17167    function_tests++;
17168#endif
17169
17170    return(test_ret);
17171}
17172
17173
17174static int
17175test_xmlRelaxNGNewDocParserCtxt(void) {
17176    int test_ret = 0;
17177
17178#if defined(LIBXML_SCHEMAS_ENABLED)
17179    int mem_base;
17180    xmlRelaxNGParserCtxtPtr ret_val;
17181    xmlDocPtr doc; /* a preparsed document tree */
17182    int n_doc;
17183
17184    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17185        mem_base = xmlMemBlocks();
17186        doc = gen_xmlDocPtr(n_doc, 0);
17187
17188        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17189        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17190        call_tests++;
17191        des_xmlDocPtr(n_doc, doc, 0);
17192        xmlResetLastError();
17193        if (mem_base != xmlMemBlocks()) {
17194            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17195	           xmlMemBlocks() - mem_base);
17196	    test_ret++;
17197            printf(" %d", n_doc);
17198            printf("\n");
17199        }
17200    }
17201    function_tests++;
17202#endif
17203
17204    return(test_ret);
17205}
17206
17207
17208static int
17209test_xmlRelaxNGNewMemParserCtxt(void) {
17210    int test_ret = 0;
17211
17212#if defined(LIBXML_SCHEMAS_ENABLED)
17213    int mem_base;
17214    xmlRelaxNGParserCtxtPtr ret_val;
17215    char * buffer; /* a pointer to a char array containing the schemas */
17216    int n_buffer;
17217    int size; /* the size of the array */
17218    int n_size;
17219
17220    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17221    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17222        mem_base = xmlMemBlocks();
17223        buffer = gen_const_char_ptr(n_buffer, 0);
17224        size = gen_int(n_size, 1);
17225
17226        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17227        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17228        call_tests++;
17229        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17230        des_int(n_size, size, 1);
17231        xmlResetLastError();
17232        if (mem_base != xmlMemBlocks()) {
17233            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17234	           xmlMemBlocks() - mem_base);
17235	    test_ret++;
17236            printf(" %d", n_buffer);
17237            printf(" %d", n_size);
17238            printf("\n");
17239        }
17240    }
17241    }
17242    function_tests++;
17243#endif
17244
17245    return(test_ret);
17246}
17247
17248
17249static int
17250test_xmlRelaxNGNewParserCtxt(void) {
17251    int test_ret = 0;
17252
17253#if defined(LIBXML_SCHEMAS_ENABLED)
17254    int mem_base;
17255    xmlRelaxNGParserCtxtPtr ret_val;
17256    char * URL; /* the location of the schema */
17257    int n_URL;
17258
17259    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17260        mem_base = xmlMemBlocks();
17261        URL = gen_const_char_ptr(n_URL, 0);
17262
17263        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17264        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17265        call_tests++;
17266        des_const_char_ptr(n_URL, (const char *)URL, 0);
17267        xmlResetLastError();
17268        if (mem_base != xmlMemBlocks()) {
17269            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17270	           xmlMemBlocks() - mem_base);
17271	    test_ret++;
17272            printf(" %d", n_URL);
17273            printf("\n");
17274        }
17275    }
17276    function_tests++;
17277#endif
17278
17279    return(test_ret);
17280}
17281
17282
17283static int
17284test_xmlRelaxNGNewValidCtxt(void) {
17285    int test_ret = 0;
17286
17287
17288    /* missing type support */
17289    return(test_ret);
17290}
17291
17292
17293static int
17294test_xmlRelaxNGParse(void) {
17295    int test_ret = 0;
17296
17297
17298    /* missing type support */
17299    return(test_ret);
17300}
17301
17302
17303static int
17304test_xmlRelaxNGSetParserErrors(void) {
17305    int test_ret = 0;
17306
17307
17308    /* missing type support */
17309    return(test_ret);
17310}
17311
17312
17313static int
17314test_xmlRelaxNGSetValidErrors(void) {
17315    int test_ret = 0;
17316
17317
17318    /* missing type support */
17319    return(test_ret);
17320}
17321
17322
17323static int
17324test_xmlRelaxNGValidateDoc(void) {
17325    int test_ret = 0;
17326
17327#if defined(LIBXML_SCHEMAS_ENABLED)
17328    int mem_base;
17329    int ret_val;
17330    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17331    int n_ctxt;
17332    xmlDocPtr doc; /* a parsed document tree */
17333    int n_doc;
17334
17335    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17336    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17337        mem_base = xmlMemBlocks();
17338        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17339        doc = gen_xmlDocPtr(n_doc, 1);
17340
17341        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17342        desret_int(ret_val);
17343        call_tests++;
17344        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17345        des_xmlDocPtr(n_doc, doc, 1);
17346        xmlResetLastError();
17347        if (mem_base != xmlMemBlocks()) {
17348            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17349	           xmlMemBlocks() - mem_base);
17350	    test_ret++;
17351            printf(" %d", n_ctxt);
17352            printf(" %d", n_doc);
17353            printf("\n");
17354        }
17355    }
17356    }
17357    function_tests++;
17358#endif
17359
17360    return(test_ret);
17361}
17362
17363
17364static int
17365test_xmlRelaxNGValidateFullElement(void) {
17366    int test_ret = 0;
17367
17368#if defined(LIBXML_SCHEMAS_ENABLED)
17369    int mem_base;
17370    int ret_val;
17371    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17372    int n_ctxt;
17373    xmlDocPtr doc; /* a document instance */
17374    int n_doc;
17375    xmlNodePtr elem; /* an element instance */
17376    int n_elem;
17377
17378    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17379    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17380    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17381        mem_base = xmlMemBlocks();
17382        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17383        doc = gen_xmlDocPtr(n_doc, 1);
17384        elem = gen_xmlNodePtr(n_elem, 2);
17385
17386        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17387        desret_int(ret_val);
17388        call_tests++;
17389        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17390        des_xmlDocPtr(n_doc, doc, 1);
17391        des_xmlNodePtr(n_elem, elem, 2);
17392        xmlResetLastError();
17393        if (mem_base != xmlMemBlocks()) {
17394            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17395	           xmlMemBlocks() - mem_base);
17396	    test_ret++;
17397            printf(" %d", n_ctxt);
17398            printf(" %d", n_doc);
17399            printf(" %d", n_elem);
17400            printf("\n");
17401        }
17402    }
17403    }
17404    }
17405    function_tests++;
17406#endif
17407
17408    return(test_ret);
17409}
17410
17411
17412static int
17413test_xmlRelaxNGValidatePopElement(void) {
17414    int test_ret = 0;
17415
17416#if defined(LIBXML_SCHEMAS_ENABLED)
17417    int mem_base;
17418    int ret_val;
17419    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17420    int n_ctxt;
17421    xmlDocPtr doc; /* a document instance */
17422    int n_doc;
17423    xmlNodePtr elem; /* an element instance */
17424    int n_elem;
17425
17426    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17427    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17428    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17429        mem_base = xmlMemBlocks();
17430        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17431        doc = gen_xmlDocPtr(n_doc, 1);
17432        elem = gen_xmlNodePtr(n_elem, 2);
17433
17434        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17435        desret_int(ret_val);
17436        call_tests++;
17437        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17438        des_xmlDocPtr(n_doc, doc, 1);
17439        des_xmlNodePtr(n_elem, elem, 2);
17440        xmlResetLastError();
17441        if (mem_base != xmlMemBlocks()) {
17442            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17443	           xmlMemBlocks() - mem_base);
17444	    test_ret++;
17445            printf(" %d", n_ctxt);
17446            printf(" %d", n_doc);
17447            printf(" %d", n_elem);
17448            printf("\n");
17449        }
17450    }
17451    }
17452    }
17453    function_tests++;
17454#endif
17455
17456    return(test_ret);
17457}
17458
17459
17460static int
17461test_xmlRelaxNGValidatePushCData(void) {
17462    int test_ret = 0;
17463
17464#if defined(LIBXML_SCHEMAS_ENABLED)
17465    int mem_base;
17466    int ret_val;
17467    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17468    int n_ctxt;
17469    xmlChar * data; /* some character data read */
17470    int n_data;
17471    int len; /* the lenght of the data */
17472    int n_len;
17473
17474    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17475    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17476    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17477        mem_base = xmlMemBlocks();
17478        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17479        data = gen_const_xmlChar_ptr(n_data, 1);
17480        len = gen_int(n_len, 2);
17481
17482        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17483        desret_int(ret_val);
17484        call_tests++;
17485        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17486        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17487        des_int(n_len, len, 2);
17488        xmlResetLastError();
17489        if (mem_base != xmlMemBlocks()) {
17490            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17491	           xmlMemBlocks() - mem_base);
17492	    test_ret++;
17493            printf(" %d", n_ctxt);
17494            printf(" %d", n_data);
17495            printf(" %d", n_len);
17496            printf("\n");
17497        }
17498    }
17499    }
17500    }
17501    function_tests++;
17502#endif
17503
17504    return(test_ret);
17505}
17506
17507
17508static int
17509test_xmlRelaxNGValidatePushElement(void) {
17510    int test_ret = 0;
17511
17512#if defined(LIBXML_SCHEMAS_ENABLED)
17513    int mem_base;
17514    int ret_val;
17515    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17516    int n_ctxt;
17517    xmlDocPtr doc; /* a document instance */
17518    int n_doc;
17519    xmlNodePtr elem; /* an element instance */
17520    int n_elem;
17521
17522    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17523    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17524    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17525        mem_base = xmlMemBlocks();
17526        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17527        doc = gen_xmlDocPtr(n_doc, 1);
17528        elem = gen_xmlNodePtr(n_elem, 2);
17529
17530        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17531        desret_int(ret_val);
17532        call_tests++;
17533        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17534        des_xmlDocPtr(n_doc, doc, 1);
17535        des_xmlNodePtr(n_elem, elem, 2);
17536        xmlResetLastError();
17537        if (mem_base != xmlMemBlocks()) {
17538            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17539	           xmlMemBlocks() - mem_base);
17540	    test_ret++;
17541            printf(" %d", n_ctxt);
17542            printf(" %d", n_doc);
17543            printf(" %d", n_elem);
17544            printf("\n");
17545        }
17546    }
17547    }
17548    }
17549    function_tests++;
17550#endif
17551
17552    return(test_ret);
17553}
17554
17555
17556static int
17557test_xmlRelaxParserSetFlag(void) {
17558    int test_ret = 0;
17559
17560#if defined(LIBXML_SCHEMAS_ENABLED)
17561    int mem_base;
17562    int ret_val;
17563    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17564    int n_ctxt;
17565    int flags; /* a set of flags values */
17566    int n_flags;
17567
17568    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17569    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17570        mem_base = xmlMemBlocks();
17571        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17572        flags = gen_int(n_flags, 1);
17573
17574        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17575        desret_int(ret_val);
17576        call_tests++;
17577        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17578        des_int(n_flags, flags, 1);
17579        xmlResetLastError();
17580        if (mem_base != xmlMemBlocks()) {
17581            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17582	           xmlMemBlocks() - mem_base);
17583	    test_ret++;
17584            printf(" %d", n_ctxt);
17585            printf(" %d", n_flags);
17586            printf("\n");
17587        }
17588    }
17589    }
17590    function_tests++;
17591#endif
17592
17593    return(test_ret);
17594}
17595
17596static int
17597test_relaxng(void) {
17598    int test_ret = 0;
17599
17600    if (quiet == 0) printf("Testing relaxng : 14 of 22 functions ...\n");
17601    test_ret += test_xmlRelaxNGDump();
17602    test_ret += test_xmlRelaxNGDumpTree();
17603    test_ret += test_xmlRelaxNGGetParserErrors();
17604    test_ret += test_xmlRelaxNGGetValidErrors();
17605    test_ret += test_xmlRelaxNGInitTypes();
17606    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17607    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17608    test_ret += test_xmlRelaxNGNewParserCtxt();
17609    test_ret += test_xmlRelaxNGNewValidCtxt();
17610    test_ret += test_xmlRelaxNGParse();
17611    test_ret += test_xmlRelaxNGSetParserErrors();
17612    test_ret += test_xmlRelaxNGSetValidErrors();
17613    test_ret += test_xmlRelaxNGValidateDoc();
17614    test_ret += test_xmlRelaxNGValidateFullElement();
17615    test_ret += test_xmlRelaxNGValidatePopElement();
17616    test_ret += test_xmlRelaxNGValidatePushCData();
17617    test_ret += test_xmlRelaxNGValidatePushElement();
17618    test_ret += test_xmlRelaxParserSetFlag();
17619
17620    if (test_ret != 0)
17621	printf("Module relaxng: %d errors\n", test_ret);
17622    return(test_ret);
17623}
17624static int
17625test_schemasInternals(void) {
17626    int test_ret = 0;
17627
17628    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17629
17630    if (test_ret != 0)
17631	printf("Module schemasInternals: %d errors\n", test_ret);
17632    return(test_ret);
17633}
17634
17635static int
17636test_xmlAddChild(void) {
17637    int test_ret = 0;
17638
17639    int mem_base;
17640    xmlNodePtr ret_val;
17641    xmlNodePtr parent; /* the parent node */
17642    int n_parent;
17643    xmlNodePtr cur; /* the child node */
17644    int n_cur;
17645
17646    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17647    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17648        mem_base = xmlMemBlocks();
17649        parent = gen_xmlNodePtr(n_parent, 0);
17650        cur = gen_xmlNodePtr_in(n_cur, 1);
17651
17652        ret_val = xmlAddChild(parent, cur);
17653        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
17654        desret_xmlNodePtr(ret_val);
17655        call_tests++;
17656        des_xmlNodePtr(n_parent, parent, 0);
17657        des_xmlNodePtr_in(n_cur, cur, 1);
17658        xmlResetLastError();
17659        if (mem_base != xmlMemBlocks()) {
17660            printf("Leak of %d blocks found in xmlAddChild",
17661	           xmlMemBlocks() - mem_base);
17662	    test_ret++;
17663            printf(" %d", n_parent);
17664            printf(" %d", n_cur);
17665            printf("\n");
17666        }
17667    }
17668    }
17669    function_tests++;
17670
17671    return(test_ret);
17672}
17673
17674
17675static int
17676test_xmlAddChildList(void) {
17677    int test_ret = 0;
17678
17679    int mem_base;
17680    xmlNodePtr ret_val;
17681    xmlNodePtr parent; /* the parent node */
17682    int n_parent;
17683    xmlNodePtr cur; /* the first node in the list */
17684    int n_cur;
17685
17686    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17687    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17688        mem_base = xmlMemBlocks();
17689        parent = gen_xmlNodePtr(n_parent, 0);
17690        cur = gen_xmlNodePtr_in(n_cur, 1);
17691
17692        ret_val = xmlAddChildList(parent, cur);
17693        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
17694        desret_xmlNodePtr(ret_val);
17695        call_tests++;
17696        des_xmlNodePtr(n_parent, parent, 0);
17697        des_xmlNodePtr_in(n_cur, cur, 1);
17698        xmlResetLastError();
17699        if (mem_base != xmlMemBlocks()) {
17700            printf("Leak of %d blocks found in xmlAddChildList",
17701	           xmlMemBlocks() - mem_base);
17702	    test_ret++;
17703            printf(" %d", n_parent);
17704            printf(" %d", n_cur);
17705            printf("\n");
17706        }
17707    }
17708    }
17709    function_tests++;
17710
17711    return(test_ret);
17712}
17713
17714
17715static int
17716test_xmlAddNextSibling(void) {
17717    int test_ret = 0;
17718
17719    int mem_base;
17720    xmlNodePtr ret_val;
17721    xmlNodePtr cur; /* the child node */
17722    int n_cur;
17723    xmlNodePtr elem; /* the new node */
17724    int n_elem;
17725
17726    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17727    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17728        mem_base = xmlMemBlocks();
17729        cur = gen_xmlNodePtr(n_cur, 0);
17730        elem = gen_xmlNodePtr_in(n_elem, 1);
17731
17732        ret_val = xmlAddNextSibling(cur, elem);
17733        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17734        desret_xmlNodePtr(ret_val);
17735        call_tests++;
17736        des_xmlNodePtr(n_cur, cur, 0);
17737        des_xmlNodePtr_in(n_elem, elem, 1);
17738        xmlResetLastError();
17739        if (mem_base != xmlMemBlocks()) {
17740            printf("Leak of %d blocks found in xmlAddNextSibling",
17741	           xmlMemBlocks() - mem_base);
17742	    test_ret++;
17743            printf(" %d", n_cur);
17744            printf(" %d", n_elem);
17745            printf("\n");
17746        }
17747    }
17748    }
17749    function_tests++;
17750
17751    return(test_ret);
17752}
17753
17754
17755static int
17756test_xmlAddPrevSibling(void) {
17757    int test_ret = 0;
17758
17759#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
17760    int mem_base;
17761    xmlNodePtr ret_val;
17762    xmlNodePtr cur; /* the child node */
17763    int n_cur;
17764    xmlNodePtr elem; /* the new node */
17765    int n_elem;
17766
17767    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17768    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17769        mem_base = xmlMemBlocks();
17770        cur = gen_xmlNodePtr(n_cur, 0);
17771        elem = gen_xmlNodePtr_in(n_elem, 1);
17772
17773        ret_val = xmlAddPrevSibling(cur, elem);
17774        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17775        desret_xmlNodePtr(ret_val);
17776        call_tests++;
17777        des_xmlNodePtr(n_cur, cur, 0);
17778        des_xmlNodePtr_in(n_elem, elem, 1);
17779        xmlResetLastError();
17780        if (mem_base != xmlMemBlocks()) {
17781            printf("Leak of %d blocks found in xmlAddPrevSibling",
17782	           xmlMemBlocks() - mem_base);
17783	    test_ret++;
17784            printf(" %d", n_cur);
17785            printf(" %d", n_elem);
17786            printf("\n");
17787        }
17788    }
17789    }
17790    function_tests++;
17791#endif
17792
17793    return(test_ret);
17794}
17795
17796
17797static int
17798test_xmlAddSibling(void) {
17799    int test_ret = 0;
17800
17801    int mem_base;
17802    xmlNodePtr ret_val;
17803    xmlNodePtr cur; /* the child node */
17804    int n_cur;
17805    xmlNodePtr elem; /* the new node */
17806    int n_elem;
17807
17808    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17809    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17810        mem_base = xmlMemBlocks();
17811        cur = gen_xmlNodePtr(n_cur, 0);
17812        elem = gen_xmlNodePtr_in(n_elem, 1);
17813
17814        ret_val = xmlAddSibling(cur, elem);
17815        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17816        desret_xmlNodePtr(ret_val);
17817        call_tests++;
17818        des_xmlNodePtr(n_cur, cur, 0);
17819        des_xmlNodePtr_in(n_elem, elem, 1);
17820        xmlResetLastError();
17821        if (mem_base != xmlMemBlocks()) {
17822            printf("Leak of %d blocks found in xmlAddSibling",
17823	           xmlMemBlocks() - mem_base);
17824	    test_ret++;
17825            printf(" %d", n_cur);
17826            printf(" %d", n_elem);
17827            printf("\n");
17828        }
17829    }
17830    }
17831    function_tests++;
17832
17833    return(test_ret);
17834}
17835
17836
17837static int
17838test_xmlAttrSerializeTxtContent(void) {
17839    int test_ret = 0;
17840
17841#if defined(LIBXML_OUTPUT_ENABLED)
17842#ifdef LIBXML_OUTPUT_ENABLED
17843    int mem_base;
17844    xmlBufferPtr buf; /* the XML buffer output */
17845    int n_buf;
17846    xmlDocPtr doc; /* the document */
17847    int n_doc;
17848    xmlAttrPtr attr; /* the attribute node */
17849    int n_attr;
17850    xmlChar * string; /* the text content */
17851    int n_string;
17852
17853    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17854    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17855    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
17856    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
17857        mem_base = xmlMemBlocks();
17858        buf = gen_xmlBufferPtr(n_buf, 0);
17859        doc = gen_xmlDocPtr(n_doc, 1);
17860        attr = gen_xmlAttrPtr(n_attr, 2);
17861        string = gen_const_xmlChar_ptr(n_string, 3);
17862
17863        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
17864        call_tests++;
17865        des_xmlBufferPtr(n_buf, buf, 0);
17866        des_xmlDocPtr(n_doc, doc, 1);
17867        des_xmlAttrPtr(n_attr, attr, 2);
17868        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
17869        xmlResetLastError();
17870        if (mem_base != xmlMemBlocks()) {
17871            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
17872	           xmlMemBlocks() - mem_base);
17873	    test_ret++;
17874            printf(" %d", n_buf);
17875            printf(" %d", n_doc);
17876            printf(" %d", n_attr);
17877            printf(" %d", n_string);
17878            printf("\n");
17879        }
17880    }
17881    }
17882    }
17883    }
17884    function_tests++;
17885#endif
17886#endif
17887
17888    return(test_ret);
17889}
17890
17891
17892static int
17893test_xmlBufferAdd(void) {
17894    int test_ret = 0;
17895
17896    int mem_base;
17897    int ret_val;
17898    xmlBufferPtr buf; /* the buffer to dump */
17899    int n_buf;
17900    xmlChar * str; /* the #xmlChar string */
17901    int n_str;
17902    int len; /* the number of #xmlChar to add */
17903    int n_len;
17904
17905    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17906    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17907    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17908        mem_base = xmlMemBlocks();
17909        buf = gen_xmlBufferPtr(n_buf, 0);
17910        str = gen_const_xmlChar_ptr(n_str, 1);
17911        len = gen_int(n_len, 2);
17912
17913        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
17914        desret_int(ret_val);
17915        call_tests++;
17916        des_xmlBufferPtr(n_buf, buf, 0);
17917        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17918        des_int(n_len, len, 2);
17919        xmlResetLastError();
17920        if (mem_base != xmlMemBlocks()) {
17921            printf("Leak of %d blocks found in xmlBufferAdd",
17922	           xmlMemBlocks() - mem_base);
17923	    test_ret++;
17924            printf(" %d", n_buf);
17925            printf(" %d", n_str);
17926            printf(" %d", n_len);
17927            printf("\n");
17928        }
17929    }
17930    }
17931    }
17932    function_tests++;
17933
17934    return(test_ret);
17935}
17936
17937
17938static int
17939test_xmlBufferAddHead(void) {
17940    int test_ret = 0;
17941
17942    int mem_base;
17943    int ret_val;
17944    xmlBufferPtr buf; /* the buffer */
17945    int n_buf;
17946    xmlChar * str; /* the #xmlChar string */
17947    int n_str;
17948    int len; /* the number of #xmlChar to add */
17949    int n_len;
17950
17951    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17952    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17953    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17954        mem_base = xmlMemBlocks();
17955        buf = gen_xmlBufferPtr(n_buf, 0);
17956        str = gen_const_xmlChar_ptr(n_str, 1);
17957        len = gen_int(n_len, 2);
17958
17959        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
17960        desret_int(ret_val);
17961        call_tests++;
17962        des_xmlBufferPtr(n_buf, buf, 0);
17963        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17964        des_int(n_len, len, 2);
17965        xmlResetLastError();
17966        if (mem_base != xmlMemBlocks()) {
17967            printf("Leak of %d blocks found in xmlBufferAddHead",
17968	           xmlMemBlocks() - mem_base);
17969	    test_ret++;
17970            printf(" %d", n_buf);
17971            printf(" %d", n_str);
17972            printf(" %d", n_len);
17973            printf("\n");
17974        }
17975    }
17976    }
17977    }
17978    function_tests++;
17979
17980    return(test_ret);
17981}
17982
17983
17984static int
17985test_xmlBufferCCat(void) {
17986    int test_ret = 0;
17987
17988    int mem_base;
17989    int ret_val;
17990    xmlBufferPtr buf; /* the buffer to dump */
17991    int n_buf;
17992    char * str; /* the C char string */
17993    int n_str;
17994
17995    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17996    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
17997        mem_base = xmlMemBlocks();
17998        buf = gen_xmlBufferPtr(n_buf, 0);
17999        str = gen_const_char_ptr(n_str, 1);
18000
18001        ret_val = xmlBufferCCat(buf, (const char *)str);
18002        desret_int(ret_val);
18003        call_tests++;
18004        des_xmlBufferPtr(n_buf, buf, 0);
18005        des_const_char_ptr(n_str, (const char *)str, 1);
18006        xmlResetLastError();
18007        if (mem_base != xmlMemBlocks()) {
18008            printf("Leak of %d blocks found in xmlBufferCCat",
18009	           xmlMemBlocks() - mem_base);
18010	    test_ret++;
18011            printf(" %d", n_buf);
18012            printf(" %d", n_str);
18013            printf("\n");
18014        }
18015    }
18016    }
18017    function_tests++;
18018
18019    return(test_ret);
18020}
18021
18022
18023static int
18024test_xmlBufferCat(void) {
18025    int test_ret = 0;
18026
18027    int mem_base;
18028    int ret_val;
18029    xmlBufferPtr buf; /* the buffer to add to */
18030    int n_buf;
18031    xmlChar * str; /* the #xmlChar string */
18032    int n_str;
18033
18034    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18035    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18036        mem_base = xmlMemBlocks();
18037        buf = gen_xmlBufferPtr(n_buf, 0);
18038        str = gen_const_xmlChar_ptr(n_str, 1);
18039
18040        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18041        desret_int(ret_val);
18042        call_tests++;
18043        des_xmlBufferPtr(n_buf, buf, 0);
18044        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18045        xmlResetLastError();
18046        if (mem_base != xmlMemBlocks()) {
18047            printf("Leak of %d blocks found in xmlBufferCat",
18048	           xmlMemBlocks() - mem_base);
18049	    test_ret++;
18050            printf(" %d", n_buf);
18051            printf(" %d", n_str);
18052            printf("\n");
18053        }
18054    }
18055    }
18056    function_tests++;
18057
18058    return(test_ret);
18059}
18060
18061
18062#define gen_nb_const_xmlBufferPtr 1
18063static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18064    return(NULL);
18065}
18066static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18067}
18068
18069static int
18070test_xmlBufferContent(void) {
18071    int test_ret = 0;
18072
18073    int mem_base;
18074    const xmlChar * ret_val;
18075    xmlBufferPtr buf; /* the buffer */
18076    int n_buf;
18077
18078    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18079        mem_base = xmlMemBlocks();
18080        buf = gen_const_xmlBufferPtr(n_buf, 0);
18081
18082        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18083        desret_const_xmlChar_ptr(ret_val);
18084        call_tests++;
18085        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18086        xmlResetLastError();
18087        if (mem_base != xmlMemBlocks()) {
18088            printf("Leak of %d blocks found in xmlBufferContent",
18089	           xmlMemBlocks() - mem_base);
18090	    test_ret++;
18091            printf(" %d", n_buf);
18092            printf("\n");
18093        }
18094    }
18095    function_tests++;
18096
18097    return(test_ret);
18098}
18099
18100
18101static int
18102test_xmlBufferCreate(void) {
18103    int test_ret = 0;
18104
18105    int mem_base;
18106    xmlBufferPtr ret_val;
18107
18108        mem_base = xmlMemBlocks();
18109
18110        ret_val = xmlBufferCreate();
18111        desret_xmlBufferPtr(ret_val);
18112        call_tests++;
18113        xmlResetLastError();
18114        if (mem_base != xmlMemBlocks()) {
18115            printf("Leak of %d blocks found in xmlBufferCreate",
18116	           xmlMemBlocks() - mem_base);
18117	    test_ret++;
18118            printf("\n");
18119        }
18120    function_tests++;
18121
18122    return(test_ret);
18123}
18124
18125
18126static int
18127test_xmlBufferCreateSize(void) {
18128    int test_ret = 0;
18129
18130
18131    /* missing type support */
18132    return(test_ret);
18133}
18134
18135
18136static int
18137test_xmlBufferCreateStatic(void) {
18138    int test_ret = 0;
18139
18140
18141    /* missing type support */
18142    return(test_ret);
18143}
18144
18145
18146static int
18147test_xmlBufferEmpty(void) {
18148    int test_ret = 0;
18149
18150    int mem_base;
18151    xmlBufferPtr buf; /* the buffer */
18152    int n_buf;
18153
18154    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18155        mem_base = xmlMemBlocks();
18156        buf = gen_xmlBufferPtr(n_buf, 0);
18157
18158        xmlBufferEmpty(buf);
18159        call_tests++;
18160        des_xmlBufferPtr(n_buf, buf, 0);
18161        xmlResetLastError();
18162        if (mem_base != xmlMemBlocks()) {
18163            printf("Leak of %d blocks found in xmlBufferEmpty",
18164	           xmlMemBlocks() - mem_base);
18165	    test_ret++;
18166            printf(" %d", n_buf);
18167            printf("\n");
18168        }
18169    }
18170    function_tests++;
18171
18172    return(test_ret);
18173}
18174
18175
18176static int
18177test_xmlBufferGrow(void) {
18178    int test_ret = 0;
18179
18180    int mem_base;
18181    int ret_val;
18182    xmlBufferPtr buf; /* the buffer */
18183    int n_buf;
18184    unsigned int len; /* the minimum free size to allocate */
18185    int n_len;
18186
18187    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18188    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18189        mem_base = xmlMemBlocks();
18190        buf = gen_xmlBufferPtr(n_buf, 0);
18191        len = gen_unsigned_int(n_len, 1);
18192
18193        ret_val = xmlBufferGrow(buf, len);
18194        desret_int(ret_val);
18195        call_tests++;
18196        des_xmlBufferPtr(n_buf, buf, 0);
18197        des_unsigned_int(n_len, len, 1);
18198        xmlResetLastError();
18199        if (mem_base != xmlMemBlocks()) {
18200            printf("Leak of %d blocks found in xmlBufferGrow",
18201	           xmlMemBlocks() - mem_base);
18202	    test_ret++;
18203            printf(" %d", n_buf);
18204            printf(" %d", n_len);
18205            printf("\n");
18206        }
18207    }
18208    }
18209    function_tests++;
18210
18211    return(test_ret);
18212}
18213
18214
18215static int
18216test_xmlBufferLength(void) {
18217    int test_ret = 0;
18218
18219    int mem_base;
18220    int ret_val;
18221    xmlBufferPtr buf; /* the buffer */
18222    int n_buf;
18223
18224    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18225        mem_base = xmlMemBlocks();
18226        buf = gen_const_xmlBufferPtr(n_buf, 0);
18227
18228        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18229        desret_int(ret_val);
18230        call_tests++;
18231        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18232        xmlResetLastError();
18233        if (mem_base != xmlMemBlocks()) {
18234            printf("Leak of %d blocks found in xmlBufferLength",
18235	           xmlMemBlocks() - mem_base);
18236	    test_ret++;
18237            printf(" %d", n_buf);
18238            printf("\n");
18239        }
18240    }
18241    function_tests++;
18242
18243    return(test_ret);
18244}
18245
18246
18247static int
18248test_xmlBufferResize(void) {
18249    int test_ret = 0;
18250
18251    int mem_base;
18252    int ret_val;
18253    xmlBufferPtr buf; /* the buffer to resize */
18254    int n_buf;
18255    unsigned int size; /* the desired size */
18256    int n_size;
18257
18258    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18259    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18260        mem_base = xmlMemBlocks();
18261        buf = gen_xmlBufferPtr(n_buf, 0);
18262        size = gen_unsigned_int(n_size, 1);
18263
18264        ret_val = xmlBufferResize(buf, size);
18265        desret_int(ret_val);
18266        call_tests++;
18267        des_xmlBufferPtr(n_buf, buf, 0);
18268        des_unsigned_int(n_size, size, 1);
18269        xmlResetLastError();
18270        if (mem_base != xmlMemBlocks()) {
18271            printf("Leak of %d blocks found in xmlBufferResize",
18272	           xmlMemBlocks() - mem_base);
18273	    test_ret++;
18274            printf(" %d", n_buf);
18275            printf(" %d", n_size);
18276            printf("\n");
18277        }
18278    }
18279    }
18280    function_tests++;
18281
18282    return(test_ret);
18283}
18284
18285
18286static int
18287test_xmlBufferSetAllocationScheme(void) {
18288    int test_ret = 0;
18289
18290    int mem_base;
18291    xmlBufferPtr buf; /* the buffer to tune */
18292    int n_buf;
18293    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18294    int n_scheme;
18295
18296    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18297    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18298        mem_base = xmlMemBlocks();
18299        buf = gen_xmlBufferPtr(n_buf, 0);
18300        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18301
18302        xmlBufferSetAllocationScheme(buf, scheme);
18303        call_tests++;
18304        des_xmlBufferPtr(n_buf, buf, 0);
18305        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18306        xmlResetLastError();
18307        if (mem_base != xmlMemBlocks()) {
18308            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18309	           xmlMemBlocks() - mem_base);
18310	    test_ret++;
18311            printf(" %d", n_buf);
18312            printf(" %d", n_scheme);
18313            printf("\n");
18314        }
18315    }
18316    }
18317    function_tests++;
18318
18319    return(test_ret);
18320}
18321
18322
18323static int
18324test_xmlBufferShrink(void) {
18325    int test_ret = 0;
18326
18327    int mem_base;
18328    int ret_val;
18329    xmlBufferPtr buf; /* the buffer to dump */
18330    int n_buf;
18331    unsigned int len; /* the number of xmlChar to remove */
18332    int n_len;
18333
18334    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18335    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18336        mem_base = xmlMemBlocks();
18337        buf = gen_xmlBufferPtr(n_buf, 0);
18338        len = gen_unsigned_int(n_len, 1);
18339
18340        ret_val = xmlBufferShrink(buf, len);
18341        desret_int(ret_val);
18342        call_tests++;
18343        des_xmlBufferPtr(n_buf, buf, 0);
18344        des_unsigned_int(n_len, len, 1);
18345        xmlResetLastError();
18346        if (mem_base != xmlMemBlocks()) {
18347            printf("Leak of %d blocks found in xmlBufferShrink",
18348	           xmlMemBlocks() - mem_base);
18349	    test_ret++;
18350            printf(" %d", n_buf);
18351            printf(" %d", n_len);
18352            printf("\n");
18353        }
18354    }
18355    }
18356    function_tests++;
18357
18358    return(test_ret);
18359}
18360
18361
18362static int
18363test_xmlBufferWriteCHAR(void) {
18364    int test_ret = 0;
18365
18366    int mem_base;
18367    xmlBufferPtr buf; /* the XML buffer */
18368    int n_buf;
18369    xmlChar * string; /* the string to add */
18370    int n_string;
18371
18372    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18373    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18374        mem_base = xmlMemBlocks();
18375        buf = gen_xmlBufferPtr(n_buf, 0);
18376        string = gen_const_xmlChar_ptr(n_string, 1);
18377
18378        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18379        call_tests++;
18380        des_xmlBufferPtr(n_buf, buf, 0);
18381        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18382        xmlResetLastError();
18383        if (mem_base != xmlMemBlocks()) {
18384            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18385	           xmlMemBlocks() - mem_base);
18386	    test_ret++;
18387            printf(" %d", n_buf);
18388            printf(" %d", n_string);
18389            printf("\n");
18390        }
18391    }
18392    }
18393    function_tests++;
18394
18395    return(test_ret);
18396}
18397
18398
18399static int
18400test_xmlBufferWriteChar(void) {
18401    int test_ret = 0;
18402
18403    int mem_base;
18404    xmlBufferPtr buf; /* the XML buffer output */
18405    int n_buf;
18406    char * string; /* the string to add */
18407    int n_string;
18408
18409    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18410    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18411        mem_base = xmlMemBlocks();
18412        buf = gen_xmlBufferPtr(n_buf, 0);
18413        string = gen_const_char_ptr(n_string, 1);
18414
18415        xmlBufferWriteChar(buf, (const char *)string);
18416        call_tests++;
18417        des_xmlBufferPtr(n_buf, buf, 0);
18418        des_const_char_ptr(n_string, (const char *)string, 1);
18419        xmlResetLastError();
18420        if (mem_base != xmlMemBlocks()) {
18421            printf("Leak of %d blocks found in xmlBufferWriteChar",
18422	           xmlMemBlocks() - mem_base);
18423	    test_ret++;
18424            printf(" %d", n_buf);
18425            printf(" %d", n_string);
18426            printf("\n");
18427        }
18428    }
18429    }
18430    function_tests++;
18431
18432    return(test_ret);
18433}
18434
18435
18436static int
18437test_xmlBufferWriteQuotedString(void) {
18438    int test_ret = 0;
18439
18440    int mem_base;
18441    xmlBufferPtr buf; /* the XML buffer output */
18442    int n_buf;
18443    xmlChar * string; /* the string to add */
18444    int n_string;
18445
18446    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18447    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18448        mem_base = xmlMemBlocks();
18449        buf = gen_xmlBufferPtr(n_buf, 0);
18450        string = gen_const_xmlChar_ptr(n_string, 1);
18451
18452        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18453        call_tests++;
18454        des_xmlBufferPtr(n_buf, buf, 0);
18455        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18456        xmlResetLastError();
18457        if (mem_base != xmlMemBlocks()) {
18458            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18459	           xmlMemBlocks() - mem_base);
18460	    test_ret++;
18461            printf(" %d", n_buf);
18462            printf(" %d", n_string);
18463            printf("\n");
18464        }
18465    }
18466    }
18467    function_tests++;
18468
18469    return(test_ret);
18470}
18471
18472
18473static int
18474test_xmlBuildQName(void) {
18475    int test_ret = 0;
18476
18477    int mem_base;
18478    xmlChar * ret_val;
18479    xmlChar * ncname; /* the Name */
18480    int n_ncname;
18481    xmlChar * prefix; /* the prefix */
18482    int n_prefix;
18483    xmlChar * memory; /* preallocated memory */
18484    int n_memory;
18485    int len; /* preallocated memory length */
18486    int n_len;
18487
18488    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18489    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18490    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18491    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18492        mem_base = xmlMemBlocks();
18493        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18494        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18495        memory = gen_xmlChar_ptr(n_memory, 2);
18496        len = gen_int(n_len, 3);
18497
18498        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18499        if ((ret_val != NULL) && (ret_val != ncname) &&
18500              (ret_val != prefix) && (ret_val != memory))
18501              xmlFree(ret_val);
18502	  ret_val = NULL;
18503        desret_xmlChar_ptr(ret_val);
18504        call_tests++;
18505        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18506        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18507        des_xmlChar_ptr(n_memory, memory, 2);
18508        des_int(n_len, len, 3);
18509        xmlResetLastError();
18510        if (mem_base != xmlMemBlocks()) {
18511            printf("Leak of %d blocks found in xmlBuildQName",
18512	           xmlMemBlocks() - mem_base);
18513	    test_ret++;
18514            printf(" %d", n_ncname);
18515            printf(" %d", n_prefix);
18516            printf(" %d", n_memory);
18517            printf(" %d", n_len);
18518            printf("\n");
18519        }
18520    }
18521    }
18522    }
18523    }
18524    function_tests++;
18525
18526    return(test_ret);
18527}
18528
18529
18530static int
18531test_xmlCopyDoc(void) {
18532    int test_ret = 0;
18533
18534#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18535    int mem_base;
18536    xmlDocPtr ret_val;
18537    xmlDocPtr doc; /* the document */
18538    int n_doc;
18539    int recursive; /* if not zero do a recursive copy. */
18540    int n_recursive;
18541
18542    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18543    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18544        mem_base = xmlMemBlocks();
18545        doc = gen_xmlDocPtr(n_doc, 0);
18546        recursive = gen_int(n_recursive, 1);
18547
18548        ret_val = xmlCopyDoc(doc, recursive);
18549        desret_xmlDocPtr(ret_val);
18550        call_tests++;
18551        des_xmlDocPtr(n_doc, doc, 0);
18552        des_int(n_recursive, recursive, 1);
18553        xmlResetLastError();
18554        if (mem_base != xmlMemBlocks()) {
18555            printf("Leak of %d blocks found in xmlCopyDoc",
18556	           xmlMemBlocks() - mem_base);
18557	    test_ret++;
18558            printf(" %d", n_doc);
18559            printf(" %d", n_recursive);
18560            printf("\n");
18561        }
18562    }
18563    }
18564    function_tests++;
18565#endif
18566
18567    return(test_ret);
18568}
18569
18570
18571static int
18572test_xmlCopyDtd(void) {
18573    int test_ret = 0;
18574
18575#if defined(LIBXML_TREE_ENABLED)
18576    int mem_base;
18577    xmlDtdPtr ret_val;
18578    xmlDtdPtr dtd; /* the dtd */
18579    int n_dtd;
18580
18581    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18582        mem_base = xmlMemBlocks();
18583        dtd = gen_xmlDtdPtr(n_dtd, 0);
18584
18585        ret_val = xmlCopyDtd(dtd);
18586        desret_xmlDtdPtr(ret_val);
18587        call_tests++;
18588        des_xmlDtdPtr(n_dtd, dtd, 0);
18589        xmlResetLastError();
18590        if (mem_base != xmlMemBlocks()) {
18591            printf("Leak of %d blocks found in xmlCopyDtd",
18592	           xmlMemBlocks() - mem_base);
18593	    test_ret++;
18594            printf(" %d", n_dtd);
18595            printf("\n");
18596        }
18597    }
18598    function_tests++;
18599#endif
18600
18601    return(test_ret);
18602}
18603
18604
18605static int
18606test_xmlCopyNamespace(void) {
18607    int test_ret = 0;
18608
18609    int mem_base;
18610    xmlNsPtr ret_val;
18611    xmlNsPtr cur; /* the namespace */
18612    int n_cur;
18613
18614    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18615        mem_base = xmlMemBlocks();
18616        cur = gen_xmlNsPtr(n_cur, 0);
18617
18618        ret_val = xmlCopyNamespace(cur);
18619        if (ret_val != NULL) xmlFreeNs(ret_val);
18620        desret_xmlNsPtr(ret_val);
18621        call_tests++;
18622        des_xmlNsPtr(n_cur, cur, 0);
18623        xmlResetLastError();
18624        if (mem_base != xmlMemBlocks()) {
18625            printf("Leak of %d blocks found in xmlCopyNamespace",
18626	           xmlMemBlocks() - mem_base);
18627	    test_ret++;
18628            printf(" %d", n_cur);
18629            printf("\n");
18630        }
18631    }
18632    function_tests++;
18633
18634    return(test_ret);
18635}
18636
18637
18638static int
18639test_xmlCopyNamespaceList(void) {
18640    int test_ret = 0;
18641
18642    int mem_base;
18643    xmlNsPtr ret_val;
18644    xmlNsPtr cur; /* the first namespace */
18645    int n_cur;
18646
18647    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18648        mem_base = xmlMemBlocks();
18649        cur = gen_xmlNsPtr(n_cur, 0);
18650
18651        ret_val = xmlCopyNamespaceList(cur);
18652        if (ret_val != NULL) xmlFreeNsList(ret_val);
18653        desret_xmlNsPtr(ret_val);
18654        call_tests++;
18655        des_xmlNsPtr(n_cur, cur, 0);
18656        xmlResetLastError();
18657        if (mem_base != xmlMemBlocks()) {
18658            printf("Leak of %d blocks found in xmlCopyNamespaceList",
18659	           xmlMemBlocks() - mem_base);
18660	    test_ret++;
18661            printf(" %d", n_cur);
18662            printf("\n");
18663        }
18664    }
18665    function_tests++;
18666
18667    return(test_ret);
18668}
18669
18670
18671static int
18672test_xmlCopyNode(void) {
18673    int test_ret = 0;
18674
18675    int mem_base;
18676    xmlNodePtr ret_val;
18677    xmlNodePtr node; /* the node */
18678    int n_node;
18679    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18680    int n_extended;
18681
18682    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18683    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18684        mem_base = xmlMemBlocks();
18685        node = gen_const_xmlNodePtr(n_node, 0);
18686        extended = gen_int(n_extended, 1);
18687
18688        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
18689        desret_xmlNodePtr(ret_val);
18690        call_tests++;
18691        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18692        des_int(n_extended, extended, 1);
18693        xmlResetLastError();
18694        if (mem_base != xmlMemBlocks()) {
18695            printf("Leak of %d blocks found in xmlCopyNode",
18696	           xmlMemBlocks() - mem_base);
18697	    test_ret++;
18698            printf(" %d", n_node);
18699            printf(" %d", n_extended);
18700            printf("\n");
18701        }
18702    }
18703    }
18704    function_tests++;
18705
18706    return(test_ret);
18707}
18708
18709
18710static int
18711test_xmlCopyNodeList(void) {
18712    int test_ret = 0;
18713
18714    int mem_base;
18715    xmlNodePtr ret_val;
18716    xmlNodePtr node; /* the first node in the list. */
18717    int n_node;
18718
18719    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18720        mem_base = xmlMemBlocks();
18721        node = gen_const_xmlNodePtr(n_node, 0);
18722
18723        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
18724        desret_xmlNodePtr(ret_val);
18725        call_tests++;
18726        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18727        xmlResetLastError();
18728        if (mem_base != xmlMemBlocks()) {
18729            printf("Leak of %d blocks found in xmlCopyNodeList",
18730	           xmlMemBlocks() - mem_base);
18731	    test_ret++;
18732            printf(" %d", n_node);
18733            printf("\n");
18734        }
18735    }
18736    function_tests++;
18737
18738    return(test_ret);
18739}
18740
18741
18742static int
18743test_xmlCopyProp(void) {
18744    int test_ret = 0;
18745
18746    int mem_base;
18747    xmlAttrPtr ret_val;
18748    xmlNodePtr target; /* the element where the attribute will be grafted */
18749    int n_target;
18750    xmlAttrPtr cur; /* the attribute */
18751    int n_cur;
18752
18753    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18754    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18755        mem_base = xmlMemBlocks();
18756        target = gen_xmlNodePtr(n_target, 0);
18757        cur = gen_xmlAttrPtr(n_cur, 1);
18758
18759        ret_val = xmlCopyProp(target, cur);
18760        desret_xmlAttrPtr(ret_val);
18761        call_tests++;
18762        des_xmlNodePtr(n_target, target, 0);
18763        des_xmlAttrPtr(n_cur, cur, 1);
18764        xmlResetLastError();
18765        if (mem_base != xmlMemBlocks()) {
18766            printf("Leak of %d blocks found in xmlCopyProp",
18767	           xmlMemBlocks() - mem_base);
18768	    test_ret++;
18769            printf(" %d", n_target);
18770            printf(" %d", n_cur);
18771            printf("\n");
18772        }
18773    }
18774    }
18775    function_tests++;
18776
18777    return(test_ret);
18778}
18779
18780
18781static int
18782test_xmlCopyPropList(void) {
18783    int test_ret = 0;
18784
18785    int mem_base;
18786    xmlAttrPtr ret_val;
18787    xmlNodePtr target; /* the element where the attributes will be grafted */
18788    int n_target;
18789    xmlAttrPtr cur; /* the first attribute */
18790    int n_cur;
18791
18792    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18793    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18794        mem_base = xmlMemBlocks();
18795        target = gen_xmlNodePtr(n_target, 0);
18796        cur = gen_xmlAttrPtr(n_cur, 1);
18797
18798        ret_val = xmlCopyPropList(target, cur);
18799        desret_xmlAttrPtr(ret_val);
18800        call_tests++;
18801        des_xmlNodePtr(n_target, target, 0);
18802        des_xmlAttrPtr(n_cur, cur, 1);
18803        xmlResetLastError();
18804        if (mem_base != xmlMemBlocks()) {
18805            printf("Leak of %d blocks found in xmlCopyPropList",
18806	           xmlMemBlocks() - mem_base);
18807	    test_ret++;
18808            printf(" %d", n_target);
18809            printf(" %d", n_cur);
18810            printf("\n");
18811        }
18812    }
18813    }
18814    function_tests++;
18815
18816    return(test_ret);
18817}
18818
18819
18820static int
18821test_xmlCreateIntSubset(void) {
18822    int test_ret = 0;
18823
18824    int mem_base;
18825    xmlDtdPtr ret_val;
18826    xmlDocPtr doc; /* the document pointer */
18827    int n_doc;
18828    xmlChar * name; /* the DTD name */
18829    int n_name;
18830    xmlChar * ExternalID; /* the external (PUBLIC) ID */
18831    int n_ExternalID;
18832    xmlChar * SystemID; /* the system ID */
18833    int n_SystemID;
18834
18835    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18836    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
18837    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
18838    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
18839        mem_base = xmlMemBlocks();
18840        doc = gen_xmlDocPtr(n_doc, 0);
18841        name = gen_const_xmlChar_ptr(n_name, 1);
18842        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
18843        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
18844
18845        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
18846        desret_xmlDtdPtr(ret_val);
18847        call_tests++;
18848        des_xmlDocPtr(n_doc, doc, 0);
18849        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
18850        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
18851        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
18852        xmlResetLastError();
18853        if (mem_base != xmlMemBlocks()) {
18854            printf("Leak of %d blocks found in xmlCreateIntSubset",
18855	           xmlMemBlocks() - mem_base);
18856	    test_ret++;
18857            printf(" %d", n_doc);
18858            printf(" %d", n_name);
18859            printf(" %d", n_ExternalID);
18860            printf(" %d", n_SystemID);
18861            printf("\n");
18862        }
18863    }
18864    }
18865    }
18866    }
18867    function_tests++;
18868
18869    return(test_ret);
18870}
18871
18872
18873static int
18874test_xmlDocCopyNode(void) {
18875    int test_ret = 0;
18876
18877    int mem_base;
18878    xmlNodePtr ret_val;
18879    xmlNodePtr node; /* the node */
18880    int n_node;
18881    xmlDocPtr doc; /* the document */
18882    int n_doc;
18883    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18884    int n_extended;
18885
18886    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18887    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18888    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18889        mem_base = xmlMemBlocks();
18890        node = gen_const_xmlNodePtr(n_node, 0);
18891        doc = gen_xmlDocPtr(n_doc, 1);
18892        extended = gen_int(n_extended, 2);
18893
18894        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
18895        desret_xmlNodePtr(ret_val);
18896        call_tests++;
18897        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18898        des_xmlDocPtr(n_doc, doc, 1);
18899        des_int(n_extended, extended, 2);
18900        xmlResetLastError();
18901        if (mem_base != xmlMemBlocks()) {
18902            printf("Leak of %d blocks found in xmlDocCopyNode",
18903	           xmlMemBlocks() - mem_base);
18904	    test_ret++;
18905            printf(" %d", n_node);
18906            printf(" %d", n_doc);
18907            printf(" %d", n_extended);
18908            printf("\n");
18909        }
18910    }
18911    }
18912    }
18913    function_tests++;
18914
18915    return(test_ret);
18916}
18917
18918
18919static int
18920test_xmlDocCopyNodeList(void) {
18921    int test_ret = 0;
18922
18923    int mem_base;
18924    xmlNodePtr ret_val;
18925    xmlDocPtr doc; /* the target document */
18926    int n_doc;
18927    xmlNodePtr node; /* the first node in the list. */
18928    int n_node;
18929
18930    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18931    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18932        mem_base = xmlMemBlocks();
18933        doc = gen_xmlDocPtr(n_doc, 0);
18934        node = gen_const_xmlNodePtr(n_node, 1);
18935
18936        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
18937        desret_xmlNodePtr(ret_val);
18938        call_tests++;
18939        des_xmlDocPtr(n_doc, doc, 0);
18940        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
18941        xmlResetLastError();
18942        if (mem_base != xmlMemBlocks()) {
18943            printf("Leak of %d blocks found in xmlDocCopyNodeList",
18944	           xmlMemBlocks() - mem_base);
18945	    test_ret++;
18946            printf(" %d", n_doc);
18947            printf(" %d", n_node);
18948            printf("\n");
18949        }
18950    }
18951    }
18952    function_tests++;
18953
18954    return(test_ret);
18955}
18956
18957
18958static int
18959test_xmlDocDump(void) {
18960    int test_ret = 0;
18961
18962#if defined(LIBXML_OUTPUT_ENABLED)
18963    int mem_base;
18964    int ret_val;
18965    FILE * f; /* the FILE* */
18966    int n_f;
18967    xmlDocPtr cur; /* the document */
18968    int n_cur;
18969
18970    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
18971    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18972        mem_base = xmlMemBlocks();
18973        f = gen_FILE_ptr(n_f, 0);
18974        cur = gen_xmlDocPtr(n_cur, 1);
18975
18976        ret_val = xmlDocDump(f, cur);
18977        desret_int(ret_val);
18978        call_tests++;
18979        des_FILE_ptr(n_f, f, 0);
18980        des_xmlDocPtr(n_cur, cur, 1);
18981        xmlResetLastError();
18982        if (mem_base != xmlMemBlocks()) {
18983            printf("Leak of %d blocks found in xmlDocDump",
18984	           xmlMemBlocks() - mem_base);
18985	    test_ret++;
18986            printf(" %d", n_f);
18987            printf(" %d", n_cur);
18988            printf("\n");
18989        }
18990    }
18991    }
18992    function_tests++;
18993#endif
18994
18995    return(test_ret);
18996}
18997
18998
18999static int
19000test_xmlDocDumpFormatMemory(void) {
19001    int test_ret = 0;
19002
19003#if defined(LIBXML_OUTPUT_ENABLED)
19004    int mem_base;
19005    xmlDocPtr cur; /* the document */
19006    int n_cur;
19007    xmlChar ** mem; /* OUT: the memory pointer */
19008    int n_mem;
19009    int * size; /* OUT: the memory length */
19010    int n_size;
19011    int format; /* should formatting spaces been added */
19012    int n_format;
19013
19014    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19015    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19016    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19017    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19018        mem_base = xmlMemBlocks();
19019        cur = gen_xmlDocPtr(n_cur, 0);
19020        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19021        size = gen_int_ptr(n_size, 2);
19022        format = gen_int(n_format, 3);
19023
19024        xmlDocDumpFormatMemory(cur, mem, size, format);
19025        call_tests++;
19026        des_xmlDocPtr(n_cur, cur, 0);
19027        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19028        des_int_ptr(n_size, size, 2);
19029        des_int(n_format, format, 3);
19030        xmlResetLastError();
19031        if (mem_base != xmlMemBlocks()) {
19032            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19033	           xmlMemBlocks() - mem_base);
19034	    test_ret++;
19035            printf(" %d", n_cur);
19036            printf(" %d", n_mem);
19037            printf(" %d", n_size);
19038            printf(" %d", n_format);
19039            printf("\n");
19040        }
19041    }
19042    }
19043    }
19044    }
19045    function_tests++;
19046#endif
19047
19048    return(test_ret);
19049}
19050
19051
19052static int
19053test_xmlDocDumpFormatMemoryEnc(void) {
19054    int test_ret = 0;
19055
19056#if defined(LIBXML_OUTPUT_ENABLED)
19057    int mem_base;
19058    xmlDocPtr out_doc; /* Document to generate XML text from */
19059    int n_out_doc;
19060    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19061    int n_doc_txt_ptr;
19062    int * doc_txt_len; /* Length of the generated XML text */
19063    int n_doc_txt_len;
19064    char * txt_encoding; /* Character encoding to use when generating XML text */
19065    int n_txt_encoding;
19066    int format; /* should formatting spaces been added */
19067    int n_format;
19068
19069    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19070    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19071    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19072    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19073    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19074        mem_base = xmlMemBlocks();
19075        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19076        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19077        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19078        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19079        format = gen_int(n_format, 4);
19080
19081        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19082        call_tests++;
19083        des_xmlDocPtr(n_out_doc, out_doc, 0);
19084        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19085        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19086        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19087        des_int(n_format, format, 4);
19088        xmlResetLastError();
19089        if (mem_base != xmlMemBlocks()) {
19090            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19091	           xmlMemBlocks() - mem_base);
19092	    test_ret++;
19093            printf(" %d", n_out_doc);
19094            printf(" %d", n_doc_txt_ptr);
19095            printf(" %d", n_doc_txt_len);
19096            printf(" %d", n_txt_encoding);
19097            printf(" %d", n_format);
19098            printf("\n");
19099        }
19100    }
19101    }
19102    }
19103    }
19104    }
19105    function_tests++;
19106#endif
19107
19108    return(test_ret);
19109}
19110
19111
19112static int
19113test_xmlDocDumpMemory(void) {
19114    int test_ret = 0;
19115
19116#if defined(LIBXML_OUTPUT_ENABLED)
19117    int mem_base;
19118    xmlDocPtr cur; /* the document */
19119    int n_cur;
19120    xmlChar ** mem; /* OUT: the memory pointer */
19121    int n_mem;
19122    int * size; /* OUT: the memory length */
19123    int n_size;
19124
19125    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19126    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19127    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19128        mem_base = xmlMemBlocks();
19129        cur = gen_xmlDocPtr(n_cur, 0);
19130        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19131        size = gen_int_ptr(n_size, 2);
19132
19133        xmlDocDumpMemory(cur, mem, size);
19134        call_tests++;
19135        des_xmlDocPtr(n_cur, cur, 0);
19136        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19137        des_int_ptr(n_size, size, 2);
19138        xmlResetLastError();
19139        if (mem_base != xmlMemBlocks()) {
19140            printf("Leak of %d blocks found in xmlDocDumpMemory",
19141	           xmlMemBlocks() - mem_base);
19142	    test_ret++;
19143            printf(" %d", n_cur);
19144            printf(" %d", n_mem);
19145            printf(" %d", n_size);
19146            printf("\n");
19147        }
19148    }
19149    }
19150    }
19151    function_tests++;
19152#endif
19153
19154    return(test_ret);
19155}
19156
19157
19158static int
19159test_xmlDocDumpMemoryEnc(void) {
19160    int test_ret = 0;
19161
19162#if defined(LIBXML_OUTPUT_ENABLED)
19163    int mem_base;
19164    xmlDocPtr out_doc; /* Document to generate XML text from */
19165    int n_out_doc;
19166    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19167    int n_doc_txt_ptr;
19168    int * doc_txt_len; /* Length of the generated XML text */
19169    int n_doc_txt_len;
19170    char * txt_encoding; /* Character encoding to use when generating XML text */
19171    int n_txt_encoding;
19172
19173    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19174    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19175    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19176    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19177        mem_base = xmlMemBlocks();
19178        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19179        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19180        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19181        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19182
19183        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19184        call_tests++;
19185        des_xmlDocPtr(n_out_doc, out_doc, 0);
19186        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19187        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19188        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19189        xmlResetLastError();
19190        if (mem_base != xmlMemBlocks()) {
19191            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19192	           xmlMemBlocks() - mem_base);
19193	    test_ret++;
19194            printf(" %d", n_out_doc);
19195            printf(" %d", n_doc_txt_ptr);
19196            printf(" %d", n_doc_txt_len);
19197            printf(" %d", n_txt_encoding);
19198            printf("\n");
19199        }
19200    }
19201    }
19202    }
19203    }
19204    function_tests++;
19205#endif
19206
19207    return(test_ret);
19208}
19209
19210
19211static int
19212test_xmlDocFormatDump(void) {
19213    int test_ret = 0;
19214
19215#if defined(LIBXML_OUTPUT_ENABLED)
19216    int mem_base;
19217    int ret_val;
19218    FILE * f; /* the FILE* */
19219    int n_f;
19220    xmlDocPtr cur; /* the document */
19221    int n_cur;
19222    int format; /* should formatting spaces been added */
19223    int n_format;
19224
19225    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19226    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19227    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19228        mem_base = xmlMemBlocks();
19229        f = gen_FILE_ptr(n_f, 0);
19230        cur = gen_xmlDocPtr(n_cur, 1);
19231        format = gen_int(n_format, 2);
19232
19233        ret_val = xmlDocFormatDump(f, cur, format);
19234        desret_int(ret_val);
19235        call_tests++;
19236        des_FILE_ptr(n_f, f, 0);
19237        des_xmlDocPtr(n_cur, cur, 1);
19238        des_int(n_format, format, 2);
19239        xmlResetLastError();
19240        if (mem_base != xmlMemBlocks()) {
19241            printf("Leak of %d blocks found in xmlDocFormatDump",
19242	           xmlMemBlocks() - mem_base);
19243	    test_ret++;
19244            printf(" %d", n_f);
19245            printf(" %d", n_cur);
19246            printf(" %d", n_format);
19247            printf("\n");
19248        }
19249    }
19250    }
19251    }
19252    function_tests++;
19253#endif
19254
19255    return(test_ret);
19256}
19257
19258
19259static int
19260test_xmlDocGetRootElement(void) {
19261    int test_ret = 0;
19262
19263    int mem_base;
19264    xmlNodePtr ret_val;
19265    xmlDocPtr doc; /* the document */
19266    int n_doc;
19267
19268    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19269        mem_base = xmlMemBlocks();
19270        doc = gen_xmlDocPtr(n_doc, 0);
19271
19272        ret_val = xmlDocGetRootElement(doc);
19273        desret_xmlNodePtr(ret_val);
19274        call_tests++;
19275        des_xmlDocPtr(n_doc, doc, 0);
19276        xmlResetLastError();
19277        if (mem_base != xmlMemBlocks()) {
19278            printf("Leak of %d blocks found in xmlDocGetRootElement",
19279	           xmlMemBlocks() - mem_base);
19280	    test_ret++;
19281            printf(" %d", n_doc);
19282            printf("\n");
19283        }
19284    }
19285    function_tests++;
19286
19287    return(test_ret);
19288}
19289
19290
19291static int
19292test_xmlDocSetRootElement(void) {
19293    int test_ret = 0;
19294
19295#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
19296    int mem_base;
19297    xmlNodePtr ret_val;
19298    xmlDocPtr doc; /* the document */
19299    int n_doc;
19300    xmlNodePtr root; /* the new document root element */
19301    int n_root;
19302
19303    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19304    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
19305        mem_base = xmlMemBlocks();
19306        doc = gen_xmlDocPtr(n_doc, 0);
19307        root = gen_xmlNodePtr_in(n_root, 1);
19308
19309        ret_val = xmlDocSetRootElement(doc, root);
19310        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
19311        desret_xmlNodePtr(ret_val);
19312        call_tests++;
19313        des_xmlDocPtr(n_doc, doc, 0);
19314        des_xmlNodePtr_in(n_root, root, 1);
19315        xmlResetLastError();
19316        if (mem_base != xmlMemBlocks()) {
19317            printf("Leak of %d blocks found in xmlDocSetRootElement",
19318	           xmlMemBlocks() - mem_base);
19319	    test_ret++;
19320            printf(" %d", n_doc);
19321            printf(" %d", n_root);
19322            printf("\n");
19323        }
19324    }
19325    }
19326    function_tests++;
19327#endif
19328
19329    return(test_ret);
19330}
19331
19332
19333static int
19334test_xmlElemDump(void) {
19335    int test_ret = 0;
19336
19337#if defined(LIBXML_OUTPUT_ENABLED)
19338    int mem_base;
19339    FILE * f; /* the FILE * for the output */
19340    int n_f;
19341    xmlDocPtr doc; /* the document */
19342    int n_doc;
19343    xmlNodePtr cur; /* the current node */
19344    int n_cur;
19345
19346    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19347    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19348    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
19349        mem_base = xmlMemBlocks();
19350        f = gen_FILE_ptr(n_f, 0);
19351        doc = gen_xmlDocPtr(n_doc, 1);
19352        cur = gen_xmlNodePtr(n_cur, 2);
19353
19354        xmlElemDump(f, doc, cur);
19355        call_tests++;
19356        des_FILE_ptr(n_f, f, 0);
19357        des_xmlDocPtr(n_doc, doc, 1);
19358        des_xmlNodePtr(n_cur, cur, 2);
19359        xmlResetLastError();
19360        if (mem_base != xmlMemBlocks()) {
19361            printf("Leak of %d blocks found in xmlElemDump",
19362	           xmlMemBlocks() - mem_base);
19363	    test_ret++;
19364            printf(" %d", n_f);
19365            printf(" %d", n_doc);
19366            printf(" %d", n_cur);
19367            printf("\n");
19368        }
19369    }
19370    }
19371    }
19372    function_tests++;
19373#endif
19374
19375    return(test_ret);
19376}
19377
19378
19379static int
19380test_xmlGetBufferAllocationScheme(void) {
19381    int test_ret = 0;
19382
19383    int mem_base;
19384    xmlBufferAllocationScheme ret_val;
19385
19386        mem_base = xmlMemBlocks();
19387
19388        ret_val = xmlGetBufferAllocationScheme();
19389        desret_xmlBufferAllocationScheme(ret_val);
19390        call_tests++;
19391        xmlResetLastError();
19392        if (mem_base != xmlMemBlocks()) {
19393            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
19394	           xmlMemBlocks() - mem_base);
19395	    test_ret++;
19396            printf("\n");
19397        }
19398    function_tests++;
19399
19400    return(test_ret);
19401}
19402
19403
19404static int
19405test_xmlGetCompressMode(void) {
19406    int test_ret = 0;
19407
19408    int mem_base;
19409    int ret_val;
19410
19411        mem_base = xmlMemBlocks();
19412
19413        ret_val = xmlGetCompressMode();
19414        desret_int(ret_val);
19415        call_tests++;
19416        xmlResetLastError();
19417        if (mem_base != xmlMemBlocks()) {
19418            printf("Leak of %d blocks found in xmlGetCompressMode",
19419	           xmlMemBlocks() - mem_base);
19420	    test_ret++;
19421            printf("\n");
19422        }
19423    function_tests++;
19424
19425    return(test_ret);
19426}
19427
19428
19429static int
19430test_xmlGetDocCompressMode(void) {
19431    int test_ret = 0;
19432
19433    int mem_base;
19434    int ret_val;
19435    xmlDocPtr doc; /* the document */
19436    int n_doc;
19437
19438    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19439        mem_base = xmlMemBlocks();
19440        doc = gen_xmlDocPtr(n_doc, 0);
19441
19442        ret_val = xmlGetDocCompressMode(doc);
19443        desret_int(ret_val);
19444        call_tests++;
19445        des_xmlDocPtr(n_doc, doc, 0);
19446        xmlResetLastError();
19447        if (mem_base != xmlMemBlocks()) {
19448            printf("Leak of %d blocks found in xmlGetDocCompressMode",
19449	           xmlMemBlocks() - mem_base);
19450	    test_ret++;
19451            printf(" %d", n_doc);
19452            printf("\n");
19453        }
19454    }
19455    function_tests++;
19456
19457    return(test_ret);
19458}
19459
19460
19461static int
19462test_xmlGetIntSubset(void) {
19463    int test_ret = 0;
19464
19465    int mem_base;
19466    xmlDtdPtr ret_val;
19467    xmlDocPtr doc; /* the document pointer */
19468    int n_doc;
19469
19470    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19471        mem_base = xmlMemBlocks();
19472        doc = gen_xmlDocPtr(n_doc, 0);
19473
19474        ret_val = xmlGetIntSubset(doc);
19475        desret_xmlDtdPtr(ret_val);
19476        call_tests++;
19477        des_xmlDocPtr(n_doc, doc, 0);
19478        xmlResetLastError();
19479        if (mem_base != xmlMemBlocks()) {
19480            printf("Leak of %d blocks found in xmlGetIntSubset",
19481	           xmlMemBlocks() - mem_base);
19482	    test_ret++;
19483            printf(" %d", n_doc);
19484            printf("\n");
19485        }
19486    }
19487    function_tests++;
19488
19489    return(test_ret);
19490}
19491
19492
19493static int
19494test_xmlGetLastChild(void) {
19495    int test_ret = 0;
19496
19497    int mem_base;
19498    xmlNodePtr ret_val;
19499    xmlNodePtr parent; /* the parent node */
19500    int n_parent;
19501
19502    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19503        mem_base = xmlMemBlocks();
19504        parent = gen_xmlNodePtr(n_parent, 0);
19505
19506        ret_val = xmlGetLastChild(parent);
19507        desret_xmlNodePtr(ret_val);
19508        call_tests++;
19509        des_xmlNodePtr(n_parent, parent, 0);
19510        xmlResetLastError();
19511        if (mem_base != xmlMemBlocks()) {
19512            printf("Leak of %d blocks found in xmlGetLastChild",
19513	           xmlMemBlocks() - mem_base);
19514	    test_ret++;
19515            printf(" %d", n_parent);
19516            printf("\n");
19517        }
19518    }
19519    function_tests++;
19520
19521    return(test_ret);
19522}
19523
19524
19525static int
19526test_xmlGetLineNo(void) {
19527    int test_ret = 0;
19528
19529    int mem_base;
19530    long ret_val;
19531    xmlNodePtr node; /* valid node */
19532    int n_node;
19533
19534    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19535        mem_base = xmlMemBlocks();
19536        node = gen_xmlNodePtr(n_node, 0);
19537
19538        ret_val = xmlGetLineNo(node);
19539        desret_long(ret_val);
19540        call_tests++;
19541        des_xmlNodePtr(n_node, node, 0);
19542        xmlResetLastError();
19543        if (mem_base != xmlMemBlocks()) {
19544            printf("Leak of %d blocks found in xmlGetLineNo",
19545	           xmlMemBlocks() - mem_base);
19546	    test_ret++;
19547            printf(" %d", n_node);
19548            printf("\n");
19549        }
19550    }
19551    function_tests++;
19552
19553    return(test_ret);
19554}
19555
19556
19557static int
19558test_xmlGetNoNsProp(void) {
19559    int test_ret = 0;
19560
19561    int mem_base;
19562    xmlChar * ret_val;
19563    xmlNodePtr node; /* the node */
19564    int n_node;
19565    xmlChar * name; /* the attribute name */
19566    int n_name;
19567
19568    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19569    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19570        mem_base = xmlMemBlocks();
19571        node = gen_xmlNodePtr(n_node, 0);
19572        name = gen_const_xmlChar_ptr(n_name, 1);
19573
19574        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
19575        desret_xmlChar_ptr(ret_val);
19576        call_tests++;
19577        des_xmlNodePtr(n_node, node, 0);
19578        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19579        xmlResetLastError();
19580        if (mem_base != xmlMemBlocks()) {
19581            printf("Leak of %d blocks found in xmlGetNoNsProp",
19582	           xmlMemBlocks() - mem_base);
19583	    test_ret++;
19584            printf(" %d", n_node);
19585            printf(" %d", n_name);
19586            printf("\n");
19587        }
19588    }
19589    }
19590    function_tests++;
19591
19592    return(test_ret);
19593}
19594
19595
19596static int
19597test_xmlGetNodePath(void) {
19598    int test_ret = 0;
19599
19600#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
19601    int mem_base;
19602    xmlChar * ret_val;
19603    xmlNodePtr node; /* a node */
19604    int n_node;
19605
19606    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19607        mem_base = xmlMemBlocks();
19608        node = gen_xmlNodePtr(n_node, 0);
19609
19610        ret_val = xmlGetNodePath(node);
19611        desret_xmlChar_ptr(ret_val);
19612        call_tests++;
19613        des_xmlNodePtr(n_node, node, 0);
19614        xmlResetLastError();
19615        if (mem_base != xmlMemBlocks()) {
19616            printf("Leak of %d blocks found in xmlGetNodePath",
19617	           xmlMemBlocks() - mem_base);
19618	    test_ret++;
19619            printf(" %d", n_node);
19620            printf("\n");
19621        }
19622    }
19623    function_tests++;
19624#endif
19625
19626    return(test_ret);
19627}
19628
19629
19630static int
19631test_xmlGetNsList(void) {
19632    int test_ret = 0;
19633
19634
19635    /* missing type support */
19636    return(test_ret);
19637}
19638
19639
19640static int
19641test_xmlGetNsProp(void) {
19642    int test_ret = 0;
19643
19644    int mem_base;
19645    xmlChar * ret_val;
19646    xmlNodePtr node; /* the node */
19647    int n_node;
19648    xmlChar * name; /* the attribute name */
19649    int n_name;
19650    xmlChar * nameSpace; /* the URI of the namespace */
19651    int n_nameSpace;
19652
19653    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19654    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19655    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19656        mem_base = xmlMemBlocks();
19657        node = gen_xmlNodePtr(n_node, 0);
19658        name = gen_const_xmlChar_ptr(n_name, 1);
19659        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
19660
19661        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
19662        desret_xmlChar_ptr(ret_val);
19663        call_tests++;
19664        des_xmlNodePtr(n_node, node, 0);
19665        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19666        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
19667        xmlResetLastError();
19668        if (mem_base != xmlMemBlocks()) {
19669            printf("Leak of %d blocks found in xmlGetNsProp",
19670	           xmlMemBlocks() - mem_base);
19671	    test_ret++;
19672            printf(" %d", n_node);
19673            printf(" %d", n_name);
19674            printf(" %d", n_nameSpace);
19675            printf("\n");
19676        }
19677    }
19678    }
19679    }
19680    function_tests++;
19681
19682    return(test_ret);
19683}
19684
19685
19686static int
19687test_xmlGetProp(void) {
19688    int test_ret = 0;
19689
19690    int mem_base;
19691    xmlChar * ret_val;
19692    xmlNodePtr node; /* the node */
19693    int n_node;
19694    xmlChar * name; /* the attribute name */
19695    int n_name;
19696
19697    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19698    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19699        mem_base = xmlMemBlocks();
19700        node = gen_xmlNodePtr(n_node, 0);
19701        name = gen_const_xmlChar_ptr(n_name, 1);
19702
19703        ret_val = xmlGetProp(node, (const xmlChar *)name);
19704        desret_xmlChar_ptr(ret_val);
19705        call_tests++;
19706        des_xmlNodePtr(n_node, node, 0);
19707        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19708        xmlResetLastError();
19709        if (mem_base != xmlMemBlocks()) {
19710            printf("Leak of %d blocks found in xmlGetProp",
19711	           xmlMemBlocks() - mem_base);
19712	    test_ret++;
19713            printf(" %d", n_node);
19714            printf(" %d", n_name);
19715            printf("\n");
19716        }
19717    }
19718    }
19719    function_tests++;
19720
19721    return(test_ret);
19722}
19723
19724
19725static int
19726test_xmlHasNsProp(void) {
19727    int test_ret = 0;
19728
19729    int mem_base;
19730    xmlAttrPtr ret_val;
19731    xmlNodePtr node; /* the node */
19732    int n_node;
19733    xmlChar * name; /* the attribute name */
19734    int n_name;
19735    xmlChar * nameSpace; /* the URI of the namespace */
19736    int n_nameSpace;
19737
19738    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19739    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19740    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19741        mem_base = xmlMemBlocks();
19742        node = gen_xmlNodePtr(n_node, 0);
19743        name = gen_const_xmlChar_ptr(n_name, 1);
19744        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
19745
19746        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
19747        desret_xmlAttrPtr(ret_val);
19748        call_tests++;
19749        des_xmlNodePtr(n_node, node, 0);
19750        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19751        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
19752        xmlResetLastError();
19753        if (mem_base != xmlMemBlocks()) {
19754            printf("Leak of %d blocks found in xmlHasNsProp",
19755	           xmlMemBlocks() - mem_base);
19756	    test_ret++;
19757            printf(" %d", n_node);
19758            printf(" %d", n_name);
19759            printf(" %d", n_nameSpace);
19760            printf("\n");
19761        }
19762    }
19763    }
19764    }
19765    function_tests++;
19766
19767    return(test_ret);
19768}
19769
19770
19771static int
19772test_xmlHasProp(void) {
19773    int test_ret = 0;
19774
19775    int mem_base;
19776    xmlAttrPtr ret_val;
19777    xmlNodePtr node; /* the node */
19778    int n_node;
19779    xmlChar * name; /* the attribute name */
19780    int n_name;
19781
19782    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19783    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19784        mem_base = xmlMemBlocks();
19785        node = gen_xmlNodePtr(n_node, 0);
19786        name = gen_const_xmlChar_ptr(n_name, 1);
19787
19788        ret_val = xmlHasProp(node, (const xmlChar *)name);
19789        desret_xmlAttrPtr(ret_val);
19790        call_tests++;
19791        des_xmlNodePtr(n_node, node, 0);
19792        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19793        xmlResetLastError();
19794        if (mem_base != xmlMemBlocks()) {
19795            printf("Leak of %d blocks found in xmlHasProp",
19796	           xmlMemBlocks() - mem_base);
19797	    test_ret++;
19798            printf(" %d", n_node);
19799            printf(" %d", n_name);
19800            printf("\n");
19801        }
19802    }
19803    }
19804    function_tests++;
19805
19806    return(test_ret);
19807}
19808
19809
19810static int
19811test_xmlIsBlankNode(void) {
19812    int test_ret = 0;
19813
19814    int mem_base;
19815    int ret_val;
19816    xmlNodePtr node; /* the node */
19817    int n_node;
19818
19819    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19820        mem_base = xmlMemBlocks();
19821        node = gen_xmlNodePtr(n_node, 0);
19822
19823        ret_val = xmlIsBlankNode(node);
19824        desret_int(ret_val);
19825        call_tests++;
19826        des_xmlNodePtr(n_node, node, 0);
19827        xmlResetLastError();
19828        if (mem_base != xmlMemBlocks()) {
19829            printf("Leak of %d blocks found in xmlIsBlankNode",
19830	           xmlMemBlocks() - mem_base);
19831	    test_ret++;
19832            printf(" %d", n_node);
19833            printf("\n");
19834        }
19835    }
19836    function_tests++;
19837
19838    return(test_ret);
19839}
19840
19841
19842static int
19843test_xmlIsXHTML(void) {
19844    int test_ret = 0;
19845
19846    int mem_base;
19847    int ret_val;
19848    xmlChar * systemID; /* the system identifier */
19849    int n_systemID;
19850    xmlChar * publicID; /* the public identifier */
19851    int n_publicID;
19852
19853    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
19854    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
19855        mem_base = xmlMemBlocks();
19856        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
19857        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
19858
19859        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
19860        desret_int(ret_val);
19861        call_tests++;
19862        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
19863        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
19864        xmlResetLastError();
19865        if (mem_base != xmlMemBlocks()) {
19866            printf("Leak of %d blocks found in xmlIsXHTML",
19867	           xmlMemBlocks() - mem_base);
19868	    test_ret++;
19869            printf(" %d", n_systemID);
19870            printf(" %d", n_publicID);
19871            printf("\n");
19872        }
19873    }
19874    }
19875    function_tests++;
19876
19877    return(test_ret);
19878}
19879
19880
19881static int
19882test_xmlNewCDataBlock(void) {
19883    int test_ret = 0;
19884
19885    int mem_base;
19886    xmlNodePtr ret_val;
19887    xmlDocPtr doc; /* the document */
19888    int n_doc;
19889    xmlChar * content; /* the CDATA block content content */
19890    int n_content;
19891    int len; /* the length of the block */
19892    int n_len;
19893
19894    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19895    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19896    for (n_len = 0;n_len < gen_nb_int;n_len++) {
19897        mem_base = xmlMemBlocks();
19898        doc = gen_xmlDocPtr(n_doc, 0);
19899        content = gen_const_xmlChar_ptr(n_content, 1);
19900        len = gen_int(n_len, 2);
19901
19902        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
19903        desret_xmlNodePtr(ret_val);
19904        call_tests++;
19905        des_xmlDocPtr(n_doc, doc, 0);
19906        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
19907        des_int(n_len, len, 2);
19908        xmlResetLastError();
19909        if (mem_base != xmlMemBlocks()) {
19910            printf("Leak of %d blocks found in xmlNewCDataBlock",
19911	           xmlMemBlocks() - mem_base);
19912	    test_ret++;
19913            printf(" %d", n_doc);
19914            printf(" %d", n_content);
19915            printf(" %d", n_len);
19916            printf("\n");
19917        }
19918    }
19919    }
19920    }
19921    function_tests++;
19922
19923    return(test_ret);
19924}
19925
19926
19927static int
19928test_xmlNewCharRef(void) {
19929    int test_ret = 0;
19930
19931    int mem_base;
19932    xmlNodePtr ret_val;
19933    xmlDocPtr doc; /* the document */
19934    int n_doc;
19935    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
19936    int n_name;
19937
19938    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19939    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19940        mem_base = xmlMemBlocks();
19941        doc = gen_xmlDocPtr(n_doc, 0);
19942        name = gen_const_xmlChar_ptr(n_name, 1);
19943
19944        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
19945        desret_xmlNodePtr(ret_val);
19946        call_tests++;
19947        des_xmlDocPtr(n_doc, doc, 0);
19948        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19949        xmlResetLastError();
19950        if (mem_base != xmlMemBlocks()) {
19951            printf("Leak of %d blocks found in xmlNewCharRef",
19952	           xmlMemBlocks() - mem_base);
19953	    test_ret++;
19954            printf(" %d", n_doc);
19955            printf(" %d", n_name);
19956            printf("\n");
19957        }
19958    }
19959    }
19960    function_tests++;
19961
19962    return(test_ret);
19963}
19964
19965
19966static int
19967test_xmlNewChild(void) {
19968    int test_ret = 0;
19969
19970#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19971#ifdef LIBXML_TREE_ENABLED
19972    int mem_base;
19973    xmlNodePtr ret_val;
19974    xmlNodePtr parent; /* the parent node */
19975    int n_parent;
19976    xmlNsPtr ns; /* a namespace if any */
19977    int n_ns;
19978    xmlChar * name; /* the name of the child */
19979    int n_name;
19980    xmlChar * content; /* the XML content of the child if any. */
19981    int n_content;
19982
19983    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19984    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
19985    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19986    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19987        mem_base = xmlMemBlocks();
19988        parent = gen_xmlNodePtr(n_parent, 0);
19989        ns = gen_xmlNsPtr(n_ns, 1);
19990        name = gen_const_xmlChar_ptr(n_name, 2);
19991        content = gen_const_xmlChar_ptr(n_content, 3);
19992
19993        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
19994        desret_xmlNodePtr(ret_val);
19995        call_tests++;
19996        des_xmlNodePtr(n_parent, parent, 0);
19997        des_xmlNsPtr(n_ns, ns, 1);
19998        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
19999        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20000        xmlResetLastError();
20001        if (mem_base != xmlMemBlocks()) {
20002            printf("Leak of %d blocks found in xmlNewChild",
20003	           xmlMemBlocks() - mem_base);
20004	    test_ret++;
20005            printf(" %d", n_parent);
20006            printf(" %d", n_ns);
20007            printf(" %d", n_name);
20008            printf(" %d", n_content);
20009            printf("\n");
20010        }
20011    }
20012    }
20013    }
20014    }
20015    function_tests++;
20016#endif
20017#endif
20018
20019    return(test_ret);
20020}
20021
20022
20023static int
20024test_xmlNewComment(void) {
20025    int test_ret = 0;
20026
20027    int mem_base;
20028    xmlNodePtr ret_val;
20029    xmlChar * content; /* the comment content */
20030    int n_content;
20031
20032    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20033        mem_base = xmlMemBlocks();
20034        content = gen_const_xmlChar_ptr(n_content, 0);
20035
20036        ret_val = xmlNewComment((const xmlChar *)content);
20037        desret_xmlNodePtr(ret_val);
20038        call_tests++;
20039        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20040        xmlResetLastError();
20041        if (mem_base != xmlMemBlocks()) {
20042            printf("Leak of %d blocks found in xmlNewComment",
20043	           xmlMemBlocks() - mem_base);
20044	    test_ret++;
20045            printf(" %d", n_content);
20046            printf("\n");
20047        }
20048    }
20049    function_tests++;
20050
20051    return(test_ret);
20052}
20053
20054
20055static int
20056test_xmlNewDoc(void) {
20057    int test_ret = 0;
20058
20059    int mem_base;
20060    xmlDocPtr ret_val;
20061    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20062    int n_version;
20063
20064    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20065        mem_base = xmlMemBlocks();
20066        version = gen_const_xmlChar_ptr(n_version, 0);
20067
20068        ret_val = xmlNewDoc((const xmlChar *)version);
20069        desret_xmlDocPtr(ret_val);
20070        call_tests++;
20071        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20072        xmlResetLastError();
20073        if (mem_base != xmlMemBlocks()) {
20074            printf("Leak of %d blocks found in xmlNewDoc",
20075	           xmlMemBlocks() - mem_base);
20076	    test_ret++;
20077            printf(" %d", n_version);
20078            printf("\n");
20079        }
20080    }
20081    function_tests++;
20082
20083    return(test_ret);
20084}
20085
20086
20087static int
20088test_xmlNewDocComment(void) {
20089    int test_ret = 0;
20090
20091    int mem_base;
20092    xmlNodePtr ret_val;
20093    xmlDocPtr doc; /* the document */
20094    int n_doc;
20095    xmlChar * content; /* the comment content */
20096    int n_content;
20097
20098    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20099    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20100        mem_base = xmlMemBlocks();
20101        doc = gen_xmlDocPtr(n_doc, 0);
20102        content = gen_const_xmlChar_ptr(n_content, 1);
20103
20104        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20105        desret_xmlNodePtr(ret_val);
20106        call_tests++;
20107        des_xmlDocPtr(n_doc, doc, 0);
20108        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20109        xmlResetLastError();
20110        if (mem_base != xmlMemBlocks()) {
20111            printf("Leak of %d blocks found in xmlNewDocComment",
20112	           xmlMemBlocks() - mem_base);
20113	    test_ret++;
20114            printf(" %d", n_doc);
20115            printf(" %d", n_content);
20116            printf("\n");
20117        }
20118    }
20119    }
20120    function_tests++;
20121
20122    return(test_ret);
20123}
20124
20125
20126static int
20127test_xmlNewDocFragment(void) {
20128    int test_ret = 0;
20129
20130#if defined(LIBXML_TREE_ENABLED)
20131    int mem_base;
20132    xmlNodePtr ret_val;
20133    xmlDocPtr doc; /* the document owning the fragment */
20134    int n_doc;
20135
20136    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20137        mem_base = xmlMemBlocks();
20138        doc = gen_xmlDocPtr(n_doc, 0);
20139
20140        ret_val = xmlNewDocFragment(doc);
20141        desret_xmlNodePtr(ret_val);
20142        call_tests++;
20143        des_xmlDocPtr(n_doc, doc, 0);
20144        xmlResetLastError();
20145        if (mem_base != xmlMemBlocks()) {
20146            printf("Leak of %d blocks found in xmlNewDocFragment",
20147	           xmlMemBlocks() - mem_base);
20148	    test_ret++;
20149            printf(" %d", n_doc);
20150            printf("\n");
20151        }
20152    }
20153    function_tests++;
20154#endif
20155
20156    return(test_ret);
20157}
20158
20159
20160static int
20161test_xmlNewDocNode(void) {
20162    int test_ret = 0;
20163
20164    int mem_base;
20165    xmlNodePtr ret_val;
20166    xmlDocPtr doc; /* the document */
20167    int n_doc;
20168    xmlNsPtr ns; /* namespace if any */
20169    int n_ns;
20170    xmlChar * name; /* the node name */
20171    int n_name;
20172    xmlChar * content; /* the XML text content if any */
20173    int n_content;
20174
20175    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20176    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20177    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20178    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20179        mem_base = xmlMemBlocks();
20180        doc = gen_xmlDocPtr(n_doc, 0);
20181        ns = gen_xmlNsPtr(n_ns, 1);
20182        name = gen_const_xmlChar_ptr(n_name, 2);
20183        content = gen_const_xmlChar_ptr(n_content, 3);
20184
20185        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20186        desret_xmlNodePtr(ret_val);
20187        call_tests++;
20188        des_xmlDocPtr(n_doc, doc, 0);
20189        des_xmlNsPtr(n_ns, ns, 1);
20190        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20191        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20192        xmlResetLastError();
20193        if (mem_base != xmlMemBlocks()) {
20194            printf("Leak of %d blocks found in xmlNewDocNode",
20195	           xmlMemBlocks() - mem_base);
20196	    test_ret++;
20197            printf(" %d", n_doc);
20198            printf(" %d", n_ns);
20199            printf(" %d", n_name);
20200            printf(" %d", n_content);
20201            printf("\n");
20202        }
20203    }
20204    }
20205    }
20206    }
20207    function_tests++;
20208
20209    return(test_ret);
20210}
20211
20212
20213static int
20214test_xmlNewDocNodeEatName(void) {
20215    int test_ret = 0;
20216
20217    int mem_base;
20218    xmlNodePtr ret_val;
20219    xmlDocPtr doc; /* the document */
20220    int n_doc;
20221    xmlNsPtr ns; /* namespace if any */
20222    int n_ns;
20223    xmlChar * name; /* the node name */
20224    int n_name;
20225    xmlChar * content; /* the XML text content if any */
20226    int n_content;
20227
20228    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20229    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20230    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20231    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20232        mem_base = xmlMemBlocks();
20233        doc = gen_xmlDocPtr(n_doc, 0);
20234        ns = gen_xmlNsPtr(n_ns, 1);
20235        name = gen_eaten_name(n_name, 2);
20236        content = gen_const_xmlChar_ptr(n_content, 3);
20237
20238        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
20239        desret_xmlNodePtr(ret_val);
20240        call_tests++;
20241        des_xmlDocPtr(n_doc, doc, 0);
20242        des_xmlNsPtr(n_ns, ns, 1);
20243        des_eaten_name(n_name, name, 2);
20244        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20245        xmlResetLastError();
20246        if (mem_base != xmlMemBlocks()) {
20247            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20248	           xmlMemBlocks() - mem_base);
20249	    test_ret++;
20250            printf(" %d", n_doc);
20251            printf(" %d", n_ns);
20252            printf(" %d", n_name);
20253            printf(" %d", n_content);
20254            printf("\n");
20255        }
20256    }
20257    }
20258    }
20259    }
20260    function_tests++;
20261
20262    return(test_ret);
20263}
20264
20265
20266static int
20267test_xmlNewDocPI(void) {
20268    int test_ret = 0;
20269
20270    int mem_base;
20271    xmlNodePtr ret_val;
20272    xmlDocPtr doc; /* the target document */
20273    int n_doc;
20274    xmlChar * name; /* the processing instruction name */
20275    int n_name;
20276    xmlChar * content; /* the PI content */
20277    int n_content;
20278
20279    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20280    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20281    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20282        mem_base = xmlMemBlocks();
20283        doc = gen_xmlDocPtr(n_doc, 0);
20284        name = gen_const_xmlChar_ptr(n_name, 1);
20285        content = gen_const_xmlChar_ptr(n_content, 2);
20286
20287        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
20288        desret_xmlNodePtr(ret_val);
20289        call_tests++;
20290        des_xmlDocPtr(n_doc, doc, 0);
20291        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20292        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
20293        xmlResetLastError();
20294        if (mem_base != xmlMemBlocks()) {
20295            printf("Leak of %d blocks found in xmlNewDocPI",
20296	           xmlMemBlocks() - mem_base);
20297	    test_ret++;
20298            printf(" %d", n_doc);
20299            printf(" %d", n_name);
20300            printf(" %d", n_content);
20301            printf("\n");
20302        }
20303    }
20304    }
20305    }
20306    function_tests++;
20307
20308    return(test_ret);
20309}
20310
20311
20312static int
20313test_xmlNewDocProp(void) {
20314    int test_ret = 0;
20315
20316    int mem_base;
20317    xmlAttrPtr ret_val;
20318    xmlDocPtr doc; /* the document */
20319    int n_doc;
20320    xmlChar * name; /* the name of the attribute */
20321    int n_name;
20322    xmlChar * value; /* the value of the attribute */
20323    int n_value;
20324
20325    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20326    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20327    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20328        mem_base = xmlMemBlocks();
20329        doc = gen_xmlDocPtr(n_doc, 0);
20330        name = gen_const_xmlChar_ptr(n_name, 1);
20331        value = gen_const_xmlChar_ptr(n_value, 2);
20332
20333        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
20334        desret_xmlAttrPtr(ret_val);
20335        call_tests++;
20336        des_xmlDocPtr(n_doc, doc, 0);
20337        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20338        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20339        xmlResetLastError();
20340        if (mem_base != xmlMemBlocks()) {
20341            printf("Leak of %d blocks found in xmlNewDocProp",
20342	           xmlMemBlocks() - mem_base);
20343	    test_ret++;
20344            printf(" %d", n_doc);
20345            printf(" %d", n_name);
20346            printf(" %d", n_value);
20347            printf("\n");
20348        }
20349    }
20350    }
20351    }
20352    function_tests++;
20353
20354    return(test_ret);
20355}
20356
20357
20358static int
20359test_xmlNewDocRawNode(void) {
20360    int test_ret = 0;
20361
20362#if defined(LIBXML_TREE_ENABLED)
20363#ifdef LIBXML_TREE_ENABLED
20364    int mem_base;
20365    xmlNodePtr ret_val;
20366    xmlDocPtr doc; /* the document */
20367    int n_doc;
20368    xmlNsPtr ns; /* namespace if any */
20369    int n_ns;
20370    xmlChar * name; /* the node name */
20371    int n_name;
20372    xmlChar * content; /* the text content if any */
20373    int n_content;
20374
20375    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20376    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20377    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20378    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20379        mem_base = xmlMemBlocks();
20380        doc = gen_xmlDocPtr(n_doc, 0);
20381        ns = gen_xmlNsPtr(n_ns, 1);
20382        name = gen_const_xmlChar_ptr(n_name, 2);
20383        content = gen_const_xmlChar_ptr(n_content, 3);
20384
20385        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20386        desret_xmlNodePtr(ret_val);
20387        call_tests++;
20388        des_xmlDocPtr(n_doc, doc, 0);
20389        des_xmlNsPtr(n_ns, ns, 1);
20390        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20391        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20392        xmlResetLastError();
20393        if (mem_base != xmlMemBlocks()) {
20394            printf("Leak of %d blocks found in xmlNewDocRawNode",
20395	           xmlMemBlocks() - mem_base);
20396	    test_ret++;
20397            printf(" %d", n_doc);
20398            printf(" %d", n_ns);
20399            printf(" %d", n_name);
20400            printf(" %d", n_content);
20401            printf("\n");
20402        }
20403    }
20404    }
20405    }
20406    }
20407    function_tests++;
20408#endif
20409#endif
20410
20411    return(test_ret);
20412}
20413
20414
20415static int
20416test_xmlNewDocText(void) {
20417    int test_ret = 0;
20418
20419    int mem_base;
20420    xmlNodePtr ret_val;
20421    xmlDocPtr doc; /* the document */
20422    int n_doc;
20423    xmlChar * content; /* the text content */
20424    int n_content;
20425
20426    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20427    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20428        mem_base = xmlMemBlocks();
20429        doc = gen_xmlDocPtr(n_doc, 0);
20430        content = gen_const_xmlChar_ptr(n_content, 1);
20431
20432        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
20433        desret_xmlNodePtr(ret_val);
20434        call_tests++;
20435        des_xmlDocPtr(n_doc, doc, 0);
20436        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20437        xmlResetLastError();
20438        if (mem_base != xmlMemBlocks()) {
20439            printf("Leak of %d blocks found in xmlNewDocText",
20440	           xmlMemBlocks() - mem_base);
20441	    test_ret++;
20442            printf(" %d", n_doc);
20443            printf(" %d", n_content);
20444            printf("\n");
20445        }
20446    }
20447    }
20448    function_tests++;
20449
20450    return(test_ret);
20451}
20452
20453
20454static int
20455test_xmlNewDocTextLen(void) {
20456    int test_ret = 0;
20457
20458    int mem_base;
20459    xmlNodePtr ret_val;
20460    xmlDocPtr doc; /* the document */
20461    int n_doc;
20462    xmlChar * content; /* the text content */
20463    int n_content;
20464    int len; /* the text len. */
20465    int n_len;
20466
20467    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20468    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20469    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20470        mem_base = xmlMemBlocks();
20471        doc = gen_xmlDocPtr(n_doc, 0);
20472        content = gen_const_xmlChar_ptr(n_content, 1);
20473        len = gen_int(n_len, 2);
20474
20475        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
20476        desret_xmlNodePtr(ret_val);
20477        call_tests++;
20478        des_xmlDocPtr(n_doc, doc, 0);
20479        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20480        des_int(n_len, len, 2);
20481        xmlResetLastError();
20482        if (mem_base != xmlMemBlocks()) {
20483            printf("Leak of %d blocks found in xmlNewDocTextLen",
20484	           xmlMemBlocks() - mem_base);
20485	    test_ret++;
20486            printf(" %d", n_doc);
20487            printf(" %d", n_content);
20488            printf(" %d", n_len);
20489            printf("\n");
20490        }
20491    }
20492    }
20493    }
20494    function_tests++;
20495
20496    return(test_ret);
20497}
20498
20499
20500static int
20501test_xmlNewDtd(void) {
20502    int test_ret = 0;
20503
20504    int mem_base;
20505    xmlDtdPtr ret_val;
20506    xmlDocPtr doc; /* the document pointer */
20507    int n_doc;
20508    xmlChar * name; /* the DTD name */
20509    int n_name;
20510    xmlChar * ExternalID; /* the external ID */
20511    int n_ExternalID;
20512    xmlChar * SystemID; /* the system ID */
20513    int n_SystemID;
20514
20515    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20516    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20517    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20518    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20519        mem_base = xmlMemBlocks();
20520        doc = gen_xmlDocPtr(n_doc, 0);
20521        name = gen_const_xmlChar_ptr(n_name, 1);
20522        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20523        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20524
20525        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
20526        desret_xmlDtdPtr(ret_val);
20527        call_tests++;
20528        des_xmlDocPtr(n_doc, doc, 0);
20529        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20530        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
20531        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
20532        xmlResetLastError();
20533        if (mem_base != xmlMemBlocks()) {
20534            printf("Leak of %d blocks found in xmlNewDtd",
20535	           xmlMemBlocks() - mem_base);
20536	    test_ret++;
20537            printf(" %d", n_doc);
20538            printf(" %d", n_name);
20539            printf(" %d", n_ExternalID);
20540            printf(" %d", n_SystemID);
20541            printf("\n");
20542        }
20543    }
20544    }
20545    }
20546    }
20547    function_tests++;
20548
20549    return(test_ret);
20550}
20551
20552
20553static int
20554test_xmlNewNode(void) {
20555    int test_ret = 0;
20556
20557    int mem_base;
20558    xmlNodePtr ret_val;
20559    xmlNsPtr ns; /* namespace if any */
20560    int n_ns;
20561    xmlChar * name; /* the node name */
20562    int n_name;
20563
20564    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20565    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20566        mem_base = xmlMemBlocks();
20567        ns = gen_xmlNsPtr(n_ns, 0);
20568        name = gen_const_xmlChar_ptr(n_name, 1);
20569
20570        ret_val = xmlNewNode(ns, (const xmlChar *)name);
20571        desret_xmlNodePtr(ret_val);
20572        call_tests++;
20573        des_xmlNsPtr(n_ns, ns, 0);
20574        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20575        xmlResetLastError();
20576        if (mem_base != xmlMemBlocks()) {
20577            printf("Leak of %d blocks found in xmlNewNode",
20578	           xmlMemBlocks() - mem_base);
20579	    test_ret++;
20580            printf(" %d", n_ns);
20581            printf(" %d", n_name);
20582            printf("\n");
20583        }
20584    }
20585    }
20586    function_tests++;
20587
20588    return(test_ret);
20589}
20590
20591
20592static int
20593test_xmlNewNodeEatName(void) {
20594    int test_ret = 0;
20595
20596    int mem_base;
20597    xmlNodePtr ret_val;
20598    xmlNsPtr ns; /* namespace if any */
20599    int n_ns;
20600    xmlChar * name; /* the node name */
20601    int n_name;
20602
20603    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20604    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20605        mem_base = xmlMemBlocks();
20606        ns = gen_xmlNsPtr(n_ns, 0);
20607        name = gen_eaten_name(n_name, 1);
20608
20609        ret_val = xmlNewNodeEatName(ns, name);
20610        desret_xmlNodePtr(ret_val);
20611        call_tests++;
20612        des_xmlNsPtr(n_ns, ns, 0);
20613        des_eaten_name(n_name, name, 1);
20614        xmlResetLastError();
20615        if (mem_base != xmlMemBlocks()) {
20616            printf("Leak of %d blocks found in xmlNewNodeEatName",
20617	           xmlMemBlocks() - mem_base);
20618	    test_ret++;
20619            printf(" %d", n_ns);
20620            printf(" %d", n_name);
20621            printf("\n");
20622        }
20623    }
20624    }
20625    function_tests++;
20626
20627    return(test_ret);
20628}
20629
20630
20631static int
20632test_xmlNewNs(void) {
20633    int test_ret = 0;
20634
20635    int mem_base;
20636    xmlNsPtr ret_val;
20637    xmlNodePtr node; /* the element carrying the namespace */
20638    int n_node;
20639    xmlChar * href; /* the URI associated */
20640    int n_href;
20641    xmlChar * prefix; /* the prefix for the namespace */
20642    int n_prefix;
20643
20644    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20645    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
20646    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
20647        mem_base = xmlMemBlocks();
20648        node = gen_xmlNodePtr(n_node, 0);
20649        href = gen_const_xmlChar_ptr(n_href, 1);
20650        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
20651
20652        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
20653        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
20654        desret_xmlNsPtr(ret_val);
20655        call_tests++;
20656        des_xmlNodePtr(n_node, node, 0);
20657        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
20658        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
20659        xmlResetLastError();
20660        if (mem_base != xmlMemBlocks()) {
20661            printf("Leak of %d blocks found in xmlNewNs",
20662	           xmlMemBlocks() - mem_base);
20663	    test_ret++;
20664            printf(" %d", n_node);
20665            printf(" %d", n_href);
20666            printf(" %d", n_prefix);
20667            printf("\n");
20668        }
20669    }
20670    }
20671    }
20672    function_tests++;
20673
20674    return(test_ret);
20675}
20676
20677
20678static int
20679test_xmlNewNsProp(void) {
20680    int test_ret = 0;
20681
20682    int mem_base;
20683    xmlAttrPtr ret_val;
20684    xmlNodePtr node; /* the holding node */
20685    int n_node;
20686    xmlNsPtr ns; /* the namespace */
20687    int n_ns;
20688    xmlChar * name; /* the name of the attribute */
20689    int n_name;
20690    xmlChar * value; /* the value of the attribute */
20691    int n_value;
20692
20693    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20694    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20695    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20696    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20697        mem_base = xmlMemBlocks();
20698        node = gen_xmlNodePtr(n_node, 0);
20699        ns = gen_xmlNsPtr(n_ns, 1);
20700        name = gen_const_xmlChar_ptr(n_name, 2);
20701        value = gen_const_xmlChar_ptr(n_value, 3);
20702
20703        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
20704        desret_xmlAttrPtr(ret_val);
20705        call_tests++;
20706        des_xmlNodePtr(n_node, node, 0);
20707        des_xmlNsPtr(n_ns, ns, 1);
20708        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20709        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
20710        xmlResetLastError();
20711        if (mem_base != xmlMemBlocks()) {
20712            printf("Leak of %d blocks found in xmlNewNsProp",
20713	           xmlMemBlocks() - mem_base);
20714	    test_ret++;
20715            printf(" %d", n_node);
20716            printf(" %d", n_ns);
20717            printf(" %d", n_name);
20718            printf(" %d", n_value);
20719            printf("\n");
20720        }
20721    }
20722    }
20723    }
20724    }
20725    function_tests++;
20726
20727    return(test_ret);
20728}
20729
20730
20731static int
20732test_xmlNewNsPropEatName(void) {
20733    int test_ret = 0;
20734
20735    int mem_base;
20736    xmlAttrPtr ret_val;
20737    xmlNodePtr node; /* the holding node */
20738    int n_node;
20739    xmlNsPtr ns; /* the namespace */
20740    int n_ns;
20741    xmlChar * name; /* the name of the attribute */
20742    int n_name;
20743    xmlChar * value; /* the value of the attribute */
20744    int n_value;
20745
20746    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20747    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20748    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20749    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20750        mem_base = xmlMemBlocks();
20751        node = gen_xmlNodePtr(n_node, 0);
20752        ns = gen_xmlNsPtr(n_ns, 1);
20753        name = gen_eaten_name(n_name, 2);
20754        value = gen_const_xmlChar_ptr(n_value, 3);
20755
20756        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
20757        desret_xmlAttrPtr(ret_val);
20758        call_tests++;
20759        des_xmlNodePtr(n_node, node, 0);
20760        des_xmlNsPtr(n_ns, ns, 1);
20761        des_eaten_name(n_name, name, 2);
20762        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
20763        xmlResetLastError();
20764        if (mem_base != xmlMemBlocks()) {
20765            printf("Leak of %d blocks found in xmlNewNsPropEatName",
20766	           xmlMemBlocks() - mem_base);
20767	    test_ret++;
20768            printf(" %d", n_node);
20769            printf(" %d", n_ns);
20770            printf(" %d", n_name);
20771            printf(" %d", n_value);
20772            printf("\n");
20773        }
20774    }
20775    }
20776    }
20777    }
20778    function_tests++;
20779
20780    return(test_ret);
20781}
20782
20783
20784static int
20785test_xmlNewPI(void) {
20786    int test_ret = 0;
20787
20788    int mem_base;
20789    xmlNodePtr ret_val;
20790    xmlChar * name; /* the processing instruction name */
20791    int n_name;
20792    xmlChar * content; /* the PI content */
20793    int n_content;
20794
20795    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20796    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20797        mem_base = xmlMemBlocks();
20798        name = gen_const_xmlChar_ptr(n_name, 0);
20799        content = gen_const_xmlChar_ptr(n_content, 1);
20800
20801        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
20802        desret_xmlNodePtr(ret_val);
20803        call_tests++;
20804        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
20805        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20806        xmlResetLastError();
20807        if (mem_base != xmlMemBlocks()) {
20808            printf("Leak of %d blocks found in xmlNewPI",
20809	           xmlMemBlocks() - mem_base);
20810	    test_ret++;
20811            printf(" %d", n_name);
20812            printf(" %d", n_content);
20813            printf("\n");
20814        }
20815    }
20816    }
20817    function_tests++;
20818
20819    return(test_ret);
20820}
20821
20822
20823static int
20824test_xmlNewProp(void) {
20825    int test_ret = 0;
20826
20827#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20828#ifdef LIBXML_TREE_ENABLED
20829    int mem_base;
20830    xmlAttrPtr ret_val;
20831    xmlNodePtr node; /* the holding node */
20832    int n_node;
20833    xmlChar * name; /* the name of the attribute */
20834    int n_name;
20835    xmlChar * value; /* the value of the attribute */
20836    int n_value;
20837
20838    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20839    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20840    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20841        mem_base = xmlMemBlocks();
20842        node = gen_xmlNodePtr(n_node, 0);
20843        name = gen_const_xmlChar_ptr(n_name, 1);
20844        value = gen_const_xmlChar_ptr(n_value, 2);
20845
20846        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
20847        desret_xmlAttrPtr(ret_val);
20848        call_tests++;
20849        des_xmlNodePtr(n_node, node, 0);
20850        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20851        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20852        xmlResetLastError();
20853        if (mem_base != xmlMemBlocks()) {
20854            printf("Leak of %d blocks found in xmlNewProp",
20855	           xmlMemBlocks() - mem_base);
20856	    test_ret++;
20857            printf(" %d", n_node);
20858            printf(" %d", n_name);
20859            printf(" %d", n_value);
20860            printf("\n");
20861        }
20862    }
20863    }
20864    }
20865    function_tests++;
20866#endif
20867#endif
20868
20869    return(test_ret);
20870}
20871
20872
20873static int
20874test_xmlNewReference(void) {
20875    int test_ret = 0;
20876
20877    int mem_base;
20878    xmlNodePtr ret_val;
20879    xmlDocPtr doc; /* the document */
20880    int n_doc;
20881    xmlChar * name; /* the reference name, or the reference string with & and ; */
20882    int n_name;
20883
20884    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20885    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20886        mem_base = xmlMemBlocks();
20887        doc = gen_xmlDocPtr(n_doc, 0);
20888        name = gen_const_xmlChar_ptr(n_name, 1);
20889
20890        ret_val = xmlNewReference(doc, (const xmlChar *)name);
20891        desret_xmlNodePtr(ret_val);
20892        call_tests++;
20893        des_xmlDocPtr(n_doc, doc, 0);
20894        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20895        xmlResetLastError();
20896        if (mem_base != xmlMemBlocks()) {
20897            printf("Leak of %d blocks found in xmlNewReference",
20898	           xmlMemBlocks() - mem_base);
20899	    test_ret++;
20900            printf(" %d", n_doc);
20901            printf(" %d", n_name);
20902            printf("\n");
20903        }
20904    }
20905    }
20906    function_tests++;
20907
20908    return(test_ret);
20909}
20910
20911
20912static int
20913test_xmlNewText(void) {
20914    int test_ret = 0;
20915
20916    int mem_base;
20917    xmlNodePtr ret_val;
20918    xmlChar * content; /* the text content */
20919    int n_content;
20920
20921    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20922        mem_base = xmlMemBlocks();
20923        content = gen_const_xmlChar_ptr(n_content, 0);
20924
20925        ret_val = xmlNewText((const xmlChar *)content);
20926        desret_xmlNodePtr(ret_val);
20927        call_tests++;
20928        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20929        xmlResetLastError();
20930        if (mem_base != xmlMemBlocks()) {
20931            printf("Leak of %d blocks found in xmlNewText",
20932	           xmlMemBlocks() - mem_base);
20933	    test_ret++;
20934            printf(" %d", n_content);
20935            printf("\n");
20936        }
20937    }
20938    function_tests++;
20939
20940    return(test_ret);
20941}
20942
20943
20944static int
20945test_xmlNewTextChild(void) {
20946    int test_ret = 0;
20947
20948#if defined(LIBXML_TREE_ENABLED)
20949#ifdef LIBXML_TREE_ENABLED
20950    int mem_base;
20951    xmlNodePtr ret_val;
20952    xmlNodePtr parent; /* the parent node */
20953    int n_parent;
20954    xmlNsPtr ns; /* a namespace if any */
20955    int n_ns;
20956    xmlChar * name; /* the name of the child */
20957    int n_name;
20958    xmlChar * content; /* the text content of the child if any. */
20959    int n_content;
20960
20961    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20962    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20963    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20964    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20965        mem_base = xmlMemBlocks();
20966        parent = gen_xmlNodePtr(n_parent, 0);
20967        ns = gen_xmlNsPtr(n_ns, 1);
20968        name = gen_const_xmlChar_ptr(n_name, 2);
20969        content = gen_const_xmlChar_ptr(n_content, 3);
20970
20971        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20972        desret_xmlNodePtr(ret_val);
20973        call_tests++;
20974        des_xmlNodePtr(n_parent, parent, 0);
20975        des_xmlNsPtr(n_ns, ns, 1);
20976        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20977        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20978        xmlResetLastError();
20979        if (mem_base != xmlMemBlocks()) {
20980            printf("Leak of %d blocks found in xmlNewTextChild",
20981	           xmlMemBlocks() - mem_base);
20982	    test_ret++;
20983            printf(" %d", n_parent);
20984            printf(" %d", n_ns);
20985            printf(" %d", n_name);
20986            printf(" %d", n_content);
20987            printf("\n");
20988        }
20989    }
20990    }
20991    }
20992    }
20993    function_tests++;
20994#endif
20995#endif
20996
20997    return(test_ret);
20998}
20999
21000
21001static int
21002test_xmlNewTextLen(void) {
21003    int test_ret = 0;
21004
21005    int mem_base;
21006    xmlNodePtr ret_val;
21007    xmlChar * content; /* the text content */
21008    int n_content;
21009    int len; /* the text len. */
21010    int n_len;
21011
21012    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21013    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21014        mem_base = xmlMemBlocks();
21015        content = gen_const_xmlChar_ptr(n_content, 0);
21016        len = gen_int(n_len, 1);
21017
21018        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21019        desret_xmlNodePtr(ret_val);
21020        call_tests++;
21021        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21022        des_int(n_len, len, 1);
21023        xmlResetLastError();
21024        if (mem_base != xmlMemBlocks()) {
21025            printf("Leak of %d blocks found in xmlNewTextLen",
21026	           xmlMemBlocks() - mem_base);
21027	    test_ret++;
21028            printf(" %d", n_content);
21029            printf(" %d", n_len);
21030            printf("\n");
21031        }
21032    }
21033    }
21034    function_tests++;
21035
21036    return(test_ret);
21037}
21038
21039
21040static int
21041test_xmlNodeAddContent(void) {
21042    int test_ret = 0;
21043
21044    int mem_base;
21045    xmlNodePtr cur; /* the node being modified */
21046    int n_cur;
21047    xmlChar * content; /* extra content */
21048    int n_content;
21049
21050    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21051    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21052        mem_base = xmlMemBlocks();
21053        cur = gen_xmlNodePtr(n_cur, 0);
21054        content = gen_const_xmlChar_ptr(n_content, 1);
21055
21056        xmlNodeAddContent(cur, (const xmlChar *)content);
21057        call_tests++;
21058        des_xmlNodePtr(n_cur, cur, 0);
21059        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21060        xmlResetLastError();
21061        if (mem_base != xmlMemBlocks()) {
21062            printf("Leak of %d blocks found in xmlNodeAddContent",
21063	           xmlMemBlocks() - mem_base);
21064	    test_ret++;
21065            printf(" %d", n_cur);
21066            printf(" %d", n_content);
21067            printf("\n");
21068        }
21069    }
21070    }
21071    function_tests++;
21072
21073    return(test_ret);
21074}
21075
21076
21077static int
21078test_xmlNodeAddContentLen(void) {
21079    int test_ret = 0;
21080
21081    int mem_base;
21082    xmlNodePtr cur; /* the node being modified */
21083    int n_cur;
21084    xmlChar * content; /* extra content */
21085    int n_content;
21086    int len; /* the size of @content */
21087    int n_len;
21088
21089    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21090    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21091    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21092        mem_base = xmlMemBlocks();
21093        cur = gen_xmlNodePtr(n_cur, 0);
21094        content = gen_const_xmlChar_ptr(n_content, 1);
21095        len = gen_int(n_len, 2);
21096
21097        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21098        call_tests++;
21099        des_xmlNodePtr(n_cur, cur, 0);
21100        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21101        des_int(n_len, len, 2);
21102        xmlResetLastError();
21103        if (mem_base != xmlMemBlocks()) {
21104            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21105	           xmlMemBlocks() - mem_base);
21106	    test_ret++;
21107            printf(" %d", n_cur);
21108            printf(" %d", n_content);
21109            printf(" %d", n_len);
21110            printf("\n");
21111        }
21112    }
21113    }
21114    }
21115    function_tests++;
21116
21117    return(test_ret);
21118}
21119
21120
21121static int
21122test_xmlNodeBufGetContent(void) {
21123    int test_ret = 0;
21124
21125    int mem_base;
21126    int ret_val;
21127    xmlBufferPtr buffer; /* a buffer */
21128    int n_buffer;
21129    xmlNodePtr cur; /* the node being read */
21130    int n_cur;
21131
21132    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21133    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21134        mem_base = xmlMemBlocks();
21135        buffer = gen_xmlBufferPtr(n_buffer, 0);
21136        cur = gen_xmlNodePtr(n_cur, 1);
21137
21138        ret_val = xmlNodeBufGetContent(buffer, cur);
21139        desret_int(ret_val);
21140        call_tests++;
21141        des_xmlBufferPtr(n_buffer, buffer, 0);
21142        des_xmlNodePtr(n_cur, cur, 1);
21143        xmlResetLastError();
21144        if (mem_base != xmlMemBlocks()) {
21145            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21146	           xmlMemBlocks() - mem_base);
21147	    test_ret++;
21148            printf(" %d", n_buffer);
21149            printf(" %d", n_cur);
21150            printf("\n");
21151        }
21152    }
21153    }
21154    function_tests++;
21155
21156    return(test_ret);
21157}
21158
21159
21160static int
21161test_xmlNodeDump(void) {
21162    int test_ret = 0;
21163
21164#if defined(LIBXML_OUTPUT_ENABLED)
21165    int mem_base;
21166    int ret_val;
21167    xmlBufferPtr buf; /* the XML buffer output */
21168    int n_buf;
21169    xmlDocPtr doc; /* the document */
21170    int n_doc;
21171    xmlNodePtr cur; /* the current node */
21172    int n_cur;
21173    int level; /* the imbrication level for indenting */
21174    int n_level;
21175    int format; /* is formatting allowed */
21176    int n_format;
21177
21178    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21179    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21180    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21181    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21182    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21183        mem_base = xmlMemBlocks();
21184        buf = gen_xmlBufferPtr(n_buf, 0);
21185        doc = gen_xmlDocPtr(n_doc, 1);
21186        cur = gen_xmlNodePtr(n_cur, 2);
21187        level = gen_int(n_level, 3);
21188        format = gen_int(n_format, 4);
21189
21190        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21191        desret_int(ret_val);
21192        call_tests++;
21193        des_xmlBufferPtr(n_buf, buf, 0);
21194        des_xmlDocPtr(n_doc, doc, 1);
21195        des_xmlNodePtr(n_cur, cur, 2);
21196        des_int(n_level, level, 3);
21197        des_int(n_format, format, 4);
21198        xmlResetLastError();
21199        if (mem_base != xmlMemBlocks()) {
21200            printf("Leak of %d blocks found in xmlNodeDump",
21201	           xmlMemBlocks() - mem_base);
21202	    test_ret++;
21203            printf(" %d", n_buf);
21204            printf(" %d", n_doc);
21205            printf(" %d", n_cur);
21206            printf(" %d", n_level);
21207            printf(" %d", n_format);
21208            printf("\n");
21209        }
21210    }
21211    }
21212    }
21213    }
21214    }
21215    function_tests++;
21216#endif
21217
21218    return(test_ret);
21219}
21220
21221
21222static int
21223test_xmlNodeDumpOutput(void) {
21224    int test_ret = 0;
21225
21226#if defined(LIBXML_OUTPUT_ENABLED)
21227    int mem_base;
21228    xmlOutputBufferPtr buf; /* the XML buffer output */
21229    int n_buf;
21230    xmlDocPtr doc; /* the document */
21231    int n_doc;
21232    xmlNodePtr cur; /* the current node */
21233    int n_cur;
21234    int level; /* the imbrication level for indenting */
21235    int n_level;
21236    int format; /* is formatting allowed */
21237    int n_format;
21238    char * encoding; /* an optional encoding string */
21239    int n_encoding;
21240
21241    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21242    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21243    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21244    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21245    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21246    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21247        mem_base = xmlMemBlocks();
21248        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21249        doc = gen_xmlDocPtr(n_doc, 1);
21250        cur = gen_xmlNodePtr(n_cur, 2);
21251        level = gen_int(n_level, 3);
21252        format = gen_int(n_format, 4);
21253        encoding = gen_const_char_ptr(n_encoding, 5);
21254
21255        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
21256        call_tests++;
21257        des_xmlOutputBufferPtr(n_buf, buf, 0);
21258        des_xmlDocPtr(n_doc, doc, 1);
21259        des_xmlNodePtr(n_cur, cur, 2);
21260        des_int(n_level, level, 3);
21261        des_int(n_format, format, 4);
21262        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
21263        xmlResetLastError();
21264        if (mem_base != xmlMemBlocks()) {
21265            printf("Leak of %d blocks found in xmlNodeDumpOutput",
21266	           xmlMemBlocks() - mem_base);
21267	    test_ret++;
21268            printf(" %d", n_buf);
21269            printf(" %d", n_doc);
21270            printf(" %d", n_cur);
21271            printf(" %d", n_level);
21272            printf(" %d", n_format);
21273            printf(" %d", n_encoding);
21274            printf("\n");
21275        }
21276    }
21277    }
21278    }
21279    }
21280    }
21281    }
21282    function_tests++;
21283#endif
21284
21285    return(test_ret);
21286}
21287
21288
21289static int
21290test_xmlNodeGetBase(void) {
21291    int test_ret = 0;
21292
21293    int mem_base;
21294    xmlChar * ret_val;
21295    xmlDocPtr doc; /* the document the node pertains to */
21296    int n_doc;
21297    xmlNodePtr cur; /* the node being checked */
21298    int n_cur;
21299
21300    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21301    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21302        mem_base = xmlMemBlocks();
21303        doc = gen_xmlDocPtr(n_doc, 0);
21304        cur = gen_xmlNodePtr(n_cur, 1);
21305
21306        ret_val = xmlNodeGetBase(doc, cur);
21307        desret_xmlChar_ptr(ret_val);
21308        call_tests++;
21309        des_xmlDocPtr(n_doc, doc, 0);
21310        des_xmlNodePtr(n_cur, cur, 1);
21311        xmlResetLastError();
21312        if (mem_base != xmlMemBlocks()) {
21313            printf("Leak of %d blocks found in xmlNodeGetBase",
21314	           xmlMemBlocks() - mem_base);
21315	    test_ret++;
21316            printf(" %d", n_doc);
21317            printf(" %d", n_cur);
21318            printf("\n");
21319        }
21320    }
21321    }
21322    function_tests++;
21323
21324    return(test_ret);
21325}
21326
21327
21328static int
21329test_xmlNodeGetContent(void) {
21330    int test_ret = 0;
21331
21332    int mem_base;
21333    xmlChar * ret_val;
21334    xmlNodePtr cur; /* the node being read */
21335    int n_cur;
21336
21337    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21338        mem_base = xmlMemBlocks();
21339        cur = gen_xmlNodePtr(n_cur, 0);
21340
21341        ret_val = xmlNodeGetContent(cur);
21342        desret_xmlChar_ptr(ret_val);
21343        call_tests++;
21344        des_xmlNodePtr(n_cur, cur, 0);
21345        xmlResetLastError();
21346        if (mem_base != xmlMemBlocks()) {
21347            printf("Leak of %d blocks found in xmlNodeGetContent",
21348	           xmlMemBlocks() - mem_base);
21349	    test_ret++;
21350            printf(" %d", n_cur);
21351            printf("\n");
21352        }
21353    }
21354    function_tests++;
21355
21356    return(test_ret);
21357}
21358
21359
21360static int
21361test_xmlNodeGetLang(void) {
21362    int test_ret = 0;
21363
21364    int mem_base;
21365    xmlChar * ret_val;
21366    xmlNodePtr cur; /* the node being checked */
21367    int n_cur;
21368
21369    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21370        mem_base = xmlMemBlocks();
21371        cur = gen_xmlNodePtr(n_cur, 0);
21372
21373        ret_val = xmlNodeGetLang(cur);
21374        desret_xmlChar_ptr(ret_val);
21375        call_tests++;
21376        des_xmlNodePtr(n_cur, cur, 0);
21377        xmlResetLastError();
21378        if (mem_base != xmlMemBlocks()) {
21379            printf("Leak of %d blocks found in xmlNodeGetLang",
21380	           xmlMemBlocks() - mem_base);
21381	    test_ret++;
21382            printf(" %d", n_cur);
21383            printf("\n");
21384        }
21385    }
21386    function_tests++;
21387
21388    return(test_ret);
21389}
21390
21391
21392static int
21393test_xmlNodeGetSpacePreserve(void) {
21394    int test_ret = 0;
21395
21396    int mem_base;
21397    int ret_val;
21398    xmlNodePtr cur; /* the node being checked */
21399    int n_cur;
21400
21401    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21402        mem_base = xmlMemBlocks();
21403        cur = gen_xmlNodePtr(n_cur, 0);
21404
21405        ret_val = xmlNodeGetSpacePreserve(cur);
21406        desret_int(ret_val);
21407        call_tests++;
21408        des_xmlNodePtr(n_cur, cur, 0);
21409        xmlResetLastError();
21410        if (mem_base != xmlMemBlocks()) {
21411            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
21412	           xmlMemBlocks() - mem_base);
21413	    test_ret++;
21414            printf(" %d", n_cur);
21415            printf("\n");
21416        }
21417    }
21418    function_tests++;
21419
21420    return(test_ret);
21421}
21422
21423
21424static int
21425test_xmlNodeIsText(void) {
21426    int test_ret = 0;
21427
21428    int mem_base;
21429    int ret_val;
21430    xmlNodePtr node; /* the node */
21431    int n_node;
21432
21433    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21434        mem_base = xmlMemBlocks();
21435        node = gen_xmlNodePtr(n_node, 0);
21436
21437        ret_val = xmlNodeIsText(node);
21438        desret_int(ret_val);
21439        call_tests++;
21440        des_xmlNodePtr(n_node, node, 0);
21441        xmlResetLastError();
21442        if (mem_base != xmlMemBlocks()) {
21443            printf("Leak of %d blocks found in xmlNodeIsText",
21444	           xmlMemBlocks() - mem_base);
21445	    test_ret++;
21446            printf(" %d", n_node);
21447            printf("\n");
21448        }
21449    }
21450    function_tests++;
21451
21452    return(test_ret);
21453}
21454
21455
21456static int
21457test_xmlNodeListGetRawString(void) {
21458    int test_ret = 0;
21459
21460#if defined(LIBXML_TREE_ENABLED)
21461    int mem_base;
21462    xmlChar * ret_val;
21463    xmlDocPtr doc; /* the document */
21464    int n_doc;
21465    xmlNodePtr list; /* a Node list */
21466    int n_list;
21467    int inLine; /* should we replace entity contents or show their external form */
21468    int n_inLine;
21469
21470    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21471    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21472    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21473        mem_base = xmlMemBlocks();
21474        doc = gen_xmlDocPtr(n_doc, 0);
21475        list = gen_xmlNodePtr(n_list, 1);
21476        inLine = gen_int(n_inLine, 2);
21477
21478        ret_val = xmlNodeListGetRawString(doc, list, inLine);
21479        desret_xmlChar_ptr(ret_val);
21480        call_tests++;
21481        des_xmlDocPtr(n_doc, doc, 0);
21482        des_xmlNodePtr(n_list, list, 1);
21483        des_int(n_inLine, inLine, 2);
21484        xmlResetLastError();
21485        if (mem_base != xmlMemBlocks()) {
21486            printf("Leak of %d blocks found in xmlNodeListGetRawString",
21487	           xmlMemBlocks() - mem_base);
21488	    test_ret++;
21489            printf(" %d", n_doc);
21490            printf(" %d", n_list);
21491            printf(" %d", n_inLine);
21492            printf("\n");
21493        }
21494    }
21495    }
21496    }
21497    function_tests++;
21498#endif
21499
21500    return(test_ret);
21501}
21502
21503
21504static int
21505test_xmlNodeListGetString(void) {
21506    int test_ret = 0;
21507
21508    int mem_base;
21509    xmlChar * ret_val;
21510    xmlDocPtr doc; /* the document */
21511    int n_doc;
21512    xmlNodePtr list; /* a Node list */
21513    int n_list;
21514    int inLine; /* should we replace entity contents or show their external form */
21515    int n_inLine;
21516
21517    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21518    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21519    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21520        mem_base = xmlMemBlocks();
21521        doc = gen_xmlDocPtr(n_doc, 0);
21522        list = gen_xmlNodePtr(n_list, 1);
21523        inLine = gen_int(n_inLine, 2);
21524
21525        ret_val = xmlNodeListGetString(doc, list, inLine);
21526        desret_xmlChar_ptr(ret_val);
21527        call_tests++;
21528        des_xmlDocPtr(n_doc, doc, 0);
21529        des_xmlNodePtr(n_list, list, 1);
21530        des_int(n_inLine, inLine, 2);
21531        xmlResetLastError();
21532        if (mem_base != xmlMemBlocks()) {
21533            printf("Leak of %d blocks found in xmlNodeListGetString",
21534	           xmlMemBlocks() - mem_base);
21535	    test_ret++;
21536            printf(" %d", n_doc);
21537            printf(" %d", n_list);
21538            printf(" %d", n_inLine);
21539            printf("\n");
21540        }
21541    }
21542    }
21543    }
21544    function_tests++;
21545
21546    return(test_ret);
21547}
21548
21549
21550static int
21551test_xmlNodeSetBase(void) {
21552    int test_ret = 0;
21553
21554#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
21555    int mem_base;
21556    xmlNodePtr cur; /* the node being changed */
21557    int n_cur;
21558    xmlChar * uri; /* the new base URI */
21559    int n_uri;
21560
21561    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21562    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
21563        mem_base = xmlMemBlocks();
21564        cur = gen_xmlNodePtr(n_cur, 0);
21565        uri = gen_const_xmlChar_ptr(n_uri, 1);
21566
21567        xmlNodeSetBase(cur, (const xmlChar *)uri);
21568        call_tests++;
21569        des_xmlNodePtr(n_cur, cur, 0);
21570        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
21571        xmlResetLastError();
21572        if (mem_base != xmlMemBlocks()) {
21573            printf("Leak of %d blocks found in xmlNodeSetBase",
21574	           xmlMemBlocks() - mem_base);
21575	    test_ret++;
21576            printf(" %d", n_cur);
21577            printf(" %d", n_uri);
21578            printf("\n");
21579        }
21580    }
21581    }
21582    function_tests++;
21583#endif
21584
21585    return(test_ret);
21586}
21587
21588
21589static int
21590test_xmlNodeSetContent(void) {
21591    int test_ret = 0;
21592
21593    int mem_base;
21594    xmlNodePtr cur; /* the node being modified */
21595    int n_cur;
21596    xmlChar * content; /* the new value of the content */
21597    int n_content;
21598
21599    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21600    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21601        mem_base = xmlMemBlocks();
21602        cur = gen_xmlNodePtr(n_cur, 0);
21603        content = gen_const_xmlChar_ptr(n_content, 1);
21604
21605        xmlNodeSetContent(cur, (const xmlChar *)content);
21606        call_tests++;
21607        des_xmlNodePtr(n_cur, cur, 0);
21608        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21609        xmlResetLastError();
21610        if (mem_base != xmlMemBlocks()) {
21611            printf("Leak of %d blocks found in xmlNodeSetContent",
21612	           xmlMemBlocks() - mem_base);
21613	    test_ret++;
21614            printf(" %d", n_cur);
21615            printf(" %d", n_content);
21616            printf("\n");
21617        }
21618    }
21619    }
21620    function_tests++;
21621
21622    return(test_ret);
21623}
21624
21625
21626static int
21627test_xmlNodeSetContentLen(void) {
21628    int test_ret = 0;
21629
21630#if defined(LIBXML_TREE_ENABLED)
21631    int mem_base;
21632    xmlNodePtr cur; /* the node being modified */
21633    int n_cur;
21634    xmlChar * content; /* the new value of the content */
21635    int n_content;
21636    int len; /* the size of @content */
21637    int n_len;
21638
21639    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21640    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21641    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21642        mem_base = xmlMemBlocks();
21643        cur = gen_xmlNodePtr(n_cur, 0);
21644        content = gen_const_xmlChar_ptr(n_content, 1);
21645        len = gen_int(n_len, 2);
21646
21647        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
21648        call_tests++;
21649        des_xmlNodePtr(n_cur, cur, 0);
21650        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21651        des_int(n_len, len, 2);
21652        xmlResetLastError();
21653        if (mem_base != xmlMemBlocks()) {
21654            printf("Leak of %d blocks found in xmlNodeSetContentLen",
21655	           xmlMemBlocks() - mem_base);
21656	    test_ret++;
21657            printf(" %d", n_cur);
21658            printf(" %d", n_content);
21659            printf(" %d", n_len);
21660            printf("\n");
21661        }
21662    }
21663    }
21664    }
21665    function_tests++;
21666#endif
21667
21668    return(test_ret);
21669}
21670
21671
21672static int
21673test_xmlNodeSetLang(void) {
21674    int test_ret = 0;
21675
21676#if defined(LIBXML_TREE_ENABLED)
21677    int mem_base;
21678    xmlNodePtr cur; /* the node being changed */
21679    int n_cur;
21680    xmlChar * lang; /* the language description */
21681    int n_lang;
21682
21683    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21684    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
21685        mem_base = xmlMemBlocks();
21686        cur = gen_xmlNodePtr(n_cur, 0);
21687        lang = gen_const_xmlChar_ptr(n_lang, 1);
21688
21689        xmlNodeSetLang(cur, (const xmlChar *)lang);
21690        call_tests++;
21691        des_xmlNodePtr(n_cur, cur, 0);
21692        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
21693        xmlResetLastError();
21694        if (mem_base != xmlMemBlocks()) {
21695            printf("Leak of %d blocks found in xmlNodeSetLang",
21696	           xmlMemBlocks() - mem_base);
21697	    test_ret++;
21698            printf(" %d", n_cur);
21699            printf(" %d", n_lang);
21700            printf("\n");
21701        }
21702    }
21703    }
21704    function_tests++;
21705#endif
21706
21707    return(test_ret);
21708}
21709
21710
21711static int
21712test_xmlNodeSetName(void) {
21713    int test_ret = 0;
21714
21715#if defined(LIBXML_TREE_ENABLED)
21716    int mem_base;
21717    xmlNodePtr cur; /* the node being changed */
21718    int n_cur;
21719    xmlChar * name; /* the new tag name */
21720    int n_name;
21721
21722    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21723    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21724        mem_base = xmlMemBlocks();
21725        cur = gen_xmlNodePtr(n_cur, 0);
21726        name = gen_const_xmlChar_ptr(n_name, 1);
21727
21728        xmlNodeSetName(cur, (const xmlChar *)name);
21729        call_tests++;
21730        des_xmlNodePtr(n_cur, cur, 0);
21731        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21732        xmlResetLastError();
21733        if (mem_base != xmlMemBlocks()) {
21734            printf("Leak of %d blocks found in xmlNodeSetName",
21735	           xmlMemBlocks() - mem_base);
21736	    test_ret++;
21737            printf(" %d", n_cur);
21738            printf(" %d", n_name);
21739            printf("\n");
21740        }
21741    }
21742    }
21743    function_tests++;
21744#endif
21745
21746    return(test_ret);
21747}
21748
21749
21750static int
21751test_xmlNodeSetSpacePreserve(void) {
21752    int test_ret = 0;
21753
21754#if defined(LIBXML_TREE_ENABLED)
21755    int mem_base;
21756    xmlNodePtr cur; /* the node being changed */
21757    int n_cur;
21758    int val; /* the xml:space value ("0": default, 1: "preserve") */
21759    int n_val;
21760
21761    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21762    for (n_val = 0;n_val < gen_nb_int;n_val++) {
21763        mem_base = xmlMemBlocks();
21764        cur = gen_xmlNodePtr(n_cur, 0);
21765        val = gen_int(n_val, 1);
21766
21767        xmlNodeSetSpacePreserve(cur, val);
21768        call_tests++;
21769        des_xmlNodePtr(n_cur, cur, 0);
21770        des_int(n_val, val, 1);
21771        xmlResetLastError();
21772        if (mem_base != xmlMemBlocks()) {
21773            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
21774	           xmlMemBlocks() - mem_base);
21775	    test_ret++;
21776            printf(" %d", n_cur);
21777            printf(" %d", n_val);
21778            printf("\n");
21779        }
21780    }
21781    }
21782    function_tests++;
21783#endif
21784
21785    return(test_ret);
21786}
21787
21788
21789static int
21790test_xmlReconciliateNs(void) {
21791    int test_ret = 0;
21792
21793#if defined(LIBXML_TREE_ENABLED)
21794#ifdef LIBXML_TREE_ENABLED
21795    int mem_base;
21796    int ret_val;
21797    xmlDocPtr doc; /* the document */
21798    int n_doc;
21799    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
21800    int n_tree;
21801
21802    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21803    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
21804        mem_base = xmlMemBlocks();
21805        doc = gen_xmlDocPtr(n_doc, 0);
21806        tree = gen_xmlNodePtr(n_tree, 1);
21807
21808        ret_val = xmlReconciliateNs(doc, tree);
21809        desret_int(ret_val);
21810        call_tests++;
21811        des_xmlDocPtr(n_doc, doc, 0);
21812        des_xmlNodePtr(n_tree, tree, 1);
21813        xmlResetLastError();
21814        if (mem_base != xmlMemBlocks()) {
21815            printf("Leak of %d blocks found in xmlReconciliateNs",
21816	           xmlMemBlocks() - mem_base);
21817	    test_ret++;
21818            printf(" %d", n_doc);
21819            printf(" %d", n_tree);
21820            printf("\n");
21821        }
21822    }
21823    }
21824    function_tests++;
21825#endif
21826#endif
21827
21828    return(test_ret);
21829}
21830
21831
21832static int
21833test_xmlRemoveProp(void) {
21834    int test_ret = 0;
21835
21836#if defined(LIBXML_TREE_ENABLED)
21837    int mem_base;
21838    int ret_val;
21839    xmlAttrPtr cur; /* an attribute */
21840    int n_cur;
21841
21842    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
21843        mem_base = xmlMemBlocks();
21844        cur = gen_xmlAttrPtr(n_cur, 0);
21845
21846        ret_val = xmlRemoveProp(cur);
21847        cur = NULL;
21848        desret_int(ret_val);
21849        call_tests++;
21850        des_xmlAttrPtr(n_cur, cur, 0);
21851        xmlResetLastError();
21852        if (mem_base != xmlMemBlocks()) {
21853            printf("Leak of %d blocks found in xmlRemoveProp",
21854	           xmlMemBlocks() - mem_base);
21855	    test_ret++;
21856            printf(" %d", n_cur);
21857            printf("\n");
21858        }
21859    }
21860    function_tests++;
21861#endif
21862
21863    return(test_ret);
21864}
21865
21866
21867static int
21868test_xmlReplaceNode(void) {
21869    int test_ret = 0;
21870
21871#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
21872    int mem_base;
21873    xmlNodePtr ret_val;
21874    xmlNodePtr old; /* the old node */
21875    int n_old;
21876    xmlNodePtr cur; /* the node */
21877    int n_cur;
21878
21879    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
21880    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
21881        mem_base = xmlMemBlocks();
21882        old = gen_xmlNodePtr(n_old, 0);
21883        cur = gen_xmlNodePtr_in(n_cur, 1);
21884
21885        ret_val = xmlReplaceNode(old, cur);
21886        if (cur != NULL) {
21887              xmlUnlinkNode(cur);
21888              xmlFreeNode(cur) ; cur = NULL ; }
21889          if (old != NULL) {
21890              xmlUnlinkNode(old);
21891              xmlFreeNode(old) ; old = NULL ; }
21892	  ret_val = NULL;
21893        desret_xmlNodePtr(ret_val);
21894        call_tests++;
21895        des_xmlNodePtr(n_old, old, 0);
21896        des_xmlNodePtr_in(n_cur, cur, 1);
21897        xmlResetLastError();
21898        if (mem_base != xmlMemBlocks()) {
21899            printf("Leak of %d blocks found in xmlReplaceNode",
21900	           xmlMemBlocks() - mem_base);
21901	    test_ret++;
21902            printf(" %d", n_old);
21903            printf(" %d", n_cur);
21904            printf("\n");
21905        }
21906    }
21907    }
21908    function_tests++;
21909#endif
21910
21911    return(test_ret);
21912}
21913
21914
21915static int
21916test_xmlSaveFile(void) {
21917    int test_ret = 0;
21918
21919#if defined(LIBXML_OUTPUT_ENABLED)
21920    int mem_base;
21921    int ret_val;
21922    const char * filename; /* the filename (or URL) */
21923    int n_filename;
21924    xmlDocPtr cur; /* the document */
21925    int n_cur;
21926
21927    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21928    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21929        mem_base = xmlMemBlocks();
21930        filename = gen_fileoutput(n_filename, 0);
21931        cur = gen_xmlDocPtr(n_cur, 1);
21932
21933        ret_val = xmlSaveFile(filename, cur);
21934        desret_int(ret_val);
21935        call_tests++;
21936        des_fileoutput(n_filename, filename, 0);
21937        des_xmlDocPtr(n_cur, cur, 1);
21938        xmlResetLastError();
21939        if (mem_base != xmlMemBlocks()) {
21940            printf("Leak of %d blocks found in xmlSaveFile",
21941	           xmlMemBlocks() - mem_base);
21942	    test_ret++;
21943            printf(" %d", n_filename);
21944            printf(" %d", n_cur);
21945            printf("\n");
21946        }
21947    }
21948    }
21949    function_tests++;
21950#endif
21951
21952    return(test_ret);
21953}
21954
21955
21956static int
21957test_xmlSaveFileEnc(void) {
21958    int test_ret = 0;
21959
21960#if defined(LIBXML_OUTPUT_ENABLED)
21961    int mem_base;
21962    int ret_val;
21963    const char * filename; /* the filename (or URL) */
21964    int n_filename;
21965    xmlDocPtr cur; /* the document */
21966    int n_cur;
21967    char * encoding; /* the name of an encoding (or NULL) */
21968    int n_encoding;
21969
21970    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21971    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21972    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21973        mem_base = xmlMemBlocks();
21974        filename = gen_fileoutput(n_filename, 0);
21975        cur = gen_xmlDocPtr(n_cur, 1);
21976        encoding = gen_const_char_ptr(n_encoding, 2);
21977
21978        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
21979        desret_int(ret_val);
21980        call_tests++;
21981        des_fileoutput(n_filename, filename, 0);
21982        des_xmlDocPtr(n_cur, cur, 1);
21983        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
21984        xmlResetLastError();
21985        if (mem_base != xmlMemBlocks()) {
21986            printf("Leak of %d blocks found in xmlSaveFileEnc",
21987	           xmlMemBlocks() - mem_base);
21988	    test_ret++;
21989            printf(" %d", n_filename);
21990            printf(" %d", n_cur);
21991            printf(" %d", n_encoding);
21992            printf("\n");
21993        }
21994    }
21995    }
21996    }
21997    function_tests++;
21998#endif
21999
22000    return(test_ret);
22001}
22002
22003
22004static int
22005test_xmlSaveFileTo(void) {
22006    int test_ret = 0;
22007
22008#if defined(LIBXML_OUTPUT_ENABLED)
22009    int mem_base;
22010    int ret_val;
22011    xmlOutputBufferPtr buf; /* an output I/O buffer */
22012    int n_buf;
22013    xmlDocPtr cur; /* the document */
22014    int n_cur;
22015    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22016    int n_encoding;
22017
22018    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22019    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22020    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22021        mem_base = xmlMemBlocks();
22022        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22023        cur = gen_xmlDocPtr(n_cur, 1);
22024        encoding = gen_const_char_ptr(n_encoding, 2);
22025
22026        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22027        buf = NULL;
22028        desret_int(ret_val);
22029        call_tests++;
22030        des_xmlOutputBufferPtr(n_buf, buf, 0);
22031        des_xmlDocPtr(n_cur, cur, 1);
22032        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22033        xmlResetLastError();
22034        if (mem_base != xmlMemBlocks()) {
22035            printf("Leak of %d blocks found in xmlSaveFileTo",
22036	           xmlMemBlocks() - mem_base);
22037	    test_ret++;
22038            printf(" %d", n_buf);
22039            printf(" %d", n_cur);
22040            printf(" %d", n_encoding);
22041            printf("\n");
22042        }
22043    }
22044    }
22045    }
22046    function_tests++;
22047#endif
22048
22049    return(test_ret);
22050}
22051
22052
22053static int
22054test_xmlSaveFormatFile(void) {
22055    int test_ret = 0;
22056
22057#if defined(LIBXML_OUTPUT_ENABLED)
22058    int mem_base;
22059    int ret_val;
22060    const char * filename; /* the filename (or URL) */
22061    int n_filename;
22062    xmlDocPtr cur; /* the document */
22063    int n_cur;
22064    int format; /* should formatting spaces been added */
22065    int n_format;
22066
22067    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22068    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22069    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22070        mem_base = xmlMemBlocks();
22071        filename = gen_fileoutput(n_filename, 0);
22072        cur = gen_xmlDocPtr(n_cur, 1);
22073        format = gen_int(n_format, 2);
22074
22075        ret_val = xmlSaveFormatFile(filename, cur, format);
22076        desret_int(ret_val);
22077        call_tests++;
22078        des_fileoutput(n_filename, filename, 0);
22079        des_xmlDocPtr(n_cur, cur, 1);
22080        des_int(n_format, format, 2);
22081        xmlResetLastError();
22082        if (mem_base != xmlMemBlocks()) {
22083            printf("Leak of %d blocks found in xmlSaveFormatFile",
22084	           xmlMemBlocks() - mem_base);
22085	    test_ret++;
22086            printf(" %d", n_filename);
22087            printf(" %d", n_cur);
22088            printf(" %d", n_format);
22089            printf("\n");
22090        }
22091    }
22092    }
22093    }
22094    function_tests++;
22095#endif
22096
22097    return(test_ret);
22098}
22099
22100
22101static int
22102test_xmlSaveFormatFileEnc(void) {
22103    int test_ret = 0;
22104
22105#if defined(LIBXML_OUTPUT_ENABLED)
22106    int mem_base;
22107    int ret_val;
22108    const char * filename; /* the filename or URL to output */
22109    int n_filename;
22110    xmlDocPtr cur; /* the document being saved */
22111    int n_cur;
22112    char * encoding; /* the name of the encoding to use or NULL. */
22113    int n_encoding;
22114    int format; /* should formatting spaces be added. */
22115    int n_format;
22116
22117    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22118    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22119    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22120    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22121        mem_base = xmlMemBlocks();
22122        filename = gen_fileoutput(n_filename, 0);
22123        cur = gen_xmlDocPtr(n_cur, 1);
22124        encoding = gen_const_char_ptr(n_encoding, 2);
22125        format = gen_int(n_format, 3);
22126
22127        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22128        desret_int(ret_val);
22129        call_tests++;
22130        des_fileoutput(n_filename, filename, 0);
22131        des_xmlDocPtr(n_cur, cur, 1);
22132        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22133        des_int(n_format, format, 3);
22134        xmlResetLastError();
22135        if (mem_base != xmlMemBlocks()) {
22136            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22137	           xmlMemBlocks() - mem_base);
22138	    test_ret++;
22139            printf(" %d", n_filename);
22140            printf(" %d", n_cur);
22141            printf(" %d", n_encoding);
22142            printf(" %d", n_format);
22143            printf("\n");
22144        }
22145    }
22146    }
22147    }
22148    }
22149    function_tests++;
22150#endif
22151
22152    return(test_ret);
22153}
22154
22155
22156static int
22157test_xmlSaveFormatFileTo(void) {
22158    int test_ret = 0;
22159
22160#if defined(LIBXML_OUTPUT_ENABLED)
22161    int mem_base;
22162    int ret_val;
22163    xmlOutputBufferPtr buf; /* an output I/O buffer */
22164    int n_buf;
22165    xmlDocPtr cur; /* the document */
22166    int n_cur;
22167    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22168    int n_encoding;
22169    int format; /* should formatting spaces been added */
22170    int n_format;
22171
22172    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22173    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22174    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22175    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22176        mem_base = xmlMemBlocks();
22177        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22178        cur = gen_xmlDocPtr(n_cur, 1);
22179        encoding = gen_const_char_ptr(n_encoding, 2);
22180        format = gen_int(n_format, 3);
22181
22182        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22183        buf = NULL;
22184        desret_int(ret_val);
22185        call_tests++;
22186        des_xmlOutputBufferPtr(n_buf, buf, 0);
22187        des_xmlDocPtr(n_cur, cur, 1);
22188        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22189        des_int(n_format, format, 3);
22190        xmlResetLastError();
22191        if (mem_base != xmlMemBlocks()) {
22192            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22193	           xmlMemBlocks() - mem_base);
22194	    test_ret++;
22195            printf(" %d", n_buf);
22196            printf(" %d", n_cur);
22197            printf(" %d", n_encoding);
22198            printf(" %d", n_format);
22199            printf("\n");
22200        }
22201    }
22202    }
22203    }
22204    }
22205    function_tests++;
22206#endif
22207
22208    return(test_ret);
22209}
22210
22211
22212static int
22213test_xmlSearchNs(void) {
22214    int test_ret = 0;
22215
22216    int mem_base;
22217    xmlNsPtr ret_val;
22218    xmlDocPtr doc; /* the document */
22219    int n_doc;
22220    xmlNodePtr node; /* the current node */
22221    int n_node;
22222    xmlChar * nameSpace; /* the namespace prefix */
22223    int n_nameSpace;
22224
22225    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22226    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22227    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22228        mem_base = xmlMemBlocks();
22229        doc = gen_xmlDocPtr(n_doc, 0);
22230        node = gen_xmlNodePtr(n_node, 1);
22231        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22232
22233        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
22234        desret_xmlNsPtr(ret_val);
22235        call_tests++;
22236        des_xmlDocPtr(n_doc, doc, 0);
22237        des_xmlNodePtr(n_node, node, 1);
22238        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
22239        xmlResetLastError();
22240        if (mem_base != xmlMemBlocks()) {
22241            printf("Leak of %d blocks found in xmlSearchNs",
22242	           xmlMemBlocks() - mem_base);
22243	    test_ret++;
22244            printf(" %d", n_doc);
22245            printf(" %d", n_node);
22246            printf(" %d", n_nameSpace);
22247            printf("\n");
22248        }
22249    }
22250    }
22251    }
22252    function_tests++;
22253
22254    return(test_ret);
22255}
22256
22257
22258static int
22259test_xmlSearchNsByHref(void) {
22260    int test_ret = 0;
22261
22262    int mem_base;
22263    xmlNsPtr ret_val;
22264    xmlDocPtr doc; /* the document */
22265    int n_doc;
22266    xmlNodePtr node; /* the current node */
22267    int n_node;
22268    xmlChar * href; /* the namespace value */
22269    int n_href;
22270
22271    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22272    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22273    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22274        mem_base = xmlMemBlocks();
22275        doc = gen_xmlDocPtr(n_doc, 0);
22276        node = gen_xmlNodePtr(n_node, 1);
22277        href = gen_const_xmlChar_ptr(n_href, 2);
22278
22279        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
22280        desret_xmlNsPtr(ret_val);
22281        call_tests++;
22282        des_xmlDocPtr(n_doc, doc, 0);
22283        des_xmlNodePtr(n_node, node, 1);
22284        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
22285        xmlResetLastError();
22286        if (mem_base != xmlMemBlocks()) {
22287            printf("Leak of %d blocks found in xmlSearchNsByHref",
22288	           xmlMemBlocks() - mem_base);
22289	    test_ret++;
22290            printf(" %d", n_doc);
22291            printf(" %d", n_node);
22292            printf(" %d", n_href);
22293            printf("\n");
22294        }
22295    }
22296    }
22297    }
22298    function_tests++;
22299
22300    return(test_ret);
22301}
22302
22303
22304static int
22305test_xmlSetBufferAllocationScheme(void) {
22306    int test_ret = 0;
22307
22308    int mem_base;
22309    xmlBufferAllocationScheme scheme; /* allocation method to use */
22310    int n_scheme;
22311
22312    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
22313        mem_base = xmlMemBlocks();
22314        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
22315
22316        xmlSetBufferAllocationScheme(scheme);
22317        call_tests++;
22318        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
22319        xmlResetLastError();
22320        if (mem_base != xmlMemBlocks()) {
22321            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
22322	           xmlMemBlocks() - mem_base);
22323	    test_ret++;
22324            printf(" %d", n_scheme);
22325            printf("\n");
22326        }
22327    }
22328    function_tests++;
22329
22330    return(test_ret);
22331}
22332
22333
22334static int
22335test_xmlSetCompressMode(void) {
22336    int test_ret = 0;
22337
22338    int mem_base;
22339    int mode; /* the compression ratio */
22340    int n_mode;
22341
22342    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22343        mem_base = xmlMemBlocks();
22344        mode = gen_int(n_mode, 0);
22345
22346        xmlSetCompressMode(mode);
22347        call_tests++;
22348        des_int(n_mode, mode, 0);
22349        xmlResetLastError();
22350        if (mem_base != xmlMemBlocks()) {
22351            printf("Leak of %d blocks found in xmlSetCompressMode",
22352	           xmlMemBlocks() - mem_base);
22353	    test_ret++;
22354            printf(" %d", n_mode);
22355            printf("\n");
22356        }
22357    }
22358    function_tests++;
22359
22360    return(test_ret);
22361}
22362
22363
22364static int
22365test_xmlSetDocCompressMode(void) {
22366    int test_ret = 0;
22367
22368    int mem_base;
22369    xmlDocPtr doc; /* the document */
22370    int n_doc;
22371    int mode; /* the compression ratio */
22372    int n_mode;
22373
22374    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22375    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22376        mem_base = xmlMemBlocks();
22377        doc = gen_xmlDocPtr(n_doc, 0);
22378        mode = gen_int(n_mode, 1);
22379
22380        xmlSetDocCompressMode(doc, mode);
22381        call_tests++;
22382        des_xmlDocPtr(n_doc, doc, 0);
22383        des_int(n_mode, mode, 1);
22384        xmlResetLastError();
22385        if (mem_base != xmlMemBlocks()) {
22386            printf("Leak of %d blocks found in xmlSetDocCompressMode",
22387	           xmlMemBlocks() - mem_base);
22388	    test_ret++;
22389            printf(" %d", n_doc);
22390            printf(" %d", n_mode);
22391            printf("\n");
22392        }
22393    }
22394    }
22395    function_tests++;
22396
22397    return(test_ret);
22398}
22399
22400
22401static int
22402test_xmlSetNs(void) {
22403    int test_ret = 0;
22404
22405    int mem_base;
22406    xmlNodePtr node; /* a node in the document */
22407    int n_node;
22408    xmlNsPtr ns; /* a namespace pointer */
22409    int n_ns;
22410
22411    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22412    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22413        mem_base = xmlMemBlocks();
22414        node = gen_xmlNodePtr(n_node, 0);
22415        ns = gen_xmlNsPtr(n_ns, 1);
22416
22417        xmlSetNs(node, ns);
22418        call_tests++;
22419        des_xmlNodePtr(n_node, node, 0);
22420        des_xmlNsPtr(n_ns, ns, 1);
22421        xmlResetLastError();
22422        if (mem_base != xmlMemBlocks()) {
22423            printf("Leak of %d blocks found in xmlSetNs",
22424	           xmlMemBlocks() - mem_base);
22425	    test_ret++;
22426            printf(" %d", n_node);
22427            printf(" %d", n_ns);
22428            printf("\n");
22429        }
22430    }
22431    }
22432    function_tests++;
22433
22434    return(test_ret);
22435}
22436
22437
22438static int
22439test_xmlSetNsProp(void) {
22440    int test_ret = 0;
22441
22442#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22443    int mem_base;
22444    xmlAttrPtr ret_val;
22445    xmlNodePtr node; /* the node */
22446    int n_node;
22447    xmlNsPtr ns; /* the namespace definition */
22448    int n_ns;
22449    xmlChar * name; /* the attribute name */
22450    int n_name;
22451    xmlChar * value; /* the attribute value */
22452    int n_value;
22453
22454    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22455    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22456    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22457    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22458        mem_base = xmlMemBlocks();
22459        node = gen_xmlNodePtr(n_node, 0);
22460        ns = gen_xmlNsPtr(n_ns, 1);
22461        name = gen_const_xmlChar_ptr(n_name, 2);
22462        value = gen_const_xmlChar_ptr(n_value, 3);
22463
22464        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
22465        desret_xmlAttrPtr(ret_val);
22466        call_tests++;
22467        des_xmlNodePtr(n_node, node, 0);
22468        des_xmlNsPtr(n_ns, ns, 1);
22469        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22470        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22471        xmlResetLastError();
22472        if (mem_base != xmlMemBlocks()) {
22473            printf("Leak of %d blocks found in xmlSetNsProp",
22474	           xmlMemBlocks() - mem_base);
22475	    test_ret++;
22476            printf(" %d", n_node);
22477            printf(" %d", n_ns);
22478            printf(" %d", n_name);
22479            printf(" %d", n_value);
22480            printf("\n");
22481        }
22482    }
22483    }
22484    }
22485    }
22486    function_tests++;
22487#endif
22488
22489    return(test_ret);
22490}
22491
22492
22493static int
22494test_xmlSetProp(void) {
22495    int test_ret = 0;
22496
22497#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22498    int mem_base;
22499    xmlAttrPtr ret_val;
22500    xmlNodePtr node; /* the node */
22501    int n_node;
22502    xmlChar * name; /* the attribute name */
22503    int n_name;
22504    xmlChar * value; /* the attribute value */
22505    int n_value;
22506
22507    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22508    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22509    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22510        mem_base = xmlMemBlocks();
22511        node = gen_xmlNodePtr(n_node, 0);
22512        name = gen_const_xmlChar_ptr(n_name, 1);
22513        value = gen_const_xmlChar_ptr(n_value, 2);
22514
22515        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
22516        desret_xmlAttrPtr(ret_val);
22517        call_tests++;
22518        des_xmlNodePtr(n_node, node, 0);
22519        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22520        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22521        xmlResetLastError();
22522        if (mem_base != xmlMemBlocks()) {
22523            printf("Leak of %d blocks found in xmlSetProp",
22524	           xmlMemBlocks() - mem_base);
22525	    test_ret++;
22526            printf(" %d", n_node);
22527            printf(" %d", n_name);
22528            printf(" %d", n_value);
22529            printf("\n");
22530        }
22531    }
22532    }
22533    }
22534    function_tests++;
22535#endif
22536
22537    return(test_ret);
22538}
22539
22540
22541static int
22542test_xmlSplitQName2(void) {
22543    int test_ret = 0;
22544
22545    int mem_base;
22546    xmlChar * ret_val;
22547    xmlChar * name; /* the full QName */
22548    int n_name;
22549    xmlChar ** prefix; /* a xmlChar ** */
22550    int n_prefix;
22551
22552    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22553    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
22554        mem_base = xmlMemBlocks();
22555        name = gen_const_xmlChar_ptr(n_name, 0);
22556        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
22557
22558        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
22559        desret_xmlChar_ptr(ret_val);
22560        call_tests++;
22561        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22562        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
22563        xmlResetLastError();
22564        if (mem_base != xmlMemBlocks()) {
22565            printf("Leak of %d blocks found in xmlSplitQName2",
22566	           xmlMemBlocks() - mem_base);
22567	    test_ret++;
22568            printf(" %d", n_name);
22569            printf(" %d", n_prefix);
22570            printf("\n");
22571        }
22572    }
22573    }
22574    function_tests++;
22575
22576    return(test_ret);
22577}
22578
22579
22580static int
22581test_xmlSplitQName3(void) {
22582    int test_ret = 0;
22583
22584    int mem_base;
22585    const xmlChar * ret_val;
22586    xmlChar * name; /* the full QName */
22587    int n_name;
22588    int * len; /* an int * */
22589    int n_len;
22590
22591    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22592    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
22593        mem_base = xmlMemBlocks();
22594        name = gen_const_xmlChar_ptr(n_name, 0);
22595        len = gen_int_ptr(n_len, 1);
22596
22597        ret_val = xmlSplitQName3((const xmlChar *)name, len);
22598        desret_const_xmlChar_ptr(ret_val);
22599        call_tests++;
22600        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22601        des_int_ptr(n_len, len, 1);
22602        xmlResetLastError();
22603        if (mem_base != xmlMemBlocks()) {
22604            printf("Leak of %d blocks found in xmlSplitQName3",
22605	           xmlMemBlocks() - mem_base);
22606	    test_ret++;
22607            printf(" %d", n_name);
22608            printf(" %d", n_len);
22609            printf("\n");
22610        }
22611    }
22612    }
22613    function_tests++;
22614
22615    return(test_ret);
22616}
22617
22618
22619static int
22620test_xmlStringGetNodeList(void) {
22621    int test_ret = 0;
22622
22623    int mem_base;
22624    xmlNodePtr ret_val;
22625    xmlDocPtr doc; /* the document */
22626    int n_doc;
22627    xmlChar * value; /* the value of the attribute */
22628    int n_value;
22629
22630    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22631    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22632        mem_base = xmlMemBlocks();
22633        doc = gen_xmlDocPtr(n_doc, 0);
22634        value = gen_const_xmlChar_ptr(n_value, 1);
22635
22636        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
22637        desret_xmlNodePtr(ret_val);
22638        call_tests++;
22639        des_xmlDocPtr(n_doc, doc, 0);
22640        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
22641        xmlResetLastError();
22642        if (mem_base != xmlMemBlocks()) {
22643            printf("Leak of %d blocks found in xmlStringGetNodeList",
22644	           xmlMemBlocks() - mem_base);
22645	    test_ret++;
22646            printf(" %d", n_doc);
22647            printf(" %d", n_value);
22648            printf("\n");
22649        }
22650    }
22651    }
22652    function_tests++;
22653
22654    return(test_ret);
22655}
22656
22657
22658static int
22659test_xmlStringLenGetNodeList(void) {
22660    int test_ret = 0;
22661
22662    int mem_base;
22663    xmlNodePtr ret_val;
22664    xmlDocPtr doc; /* the document */
22665    int n_doc;
22666    xmlChar * value; /* the value of the text */
22667    int n_value;
22668    int len; /* the length of the string value */
22669    int n_len;
22670
22671    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22672    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22673    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22674        mem_base = xmlMemBlocks();
22675        doc = gen_xmlDocPtr(n_doc, 0);
22676        value = gen_const_xmlChar_ptr(n_value, 1);
22677        len = gen_int(n_len, 2);
22678
22679        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
22680        desret_xmlNodePtr(ret_val);
22681        call_tests++;
22682        des_xmlDocPtr(n_doc, doc, 0);
22683        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
22684        des_int(n_len, len, 2);
22685        xmlResetLastError();
22686        if (mem_base != xmlMemBlocks()) {
22687            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
22688	           xmlMemBlocks() - mem_base);
22689	    test_ret++;
22690            printf(" %d", n_doc);
22691            printf(" %d", n_value);
22692            printf(" %d", n_len);
22693            printf("\n");
22694        }
22695    }
22696    }
22697    }
22698    function_tests++;
22699
22700    return(test_ret);
22701}
22702
22703
22704static int
22705test_xmlTextConcat(void) {
22706    int test_ret = 0;
22707
22708    int mem_base;
22709    int ret_val;
22710    xmlNodePtr node; /* the node */
22711    int n_node;
22712    xmlChar * content; /* the content */
22713    int n_content;
22714    int len; /* @content length */
22715    int n_len;
22716
22717    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22718    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22719    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22720        mem_base = xmlMemBlocks();
22721        node = gen_xmlNodePtr(n_node, 0);
22722        content = gen_const_xmlChar_ptr(n_content, 1);
22723        len = gen_int(n_len, 2);
22724
22725        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
22726        desret_int(ret_val);
22727        call_tests++;
22728        des_xmlNodePtr(n_node, node, 0);
22729        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22730        des_int(n_len, len, 2);
22731        xmlResetLastError();
22732        if (mem_base != xmlMemBlocks()) {
22733            printf("Leak of %d blocks found in xmlTextConcat",
22734	           xmlMemBlocks() - mem_base);
22735	    test_ret++;
22736            printf(" %d", n_node);
22737            printf(" %d", n_content);
22738            printf(" %d", n_len);
22739            printf("\n");
22740        }
22741    }
22742    }
22743    }
22744    function_tests++;
22745
22746    return(test_ret);
22747}
22748
22749
22750static int
22751test_xmlTextMerge(void) {
22752    int test_ret = 0;
22753
22754    int mem_base;
22755    xmlNodePtr ret_val;
22756    xmlNodePtr first; /* the first text node */
22757    int n_first;
22758    xmlNodePtr second; /* the second text node being merged */
22759    int n_second;
22760
22761    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
22762    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
22763        mem_base = xmlMemBlocks();
22764        first = gen_xmlNodePtr_in(n_first, 0);
22765        second = gen_xmlNodePtr_in(n_second, 1);
22766
22767        ret_val = xmlTextMerge(first, second);
22768        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
22769              xmlUnlinkNode(second);
22770              xmlFreeNode(second) ; second = NULL ; }
22771        desret_xmlNodePtr(ret_val);
22772        call_tests++;
22773        des_xmlNodePtr_in(n_first, first, 0);
22774        des_xmlNodePtr_in(n_second, second, 1);
22775        xmlResetLastError();
22776        if (mem_base != xmlMemBlocks()) {
22777            printf("Leak of %d blocks found in xmlTextMerge",
22778	           xmlMemBlocks() - mem_base);
22779	    test_ret++;
22780            printf(" %d", n_first);
22781            printf(" %d", n_second);
22782            printf("\n");
22783        }
22784    }
22785    }
22786    function_tests++;
22787
22788    return(test_ret);
22789}
22790
22791
22792static int
22793test_xmlUnsetNsProp(void) {
22794    int test_ret = 0;
22795
22796#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22797    int mem_base;
22798    int ret_val;
22799    xmlNodePtr node; /* the node */
22800    int n_node;
22801    xmlNsPtr ns; /* the namespace definition */
22802    int n_ns;
22803    xmlChar * name; /* the attribute name */
22804    int n_name;
22805
22806    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22807    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22808    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22809        mem_base = xmlMemBlocks();
22810        node = gen_xmlNodePtr(n_node, 0);
22811        ns = gen_xmlNsPtr(n_ns, 1);
22812        name = gen_const_xmlChar_ptr(n_name, 2);
22813
22814        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
22815        desret_int(ret_val);
22816        call_tests++;
22817        des_xmlNodePtr(n_node, node, 0);
22818        des_xmlNsPtr(n_ns, ns, 1);
22819        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22820        xmlResetLastError();
22821        if (mem_base != xmlMemBlocks()) {
22822            printf("Leak of %d blocks found in xmlUnsetNsProp",
22823	           xmlMemBlocks() - mem_base);
22824	    test_ret++;
22825            printf(" %d", n_node);
22826            printf(" %d", n_ns);
22827            printf(" %d", n_name);
22828            printf("\n");
22829        }
22830    }
22831    }
22832    }
22833    function_tests++;
22834#endif
22835
22836    return(test_ret);
22837}
22838
22839
22840static int
22841test_xmlUnsetProp(void) {
22842    int test_ret = 0;
22843
22844#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22845    int mem_base;
22846    int ret_val;
22847    xmlNodePtr node; /* the node */
22848    int n_node;
22849    xmlChar * name; /* the attribute name */
22850    int n_name;
22851
22852    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22853    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22854        mem_base = xmlMemBlocks();
22855        node = gen_xmlNodePtr(n_node, 0);
22856        name = gen_const_xmlChar_ptr(n_name, 1);
22857
22858        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
22859        desret_int(ret_val);
22860        call_tests++;
22861        des_xmlNodePtr(n_node, node, 0);
22862        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22863        xmlResetLastError();
22864        if (mem_base != xmlMemBlocks()) {
22865            printf("Leak of %d blocks found in xmlUnsetProp",
22866	           xmlMemBlocks() - mem_base);
22867	    test_ret++;
22868            printf(" %d", n_node);
22869            printf(" %d", n_name);
22870            printf("\n");
22871        }
22872    }
22873    }
22874    function_tests++;
22875#endif
22876
22877    return(test_ret);
22878}
22879
22880
22881static int
22882test_xmlValidateNCName(void) {
22883    int test_ret = 0;
22884
22885#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
22886#ifdef LIBXML_TREE_ENABLED
22887    int mem_base;
22888    int ret_val;
22889    xmlChar * value; /* the value to check */
22890    int n_value;
22891    int space; /* allow spaces in front and end of the string */
22892    int n_space;
22893
22894    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22895    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22896        mem_base = xmlMemBlocks();
22897        value = gen_const_xmlChar_ptr(n_value, 0);
22898        space = gen_int(n_space, 1);
22899
22900        ret_val = xmlValidateNCName((const xmlChar *)value, space);
22901        desret_int(ret_val);
22902        call_tests++;
22903        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22904        des_int(n_space, space, 1);
22905        xmlResetLastError();
22906        if (mem_base != xmlMemBlocks()) {
22907            printf("Leak of %d blocks found in xmlValidateNCName",
22908	           xmlMemBlocks() - mem_base);
22909	    test_ret++;
22910            printf(" %d", n_value);
22911            printf(" %d", n_space);
22912            printf("\n");
22913        }
22914    }
22915    }
22916    function_tests++;
22917#endif
22918#endif
22919
22920    return(test_ret);
22921}
22922
22923
22924static int
22925test_xmlValidateNMToken(void) {
22926    int test_ret = 0;
22927
22928#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22929#ifdef LIBXML_TREE_ENABLED
22930    int mem_base;
22931    int ret_val;
22932    xmlChar * value; /* the value to check */
22933    int n_value;
22934    int space; /* allow spaces in front and end of the string */
22935    int n_space;
22936
22937    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22938    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22939        mem_base = xmlMemBlocks();
22940        value = gen_const_xmlChar_ptr(n_value, 0);
22941        space = gen_int(n_space, 1);
22942
22943        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
22944        desret_int(ret_val);
22945        call_tests++;
22946        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22947        des_int(n_space, space, 1);
22948        xmlResetLastError();
22949        if (mem_base != xmlMemBlocks()) {
22950            printf("Leak of %d blocks found in xmlValidateNMToken",
22951	           xmlMemBlocks() - mem_base);
22952	    test_ret++;
22953            printf(" %d", n_value);
22954            printf(" %d", n_space);
22955            printf("\n");
22956        }
22957    }
22958    }
22959    function_tests++;
22960#endif
22961#endif
22962
22963    return(test_ret);
22964}
22965
22966
22967static int
22968test_xmlValidateName(void) {
22969    int test_ret = 0;
22970
22971#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22972#ifdef LIBXML_TREE_ENABLED
22973    int mem_base;
22974    int ret_val;
22975    xmlChar * value; /* the value to check */
22976    int n_value;
22977    int space; /* allow spaces in front and end of the string */
22978    int n_space;
22979
22980    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22981    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22982        mem_base = xmlMemBlocks();
22983        value = gen_const_xmlChar_ptr(n_value, 0);
22984        space = gen_int(n_space, 1);
22985
22986        ret_val = xmlValidateName((const xmlChar *)value, space);
22987        desret_int(ret_val);
22988        call_tests++;
22989        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22990        des_int(n_space, space, 1);
22991        xmlResetLastError();
22992        if (mem_base != xmlMemBlocks()) {
22993            printf("Leak of %d blocks found in xmlValidateName",
22994	           xmlMemBlocks() - mem_base);
22995	    test_ret++;
22996            printf(" %d", n_value);
22997            printf(" %d", n_space);
22998            printf("\n");
22999        }
23000    }
23001    }
23002    function_tests++;
23003#endif
23004#endif
23005
23006    return(test_ret);
23007}
23008
23009
23010static int
23011test_xmlValidateQName(void) {
23012    int test_ret = 0;
23013
23014#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23015#ifdef LIBXML_TREE_ENABLED
23016    int mem_base;
23017    int ret_val;
23018    xmlChar * value; /* the value to check */
23019    int n_value;
23020    int space; /* allow spaces in front and end of the string */
23021    int n_space;
23022
23023    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23024    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23025        mem_base = xmlMemBlocks();
23026        value = gen_const_xmlChar_ptr(n_value, 0);
23027        space = gen_int(n_space, 1);
23028
23029        ret_val = xmlValidateQName((const xmlChar *)value, space);
23030        desret_int(ret_val);
23031        call_tests++;
23032        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23033        des_int(n_space, space, 1);
23034        xmlResetLastError();
23035        if (mem_base != xmlMemBlocks()) {
23036            printf("Leak of %d blocks found in xmlValidateQName",
23037	           xmlMemBlocks() - mem_base);
23038	    test_ret++;
23039            printf(" %d", n_value);
23040            printf(" %d", n_space);
23041            printf("\n");
23042        }
23043    }
23044    }
23045    function_tests++;
23046#endif
23047#endif
23048
23049    return(test_ret);
23050}
23051
23052static int
23053test_tree(void) {
23054    int test_ret = 0;
23055
23056    if (quiet == 0) printf("Testing tree : 129 of 146 functions ...\n");
23057    test_ret += test_xmlAddChild();
23058    test_ret += test_xmlAddChildList();
23059    test_ret += test_xmlAddNextSibling();
23060    test_ret += test_xmlAddPrevSibling();
23061    test_ret += test_xmlAddSibling();
23062    test_ret += test_xmlAttrSerializeTxtContent();
23063    test_ret += test_xmlBufferAdd();
23064    test_ret += test_xmlBufferAddHead();
23065    test_ret += test_xmlBufferCCat();
23066    test_ret += test_xmlBufferCat();
23067    test_ret += test_xmlBufferContent();
23068    test_ret += test_xmlBufferCreate();
23069    test_ret += test_xmlBufferCreateSize();
23070    test_ret += test_xmlBufferCreateStatic();
23071    test_ret += test_xmlBufferEmpty();
23072    test_ret += test_xmlBufferGrow();
23073    test_ret += test_xmlBufferLength();
23074    test_ret += test_xmlBufferResize();
23075    test_ret += test_xmlBufferSetAllocationScheme();
23076    test_ret += test_xmlBufferShrink();
23077    test_ret += test_xmlBufferWriteCHAR();
23078    test_ret += test_xmlBufferWriteChar();
23079    test_ret += test_xmlBufferWriteQuotedString();
23080    test_ret += test_xmlBuildQName();
23081    test_ret += test_xmlCopyDoc();
23082    test_ret += test_xmlCopyDtd();
23083    test_ret += test_xmlCopyNamespace();
23084    test_ret += test_xmlCopyNamespaceList();
23085    test_ret += test_xmlCopyNode();
23086    test_ret += test_xmlCopyNodeList();
23087    test_ret += test_xmlCopyProp();
23088    test_ret += test_xmlCopyPropList();
23089    test_ret += test_xmlCreateIntSubset();
23090    test_ret += test_xmlDocCopyNode();
23091    test_ret += test_xmlDocCopyNodeList();
23092    test_ret += test_xmlDocDump();
23093    test_ret += test_xmlDocDumpFormatMemory();
23094    test_ret += test_xmlDocDumpFormatMemoryEnc();
23095    test_ret += test_xmlDocDumpMemory();
23096    test_ret += test_xmlDocDumpMemoryEnc();
23097    test_ret += test_xmlDocFormatDump();
23098    test_ret += test_xmlDocGetRootElement();
23099    test_ret += test_xmlDocSetRootElement();
23100    test_ret += test_xmlElemDump();
23101    test_ret += test_xmlGetBufferAllocationScheme();
23102    test_ret += test_xmlGetCompressMode();
23103    test_ret += test_xmlGetDocCompressMode();
23104    test_ret += test_xmlGetIntSubset();
23105    test_ret += test_xmlGetLastChild();
23106    test_ret += test_xmlGetLineNo();
23107    test_ret += test_xmlGetNoNsProp();
23108    test_ret += test_xmlGetNodePath();
23109    test_ret += test_xmlGetNsList();
23110    test_ret += test_xmlGetNsProp();
23111    test_ret += test_xmlGetProp();
23112    test_ret += test_xmlHasNsProp();
23113    test_ret += test_xmlHasProp();
23114    test_ret += test_xmlIsBlankNode();
23115    test_ret += test_xmlIsXHTML();
23116    test_ret += test_xmlNewCDataBlock();
23117    test_ret += test_xmlNewCharRef();
23118    test_ret += test_xmlNewChild();
23119    test_ret += test_xmlNewComment();
23120    test_ret += test_xmlNewDoc();
23121    test_ret += test_xmlNewDocComment();
23122    test_ret += test_xmlNewDocFragment();
23123    test_ret += test_xmlNewDocNode();
23124    test_ret += test_xmlNewDocNodeEatName();
23125    test_ret += test_xmlNewDocPI();
23126    test_ret += test_xmlNewDocProp();
23127    test_ret += test_xmlNewDocRawNode();
23128    test_ret += test_xmlNewDocText();
23129    test_ret += test_xmlNewDocTextLen();
23130    test_ret += test_xmlNewDtd();
23131    test_ret += test_xmlNewNode();
23132    test_ret += test_xmlNewNodeEatName();
23133    test_ret += test_xmlNewNs();
23134    test_ret += test_xmlNewNsProp();
23135    test_ret += test_xmlNewNsPropEatName();
23136    test_ret += test_xmlNewPI();
23137    test_ret += test_xmlNewProp();
23138    test_ret += test_xmlNewReference();
23139    test_ret += test_xmlNewText();
23140    test_ret += test_xmlNewTextChild();
23141    test_ret += test_xmlNewTextLen();
23142    test_ret += test_xmlNodeAddContent();
23143    test_ret += test_xmlNodeAddContentLen();
23144    test_ret += test_xmlNodeBufGetContent();
23145    test_ret += test_xmlNodeDump();
23146    test_ret += test_xmlNodeDumpOutput();
23147    test_ret += test_xmlNodeGetBase();
23148    test_ret += test_xmlNodeGetContent();
23149    test_ret += test_xmlNodeGetLang();
23150    test_ret += test_xmlNodeGetSpacePreserve();
23151    test_ret += test_xmlNodeIsText();
23152    test_ret += test_xmlNodeListGetRawString();
23153    test_ret += test_xmlNodeListGetString();
23154    test_ret += test_xmlNodeSetBase();
23155    test_ret += test_xmlNodeSetContent();
23156    test_ret += test_xmlNodeSetContentLen();
23157    test_ret += test_xmlNodeSetLang();
23158    test_ret += test_xmlNodeSetName();
23159    test_ret += test_xmlNodeSetSpacePreserve();
23160    test_ret += test_xmlReconciliateNs();
23161    test_ret += test_xmlRemoveProp();
23162    test_ret += test_xmlReplaceNode();
23163    test_ret += test_xmlSaveFile();
23164    test_ret += test_xmlSaveFileEnc();
23165    test_ret += test_xmlSaveFileTo();
23166    test_ret += test_xmlSaveFormatFile();
23167    test_ret += test_xmlSaveFormatFileEnc();
23168    test_ret += test_xmlSaveFormatFileTo();
23169    test_ret += test_xmlSearchNs();
23170    test_ret += test_xmlSearchNsByHref();
23171    test_ret += test_xmlSetBufferAllocationScheme();
23172    test_ret += test_xmlSetCompressMode();
23173    test_ret += test_xmlSetDocCompressMode();
23174    test_ret += test_xmlSetNs();
23175    test_ret += test_xmlSetNsProp();
23176    test_ret += test_xmlSetProp();
23177    test_ret += test_xmlSplitQName2();
23178    test_ret += test_xmlSplitQName3();
23179    test_ret += test_xmlStringGetNodeList();
23180    test_ret += test_xmlStringLenGetNodeList();
23181    test_ret += test_xmlTextConcat();
23182    test_ret += test_xmlTextMerge();
23183    test_ret += test_xmlUnsetNsProp();
23184    test_ret += test_xmlUnsetProp();
23185    test_ret += test_xmlValidateNCName();
23186    test_ret += test_xmlValidateNMToken();
23187    test_ret += test_xmlValidateName();
23188    test_ret += test_xmlValidateQName();
23189
23190    if (test_ret != 0)
23191	printf("Module tree: %d errors\n", test_ret);
23192    return(test_ret);
23193}
23194
23195static int
23196test_xmlBuildRelativeURI(void) {
23197    int test_ret = 0;
23198
23199    int mem_base;
23200    xmlChar * ret_val;
23201    xmlChar * URI; /* the URI reference under consideration */
23202    int n_URI;
23203    xmlChar * base; /* the base value */
23204    int n_base;
23205
23206    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23207    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23208        mem_base = xmlMemBlocks();
23209        URI = gen_const_xmlChar_ptr(n_URI, 0);
23210        base = gen_const_xmlChar_ptr(n_base, 1);
23211
23212        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
23213        desret_xmlChar_ptr(ret_val);
23214        call_tests++;
23215        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23216        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23217        xmlResetLastError();
23218        if (mem_base != xmlMemBlocks()) {
23219            printf("Leak of %d blocks found in xmlBuildRelativeURI",
23220	           xmlMemBlocks() - mem_base);
23221	    test_ret++;
23222            printf(" %d", n_URI);
23223            printf(" %d", n_base);
23224            printf("\n");
23225        }
23226    }
23227    }
23228    function_tests++;
23229
23230    return(test_ret);
23231}
23232
23233
23234static int
23235test_xmlBuildURI(void) {
23236    int test_ret = 0;
23237
23238    int mem_base;
23239    xmlChar * ret_val;
23240    xmlChar * URI; /* the URI instance found in the document */
23241    int n_URI;
23242    xmlChar * base; /* the base value */
23243    int n_base;
23244
23245    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23246    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23247        mem_base = xmlMemBlocks();
23248        URI = gen_const_xmlChar_ptr(n_URI, 0);
23249        base = gen_const_xmlChar_ptr(n_base, 1);
23250
23251        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
23252        desret_xmlChar_ptr(ret_val);
23253        call_tests++;
23254        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23255        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23256        xmlResetLastError();
23257        if (mem_base != xmlMemBlocks()) {
23258            printf("Leak of %d blocks found in xmlBuildURI",
23259	           xmlMemBlocks() - mem_base);
23260	    test_ret++;
23261            printf(" %d", n_URI);
23262            printf(" %d", n_base);
23263            printf("\n");
23264        }
23265    }
23266    }
23267    function_tests++;
23268
23269    return(test_ret);
23270}
23271
23272
23273static int
23274test_xmlCanonicPath(void) {
23275    int test_ret = 0;
23276
23277    int mem_base;
23278    xmlChar * ret_val;
23279    xmlChar * path; /* the resource locator in a filesystem notation */
23280    int n_path;
23281
23282    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
23283        mem_base = xmlMemBlocks();
23284        path = gen_const_xmlChar_ptr(n_path, 0);
23285
23286        ret_val = xmlCanonicPath((const xmlChar *)path);
23287        desret_xmlChar_ptr(ret_val);
23288        call_tests++;
23289        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
23290        xmlResetLastError();
23291        if (mem_base != xmlMemBlocks()) {
23292            printf("Leak of %d blocks found in xmlCanonicPath",
23293	           xmlMemBlocks() - mem_base);
23294	    test_ret++;
23295            printf(" %d", n_path);
23296            printf("\n");
23297        }
23298    }
23299    function_tests++;
23300
23301    return(test_ret);
23302}
23303
23304
23305static int
23306test_xmlCreateURI(void) {
23307    int test_ret = 0;
23308
23309
23310    /* missing type support */
23311    return(test_ret);
23312}
23313
23314
23315static int
23316test_xmlNormalizeURIPath(void) {
23317    int test_ret = 0;
23318
23319    int mem_base;
23320    int ret_val;
23321    char * path; /* pointer to the path string */
23322    int n_path;
23323
23324    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
23325        mem_base = xmlMemBlocks();
23326        path = gen_char_ptr(n_path, 0);
23327
23328        ret_val = xmlNormalizeURIPath(path);
23329        desret_int(ret_val);
23330        call_tests++;
23331        des_char_ptr(n_path, path, 0);
23332        xmlResetLastError();
23333        if (mem_base != xmlMemBlocks()) {
23334            printf("Leak of %d blocks found in xmlNormalizeURIPath",
23335	           xmlMemBlocks() - mem_base);
23336	    test_ret++;
23337            printf(" %d", n_path);
23338            printf("\n");
23339        }
23340    }
23341    function_tests++;
23342
23343    return(test_ret);
23344}
23345
23346
23347static int
23348test_xmlParseURI(void) {
23349    int test_ret = 0;
23350
23351
23352    /* missing type support */
23353    return(test_ret);
23354}
23355
23356
23357#define gen_nb_xmlURIPtr 1
23358static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23359    return(NULL);
23360}
23361static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23362}
23363
23364static int
23365test_xmlParseURIReference(void) {
23366    int test_ret = 0;
23367
23368    int mem_base;
23369    int ret_val;
23370    xmlURIPtr uri; /* pointer to an URI structure */
23371    int n_uri;
23372    char * str; /* the string to analyze */
23373    int n_str;
23374
23375    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23376    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
23377        mem_base = xmlMemBlocks();
23378        uri = gen_xmlURIPtr(n_uri, 0);
23379        str = gen_const_char_ptr(n_str, 1);
23380
23381        ret_val = xmlParseURIReference(uri, (const char *)str);
23382        desret_int(ret_val);
23383        call_tests++;
23384        des_xmlURIPtr(n_uri, uri, 0);
23385        des_const_char_ptr(n_str, (const char *)str, 1);
23386        xmlResetLastError();
23387        if (mem_base != xmlMemBlocks()) {
23388            printf("Leak of %d blocks found in xmlParseURIReference",
23389	           xmlMemBlocks() - mem_base);
23390	    test_ret++;
23391            printf(" %d", n_uri);
23392            printf(" %d", n_str);
23393            printf("\n");
23394        }
23395    }
23396    }
23397    function_tests++;
23398
23399    return(test_ret);
23400}
23401
23402
23403static int
23404test_xmlPrintURI(void) {
23405    int test_ret = 0;
23406
23407    int mem_base;
23408    FILE * stream; /* a FILE* for the output */
23409    int n_stream;
23410    xmlURIPtr uri; /* pointer to an xmlURI */
23411    int n_uri;
23412
23413    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
23414    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23415        mem_base = xmlMemBlocks();
23416        stream = gen_FILE_ptr(n_stream, 0);
23417        uri = gen_xmlURIPtr(n_uri, 1);
23418
23419        xmlPrintURI(stream, uri);
23420        call_tests++;
23421        des_FILE_ptr(n_stream, stream, 0);
23422        des_xmlURIPtr(n_uri, uri, 1);
23423        xmlResetLastError();
23424        if (mem_base != xmlMemBlocks()) {
23425            printf("Leak of %d blocks found in xmlPrintURI",
23426	           xmlMemBlocks() - mem_base);
23427	    test_ret++;
23428            printf(" %d", n_stream);
23429            printf(" %d", n_uri);
23430            printf("\n");
23431        }
23432    }
23433    }
23434    function_tests++;
23435
23436    return(test_ret);
23437}
23438
23439
23440static int
23441test_xmlSaveUri(void) {
23442    int test_ret = 0;
23443
23444    int mem_base;
23445    xmlChar * ret_val;
23446    xmlURIPtr uri; /* pointer to an xmlURI */
23447    int n_uri;
23448
23449    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23450        mem_base = xmlMemBlocks();
23451        uri = gen_xmlURIPtr(n_uri, 0);
23452
23453        ret_val = xmlSaveUri(uri);
23454        desret_xmlChar_ptr(ret_val);
23455        call_tests++;
23456        des_xmlURIPtr(n_uri, uri, 0);
23457        xmlResetLastError();
23458        if (mem_base != xmlMemBlocks()) {
23459            printf("Leak of %d blocks found in xmlSaveUri",
23460	           xmlMemBlocks() - mem_base);
23461	    test_ret++;
23462            printf(" %d", n_uri);
23463            printf("\n");
23464        }
23465    }
23466    function_tests++;
23467
23468    return(test_ret);
23469}
23470
23471
23472static int
23473test_xmlURIEscape(void) {
23474    int test_ret = 0;
23475
23476    int mem_base;
23477    xmlChar * ret_val;
23478    xmlChar * str; /* the string of the URI to escape */
23479    int n_str;
23480
23481    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23482        mem_base = xmlMemBlocks();
23483        str = gen_const_xmlChar_ptr(n_str, 0);
23484
23485        ret_val = xmlURIEscape((const xmlChar *)str);
23486        desret_xmlChar_ptr(ret_val);
23487        call_tests++;
23488        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23489        xmlResetLastError();
23490        if (mem_base != xmlMemBlocks()) {
23491            printf("Leak of %d blocks found in xmlURIEscape",
23492	           xmlMemBlocks() - mem_base);
23493	    test_ret++;
23494            printf(" %d", n_str);
23495            printf("\n");
23496        }
23497    }
23498    function_tests++;
23499
23500    return(test_ret);
23501}
23502
23503
23504static int
23505test_xmlURIEscapeStr(void) {
23506    int test_ret = 0;
23507
23508    int mem_base;
23509    xmlChar * ret_val;
23510    xmlChar * str; /* string to escape */
23511    int n_str;
23512    xmlChar * list; /* exception list string of chars not to escape */
23513    int n_list;
23514
23515    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23516    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
23517        mem_base = xmlMemBlocks();
23518        str = gen_const_xmlChar_ptr(n_str, 0);
23519        list = gen_const_xmlChar_ptr(n_list, 1);
23520
23521        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
23522        desret_xmlChar_ptr(ret_val);
23523        call_tests++;
23524        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23525        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
23526        xmlResetLastError();
23527        if (mem_base != xmlMemBlocks()) {
23528            printf("Leak of %d blocks found in xmlURIEscapeStr",
23529	           xmlMemBlocks() - mem_base);
23530	    test_ret++;
23531            printf(" %d", n_str);
23532            printf(" %d", n_list);
23533            printf("\n");
23534        }
23535    }
23536    }
23537    function_tests++;
23538
23539    return(test_ret);
23540}
23541
23542
23543static int
23544test_xmlURIUnescapeString(void) {
23545    int test_ret = 0;
23546
23547
23548    /* missing type support */
23549    return(test_ret);
23550}
23551
23552static int
23553test_uri(void) {
23554    int test_ret = 0;
23555
23556    if (quiet == 0) printf("Testing uri : 9 of 13 functions ...\n");
23557    test_ret += test_xmlBuildRelativeURI();
23558    test_ret += test_xmlBuildURI();
23559    test_ret += test_xmlCanonicPath();
23560    test_ret += test_xmlCreateURI();
23561    test_ret += test_xmlNormalizeURIPath();
23562    test_ret += test_xmlParseURI();
23563    test_ret += test_xmlParseURIReference();
23564    test_ret += test_xmlPrintURI();
23565    test_ret += test_xmlSaveUri();
23566    test_ret += test_xmlURIEscape();
23567    test_ret += test_xmlURIEscapeStr();
23568    test_ret += test_xmlURIUnescapeString();
23569
23570    if (test_ret != 0)
23571	printf("Module uri: %d errors\n", test_ret);
23572    return(test_ret);
23573}
23574
23575static int
23576test_xmlAddAttributeDecl(void) {
23577    int test_ret = 0;
23578
23579    int mem_base;
23580    xmlAttributePtr ret_val;
23581    xmlValidCtxtPtr ctxt; /* the validation context */
23582    int n_ctxt;
23583    xmlDtdPtr dtd; /* pointer to the DTD */
23584    int n_dtd;
23585    xmlChar * elem; /* the element name */
23586    int n_elem;
23587    xmlChar * name; /* the attribute name */
23588    int n_name;
23589    xmlChar * ns; /* the attribute namespace prefix */
23590    int n_ns;
23591    xmlAttributeType type; /* the attribute type */
23592    int n_type;
23593    xmlAttributeDefault def; /* the attribute default type */
23594    int n_def;
23595    xmlChar * defaultValue; /* the attribute default value */
23596    int n_defaultValue;
23597    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
23598    int n_tree;
23599
23600    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23601    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23602    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23603    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23604    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
23605    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
23606    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
23607    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
23608    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
23609        mem_base = xmlMemBlocks();
23610        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23611        dtd = gen_xmlDtdPtr(n_dtd, 1);
23612        elem = gen_const_xmlChar_ptr(n_elem, 2);
23613        name = gen_const_xmlChar_ptr(n_name, 3);
23614        ns = gen_const_xmlChar_ptr(n_ns, 4);
23615        type = gen_xmlAttributeType(n_type, 5);
23616        def = gen_xmlAttributeDefault(n_def, 6);
23617        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
23618        tree = gen_xmlEnumerationPtr(n_tree, 8);
23619
23620        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
23621        desret_xmlAttributePtr(ret_val);
23622        call_tests++;
23623        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23624        des_xmlDtdPtr(n_dtd, dtd, 1);
23625        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
23626        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
23627        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
23628        des_xmlAttributeType(n_type, type, 5);
23629        des_xmlAttributeDefault(n_def, def, 6);
23630        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
23631        des_xmlEnumerationPtr(n_tree, tree, 8);
23632        xmlResetLastError();
23633        if (mem_base != xmlMemBlocks()) {
23634            printf("Leak of %d blocks found in xmlAddAttributeDecl",
23635	           xmlMemBlocks() - mem_base);
23636	    test_ret++;
23637            printf(" %d", n_ctxt);
23638            printf(" %d", n_dtd);
23639            printf(" %d", n_elem);
23640            printf(" %d", n_name);
23641            printf(" %d", n_ns);
23642            printf(" %d", n_type);
23643            printf(" %d", n_def);
23644            printf(" %d", n_defaultValue);
23645            printf(" %d", n_tree);
23646            printf("\n");
23647        }
23648    }
23649    }
23650    }
23651    }
23652    }
23653    }
23654    }
23655    }
23656    }
23657    function_tests++;
23658
23659    return(test_ret);
23660}
23661
23662
23663static int
23664test_xmlAddElementDecl(void) {
23665    int test_ret = 0;
23666
23667    int mem_base;
23668    xmlElementPtr ret_val;
23669    xmlValidCtxtPtr ctxt; /* the validation context */
23670    int n_ctxt;
23671    xmlDtdPtr dtd; /* pointer to the DTD */
23672    int n_dtd;
23673    xmlChar * name; /* the entity name */
23674    int n_name;
23675    xmlElementTypeVal type; /* the element type */
23676    int n_type;
23677    xmlElementContentPtr content; /* the element content tree or NULL */
23678    int n_content;
23679
23680    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23681    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23682    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23683    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
23684    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
23685        mem_base = xmlMemBlocks();
23686        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23687        dtd = gen_xmlDtdPtr(n_dtd, 1);
23688        name = gen_const_xmlChar_ptr(n_name, 2);
23689        type = gen_xmlElementTypeVal(n_type, 3);
23690        content = gen_xmlElementContentPtr(n_content, 4);
23691
23692        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
23693        desret_xmlElementPtr(ret_val);
23694        call_tests++;
23695        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23696        des_xmlDtdPtr(n_dtd, dtd, 1);
23697        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23698        des_xmlElementTypeVal(n_type, type, 3);
23699        des_xmlElementContentPtr(n_content, content, 4);
23700        xmlResetLastError();
23701        if (mem_base != xmlMemBlocks()) {
23702            printf("Leak of %d blocks found in xmlAddElementDecl",
23703	           xmlMemBlocks() - mem_base);
23704	    test_ret++;
23705            printf(" %d", n_ctxt);
23706            printf(" %d", n_dtd);
23707            printf(" %d", n_name);
23708            printf(" %d", n_type);
23709            printf(" %d", n_content);
23710            printf("\n");
23711        }
23712    }
23713    }
23714    }
23715    }
23716    }
23717    function_tests++;
23718
23719    return(test_ret);
23720}
23721
23722
23723static int
23724test_xmlAddID(void) {
23725    int test_ret = 0;
23726
23727
23728    /* missing type support */
23729    return(test_ret);
23730}
23731
23732
23733static int
23734test_xmlAddNotationDecl(void) {
23735    int test_ret = 0;
23736
23737
23738    /* missing type support */
23739    return(test_ret);
23740}
23741
23742
23743static int
23744test_xmlAddRef(void) {
23745    int test_ret = 0;
23746
23747
23748    /* missing type support */
23749    return(test_ret);
23750}
23751
23752
23753#define gen_nb_xmlAttributeTablePtr 1
23754static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23755    return(NULL);
23756}
23757static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23758}
23759
23760static int
23761test_xmlCopyAttributeTable(void) {
23762    int test_ret = 0;
23763
23764
23765    /* missing type support */
23766    return(test_ret);
23767}
23768
23769
23770static int
23771test_xmlCopyDocElementContent(void) {
23772    int test_ret = 0;
23773
23774    int mem_base;
23775    xmlElementContentPtr ret_val;
23776    xmlDocPtr doc; /* the document owning the element declaration */
23777    int n_doc;
23778    xmlElementContentPtr cur; /* An element content pointer. */
23779    int n_cur;
23780
23781    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23782    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
23783        mem_base = xmlMemBlocks();
23784        doc = gen_xmlDocPtr(n_doc, 0);
23785        cur = gen_xmlElementContentPtr(n_cur, 1);
23786
23787        ret_val = xmlCopyDocElementContent(doc, cur);
23788        desret_xmlElementContentPtr(ret_val);
23789        call_tests++;
23790        des_xmlDocPtr(n_doc, doc, 0);
23791        des_xmlElementContentPtr(n_cur, cur, 1);
23792        xmlResetLastError();
23793        if (mem_base != xmlMemBlocks()) {
23794            printf("Leak of %d blocks found in xmlCopyDocElementContent",
23795	           xmlMemBlocks() - mem_base);
23796	    test_ret++;
23797            printf(" %d", n_doc);
23798            printf(" %d", n_cur);
23799            printf("\n");
23800        }
23801    }
23802    }
23803    function_tests++;
23804
23805    return(test_ret);
23806}
23807
23808
23809static int
23810test_xmlCopyElementContent(void) {
23811    int test_ret = 0;
23812
23813    int mem_base;
23814    xmlElementContentPtr ret_val;
23815    xmlElementContentPtr cur; /* An element content pointer. */
23816    int n_cur;
23817
23818    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
23819        mem_base = xmlMemBlocks();
23820        cur = gen_xmlElementContentPtr(n_cur, 0);
23821
23822        ret_val = xmlCopyElementContent(cur);
23823        desret_xmlElementContentPtr(ret_val);
23824        call_tests++;
23825        des_xmlElementContentPtr(n_cur, cur, 0);
23826        xmlResetLastError();
23827        if (mem_base != xmlMemBlocks()) {
23828            printf("Leak of %d blocks found in xmlCopyElementContent",
23829	           xmlMemBlocks() - mem_base);
23830	    test_ret++;
23831            printf(" %d", n_cur);
23832            printf("\n");
23833        }
23834    }
23835    function_tests++;
23836
23837    return(test_ret);
23838}
23839
23840
23841#define gen_nb_xmlElementTablePtr 1
23842static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23843    return(NULL);
23844}
23845static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23846}
23847
23848static int
23849test_xmlCopyElementTable(void) {
23850    int test_ret = 0;
23851
23852
23853    /* missing type support */
23854    return(test_ret);
23855}
23856
23857
23858static int
23859test_xmlCopyEnumeration(void) {
23860    int test_ret = 0;
23861
23862
23863    /* missing type support */
23864    return(test_ret);
23865}
23866
23867
23868#define gen_nb_xmlNotationTablePtr 1
23869static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23870    return(NULL);
23871}
23872static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23873}
23874
23875static int
23876test_xmlCopyNotationTable(void) {
23877    int test_ret = 0;
23878
23879
23880    /* missing type support */
23881    return(test_ret);
23882}
23883
23884
23885static int
23886test_xmlCreateEnumeration(void) {
23887    int test_ret = 0;
23888
23889
23890    /* missing type support */
23891    return(test_ret);
23892}
23893
23894
23895#define gen_nb_xmlAttributePtr 1
23896static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23897    return(NULL);
23898}
23899static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23900}
23901
23902static int
23903test_xmlDumpAttributeDecl(void) {
23904    int test_ret = 0;
23905
23906#if defined(LIBXML_OUTPUT_ENABLED)
23907    int mem_base;
23908    xmlBufferPtr buf; /* the XML buffer output */
23909    int n_buf;
23910    xmlAttributePtr attr; /* An attribute declaration */
23911    int n_attr;
23912
23913    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23914    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
23915        mem_base = xmlMemBlocks();
23916        buf = gen_xmlBufferPtr(n_buf, 0);
23917        attr = gen_xmlAttributePtr(n_attr, 1);
23918
23919        xmlDumpAttributeDecl(buf, attr);
23920        call_tests++;
23921        des_xmlBufferPtr(n_buf, buf, 0);
23922        des_xmlAttributePtr(n_attr, attr, 1);
23923        xmlResetLastError();
23924        if (mem_base != xmlMemBlocks()) {
23925            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
23926	           xmlMemBlocks() - mem_base);
23927	    test_ret++;
23928            printf(" %d", n_buf);
23929            printf(" %d", n_attr);
23930            printf("\n");
23931        }
23932    }
23933    }
23934    function_tests++;
23935#endif
23936
23937    return(test_ret);
23938}
23939
23940
23941static int
23942test_xmlDumpAttributeTable(void) {
23943    int test_ret = 0;
23944
23945#if defined(LIBXML_OUTPUT_ENABLED)
23946    int mem_base;
23947    xmlBufferPtr buf; /* the XML buffer output */
23948    int n_buf;
23949    xmlAttributeTablePtr table; /* An attribute table */
23950    int n_table;
23951
23952    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23953    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
23954        mem_base = xmlMemBlocks();
23955        buf = gen_xmlBufferPtr(n_buf, 0);
23956        table = gen_xmlAttributeTablePtr(n_table, 1);
23957
23958        xmlDumpAttributeTable(buf, table);
23959        call_tests++;
23960        des_xmlBufferPtr(n_buf, buf, 0);
23961        des_xmlAttributeTablePtr(n_table, table, 1);
23962        xmlResetLastError();
23963        if (mem_base != xmlMemBlocks()) {
23964            printf("Leak of %d blocks found in xmlDumpAttributeTable",
23965	           xmlMemBlocks() - mem_base);
23966	    test_ret++;
23967            printf(" %d", n_buf);
23968            printf(" %d", n_table);
23969            printf("\n");
23970        }
23971    }
23972    }
23973    function_tests++;
23974#endif
23975
23976    return(test_ret);
23977}
23978
23979
23980#define gen_nb_xmlElementPtr 1
23981static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23982    return(NULL);
23983}
23984static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23985}
23986
23987static int
23988test_xmlDumpElementDecl(void) {
23989    int test_ret = 0;
23990
23991#if defined(LIBXML_OUTPUT_ENABLED)
23992    int mem_base;
23993    xmlBufferPtr buf; /* the XML buffer output */
23994    int n_buf;
23995    xmlElementPtr elem; /* An element table */
23996    int n_elem;
23997
23998    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23999    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24000        mem_base = xmlMemBlocks();
24001        buf = gen_xmlBufferPtr(n_buf, 0);
24002        elem = gen_xmlElementPtr(n_elem, 1);
24003
24004        xmlDumpElementDecl(buf, elem);
24005        call_tests++;
24006        des_xmlBufferPtr(n_buf, buf, 0);
24007        des_xmlElementPtr(n_elem, elem, 1);
24008        xmlResetLastError();
24009        if (mem_base != xmlMemBlocks()) {
24010            printf("Leak of %d blocks found in xmlDumpElementDecl",
24011	           xmlMemBlocks() - mem_base);
24012	    test_ret++;
24013            printf(" %d", n_buf);
24014            printf(" %d", n_elem);
24015            printf("\n");
24016        }
24017    }
24018    }
24019    function_tests++;
24020#endif
24021
24022    return(test_ret);
24023}
24024
24025
24026static int
24027test_xmlDumpElementTable(void) {
24028    int test_ret = 0;
24029
24030#if defined(LIBXML_OUTPUT_ENABLED)
24031    int mem_base;
24032    xmlBufferPtr buf; /* the XML buffer output */
24033    int n_buf;
24034    xmlElementTablePtr table; /* An element table */
24035    int n_table;
24036
24037    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24038    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24039        mem_base = xmlMemBlocks();
24040        buf = gen_xmlBufferPtr(n_buf, 0);
24041        table = gen_xmlElementTablePtr(n_table, 1);
24042
24043        xmlDumpElementTable(buf, table);
24044        call_tests++;
24045        des_xmlBufferPtr(n_buf, buf, 0);
24046        des_xmlElementTablePtr(n_table, table, 1);
24047        xmlResetLastError();
24048        if (mem_base != xmlMemBlocks()) {
24049            printf("Leak of %d blocks found in xmlDumpElementTable",
24050	           xmlMemBlocks() - mem_base);
24051	    test_ret++;
24052            printf(" %d", n_buf);
24053            printf(" %d", n_table);
24054            printf("\n");
24055        }
24056    }
24057    }
24058    function_tests++;
24059#endif
24060
24061    return(test_ret);
24062}
24063
24064
24065#define gen_nb_xmlNotationPtr 1
24066static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24067    return(NULL);
24068}
24069static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24070}
24071
24072static int
24073test_xmlDumpNotationDecl(void) {
24074    int test_ret = 0;
24075
24076#if defined(LIBXML_OUTPUT_ENABLED)
24077    int mem_base;
24078    xmlBufferPtr buf; /* the XML buffer output */
24079    int n_buf;
24080    xmlNotationPtr nota; /* A notation declaration */
24081    int n_nota;
24082
24083    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24084    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24085        mem_base = xmlMemBlocks();
24086        buf = gen_xmlBufferPtr(n_buf, 0);
24087        nota = gen_xmlNotationPtr(n_nota, 1);
24088
24089        xmlDumpNotationDecl(buf, nota);
24090        call_tests++;
24091        des_xmlBufferPtr(n_buf, buf, 0);
24092        des_xmlNotationPtr(n_nota, nota, 1);
24093        xmlResetLastError();
24094        if (mem_base != xmlMemBlocks()) {
24095            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24096	           xmlMemBlocks() - mem_base);
24097	    test_ret++;
24098            printf(" %d", n_buf);
24099            printf(" %d", n_nota);
24100            printf("\n");
24101        }
24102    }
24103    }
24104    function_tests++;
24105#endif
24106
24107    return(test_ret);
24108}
24109
24110
24111static int
24112test_xmlDumpNotationTable(void) {
24113    int test_ret = 0;
24114
24115#if defined(LIBXML_OUTPUT_ENABLED)
24116    int mem_base;
24117    xmlBufferPtr buf; /* the XML buffer output */
24118    int n_buf;
24119    xmlNotationTablePtr table; /* A notation table */
24120    int n_table;
24121
24122    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24123    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24124        mem_base = xmlMemBlocks();
24125        buf = gen_xmlBufferPtr(n_buf, 0);
24126        table = gen_xmlNotationTablePtr(n_table, 1);
24127
24128        xmlDumpNotationTable(buf, table);
24129        call_tests++;
24130        des_xmlBufferPtr(n_buf, buf, 0);
24131        des_xmlNotationTablePtr(n_table, table, 1);
24132        xmlResetLastError();
24133        if (mem_base != xmlMemBlocks()) {
24134            printf("Leak of %d blocks found in xmlDumpNotationTable",
24135	           xmlMemBlocks() - mem_base);
24136	    test_ret++;
24137            printf(" %d", n_buf);
24138            printf(" %d", n_table);
24139            printf("\n");
24140        }
24141    }
24142    }
24143    function_tests++;
24144#endif
24145
24146    return(test_ret);
24147}
24148
24149
24150static int
24151test_xmlGetDtdAttrDesc(void) {
24152    int test_ret = 0;
24153
24154    int mem_base;
24155    xmlAttributePtr ret_val;
24156    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24157    int n_dtd;
24158    xmlChar * elem; /* the element name */
24159    int n_elem;
24160    xmlChar * name; /* the attribute name */
24161    int n_name;
24162
24163    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24164    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24165    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24166        mem_base = xmlMemBlocks();
24167        dtd = gen_xmlDtdPtr(n_dtd, 0);
24168        elem = gen_const_xmlChar_ptr(n_elem, 1);
24169        name = gen_const_xmlChar_ptr(n_name, 2);
24170
24171        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
24172        desret_xmlAttributePtr(ret_val);
24173        call_tests++;
24174        des_xmlDtdPtr(n_dtd, dtd, 0);
24175        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24176        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24177        xmlResetLastError();
24178        if (mem_base != xmlMemBlocks()) {
24179            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
24180	           xmlMemBlocks() - mem_base);
24181	    test_ret++;
24182            printf(" %d", n_dtd);
24183            printf(" %d", n_elem);
24184            printf(" %d", n_name);
24185            printf("\n");
24186        }
24187    }
24188    }
24189    }
24190    function_tests++;
24191
24192    return(test_ret);
24193}
24194
24195
24196static int
24197test_xmlGetDtdElementDesc(void) {
24198    int test_ret = 0;
24199
24200    int mem_base;
24201    xmlElementPtr ret_val;
24202    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24203    int n_dtd;
24204    xmlChar * name; /* the element name */
24205    int n_name;
24206
24207    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24208    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24209        mem_base = xmlMemBlocks();
24210        dtd = gen_xmlDtdPtr(n_dtd, 0);
24211        name = gen_const_xmlChar_ptr(n_name, 1);
24212
24213        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
24214        desret_xmlElementPtr(ret_val);
24215        call_tests++;
24216        des_xmlDtdPtr(n_dtd, dtd, 0);
24217        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24218        xmlResetLastError();
24219        if (mem_base != xmlMemBlocks()) {
24220            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
24221	           xmlMemBlocks() - mem_base);
24222	    test_ret++;
24223            printf(" %d", n_dtd);
24224            printf(" %d", n_name);
24225            printf("\n");
24226        }
24227    }
24228    }
24229    function_tests++;
24230
24231    return(test_ret);
24232}
24233
24234
24235static int
24236test_xmlGetDtdNotationDesc(void) {
24237    int test_ret = 0;
24238
24239
24240    /* missing type support */
24241    return(test_ret);
24242}
24243
24244
24245static int
24246test_xmlGetDtdQAttrDesc(void) {
24247    int test_ret = 0;
24248
24249    int mem_base;
24250    xmlAttributePtr ret_val;
24251    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24252    int n_dtd;
24253    xmlChar * elem; /* the element name */
24254    int n_elem;
24255    xmlChar * name; /* the attribute name */
24256    int n_name;
24257    xmlChar * prefix; /* the attribute namespace prefix */
24258    int n_prefix;
24259
24260    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24261    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24262    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24263    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24264        mem_base = xmlMemBlocks();
24265        dtd = gen_xmlDtdPtr(n_dtd, 0);
24266        elem = gen_const_xmlChar_ptr(n_elem, 1);
24267        name = gen_const_xmlChar_ptr(n_name, 2);
24268        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
24269
24270        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
24271        desret_xmlAttributePtr(ret_val);
24272        call_tests++;
24273        des_xmlDtdPtr(n_dtd, dtd, 0);
24274        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24275        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24276        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
24277        xmlResetLastError();
24278        if (mem_base != xmlMemBlocks()) {
24279            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
24280	           xmlMemBlocks() - mem_base);
24281	    test_ret++;
24282            printf(" %d", n_dtd);
24283            printf(" %d", n_elem);
24284            printf(" %d", n_name);
24285            printf(" %d", n_prefix);
24286            printf("\n");
24287        }
24288    }
24289    }
24290    }
24291    }
24292    function_tests++;
24293
24294    return(test_ret);
24295}
24296
24297
24298static int
24299test_xmlGetDtdQElementDesc(void) {
24300    int test_ret = 0;
24301
24302    int mem_base;
24303    xmlElementPtr ret_val;
24304    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24305    int n_dtd;
24306    xmlChar * name; /* the element name */
24307    int n_name;
24308    xmlChar * prefix; /* the element namespace prefix */
24309    int n_prefix;
24310
24311    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24312    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24313    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24314        mem_base = xmlMemBlocks();
24315        dtd = gen_xmlDtdPtr(n_dtd, 0);
24316        name = gen_const_xmlChar_ptr(n_name, 1);
24317        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
24318
24319        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
24320        desret_xmlElementPtr(ret_val);
24321        call_tests++;
24322        des_xmlDtdPtr(n_dtd, dtd, 0);
24323        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24324        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
24325        xmlResetLastError();
24326        if (mem_base != xmlMemBlocks()) {
24327            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
24328	           xmlMemBlocks() - mem_base);
24329	    test_ret++;
24330            printf(" %d", n_dtd);
24331            printf(" %d", n_name);
24332            printf(" %d", n_prefix);
24333            printf("\n");
24334        }
24335    }
24336    }
24337    }
24338    function_tests++;
24339
24340    return(test_ret);
24341}
24342
24343
24344static int
24345test_xmlGetID(void) {
24346    int test_ret = 0;
24347
24348    int mem_base;
24349    xmlAttrPtr ret_val;
24350    xmlDocPtr doc; /* pointer to the document */
24351    int n_doc;
24352    xmlChar * ID; /* the ID value */
24353    int n_ID;
24354
24355    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24356    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
24357        mem_base = xmlMemBlocks();
24358        doc = gen_xmlDocPtr(n_doc, 0);
24359        ID = gen_const_xmlChar_ptr(n_ID, 1);
24360
24361        ret_val = xmlGetID(doc, (const xmlChar *)ID);
24362        desret_xmlAttrPtr(ret_val);
24363        call_tests++;
24364        des_xmlDocPtr(n_doc, doc, 0);
24365        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
24366        xmlResetLastError();
24367        if (mem_base != xmlMemBlocks()) {
24368            printf("Leak of %d blocks found in xmlGetID",
24369	           xmlMemBlocks() - mem_base);
24370	    test_ret++;
24371            printf(" %d", n_doc);
24372            printf(" %d", n_ID);
24373            printf("\n");
24374        }
24375    }
24376    }
24377    function_tests++;
24378
24379    return(test_ret);
24380}
24381
24382
24383static int
24384test_xmlGetRefs(void) {
24385    int test_ret = 0;
24386
24387
24388    /* missing type support */
24389    return(test_ret);
24390}
24391
24392
24393static int
24394test_xmlIsID(void) {
24395    int test_ret = 0;
24396
24397    int mem_base;
24398    int ret_val;
24399    xmlDocPtr doc; /* the document */
24400    int n_doc;
24401    xmlNodePtr elem; /* the element carrying the attribute */
24402    int n_elem;
24403    xmlAttrPtr attr; /* the attribute */
24404    int n_attr;
24405
24406    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24407    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24408    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24409        mem_base = xmlMemBlocks();
24410        doc = gen_xmlDocPtr(n_doc, 0);
24411        elem = gen_xmlNodePtr(n_elem, 1);
24412        attr = gen_xmlAttrPtr(n_attr, 2);
24413
24414        ret_val = xmlIsID(doc, elem, attr);
24415        desret_int(ret_val);
24416        call_tests++;
24417        des_xmlDocPtr(n_doc, doc, 0);
24418        des_xmlNodePtr(n_elem, elem, 1);
24419        des_xmlAttrPtr(n_attr, attr, 2);
24420        xmlResetLastError();
24421        if (mem_base != xmlMemBlocks()) {
24422            printf("Leak of %d blocks found in xmlIsID",
24423	           xmlMemBlocks() - mem_base);
24424	    test_ret++;
24425            printf(" %d", n_doc);
24426            printf(" %d", n_elem);
24427            printf(" %d", n_attr);
24428            printf("\n");
24429        }
24430    }
24431    }
24432    }
24433    function_tests++;
24434
24435    return(test_ret);
24436}
24437
24438
24439static int
24440test_xmlIsMixedElement(void) {
24441    int test_ret = 0;
24442
24443    int mem_base;
24444    int ret_val;
24445    xmlDocPtr doc; /* the document */
24446    int n_doc;
24447    xmlChar * name; /* the element name */
24448    int n_name;
24449
24450    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24451    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24452        mem_base = xmlMemBlocks();
24453        doc = gen_xmlDocPtr(n_doc, 0);
24454        name = gen_const_xmlChar_ptr(n_name, 1);
24455
24456        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
24457        desret_int(ret_val);
24458        call_tests++;
24459        des_xmlDocPtr(n_doc, doc, 0);
24460        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24461        xmlResetLastError();
24462        if (mem_base != xmlMemBlocks()) {
24463            printf("Leak of %d blocks found in xmlIsMixedElement",
24464	           xmlMemBlocks() - mem_base);
24465	    test_ret++;
24466            printf(" %d", n_doc);
24467            printf(" %d", n_name);
24468            printf("\n");
24469        }
24470    }
24471    }
24472    function_tests++;
24473
24474    return(test_ret);
24475}
24476
24477
24478static int
24479test_xmlIsRef(void) {
24480    int test_ret = 0;
24481
24482    int mem_base;
24483    int ret_val;
24484    xmlDocPtr doc; /* the document */
24485    int n_doc;
24486    xmlNodePtr elem; /* the element carrying the attribute */
24487    int n_elem;
24488    xmlAttrPtr attr; /* the attribute */
24489    int n_attr;
24490
24491    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24492    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24493    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24494        mem_base = xmlMemBlocks();
24495        doc = gen_xmlDocPtr(n_doc, 0);
24496        elem = gen_xmlNodePtr(n_elem, 1);
24497        attr = gen_xmlAttrPtr(n_attr, 2);
24498
24499        ret_val = xmlIsRef(doc, elem, attr);
24500        desret_int(ret_val);
24501        call_tests++;
24502        des_xmlDocPtr(n_doc, doc, 0);
24503        des_xmlNodePtr(n_elem, elem, 1);
24504        des_xmlAttrPtr(n_attr, attr, 2);
24505        xmlResetLastError();
24506        if (mem_base != xmlMemBlocks()) {
24507            printf("Leak of %d blocks found in xmlIsRef",
24508	           xmlMemBlocks() - mem_base);
24509	    test_ret++;
24510            printf(" %d", n_doc);
24511            printf(" %d", n_elem);
24512            printf(" %d", n_attr);
24513            printf("\n");
24514        }
24515    }
24516    }
24517    }
24518    function_tests++;
24519
24520    return(test_ret);
24521}
24522
24523
24524static int
24525test_xmlNewDocElementContent(void) {
24526    int test_ret = 0;
24527
24528    int mem_base;
24529    xmlElementContentPtr ret_val;
24530    xmlDocPtr doc; /* the document */
24531    int n_doc;
24532    xmlChar * name; /* the subelement name or NULL */
24533    int n_name;
24534    xmlElementContentType type; /* the type of element content decl */
24535    int n_type;
24536
24537    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24538    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24539    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24540        mem_base = xmlMemBlocks();
24541        doc = gen_xmlDocPtr(n_doc, 0);
24542        name = gen_const_xmlChar_ptr(n_name, 1);
24543        type = gen_xmlElementContentType(n_type, 2);
24544
24545        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
24546        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
24547        desret_xmlElementContentPtr(ret_val);
24548        call_tests++;
24549        des_xmlDocPtr(n_doc, doc, 0);
24550        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24551        des_xmlElementContentType(n_type, type, 2);
24552        xmlResetLastError();
24553        if (mem_base != xmlMemBlocks()) {
24554            printf("Leak of %d blocks found in xmlNewDocElementContent",
24555	           xmlMemBlocks() - mem_base);
24556	    test_ret++;
24557            printf(" %d", n_doc);
24558            printf(" %d", n_name);
24559            printf(" %d", n_type);
24560            printf("\n");
24561        }
24562    }
24563    }
24564    }
24565    function_tests++;
24566
24567    return(test_ret);
24568}
24569
24570
24571static int
24572test_xmlNewElementContent(void) {
24573    int test_ret = 0;
24574
24575    int mem_base;
24576    xmlElementContentPtr ret_val;
24577    xmlChar * name; /* the subelement name or NULL */
24578    int n_name;
24579    xmlElementContentType type; /* the type of element content decl */
24580    int n_type;
24581
24582    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24583    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24584        mem_base = xmlMemBlocks();
24585        name = gen_const_xmlChar_ptr(n_name, 0);
24586        type = gen_xmlElementContentType(n_type, 1);
24587
24588        ret_val = xmlNewElementContent((const xmlChar *)name, type);
24589        desret_xmlElementContentPtr(ret_val);
24590        call_tests++;
24591        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24592        des_xmlElementContentType(n_type, type, 1);
24593        xmlResetLastError();
24594        if (mem_base != xmlMemBlocks()) {
24595            printf("Leak of %d blocks found in xmlNewElementContent",
24596	           xmlMemBlocks() - mem_base);
24597	    test_ret++;
24598            printf(" %d", n_name);
24599            printf(" %d", n_type);
24600            printf("\n");
24601        }
24602    }
24603    }
24604    function_tests++;
24605
24606    return(test_ret);
24607}
24608
24609
24610static int
24611test_xmlNewValidCtxt(void) {
24612    int test_ret = 0;
24613
24614
24615    /* missing type support */
24616    return(test_ret);
24617}
24618
24619
24620static int
24621test_xmlRemoveID(void) {
24622    int test_ret = 0;
24623
24624    int mem_base;
24625    int ret_val;
24626    xmlDocPtr doc; /* the document */
24627    int n_doc;
24628    xmlAttrPtr attr; /* the attribute */
24629    int n_attr;
24630
24631    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24632    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24633        mem_base = xmlMemBlocks();
24634        doc = gen_xmlDocPtr(n_doc, 0);
24635        attr = gen_xmlAttrPtr(n_attr, 1);
24636
24637        ret_val = xmlRemoveID(doc, attr);
24638        desret_int(ret_val);
24639        call_tests++;
24640        des_xmlDocPtr(n_doc, doc, 0);
24641        des_xmlAttrPtr(n_attr, attr, 1);
24642        xmlResetLastError();
24643        if (mem_base != xmlMemBlocks()) {
24644            printf("Leak of %d blocks found in xmlRemoveID",
24645	           xmlMemBlocks() - mem_base);
24646	    test_ret++;
24647            printf(" %d", n_doc);
24648            printf(" %d", n_attr);
24649            printf("\n");
24650        }
24651    }
24652    }
24653    function_tests++;
24654
24655    return(test_ret);
24656}
24657
24658
24659static int
24660test_xmlRemoveRef(void) {
24661    int test_ret = 0;
24662
24663    int mem_base;
24664    int ret_val;
24665    xmlDocPtr doc; /* the document */
24666    int n_doc;
24667    xmlAttrPtr attr; /* the attribute */
24668    int n_attr;
24669
24670    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24671    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24672        mem_base = xmlMemBlocks();
24673        doc = gen_xmlDocPtr(n_doc, 0);
24674        attr = gen_xmlAttrPtr(n_attr, 1);
24675
24676        ret_val = xmlRemoveRef(doc, attr);
24677        desret_int(ret_val);
24678        call_tests++;
24679        des_xmlDocPtr(n_doc, doc, 0);
24680        des_xmlAttrPtr(n_attr, attr, 1);
24681        xmlResetLastError();
24682        if (mem_base != xmlMemBlocks()) {
24683            printf("Leak of %d blocks found in xmlRemoveRef",
24684	           xmlMemBlocks() - mem_base);
24685	    test_ret++;
24686            printf(" %d", n_doc);
24687            printf(" %d", n_attr);
24688            printf("\n");
24689        }
24690    }
24691    }
24692    function_tests++;
24693
24694    return(test_ret);
24695}
24696
24697
24698static int
24699test_xmlSnprintfElementContent(void) {
24700    int test_ret = 0;
24701
24702    int mem_base;
24703    char * buf; /* an output buffer */
24704    int n_buf;
24705    int size; /* the buffer size */
24706    int n_size;
24707    xmlElementContentPtr content; /* An element table */
24708    int n_content;
24709    int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24710    int n_glob;
24711
24712    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24713    for (n_size = 0;n_size < gen_nb_int;n_size++) {
24714    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24715    for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24716        mem_base = xmlMemBlocks();
24717        buf = gen_char_ptr(n_buf, 0);
24718        size = gen_int(n_size, 1);
24719        content = gen_xmlElementContentPtr(n_content, 2);
24720        glob = gen_int(n_glob, 3);
24721
24722        xmlSnprintfElementContent(buf, size, content, glob);
24723        call_tests++;
24724        des_char_ptr(n_buf, buf, 0);
24725        des_int(n_size, size, 1);
24726        des_xmlElementContentPtr(n_content, content, 2);
24727        des_int(n_glob, glob, 3);
24728        xmlResetLastError();
24729        if (mem_base != xmlMemBlocks()) {
24730            printf("Leak of %d blocks found in xmlSnprintfElementContent",
24731	           xmlMemBlocks() - mem_base);
24732	    test_ret++;
24733            printf(" %d", n_buf);
24734            printf(" %d", n_size);
24735            printf(" %d", n_content);
24736            printf(" %d", n_glob);
24737            printf("\n");
24738        }
24739    }
24740    }
24741    }
24742    }
24743    function_tests++;
24744
24745    return(test_ret);
24746}
24747
24748
24749static int
24750test_xmlSprintfElementContent(void) {
24751    int test_ret = 0;
24752
24753#if defined(LIBXML_OUTPUT_ENABLED)
24754#ifdef LIBXML_OUTPUT_ENABLED
24755    int mem_base;
24756    char * buf; /* an output buffer */
24757    int n_buf;
24758    xmlElementContentPtr content; /* An element table */
24759    int n_content;
24760    int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24761    int n_glob;
24762
24763    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24764    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24765    for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24766        mem_base = xmlMemBlocks();
24767        buf = gen_char_ptr(n_buf, 0);
24768        content = gen_xmlElementContentPtr(n_content, 1);
24769        glob = gen_int(n_glob, 2);
24770
24771        xmlSprintfElementContent(buf, content, glob);
24772        call_tests++;
24773        des_char_ptr(n_buf, buf, 0);
24774        des_xmlElementContentPtr(n_content, content, 1);
24775        des_int(n_glob, glob, 2);
24776        xmlResetLastError();
24777        if (mem_base != xmlMemBlocks()) {
24778            printf("Leak of %d blocks found in xmlSprintfElementContent",
24779	           xmlMemBlocks() - mem_base);
24780	    test_ret++;
24781            printf(" %d", n_buf);
24782            printf(" %d", n_content);
24783            printf(" %d", n_glob);
24784            printf("\n");
24785        }
24786    }
24787    }
24788    }
24789    function_tests++;
24790#endif
24791#endif
24792
24793    return(test_ret);
24794}
24795
24796
24797static int
24798test_xmlValidBuildContentModel(void) {
24799    int test_ret = 0;
24800
24801#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
24802    int mem_base;
24803    int ret_val;
24804    xmlValidCtxtPtr ctxt; /* a validation context */
24805    int n_ctxt;
24806    xmlElementPtr elem; /* an element declaration node */
24807    int n_elem;
24808
24809    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24810    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24811        mem_base = xmlMemBlocks();
24812        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24813        elem = gen_xmlElementPtr(n_elem, 1);
24814
24815        ret_val = xmlValidBuildContentModel(ctxt, elem);
24816        desret_int(ret_val);
24817        call_tests++;
24818        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24819        des_xmlElementPtr(n_elem, elem, 1);
24820        xmlResetLastError();
24821        if (mem_base != xmlMemBlocks()) {
24822            printf("Leak of %d blocks found in xmlValidBuildContentModel",
24823	           xmlMemBlocks() - mem_base);
24824	    test_ret++;
24825            printf(" %d", n_ctxt);
24826            printf(" %d", n_elem);
24827            printf("\n");
24828        }
24829    }
24830    }
24831    function_tests++;
24832#endif
24833
24834    return(test_ret);
24835}
24836
24837
24838static int
24839test_xmlValidCtxtNormalizeAttributeValue(void) {
24840    int test_ret = 0;
24841
24842#if defined(LIBXML_VALID_ENABLED)
24843    int mem_base;
24844    xmlChar * ret_val;
24845    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
24846    int n_ctxt;
24847    xmlDocPtr doc; /* the document */
24848    int n_doc;
24849    xmlNodePtr elem; /* the parent */
24850    int n_elem;
24851    xmlChar * name; /* the attribute name */
24852    int n_name;
24853    xmlChar * value; /* the attribute value */
24854    int n_value;
24855
24856    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24857    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24858    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24859    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24860    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24861        mem_base = xmlMemBlocks();
24862        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24863        doc = gen_xmlDocPtr(n_doc, 1);
24864        elem = gen_xmlNodePtr(n_elem, 2);
24865        name = gen_const_xmlChar_ptr(n_name, 3);
24866        value = gen_const_xmlChar_ptr(n_value, 4);
24867
24868        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
24869        desret_xmlChar_ptr(ret_val);
24870        call_tests++;
24871        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24872        des_xmlDocPtr(n_doc, doc, 1);
24873        des_xmlNodePtr(n_elem, elem, 2);
24874        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24875        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
24876        xmlResetLastError();
24877        if (mem_base != xmlMemBlocks()) {
24878            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
24879	           xmlMemBlocks() - mem_base);
24880	    test_ret++;
24881            printf(" %d", n_ctxt);
24882            printf(" %d", n_doc);
24883            printf(" %d", n_elem);
24884            printf(" %d", n_name);
24885            printf(" %d", n_value);
24886            printf("\n");
24887        }
24888    }
24889    }
24890    }
24891    }
24892    }
24893    function_tests++;
24894#endif
24895
24896    return(test_ret);
24897}
24898
24899
24900#define gen_nb_xmlElementContent_ptr 1
24901static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24902    return(NULL);
24903}
24904static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24905}
24906
24907static int
24908test_xmlValidGetPotentialChildren(void) {
24909    int test_ret = 0;
24910
24911#if defined(LIBXML_VALID_ENABLED)
24912#ifdef LIBXML_VALID_ENABLED
24913    int mem_base;
24914    int ret_val;
24915    xmlElementContent * ctree; /* an element content tree */
24916    int n_ctree;
24917    xmlChar ** list; /* an array to store the list of child names */
24918    int n_list;
24919    int * len; /* a pointer to the number of element in the list */
24920    int n_len;
24921    int max; /* the size of the array */
24922    int n_max;
24923
24924    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
24925    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
24926    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
24927    for (n_max = 0;n_max < gen_nb_int;n_max++) {
24928        mem_base = xmlMemBlocks();
24929        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
24930        list = gen_const_xmlChar_ptr_ptr(n_list, 1);
24931        len = gen_int_ptr(n_len, 2);
24932        max = gen_int(n_max, 3);
24933
24934        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)list, len, max);
24935        desret_int(ret_val);
24936        call_tests++;
24937        des_xmlElementContent_ptr(n_ctree, ctree, 0);
24938        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 1);
24939        des_int_ptr(n_len, len, 2);
24940        des_int(n_max, max, 3);
24941        xmlResetLastError();
24942        if (mem_base != xmlMemBlocks()) {
24943            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
24944	           xmlMemBlocks() - mem_base);
24945	    test_ret++;
24946            printf(" %d", n_ctree);
24947            printf(" %d", n_list);
24948            printf(" %d", n_len);
24949            printf(" %d", n_max);
24950            printf("\n");
24951        }
24952    }
24953    }
24954    }
24955    }
24956    function_tests++;
24957#endif
24958#endif
24959
24960    return(test_ret);
24961}
24962
24963
24964static int
24965test_xmlValidGetValidElements(void) {
24966    int test_ret = 0;
24967
24968#if defined(LIBXML_VALID_ENABLED)
24969#ifdef LIBXML_VALID_ENABLED
24970    int mem_base;
24971    int ret_val;
24972    xmlNode * prev; /* an element to insert after */
24973    int n_prev;
24974    xmlNode * next; /* an element to insert next */
24975    int n_next;
24976    xmlChar ** names; /* an array to store the list of child names */
24977    int n_names;
24978    int max; /* the size of the array */
24979    int n_max;
24980
24981    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
24982    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
24983    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
24984    for (n_max = 0;n_max < gen_nb_int;n_max++) {
24985        mem_base = xmlMemBlocks();
24986        prev = gen_xmlNodePtr(n_prev, 0);
24987        next = gen_xmlNodePtr(n_next, 1);
24988        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
24989        max = gen_int(n_max, 3);
24990
24991        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
24992        desret_int(ret_val);
24993        call_tests++;
24994        des_xmlNodePtr(n_prev, prev, 0);
24995        des_xmlNodePtr(n_next, next, 1);
24996        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
24997        des_int(n_max, max, 3);
24998        xmlResetLastError();
24999        if (mem_base != xmlMemBlocks()) {
25000            printf("Leak of %d blocks found in xmlValidGetValidElements",
25001	           xmlMemBlocks() - mem_base);
25002	    test_ret++;
25003            printf(" %d", n_prev);
25004            printf(" %d", n_next);
25005            printf(" %d", n_names);
25006            printf(" %d", n_max);
25007            printf("\n");
25008        }
25009    }
25010    }
25011    }
25012    }
25013    function_tests++;
25014#endif
25015#endif
25016
25017    return(test_ret);
25018}
25019
25020
25021static int
25022test_xmlValidNormalizeAttributeValue(void) {
25023    int test_ret = 0;
25024
25025#if defined(LIBXML_VALID_ENABLED)
25026    int mem_base;
25027    xmlChar * ret_val;
25028    xmlDocPtr doc; /* the document */
25029    int n_doc;
25030    xmlNodePtr elem; /* the parent */
25031    int n_elem;
25032    xmlChar * name; /* the attribute name */
25033    int n_name;
25034    xmlChar * value; /* the attribute value */
25035    int n_value;
25036
25037    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25038    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25039    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25040    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25041        mem_base = xmlMemBlocks();
25042        doc = gen_xmlDocPtr(n_doc, 0);
25043        elem = gen_xmlNodePtr(n_elem, 1);
25044        name = gen_const_xmlChar_ptr(n_name, 2);
25045        value = gen_const_xmlChar_ptr(n_value, 3);
25046
25047        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25048        desret_xmlChar_ptr(ret_val);
25049        call_tests++;
25050        des_xmlDocPtr(n_doc, doc, 0);
25051        des_xmlNodePtr(n_elem, elem, 1);
25052        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25053        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25054        xmlResetLastError();
25055        if (mem_base != xmlMemBlocks()) {
25056            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25057	           xmlMemBlocks() - mem_base);
25058	    test_ret++;
25059            printf(" %d", n_doc);
25060            printf(" %d", n_elem);
25061            printf(" %d", n_name);
25062            printf(" %d", n_value);
25063            printf("\n");
25064        }
25065    }
25066    }
25067    }
25068    }
25069    function_tests++;
25070#endif
25071
25072    return(test_ret);
25073}
25074
25075
25076static int
25077test_xmlValidateAttributeDecl(void) {
25078    int test_ret = 0;
25079
25080#if defined(LIBXML_VALID_ENABLED)
25081    int mem_base;
25082    int ret_val;
25083    xmlValidCtxtPtr ctxt; /* the validation context */
25084    int n_ctxt;
25085    xmlDocPtr doc; /* a document instance */
25086    int n_doc;
25087    xmlAttributePtr attr; /* an attribute definition */
25088    int n_attr;
25089
25090    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25091    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25092    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25093        mem_base = xmlMemBlocks();
25094        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25095        doc = gen_xmlDocPtr(n_doc, 1);
25096        attr = gen_xmlAttributePtr(n_attr, 2);
25097
25098        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25099        desret_int(ret_val);
25100        call_tests++;
25101        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25102        des_xmlDocPtr(n_doc, doc, 1);
25103        des_xmlAttributePtr(n_attr, attr, 2);
25104        xmlResetLastError();
25105        if (mem_base != xmlMemBlocks()) {
25106            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25107	           xmlMemBlocks() - mem_base);
25108	    test_ret++;
25109            printf(" %d", n_ctxt);
25110            printf(" %d", n_doc);
25111            printf(" %d", n_attr);
25112            printf("\n");
25113        }
25114    }
25115    }
25116    }
25117    function_tests++;
25118#endif
25119
25120    return(test_ret);
25121}
25122
25123
25124static int
25125test_xmlValidateAttributeValue(void) {
25126    int test_ret = 0;
25127
25128#if defined(LIBXML_VALID_ENABLED)
25129    int mem_base;
25130    int ret_val;
25131    xmlAttributeType type; /* an attribute type */
25132    int n_type;
25133    xmlChar * value; /* an attribute value */
25134    int n_value;
25135
25136    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25137    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25138        mem_base = xmlMemBlocks();
25139        type = gen_xmlAttributeType(n_type, 0);
25140        value = gen_const_xmlChar_ptr(n_value, 1);
25141
25142        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25143        desret_int(ret_val);
25144        call_tests++;
25145        des_xmlAttributeType(n_type, type, 0);
25146        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25147        xmlResetLastError();
25148        if (mem_base != xmlMemBlocks()) {
25149            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25150	           xmlMemBlocks() - mem_base);
25151	    test_ret++;
25152            printf(" %d", n_type);
25153            printf(" %d", n_value);
25154            printf("\n");
25155        }
25156    }
25157    }
25158    function_tests++;
25159#endif
25160
25161    return(test_ret);
25162}
25163
25164
25165static int
25166test_xmlValidateDocument(void) {
25167    int test_ret = 0;
25168
25169#if defined(LIBXML_VALID_ENABLED)
25170    int mem_base;
25171    int ret_val;
25172    xmlValidCtxtPtr ctxt; /* the validation context */
25173    int n_ctxt;
25174    xmlDocPtr doc; /* a document instance */
25175    int n_doc;
25176
25177    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25178    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25179        mem_base = xmlMemBlocks();
25180        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25181        doc = gen_xmlDocPtr(n_doc, 1);
25182
25183        ret_val = xmlValidateDocument(ctxt, doc);
25184        desret_int(ret_val);
25185        call_tests++;
25186        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25187        des_xmlDocPtr(n_doc, doc, 1);
25188        xmlResetLastError();
25189        if (mem_base != xmlMemBlocks()) {
25190            printf("Leak of %d blocks found in xmlValidateDocument",
25191	           xmlMemBlocks() - mem_base);
25192	    test_ret++;
25193            printf(" %d", n_ctxt);
25194            printf(" %d", n_doc);
25195            printf("\n");
25196        }
25197    }
25198    }
25199    function_tests++;
25200#endif
25201
25202    return(test_ret);
25203}
25204
25205
25206static int
25207test_xmlValidateDocumentFinal(void) {
25208    int test_ret = 0;
25209
25210#if defined(LIBXML_VALID_ENABLED)
25211    int mem_base;
25212    int ret_val;
25213    xmlValidCtxtPtr ctxt; /* the validation context */
25214    int n_ctxt;
25215    xmlDocPtr doc; /* a document instance */
25216    int n_doc;
25217
25218    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25219    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25220        mem_base = xmlMemBlocks();
25221        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25222        doc = gen_xmlDocPtr(n_doc, 1);
25223
25224        ret_val = xmlValidateDocumentFinal(ctxt, doc);
25225        desret_int(ret_val);
25226        call_tests++;
25227        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25228        des_xmlDocPtr(n_doc, doc, 1);
25229        xmlResetLastError();
25230        if (mem_base != xmlMemBlocks()) {
25231            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
25232	           xmlMemBlocks() - mem_base);
25233	    test_ret++;
25234            printf(" %d", n_ctxt);
25235            printf(" %d", n_doc);
25236            printf("\n");
25237        }
25238    }
25239    }
25240    function_tests++;
25241#endif
25242
25243    return(test_ret);
25244}
25245
25246
25247static int
25248test_xmlValidateDtd(void) {
25249    int test_ret = 0;
25250
25251#if defined(LIBXML_VALID_ENABLED)
25252    int mem_base;
25253    int ret_val;
25254    xmlValidCtxtPtr ctxt; /* the validation context */
25255    int n_ctxt;
25256    xmlDocPtr doc; /* a document instance */
25257    int n_doc;
25258    xmlDtdPtr dtd; /* a dtd instance */
25259    int n_dtd;
25260
25261    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25262    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25263    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25264        mem_base = xmlMemBlocks();
25265        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25266        doc = gen_xmlDocPtr(n_doc, 1);
25267        dtd = gen_xmlDtdPtr(n_dtd, 2);
25268
25269        ret_val = xmlValidateDtd(ctxt, doc, dtd);
25270        desret_int(ret_val);
25271        call_tests++;
25272        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25273        des_xmlDocPtr(n_doc, doc, 1);
25274        des_xmlDtdPtr(n_dtd, dtd, 2);
25275        xmlResetLastError();
25276        if (mem_base != xmlMemBlocks()) {
25277            printf("Leak of %d blocks found in xmlValidateDtd",
25278	           xmlMemBlocks() - mem_base);
25279	    test_ret++;
25280            printf(" %d", n_ctxt);
25281            printf(" %d", n_doc);
25282            printf(" %d", n_dtd);
25283            printf("\n");
25284        }
25285    }
25286    }
25287    }
25288    function_tests++;
25289#endif
25290
25291    return(test_ret);
25292}
25293
25294
25295static int
25296test_xmlValidateDtdFinal(void) {
25297    int test_ret = 0;
25298
25299#if defined(LIBXML_VALID_ENABLED)
25300    int mem_base;
25301    int ret_val;
25302    xmlValidCtxtPtr ctxt; /* the validation context */
25303    int n_ctxt;
25304    xmlDocPtr doc; /* a document instance */
25305    int n_doc;
25306
25307    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25308    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25309        mem_base = xmlMemBlocks();
25310        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25311        doc = gen_xmlDocPtr(n_doc, 1);
25312
25313        ret_val = xmlValidateDtdFinal(ctxt, doc);
25314        desret_int(ret_val);
25315        call_tests++;
25316        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25317        des_xmlDocPtr(n_doc, doc, 1);
25318        xmlResetLastError();
25319        if (mem_base != xmlMemBlocks()) {
25320            printf("Leak of %d blocks found in xmlValidateDtdFinal",
25321	           xmlMemBlocks() - mem_base);
25322	    test_ret++;
25323            printf(" %d", n_ctxt);
25324            printf(" %d", n_doc);
25325            printf("\n");
25326        }
25327    }
25328    }
25329    function_tests++;
25330#endif
25331
25332    return(test_ret);
25333}
25334
25335
25336static int
25337test_xmlValidateElement(void) {
25338    int test_ret = 0;
25339
25340#if defined(LIBXML_VALID_ENABLED)
25341    int mem_base;
25342    int ret_val;
25343    xmlValidCtxtPtr ctxt; /* the validation context */
25344    int n_ctxt;
25345    xmlDocPtr doc; /* a document instance */
25346    int n_doc;
25347    xmlNodePtr elem; /* an element instance */
25348    int n_elem;
25349
25350    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25351    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25352    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25353        mem_base = xmlMemBlocks();
25354        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25355        doc = gen_xmlDocPtr(n_doc, 1);
25356        elem = gen_xmlNodePtr(n_elem, 2);
25357
25358        ret_val = xmlValidateElement(ctxt, doc, elem);
25359        desret_int(ret_val);
25360        call_tests++;
25361        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25362        des_xmlDocPtr(n_doc, doc, 1);
25363        des_xmlNodePtr(n_elem, elem, 2);
25364        xmlResetLastError();
25365        if (mem_base != xmlMemBlocks()) {
25366            printf("Leak of %d blocks found in xmlValidateElement",
25367	           xmlMemBlocks() - mem_base);
25368	    test_ret++;
25369            printf(" %d", n_ctxt);
25370            printf(" %d", n_doc);
25371            printf(" %d", n_elem);
25372            printf("\n");
25373        }
25374    }
25375    }
25376    }
25377    function_tests++;
25378#endif
25379
25380    return(test_ret);
25381}
25382
25383
25384static int
25385test_xmlValidateElementDecl(void) {
25386    int test_ret = 0;
25387
25388#if defined(LIBXML_VALID_ENABLED)
25389    int mem_base;
25390    int ret_val;
25391    xmlValidCtxtPtr ctxt; /* the validation context */
25392    int n_ctxt;
25393    xmlDocPtr doc; /* a document instance */
25394    int n_doc;
25395    xmlElementPtr elem; /* an element definition */
25396    int n_elem;
25397
25398    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25399    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25400    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25401        mem_base = xmlMemBlocks();
25402        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25403        doc = gen_xmlDocPtr(n_doc, 1);
25404        elem = gen_xmlElementPtr(n_elem, 2);
25405
25406        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
25407        desret_int(ret_val);
25408        call_tests++;
25409        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25410        des_xmlDocPtr(n_doc, doc, 1);
25411        des_xmlElementPtr(n_elem, elem, 2);
25412        xmlResetLastError();
25413        if (mem_base != xmlMemBlocks()) {
25414            printf("Leak of %d blocks found in xmlValidateElementDecl",
25415	           xmlMemBlocks() - mem_base);
25416	    test_ret++;
25417            printf(" %d", n_ctxt);
25418            printf(" %d", n_doc);
25419            printf(" %d", n_elem);
25420            printf("\n");
25421        }
25422    }
25423    }
25424    }
25425    function_tests++;
25426#endif
25427
25428    return(test_ret);
25429}
25430
25431
25432static int
25433test_xmlValidateNameValue(void) {
25434    int test_ret = 0;
25435
25436#if defined(LIBXML_VALID_ENABLED)
25437    int mem_base;
25438    int ret_val;
25439    xmlChar * value; /* an Name value */
25440    int n_value;
25441
25442    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25443        mem_base = xmlMemBlocks();
25444        value = gen_const_xmlChar_ptr(n_value, 0);
25445
25446        ret_val = xmlValidateNameValue((const xmlChar *)value);
25447        desret_int(ret_val);
25448        call_tests++;
25449        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25450        xmlResetLastError();
25451        if (mem_base != xmlMemBlocks()) {
25452            printf("Leak of %d blocks found in xmlValidateNameValue",
25453	           xmlMemBlocks() - mem_base);
25454	    test_ret++;
25455            printf(" %d", n_value);
25456            printf("\n");
25457        }
25458    }
25459    function_tests++;
25460#endif
25461
25462    return(test_ret);
25463}
25464
25465
25466static int
25467test_xmlValidateNamesValue(void) {
25468    int test_ret = 0;
25469
25470#if defined(LIBXML_VALID_ENABLED)
25471    int mem_base;
25472    int ret_val;
25473    xmlChar * value; /* an Names value */
25474    int n_value;
25475
25476    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25477        mem_base = xmlMemBlocks();
25478        value = gen_const_xmlChar_ptr(n_value, 0);
25479
25480        ret_val = xmlValidateNamesValue((const xmlChar *)value);
25481        desret_int(ret_val);
25482        call_tests++;
25483        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25484        xmlResetLastError();
25485        if (mem_base != xmlMemBlocks()) {
25486            printf("Leak of %d blocks found in xmlValidateNamesValue",
25487	           xmlMemBlocks() - mem_base);
25488	    test_ret++;
25489            printf(" %d", n_value);
25490            printf("\n");
25491        }
25492    }
25493    function_tests++;
25494#endif
25495
25496    return(test_ret);
25497}
25498
25499
25500static int
25501test_xmlValidateNmtokenValue(void) {
25502    int test_ret = 0;
25503
25504#if defined(LIBXML_VALID_ENABLED)
25505    int mem_base;
25506    int ret_val;
25507    xmlChar * value; /* an Nmtoken value */
25508    int n_value;
25509
25510    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25511        mem_base = xmlMemBlocks();
25512        value = gen_const_xmlChar_ptr(n_value, 0);
25513
25514        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
25515        desret_int(ret_val);
25516        call_tests++;
25517        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25518        xmlResetLastError();
25519        if (mem_base != xmlMemBlocks()) {
25520            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
25521	           xmlMemBlocks() - mem_base);
25522	    test_ret++;
25523            printf(" %d", n_value);
25524            printf("\n");
25525        }
25526    }
25527    function_tests++;
25528#endif
25529
25530    return(test_ret);
25531}
25532
25533
25534static int
25535test_xmlValidateNmtokensValue(void) {
25536    int test_ret = 0;
25537
25538#if defined(LIBXML_VALID_ENABLED)
25539    int mem_base;
25540    int ret_val;
25541    xmlChar * value; /* an Nmtokens value */
25542    int n_value;
25543
25544    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25545        mem_base = xmlMemBlocks();
25546        value = gen_const_xmlChar_ptr(n_value, 0);
25547
25548        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
25549        desret_int(ret_val);
25550        call_tests++;
25551        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25552        xmlResetLastError();
25553        if (mem_base != xmlMemBlocks()) {
25554            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
25555	           xmlMemBlocks() - mem_base);
25556	    test_ret++;
25557            printf(" %d", n_value);
25558            printf("\n");
25559        }
25560    }
25561    function_tests++;
25562#endif
25563
25564    return(test_ret);
25565}
25566
25567
25568static int
25569test_xmlValidateNotationDecl(void) {
25570    int test_ret = 0;
25571
25572#if defined(LIBXML_VALID_ENABLED)
25573    int mem_base;
25574    int ret_val;
25575    xmlValidCtxtPtr ctxt; /* the validation context */
25576    int n_ctxt;
25577    xmlDocPtr doc; /* a document instance */
25578    int n_doc;
25579    xmlNotationPtr nota; /* a notation definition */
25580    int n_nota;
25581
25582    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25583    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25584    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25585        mem_base = xmlMemBlocks();
25586        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25587        doc = gen_xmlDocPtr(n_doc, 1);
25588        nota = gen_xmlNotationPtr(n_nota, 2);
25589
25590        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
25591        desret_int(ret_val);
25592        call_tests++;
25593        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25594        des_xmlDocPtr(n_doc, doc, 1);
25595        des_xmlNotationPtr(n_nota, nota, 2);
25596        xmlResetLastError();
25597        if (mem_base != xmlMemBlocks()) {
25598            printf("Leak of %d blocks found in xmlValidateNotationDecl",
25599	           xmlMemBlocks() - mem_base);
25600	    test_ret++;
25601            printf(" %d", n_ctxt);
25602            printf(" %d", n_doc);
25603            printf(" %d", n_nota);
25604            printf("\n");
25605        }
25606    }
25607    }
25608    }
25609    function_tests++;
25610#endif
25611
25612    return(test_ret);
25613}
25614
25615
25616static int
25617test_xmlValidateNotationUse(void) {
25618    int test_ret = 0;
25619
25620#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
25621    int mem_base;
25622    int ret_val;
25623    xmlValidCtxtPtr ctxt; /* the validation context */
25624    int n_ctxt;
25625    xmlDocPtr doc; /* the document */
25626    int n_doc;
25627    xmlChar * notationName; /* the notation name to check */
25628    int n_notationName;
25629
25630    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25631    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25632    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
25633        mem_base = xmlMemBlocks();
25634        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25635        doc = gen_xmlDocPtr(n_doc, 1);
25636        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
25637
25638        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
25639        desret_int(ret_val);
25640        call_tests++;
25641        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25642        des_xmlDocPtr(n_doc, doc, 1);
25643        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
25644        xmlResetLastError();
25645        if (mem_base != xmlMemBlocks()) {
25646            printf("Leak of %d blocks found in xmlValidateNotationUse",
25647	           xmlMemBlocks() - mem_base);
25648	    test_ret++;
25649            printf(" %d", n_ctxt);
25650            printf(" %d", n_doc);
25651            printf(" %d", n_notationName);
25652            printf("\n");
25653        }
25654    }
25655    }
25656    }
25657    function_tests++;
25658#endif
25659
25660    return(test_ret);
25661}
25662
25663
25664static int
25665test_xmlValidateOneAttribute(void) {
25666    int test_ret = 0;
25667
25668#if defined(LIBXML_VALID_ENABLED)
25669    int mem_base;
25670    int ret_val;
25671    xmlValidCtxtPtr ctxt; /* the validation context */
25672    int n_ctxt;
25673    xmlDocPtr doc; /* a document instance */
25674    int n_doc;
25675    xmlNodePtr elem; /* an element instance */
25676    int n_elem;
25677    xmlAttrPtr attr; /* an attribute instance */
25678    int n_attr;
25679    xmlChar * value; /* the attribute value (without entities processing) */
25680    int n_value;
25681
25682    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25683    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25684    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25685    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25686    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25687        mem_base = xmlMemBlocks();
25688        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25689        doc = gen_xmlDocPtr(n_doc, 1);
25690        elem = gen_xmlNodePtr(n_elem, 2);
25691        attr = gen_xmlAttrPtr(n_attr, 3);
25692        value = gen_const_xmlChar_ptr(n_value, 4);
25693
25694        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
25695        desret_int(ret_val);
25696        call_tests++;
25697        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25698        des_xmlDocPtr(n_doc, doc, 1);
25699        des_xmlNodePtr(n_elem, elem, 2);
25700        des_xmlAttrPtr(n_attr, attr, 3);
25701        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25702        xmlResetLastError();
25703        if (mem_base != xmlMemBlocks()) {
25704            printf("Leak of %d blocks found in xmlValidateOneAttribute",
25705	           xmlMemBlocks() - mem_base);
25706	    test_ret++;
25707            printf(" %d", n_ctxt);
25708            printf(" %d", n_doc);
25709            printf(" %d", n_elem);
25710            printf(" %d", n_attr);
25711            printf(" %d", n_value);
25712            printf("\n");
25713        }
25714    }
25715    }
25716    }
25717    }
25718    }
25719    function_tests++;
25720#endif
25721
25722    return(test_ret);
25723}
25724
25725
25726static int
25727test_xmlValidateOneElement(void) {
25728    int test_ret = 0;
25729
25730#if defined(LIBXML_VALID_ENABLED)
25731    int mem_base;
25732    int ret_val;
25733    xmlValidCtxtPtr ctxt; /* the validation context */
25734    int n_ctxt;
25735    xmlDocPtr doc; /* a document instance */
25736    int n_doc;
25737    xmlNodePtr elem; /* an element instance */
25738    int n_elem;
25739
25740    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25741    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25742    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25743        mem_base = xmlMemBlocks();
25744        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25745        doc = gen_xmlDocPtr(n_doc, 1);
25746        elem = gen_xmlNodePtr(n_elem, 2);
25747
25748        ret_val = xmlValidateOneElement(ctxt, doc, elem);
25749        desret_int(ret_val);
25750        call_tests++;
25751        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25752        des_xmlDocPtr(n_doc, doc, 1);
25753        des_xmlNodePtr(n_elem, elem, 2);
25754        xmlResetLastError();
25755        if (mem_base != xmlMemBlocks()) {
25756            printf("Leak of %d blocks found in xmlValidateOneElement",
25757	           xmlMemBlocks() - mem_base);
25758	    test_ret++;
25759            printf(" %d", n_ctxt);
25760            printf(" %d", n_doc);
25761            printf(" %d", n_elem);
25762            printf("\n");
25763        }
25764    }
25765    }
25766    }
25767    function_tests++;
25768#endif
25769
25770    return(test_ret);
25771}
25772
25773
25774static int
25775test_xmlValidateOneNamespace(void) {
25776    int test_ret = 0;
25777
25778#if defined(LIBXML_VALID_ENABLED)
25779    int mem_base;
25780    int ret_val;
25781    xmlValidCtxtPtr ctxt; /* the validation context */
25782    int n_ctxt;
25783    xmlDocPtr doc; /* a document instance */
25784    int n_doc;
25785    xmlNodePtr elem; /* an element instance */
25786    int n_elem;
25787    xmlChar * prefix; /* the namespace prefix */
25788    int n_prefix;
25789    xmlNsPtr ns; /* an namespace declaration instance */
25790    int n_ns;
25791    xmlChar * value; /* the attribute value (without entities processing) */
25792    int n_value;
25793
25794    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25795    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25796    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25797    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25798    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
25799    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25800        mem_base = xmlMemBlocks();
25801        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25802        doc = gen_xmlDocPtr(n_doc, 1);
25803        elem = gen_xmlNodePtr(n_elem, 2);
25804        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25805        ns = gen_xmlNsPtr(n_ns, 4);
25806        value = gen_const_xmlChar_ptr(n_value, 5);
25807
25808        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
25809        desret_int(ret_val);
25810        call_tests++;
25811        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25812        des_xmlDocPtr(n_doc, doc, 1);
25813        des_xmlNodePtr(n_elem, elem, 2);
25814        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25815        des_xmlNsPtr(n_ns, ns, 4);
25816        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
25817        xmlResetLastError();
25818        if (mem_base != xmlMemBlocks()) {
25819            printf("Leak of %d blocks found in xmlValidateOneNamespace",
25820	           xmlMemBlocks() - mem_base);
25821	    test_ret++;
25822            printf(" %d", n_ctxt);
25823            printf(" %d", n_doc);
25824            printf(" %d", n_elem);
25825            printf(" %d", n_prefix);
25826            printf(" %d", n_ns);
25827            printf(" %d", n_value);
25828            printf("\n");
25829        }
25830    }
25831    }
25832    }
25833    }
25834    }
25835    }
25836    function_tests++;
25837#endif
25838
25839    return(test_ret);
25840}
25841
25842
25843static int
25844test_xmlValidatePopElement(void) {
25845    int test_ret = 0;
25846
25847#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25848    int mem_base;
25849    int ret_val;
25850    xmlValidCtxtPtr ctxt; /* the validation context */
25851    int n_ctxt;
25852    xmlDocPtr doc; /* a document instance */
25853    int n_doc;
25854    xmlNodePtr elem; /* an element instance */
25855    int n_elem;
25856    xmlChar * qname; /* the qualified name as appearing in the serialization */
25857    int n_qname;
25858
25859    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25860    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25861    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25862    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25863        mem_base = xmlMemBlocks();
25864        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25865        doc = gen_xmlDocPtr(n_doc, 1);
25866        elem = gen_xmlNodePtr(n_elem, 2);
25867        qname = gen_const_xmlChar_ptr(n_qname, 3);
25868
25869        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
25870        desret_int(ret_val);
25871        call_tests++;
25872        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25873        des_xmlDocPtr(n_doc, doc, 1);
25874        des_xmlNodePtr(n_elem, elem, 2);
25875        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
25876        xmlResetLastError();
25877        if (mem_base != xmlMemBlocks()) {
25878            printf("Leak of %d blocks found in xmlValidatePopElement",
25879	           xmlMemBlocks() - mem_base);
25880	    test_ret++;
25881            printf(" %d", n_ctxt);
25882            printf(" %d", n_doc);
25883            printf(" %d", n_elem);
25884            printf(" %d", n_qname);
25885            printf("\n");
25886        }
25887    }
25888    }
25889    }
25890    }
25891    function_tests++;
25892#endif
25893
25894    return(test_ret);
25895}
25896
25897
25898static int
25899test_xmlValidatePushCData(void) {
25900    int test_ret = 0;
25901
25902#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25903    int mem_base;
25904    int ret_val;
25905    xmlValidCtxtPtr ctxt; /* the validation context */
25906    int n_ctxt;
25907    xmlChar * data; /* some character data read */
25908    int n_data;
25909    int len; /* the lenght of the data */
25910    int n_len;
25911
25912    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25913    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
25914    for (n_len = 0;n_len < gen_nb_int;n_len++) {
25915        mem_base = xmlMemBlocks();
25916        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25917        data = gen_const_xmlChar_ptr(n_data, 1);
25918        len = gen_int(n_len, 2);
25919
25920        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
25921        desret_int(ret_val);
25922        call_tests++;
25923        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25924        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
25925        des_int(n_len, len, 2);
25926        xmlResetLastError();
25927        if (mem_base != xmlMemBlocks()) {
25928            printf("Leak of %d blocks found in xmlValidatePushCData",
25929	           xmlMemBlocks() - mem_base);
25930	    test_ret++;
25931            printf(" %d", n_ctxt);
25932            printf(" %d", n_data);
25933            printf(" %d", n_len);
25934            printf("\n");
25935        }
25936    }
25937    }
25938    }
25939    function_tests++;
25940#endif
25941
25942    return(test_ret);
25943}
25944
25945
25946static int
25947test_xmlValidatePushElement(void) {
25948    int test_ret = 0;
25949
25950#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25951    int mem_base;
25952    int ret_val;
25953    xmlValidCtxtPtr ctxt; /* the validation context */
25954    int n_ctxt;
25955    xmlDocPtr doc; /* a document instance */
25956    int n_doc;
25957    xmlNodePtr elem; /* an element instance */
25958    int n_elem;
25959    xmlChar * qname; /* the qualified name as appearing in the serialization */
25960    int n_qname;
25961
25962    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25963    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25964    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25965    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25966        mem_base = xmlMemBlocks();
25967        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25968        doc = gen_xmlDocPtr(n_doc, 1);
25969        elem = gen_xmlNodePtr(n_elem, 2);
25970        qname = gen_const_xmlChar_ptr(n_qname, 3);
25971
25972        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
25973        desret_int(ret_val);
25974        call_tests++;
25975        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25976        des_xmlDocPtr(n_doc, doc, 1);
25977        des_xmlNodePtr(n_elem, elem, 2);
25978        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
25979        xmlResetLastError();
25980        if (mem_base != xmlMemBlocks()) {
25981            printf("Leak of %d blocks found in xmlValidatePushElement",
25982	           xmlMemBlocks() - mem_base);
25983	    test_ret++;
25984            printf(" %d", n_ctxt);
25985            printf(" %d", n_doc);
25986            printf(" %d", n_elem);
25987            printf(" %d", n_qname);
25988            printf("\n");
25989        }
25990    }
25991    }
25992    }
25993    }
25994    function_tests++;
25995#endif
25996
25997    return(test_ret);
25998}
25999
26000
26001static int
26002test_xmlValidateRoot(void) {
26003    int test_ret = 0;
26004
26005#if defined(LIBXML_VALID_ENABLED)
26006    int mem_base;
26007    int ret_val;
26008    xmlValidCtxtPtr ctxt; /* the validation context */
26009    int n_ctxt;
26010    xmlDocPtr doc; /* a document instance */
26011    int n_doc;
26012
26013    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26014    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26015        mem_base = xmlMemBlocks();
26016        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26017        doc = gen_xmlDocPtr(n_doc, 1);
26018
26019        ret_val = xmlValidateRoot(ctxt, doc);
26020        desret_int(ret_val);
26021        call_tests++;
26022        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26023        des_xmlDocPtr(n_doc, doc, 1);
26024        xmlResetLastError();
26025        if (mem_base != xmlMemBlocks()) {
26026            printf("Leak of %d blocks found in xmlValidateRoot",
26027	           xmlMemBlocks() - mem_base);
26028	    test_ret++;
26029            printf(" %d", n_ctxt);
26030            printf(" %d", n_doc);
26031            printf("\n");
26032        }
26033    }
26034    }
26035    function_tests++;
26036#endif
26037
26038    return(test_ret);
26039}
26040
26041static int
26042test_valid(void) {
26043    int test_ret = 0;
26044
26045    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26046    test_ret += test_xmlAddAttributeDecl();
26047    test_ret += test_xmlAddElementDecl();
26048    test_ret += test_xmlAddID();
26049    test_ret += test_xmlAddNotationDecl();
26050    test_ret += test_xmlAddRef();
26051    test_ret += test_xmlCopyAttributeTable();
26052    test_ret += test_xmlCopyDocElementContent();
26053    test_ret += test_xmlCopyElementContent();
26054    test_ret += test_xmlCopyElementTable();
26055    test_ret += test_xmlCopyEnumeration();
26056    test_ret += test_xmlCopyNotationTable();
26057    test_ret += test_xmlCreateEnumeration();
26058    test_ret += test_xmlDumpAttributeDecl();
26059    test_ret += test_xmlDumpAttributeTable();
26060    test_ret += test_xmlDumpElementDecl();
26061    test_ret += test_xmlDumpElementTable();
26062    test_ret += test_xmlDumpNotationDecl();
26063    test_ret += test_xmlDumpNotationTable();
26064    test_ret += test_xmlGetDtdAttrDesc();
26065    test_ret += test_xmlGetDtdElementDesc();
26066    test_ret += test_xmlGetDtdNotationDesc();
26067    test_ret += test_xmlGetDtdQAttrDesc();
26068    test_ret += test_xmlGetDtdQElementDesc();
26069    test_ret += test_xmlGetID();
26070    test_ret += test_xmlGetRefs();
26071    test_ret += test_xmlIsID();
26072    test_ret += test_xmlIsMixedElement();
26073    test_ret += test_xmlIsRef();
26074    test_ret += test_xmlNewDocElementContent();
26075    test_ret += test_xmlNewElementContent();
26076    test_ret += test_xmlNewValidCtxt();
26077    test_ret += test_xmlRemoveID();
26078    test_ret += test_xmlRemoveRef();
26079    test_ret += test_xmlSnprintfElementContent();
26080    test_ret += test_xmlSprintfElementContent();
26081    test_ret += test_xmlValidBuildContentModel();
26082    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26083    test_ret += test_xmlValidGetPotentialChildren();
26084    test_ret += test_xmlValidGetValidElements();
26085    test_ret += test_xmlValidNormalizeAttributeValue();
26086    test_ret += test_xmlValidateAttributeDecl();
26087    test_ret += test_xmlValidateAttributeValue();
26088    test_ret += test_xmlValidateDocument();
26089    test_ret += test_xmlValidateDocumentFinal();
26090    test_ret += test_xmlValidateDtd();
26091    test_ret += test_xmlValidateDtdFinal();
26092    test_ret += test_xmlValidateElement();
26093    test_ret += test_xmlValidateElementDecl();
26094    test_ret += test_xmlValidateNameValue();
26095    test_ret += test_xmlValidateNamesValue();
26096    test_ret += test_xmlValidateNmtokenValue();
26097    test_ret += test_xmlValidateNmtokensValue();
26098    test_ret += test_xmlValidateNotationDecl();
26099    test_ret += test_xmlValidateNotationUse();
26100    test_ret += test_xmlValidateOneAttribute();
26101    test_ret += test_xmlValidateOneElement();
26102    test_ret += test_xmlValidateOneNamespace();
26103    test_ret += test_xmlValidatePopElement();
26104    test_ret += test_xmlValidatePushCData();
26105    test_ret += test_xmlValidatePushElement();
26106    test_ret += test_xmlValidateRoot();
26107
26108    if (test_ret != 0)
26109	printf("Module valid: %d errors\n", test_ret);
26110    return(test_ret);
26111}
26112
26113static int
26114test_xmlXIncludeNewContext(void) {
26115    int test_ret = 0;
26116
26117
26118    /* missing type support */
26119    return(test_ret);
26120}
26121
26122
26123static int
26124test_xmlXIncludeProcess(void) {
26125    int test_ret = 0;
26126
26127#if defined(LIBXML_XINCLUDE_ENABLED)
26128    int mem_base;
26129    int ret_val;
26130    xmlDocPtr doc; /* an XML document */
26131    int n_doc;
26132
26133    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26134        mem_base = xmlMemBlocks();
26135        doc = gen_xmlDocPtr(n_doc, 0);
26136
26137        ret_val = xmlXIncludeProcess(doc);
26138        desret_int(ret_val);
26139        call_tests++;
26140        des_xmlDocPtr(n_doc, doc, 0);
26141        xmlResetLastError();
26142        if (mem_base != xmlMemBlocks()) {
26143            printf("Leak of %d blocks found in xmlXIncludeProcess",
26144	           xmlMemBlocks() - mem_base);
26145	    test_ret++;
26146            printf(" %d", n_doc);
26147            printf("\n");
26148        }
26149    }
26150    function_tests++;
26151#endif
26152
26153    return(test_ret);
26154}
26155
26156
26157static int
26158test_xmlXIncludeProcessFlags(void) {
26159    int test_ret = 0;
26160
26161#if defined(LIBXML_XINCLUDE_ENABLED)
26162    int mem_base;
26163    int ret_val;
26164    xmlDocPtr doc; /* an XML document */
26165    int n_doc;
26166    int flags; /* a set of xmlParserOption used for parsing XML includes */
26167    int n_flags;
26168
26169    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26170    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26171        mem_base = xmlMemBlocks();
26172        doc = gen_xmlDocPtr(n_doc, 0);
26173        flags = gen_int(n_flags, 1);
26174
26175        ret_val = xmlXIncludeProcessFlags(doc, flags);
26176        desret_int(ret_val);
26177        call_tests++;
26178        des_xmlDocPtr(n_doc, doc, 0);
26179        des_int(n_flags, flags, 1);
26180        xmlResetLastError();
26181        if (mem_base != xmlMemBlocks()) {
26182            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
26183	           xmlMemBlocks() - mem_base);
26184	    test_ret++;
26185            printf(" %d", n_doc);
26186            printf(" %d", n_flags);
26187            printf("\n");
26188        }
26189    }
26190    }
26191    function_tests++;
26192#endif
26193
26194    return(test_ret);
26195}
26196
26197#ifdef LIBXML_XINCLUDE_ENABLED
26198
26199#define gen_nb_xmlXIncludeCtxtPtr 1
26200static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26201    return(NULL);
26202}
26203static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26204}
26205#endif
26206
26207
26208static int
26209test_xmlXIncludeProcessNode(void) {
26210    int test_ret = 0;
26211
26212#if defined(LIBXML_XINCLUDE_ENABLED)
26213    int mem_base;
26214    int ret_val;
26215    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
26216    int n_ctxt;
26217    xmlNodePtr node; /* a node in an XML document */
26218    int n_node;
26219
26220    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26221    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
26222        mem_base = xmlMemBlocks();
26223        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26224        node = gen_xmlNodePtr(n_node, 1);
26225
26226        ret_val = xmlXIncludeProcessNode(ctxt, node);
26227        desret_int(ret_val);
26228        call_tests++;
26229        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26230        des_xmlNodePtr(n_node, node, 1);
26231        xmlResetLastError();
26232        if (mem_base != xmlMemBlocks()) {
26233            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
26234	           xmlMemBlocks() - mem_base);
26235	    test_ret++;
26236            printf(" %d", n_ctxt);
26237            printf(" %d", n_node);
26238            printf("\n");
26239        }
26240    }
26241    }
26242    function_tests++;
26243#endif
26244
26245    return(test_ret);
26246}
26247
26248
26249static int
26250test_xmlXIncludeProcessTree(void) {
26251    int test_ret = 0;
26252
26253#if defined(LIBXML_XINCLUDE_ENABLED)
26254    int mem_base;
26255    int ret_val;
26256    xmlNodePtr tree; /* a node in an XML document */
26257    int n_tree;
26258
26259    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26260        mem_base = xmlMemBlocks();
26261        tree = gen_xmlNodePtr(n_tree, 0);
26262
26263        ret_val = xmlXIncludeProcessTree(tree);
26264        desret_int(ret_val);
26265        call_tests++;
26266        des_xmlNodePtr(n_tree, tree, 0);
26267        xmlResetLastError();
26268        if (mem_base != xmlMemBlocks()) {
26269            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
26270	           xmlMemBlocks() - mem_base);
26271	    test_ret++;
26272            printf(" %d", n_tree);
26273            printf("\n");
26274        }
26275    }
26276    function_tests++;
26277#endif
26278
26279    return(test_ret);
26280}
26281
26282
26283static int
26284test_xmlXIncludeProcessTreeFlags(void) {
26285    int test_ret = 0;
26286
26287#if defined(LIBXML_XINCLUDE_ENABLED)
26288    int mem_base;
26289    int ret_val;
26290    xmlNodePtr tree; /* a node in an XML document */
26291    int n_tree;
26292    int flags; /* a set of xmlParserOption used for parsing XML includes */
26293    int n_flags;
26294
26295    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26296    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26297        mem_base = xmlMemBlocks();
26298        tree = gen_xmlNodePtr(n_tree, 0);
26299        flags = gen_int(n_flags, 1);
26300
26301        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
26302        desret_int(ret_val);
26303        call_tests++;
26304        des_xmlNodePtr(n_tree, tree, 0);
26305        des_int(n_flags, flags, 1);
26306        xmlResetLastError();
26307        if (mem_base != xmlMemBlocks()) {
26308            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
26309	           xmlMemBlocks() - mem_base);
26310	    test_ret++;
26311            printf(" %d", n_tree);
26312            printf(" %d", n_flags);
26313            printf("\n");
26314        }
26315    }
26316    }
26317    function_tests++;
26318#endif
26319
26320    return(test_ret);
26321}
26322
26323
26324static int
26325test_xmlXIncludeSetFlags(void) {
26326    int test_ret = 0;
26327
26328#if defined(LIBXML_XINCLUDE_ENABLED)
26329    int mem_base;
26330    int ret_val;
26331    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
26332    int n_ctxt;
26333    int flags; /* a set of xmlParserOption used for parsing XML includes */
26334    int n_flags;
26335
26336    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26337    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26338        mem_base = xmlMemBlocks();
26339        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26340        flags = gen_int(n_flags, 1);
26341
26342        ret_val = xmlXIncludeSetFlags(ctxt, flags);
26343        desret_int(ret_val);
26344        call_tests++;
26345        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26346        des_int(n_flags, flags, 1);
26347        xmlResetLastError();
26348        if (mem_base != xmlMemBlocks()) {
26349            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
26350	           xmlMemBlocks() - mem_base);
26351	    test_ret++;
26352            printf(" %d", n_ctxt);
26353            printf(" %d", n_flags);
26354            printf("\n");
26355        }
26356    }
26357    }
26358    function_tests++;
26359#endif
26360
26361    return(test_ret);
26362}
26363
26364static int
26365test_xinclude(void) {
26366    int test_ret = 0;
26367
26368    if (quiet == 0) printf("Testing xinclude : 6 of 8 functions ...\n");
26369    test_ret += test_xmlXIncludeNewContext();
26370    test_ret += test_xmlXIncludeProcess();
26371    test_ret += test_xmlXIncludeProcessFlags();
26372    test_ret += test_xmlXIncludeProcessNode();
26373    test_ret += test_xmlXIncludeProcessTree();
26374    test_ret += test_xmlXIncludeProcessTreeFlags();
26375    test_ret += test_xmlXIncludeSetFlags();
26376
26377    if (test_ret != 0)
26378	printf("Module xinclude: %d errors\n", test_ret);
26379    return(test_ret);
26380}
26381
26382static int
26383test_xmlAllocOutputBuffer(void) {
26384    int test_ret = 0;
26385
26386#if defined(LIBXML_OUTPUT_ENABLED)
26387    int mem_base;
26388    xmlOutputBufferPtr ret_val;
26389    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26390    int n_encoder;
26391
26392    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26393        mem_base = xmlMemBlocks();
26394        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
26395
26396        ret_val = xmlAllocOutputBuffer(encoder);
26397        desret_xmlOutputBufferPtr(ret_val);
26398        call_tests++;
26399        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
26400        xmlResetLastError();
26401        if (mem_base != xmlMemBlocks()) {
26402            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
26403	           xmlMemBlocks() - mem_base);
26404	    test_ret++;
26405            printf(" %d", n_encoder);
26406            printf("\n");
26407        }
26408    }
26409    function_tests++;
26410#endif
26411
26412    return(test_ret);
26413}
26414
26415
26416static int
26417test_xmlAllocParserInputBuffer(void) {
26418    int test_ret = 0;
26419
26420    int mem_base;
26421    xmlParserInputBufferPtr ret_val;
26422    xmlCharEncoding enc; /* the charset encoding if known */
26423    int n_enc;
26424
26425    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26426        mem_base = xmlMemBlocks();
26427        enc = gen_xmlCharEncoding(n_enc, 0);
26428
26429        ret_val = xmlAllocParserInputBuffer(enc);
26430        desret_xmlParserInputBufferPtr(ret_val);
26431        call_tests++;
26432        des_xmlCharEncoding(n_enc, enc, 0);
26433        xmlResetLastError();
26434        if (mem_base != xmlMemBlocks()) {
26435            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
26436	           xmlMemBlocks() - mem_base);
26437	    test_ret++;
26438            printf(" %d", n_enc);
26439            printf("\n");
26440        }
26441    }
26442    function_tests++;
26443
26444    return(test_ret);
26445}
26446
26447
26448static int
26449test_xmlCheckFilename(void) {
26450    int test_ret = 0;
26451
26452    int mem_base;
26453    int ret_val;
26454    char * path; /* the path to check */
26455    int n_path;
26456
26457    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
26458        mem_base = xmlMemBlocks();
26459        path = gen_const_char_ptr(n_path, 0);
26460
26461        ret_val = xmlCheckFilename((const char *)path);
26462        desret_int(ret_val);
26463        call_tests++;
26464        des_const_char_ptr(n_path, (const char *)path, 0);
26465        xmlResetLastError();
26466        if (mem_base != xmlMemBlocks()) {
26467            printf("Leak of %d blocks found in xmlCheckFilename",
26468	           xmlMemBlocks() - mem_base);
26469	    test_ret++;
26470            printf(" %d", n_path);
26471            printf("\n");
26472        }
26473    }
26474    function_tests++;
26475
26476    return(test_ret);
26477}
26478
26479
26480static int
26481test_xmlCheckHTTPInput(void) {
26482    int test_ret = 0;
26483
26484    int mem_base;
26485    xmlParserInputPtr ret_val;
26486    xmlParserCtxtPtr ctxt; /* an XML parser context */
26487    int n_ctxt;
26488    xmlParserInputPtr ret; /* an XML parser input */
26489    int n_ret;
26490
26491    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
26492    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
26493        mem_base = xmlMemBlocks();
26494        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
26495        ret = gen_xmlParserInputPtr(n_ret, 1);
26496
26497        ret_val = xmlCheckHTTPInput(ctxt, ret);
26498        desret_xmlParserInputPtr(ret_val);
26499        call_tests++;
26500        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
26501        des_xmlParserInputPtr(n_ret, ret, 1);
26502        xmlResetLastError();
26503        if (mem_base != xmlMemBlocks()) {
26504            printf("Leak of %d blocks found in xmlCheckHTTPInput",
26505	           xmlMemBlocks() - mem_base);
26506	    test_ret++;
26507            printf(" %d", n_ctxt);
26508            printf(" %d", n_ret);
26509            printf("\n");
26510        }
26511    }
26512    }
26513    function_tests++;
26514
26515    return(test_ret);
26516}
26517
26518
26519static int
26520test_xmlCleanupInputCallbacks(void) {
26521    int test_ret = 0;
26522
26523    int mem_base;
26524
26525        mem_base = xmlMemBlocks();
26526
26527        xmlCleanupInputCallbacks();
26528        call_tests++;
26529        xmlResetLastError();
26530        if (mem_base != xmlMemBlocks()) {
26531            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
26532	           xmlMemBlocks() - mem_base);
26533	    test_ret++;
26534            printf("\n");
26535        }
26536    function_tests++;
26537
26538    return(test_ret);
26539}
26540
26541
26542static int
26543test_xmlCleanupOutputCallbacks(void) {
26544    int test_ret = 0;
26545
26546#if defined(LIBXML_OUTPUT_ENABLED)
26547    int mem_base;
26548
26549        mem_base = xmlMemBlocks();
26550
26551        xmlCleanupOutputCallbacks();
26552        call_tests++;
26553        xmlResetLastError();
26554        if (mem_base != xmlMemBlocks()) {
26555            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
26556	           xmlMemBlocks() - mem_base);
26557	    test_ret++;
26558            printf("\n");
26559        }
26560    function_tests++;
26561#endif
26562
26563    return(test_ret);
26564}
26565
26566
26567static int
26568test_xmlFileClose(void) {
26569    int test_ret = 0;
26570
26571    int mem_base;
26572    int ret_val;
26573    void * context; /* the I/O context */
26574    int n_context;
26575
26576    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26577        mem_base = xmlMemBlocks();
26578        context = gen_void_ptr(n_context, 0);
26579
26580        ret_val = xmlFileClose(context);
26581        desret_int(ret_val);
26582        call_tests++;
26583        des_void_ptr(n_context, context, 0);
26584        xmlResetLastError();
26585        if (mem_base != xmlMemBlocks()) {
26586            printf("Leak of %d blocks found in xmlFileClose",
26587	           xmlMemBlocks() - mem_base);
26588	    test_ret++;
26589            printf(" %d", n_context);
26590            printf("\n");
26591        }
26592    }
26593    function_tests++;
26594
26595    return(test_ret);
26596}
26597
26598
26599static int
26600test_xmlFileMatch(void) {
26601    int test_ret = 0;
26602
26603    int mem_base;
26604    int ret_val;
26605    const char * filename; /* the URI for matching */
26606    int n_filename;
26607
26608    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26609        mem_base = xmlMemBlocks();
26610        filename = gen_filepath(n_filename, 0);
26611
26612        ret_val = xmlFileMatch(filename);
26613        desret_int(ret_val);
26614        call_tests++;
26615        des_filepath(n_filename, filename, 0);
26616        xmlResetLastError();
26617        if (mem_base != xmlMemBlocks()) {
26618            printf("Leak of %d blocks found in xmlFileMatch",
26619	           xmlMemBlocks() - mem_base);
26620	    test_ret++;
26621            printf(" %d", n_filename);
26622            printf("\n");
26623        }
26624    }
26625    function_tests++;
26626
26627    return(test_ret);
26628}
26629
26630
26631static int
26632test_xmlFileOpen(void) {
26633    int test_ret = 0;
26634
26635    int mem_base;
26636    void * ret_val;
26637    const char * filename; /* the URI for matching */
26638    int n_filename;
26639
26640    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26641        mem_base = xmlMemBlocks();
26642        filename = gen_filepath(n_filename, 0);
26643
26644        ret_val = xmlFileOpen(filename);
26645        desret_void_ptr(ret_val);
26646        call_tests++;
26647        des_filepath(n_filename, filename, 0);
26648        xmlResetLastError();
26649        if (mem_base != xmlMemBlocks()) {
26650            printf("Leak of %d blocks found in xmlFileOpen",
26651	           xmlMemBlocks() - mem_base);
26652	    test_ret++;
26653            printf(" %d", n_filename);
26654            printf("\n");
26655        }
26656    }
26657    function_tests++;
26658
26659    return(test_ret);
26660}
26661
26662
26663static int
26664test_xmlFileRead(void) {
26665    int test_ret = 0;
26666
26667    int mem_base;
26668    int ret_val;
26669    void * context; /* the I/O context */
26670    int n_context;
26671    char * buffer; /* where to drop data */
26672    int n_buffer;
26673    int len; /* number of bytes to write */
26674    int n_len;
26675
26676    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26677    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26678    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26679        mem_base = xmlMemBlocks();
26680        context = gen_void_ptr(n_context, 0);
26681        buffer = gen_char_ptr(n_buffer, 1);
26682        len = gen_int(n_len, 2);
26683
26684        ret_val = xmlFileRead(context, buffer, len);
26685        desret_int(ret_val);
26686        call_tests++;
26687        des_void_ptr(n_context, context, 0);
26688        des_char_ptr(n_buffer, buffer, 1);
26689        des_int(n_len, len, 2);
26690        xmlResetLastError();
26691        if (mem_base != xmlMemBlocks()) {
26692            printf("Leak of %d blocks found in xmlFileRead",
26693	           xmlMemBlocks() - mem_base);
26694	    test_ret++;
26695            printf(" %d", n_context);
26696            printf(" %d", n_buffer);
26697            printf(" %d", n_len);
26698            printf("\n");
26699        }
26700    }
26701    }
26702    }
26703    function_tests++;
26704
26705    return(test_ret);
26706}
26707
26708
26709static int
26710test_xmlIOFTPClose(void) {
26711    int test_ret = 0;
26712
26713#if defined(LIBXML_FTP_ENABLED)
26714    int mem_base;
26715    int ret_val;
26716    void * context; /* the I/O context */
26717    int n_context;
26718
26719    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26720        mem_base = xmlMemBlocks();
26721        context = gen_void_ptr(n_context, 0);
26722
26723        ret_val = xmlIOFTPClose(context);
26724        desret_int(ret_val);
26725        call_tests++;
26726        des_void_ptr(n_context, context, 0);
26727        xmlResetLastError();
26728        if (mem_base != xmlMemBlocks()) {
26729            printf("Leak of %d blocks found in xmlIOFTPClose",
26730	           xmlMemBlocks() - mem_base);
26731	    test_ret++;
26732            printf(" %d", n_context);
26733            printf("\n");
26734        }
26735    }
26736    function_tests++;
26737#endif
26738
26739    return(test_ret);
26740}
26741
26742
26743static int
26744test_xmlIOFTPMatch(void) {
26745    int test_ret = 0;
26746
26747#if defined(LIBXML_FTP_ENABLED)
26748    int mem_base;
26749    int ret_val;
26750    const char * filename; /* the URI for matching */
26751    int n_filename;
26752
26753    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26754        mem_base = xmlMemBlocks();
26755        filename = gen_filepath(n_filename, 0);
26756
26757        ret_val = xmlIOFTPMatch(filename);
26758        desret_int(ret_val);
26759        call_tests++;
26760        des_filepath(n_filename, filename, 0);
26761        xmlResetLastError();
26762        if (mem_base != xmlMemBlocks()) {
26763            printf("Leak of %d blocks found in xmlIOFTPMatch",
26764	           xmlMemBlocks() - mem_base);
26765	    test_ret++;
26766            printf(" %d", n_filename);
26767            printf("\n");
26768        }
26769    }
26770    function_tests++;
26771#endif
26772
26773    return(test_ret);
26774}
26775
26776
26777static int
26778test_xmlIOFTPOpen(void) {
26779    int test_ret = 0;
26780
26781#if defined(LIBXML_FTP_ENABLED)
26782    int mem_base;
26783    void * ret_val;
26784    const char * filename; /* the URI for matching */
26785    int n_filename;
26786
26787    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26788        mem_base = xmlMemBlocks();
26789        filename = gen_filepath(n_filename, 0);
26790
26791        ret_val = xmlIOFTPOpen(filename);
26792        desret_void_ptr(ret_val);
26793        call_tests++;
26794        des_filepath(n_filename, filename, 0);
26795        xmlResetLastError();
26796        if (mem_base != xmlMemBlocks()) {
26797            printf("Leak of %d blocks found in xmlIOFTPOpen",
26798	           xmlMemBlocks() - mem_base);
26799	    test_ret++;
26800            printf(" %d", n_filename);
26801            printf("\n");
26802        }
26803    }
26804    function_tests++;
26805#endif
26806
26807    return(test_ret);
26808}
26809
26810
26811static int
26812test_xmlIOFTPRead(void) {
26813    int test_ret = 0;
26814
26815#if defined(LIBXML_FTP_ENABLED)
26816    int mem_base;
26817    int ret_val;
26818    void * context; /* the I/O context */
26819    int n_context;
26820    char * buffer; /* where to drop data */
26821    int n_buffer;
26822    int len; /* number of bytes to write */
26823    int n_len;
26824
26825    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26826    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26827    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26828        mem_base = xmlMemBlocks();
26829        context = gen_void_ptr(n_context, 0);
26830        buffer = gen_char_ptr(n_buffer, 1);
26831        len = gen_int(n_len, 2);
26832
26833        ret_val = xmlIOFTPRead(context, buffer, len);
26834        desret_int(ret_val);
26835        call_tests++;
26836        des_void_ptr(n_context, context, 0);
26837        des_char_ptr(n_buffer, buffer, 1);
26838        des_int(n_len, len, 2);
26839        xmlResetLastError();
26840        if (mem_base != xmlMemBlocks()) {
26841            printf("Leak of %d blocks found in xmlIOFTPRead",
26842	           xmlMemBlocks() - mem_base);
26843	    test_ret++;
26844            printf(" %d", n_context);
26845            printf(" %d", n_buffer);
26846            printf(" %d", n_len);
26847            printf("\n");
26848        }
26849    }
26850    }
26851    }
26852    function_tests++;
26853#endif
26854
26855    return(test_ret);
26856}
26857
26858
26859static int
26860test_xmlIOHTTPClose(void) {
26861    int test_ret = 0;
26862
26863#if defined(LIBXML_HTTP_ENABLED)
26864    int mem_base;
26865    int ret_val;
26866    void * context; /* the I/O context */
26867    int n_context;
26868
26869    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26870        mem_base = xmlMemBlocks();
26871        context = gen_void_ptr(n_context, 0);
26872
26873        ret_val = xmlIOHTTPClose(context);
26874        desret_int(ret_val);
26875        call_tests++;
26876        des_void_ptr(n_context, context, 0);
26877        xmlResetLastError();
26878        if (mem_base != xmlMemBlocks()) {
26879            printf("Leak of %d blocks found in xmlIOHTTPClose",
26880	           xmlMemBlocks() - mem_base);
26881	    test_ret++;
26882            printf(" %d", n_context);
26883            printf("\n");
26884        }
26885    }
26886    function_tests++;
26887#endif
26888
26889    return(test_ret);
26890}
26891
26892
26893static int
26894test_xmlIOHTTPMatch(void) {
26895    int test_ret = 0;
26896
26897#if defined(LIBXML_HTTP_ENABLED)
26898    int mem_base;
26899    int ret_val;
26900    const char * filename; /* the URI for matching */
26901    int n_filename;
26902
26903    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26904        mem_base = xmlMemBlocks();
26905        filename = gen_filepath(n_filename, 0);
26906
26907        ret_val = xmlIOHTTPMatch(filename);
26908        desret_int(ret_val);
26909        call_tests++;
26910        des_filepath(n_filename, filename, 0);
26911        xmlResetLastError();
26912        if (mem_base != xmlMemBlocks()) {
26913            printf("Leak of %d blocks found in xmlIOHTTPMatch",
26914	           xmlMemBlocks() - mem_base);
26915	    test_ret++;
26916            printf(" %d", n_filename);
26917            printf("\n");
26918        }
26919    }
26920    function_tests++;
26921#endif
26922
26923    return(test_ret);
26924}
26925
26926
26927static int
26928test_xmlIOHTTPOpen(void) {
26929    int test_ret = 0;
26930
26931#if defined(LIBXML_HTTP_ENABLED)
26932    int mem_base;
26933    void * ret_val;
26934    const char * filename; /* the URI for matching */
26935    int n_filename;
26936
26937    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26938        mem_base = xmlMemBlocks();
26939        filename = gen_filepath(n_filename, 0);
26940
26941        ret_val = xmlIOHTTPOpen(filename);
26942        desret_xmlNanoHTTPCtxtPtr(ret_val);
26943        call_tests++;
26944        des_filepath(n_filename, filename, 0);
26945        xmlResetLastError();
26946        if (mem_base != xmlMemBlocks()) {
26947            printf("Leak of %d blocks found in xmlIOHTTPOpen",
26948	           xmlMemBlocks() - mem_base);
26949	    test_ret++;
26950            printf(" %d", n_filename);
26951            printf("\n");
26952        }
26953    }
26954    function_tests++;
26955#endif
26956
26957    return(test_ret);
26958}
26959
26960
26961static int
26962test_xmlIOHTTPRead(void) {
26963    int test_ret = 0;
26964
26965#if defined(LIBXML_HTTP_ENABLED)
26966    int mem_base;
26967    int ret_val;
26968    void * context; /* the I/O context */
26969    int n_context;
26970    char * buffer; /* where to drop data */
26971    int n_buffer;
26972    int len; /* number of bytes to write */
26973    int n_len;
26974
26975    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26976    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26977    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26978        mem_base = xmlMemBlocks();
26979        context = gen_void_ptr(n_context, 0);
26980        buffer = gen_char_ptr(n_buffer, 1);
26981        len = gen_int(n_len, 2);
26982
26983        ret_val = xmlIOHTTPRead(context, buffer, len);
26984        desret_int(ret_val);
26985        call_tests++;
26986        des_void_ptr(n_context, context, 0);
26987        des_char_ptr(n_buffer, buffer, 1);
26988        des_int(n_len, len, 2);
26989        xmlResetLastError();
26990        if (mem_base != xmlMemBlocks()) {
26991            printf("Leak of %d blocks found in xmlIOHTTPRead",
26992	           xmlMemBlocks() - mem_base);
26993	    test_ret++;
26994            printf(" %d", n_context);
26995            printf(" %d", n_buffer);
26996            printf(" %d", n_len);
26997            printf("\n");
26998        }
26999    }
27000    }
27001    }
27002    function_tests++;
27003#endif
27004
27005    return(test_ret);
27006}
27007
27008
27009static int
27010test_xmlNoNetExternalEntityLoader(void) {
27011    int test_ret = 0;
27012
27013    int mem_base;
27014    xmlParserInputPtr ret_val;
27015    const char * URL; /* the URL for the entity to load */
27016    int n_URL;
27017    char * ID; /* the System ID for the entity to load */
27018    int n_ID;
27019    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27020    int n_ctxt;
27021
27022    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27023    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27024    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27025        mem_base = xmlMemBlocks();
27026        URL = gen_filepath(n_URL, 0);
27027        ID = gen_const_char_ptr(n_ID, 1);
27028        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27029
27030        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27031        desret_xmlParserInputPtr(ret_val);
27032        call_tests++;
27033        des_filepath(n_URL, URL, 0);
27034        des_const_char_ptr(n_ID, (const char *)ID, 1);
27035        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27036        xmlResetLastError();
27037        if (mem_base != xmlMemBlocks()) {
27038            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27039	           xmlMemBlocks() - mem_base);
27040	    test_ret++;
27041            printf(" %d", n_URL);
27042            printf(" %d", n_ID);
27043            printf(" %d", n_ctxt);
27044            printf("\n");
27045        }
27046    }
27047    }
27048    }
27049    function_tests++;
27050
27051    return(test_ret);
27052}
27053
27054
27055static int
27056test_xmlNormalizeWindowsPath(void) {
27057    int test_ret = 0;
27058
27059    int mem_base;
27060    xmlChar * ret_val;
27061    xmlChar * path; /* the input file path */
27062    int n_path;
27063
27064    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27065        mem_base = xmlMemBlocks();
27066        path = gen_const_xmlChar_ptr(n_path, 0);
27067
27068        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27069        desret_xmlChar_ptr(ret_val);
27070        call_tests++;
27071        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27072        xmlResetLastError();
27073        if (mem_base != xmlMemBlocks()) {
27074            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27075	           xmlMemBlocks() - mem_base);
27076	    test_ret++;
27077            printf(" %d", n_path);
27078            printf("\n");
27079        }
27080    }
27081    function_tests++;
27082
27083    return(test_ret);
27084}
27085
27086
27087static int
27088test_xmlOutputBufferCreateFd(void) {
27089    int test_ret = 0;
27090
27091#if defined(LIBXML_OUTPUT_ENABLED)
27092    int mem_base;
27093    xmlOutputBufferPtr ret_val;
27094    int fd; /* a file descriptor number */
27095    int n_fd;
27096    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27097    int n_encoder;
27098
27099    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27100    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27101        mem_base = xmlMemBlocks();
27102        fd = gen_int(n_fd, 0);
27103        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27104
27105        ret_val = xmlOutputBufferCreateFd(fd, encoder);
27106        desret_xmlOutputBufferPtr(ret_val);
27107        call_tests++;
27108        des_int(n_fd, fd, 0);
27109        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27110        xmlResetLastError();
27111        if (mem_base != xmlMemBlocks()) {
27112            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
27113	           xmlMemBlocks() - mem_base);
27114	    test_ret++;
27115            printf(" %d", n_fd);
27116            printf(" %d", n_encoder);
27117            printf("\n");
27118        }
27119    }
27120    }
27121    function_tests++;
27122#endif
27123
27124    return(test_ret);
27125}
27126
27127
27128static int
27129test_xmlOutputBufferCreateFile(void) {
27130    int test_ret = 0;
27131
27132#if defined(LIBXML_OUTPUT_ENABLED)
27133    int mem_base;
27134    xmlOutputBufferPtr ret_val;
27135    FILE * file; /* a FILE* */
27136    int n_file;
27137    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27138    int n_encoder;
27139
27140    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27141    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27142        mem_base = xmlMemBlocks();
27143        file = gen_FILE_ptr(n_file, 0);
27144        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27145
27146        ret_val = xmlOutputBufferCreateFile(file, encoder);
27147        desret_xmlOutputBufferPtr(ret_val);
27148        call_tests++;
27149        des_FILE_ptr(n_file, file, 0);
27150        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27151        xmlResetLastError();
27152        if (mem_base != xmlMemBlocks()) {
27153            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
27154	           xmlMemBlocks() - mem_base);
27155	    test_ret++;
27156            printf(" %d", n_file);
27157            printf(" %d", n_encoder);
27158            printf("\n");
27159        }
27160    }
27161    }
27162    function_tests++;
27163#endif
27164
27165    return(test_ret);
27166}
27167
27168
27169static int
27170test_xmlOutputBufferCreateFilename(void) {
27171    int test_ret = 0;
27172
27173#if defined(LIBXML_OUTPUT_ENABLED)
27174    int mem_base;
27175    xmlOutputBufferPtr ret_val;
27176    const char * URI; /* a C string containing the URI or filename */
27177    int n_URI;
27178    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27179    int n_encoder;
27180    int compression; /* the compression ration (0 none, 9 max). */
27181    int n_compression;
27182
27183    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27184    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27185    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
27186        mem_base = xmlMemBlocks();
27187        URI = gen_fileoutput(n_URI, 0);
27188        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27189        compression = gen_int(n_compression, 2);
27190
27191        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
27192        desret_xmlOutputBufferPtr(ret_val);
27193        call_tests++;
27194        des_fileoutput(n_URI, URI, 0);
27195        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27196        des_int(n_compression, compression, 2);
27197        xmlResetLastError();
27198        if (mem_base != xmlMemBlocks()) {
27199            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
27200	           xmlMemBlocks() - mem_base);
27201	    test_ret++;
27202            printf(" %d", n_URI);
27203            printf(" %d", n_encoder);
27204            printf(" %d", n_compression);
27205            printf("\n");
27206        }
27207    }
27208    }
27209    }
27210    function_tests++;
27211#endif
27212
27213    return(test_ret);
27214}
27215
27216
27217static int
27218test_xmlOutputBufferFlush(void) {
27219    int test_ret = 0;
27220
27221#if defined(LIBXML_OUTPUT_ENABLED)
27222    int mem_base;
27223    int ret_val;
27224    xmlOutputBufferPtr out; /* a buffered output */
27225    int n_out;
27226
27227    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27228        mem_base = xmlMemBlocks();
27229        out = gen_xmlOutputBufferPtr(n_out, 0);
27230
27231        ret_val = xmlOutputBufferFlush(out);
27232        desret_int(ret_val);
27233        call_tests++;
27234        des_xmlOutputBufferPtr(n_out, out, 0);
27235        xmlResetLastError();
27236        if (mem_base != xmlMemBlocks()) {
27237            printf("Leak of %d blocks found in xmlOutputBufferFlush",
27238	           xmlMemBlocks() - mem_base);
27239	    test_ret++;
27240            printf(" %d", n_out);
27241            printf("\n");
27242        }
27243    }
27244    function_tests++;
27245#endif
27246
27247    return(test_ret);
27248}
27249
27250
27251static int
27252test_xmlOutputBufferWrite(void) {
27253    int test_ret = 0;
27254
27255#if defined(LIBXML_OUTPUT_ENABLED)
27256    int mem_base;
27257    int ret_val;
27258    xmlOutputBufferPtr out; /* a buffered parser output */
27259    int n_out;
27260    int len; /* the size in bytes of the array. */
27261    int n_len;
27262    char * buf; /* an char array */
27263    int n_buf;
27264
27265    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27266    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27267    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27268        mem_base = xmlMemBlocks();
27269        out = gen_xmlOutputBufferPtr(n_out, 0);
27270        len = gen_int(n_len, 1);
27271        buf = gen_const_char_ptr(n_buf, 2);
27272
27273        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
27274        desret_int(ret_val);
27275        call_tests++;
27276        des_xmlOutputBufferPtr(n_out, out, 0);
27277        des_int(n_len, len, 1);
27278        des_const_char_ptr(n_buf, (const char *)buf, 2);
27279        xmlResetLastError();
27280        if (mem_base != xmlMemBlocks()) {
27281            printf("Leak of %d blocks found in xmlOutputBufferWrite",
27282	           xmlMemBlocks() - mem_base);
27283	    test_ret++;
27284            printf(" %d", n_out);
27285            printf(" %d", n_len);
27286            printf(" %d", n_buf);
27287            printf("\n");
27288        }
27289    }
27290    }
27291    }
27292    function_tests++;
27293#endif
27294
27295    return(test_ret);
27296}
27297
27298
27299static int
27300test_xmlOutputBufferWriteEscape(void) {
27301    int test_ret = 0;
27302
27303
27304    /* missing type support */
27305    return(test_ret);
27306}
27307
27308
27309static int
27310test_xmlOutputBufferWriteString(void) {
27311    int test_ret = 0;
27312
27313#if defined(LIBXML_OUTPUT_ENABLED)
27314    int mem_base;
27315    int ret_val;
27316    xmlOutputBufferPtr out; /* a buffered parser output */
27317    int n_out;
27318    char * str; /* a zero terminated C string */
27319    int n_str;
27320
27321    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27322    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
27323        mem_base = xmlMemBlocks();
27324        out = gen_xmlOutputBufferPtr(n_out, 0);
27325        str = gen_const_char_ptr(n_str, 1);
27326
27327        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
27328        desret_int(ret_val);
27329        call_tests++;
27330        des_xmlOutputBufferPtr(n_out, out, 0);
27331        des_const_char_ptr(n_str, (const char *)str, 1);
27332        xmlResetLastError();
27333        if (mem_base != xmlMemBlocks()) {
27334            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
27335	           xmlMemBlocks() - mem_base);
27336	    test_ret++;
27337            printf(" %d", n_out);
27338            printf(" %d", n_str);
27339            printf("\n");
27340        }
27341    }
27342    }
27343    function_tests++;
27344#endif
27345
27346    return(test_ret);
27347}
27348
27349
27350static int
27351test_xmlParserGetDirectory(void) {
27352    int test_ret = 0;
27353
27354
27355    /* missing type support */
27356    return(test_ret);
27357}
27358
27359
27360static int
27361test_xmlParserInputBufferCreateFd(void) {
27362    int test_ret = 0;
27363
27364    int mem_base;
27365    xmlParserInputBufferPtr ret_val;
27366    int fd; /* a file descriptor number */
27367    int n_fd;
27368    xmlCharEncoding enc; /* the charset encoding if known */
27369    int n_enc;
27370
27371    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27372    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27373        mem_base = xmlMemBlocks();
27374        fd = gen_int(n_fd, 0);
27375        enc = gen_xmlCharEncoding(n_enc, 1);
27376        if (fd >= 0) fd = -1;
27377
27378        ret_val = xmlParserInputBufferCreateFd(fd, enc);
27379        desret_xmlParserInputBufferPtr(ret_val);
27380        call_tests++;
27381        des_int(n_fd, fd, 0);
27382        des_xmlCharEncoding(n_enc, enc, 1);
27383        xmlResetLastError();
27384        if (mem_base != xmlMemBlocks()) {
27385            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
27386	           xmlMemBlocks() - mem_base);
27387	    test_ret++;
27388            printf(" %d", n_fd);
27389            printf(" %d", n_enc);
27390            printf("\n");
27391        }
27392    }
27393    }
27394    function_tests++;
27395
27396    return(test_ret);
27397}
27398
27399
27400static int
27401test_xmlParserInputBufferCreateFile(void) {
27402    int test_ret = 0;
27403
27404    int mem_base;
27405    xmlParserInputBufferPtr ret_val;
27406    FILE * file; /* a FILE* */
27407    int n_file;
27408    xmlCharEncoding enc; /* the charset encoding if known */
27409    int n_enc;
27410
27411    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27412    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27413        mem_base = xmlMemBlocks();
27414        file = gen_FILE_ptr(n_file, 0);
27415        enc = gen_xmlCharEncoding(n_enc, 1);
27416
27417        ret_val = xmlParserInputBufferCreateFile(file, enc);
27418        desret_xmlParserInputBufferPtr(ret_val);
27419        call_tests++;
27420        des_FILE_ptr(n_file, file, 0);
27421        des_xmlCharEncoding(n_enc, enc, 1);
27422        xmlResetLastError();
27423        if (mem_base != xmlMemBlocks()) {
27424            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
27425	           xmlMemBlocks() - mem_base);
27426	    test_ret++;
27427            printf(" %d", n_file);
27428            printf(" %d", n_enc);
27429            printf("\n");
27430        }
27431    }
27432    }
27433    function_tests++;
27434
27435    return(test_ret);
27436}
27437
27438
27439static int
27440test_xmlParserInputBufferCreateFilename(void) {
27441    int test_ret = 0;
27442
27443    int mem_base;
27444    xmlParserInputBufferPtr ret_val;
27445    const char * URI; /* a C string containing the URI or filename */
27446    int n_URI;
27447    xmlCharEncoding enc; /* the charset encoding if known */
27448    int n_enc;
27449
27450    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27451    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27452        mem_base = xmlMemBlocks();
27453        URI = gen_fileoutput(n_URI, 0);
27454        enc = gen_xmlCharEncoding(n_enc, 1);
27455
27456        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
27457        desret_xmlParserInputBufferPtr(ret_val);
27458        call_tests++;
27459        des_fileoutput(n_URI, URI, 0);
27460        des_xmlCharEncoding(n_enc, enc, 1);
27461        xmlResetLastError();
27462        if (mem_base != xmlMemBlocks()) {
27463            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
27464	           xmlMemBlocks() - mem_base);
27465	    test_ret++;
27466            printf(" %d", n_URI);
27467            printf(" %d", n_enc);
27468            printf("\n");
27469        }
27470    }
27471    }
27472    function_tests++;
27473
27474    return(test_ret);
27475}
27476
27477
27478static int
27479test_xmlParserInputBufferCreateMem(void) {
27480    int test_ret = 0;
27481
27482    int mem_base;
27483    xmlParserInputBufferPtr ret_val;
27484    char * mem; /* the memory input */
27485    int n_mem;
27486    int size; /* the length of the memory block */
27487    int n_size;
27488    xmlCharEncoding enc; /* the charset encoding if known */
27489    int n_enc;
27490
27491    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27492    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27493    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27494        mem_base = xmlMemBlocks();
27495        mem = gen_const_char_ptr(n_mem, 0);
27496        size = gen_int(n_size, 1);
27497        enc = gen_xmlCharEncoding(n_enc, 2);
27498
27499        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
27500        desret_xmlParserInputBufferPtr(ret_val);
27501        call_tests++;
27502        des_const_char_ptr(n_mem, (const char *)mem, 0);
27503        des_int(n_size, size, 1);
27504        des_xmlCharEncoding(n_enc, enc, 2);
27505        xmlResetLastError();
27506        if (mem_base != xmlMemBlocks()) {
27507            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
27508	           xmlMemBlocks() - mem_base);
27509	    test_ret++;
27510            printf(" %d", n_mem);
27511            printf(" %d", n_size);
27512            printf(" %d", n_enc);
27513            printf("\n");
27514        }
27515    }
27516    }
27517    }
27518    function_tests++;
27519
27520    return(test_ret);
27521}
27522
27523
27524static int
27525test_xmlParserInputBufferCreateStatic(void) {
27526    int test_ret = 0;
27527
27528    int mem_base;
27529    xmlParserInputBufferPtr ret_val;
27530    char * mem; /* the memory input */
27531    int n_mem;
27532    int size; /* the length of the memory block */
27533    int n_size;
27534    xmlCharEncoding enc; /* the charset encoding if known */
27535    int n_enc;
27536
27537    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27538    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27539    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27540        mem_base = xmlMemBlocks();
27541        mem = gen_const_char_ptr(n_mem, 0);
27542        size = gen_int(n_size, 1);
27543        enc = gen_xmlCharEncoding(n_enc, 2);
27544
27545        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
27546        desret_xmlParserInputBufferPtr(ret_val);
27547        call_tests++;
27548        des_const_char_ptr(n_mem, (const char *)mem, 0);
27549        des_int(n_size, size, 1);
27550        des_xmlCharEncoding(n_enc, enc, 2);
27551        xmlResetLastError();
27552        if (mem_base != xmlMemBlocks()) {
27553            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
27554	           xmlMemBlocks() - mem_base);
27555	    test_ret++;
27556            printf(" %d", n_mem);
27557            printf(" %d", n_size);
27558            printf(" %d", n_enc);
27559            printf("\n");
27560        }
27561    }
27562    }
27563    }
27564    function_tests++;
27565
27566    return(test_ret);
27567}
27568
27569
27570static int
27571test_xmlParserInputBufferGrow(void) {
27572    int test_ret = 0;
27573
27574    int mem_base;
27575    int ret_val;
27576    xmlParserInputBufferPtr in; /* a buffered parser input */
27577    int n_in;
27578    int len; /* indicative value of the amount of chars to read */
27579    int n_len;
27580
27581    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27582    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27583        mem_base = xmlMemBlocks();
27584        in = gen_xmlParserInputBufferPtr(n_in, 0);
27585        len = gen_int(n_len, 1);
27586
27587        ret_val = xmlParserInputBufferGrow(in, len);
27588        desret_int(ret_val);
27589        call_tests++;
27590        des_xmlParserInputBufferPtr(n_in, in, 0);
27591        des_int(n_len, len, 1);
27592        xmlResetLastError();
27593        if (mem_base != xmlMemBlocks()) {
27594            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
27595	           xmlMemBlocks() - mem_base);
27596	    test_ret++;
27597            printf(" %d", n_in);
27598            printf(" %d", n_len);
27599            printf("\n");
27600        }
27601    }
27602    }
27603    function_tests++;
27604
27605    return(test_ret);
27606}
27607
27608
27609static int
27610test_xmlParserInputBufferPush(void) {
27611    int test_ret = 0;
27612
27613    int mem_base;
27614    int ret_val;
27615    xmlParserInputBufferPtr in; /* a buffered parser input */
27616    int n_in;
27617    int len; /* the size in bytes of the array. */
27618    int n_len;
27619    char * buf; /* an char array */
27620    int n_buf;
27621
27622    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27623    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27624    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27625        mem_base = xmlMemBlocks();
27626        in = gen_xmlParserInputBufferPtr(n_in, 0);
27627        len = gen_int(n_len, 1);
27628        buf = gen_const_char_ptr(n_buf, 2);
27629
27630        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
27631        desret_int(ret_val);
27632        call_tests++;
27633        des_xmlParserInputBufferPtr(n_in, in, 0);
27634        des_int(n_len, len, 1);
27635        des_const_char_ptr(n_buf, (const char *)buf, 2);
27636        xmlResetLastError();
27637        if (mem_base != xmlMemBlocks()) {
27638            printf("Leak of %d blocks found in xmlParserInputBufferPush",
27639	           xmlMemBlocks() - mem_base);
27640	    test_ret++;
27641            printf(" %d", n_in);
27642            printf(" %d", n_len);
27643            printf(" %d", n_buf);
27644            printf("\n");
27645        }
27646    }
27647    }
27648    }
27649    function_tests++;
27650
27651    return(test_ret);
27652}
27653
27654
27655static int
27656test_xmlParserInputBufferRead(void) {
27657    int test_ret = 0;
27658
27659    int mem_base;
27660    int ret_val;
27661    xmlParserInputBufferPtr in; /* a buffered parser input */
27662    int n_in;
27663    int len; /* indicative value of the amount of chars to read */
27664    int n_len;
27665
27666    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27667    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27668        mem_base = xmlMemBlocks();
27669        in = gen_xmlParserInputBufferPtr(n_in, 0);
27670        len = gen_int(n_len, 1);
27671
27672        ret_val = xmlParserInputBufferRead(in, len);
27673        desret_int(ret_val);
27674        call_tests++;
27675        des_xmlParserInputBufferPtr(n_in, in, 0);
27676        des_int(n_len, len, 1);
27677        xmlResetLastError();
27678        if (mem_base != xmlMemBlocks()) {
27679            printf("Leak of %d blocks found in xmlParserInputBufferRead",
27680	           xmlMemBlocks() - mem_base);
27681	    test_ret++;
27682            printf(" %d", n_in);
27683            printf(" %d", n_len);
27684            printf("\n");
27685        }
27686    }
27687    }
27688    function_tests++;
27689
27690    return(test_ret);
27691}
27692
27693
27694static int
27695test_xmlPopInputCallbacks(void) {
27696    int test_ret = 0;
27697
27698    int mem_base;
27699    int ret_val;
27700
27701        mem_base = xmlMemBlocks();
27702
27703        ret_val = xmlPopInputCallbacks();
27704        desret_int(ret_val);
27705        call_tests++;
27706        xmlResetLastError();
27707        if (mem_base != xmlMemBlocks()) {
27708            printf("Leak of %d blocks found in xmlPopInputCallbacks",
27709	           xmlMemBlocks() - mem_base);
27710	    test_ret++;
27711            printf("\n");
27712        }
27713    function_tests++;
27714
27715    return(test_ret);
27716}
27717
27718
27719static int
27720test_xmlRegisterDefaultInputCallbacks(void) {
27721    int test_ret = 0;
27722
27723    int mem_base;
27724
27725        mem_base = xmlMemBlocks();
27726
27727        xmlRegisterDefaultInputCallbacks();
27728        call_tests++;
27729        xmlResetLastError();
27730        if (mem_base != xmlMemBlocks()) {
27731            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
27732	           xmlMemBlocks() - mem_base);
27733	    test_ret++;
27734            printf("\n");
27735        }
27736    function_tests++;
27737
27738    return(test_ret);
27739}
27740
27741
27742static int
27743test_xmlRegisterDefaultOutputCallbacks(void) {
27744    int test_ret = 0;
27745
27746#if defined(LIBXML_OUTPUT_ENABLED)
27747    int mem_base;
27748
27749        mem_base = xmlMemBlocks();
27750
27751        xmlRegisterDefaultOutputCallbacks();
27752        call_tests++;
27753        xmlResetLastError();
27754        if (mem_base != xmlMemBlocks()) {
27755            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
27756	           xmlMemBlocks() - mem_base);
27757	    test_ret++;
27758            printf("\n");
27759        }
27760    function_tests++;
27761#endif
27762
27763    return(test_ret);
27764}
27765
27766
27767static int
27768test_xmlRegisterHTTPPostCallbacks(void) {
27769    int test_ret = 0;
27770
27771#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
27772    int mem_base;
27773
27774        mem_base = xmlMemBlocks();
27775
27776        xmlRegisterHTTPPostCallbacks();
27777        call_tests++;
27778        xmlResetLastError();
27779        if (mem_base != xmlMemBlocks()) {
27780            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
27781	           xmlMemBlocks() - mem_base);
27782	    test_ret++;
27783            printf("\n");
27784        }
27785    function_tests++;
27786#endif
27787
27788    return(test_ret);
27789}
27790
27791static int
27792test_xmlIO(void) {
27793    int test_ret = 0;
27794
27795    if (quiet == 0) printf("Testing xmlIO : 38 of 47 functions ...\n");
27796    test_ret += test_xmlAllocOutputBuffer();
27797    test_ret += test_xmlAllocParserInputBuffer();
27798    test_ret += test_xmlCheckFilename();
27799    test_ret += test_xmlCheckHTTPInput();
27800    test_ret += test_xmlCleanupInputCallbacks();
27801    test_ret += test_xmlCleanupOutputCallbacks();
27802    test_ret += test_xmlFileClose();
27803    test_ret += test_xmlFileMatch();
27804    test_ret += test_xmlFileOpen();
27805    test_ret += test_xmlFileRead();
27806    test_ret += test_xmlIOFTPClose();
27807    test_ret += test_xmlIOFTPMatch();
27808    test_ret += test_xmlIOFTPOpen();
27809    test_ret += test_xmlIOFTPRead();
27810    test_ret += test_xmlIOHTTPClose();
27811    test_ret += test_xmlIOHTTPMatch();
27812    test_ret += test_xmlIOHTTPOpen();
27813    test_ret += test_xmlIOHTTPRead();
27814    test_ret += test_xmlNoNetExternalEntityLoader();
27815    test_ret += test_xmlNormalizeWindowsPath();
27816    test_ret += test_xmlOutputBufferCreateFd();
27817    test_ret += test_xmlOutputBufferCreateFile();
27818    test_ret += test_xmlOutputBufferCreateFilename();
27819    test_ret += test_xmlOutputBufferFlush();
27820    test_ret += test_xmlOutputBufferWrite();
27821    test_ret += test_xmlOutputBufferWriteEscape();
27822    test_ret += test_xmlOutputBufferWriteString();
27823    test_ret += test_xmlParserGetDirectory();
27824    test_ret += test_xmlParserInputBufferCreateFd();
27825    test_ret += test_xmlParserInputBufferCreateFile();
27826    test_ret += test_xmlParserInputBufferCreateFilename();
27827    test_ret += test_xmlParserInputBufferCreateMem();
27828    test_ret += test_xmlParserInputBufferCreateStatic();
27829    test_ret += test_xmlParserInputBufferGrow();
27830    test_ret += test_xmlParserInputBufferPush();
27831    test_ret += test_xmlParserInputBufferRead();
27832    test_ret += test_xmlPopInputCallbacks();
27833    test_ret += test_xmlRegisterDefaultInputCallbacks();
27834    test_ret += test_xmlRegisterDefaultOutputCallbacks();
27835    test_ret += test_xmlRegisterHTTPPostCallbacks();
27836
27837    if (test_ret != 0)
27838	printf("Module xmlIO: %d errors\n", test_ret);
27839    return(test_ret);
27840}
27841#ifdef LIBXML_AUTOMATA_ENABLED
27842
27843#define gen_nb_xmlAutomataPtr 1
27844static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27845    return(NULL);
27846}
27847static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27848}
27849#endif
27850
27851
27852static int
27853test_xmlAutomataCompile(void) {
27854    int test_ret = 0;
27855
27856
27857    /* missing type support */
27858    return(test_ret);
27859}
27860
27861
27862static int
27863test_xmlAutomataGetInitState(void) {
27864    int test_ret = 0;
27865
27866
27867    /* missing type support */
27868    return(test_ret);
27869}
27870
27871
27872static int
27873test_xmlAutomataIsDeterminist(void) {
27874    int test_ret = 0;
27875
27876#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
27877    int mem_base;
27878    int ret_val;
27879    xmlAutomataPtr am; /* an automata */
27880    int n_am;
27881
27882    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27883        mem_base = xmlMemBlocks();
27884        am = gen_xmlAutomataPtr(n_am, 0);
27885
27886        ret_val = xmlAutomataIsDeterminist(am);
27887        desret_int(ret_val);
27888        call_tests++;
27889        des_xmlAutomataPtr(n_am, am, 0);
27890        xmlResetLastError();
27891        if (mem_base != xmlMemBlocks()) {
27892            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
27893	           xmlMemBlocks() - mem_base);
27894	    test_ret++;
27895            printf(" %d", n_am);
27896            printf("\n");
27897        }
27898    }
27899    function_tests++;
27900#endif
27901
27902    return(test_ret);
27903}
27904
27905#ifdef LIBXML_AUTOMATA_ENABLED
27906
27907#define gen_nb_xmlAutomataStatePtr 1
27908static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27909    return(NULL);
27910}
27911static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27912}
27913#endif
27914
27915
27916static int
27917test_xmlAutomataNewAllTrans(void) {
27918    int test_ret = 0;
27919
27920
27921    /* missing type support */
27922    return(test_ret);
27923}
27924
27925
27926static int
27927test_xmlAutomataNewCountTrans(void) {
27928    int test_ret = 0;
27929
27930
27931    /* missing type support */
27932    return(test_ret);
27933}
27934
27935
27936static int
27937test_xmlAutomataNewCountTrans2(void) {
27938    int test_ret = 0;
27939
27940
27941    /* missing type support */
27942    return(test_ret);
27943}
27944
27945
27946static int
27947test_xmlAutomataNewCountedTrans(void) {
27948    int test_ret = 0;
27949
27950
27951    /* missing type support */
27952    return(test_ret);
27953}
27954
27955
27956static int
27957test_xmlAutomataNewCounter(void) {
27958    int test_ret = 0;
27959
27960#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
27961    int mem_base;
27962    int ret_val;
27963    xmlAutomataPtr am; /* an automata */
27964    int n_am;
27965    int min; /* the minimal value on the counter */
27966    int n_min;
27967    int max; /* the maximal value on the counter */
27968    int n_max;
27969
27970    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27971    for (n_min = 0;n_min < gen_nb_int;n_min++) {
27972    for (n_max = 0;n_max < gen_nb_int;n_max++) {
27973        mem_base = xmlMemBlocks();
27974        am = gen_xmlAutomataPtr(n_am, 0);
27975        min = gen_int(n_min, 1);
27976        max = gen_int(n_max, 2);
27977
27978        ret_val = xmlAutomataNewCounter(am, min, max);
27979        desret_int(ret_val);
27980        call_tests++;
27981        des_xmlAutomataPtr(n_am, am, 0);
27982        des_int(n_min, min, 1);
27983        des_int(n_max, max, 2);
27984        xmlResetLastError();
27985        if (mem_base != xmlMemBlocks()) {
27986            printf("Leak of %d blocks found in xmlAutomataNewCounter",
27987	           xmlMemBlocks() - mem_base);
27988	    test_ret++;
27989            printf(" %d", n_am);
27990            printf(" %d", n_min);
27991            printf(" %d", n_max);
27992            printf("\n");
27993        }
27994    }
27995    }
27996    }
27997    function_tests++;
27998#endif
27999
28000    return(test_ret);
28001}
28002
28003
28004static int
28005test_xmlAutomataNewCounterTrans(void) {
28006    int test_ret = 0;
28007
28008
28009    /* missing type support */
28010    return(test_ret);
28011}
28012
28013
28014static int
28015test_xmlAutomataNewEpsilon(void) {
28016    int test_ret = 0;
28017
28018
28019    /* missing type support */
28020    return(test_ret);
28021}
28022
28023
28024static int
28025test_xmlAutomataNewOnceTrans(void) {
28026    int test_ret = 0;
28027
28028
28029    /* missing type support */
28030    return(test_ret);
28031}
28032
28033
28034static int
28035test_xmlAutomataNewOnceTrans2(void) {
28036    int test_ret = 0;
28037
28038
28039    /* missing type support */
28040    return(test_ret);
28041}
28042
28043
28044static int
28045test_xmlAutomataNewState(void) {
28046    int test_ret = 0;
28047
28048
28049    /* missing type support */
28050    return(test_ret);
28051}
28052
28053
28054static int
28055test_xmlAutomataNewTransition(void) {
28056    int test_ret = 0;
28057
28058
28059    /* missing type support */
28060    return(test_ret);
28061}
28062
28063
28064static int
28065test_xmlAutomataNewTransition2(void) {
28066    int test_ret = 0;
28067
28068
28069    /* missing type support */
28070    return(test_ret);
28071}
28072
28073
28074static int
28075test_xmlAutomataSetFinalState(void) {
28076    int test_ret = 0;
28077
28078#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28079    int mem_base;
28080    int ret_val;
28081    xmlAutomataPtr am; /* an automata */
28082    int n_am;
28083    xmlAutomataStatePtr state; /* a state in this automata */
28084    int n_state;
28085
28086    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28087    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
28088        mem_base = xmlMemBlocks();
28089        am = gen_xmlAutomataPtr(n_am, 0);
28090        state = gen_xmlAutomataStatePtr(n_state, 1);
28091
28092        ret_val = xmlAutomataSetFinalState(am, state);
28093        desret_int(ret_val);
28094        call_tests++;
28095        des_xmlAutomataPtr(n_am, am, 0);
28096        des_xmlAutomataStatePtr(n_state, state, 1);
28097        xmlResetLastError();
28098        if (mem_base != xmlMemBlocks()) {
28099            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
28100	           xmlMemBlocks() - mem_base);
28101	    test_ret++;
28102            printf(" %d", n_am);
28103            printf(" %d", n_state);
28104            printf("\n");
28105        }
28106    }
28107    }
28108    function_tests++;
28109#endif
28110
28111    return(test_ret);
28112}
28113
28114
28115static int
28116test_xmlNewAutomata(void) {
28117    int test_ret = 0;
28118
28119
28120    /* missing type support */
28121    return(test_ret);
28122}
28123
28124static int
28125test_xmlautomata(void) {
28126    int test_ret = 0;
28127
28128    if (quiet == 0) printf("Testing xmlautomata : 3 of 18 functions ...\n");
28129    test_ret += test_xmlAutomataCompile();
28130    test_ret += test_xmlAutomataGetInitState();
28131    test_ret += test_xmlAutomataIsDeterminist();
28132    test_ret += test_xmlAutomataNewAllTrans();
28133    test_ret += test_xmlAutomataNewCountTrans();
28134    test_ret += test_xmlAutomataNewCountTrans2();
28135    test_ret += test_xmlAutomataNewCountedTrans();
28136    test_ret += test_xmlAutomataNewCounter();
28137    test_ret += test_xmlAutomataNewCounterTrans();
28138    test_ret += test_xmlAutomataNewEpsilon();
28139    test_ret += test_xmlAutomataNewOnceTrans();
28140    test_ret += test_xmlAutomataNewOnceTrans2();
28141    test_ret += test_xmlAutomataNewState();
28142    test_ret += test_xmlAutomataNewTransition();
28143    test_ret += test_xmlAutomataNewTransition2();
28144    test_ret += test_xmlAutomataSetFinalState();
28145    test_ret += test_xmlNewAutomata();
28146
28147    if (test_ret != 0)
28148	printf("Module xmlautomata: %d errors\n", test_ret);
28149    return(test_ret);
28150}
28151
28152#define gen_nb_xmlGenericErrorFunc_ptr 1
28153static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28154    return(NULL);
28155}
28156static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28157}
28158
28159static int
28160test_initGenericErrorDefaultFunc(void) {
28161    int test_ret = 0;
28162
28163    int mem_base;
28164    xmlGenericErrorFunc * handler; /* the handler */
28165    int n_handler;
28166
28167    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
28168        mem_base = xmlMemBlocks();
28169        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
28170
28171        initGenericErrorDefaultFunc(handler);
28172        call_tests++;
28173        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
28174        xmlResetLastError();
28175        if (mem_base != xmlMemBlocks()) {
28176            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
28177	           xmlMemBlocks() - mem_base);
28178	    test_ret++;
28179            printf(" %d", n_handler);
28180            printf("\n");
28181        }
28182    }
28183    function_tests++;
28184
28185    return(test_ret);
28186}
28187
28188
28189#define gen_nb_xmlErrorPtr 1
28190static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28191    return(NULL);
28192}
28193static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28194}
28195
28196static int
28197test_xmlCopyError(void) {
28198    int test_ret = 0;
28199
28200    int mem_base;
28201    int ret_val;
28202    xmlErrorPtr from; /* a source error */
28203    int n_from;
28204    xmlErrorPtr to; /* a target error */
28205    int n_to;
28206
28207    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
28208    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
28209        mem_base = xmlMemBlocks();
28210        from = gen_xmlErrorPtr(n_from, 0);
28211        to = gen_xmlErrorPtr(n_to, 1);
28212
28213        ret_val = xmlCopyError(from, to);
28214        desret_int(ret_val);
28215        call_tests++;
28216        des_xmlErrorPtr(n_from, from, 0);
28217        des_xmlErrorPtr(n_to, to, 1);
28218        xmlResetLastError();
28219        if (mem_base != xmlMemBlocks()) {
28220            printf("Leak of %d blocks found in xmlCopyError",
28221	           xmlMemBlocks() - mem_base);
28222	    test_ret++;
28223            printf(" %d", n_from);
28224            printf(" %d", n_to);
28225            printf("\n");
28226        }
28227    }
28228    }
28229    function_tests++;
28230
28231    return(test_ret);
28232}
28233
28234
28235static int
28236test_xmlCtxtGetLastError(void) {
28237    int test_ret = 0;
28238
28239
28240    /* missing type support */
28241    return(test_ret);
28242}
28243
28244
28245static int
28246test_xmlCtxtResetLastError(void) {
28247    int test_ret = 0;
28248
28249    int mem_base;
28250    void * ctx; /* an XML parser context */
28251    int n_ctx;
28252
28253    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
28254        mem_base = xmlMemBlocks();
28255        ctx = gen_void_ptr(n_ctx, 0);
28256
28257        xmlCtxtResetLastError(ctx);
28258        call_tests++;
28259        des_void_ptr(n_ctx, ctx, 0);
28260        xmlResetLastError();
28261        if (mem_base != xmlMemBlocks()) {
28262            printf("Leak of %d blocks found in xmlCtxtResetLastError",
28263	           xmlMemBlocks() - mem_base);
28264	    test_ret++;
28265            printf(" %d", n_ctx);
28266            printf("\n");
28267        }
28268    }
28269    function_tests++;
28270
28271    return(test_ret);
28272}
28273
28274
28275static int
28276test_xmlGetLastError(void) {
28277    int test_ret = 0;
28278
28279
28280    /* missing type support */
28281    return(test_ret);
28282}
28283
28284
28285static int
28286test_xmlParserError(void) {
28287    int test_ret = 0;
28288
28289
28290    /* missing type support */
28291    return(test_ret);
28292}
28293
28294
28295static int
28296test_xmlParserPrintFileContext(void) {
28297    int test_ret = 0;
28298
28299    int mem_base;
28300    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28301    int n_input;
28302
28303    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28304        mem_base = xmlMemBlocks();
28305        input = gen_xmlParserInputPtr(n_input, 0);
28306
28307        xmlParserPrintFileContext(input);
28308        call_tests++;
28309        des_xmlParserInputPtr(n_input, input, 0);
28310        xmlResetLastError();
28311        if (mem_base != xmlMemBlocks()) {
28312            printf("Leak of %d blocks found in xmlParserPrintFileContext",
28313	           xmlMemBlocks() - mem_base);
28314	    test_ret++;
28315            printf(" %d", n_input);
28316            printf("\n");
28317        }
28318    }
28319    function_tests++;
28320
28321    return(test_ret);
28322}
28323
28324
28325static int
28326test_xmlParserPrintFileInfo(void) {
28327    int test_ret = 0;
28328
28329    int mem_base;
28330    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28331    int n_input;
28332
28333    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28334        mem_base = xmlMemBlocks();
28335        input = gen_xmlParserInputPtr(n_input, 0);
28336
28337        xmlParserPrintFileInfo(input);
28338        call_tests++;
28339        des_xmlParserInputPtr(n_input, input, 0);
28340        xmlResetLastError();
28341        if (mem_base != xmlMemBlocks()) {
28342            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
28343	           xmlMemBlocks() - mem_base);
28344	    test_ret++;
28345            printf(" %d", n_input);
28346            printf("\n");
28347        }
28348    }
28349    function_tests++;
28350
28351    return(test_ret);
28352}
28353
28354
28355static int
28356test_xmlParserValidityError(void) {
28357    int test_ret = 0;
28358
28359
28360    /* missing type support */
28361    return(test_ret);
28362}
28363
28364
28365static int
28366test_xmlParserValidityWarning(void) {
28367    int test_ret = 0;
28368
28369
28370    /* missing type support */
28371    return(test_ret);
28372}
28373
28374
28375static int
28376test_xmlParserWarning(void) {
28377    int test_ret = 0;
28378
28379
28380    /* missing type support */
28381    return(test_ret);
28382}
28383
28384
28385static int
28386test_xmlResetError(void) {
28387    int test_ret = 0;
28388
28389    int mem_base;
28390    xmlErrorPtr err; /* pointer to the error. */
28391    int n_err;
28392
28393    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
28394        mem_base = xmlMemBlocks();
28395        err = gen_xmlErrorPtr(n_err, 0);
28396
28397        xmlResetError(err);
28398        call_tests++;
28399        des_xmlErrorPtr(n_err, err, 0);
28400        xmlResetLastError();
28401        if (mem_base != xmlMemBlocks()) {
28402            printf("Leak of %d blocks found in xmlResetError",
28403	           xmlMemBlocks() - mem_base);
28404	    test_ret++;
28405            printf(" %d", n_err);
28406            printf("\n");
28407        }
28408    }
28409    function_tests++;
28410
28411    return(test_ret);
28412}
28413
28414
28415static int
28416test_xmlResetLastError(void) {
28417    int test_ret = 0;
28418
28419
28420
28421        xmlResetLastError();
28422        call_tests++;
28423        xmlResetLastError();
28424    function_tests++;
28425
28426    return(test_ret);
28427}
28428
28429
28430static int
28431test_xmlSetGenericErrorFunc(void) {
28432    int test_ret = 0;
28433
28434
28435    /* missing type support */
28436    return(test_ret);
28437}
28438
28439
28440static int
28441test_xmlSetStructuredErrorFunc(void) {
28442    int test_ret = 0;
28443
28444
28445    /* missing type support */
28446    return(test_ret);
28447}
28448
28449static int
28450test_xmlerror(void) {
28451    int test_ret = 0;
28452
28453    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
28454    test_ret += test_initGenericErrorDefaultFunc();
28455    test_ret += test_xmlCopyError();
28456    test_ret += test_xmlCtxtGetLastError();
28457    test_ret += test_xmlCtxtResetLastError();
28458    test_ret += test_xmlGetLastError();
28459    test_ret += test_xmlParserError();
28460    test_ret += test_xmlParserPrintFileContext();
28461    test_ret += test_xmlParserPrintFileInfo();
28462    test_ret += test_xmlParserValidityError();
28463    test_ret += test_xmlParserValidityWarning();
28464    test_ret += test_xmlParserWarning();
28465    test_ret += test_xmlResetError();
28466    test_ret += test_xmlResetLastError();
28467    test_ret += test_xmlSetGenericErrorFunc();
28468    test_ret += test_xmlSetStructuredErrorFunc();
28469
28470    if (test_ret != 0)
28471	printf("Module xmlerror: %d errors\n", test_ret);
28472    return(test_ret);
28473}
28474#ifdef LIBXML_MODULES_ENABLED
28475
28476#define gen_nb_xmlModulePtr 1
28477static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28478    return(NULL);
28479}
28480static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28481}
28482#endif
28483
28484
28485static int
28486test_xmlModuleClose(void) {
28487    int test_ret = 0;
28488
28489#if defined(LIBXML_MODULES_ENABLED)
28490    int mem_base;
28491    int ret_val;
28492    xmlModulePtr module; /* the module handle */
28493    int n_module;
28494
28495    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
28496        mem_base = xmlMemBlocks();
28497        module = gen_xmlModulePtr(n_module, 0);
28498
28499        ret_val = xmlModuleClose(module);
28500        desret_int(ret_val);
28501        call_tests++;
28502        des_xmlModulePtr(n_module, module, 0);
28503        xmlResetLastError();
28504        if (mem_base != xmlMemBlocks()) {
28505            printf("Leak of %d blocks found in xmlModuleClose",
28506	           xmlMemBlocks() - mem_base);
28507	    test_ret++;
28508            printf(" %d", n_module);
28509            printf("\n");
28510        }
28511    }
28512    function_tests++;
28513#endif
28514
28515    return(test_ret);
28516}
28517
28518
28519static int
28520test_xmlModuleOpen(void) {
28521    int test_ret = 0;
28522
28523
28524    /* missing type support */
28525    return(test_ret);
28526}
28527
28528
28529static int
28530test_xmlModuleSymbol(void) {
28531    int test_ret = 0;
28532
28533#if defined(LIBXML_MODULES_ENABLED)
28534    int mem_base;
28535    int ret_val;
28536    xmlModulePtr module; /* the module */
28537    int n_module;
28538    char * name; /* the name of the symbol */
28539    int n_name;
28540    void ** symbol; /* the resulting symbol address */
28541    int n_symbol;
28542
28543    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
28544    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
28545    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
28546        mem_base = xmlMemBlocks();
28547        module = gen_xmlModulePtr(n_module, 0);
28548        name = gen_const_char_ptr(n_name, 1);
28549        symbol = gen_void_ptr_ptr(n_symbol, 2);
28550
28551        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
28552        desret_int(ret_val);
28553        call_tests++;
28554        des_xmlModulePtr(n_module, module, 0);
28555        des_const_char_ptr(n_name, (const char *)name, 1);
28556        des_void_ptr_ptr(n_symbol, symbol, 2);
28557        xmlResetLastError();
28558        if (mem_base != xmlMemBlocks()) {
28559            printf("Leak of %d blocks found in xmlModuleSymbol",
28560	           xmlMemBlocks() - mem_base);
28561	    test_ret++;
28562            printf(" %d", n_module);
28563            printf(" %d", n_name);
28564            printf(" %d", n_symbol);
28565            printf("\n");
28566        }
28567    }
28568    }
28569    }
28570    function_tests++;
28571#endif
28572
28573    return(test_ret);
28574}
28575
28576static int
28577test_xmlmodule(void) {
28578    int test_ret = 0;
28579
28580    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
28581    test_ret += test_xmlModuleClose();
28582    test_ret += test_xmlModuleOpen();
28583    test_ret += test_xmlModuleSymbol();
28584
28585    if (test_ret != 0)
28586	printf("Module xmlmodule: %d errors\n", test_ret);
28587    return(test_ret);
28588}
28589
28590static int
28591test_xmlNewTextReader(void) {
28592    int test_ret = 0;
28593
28594#if defined(LIBXML_READER_ENABLED)
28595    int mem_base;
28596    xmlTextReaderPtr ret_val;
28597    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
28598    int n_input;
28599    const char * URI; /* the URI information for the source if available */
28600    int n_URI;
28601
28602    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
28603    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
28604        mem_base = xmlMemBlocks();
28605        input = gen_xmlParserInputBufferPtr(n_input, 0);
28606        URI = gen_filepath(n_URI, 1);
28607
28608        ret_val = xmlNewTextReader(input, URI);
28609        desret_xmlTextReaderPtr(ret_val);
28610        call_tests++;
28611        des_xmlParserInputBufferPtr(n_input, input, 0);
28612        des_filepath(n_URI, URI, 1);
28613        xmlResetLastError();
28614        if (mem_base != xmlMemBlocks()) {
28615            printf("Leak of %d blocks found in xmlNewTextReader",
28616	           xmlMemBlocks() - mem_base);
28617	    test_ret++;
28618            printf(" %d", n_input);
28619            printf(" %d", n_URI);
28620            printf("\n");
28621        }
28622    }
28623    }
28624    function_tests++;
28625#endif
28626
28627    return(test_ret);
28628}
28629
28630
28631static int
28632test_xmlNewTextReaderFilename(void) {
28633    int test_ret = 0;
28634
28635#if defined(LIBXML_READER_ENABLED)
28636    int mem_base;
28637    xmlTextReaderPtr ret_val;
28638    const char * URI; /* the URI of the resource to process */
28639    int n_URI;
28640
28641    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
28642        mem_base = xmlMemBlocks();
28643        URI = gen_filepath(n_URI, 0);
28644
28645        ret_val = xmlNewTextReaderFilename(URI);
28646        desret_xmlTextReaderPtr(ret_val);
28647        call_tests++;
28648        des_filepath(n_URI, URI, 0);
28649        xmlResetLastError();
28650        if (mem_base != xmlMemBlocks()) {
28651            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
28652	           xmlMemBlocks() - mem_base);
28653	    test_ret++;
28654            printf(" %d", n_URI);
28655            printf("\n");
28656        }
28657    }
28658    function_tests++;
28659#endif
28660
28661    return(test_ret);
28662}
28663
28664
28665static int
28666test_xmlReaderForDoc(void) {
28667    int test_ret = 0;
28668
28669#if defined(LIBXML_READER_ENABLED)
28670    int mem_base;
28671    xmlTextReaderPtr ret_val;
28672    xmlChar * cur; /* a pointer to a zero terminated string */
28673    int n_cur;
28674    const char * URL; /* the base URL to use for the document */
28675    int n_URL;
28676    char * encoding; /* the document encoding, or NULL */
28677    int n_encoding;
28678    int options; /* a combination of xmlParserOption */
28679    int n_options;
28680
28681    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28682    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28683    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28684    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28685        mem_base = xmlMemBlocks();
28686        cur = gen_const_xmlChar_ptr(n_cur, 0);
28687        URL = gen_filepath(n_URL, 1);
28688        encoding = gen_const_char_ptr(n_encoding, 2);
28689        options = gen_parseroptions(n_options, 3);
28690
28691        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
28692        desret_xmlTextReaderPtr(ret_val);
28693        call_tests++;
28694        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
28695        des_filepath(n_URL, URL, 1);
28696        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
28697        des_parseroptions(n_options, options, 3);
28698        xmlResetLastError();
28699        if (mem_base != xmlMemBlocks()) {
28700            printf("Leak of %d blocks found in xmlReaderForDoc",
28701	           xmlMemBlocks() - mem_base);
28702	    test_ret++;
28703            printf(" %d", n_cur);
28704            printf(" %d", n_URL);
28705            printf(" %d", n_encoding);
28706            printf(" %d", n_options);
28707            printf("\n");
28708        }
28709    }
28710    }
28711    }
28712    }
28713    function_tests++;
28714#endif
28715
28716    return(test_ret);
28717}
28718
28719
28720static int
28721test_xmlReaderForFile(void) {
28722    int test_ret = 0;
28723
28724#if defined(LIBXML_READER_ENABLED)
28725    int mem_base;
28726    xmlTextReaderPtr ret_val;
28727    const char * filename; /* a file or URL */
28728    int n_filename;
28729    char * encoding; /* the document encoding, or NULL */
28730    int n_encoding;
28731    int options; /* a combination of xmlParserOption */
28732    int n_options;
28733
28734    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28735    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28736    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28737        mem_base = xmlMemBlocks();
28738        filename = gen_filepath(n_filename, 0);
28739        encoding = gen_const_char_ptr(n_encoding, 1);
28740        options = gen_parseroptions(n_options, 2);
28741
28742        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
28743        desret_xmlTextReaderPtr(ret_val);
28744        call_tests++;
28745        des_filepath(n_filename, filename, 0);
28746        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
28747        des_parseroptions(n_options, options, 2);
28748        xmlResetLastError();
28749        if (mem_base != xmlMemBlocks()) {
28750            printf("Leak of %d blocks found in xmlReaderForFile",
28751	           xmlMemBlocks() - mem_base);
28752	    test_ret++;
28753            printf(" %d", n_filename);
28754            printf(" %d", n_encoding);
28755            printf(" %d", n_options);
28756            printf("\n");
28757        }
28758    }
28759    }
28760    }
28761    function_tests++;
28762#endif
28763
28764    return(test_ret);
28765}
28766
28767
28768static int
28769test_xmlReaderForMemory(void) {
28770    int test_ret = 0;
28771
28772#if defined(LIBXML_READER_ENABLED)
28773    int mem_base;
28774    xmlTextReaderPtr ret_val;
28775    char * buffer; /* a pointer to a char array */
28776    int n_buffer;
28777    int size; /* the size of the array */
28778    int n_size;
28779    const char * URL; /* the base URL to use for the document */
28780    int n_URL;
28781    char * encoding; /* the document encoding, or NULL */
28782    int n_encoding;
28783    int options; /* a combination of xmlParserOption */
28784    int n_options;
28785
28786    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28787    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28788    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28789    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28790    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28791        mem_base = xmlMemBlocks();
28792        buffer = gen_const_char_ptr(n_buffer, 0);
28793        size = gen_int(n_size, 1);
28794        URL = gen_filepath(n_URL, 2);
28795        encoding = gen_const_char_ptr(n_encoding, 3);
28796        options = gen_parseroptions(n_options, 4);
28797
28798        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
28799        desret_xmlTextReaderPtr(ret_val);
28800        call_tests++;
28801        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
28802        des_int(n_size, size, 1);
28803        des_filepath(n_URL, URL, 2);
28804        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
28805        des_parseroptions(n_options, options, 4);
28806        xmlResetLastError();
28807        if (mem_base != xmlMemBlocks()) {
28808            printf("Leak of %d blocks found in xmlReaderForMemory",
28809	           xmlMemBlocks() - mem_base);
28810	    test_ret++;
28811            printf(" %d", n_buffer);
28812            printf(" %d", n_size);
28813            printf(" %d", n_URL);
28814            printf(" %d", n_encoding);
28815            printf(" %d", n_options);
28816            printf("\n");
28817        }
28818    }
28819    }
28820    }
28821    }
28822    }
28823    function_tests++;
28824#endif
28825
28826    return(test_ret);
28827}
28828
28829
28830static int
28831test_xmlReaderNewDoc(void) {
28832    int test_ret = 0;
28833
28834#if defined(LIBXML_READER_ENABLED)
28835    int mem_base;
28836    int ret_val;
28837    xmlTextReaderPtr reader; /* an XML reader */
28838    int n_reader;
28839    xmlChar * cur; /* a pointer to a zero terminated string */
28840    int n_cur;
28841    const char * URL; /* the base URL to use for the document */
28842    int n_URL;
28843    char * encoding; /* the document encoding, or NULL */
28844    int n_encoding;
28845    int options; /* a combination of xmlParserOption */
28846    int n_options;
28847
28848    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28849    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28850    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28851    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28852    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28853        mem_base = xmlMemBlocks();
28854        reader = gen_xmlTextReaderPtr(n_reader, 0);
28855        cur = gen_const_xmlChar_ptr(n_cur, 1);
28856        URL = gen_filepath(n_URL, 2);
28857        encoding = gen_const_char_ptr(n_encoding, 3);
28858        options = gen_parseroptions(n_options, 4);
28859
28860        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
28861        desret_int(ret_val);
28862        call_tests++;
28863        des_xmlTextReaderPtr(n_reader, reader, 0);
28864        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
28865        des_filepath(n_URL, URL, 2);
28866        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
28867        des_parseroptions(n_options, options, 4);
28868        xmlResetLastError();
28869        if (mem_base != xmlMemBlocks()) {
28870            printf("Leak of %d blocks found in xmlReaderNewDoc",
28871	           xmlMemBlocks() - mem_base);
28872	    test_ret++;
28873            printf(" %d", n_reader);
28874            printf(" %d", n_cur);
28875            printf(" %d", n_URL);
28876            printf(" %d", n_encoding);
28877            printf(" %d", n_options);
28878            printf("\n");
28879        }
28880    }
28881    }
28882    }
28883    }
28884    }
28885    function_tests++;
28886#endif
28887
28888    return(test_ret);
28889}
28890
28891
28892static int
28893test_xmlReaderNewFile(void) {
28894    int test_ret = 0;
28895
28896#if defined(LIBXML_READER_ENABLED)
28897    int mem_base;
28898    int ret_val;
28899    xmlTextReaderPtr reader; /* an XML reader */
28900    int n_reader;
28901    const char * filename; /* a file or URL */
28902    int n_filename;
28903    char * encoding; /* the document encoding, or NULL */
28904    int n_encoding;
28905    int options; /* a combination of xmlParserOption */
28906    int n_options;
28907
28908    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28909    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28910    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28911    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28912        mem_base = xmlMemBlocks();
28913        reader = gen_xmlTextReaderPtr(n_reader, 0);
28914        filename = gen_filepath(n_filename, 1);
28915        encoding = gen_const_char_ptr(n_encoding, 2);
28916        options = gen_parseroptions(n_options, 3);
28917
28918        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
28919        desret_int(ret_val);
28920        call_tests++;
28921        des_xmlTextReaderPtr(n_reader, reader, 0);
28922        des_filepath(n_filename, filename, 1);
28923        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
28924        des_parseroptions(n_options, options, 3);
28925        xmlResetLastError();
28926        if (mem_base != xmlMemBlocks()) {
28927            printf("Leak of %d blocks found in xmlReaderNewFile",
28928	           xmlMemBlocks() - mem_base);
28929	    test_ret++;
28930            printf(" %d", n_reader);
28931            printf(" %d", n_filename);
28932            printf(" %d", n_encoding);
28933            printf(" %d", n_options);
28934            printf("\n");
28935        }
28936    }
28937    }
28938    }
28939    }
28940    function_tests++;
28941#endif
28942
28943    return(test_ret);
28944}
28945
28946
28947static int
28948test_xmlReaderNewMemory(void) {
28949    int test_ret = 0;
28950
28951#if defined(LIBXML_READER_ENABLED)
28952    int mem_base;
28953    int ret_val;
28954    xmlTextReaderPtr reader; /* an XML reader */
28955    int n_reader;
28956    char * buffer; /* a pointer to a char array */
28957    int n_buffer;
28958    int size; /* the size of the array */
28959    int n_size;
28960    const char * URL; /* the base URL to use for the document */
28961    int n_URL;
28962    char * encoding; /* the document encoding, or NULL */
28963    int n_encoding;
28964    int options; /* a combination of xmlParserOption */
28965    int n_options;
28966
28967    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28968    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28969    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28970    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28971    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28972    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28973        mem_base = xmlMemBlocks();
28974        reader = gen_xmlTextReaderPtr(n_reader, 0);
28975        buffer = gen_const_char_ptr(n_buffer, 1);
28976        size = gen_int(n_size, 2);
28977        URL = gen_filepath(n_URL, 3);
28978        encoding = gen_const_char_ptr(n_encoding, 4);
28979        options = gen_parseroptions(n_options, 5);
28980
28981        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
28982        desret_int(ret_val);
28983        call_tests++;
28984        des_xmlTextReaderPtr(n_reader, reader, 0);
28985        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
28986        des_int(n_size, size, 2);
28987        des_filepath(n_URL, URL, 3);
28988        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
28989        des_parseroptions(n_options, options, 5);
28990        xmlResetLastError();
28991        if (mem_base != xmlMemBlocks()) {
28992            printf("Leak of %d blocks found in xmlReaderNewMemory",
28993	           xmlMemBlocks() - mem_base);
28994	    test_ret++;
28995            printf(" %d", n_reader);
28996            printf(" %d", n_buffer);
28997            printf(" %d", n_size);
28998            printf(" %d", n_URL);
28999            printf(" %d", n_encoding);
29000            printf(" %d", n_options);
29001            printf("\n");
29002        }
29003    }
29004    }
29005    }
29006    }
29007    }
29008    }
29009    function_tests++;
29010#endif
29011
29012    return(test_ret);
29013}
29014
29015
29016static int
29017test_xmlReaderNewWalker(void) {
29018    int test_ret = 0;
29019
29020#if defined(LIBXML_READER_ENABLED)
29021    int mem_base;
29022    int ret_val;
29023    xmlTextReaderPtr reader; /* an XML reader */
29024    int n_reader;
29025    xmlDocPtr doc; /* a preparsed document */
29026    int n_doc;
29027
29028    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29029    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29030        mem_base = xmlMemBlocks();
29031        reader = gen_xmlTextReaderPtr(n_reader, 0);
29032        doc = gen_xmlDocPtr(n_doc, 1);
29033
29034        ret_val = xmlReaderNewWalker(reader, doc);
29035        desret_int(ret_val);
29036        call_tests++;
29037        des_xmlTextReaderPtr(n_reader, reader, 0);
29038        des_xmlDocPtr(n_doc, doc, 1);
29039        xmlResetLastError();
29040        if (mem_base != xmlMemBlocks()) {
29041            printf("Leak of %d blocks found in xmlReaderNewWalker",
29042	           xmlMemBlocks() - mem_base);
29043	    test_ret++;
29044            printf(" %d", n_reader);
29045            printf(" %d", n_doc);
29046            printf("\n");
29047        }
29048    }
29049    }
29050    function_tests++;
29051#endif
29052
29053    return(test_ret);
29054}
29055
29056
29057static int
29058test_xmlReaderWalker(void) {
29059    int test_ret = 0;
29060
29061#if defined(LIBXML_READER_ENABLED)
29062    int mem_base;
29063    xmlTextReaderPtr ret_val;
29064    xmlDocPtr doc; /* a preparsed document */
29065    int n_doc;
29066
29067    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29068        mem_base = xmlMemBlocks();
29069        doc = gen_xmlDocPtr(n_doc, 0);
29070
29071        ret_val = xmlReaderWalker(doc);
29072        desret_xmlTextReaderPtr(ret_val);
29073        call_tests++;
29074        des_xmlDocPtr(n_doc, doc, 0);
29075        xmlResetLastError();
29076        if (mem_base != xmlMemBlocks()) {
29077            printf("Leak of %d blocks found in xmlReaderWalker",
29078	           xmlMemBlocks() - mem_base);
29079	    test_ret++;
29080            printf(" %d", n_doc);
29081            printf("\n");
29082        }
29083    }
29084    function_tests++;
29085#endif
29086
29087    return(test_ret);
29088}
29089
29090
29091static int
29092test_xmlTextReaderAttributeCount(void) {
29093    int test_ret = 0;
29094
29095#if defined(LIBXML_READER_ENABLED)
29096    int mem_base;
29097    int ret_val;
29098    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29099    int n_reader;
29100
29101    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29102        mem_base = xmlMemBlocks();
29103        reader = gen_xmlTextReaderPtr(n_reader, 0);
29104
29105        ret_val = xmlTextReaderAttributeCount(reader);
29106        desret_int(ret_val);
29107        call_tests++;
29108        des_xmlTextReaderPtr(n_reader, reader, 0);
29109        xmlResetLastError();
29110        if (mem_base != xmlMemBlocks()) {
29111            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
29112	           xmlMemBlocks() - mem_base);
29113	    test_ret++;
29114            printf(" %d", n_reader);
29115            printf("\n");
29116        }
29117    }
29118    function_tests++;
29119#endif
29120
29121    return(test_ret);
29122}
29123
29124
29125static int
29126test_xmlTextReaderBaseUri(void) {
29127    int test_ret = 0;
29128
29129#if defined(LIBXML_READER_ENABLED)
29130    int mem_base;
29131    xmlChar * ret_val;
29132    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29133    int n_reader;
29134
29135    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29136        mem_base = xmlMemBlocks();
29137        reader = gen_xmlTextReaderPtr(n_reader, 0);
29138
29139        ret_val = xmlTextReaderBaseUri(reader);
29140        desret_xmlChar_ptr(ret_val);
29141        call_tests++;
29142        des_xmlTextReaderPtr(n_reader, reader, 0);
29143        xmlResetLastError();
29144        if (mem_base != xmlMemBlocks()) {
29145            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
29146	           xmlMemBlocks() - mem_base);
29147	    test_ret++;
29148            printf(" %d", n_reader);
29149            printf("\n");
29150        }
29151    }
29152    function_tests++;
29153#endif
29154
29155    return(test_ret);
29156}
29157
29158
29159static int
29160test_xmlTextReaderByteConsumed(void) {
29161    int test_ret = 0;
29162
29163#if defined(LIBXML_READER_ENABLED)
29164    int mem_base;
29165    long ret_val;
29166    xmlTextReaderPtr reader; /* an XML reader */
29167    int n_reader;
29168
29169    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29170        mem_base = xmlMemBlocks();
29171        reader = gen_xmlTextReaderPtr(n_reader, 0);
29172
29173        ret_val = xmlTextReaderByteConsumed(reader);
29174        desret_long(ret_val);
29175        call_tests++;
29176        des_xmlTextReaderPtr(n_reader, reader, 0);
29177        xmlResetLastError();
29178        if (mem_base != xmlMemBlocks()) {
29179            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
29180	           xmlMemBlocks() - mem_base);
29181	    test_ret++;
29182            printf(" %d", n_reader);
29183            printf("\n");
29184        }
29185    }
29186    function_tests++;
29187#endif
29188
29189    return(test_ret);
29190}
29191
29192
29193static int
29194test_xmlTextReaderClose(void) {
29195    int test_ret = 0;
29196
29197#if defined(LIBXML_READER_ENABLED)
29198    int mem_base;
29199    int ret_val;
29200    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29201    int n_reader;
29202
29203    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29204        mem_base = xmlMemBlocks();
29205        reader = gen_xmlTextReaderPtr(n_reader, 0);
29206
29207        ret_val = xmlTextReaderClose(reader);
29208        desret_int(ret_val);
29209        call_tests++;
29210        des_xmlTextReaderPtr(n_reader, reader, 0);
29211        xmlResetLastError();
29212        if (mem_base != xmlMemBlocks()) {
29213            printf("Leak of %d blocks found in xmlTextReaderClose",
29214	           xmlMemBlocks() - mem_base);
29215	    test_ret++;
29216            printf(" %d", n_reader);
29217            printf("\n");
29218        }
29219    }
29220    function_tests++;
29221#endif
29222
29223    return(test_ret);
29224}
29225
29226
29227static int
29228test_xmlTextReaderConstBaseUri(void) {
29229    int test_ret = 0;
29230
29231#if defined(LIBXML_READER_ENABLED)
29232    int mem_base;
29233    const xmlChar * ret_val;
29234    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29235    int n_reader;
29236
29237    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29238        mem_base = xmlMemBlocks();
29239        reader = gen_xmlTextReaderPtr(n_reader, 0);
29240
29241        ret_val = xmlTextReaderConstBaseUri(reader);
29242        desret_const_xmlChar_ptr(ret_val);
29243        call_tests++;
29244        des_xmlTextReaderPtr(n_reader, reader, 0);
29245        xmlResetLastError();
29246        if (mem_base != xmlMemBlocks()) {
29247            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
29248	           xmlMemBlocks() - mem_base);
29249	    test_ret++;
29250            printf(" %d", n_reader);
29251            printf("\n");
29252        }
29253    }
29254    function_tests++;
29255#endif
29256
29257    return(test_ret);
29258}
29259
29260
29261static int
29262test_xmlTextReaderConstEncoding(void) {
29263    int test_ret = 0;
29264
29265#if defined(LIBXML_READER_ENABLED)
29266    int mem_base;
29267    const xmlChar * ret_val;
29268    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29269    int n_reader;
29270
29271    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29272        mem_base = xmlMemBlocks();
29273        reader = gen_xmlTextReaderPtr(n_reader, 0);
29274
29275        ret_val = xmlTextReaderConstEncoding(reader);
29276        desret_const_xmlChar_ptr(ret_val);
29277        call_tests++;
29278        des_xmlTextReaderPtr(n_reader, reader, 0);
29279        xmlResetLastError();
29280        if (mem_base != xmlMemBlocks()) {
29281            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
29282	           xmlMemBlocks() - mem_base);
29283	    test_ret++;
29284            printf(" %d", n_reader);
29285            printf("\n");
29286        }
29287    }
29288    function_tests++;
29289#endif
29290
29291    return(test_ret);
29292}
29293
29294
29295static int
29296test_xmlTextReaderConstLocalName(void) {
29297    int test_ret = 0;
29298
29299#if defined(LIBXML_READER_ENABLED)
29300    int mem_base;
29301    const xmlChar * ret_val;
29302    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29303    int n_reader;
29304
29305    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29306        mem_base = xmlMemBlocks();
29307        reader = gen_xmlTextReaderPtr(n_reader, 0);
29308
29309        ret_val = xmlTextReaderConstLocalName(reader);
29310        desret_const_xmlChar_ptr(ret_val);
29311        call_tests++;
29312        des_xmlTextReaderPtr(n_reader, reader, 0);
29313        xmlResetLastError();
29314        if (mem_base != xmlMemBlocks()) {
29315            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
29316	           xmlMemBlocks() - mem_base);
29317	    test_ret++;
29318            printf(" %d", n_reader);
29319            printf("\n");
29320        }
29321    }
29322    function_tests++;
29323#endif
29324
29325    return(test_ret);
29326}
29327
29328
29329static int
29330test_xmlTextReaderConstName(void) {
29331    int test_ret = 0;
29332
29333#if defined(LIBXML_READER_ENABLED)
29334    int mem_base;
29335    const xmlChar * ret_val;
29336    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29337    int n_reader;
29338
29339    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29340        mem_base = xmlMemBlocks();
29341        reader = gen_xmlTextReaderPtr(n_reader, 0);
29342
29343        ret_val = xmlTextReaderConstName(reader);
29344        desret_const_xmlChar_ptr(ret_val);
29345        call_tests++;
29346        des_xmlTextReaderPtr(n_reader, reader, 0);
29347        xmlResetLastError();
29348        if (mem_base != xmlMemBlocks()) {
29349            printf("Leak of %d blocks found in xmlTextReaderConstName",
29350	           xmlMemBlocks() - mem_base);
29351	    test_ret++;
29352            printf(" %d", n_reader);
29353            printf("\n");
29354        }
29355    }
29356    function_tests++;
29357#endif
29358
29359    return(test_ret);
29360}
29361
29362
29363static int
29364test_xmlTextReaderConstNamespaceUri(void) {
29365    int test_ret = 0;
29366
29367#if defined(LIBXML_READER_ENABLED)
29368    int mem_base;
29369    const xmlChar * ret_val;
29370    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29371    int n_reader;
29372
29373    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29374        mem_base = xmlMemBlocks();
29375        reader = gen_xmlTextReaderPtr(n_reader, 0);
29376
29377        ret_val = xmlTextReaderConstNamespaceUri(reader);
29378        desret_const_xmlChar_ptr(ret_val);
29379        call_tests++;
29380        des_xmlTextReaderPtr(n_reader, reader, 0);
29381        xmlResetLastError();
29382        if (mem_base != xmlMemBlocks()) {
29383            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
29384	           xmlMemBlocks() - mem_base);
29385	    test_ret++;
29386            printf(" %d", n_reader);
29387            printf("\n");
29388        }
29389    }
29390    function_tests++;
29391#endif
29392
29393    return(test_ret);
29394}
29395
29396
29397static int
29398test_xmlTextReaderConstPrefix(void) {
29399    int test_ret = 0;
29400
29401#if defined(LIBXML_READER_ENABLED)
29402    int mem_base;
29403    const xmlChar * ret_val;
29404    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29405    int n_reader;
29406
29407    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29408        mem_base = xmlMemBlocks();
29409        reader = gen_xmlTextReaderPtr(n_reader, 0);
29410
29411        ret_val = xmlTextReaderConstPrefix(reader);
29412        desret_const_xmlChar_ptr(ret_val);
29413        call_tests++;
29414        des_xmlTextReaderPtr(n_reader, reader, 0);
29415        xmlResetLastError();
29416        if (mem_base != xmlMemBlocks()) {
29417            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
29418	           xmlMemBlocks() - mem_base);
29419	    test_ret++;
29420            printf(" %d", n_reader);
29421            printf("\n");
29422        }
29423    }
29424    function_tests++;
29425#endif
29426
29427    return(test_ret);
29428}
29429
29430
29431static int
29432test_xmlTextReaderConstString(void) {
29433    int test_ret = 0;
29434
29435#if defined(LIBXML_READER_ENABLED)
29436    int mem_base;
29437    const xmlChar * ret_val;
29438    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29439    int n_reader;
29440    xmlChar * str; /* the string to intern. */
29441    int n_str;
29442
29443    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29444    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
29445        mem_base = xmlMemBlocks();
29446        reader = gen_xmlTextReaderPtr(n_reader, 0);
29447        str = gen_const_xmlChar_ptr(n_str, 1);
29448
29449        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
29450        desret_const_xmlChar_ptr(ret_val);
29451        call_tests++;
29452        des_xmlTextReaderPtr(n_reader, reader, 0);
29453        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
29454        xmlResetLastError();
29455        if (mem_base != xmlMemBlocks()) {
29456            printf("Leak of %d blocks found in xmlTextReaderConstString",
29457	           xmlMemBlocks() - mem_base);
29458	    test_ret++;
29459            printf(" %d", n_reader);
29460            printf(" %d", n_str);
29461            printf("\n");
29462        }
29463    }
29464    }
29465    function_tests++;
29466#endif
29467
29468    return(test_ret);
29469}
29470
29471
29472static int
29473test_xmlTextReaderConstValue(void) {
29474    int test_ret = 0;
29475
29476#if defined(LIBXML_READER_ENABLED)
29477    int mem_base;
29478    const xmlChar * ret_val;
29479    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29480    int n_reader;
29481
29482    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29483        mem_base = xmlMemBlocks();
29484        reader = gen_xmlTextReaderPtr(n_reader, 0);
29485
29486        ret_val = xmlTextReaderConstValue(reader);
29487        desret_const_xmlChar_ptr(ret_val);
29488        call_tests++;
29489        des_xmlTextReaderPtr(n_reader, reader, 0);
29490        xmlResetLastError();
29491        if (mem_base != xmlMemBlocks()) {
29492            printf("Leak of %d blocks found in xmlTextReaderConstValue",
29493	           xmlMemBlocks() - mem_base);
29494	    test_ret++;
29495            printf(" %d", n_reader);
29496            printf("\n");
29497        }
29498    }
29499    function_tests++;
29500#endif
29501
29502    return(test_ret);
29503}
29504
29505
29506static int
29507test_xmlTextReaderConstXmlLang(void) {
29508    int test_ret = 0;
29509
29510#if defined(LIBXML_READER_ENABLED)
29511    int mem_base;
29512    const xmlChar * ret_val;
29513    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29514    int n_reader;
29515
29516    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29517        mem_base = xmlMemBlocks();
29518        reader = gen_xmlTextReaderPtr(n_reader, 0);
29519
29520        ret_val = xmlTextReaderConstXmlLang(reader);
29521        desret_const_xmlChar_ptr(ret_val);
29522        call_tests++;
29523        des_xmlTextReaderPtr(n_reader, reader, 0);
29524        xmlResetLastError();
29525        if (mem_base != xmlMemBlocks()) {
29526            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
29527	           xmlMemBlocks() - mem_base);
29528	    test_ret++;
29529            printf(" %d", n_reader);
29530            printf("\n");
29531        }
29532    }
29533    function_tests++;
29534#endif
29535
29536    return(test_ret);
29537}
29538
29539
29540static int
29541test_xmlTextReaderConstXmlVersion(void) {
29542    int test_ret = 0;
29543
29544#if defined(LIBXML_READER_ENABLED)
29545    int mem_base;
29546    const xmlChar * ret_val;
29547    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29548    int n_reader;
29549
29550    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29551        mem_base = xmlMemBlocks();
29552        reader = gen_xmlTextReaderPtr(n_reader, 0);
29553
29554        ret_val = xmlTextReaderConstXmlVersion(reader);
29555        desret_const_xmlChar_ptr(ret_val);
29556        call_tests++;
29557        des_xmlTextReaderPtr(n_reader, reader, 0);
29558        xmlResetLastError();
29559        if (mem_base != xmlMemBlocks()) {
29560            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
29561	           xmlMemBlocks() - mem_base);
29562	    test_ret++;
29563            printf(" %d", n_reader);
29564            printf("\n");
29565        }
29566    }
29567    function_tests++;
29568#endif
29569
29570    return(test_ret);
29571}
29572
29573
29574static int
29575test_xmlTextReaderCurrentDoc(void) {
29576    int test_ret = 0;
29577
29578#if defined(LIBXML_READER_ENABLED)
29579    int mem_base;
29580    xmlDocPtr ret_val;
29581    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29582    int n_reader;
29583
29584    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29585        mem_base = xmlMemBlocks();
29586        reader = gen_xmlTextReaderPtr(n_reader, 0);
29587
29588        ret_val = xmlTextReaderCurrentDoc(reader);
29589        desret_xmlDocPtr(ret_val);
29590        call_tests++;
29591        des_xmlTextReaderPtr(n_reader, reader, 0);
29592        xmlResetLastError();
29593        if (mem_base != xmlMemBlocks()) {
29594            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
29595	           xmlMemBlocks() - mem_base);
29596	    test_ret++;
29597            printf(" %d", n_reader);
29598            printf("\n");
29599        }
29600    }
29601    function_tests++;
29602#endif
29603
29604    return(test_ret);
29605}
29606
29607
29608static int
29609test_xmlTextReaderCurrentNode(void) {
29610    int test_ret = 0;
29611
29612#if defined(LIBXML_READER_ENABLED)
29613    int mem_base;
29614    xmlNodePtr ret_val;
29615    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29616    int n_reader;
29617
29618    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29619        mem_base = xmlMemBlocks();
29620        reader = gen_xmlTextReaderPtr(n_reader, 0);
29621
29622        ret_val = xmlTextReaderCurrentNode(reader);
29623        desret_xmlNodePtr(ret_val);
29624        call_tests++;
29625        des_xmlTextReaderPtr(n_reader, reader, 0);
29626        xmlResetLastError();
29627        if (mem_base != xmlMemBlocks()) {
29628            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
29629	           xmlMemBlocks() - mem_base);
29630	    test_ret++;
29631            printf(" %d", n_reader);
29632            printf("\n");
29633        }
29634    }
29635    function_tests++;
29636#endif
29637
29638    return(test_ret);
29639}
29640
29641
29642static int
29643test_xmlTextReaderDepth(void) {
29644    int test_ret = 0;
29645
29646#if defined(LIBXML_READER_ENABLED)
29647    int mem_base;
29648    int ret_val;
29649    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29650    int n_reader;
29651
29652    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29653        mem_base = xmlMemBlocks();
29654        reader = gen_xmlTextReaderPtr(n_reader, 0);
29655
29656        ret_val = xmlTextReaderDepth(reader);
29657        desret_int(ret_val);
29658        call_tests++;
29659        des_xmlTextReaderPtr(n_reader, reader, 0);
29660        xmlResetLastError();
29661        if (mem_base != xmlMemBlocks()) {
29662            printf("Leak of %d blocks found in xmlTextReaderDepth",
29663	           xmlMemBlocks() - mem_base);
29664	    test_ret++;
29665            printf(" %d", n_reader);
29666            printf("\n");
29667        }
29668    }
29669    function_tests++;
29670#endif
29671
29672    return(test_ret);
29673}
29674
29675
29676static int
29677test_xmlTextReaderExpand(void) {
29678    int test_ret = 0;
29679
29680#if defined(LIBXML_READER_ENABLED)
29681    int mem_base;
29682    xmlNodePtr ret_val;
29683    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29684    int n_reader;
29685
29686    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29687        mem_base = xmlMemBlocks();
29688        reader = gen_xmlTextReaderPtr(n_reader, 0);
29689
29690        ret_val = xmlTextReaderExpand(reader);
29691        desret_xmlNodePtr(ret_val);
29692        call_tests++;
29693        des_xmlTextReaderPtr(n_reader, reader, 0);
29694        xmlResetLastError();
29695        if (mem_base != xmlMemBlocks()) {
29696            printf("Leak of %d blocks found in xmlTextReaderExpand",
29697	           xmlMemBlocks() - mem_base);
29698	    test_ret++;
29699            printf(" %d", n_reader);
29700            printf("\n");
29701        }
29702    }
29703    function_tests++;
29704#endif
29705
29706    return(test_ret);
29707}
29708
29709
29710static int
29711test_xmlTextReaderGetAttribute(void) {
29712    int test_ret = 0;
29713
29714#if defined(LIBXML_READER_ENABLED)
29715    int mem_base;
29716    xmlChar * ret_val;
29717    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29718    int n_reader;
29719    xmlChar * name; /* the qualified name of the attribute. */
29720    int n_name;
29721
29722    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29723    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
29724        mem_base = xmlMemBlocks();
29725        reader = gen_xmlTextReaderPtr(n_reader, 0);
29726        name = gen_const_xmlChar_ptr(n_name, 1);
29727
29728        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
29729        desret_xmlChar_ptr(ret_val);
29730        call_tests++;
29731        des_xmlTextReaderPtr(n_reader, reader, 0);
29732        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
29733        xmlResetLastError();
29734        if (mem_base != xmlMemBlocks()) {
29735            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
29736	           xmlMemBlocks() - mem_base);
29737	    test_ret++;
29738            printf(" %d", n_reader);
29739            printf(" %d", n_name);
29740            printf("\n");
29741        }
29742    }
29743    }
29744    function_tests++;
29745#endif
29746
29747    return(test_ret);
29748}
29749
29750
29751static int
29752test_xmlTextReaderGetAttributeNo(void) {
29753    int test_ret = 0;
29754
29755#if defined(LIBXML_READER_ENABLED)
29756    int mem_base;
29757    xmlChar * ret_val;
29758    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29759    int n_reader;
29760    int no; /* the zero-based index of the attribute relative to the containing element */
29761    int n_no;
29762
29763    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29764    for (n_no = 0;n_no < gen_nb_int;n_no++) {
29765        mem_base = xmlMemBlocks();
29766        reader = gen_xmlTextReaderPtr(n_reader, 0);
29767        no = gen_int(n_no, 1);
29768
29769        ret_val = xmlTextReaderGetAttributeNo(reader, no);
29770        desret_xmlChar_ptr(ret_val);
29771        call_tests++;
29772        des_xmlTextReaderPtr(n_reader, reader, 0);
29773        des_int(n_no, no, 1);
29774        xmlResetLastError();
29775        if (mem_base != xmlMemBlocks()) {
29776            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
29777	           xmlMemBlocks() - mem_base);
29778	    test_ret++;
29779            printf(" %d", n_reader);
29780            printf(" %d", n_no);
29781            printf("\n");
29782        }
29783    }
29784    }
29785    function_tests++;
29786#endif
29787
29788    return(test_ret);
29789}
29790
29791
29792static int
29793test_xmlTextReaderGetAttributeNs(void) {
29794    int test_ret = 0;
29795
29796#if defined(LIBXML_READER_ENABLED)
29797    int mem_base;
29798    xmlChar * ret_val;
29799    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29800    int n_reader;
29801    xmlChar * localName; /* the local name of the attribute. */
29802    int n_localName;
29803    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
29804    int n_namespaceURI;
29805
29806    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29807    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
29808    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
29809        mem_base = xmlMemBlocks();
29810        reader = gen_xmlTextReaderPtr(n_reader, 0);
29811        localName = gen_const_xmlChar_ptr(n_localName, 1);
29812        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
29813
29814        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
29815        desret_xmlChar_ptr(ret_val);
29816        call_tests++;
29817        des_xmlTextReaderPtr(n_reader, reader, 0);
29818        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
29819        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
29820        xmlResetLastError();
29821        if (mem_base != xmlMemBlocks()) {
29822            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
29823	           xmlMemBlocks() - mem_base);
29824	    test_ret++;
29825            printf(" %d", n_reader);
29826            printf(" %d", n_localName);
29827            printf(" %d", n_namespaceURI);
29828            printf("\n");
29829        }
29830    }
29831    }
29832    }
29833    function_tests++;
29834#endif
29835
29836    return(test_ret);
29837}
29838
29839#ifdef LIBXML_READER_ENABLED
29840
29841#define gen_nb_xmlTextReaderErrorFunc_ptr 1
29842static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29843    return(NULL);
29844}
29845static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29846}
29847#endif
29848
29849
29850static int
29851test_xmlTextReaderGetErrorHandler(void) {
29852    int test_ret = 0;
29853
29854#if defined(LIBXML_READER_ENABLED)
29855    int mem_base;
29856    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29857    int n_reader;
29858    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
29859    int n_f;
29860    void ** arg; /* a user argument */
29861    int n_arg;
29862
29863    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29864    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
29865    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
29866        mem_base = xmlMemBlocks();
29867        reader = gen_xmlTextReaderPtr(n_reader, 0);
29868        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
29869        arg = gen_void_ptr_ptr(n_arg, 2);
29870
29871        xmlTextReaderGetErrorHandler(reader, f, arg);
29872        call_tests++;
29873        des_xmlTextReaderPtr(n_reader, reader, 0);
29874        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
29875        des_void_ptr_ptr(n_arg, arg, 2);
29876        xmlResetLastError();
29877        if (mem_base != xmlMemBlocks()) {
29878            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
29879	           xmlMemBlocks() - mem_base);
29880	    test_ret++;
29881            printf(" %d", n_reader);
29882            printf(" %d", n_f);
29883            printf(" %d", n_arg);
29884            printf("\n");
29885        }
29886    }
29887    }
29888    }
29889    function_tests++;
29890#endif
29891
29892    return(test_ret);
29893}
29894
29895
29896static int
29897test_xmlTextReaderGetParserColumnNumber(void) {
29898    int test_ret = 0;
29899
29900#if defined(LIBXML_READER_ENABLED)
29901    int mem_base;
29902    int ret_val;
29903    xmlTextReaderPtr reader; /* the user data (XML reader context) */
29904    int n_reader;
29905
29906    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29907        mem_base = xmlMemBlocks();
29908        reader = gen_xmlTextReaderPtr(n_reader, 0);
29909
29910        ret_val = xmlTextReaderGetParserColumnNumber(reader);
29911        desret_int(ret_val);
29912        call_tests++;
29913        des_xmlTextReaderPtr(n_reader, reader, 0);
29914        xmlResetLastError();
29915        if (mem_base != xmlMemBlocks()) {
29916            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
29917	           xmlMemBlocks() - mem_base);
29918	    test_ret++;
29919            printf(" %d", n_reader);
29920            printf("\n");
29921        }
29922    }
29923    function_tests++;
29924#endif
29925
29926    return(test_ret);
29927}
29928
29929
29930static int
29931test_xmlTextReaderGetParserLineNumber(void) {
29932    int test_ret = 0;
29933
29934#if defined(LIBXML_READER_ENABLED)
29935    int mem_base;
29936    int ret_val;
29937    xmlTextReaderPtr reader; /* the user data (XML reader context) */
29938    int n_reader;
29939
29940    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29941        mem_base = xmlMemBlocks();
29942        reader = gen_xmlTextReaderPtr(n_reader, 0);
29943
29944        ret_val = xmlTextReaderGetParserLineNumber(reader);
29945        desret_int(ret_val);
29946        call_tests++;
29947        des_xmlTextReaderPtr(n_reader, reader, 0);
29948        xmlResetLastError();
29949        if (mem_base != xmlMemBlocks()) {
29950            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
29951	           xmlMemBlocks() - mem_base);
29952	    test_ret++;
29953            printf(" %d", n_reader);
29954            printf("\n");
29955        }
29956    }
29957    function_tests++;
29958#endif
29959
29960    return(test_ret);
29961}
29962
29963
29964static int
29965test_xmlTextReaderGetParserProp(void) {
29966    int test_ret = 0;
29967
29968#if defined(LIBXML_READER_ENABLED)
29969    int mem_base;
29970    int ret_val;
29971    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29972    int n_reader;
29973    int prop; /* the xmlParserProperties to get */
29974    int n_prop;
29975
29976    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29977    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
29978        mem_base = xmlMemBlocks();
29979        reader = gen_xmlTextReaderPtr(n_reader, 0);
29980        prop = gen_int(n_prop, 1);
29981
29982        ret_val = xmlTextReaderGetParserProp(reader, prop);
29983        desret_int(ret_val);
29984        call_tests++;
29985        des_xmlTextReaderPtr(n_reader, reader, 0);
29986        des_int(n_prop, prop, 1);
29987        xmlResetLastError();
29988        if (mem_base != xmlMemBlocks()) {
29989            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
29990	           xmlMemBlocks() - mem_base);
29991	    test_ret++;
29992            printf(" %d", n_reader);
29993            printf(" %d", n_prop);
29994            printf("\n");
29995        }
29996    }
29997    }
29998    function_tests++;
29999#endif
30000
30001    return(test_ret);
30002}
30003
30004
30005static int
30006test_xmlTextReaderGetRemainder(void) {
30007    int test_ret = 0;
30008
30009#if defined(LIBXML_READER_ENABLED)
30010    int mem_base;
30011    xmlParserInputBufferPtr ret_val;
30012    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30013    int n_reader;
30014
30015    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30016        mem_base = xmlMemBlocks();
30017        reader = gen_xmlTextReaderPtr(n_reader, 0);
30018
30019        ret_val = xmlTextReaderGetRemainder(reader);
30020        desret_xmlParserInputBufferPtr(ret_val);
30021        call_tests++;
30022        des_xmlTextReaderPtr(n_reader, reader, 0);
30023        xmlResetLastError();
30024        if (mem_base != xmlMemBlocks()) {
30025            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30026	           xmlMemBlocks() - mem_base);
30027	    test_ret++;
30028            printf(" %d", n_reader);
30029            printf("\n");
30030        }
30031    }
30032    function_tests++;
30033#endif
30034
30035    return(test_ret);
30036}
30037
30038
30039static int
30040test_xmlTextReaderHasAttributes(void) {
30041    int test_ret = 0;
30042
30043#if defined(LIBXML_READER_ENABLED)
30044    int mem_base;
30045    int ret_val;
30046    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30047    int n_reader;
30048
30049    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30050        mem_base = xmlMemBlocks();
30051        reader = gen_xmlTextReaderPtr(n_reader, 0);
30052
30053        ret_val = xmlTextReaderHasAttributes(reader);
30054        desret_int(ret_val);
30055        call_tests++;
30056        des_xmlTextReaderPtr(n_reader, reader, 0);
30057        xmlResetLastError();
30058        if (mem_base != xmlMemBlocks()) {
30059            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
30060	           xmlMemBlocks() - mem_base);
30061	    test_ret++;
30062            printf(" %d", n_reader);
30063            printf("\n");
30064        }
30065    }
30066    function_tests++;
30067#endif
30068
30069    return(test_ret);
30070}
30071
30072
30073static int
30074test_xmlTextReaderHasValue(void) {
30075    int test_ret = 0;
30076
30077#if defined(LIBXML_READER_ENABLED)
30078    int mem_base;
30079    int ret_val;
30080    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30081    int n_reader;
30082
30083    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30084        mem_base = xmlMemBlocks();
30085        reader = gen_xmlTextReaderPtr(n_reader, 0);
30086
30087        ret_val = xmlTextReaderHasValue(reader);
30088        desret_int(ret_val);
30089        call_tests++;
30090        des_xmlTextReaderPtr(n_reader, reader, 0);
30091        xmlResetLastError();
30092        if (mem_base != xmlMemBlocks()) {
30093            printf("Leak of %d blocks found in xmlTextReaderHasValue",
30094	           xmlMemBlocks() - mem_base);
30095	    test_ret++;
30096            printf(" %d", n_reader);
30097            printf("\n");
30098        }
30099    }
30100    function_tests++;
30101#endif
30102
30103    return(test_ret);
30104}
30105
30106
30107static int
30108test_xmlTextReaderIsDefault(void) {
30109    int test_ret = 0;
30110
30111#if defined(LIBXML_READER_ENABLED)
30112    int mem_base;
30113    int ret_val;
30114    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30115    int n_reader;
30116
30117    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30118        mem_base = xmlMemBlocks();
30119        reader = gen_xmlTextReaderPtr(n_reader, 0);
30120
30121        ret_val = xmlTextReaderIsDefault(reader);
30122        desret_int(ret_val);
30123        call_tests++;
30124        des_xmlTextReaderPtr(n_reader, reader, 0);
30125        xmlResetLastError();
30126        if (mem_base != xmlMemBlocks()) {
30127            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
30128	           xmlMemBlocks() - mem_base);
30129	    test_ret++;
30130            printf(" %d", n_reader);
30131            printf("\n");
30132        }
30133    }
30134    function_tests++;
30135#endif
30136
30137    return(test_ret);
30138}
30139
30140
30141static int
30142test_xmlTextReaderIsEmptyElement(void) {
30143    int test_ret = 0;
30144
30145#if defined(LIBXML_READER_ENABLED)
30146    int mem_base;
30147    int ret_val;
30148    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30149    int n_reader;
30150
30151    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30152        mem_base = xmlMemBlocks();
30153        reader = gen_xmlTextReaderPtr(n_reader, 0);
30154
30155        ret_val = xmlTextReaderIsEmptyElement(reader);
30156        desret_int(ret_val);
30157        call_tests++;
30158        des_xmlTextReaderPtr(n_reader, reader, 0);
30159        xmlResetLastError();
30160        if (mem_base != xmlMemBlocks()) {
30161            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
30162	           xmlMemBlocks() - mem_base);
30163	    test_ret++;
30164            printf(" %d", n_reader);
30165            printf("\n");
30166        }
30167    }
30168    function_tests++;
30169#endif
30170
30171    return(test_ret);
30172}
30173
30174
30175static int
30176test_xmlTextReaderIsNamespaceDecl(void) {
30177    int test_ret = 0;
30178
30179#if defined(LIBXML_READER_ENABLED)
30180    int mem_base;
30181    int ret_val;
30182    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30183    int n_reader;
30184
30185    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30186        mem_base = xmlMemBlocks();
30187        reader = gen_xmlTextReaderPtr(n_reader, 0);
30188
30189        ret_val = xmlTextReaderIsNamespaceDecl(reader);
30190        desret_int(ret_val);
30191        call_tests++;
30192        des_xmlTextReaderPtr(n_reader, reader, 0);
30193        xmlResetLastError();
30194        if (mem_base != xmlMemBlocks()) {
30195            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
30196	           xmlMemBlocks() - mem_base);
30197	    test_ret++;
30198            printf(" %d", n_reader);
30199            printf("\n");
30200        }
30201    }
30202    function_tests++;
30203#endif
30204
30205    return(test_ret);
30206}
30207
30208
30209static int
30210test_xmlTextReaderIsValid(void) {
30211    int test_ret = 0;
30212
30213#if defined(LIBXML_READER_ENABLED)
30214    int mem_base;
30215    int ret_val;
30216    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30217    int n_reader;
30218
30219    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30220        mem_base = xmlMemBlocks();
30221        reader = gen_xmlTextReaderPtr(n_reader, 0);
30222
30223        ret_val = xmlTextReaderIsValid(reader);
30224        desret_int(ret_val);
30225        call_tests++;
30226        des_xmlTextReaderPtr(n_reader, reader, 0);
30227        xmlResetLastError();
30228        if (mem_base != xmlMemBlocks()) {
30229            printf("Leak of %d blocks found in xmlTextReaderIsValid",
30230	           xmlMemBlocks() - mem_base);
30231	    test_ret++;
30232            printf(" %d", n_reader);
30233            printf("\n");
30234        }
30235    }
30236    function_tests++;
30237#endif
30238
30239    return(test_ret);
30240}
30241
30242
30243static int
30244test_xmlTextReaderLocalName(void) {
30245    int test_ret = 0;
30246
30247#if defined(LIBXML_READER_ENABLED)
30248    int mem_base;
30249    xmlChar * ret_val;
30250    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30251    int n_reader;
30252
30253    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30254        mem_base = xmlMemBlocks();
30255        reader = gen_xmlTextReaderPtr(n_reader, 0);
30256
30257        ret_val = xmlTextReaderLocalName(reader);
30258        desret_xmlChar_ptr(ret_val);
30259        call_tests++;
30260        des_xmlTextReaderPtr(n_reader, reader, 0);
30261        xmlResetLastError();
30262        if (mem_base != xmlMemBlocks()) {
30263            printf("Leak of %d blocks found in xmlTextReaderLocalName",
30264	           xmlMemBlocks() - mem_base);
30265	    test_ret++;
30266            printf(" %d", n_reader);
30267            printf("\n");
30268        }
30269    }
30270    function_tests++;
30271#endif
30272
30273    return(test_ret);
30274}
30275
30276#ifdef LIBXML_READER_ENABLED
30277
30278#define gen_nb_xmlTextReaderLocatorPtr 1
30279static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30280    return(NULL);
30281}
30282static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30283}
30284#endif
30285
30286
30287static int
30288test_xmlTextReaderLocatorBaseURI(void) {
30289    int test_ret = 0;
30290
30291#if defined(LIBXML_READER_ENABLED)
30292    int mem_base;
30293    xmlChar * ret_val;
30294    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30295    int n_locator;
30296
30297    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30298        mem_base = xmlMemBlocks();
30299        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30300
30301        ret_val = xmlTextReaderLocatorBaseURI(locator);
30302        desret_xmlChar_ptr(ret_val);
30303        call_tests++;
30304        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30305        xmlResetLastError();
30306        if (mem_base != xmlMemBlocks()) {
30307            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
30308	           xmlMemBlocks() - mem_base);
30309	    test_ret++;
30310            printf(" %d", n_locator);
30311            printf("\n");
30312        }
30313    }
30314    function_tests++;
30315#endif
30316
30317    return(test_ret);
30318}
30319
30320
30321static int
30322test_xmlTextReaderLocatorLineNumber(void) {
30323    int test_ret = 0;
30324
30325#if defined(LIBXML_READER_ENABLED)
30326    int mem_base;
30327    int ret_val;
30328    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30329    int n_locator;
30330
30331    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30332        mem_base = xmlMemBlocks();
30333        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30334
30335        ret_val = xmlTextReaderLocatorLineNumber(locator);
30336        desret_int(ret_val);
30337        call_tests++;
30338        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30339        xmlResetLastError();
30340        if (mem_base != xmlMemBlocks()) {
30341            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
30342	           xmlMemBlocks() - mem_base);
30343	    test_ret++;
30344            printf(" %d", n_locator);
30345            printf("\n");
30346        }
30347    }
30348    function_tests++;
30349#endif
30350
30351    return(test_ret);
30352}
30353
30354
30355static int
30356test_xmlTextReaderLookupNamespace(void) {
30357    int test_ret = 0;
30358
30359#if defined(LIBXML_READER_ENABLED)
30360    int mem_base;
30361    xmlChar * ret_val;
30362    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30363    int n_reader;
30364    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
30365    int n_prefix;
30366
30367    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30368    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
30369        mem_base = xmlMemBlocks();
30370        reader = gen_xmlTextReaderPtr(n_reader, 0);
30371        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
30372
30373        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
30374        desret_xmlChar_ptr(ret_val);
30375        call_tests++;
30376        des_xmlTextReaderPtr(n_reader, reader, 0);
30377        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
30378        xmlResetLastError();
30379        if (mem_base != xmlMemBlocks()) {
30380            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
30381	           xmlMemBlocks() - mem_base);
30382	    test_ret++;
30383            printf(" %d", n_reader);
30384            printf(" %d", n_prefix);
30385            printf("\n");
30386        }
30387    }
30388    }
30389    function_tests++;
30390#endif
30391
30392    return(test_ret);
30393}
30394
30395
30396static int
30397test_xmlTextReaderMoveToAttribute(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 xmlTextReaderPtr used */
30404    int n_reader;
30405    xmlChar * name; /* the qualified name of the attribute. */
30406    int n_name;
30407
30408    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30409    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30410        mem_base = xmlMemBlocks();
30411        reader = gen_xmlTextReaderPtr(n_reader, 0);
30412        name = gen_const_xmlChar_ptr(n_name, 1);
30413
30414        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
30415        desret_int(ret_val);
30416        call_tests++;
30417        des_xmlTextReaderPtr(n_reader, reader, 0);
30418        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30419        xmlResetLastError();
30420        if (mem_base != xmlMemBlocks()) {
30421            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
30422	           xmlMemBlocks() - mem_base);
30423	    test_ret++;
30424            printf(" %d", n_reader);
30425            printf(" %d", n_name);
30426            printf("\n");
30427        }
30428    }
30429    }
30430    function_tests++;
30431#endif
30432
30433    return(test_ret);
30434}
30435
30436
30437static int
30438test_xmlTextReaderMoveToAttributeNo(void) {
30439    int test_ret = 0;
30440
30441#if defined(LIBXML_READER_ENABLED)
30442    int mem_base;
30443    int ret_val;
30444    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30445    int n_reader;
30446    int no; /* the zero-based index of the attribute relative to the containing element. */
30447    int n_no;
30448
30449    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30450    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30451        mem_base = xmlMemBlocks();
30452        reader = gen_xmlTextReaderPtr(n_reader, 0);
30453        no = gen_int(n_no, 1);
30454
30455        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
30456        desret_int(ret_val);
30457        call_tests++;
30458        des_xmlTextReaderPtr(n_reader, reader, 0);
30459        des_int(n_no, no, 1);
30460        xmlResetLastError();
30461        if (mem_base != xmlMemBlocks()) {
30462            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
30463	           xmlMemBlocks() - mem_base);
30464	    test_ret++;
30465            printf(" %d", n_reader);
30466            printf(" %d", n_no);
30467            printf("\n");
30468        }
30469    }
30470    }
30471    function_tests++;
30472#endif
30473
30474    return(test_ret);
30475}
30476
30477
30478static int
30479test_xmlTextReaderMoveToAttributeNs(void) {
30480    int test_ret = 0;
30481
30482#if defined(LIBXML_READER_ENABLED)
30483    int mem_base;
30484    int ret_val;
30485    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30486    int n_reader;
30487    xmlChar * localName; /* the local name of the attribute. */
30488    int n_localName;
30489    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30490    int n_namespaceURI;
30491
30492    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30493    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30494    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30495        mem_base = xmlMemBlocks();
30496        reader = gen_xmlTextReaderPtr(n_reader, 0);
30497        localName = gen_const_xmlChar_ptr(n_localName, 1);
30498        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30499
30500        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30501        desret_int(ret_val);
30502        call_tests++;
30503        des_xmlTextReaderPtr(n_reader, reader, 0);
30504        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30505        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30506        xmlResetLastError();
30507        if (mem_base != xmlMemBlocks()) {
30508            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
30509	           xmlMemBlocks() - mem_base);
30510	    test_ret++;
30511            printf(" %d", n_reader);
30512            printf(" %d", n_localName);
30513            printf(" %d", n_namespaceURI);
30514            printf("\n");
30515        }
30516    }
30517    }
30518    }
30519    function_tests++;
30520#endif
30521
30522    return(test_ret);
30523}
30524
30525
30526static int
30527test_xmlTextReaderMoveToElement(void) {
30528    int test_ret = 0;
30529
30530#if defined(LIBXML_READER_ENABLED)
30531    int mem_base;
30532    int ret_val;
30533    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30534    int n_reader;
30535
30536    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30537        mem_base = xmlMemBlocks();
30538        reader = gen_xmlTextReaderPtr(n_reader, 0);
30539
30540        ret_val = xmlTextReaderMoveToElement(reader);
30541        desret_int(ret_val);
30542        call_tests++;
30543        des_xmlTextReaderPtr(n_reader, reader, 0);
30544        xmlResetLastError();
30545        if (mem_base != xmlMemBlocks()) {
30546            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
30547	           xmlMemBlocks() - mem_base);
30548	    test_ret++;
30549            printf(" %d", n_reader);
30550            printf("\n");
30551        }
30552    }
30553    function_tests++;
30554#endif
30555
30556    return(test_ret);
30557}
30558
30559
30560static int
30561test_xmlTextReaderMoveToFirstAttribute(void) {
30562    int test_ret = 0;
30563
30564#if defined(LIBXML_READER_ENABLED)
30565    int mem_base;
30566    int ret_val;
30567    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30568    int n_reader;
30569
30570    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30571        mem_base = xmlMemBlocks();
30572        reader = gen_xmlTextReaderPtr(n_reader, 0);
30573
30574        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
30575        desret_int(ret_val);
30576        call_tests++;
30577        des_xmlTextReaderPtr(n_reader, reader, 0);
30578        xmlResetLastError();
30579        if (mem_base != xmlMemBlocks()) {
30580            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
30581	           xmlMemBlocks() - mem_base);
30582	    test_ret++;
30583            printf(" %d", n_reader);
30584            printf("\n");
30585        }
30586    }
30587    function_tests++;
30588#endif
30589
30590    return(test_ret);
30591}
30592
30593
30594static int
30595test_xmlTextReaderMoveToNextAttribute(void) {
30596    int test_ret = 0;
30597
30598#if defined(LIBXML_READER_ENABLED)
30599    int mem_base;
30600    int ret_val;
30601    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30602    int n_reader;
30603
30604    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30605        mem_base = xmlMemBlocks();
30606        reader = gen_xmlTextReaderPtr(n_reader, 0);
30607
30608        ret_val = xmlTextReaderMoveToNextAttribute(reader);
30609        desret_int(ret_val);
30610        call_tests++;
30611        des_xmlTextReaderPtr(n_reader, reader, 0);
30612        xmlResetLastError();
30613        if (mem_base != xmlMemBlocks()) {
30614            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
30615	           xmlMemBlocks() - mem_base);
30616	    test_ret++;
30617            printf(" %d", n_reader);
30618            printf("\n");
30619        }
30620    }
30621    function_tests++;
30622#endif
30623
30624    return(test_ret);
30625}
30626
30627
30628static int
30629test_xmlTextReaderName(void) {
30630    int test_ret = 0;
30631
30632#if defined(LIBXML_READER_ENABLED)
30633    int mem_base;
30634    xmlChar * ret_val;
30635    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30636    int n_reader;
30637
30638    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30639        mem_base = xmlMemBlocks();
30640        reader = gen_xmlTextReaderPtr(n_reader, 0);
30641
30642        ret_val = xmlTextReaderName(reader);
30643        desret_xmlChar_ptr(ret_val);
30644        call_tests++;
30645        des_xmlTextReaderPtr(n_reader, reader, 0);
30646        xmlResetLastError();
30647        if (mem_base != xmlMemBlocks()) {
30648            printf("Leak of %d blocks found in xmlTextReaderName",
30649	           xmlMemBlocks() - mem_base);
30650	    test_ret++;
30651            printf(" %d", n_reader);
30652            printf("\n");
30653        }
30654    }
30655    function_tests++;
30656#endif
30657
30658    return(test_ret);
30659}
30660
30661
30662static int
30663test_xmlTextReaderNamespaceUri(void) {
30664    int test_ret = 0;
30665
30666#if defined(LIBXML_READER_ENABLED)
30667    int mem_base;
30668    xmlChar * ret_val;
30669    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30670    int n_reader;
30671
30672    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30673        mem_base = xmlMemBlocks();
30674        reader = gen_xmlTextReaderPtr(n_reader, 0);
30675
30676        ret_val = xmlTextReaderNamespaceUri(reader);
30677        desret_xmlChar_ptr(ret_val);
30678        call_tests++;
30679        des_xmlTextReaderPtr(n_reader, reader, 0);
30680        xmlResetLastError();
30681        if (mem_base != xmlMemBlocks()) {
30682            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
30683	           xmlMemBlocks() - mem_base);
30684	    test_ret++;
30685            printf(" %d", n_reader);
30686            printf("\n");
30687        }
30688    }
30689    function_tests++;
30690#endif
30691
30692    return(test_ret);
30693}
30694
30695
30696static int
30697test_xmlTextReaderNext(void) {
30698    int test_ret = 0;
30699
30700#if defined(LIBXML_READER_ENABLED)
30701    int mem_base;
30702    int ret_val;
30703    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30704    int n_reader;
30705
30706    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30707        mem_base = xmlMemBlocks();
30708        reader = gen_xmlTextReaderPtr(n_reader, 0);
30709
30710        ret_val = xmlTextReaderNext(reader);
30711        desret_int(ret_val);
30712        call_tests++;
30713        des_xmlTextReaderPtr(n_reader, reader, 0);
30714        xmlResetLastError();
30715        if (mem_base != xmlMemBlocks()) {
30716            printf("Leak of %d blocks found in xmlTextReaderNext",
30717	           xmlMemBlocks() - mem_base);
30718	    test_ret++;
30719            printf(" %d", n_reader);
30720            printf("\n");
30721        }
30722    }
30723    function_tests++;
30724#endif
30725
30726    return(test_ret);
30727}
30728
30729
30730static int
30731test_xmlTextReaderNextSibling(void) {
30732    int test_ret = 0;
30733
30734#if defined(LIBXML_READER_ENABLED)
30735    int mem_base;
30736    int ret_val;
30737    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30738    int n_reader;
30739
30740    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30741        mem_base = xmlMemBlocks();
30742        reader = gen_xmlTextReaderPtr(n_reader, 0);
30743
30744        ret_val = xmlTextReaderNextSibling(reader);
30745        desret_int(ret_val);
30746        call_tests++;
30747        des_xmlTextReaderPtr(n_reader, reader, 0);
30748        xmlResetLastError();
30749        if (mem_base != xmlMemBlocks()) {
30750            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
30751	           xmlMemBlocks() - mem_base);
30752	    test_ret++;
30753            printf(" %d", n_reader);
30754            printf("\n");
30755        }
30756    }
30757    function_tests++;
30758#endif
30759
30760    return(test_ret);
30761}
30762
30763
30764static int
30765test_xmlTextReaderNodeType(void) {
30766    int test_ret = 0;
30767
30768#if defined(LIBXML_READER_ENABLED)
30769    int mem_base;
30770    int ret_val;
30771    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30772    int n_reader;
30773
30774    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30775        mem_base = xmlMemBlocks();
30776        reader = gen_xmlTextReaderPtr(n_reader, 0);
30777
30778        ret_val = xmlTextReaderNodeType(reader);
30779        desret_int(ret_val);
30780        call_tests++;
30781        des_xmlTextReaderPtr(n_reader, reader, 0);
30782        xmlResetLastError();
30783        if (mem_base != xmlMemBlocks()) {
30784            printf("Leak of %d blocks found in xmlTextReaderNodeType",
30785	           xmlMemBlocks() - mem_base);
30786	    test_ret++;
30787            printf(" %d", n_reader);
30788            printf("\n");
30789        }
30790    }
30791    function_tests++;
30792#endif
30793
30794    return(test_ret);
30795}
30796
30797
30798static int
30799test_xmlTextReaderNormalization(void) {
30800    int test_ret = 0;
30801
30802#if defined(LIBXML_READER_ENABLED)
30803    int mem_base;
30804    int ret_val;
30805    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30806    int n_reader;
30807
30808    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30809        mem_base = xmlMemBlocks();
30810        reader = gen_xmlTextReaderPtr(n_reader, 0);
30811
30812        ret_val = xmlTextReaderNormalization(reader);
30813        desret_int(ret_val);
30814        call_tests++;
30815        des_xmlTextReaderPtr(n_reader, reader, 0);
30816        xmlResetLastError();
30817        if (mem_base != xmlMemBlocks()) {
30818            printf("Leak of %d blocks found in xmlTextReaderNormalization",
30819	           xmlMemBlocks() - mem_base);
30820	    test_ret++;
30821            printf(" %d", n_reader);
30822            printf("\n");
30823        }
30824    }
30825    function_tests++;
30826#endif
30827
30828    return(test_ret);
30829}
30830
30831
30832static int
30833test_xmlTextReaderPrefix(void) {
30834    int test_ret = 0;
30835
30836#if defined(LIBXML_READER_ENABLED)
30837    int mem_base;
30838    xmlChar * ret_val;
30839    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30840    int n_reader;
30841
30842    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30843        mem_base = xmlMemBlocks();
30844        reader = gen_xmlTextReaderPtr(n_reader, 0);
30845
30846        ret_val = xmlTextReaderPrefix(reader);
30847        desret_xmlChar_ptr(ret_val);
30848        call_tests++;
30849        des_xmlTextReaderPtr(n_reader, reader, 0);
30850        xmlResetLastError();
30851        if (mem_base != xmlMemBlocks()) {
30852            printf("Leak of %d blocks found in xmlTextReaderPrefix",
30853	           xmlMemBlocks() - mem_base);
30854	    test_ret++;
30855            printf(" %d", n_reader);
30856            printf("\n");
30857        }
30858    }
30859    function_tests++;
30860#endif
30861
30862    return(test_ret);
30863}
30864
30865
30866static int
30867test_xmlTextReaderPreserve(void) {
30868    int test_ret = 0;
30869
30870#if defined(LIBXML_READER_ENABLED)
30871    int mem_base;
30872    xmlNodePtr ret_val;
30873    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30874    int n_reader;
30875
30876    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30877        mem_base = xmlMemBlocks();
30878        reader = gen_xmlTextReaderPtr(n_reader, 0);
30879
30880        ret_val = xmlTextReaderPreserve(reader);
30881        desret_xmlNodePtr(ret_val);
30882        call_tests++;
30883        des_xmlTextReaderPtr(n_reader, reader, 0);
30884        xmlResetLastError();
30885        if (mem_base != xmlMemBlocks()) {
30886            printf("Leak of %d blocks found in xmlTextReaderPreserve",
30887	           xmlMemBlocks() - mem_base);
30888	    test_ret++;
30889            printf(" %d", n_reader);
30890            printf("\n");
30891        }
30892    }
30893    function_tests++;
30894#endif
30895
30896    return(test_ret);
30897}
30898
30899
30900static int
30901test_xmlTextReaderPreservePattern(void) {
30902    int test_ret = 0;
30903
30904#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
30905#ifdef LIBXML_PATTERN_ENABLED
30906    int mem_base;
30907    int ret_val;
30908    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30909    int n_reader;
30910    xmlChar * pattern; /* an XPath subset pattern */
30911    int n_pattern;
30912    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
30913    int n_namespaces;
30914
30915    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30916    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
30917    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
30918        mem_base = xmlMemBlocks();
30919        reader = gen_xmlTextReaderPtr(n_reader, 0);
30920        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
30921        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
30922
30923        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
30924        desret_int(ret_val);
30925        call_tests++;
30926        des_xmlTextReaderPtr(n_reader, reader, 0);
30927        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
30928        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
30929        xmlResetLastError();
30930        if (mem_base != xmlMemBlocks()) {
30931            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
30932	           xmlMemBlocks() - mem_base);
30933	    test_ret++;
30934            printf(" %d", n_reader);
30935            printf(" %d", n_pattern);
30936            printf(" %d", n_namespaces);
30937            printf("\n");
30938        }
30939    }
30940    }
30941    }
30942    function_tests++;
30943#endif
30944#endif
30945
30946    return(test_ret);
30947}
30948
30949
30950static int
30951test_xmlTextReaderQuoteChar(void) {
30952    int test_ret = 0;
30953
30954#if defined(LIBXML_READER_ENABLED)
30955    int mem_base;
30956    int ret_val;
30957    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30958    int n_reader;
30959
30960    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30961        mem_base = xmlMemBlocks();
30962        reader = gen_xmlTextReaderPtr(n_reader, 0);
30963
30964        ret_val = xmlTextReaderQuoteChar(reader);
30965        desret_int(ret_val);
30966        call_tests++;
30967        des_xmlTextReaderPtr(n_reader, reader, 0);
30968        xmlResetLastError();
30969        if (mem_base != xmlMemBlocks()) {
30970            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
30971	           xmlMemBlocks() - mem_base);
30972	    test_ret++;
30973            printf(" %d", n_reader);
30974            printf("\n");
30975        }
30976    }
30977    function_tests++;
30978#endif
30979
30980    return(test_ret);
30981}
30982
30983
30984static int
30985test_xmlTextReaderRead(void) {
30986    int test_ret = 0;
30987
30988#if defined(LIBXML_READER_ENABLED)
30989    int mem_base;
30990    int ret_val;
30991    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30992    int n_reader;
30993
30994    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30995        mem_base = xmlMemBlocks();
30996        reader = gen_xmlTextReaderPtr(n_reader, 0);
30997
30998        ret_val = xmlTextReaderRead(reader);
30999        desret_int(ret_val);
31000        call_tests++;
31001        des_xmlTextReaderPtr(n_reader, reader, 0);
31002        xmlResetLastError();
31003        if (mem_base != xmlMemBlocks()) {
31004            printf("Leak of %d blocks found in xmlTextReaderRead",
31005	           xmlMemBlocks() - mem_base);
31006	    test_ret++;
31007            printf(" %d", n_reader);
31008            printf("\n");
31009        }
31010    }
31011    function_tests++;
31012#endif
31013
31014    return(test_ret);
31015}
31016
31017
31018static int
31019test_xmlTextReaderReadAttributeValue(void) {
31020    int test_ret = 0;
31021
31022#if defined(LIBXML_READER_ENABLED)
31023    int mem_base;
31024    int ret_val;
31025    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31026    int n_reader;
31027
31028    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31029        mem_base = xmlMemBlocks();
31030        reader = gen_xmlTextReaderPtr(n_reader, 0);
31031
31032        ret_val = xmlTextReaderReadAttributeValue(reader);
31033        desret_int(ret_val);
31034        call_tests++;
31035        des_xmlTextReaderPtr(n_reader, reader, 0);
31036        xmlResetLastError();
31037        if (mem_base != xmlMemBlocks()) {
31038            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31039	           xmlMemBlocks() - mem_base);
31040	    test_ret++;
31041            printf(" %d", n_reader);
31042            printf("\n");
31043        }
31044    }
31045    function_tests++;
31046#endif
31047
31048    return(test_ret);
31049}
31050
31051
31052static int
31053test_xmlTextReaderReadState(void) {
31054    int test_ret = 0;
31055
31056#if defined(LIBXML_READER_ENABLED)
31057    int mem_base;
31058    int ret_val;
31059    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31060    int n_reader;
31061
31062    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31063        mem_base = xmlMemBlocks();
31064        reader = gen_xmlTextReaderPtr(n_reader, 0);
31065
31066        ret_val = xmlTextReaderReadState(reader);
31067        desret_int(ret_val);
31068        call_tests++;
31069        des_xmlTextReaderPtr(n_reader, reader, 0);
31070        xmlResetLastError();
31071        if (mem_base != xmlMemBlocks()) {
31072            printf("Leak of %d blocks found in xmlTextReaderReadState",
31073	           xmlMemBlocks() - mem_base);
31074	    test_ret++;
31075            printf(" %d", n_reader);
31076            printf("\n");
31077        }
31078    }
31079    function_tests++;
31080#endif
31081
31082    return(test_ret);
31083}
31084
31085
31086static int
31087test_xmlTextReaderRelaxNGSetSchema(void) {
31088    int test_ret = 0;
31089
31090#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31091    int mem_base;
31092    int ret_val;
31093    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31094    int n_reader;
31095    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
31096    int n_schema;
31097
31098    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31099    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
31100        mem_base = xmlMemBlocks();
31101        reader = gen_xmlTextReaderPtr(n_reader, 0);
31102        schema = gen_xmlRelaxNGPtr(n_schema, 1);
31103
31104        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
31105        desret_int(ret_val);
31106        call_tests++;
31107        des_xmlTextReaderPtr(n_reader, reader, 0);
31108        des_xmlRelaxNGPtr(n_schema, schema, 1);
31109        xmlResetLastError();
31110        if (mem_base != xmlMemBlocks()) {
31111            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
31112	           xmlMemBlocks() - mem_base);
31113	    test_ret++;
31114            printf(" %d", n_reader);
31115            printf(" %d", n_schema);
31116            printf("\n");
31117        }
31118    }
31119    }
31120    function_tests++;
31121#endif
31122
31123    return(test_ret);
31124}
31125
31126
31127static int
31128test_xmlTextReaderRelaxNGValidate(void) {
31129    int test_ret = 0;
31130
31131#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31132    int mem_base;
31133    int ret_val;
31134    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31135    int n_reader;
31136    char * rng; /* the path to a RelaxNG schema or NULL */
31137    int n_rng;
31138
31139    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31140    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
31141        mem_base = xmlMemBlocks();
31142        reader = gen_xmlTextReaderPtr(n_reader, 0);
31143        rng = gen_const_char_ptr(n_rng, 1);
31144
31145        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
31146        desret_int(ret_val);
31147        call_tests++;
31148        des_xmlTextReaderPtr(n_reader, reader, 0);
31149        des_const_char_ptr(n_rng, (const char *)rng, 1);
31150        xmlResetLastError();
31151        if (mem_base != xmlMemBlocks()) {
31152            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
31153	           xmlMemBlocks() - mem_base);
31154	    test_ret++;
31155            printf(" %d", n_reader);
31156            printf(" %d", n_rng);
31157            printf("\n");
31158        }
31159    }
31160    }
31161    function_tests++;
31162#endif
31163
31164    return(test_ret);
31165}
31166
31167
31168static int
31169test_xmlTextReaderSetErrorHandler(void) {
31170    int test_ret = 0;
31171
31172
31173    /* missing type support */
31174    return(test_ret);
31175}
31176
31177
31178static int
31179test_xmlTextReaderSetParserProp(void) {
31180    int test_ret = 0;
31181
31182#if defined(LIBXML_READER_ENABLED)
31183    int mem_base;
31184    int ret_val;
31185    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31186    int n_reader;
31187    int prop; /* the xmlParserProperties to set */
31188    int n_prop;
31189    int value; /* usually 0 or 1 to (de)activate it */
31190    int n_value;
31191
31192    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31193    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31194    for (n_value = 0;n_value < gen_nb_int;n_value++) {
31195        mem_base = xmlMemBlocks();
31196        reader = gen_xmlTextReaderPtr(n_reader, 0);
31197        prop = gen_int(n_prop, 1);
31198        value = gen_int(n_value, 2);
31199
31200        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
31201        desret_int(ret_val);
31202        call_tests++;
31203        des_xmlTextReaderPtr(n_reader, reader, 0);
31204        des_int(n_prop, prop, 1);
31205        des_int(n_value, value, 2);
31206        xmlResetLastError();
31207        if (mem_base != xmlMemBlocks()) {
31208            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
31209	           xmlMemBlocks() - mem_base);
31210	    test_ret++;
31211            printf(" %d", n_reader);
31212            printf(" %d", n_prop);
31213            printf(" %d", n_value);
31214            printf("\n");
31215        }
31216    }
31217    }
31218    }
31219    function_tests++;
31220#endif
31221
31222    return(test_ret);
31223}
31224
31225
31226static int
31227test_xmlTextReaderSetStructuredErrorHandler(void) {
31228    int test_ret = 0;
31229
31230
31231    /* missing type support */
31232    return(test_ret);
31233}
31234
31235
31236static int
31237test_xmlTextReaderStandalone(void) {
31238    int test_ret = 0;
31239
31240#if defined(LIBXML_READER_ENABLED)
31241    int mem_base;
31242    int ret_val;
31243    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31244    int n_reader;
31245
31246    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31247        mem_base = xmlMemBlocks();
31248        reader = gen_xmlTextReaderPtr(n_reader, 0);
31249
31250        ret_val = xmlTextReaderStandalone(reader);
31251        desret_int(ret_val);
31252        call_tests++;
31253        des_xmlTextReaderPtr(n_reader, reader, 0);
31254        xmlResetLastError();
31255        if (mem_base != xmlMemBlocks()) {
31256            printf("Leak of %d blocks found in xmlTextReaderStandalone",
31257	           xmlMemBlocks() - mem_base);
31258	    test_ret++;
31259            printf(" %d", n_reader);
31260            printf("\n");
31261        }
31262    }
31263    function_tests++;
31264#endif
31265
31266    return(test_ret);
31267}
31268
31269
31270static int
31271test_xmlTextReaderValue(void) {
31272    int test_ret = 0;
31273
31274#if defined(LIBXML_READER_ENABLED)
31275    int mem_base;
31276    xmlChar * ret_val;
31277    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31278    int n_reader;
31279
31280    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31281        mem_base = xmlMemBlocks();
31282        reader = gen_xmlTextReaderPtr(n_reader, 0);
31283
31284        ret_val = xmlTextReaderValue(reader);
31285        desret_xmlChar_ptr(ret_val);
31286        call_tests++;
31287        des_xmlTextReaderPtr(n_reader, reader, 0);
31288        xmlResetLastError();
31289        if (mem_base != xmlMemBlocks()) {
31290            printf("Leak of %d blocks found in xmlTextReaderValue",
31291	           xmlMemBlocks() - mem_base);
31292	    test_ret++;
31293            printf(" %d", n_reader);
31294            printf("\n");
31295        }
31296    }
31297    function_tests++;
31298#endif
31299
31300    return(test_ret);
31301}
31302
31303
31304static int
31305test_xmlTextReaderXmlLang(void) {
31306    int test_ret = 0;
31307
31308#if defined(LIBXML_READER_ENABLED)
31309    int mem_base;
31310    xmlChar * ret_val;
31311    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31312    int n_reader;
31313
31314    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31315        mem_base = xmlMemBlocks();
31316        reader = gen_xmlTextReaderPtr(n_reader, 0);
31317
31318        ret_val = xmlTextReaderXmlLang(reader);
31319        desret_xmlChar_ptr(ret_val);
31320        call_tests++;
31321        des_xmlTextReaderPtr(n_reader, reader, 0);
31322        xmlResetLastError();
31323        if (mem_base != xmlMemBlocks()) {
31324            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
31325	           xmlMemBlocks() - mem_base);
31326	    test_ret++;
31327            printf(" %d", n_reader);
31328            printf("\n");
31329        }
31330    }
31331    function_tests++;
31332#endif
31333
31334    return(test_ret);
31335}
31336
31337static int
31338test_xmlreader(void) {
31339    int test_ret = 0;
31340
31341    if (quiet == 0) printf("Testing xmlreader : 71 of 81 functions ...\n");
31342    test_ret += test_xmlNewTextReader();
31343    test_ret += test_xmlNewTextReaderFilename();
31344    test_ret += test_xmlReaderForDoc();
31345    test_ret += test_xmlReaderForFile();
31346    test_ret += test_xmlReaderForMemory();
31347    test_ret += test_xmlReaderNewDoc();
31348    test_ret += test_xmlReaderNewFile();
31349    test_ret += test_xmlReaderNewMemory();
31350    test_ret += test_xmlReaderNewWalker();
31351    test_ret += test_xmlReaderWalker();
31352    test_ret += test_xmlTextReaderAttributeCount();
31353    test_ret += test_xmlTextReaderBaseUri();
31354    test_ret += test_xmlTextReaderByteConsumed();
31355    test_ret += test_xmlTextReaderClose();
31356    test_ret += test_xmlTextReaderConstBaseUri();
31357    test_ret += test_xmlTextReaderConstEncoding();
31358    test_ret += test_xmlTextReaderConstLocalName();
31359    test_ret += test_xmlTextReaderConstName();
31360    test_ret += test_xmlTextReaderConstNamespaceUri();
31361    test_ret += test_xmlTextReaderConstPrefix();
31362    test_ret += test_xmlTextReaderConstString();
31363    test_ret += test_xmlTextReaderConstValue();
31364    test_ret += test_xmlTextReaderConstXmlLang();
31365    test_ret += test_xmlTextReaderConstXmlVersion();
31366    test_ret += test_xmlTextReaderCurrentDoc();
31367    test_ret += test_xmlTextReaderCurrentNode();
31368    test_ret += test_xmlTextReaderDepth();
31369    test_ret += test_xmlTextReaderExpand();
31370    test_ret += test_xmlTextReaderGetAttribute();
31371    test_ret += test_xmlTextReaderGetAttributeNo();
31372    test_ret += test_xmlTextReaderGetAttributeNs();
31373    test_ret += test_xmlTextReaderGetErrorHandler();
31374    test_ret += test_xmlTextReaderGetParserColumnNumber();
31375    test_ret += test_xmlTextReaderGetParserLineNumber();
31376    test_ret += test_xmlTextReaderGetParserProp();
31377    test_ret += test_xmlTextReaderGetRemainder();
31378    test_ret += test_xmlTextReaderHasAttributes();
31379    test_ret += test_xmlTextReaderHasValue();
31380    test_ret += test_xmlTextReaderIsDefault();
31381    test_ret += test_xmlTextReaderIsEmptyElement();
31382    test_ret += test_xmlTextReaderIsNamespaceDecl();
31383    test_ret += test_xmlTextReaderIsValid();
31384    test_ret += test_xmlTextReaderLocalName();
31385    test_ret += test_xmlTextReaderLocatorBaseURI();
31386    test_ret += test_xmlTextReaderLocatorLineNumber();
31387    test_ret += test_xmlTextReaderLookupNamespace();
31388    test_ret += test_xmlTextReaderMoveToAttribute();
31389    test_ret += test_xmlTextReaderMoveToAttributeNo();
31390    test_ret += test_xmlTextReaderMoveToAttributeNs();
31391    test_ret += test_xmlTextReaderMoveToElement();
31392    test_ret += test_xmlTextReaderMoveToFirstAttribute();
31393    test_ret += test_xmlTextReaderMoveToNextAttribute();
31394    test_ret += test_xmlTextReaderName();
31395    test_ret += test_xmlTextReaderNamespaceUri();
31396    test_ret += test_xmlTextReaderNext();
31397    test_ret += test_xmlTextReaderNextSibling();
31398    test_ret += test_xmlTextReaderNodeType();
31399    test_ret += test_xmlTextReaderNormalization();
31400    test_ret += test_xmlTextReaderPrefix();
31401    test_ret += test_xmlTextReaderPreserve();
31402    test_ret += test_xmlTextReaderPreservePattern();
31403    test_ret += test_xmlTextReaderQuoteChar();
31404    test_ret += test_xmlTextReaderRead();
31405    test_ret += test_xmlTextReaderReadAttributeValue();
31406    test_ret += test_xmlTextReaderReadState();
31407    test_ret += test_xmlTextReaderRelaxNGSetSchema();
31408    test_ret += test_xmlTextReaderRelaxNGValidate();
31409    test_ret += test_xmlTextReaderSetErrorHandler();
31410    test_ret += test_xmlTextReaderSetParserProp();
31411    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
31412    test_ret += test_xmlTextReaderStandalone();
31413    test_ret += test_xmlTextReaderValue();
31414    test_ret += test_xmlTextReaderXmlLang();
31415
31416    if (test_ret != 0)
31417	printf("Module xmlreader: %d errors\n", test_ret);
31418    return(test_ret);
31419}
31420#ifdef LIBXML_REGEXP_ENABLED
31421
31422#define gen_nb_xmlRegExecCtxtPtr 1
31423static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31424    return(NULL);
31425}
31426static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31427}
31428#endif
31429
31430
31431static int
31432test_xmlRegExecErrInfo(void) {
31433    int test_ret = 0;
31434
31435#if defined(LIBXML_REGEXP_ENABLED)
31436    int mem_base;
31437    int ret_val;
31438    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
31439    int n_exec;
31440    xmlChar ** string; /* return value for the error string */
31441    int n_string;
31442    int * nbval; /* pointer to the number of accepted values IN/OUT */
31443    int n_nbval;
31444    int * nbneg; /* return number of negative transitions */
31445    int n_nbneg;
31446    xmlChar ** values; /* pointer to the array of acceptable values */
31447    int n_values;
31448    int * terminal; /* return value if this was a terminal state */
31449    int n_terminal;
31450
31451    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31452    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
31453    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
31454    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
31455    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
31456    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
31457        mem_base = xmlMemBlocks();
31458        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31459        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
31460        nbval = gen_int_ptr(n_nbval, 2);
31461        nbneg = gen_int_ptr(n_nbneg, 3);
31462        values = gen_xmlChar_ptr_ptr(n_values, 4);
31463        terminal = gen_int_ptr(n_terminal, 5);
31464
31465        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
31466        desret_int(ret_val);
31467        call_tests++;
31468        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31469        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
31470        des_int_ptr(n_nbval, nbval, 2);
31471        des_int_ptr(n_nbneg, nbneg, 3);
31472        des_xmlChar_ptr_ptr(n_values, values, 4);
31473        des_int_ptr(n_terminal, terminal, 5);
31474        xmlResetLastError();
31475        if (mem_base != xmlMemBlocks()) {
31476            printf("Leak of %d blocks found in xmlRegExecErrInfo",
31477	           xmlMemBlocks() - mem_base);
31478	    test_ret++;
31479            printf(" %d", n_exec);
31480            printf(" %d", n_string);
31481            printf(" %d", n_nbval);
31482            printf(" %d", n_nbneg);
31483            printf(" %d", n_values);
31484            printf(" %d", n_terminal);
31485            printf("\n");
31486        }
31487    }
31488    }
31489    }
31490    }
31491    }
31492    }
31493    function_tests++;
31494#endif
31495
31496    return(test_ret);
31497}
31498
31499
31500static int
31501test_xmlRegExecNextValues(void) {
31502    int test_ret = 0;
31503
31504#if defined(LIBXML_REGEXP_ENABLED)
31505    int mem_base;
31506    int ret_val;
31507    xmlRegExecCtxtPtr exec; /* a regexp execution context */
31508    int n_exec;
31509    int * nbval; /* pointer to the number of accepted values IN/OUT */
31510    int n_nbval;
31511    int * nbneg; /* return number of negative transitions */
31512    int n_nbneg;
31513    xmlChar ** values; /* pointer to the array of acceptable values */
31514    int n_values;
31515    int * terminal; /* return value if this was a terminal state */
31516    int n_terminal;
31517
31518    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31519    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
31520    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
31521    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
31522    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
31523        mem_base = xmlMemBlocks();
31524        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31525        nbval = gen_int_ptr(n_nbval, 1);
31526        nbneg = gen_int_ptr(n_nbneg, 2);
31527        values = gen_xmlChar_ptr_ptr(n_values, 3);
31528        terminal = gen_int_ptr(n_terminal, 4);
31529
31530        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
31531        desret_int(ret_val);
31532        call_tests++;
31533        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31534        des_int_ptr(n_nbval, nbval, 1);
31535        des_int_ptr(n_nbneg, nbneg, 2);
31536        des_xmlChar_ptr_ptr(n_values, values, 3);
31537        des_int_ptr(n_terminal, terminal, 4);
31538        xmlResetLastError();
31539        if (mem_base != xmlMemBlocks()) {
31540            printf("Leak of %d blocks found in xmlRegExecNextValues",
31541	           xmlMemBlocks() - mem_base);
31542	    test_ret++;
31543            printf(" %d", n_exec);
31544            printf(" %d", n_nbval);
31545            printf(" %d", n_nbneg);
31546            printf(" %d", n_values);
31547            printf(" %d", n_terminal);
31548            printf("\n");
31549        }
31550    }
31551    }
31552    }
31553    }
31554    }
31555    function_tests++;
31556#endif
31557
31558    return(test_ret);
31559}
31560
31561
31562static int
31563test_xmlRegExecPushString(void) {
31564    int test_ret = 0;
31565
31566#if defined(LIBXML_REGEXP_ENABLED)
31567    int mem_base;
31568    int ret_val;
31569    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
31570    int n_exec;
31571    xmlChar * value; /* a string token input */
31572    int n_value;
31573    void * data; /* data associated to the token to reuse in callbacks */
31574    int n_data;
31575
31576    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31577    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
31578    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
31579        mem_base = xmlMemBlocks();
31580        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31581        value = gen_const_xmlChar_ptr(n_value, 1);
31582        data = gen_userdata(n_data, 2);
31583
31584        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
31585        desret_int(ret_val);
31586        call_tests++;
31587        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31588        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
31589        des_userdata(n_data, data, 2);
31590        xmlResetLastError();
31591        if (mem_base != xmlMemBlocks()) {
31592            printf("Leak of %d blocks found in xmlRegExecPushString",
31593	           xmlMemBlocks() - mem_base);
31594	    test_ret++;
31595            printf(" %d", n_exec);
31596            printf(" %d", n_value);
31597            printf(" %d", n_data);
31598            printf("\n");
31599        }
31600    }
31601    }
31602    }
31603    function_tests++;
31604#endif
31605
31606    return(test_ret);
31607}
31608
31609
31610static int
31611test_xmlRegExecPushString2(void) {
31612    int test_ret = 0;
31613
31614#if defined(LIBXML_REGEXP_ENABLED)
31615    int mem_base;
31616    int ret_val;
31617    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
31618    int n_exec;
31619    xmlChar * value; /* the first string token input */
31620    int n_value;
31621    xmlChar * value2; /* the second string token input */
31622    int n_value2;
31623    void * data; /* data associated to the token to reuse in callbacks */
31624    int n_data;
31625
31626    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31627    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
31628    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
31629    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
31630        mem_base = xmlMemBlocks();
31631        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31632        value = gen_const_xmlChar_ptr(n_value, 1);
31633        value2 = gen_const_xmlChar_ptr(n_value2, 2);
31634        data = gen_userdata(n_data, 3);
31635
31636        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
31637        desret_int(ret_val);
31638        call_tests++;
31639        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31640        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
31641        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
31642        des_userdata(n_data, data, 3);
31643        xmlResetLastError();
31644        if (mem_base != xmlMemBlocks()) {
31645            printf("Leak of %d blocks found in xmlRegExecPushString2",
31646	           xmlMemBlocks() - mem_base);
31647	    test_ret++;
31648            printf(" %d", n_exec);
31649            printf(" %d", n_value);
31650            printf(" %d", n_value2);
31651            printf(" %d", n_data);
31652            printf("\n");
31653        }
31654    }
31655    }
31656    }
31657    }
31658    function_tests++;
31659#endif
31660
31661    return(test_ret);
31662}
31663
31664#ifdef LIBXML_REGEXP_ENABLED
31665
31666#define gen_nb_xmlRegexpPtr 1
31667static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31668    return(NULL);
31669}
31670static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31671}
31672#endif
31673
31674
31675static int
31676test_xmlRegNewExecCtxt(void) {
31677    int test_ret = 0;
31678
31679
31680    /* missing type support */
31681    return(test_ret);
31682}
31683
31684
31685static int
31686test_xmlRegexpCompile(void) {
31687    int test_ret = 0;
31688
31689
31690    /* missing type support */
31691    return(test_ret);
31692}
31693
31694
31695static int
31696test_xmlRegexpExec(void) {
31697    int test_ret = 0;
31698
31699#if defined(LIBXML_REGEXP_ENABLED)
31700    int mem_base;
31701    int ret_val;
31702    xmlRegexpPtr comp; /* the compiled regular expression */
31703    int n_comp;
31704    xmlChar * content; /* the value to check against the regular expression */
31705    int n_content;
31706
31707    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
31708    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
31709        mem_base = xmlMemBlocks();
31710        comp = gen_xmlRegexpPtr(n_comp, 0);
31711        content = gen_const_xmlChar_ptr(n_content, 1);
31712
31713        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
31714        desret_int(ret_val);
31715        call_tests++;
31716        des_xmlRegexpPtr(n_comp, comp, 0);
31717        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
31718        xmlResetLastError();
31719        if (mem_base != xmlMemBlocks()) {
31720            printf("Leak of %d blocks found in xmlRegexpExec",
31721	           xmlMemBlocks() - mem_base);
31722	    test_ret++;
31723            printf(" %d", n_comp);
31724            printf(" %d", n_content);
31725            printf("\n");
31726        }
31727    }
31728    }
31729    function_tests++;
31730#endif
31731
31732    return(test_ret);
31733}
31734
31735
31736static int
31737test_xmlRegexpIsDeterminist(void) {
31738    int test_ret = 0;
31739
31740#if defined(LIBXML_REGEXP_ENABLED)
31741    int mem_base;
31742    int ret_val;
31743    xmlRegexpPtr comp; /* the compiled regular expression */
31744    int n_comp;
31745
31746    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
31747        mem_base = xmlMemBlocks();
31748        comp = gen_xmlRegexpPtr(n_comp, 0);
31749
31750        ret_val = xmlRegexpIsDeterminist(comp);
31751        desret_int(ret_val);
31752        call_tests++;
31753        des_xmlRegexpPtr(n_comp, comp, 0);
31754        xmlResetLastError();
31755        if (mem_base != xmlMemBlocks()) {
31756            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
31757	           xmlMemBlocks() - mem_base);
31758	    test_ret++;
31759            printf(" %d", n_comp);
31760            printf("\n");
31761        }
31762    }
31763    function_tests++;
31764#endif
31765
31766    return(test_ret);
31767}
31768
31769
31770static int
31771test_xmlRegexpPrint(void) {
31772    int test_ret = 0;
31773
31774#if defined(LIBXML_REGEXP_ENABLED)
31775    int mem_base;
31776    FILE * output; /* the file for the output debug */
31777    int n_output;
31778    xmlRegexpPtr regexp; /* the compiled regexp */
31779    int n_regexp;
31780
31781    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
31782    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
31783        mem_base = xmlMemBlocks();
31784        output = gen_FILE_ptr(n_output, 0);
31785        regexp = gen_xmlRegexpPtr(n_regexp, 1);
31786
31787        xmlRegexpPrint(output, regexp);
31788        call_tests++;
31789        des_FILE_ptr(n_output, output, 0);
31790        des_xmlRegexpPtr(n_regexp, regexp, 1);
31791        xmlResetLastError();
31792        if (mem_base != xmlMemBlocks()) {
31793            printf("Leak of %d blocks found in xmlRegexpPrint",
31794	           xmlMemBlocks() - mem_base);
31795	    test_ret++;
31796            printf(" %d", n_output);
31797            printf(" %d", n_regexp);
31798            printf("\n");
31799        }
31800    }
31801    }
31802    function_tests++;
31803#endif
31804
31805    return(test_ret);
31806}
31807
31808static int
31809test_xmlregexp(void) {
31810    int test_ret = 0;
31811
31812    if (quiet == 0) printf("Testing xmlregexp : 7 of 11 functions ...\n");
31813    test_ret += test_xmlRegExecErrInfo();
31814    test_ret += test_xmlRegExecNextValues();
31815    test_ret += test_xmlRegExecPushString();
31816    test_ret += test_xmlRegExecPushString2();
31817    test_ret += test_xmlRegNewExecCtxt();
31818    test_ret += test_xmlRegexpCompile();
31819    test_ret += test_xmlRegexpExec();
31820    test_ret += test_xmlRegexpIsDeterminist();
31821    test_ret += test_xmlRegexpPrint();
31822
31823    if (test_ret != 0)
31824	printf("Module xmlregexp: %d errors\n", test_ret);
31825    return(test_ret);
31826}
31827#ifdef LIBXML_OUTPUT_ENABLED
31828
31829#define gen_nb_xmlSaveCtxtPtr 1
31830static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31831    return(NULL);
31832}
31833static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31834}
31835#endif
31836
31837
31838static int
31839test_xmlSaveClose(void) {
31840    int test_ret = 0;
31841
31842#if defined(LIBXML_OUTPUT_ENABLED)
31843    int mem_base;
31844    int ret_val;
31845    xmlSaveCtxtPtr ctxt; /* a document saving context */
31846    int n_ctxt;
31847
31848    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31849        mem_base = xmlMemBlocks();
31850        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31851
31852        ret_val = xmlSaveClose(ctxt);
31853        desret_int(ret_val);
31854        call_tests++;
31855        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31856        xmlResetLastError();
31857        if (mem_base != xmlMemBlocks()) {
31858            printf("Leak of %d blocks found in xmlSaveClose",
31859	           xmlMemBlocks() - mem_base);
31860	    test_ret++;
31861            printf(" %d", n_ctxt);
31862            printf("\n");
31863        }
31864    }
31865    function_tests++;
31866#endif
31867
31868    return(test_ret);
31869}
31870
31871
31872static int
31873test_xmlSaveDoc(void) {
31874    int test_ret = 0;
31875
31876#if defined(LIBXML_OUTPUT_ENABLED)
31877    int mem_base;
31878    long ret_val;
31879    xmlSaveCtxtPtr ctxt; /* a document saving context */
31880    int n_ctxt;
31881    xmlDocPtr doc; /* a document */
31882    int n_doc;
31883
31884    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31885    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31886        mem_base = xmlMemBlocks();
31887        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31888        doc = gen_xmlDocPtr(n_doc, 1);
31889
31890        ret_val = xmlSaveDoc(ctxt, doc);
31891        desret_long(ret_val);
31892        call_tests++;
31893        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31894        des_xmlDocPtr(n_doc, doc, 1);
31895        xmlResetLastError();
31896        if (mem_base != xmlMemBlocks()) {
31897            printf("Leak of %d blocks found in xmlSaveDoc",
31898	           xmlMemBlocks() - mem_base);
31899	    test_ret++;
31900            printf(" %d", n_ctxt);
31901            printf(" %d", n_doc);
31902            printf("\n");
31903        }
31904    }
31905    }
31906    function_tests++;
31907#endif
31908
31909    return(test_ret);
31910}
31911
31912
31913static int
31914test_xmlSaveFlush(void) {
31915    int test_ret = 0;
31916
31917#if defined(LIBXML_OUTPUT_ENABLED)
31918    int mem_base;
31919    int ret_val;
31920    xmlSaveCtxtPtr ctxt; /* a document saving context */
31921    int n_ctxt;
31922
31923    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31924        mem_base = xmlMemBlocks();
31925        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31926
31927        ret_val = xmlSaveFlush(ctxt);
31928        desret_int(ret_val);
31929        call_tests++;
31930        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31931        xmlResetLastError();
31932        if (mem_base != xmlMemBlocks()) {
31933            printf("Leak of %d blocks found in xmlSaveFlush",
31934	           xmlMemBlocks() - mem_base);
31935	    test_ret++;
31936            printf(" %d", n_ctxt);
31937            printf("\n");
31938        }
31939    }
31940    function_tests++;
31941#endif
31942
31943    return(test_ret);
31944}
31945
31946
31947static int
31948test_xmlSaveSetAttrEscape(void) {
31949    int test_ret = 0;
31950
31951
31952    /* missing type support */
31953    return(test_ret);
31954}
31955
31956
31957static int
31958test_xmlSaveSetEscape(void) {
31959    int test_ret = 0;
31960
31961
31962    /* missing type support */
31963    return(test_ret);
31964}
31965
31966
31967static int
31968test_xmlSaveToFd(void) {
31969    int test_ret = 0;
31970
31971
31972    /* missing type support */
31973    return(test_ret);
31974}
31975
31976
31977static int
31978test_xmlSaveToFilename(void) {
31979    int test_ret = 0;
31980
31981
31982    /* missing type support */
31983    return(test_ret);
31984}
31985
31986
31987static int
31988test_xmlSaveTree(void) {
31989    int test_ret = 0;
31990
31991#if defined(LIBXML_OUTPUT_ENABLED)
31992    int mem_base;
31993    long ret_val;
31994    xmlSaveCtxtPtr ctxt; /* a document saving context */
31995    int n_ctxt;
31996    xmlNodePtr node; /* a document */
31997    int n_node;
31998
31999    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32000    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
32001        mem_base = xmlMemBlocks();
32002        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32003        node = gen_xmlNodePtr(n_node, 1);
32004
32005        ret_val = xmlSaveTree(ctxt, node);
32006        desret_long(ret_val);
32007        call_tests++;
32008        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32009        des_xmlNodePtr(n_node, node, 1);
32010        xmlResetLastError();
32011        if (mem_base != xmlMemBlocks()) {
32012            printf("Leak of %d blocks found in xmlSaveTree",
32013	           xmlMemBlocks() - mem_base);
32014	    test_ret++;
32015            printf(" %d", n_ctxt);
32016            printf(" %d", n_node);
32017            printf("\n");
32018        }
32019    }
32020    }
32021    function_tests++;
32022#endif
32023
32024    return(test_ret);
32025}
32026
32027static int
32028test_xmlsave(void) {
32029    int test_ret = 0;
32030
32031    if (quiet == 0) printf("Testing xmlsave : 4 of 9 functions ...\n");
32032    test_ret += test_xmlSaveClose();
32033    test_ret += test_xmlSaveDoc();
32034    test_ret += test_xmlSaveFlush();
32035    test_ret += test_xmlSaveSetAttrEscape();
32036    test_ret += test_xmlSaveSetEscape();
32037    test_ret += test_xmlSaveToFd();
32038    test_ret += test_xmlSaveToFilename();
32039    test_ret += test_xmlSaveTree();
32040
32041    if (test_ret != 0)
32042	printf("Module xmlsave: %d errors\n", test_ret);
32043    return(test_ret);
32044}
32045#ifdef LIBXML_SCHEMAS_ENABLED
32046
32047#define gen_nb_xmlSchemaPtr 1
32048static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32049    return(NULL);
32050}
32051static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32052}
32053#endif
32054
32055
32056static int
32057test_xmlSchemaDump(void) {
32058    int test_ret = 0;
32059
32060#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
32061    int mem_base;
32062    FILE * output; /* the file output */
32063    int n_output;
32064    xmlSchemaPtr schema; /* a schema structure */
32065    int n_schema;
32066
32067    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
32068    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32069        mem_base = xmlMemBlocks();
32070        output = gen_FILE_ptr(n_output, 0);
32071        schema = gen_xmlSchemaPtr(n_schema, 1);
32072
32073        xmlSchemaDump(output, schema);
32074        call_tests++;
32075        des_FILE_ptr(n_output, output, 0);
32076        des_xmlSchemaPtr(n_schema, schema, 1);
32077        xmlResetLastError();
32078        if (mem_base != xmlMemBlocks()) {
32079            printf("Leak of %d blocks found in xmlSchemaDump",
32080	           xmlMemBlocks() - mem_base);
32081	    test_ret++;
32082            printf(" %d", n_output);
32083            printf(" %d", n_schema);
32084            printf("\n");
32085        }
32086    }
32087    }
32088    function_tests++;
32089#endif
32090
32091    return(test_ret);
32092}
32093
32094#ifdef LIBXML_SCHEMAS_ENABLED
32095
32096#define gen_nb_xmlSchemaParserCtxtPtr 1
32097static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32098    return(NULL);
32099}
32100static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32101}
32102#endif
32103
32104#ifdef LIBXML_SCHEMAS_ENABLED
32105
32106#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
32107static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32108    return(NULL);
32109}
32110static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32111}
32112#endif
32113
32114#ifdef LIBXML_SCHEMAS_ENABLED
32115
32116#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
32117static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32118    return(NULL);
32119}
32120static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32121}
32122#endif
32123
32124
32125static int
32126test_xmlSchemaGetParserErrors(void) {
32127    int test_ret = 0;
32128
32129#if defined(LIBXML_SCHEMAS_ENABLED)
32130    int mem_base;
32131    int ret_val;
32132    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
32133    int n_ctxt;
32134    xmlSchemaValidityErrorFunc * err; /* the error callback result */
32135    int n_err;
32136    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
32137    int n_warn;
32138    void ** ctx; /* contextual data for the callbacks result */
32139    int n_ctx;
32140
32141    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
32142    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
32143    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
32144    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
32145        mem_base = xmlMemBlocks();
32146        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
32147        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
32148        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
32149        ctx = gen_void_ptr_ptr(n_ctx, 3);
32150
32151        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
32152        desret_int(ret_val);
32153        call_tests++;
32154        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
32155        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
32156        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
32157        des_void_ptr_ptr(n_ctx, ctx, 3);
32158        xmlResetLastError();
32159        if (mem_base != xmlMemBlocks()) {
32160            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
32161	           xmlMemBlocks() - mem_base);
32162	    test_ret++;
32163            printf(" %d", n_ctxt);
32164            printf(" %d", n_err);
32165            printf(" %d", n_warn);
32166            printf(" %d", n_ctx);
32167            printf("\n");
32168        }
32169    }
32170    }
32171    }
32172    }
32173    function_tests++;
32174#endif
32175
32176    return(test_ret);
32177}
32178
32179#ifdef LIBXML_SCHEMAS_ENABLED
32180
32181#define gen_nb_xmlSchemaValidCtxtPtr 1
32182static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32183    return(NULL);
32184}
32185static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32186}
32187#endif
32188
32189
32190static int
32191test_xmlSchemaGetValidErrors(void) {
32192    int test_ret = 0;
32193
32194#if defined(LIBXML_SCHEMAS_ENABLED)
32195    int mem_base;
32196    int ret_val;
32197    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
32198    int n_ctxt;
32199    xmlSchemaValidityErrorFunc * err; /* the error function result */
32200    int n_err;
32201    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
32202    int n_warn;
32203    void ** ctx; /* the functions context result */
32204    int n_ctx;
32205
32206    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32207    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
32208    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
32209    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
32210        mem_base = xmlMemBlocks();
32211        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32212        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
32213        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
32214        ctx = gen_void_ptr_ptr(n_ctx, 3);
32215
32216        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
32217        desret_int(ret_val);
32218        call_tests++;
32219        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32220        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
32221        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
32222        des_void_ptr_ptr(n_ctx, ctx, 3);
32223        xmlResetLastError();
32224        if (mem_base != xmlMemBlocks()) {
32225            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
32226	           xmlMemBlocks() - mem_base);
32227	    test_ret++;
32228            printf(" %d", n_ctxt);
32229            printf(" %d", n_err);
32230            printf(" %d", n_warn);
32231            printf(" %d", n_ctx);
32232            printf("\n");
32233        }
32234    }
32235    }
32236    }
32237    }
32238    function_tests++;
32239#endif
32240
32241    return(test_ret);
32242}
32243
32244
32245static int
32246test_xmlSchemaNewDocParserCtxt(void) {
32247    int test_ret = 0;
32248
32249#if defined(LIBXML_SCHEMAS_ENABLED)
32250    int mem_base;
32251    xmlSchemaParserCtxtPtr ret_val;
32252    xmlDocPtr doc; /* a preparsed document tree */
32253    int n_doc;
32254
32255    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
32256        mem_base = xmlMemBlocks();
32257        doc = gen_xmlDocPtr(n_doc, 0);
32258
32259        ret_val = xmlSchemaNewDocParserCtxt(doc);
32260        desret_xmlSchemaParserCtxtPtr(ret_val);
32261        call_tests++;
32262        des_xmlDocPtr(n_doc, doc, 0);
32263        xmlResetLastError();
32264        if (mem_base != xmlMemBlocks()) {
32265            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
32266	           xmlMemBlocks() - mem_base);
32267	    test_ret++;
32268            printf(" %d", n_doc);
32269            printf("\n");
32270        }
32271    }
32272    function_tests++;
32273#endif
32274
32275    return(test_ret);
32276}
32277
32278
32279static int
32280test_xmlSchemaNewMemParserCtxt(void) {
32281    int test_ret = 0;
32282
32283#if defined(LIBXML_SCHEMAS_ENABLED)
32284    int mem_base;
32285    xmlSchemaParserCtxtPtr ret_val;
32286    char * buffer; /* a pointer to a char array containing the schemas */
32287    int n_buffer;
32288    int size; /* the size of the array */
32289    int n_size;
32290
32291    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
32292    for (n_size = 0;n_size < gen_nb_int;n_size++) {
32293        mem_base = xmlMemBlocks();
32294        buffer = gen_const_char_ptr(n_buffer, 0);
32295        size = gen_int(n_size, 1);
32296
32297        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
32298        desret_xmlSchemaParserCtxtPtr(ret_val);
32299        call_tests++;
32300        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
32301        des_int(n_size, size, 1);
32302        xmlResetLastError();
32303        if (mem_base != xmlMemBlocks()) {
32304            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
32305	           xmlMemBlocks() - mem_base);
32306	    test_ret++;
32307            printf(" %d", n_buffer);
32308            printf(" %d", n_size);
32309            printf("\n");
32310        }
32311    }
32312    }
32313    function_tests++;
32314#endif
32315
32316    return(test_ret);
32317}
32318
32319
32320static int
32321test_xmlSchemaNewParserCtxt(void) {
32322    int test_ret = 0;
32323
32324#if defined(LIBXML_SCHEMAS_ENABLED)
32325    int mem_base;
32326    xmlSchemaParserCtxtPtr ret_val;
32327    char * URL; /* the location of the schema */
32328    int n_URL;
32329
32330    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
32331        mem_base = xmlMemBlocks();
32332        URL = gen_const_char_ptr(n_URL, 0);
32333
32334        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
32335        desret_xmlSchemaParserCtxtPtr(ret_val);
32336        call_tests++;
32337        des_const_char_ptr(n_URL, (const char *)URL, 0);
32338        xmlResetLastError();
32339        if (mem_base != xmlMemBlocks()) {
32340            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
32341	           xmlMemBlocks() - mem_base);
32342	    test_ret++;
32343            printf(" %d", n_URL);
32344            printf("\n");
32345        }
32346    }
32347    function_tests++;
32348#endif
32349
32350    return(test_ret);
32351}
32352
32353
32354static int
32355test_xmlSchemaNewValidCtxt(void) {
32356    int test_ret = 0;
32357
32358
32359    /* missing type support */
32360    return(test_ret);
32361}
32362
32363
32364static int
32365test_xmlSchemaParse(void) {
32366    int test_ret = 0;
32367
32368
32369    /* missing type support */
32370    return(test_ret);
32371}
32372
32373
32374static int
32375test_xmlSchemaSetParserErrors(void) {
32376    int test_ret = 0;
32377
32378
32379    /* missing type support */
32380    return(test_ret);
32381}
32382
32383
32384static int
32385test_xmlSchemaSetValidErrors(void) {
32386    int test_ret = 0;
32387
32388
32389    /* missing type support */
32390    return(test_ret);
32391}
32392
32393
32394static int
32395test_xmlSchemaSetValidOptions(void) {
32396    int test_ret = 0;
32397
32398#if defined(LIBXML_SCHEMAS_ENABLED)
32399    int mem_base;
32400    int ret_val;
32401    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32402    int n_ctxt;
32403    int options; /* a combination of xmlSchemaValidOption */
32404    int n_options;
32405
32406    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32407    for (n_options = 0;n_options < gen_nb_int;n_options++) {
32408        mem_base = xmlMemBlocks();
32409        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32410        options = gen_int(n_options, 1);
32411
32412        ret_val = xmlSchemaSetValidOptions(ctxt, options);
32413        desret_int(ret_val);
32414        call_tests++;
32415        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32416        des_int(n_options, options, 1);
32417        xmlResetLastError();
32418        if (mem_base != xmlMemBlocks()) {
32419            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
32420	           xmlMemBlocks() - mem_base);
32421	    test_ret++;
32422            printf(" %d", n_ctxt);
32423            printf(" %d", n_options);
32424            printf("\n");
32425        }
32426    }
32427    }
32428    function_tests++;
32429#endif
32430
32431    return(test_ret);
32432}
32433
32434
32435static int
32436test_xmlSchemaValidCtxtGetOptions(void) {
32437    int test_ret = 0;
32438
32439#if defined(LIBXML_SCHEMAS_ENABLED)
32440    int mem_base;
32441    int ret_val;
32442    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32443    int n_ctxt;
32444
32445    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32446        mem_base = xmlMemBlocks();
32447        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32448
32449        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
32450        desret_int(ret_val);
32451        call_tests++;
32452        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32453        xmlResetLastError();
32454        if (mem_base != xmlMemBlocks()) {
32455            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
32456	           xmlMemBlocks() - mem_base);
32457	    test_ret++;
32458            printf(" %d", n_ctxt);
32459            printf("\n");
32460        }
32461    }
32462    function_tests++;
32463#endif
32464
32465    return(test_ret);
32466}
32467
32468
32469static int
32470test_xmlSchemaValidateDoc(void) {
32471    int test_ret = 0;
32472
32473#if defined(LIBXML_SCHEMAS_ENABLED)
32474    int mem_base;
32475    int ret_val;
32476    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32477    int n_ctxt;
32478    xmlDocPtr doc; /* a parsed document tree */
32479    int n_doc;
32480
32481    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32482    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
32483        mem_base = xmlMemBlocks();
32484        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32485        doc = gen_xmlDocPtr(n_doc, 1);
32486
32487        ret_val = xmlSchemaValidateDoc(ctxt, doc);
32488        desret_int(ret_val);
32489        call_tests++;
32490        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32491        des_xmlDocPtr(n_doc, doc, 1);
32492        xmlResetLastError();
32493        if (mem_base != xmlMemBlocks()) {
32494            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
32495	           xmlMemBlocks() - mem_base);
32496	    test_ret++;
32497            printf(" %d", n_ctxt);
32498            printf(" %d", n_doc);
32499            printf("\n");
32500        }
32501    }
32502    }
32503    function_tests++;
32504#endif
32505
32506    return(test_ret);
32507}
32508
32509
32510static int
32511test_xmlSchemaValidateOneElement(void) {
32512    int test_ret = 0;
32513
32514#if defined(LIBXML_SCHEMAS_ENABLED)
32515    int mem_base;
32516    int ret_val;
32517    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32518    int n_ctxt;
32519    xmlNodePtr elem; /* an element node */
32520    int n_elem;
32521
32522    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32523    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
32524        mem_base = xmlMemBlocks();
32525        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32526        elem = gen_xmlNodePtr(n_elem, 1);
32527
32528        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
32529        desret_int(ret_val);
32530        call_tests++;
32531        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32532        des_xmlNodePtr(n_elem, elem, 1);
32533        xmlResetLastError();
32534        if (mem_base != xmlMemBlocks()) {
32535            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
32536	           xmlMemBlocks() - mem_base);
32537	    test_ret++;
32538            printf(" %d", n_ctxt);
32539            printf(" %d", n_elem);
32540            printf("\n");
32541        }
32542    }
32543    }
32544    function_tests++;
32545#endif
32546
32547    return(test_ret);
32548}
32549
32550
32551static int
32552test_xmlSchemaValidateStream(void) {
32553    int test_ret = 0;
32554
32555#if defined(LIBXML_SCHEMAS_ENABLED)
32556    int mem_base;
32557    int ret_val;
32558    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32559    int n_ctxt;
32560    xmlParserInputBufferPtr input; /* the input to use for reading the data */
32561    int n_input;
32562    xmlCharEncoding enc; /* an optional encoding information */
32563    int n_enc;
32564    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
32565    int n_sax;
32566    void * user_data; /* the context to provide to the SAX handler. */
32567    int n_user_data;
32568
32569    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32570    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32571    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
32572    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
32573    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
32574        mem_base = xmlMemBlocks();
32575        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32576        input = gen_xmlParserInputBufferPtr(n_input, 1);
32577        enc = gen_xmlCharEncoding(n_enc, 2);
32578        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
32579        user_data = gen_userdata(n_user_data, 4);
32580
32581        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
32582        desret_int(ret_val);
32583        call_tests++;
32584        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32585        des_xmlParserInputBufferPtr(n_input, input, 1);
32586        des_xmlCharEncoding(n_enc, enc, 2);
32587        des_xmlSAXHandlerPtr(n_sax, sax, 3);
32588        des_userdata(n_user_data, user_data, 4);
32589        xmlResetLastError();
32590        if (mem_base != xmlMemBlocks()) {
32591            printf("Leak of %d blocks found in xmlSchemaValidateStream",
32592	           xmlMemBlocks() - mem_base);
32593	    test_ret++;
32594            printf(" %d", n_ctxt);
32595            printf(" %d", n_input);
32596            printf(" %d", n_enc);
32597            printf(" %d", n_sax);
32598            printf(" %d", n_user_data);
32599            printf("\n");
32600        }
32601    }
32602    }
32603    }
32604    }
32605    }
32606    function_tests++;
32607#endif
32608
32609    return(test_ret);
32610}
32611
32612static int
32613test_xmlschemas(void) {
32614    int test_ret = 0;
32615
32616    if (quiet == 0) printf("Testing xmlschemas : 11 of 18 functions ...\n");
32617    test_ret += test_xmlSchemaDump();
32618    test_ret += test_xmlSchemaGetParserErrors();
32619    test_ret += test_xmlSchemaGetValidErrors();
32620    test_ret += test_xmlSchemaNewDocParserCtxt();
32621    test_ret += test_xmlSchemaNewMemParserCtxt();
32622    test_ret += test_xmlSchemaNewParserCtxt();
32623    test_ret += test_xmlSchemaNewValidCtxt();
32624    test_ret += test_xmlSchemaParse();
32625    test_ret += test_xmlSchemaSetParserErrors();
32626    test_ret += test_xmlSchemaSetValidErrors();
32627    test_ret += test_xmlSchemaSetValidOptions();
32628    test_ret += test_xmlSchemaValidCtxtGetOptions();
32629    test_ret += test_xmlSchemaValidateDoc();
32630    test_ret += test_xmlSchemaValidateOneElement();
32631    test_ret += test_xmlSchemaValidateStream();
32632
32633    if (test_ret != 0)
32634	printf("Module xmlschemas: %d errors\n", test_ret);
32635    return(test_ret);
32636}
32637#ifdef LIBXML_SCHEMAS_ENABLED
32638
32639#define gen_nb_xmlSchemaFacetPtr 1
32640static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32641    return(NULL);
32642}
32643static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32644}
32645#endif
32646
32647#ifdef LIBXML_SCHEMAS_ENABLED
32648
32649#define gen_nb_xmlSchemaTypePtr 1
32650static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32651    return(NULL);
32652}
32653static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32654}
32655#endif
32656
32657
32658static int
32659test_xmlSchemaCheckFacet(void) {
32660    int test_ret = 0;
32661
32662#if defined(LIBXML_SCHEMAS_ENABLED)
32663    int mem_base;
32664    int ret_val;
32665    xmlSchemaFacetPtr facet; /* the facet */
32666    int n_facet;
32667    xmlSchemaTypePtr typeDecl; /* the schema type definition */
32668    int n_typeDecl;
32669    xmlSchemaParserCtxtPtr ctxt; /* the schema parser context or NULL */
32670    int n_ctxt;
32671    xmlChar * name; /* name of the type */
32672    int n_name;
32673
32674    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32675    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
32676    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
32677    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32678        mem_base = xmlMemBlocks();
32679        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
32680        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
32681        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 2);
32682        name = gen_const_xmlChar_ptr(n_name, 3);
32683
32684        ret_val = xmlSchemaCheckFacet(facet, typeDecl, ctxt, (const xmlChar *)name);
32685        desret_int(ret_val);
32686        call_tests++;
32687        des_xmlSchemaFacetPtr(n_facet, facet, 0);
32688        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
32689        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 2);
32690        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
32691        xmlResetLastError();
32692        if (mem_base != xmlMemBlocks()) {
32693            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
32694	           xmlMemBlocks() - mem_base);
32695	    test_ret++;
32696            printf(" %d", n_facet);
32697            printf(" %d", n_typeDecl);
32698            printf(" %d", n_ctxt);
32699            printf(" %d", n_name);
32700            printf("\n");
32701        }
32702    }
32703    }
32704    }
32705    }
32706    function_tests++;
32707#endif
32708
32709    return(test_ret);
32710}
32711
32712
32713static int
32714test_xmlSchemaCleanupTypes(void) {
32715    int test_ret = 0;
32716
32717#if defined(LIBXML_SCHEMAS_ENABLED)
32718    int mem_base;
32719
32720        mem_base = xmlMemBlocks();
32721
32722        xmlSchemaCleanupTypes();
32723        call_tests++;
32724        xmlResetLastError();
32725        if (mem_base != xmlMemBlocks()) {
32726            printf("Leak of %d blocks found in xmlSchemaCleanupTypes",
32727	           xmlMemBlocks() - mem_base);
32728	    test_ret++;
32729            printf("\n");
32730        }
32731    function_tests++;
32732#endif
32733
32734    return(test_ret);
32735}
32736
32737
32738static int
32739test_xmlSchemaCollapseString(void) {
32740    int test_ret = 0;
32741
32742#if defined(LIBXML_SCHEMAS_ENABLED)
32743    int mem_base;
32744    xmlChar * ret_val;
32745    xmlChar * value; /* a value */
32746    int n_value;
32747
32748    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32749        mem_base = xmlMemBlocks();
32750        value = gen_const_xmlChar_ptr(n_value, 0);
32751
32752        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
32753        desret_xmlChar_ptr(ret_val);
32754        call_tests++;
32755        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
32756        xmlResetLastError();
32757        if (mem_base != xmlMemBlocks()) {
32758            printf("Leak of %d blocks found in xmlSchemaCollapseString",
32759	           xmlMemBlocks() - mem_base);
32760	    test_ret++;
32761            printf(" %d", n_value);
32762            printf("\n");
32763        }
32764    }
32765    function_tests++;
32766#endif
32767
32768    return(test_ret);
32769}
32770
32771#ifdef LIBXML_SCHEMAS_ENABLED
32772
32773#define gen_nb_xmlSchemaValPtr 1
32774static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32775    return(NULL);
32776}
32777static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32778}
32779#endif
32780
32781
32782static int
32783test_xmlSchemaCompareValues(void) {
32784    int test_ret = 0;
32785
32786#if defined(LIBXML_SCHEMAS_ENABLED)
32787    int mem_base;
32788    int ret_val;
32789    xmlSchemaValPtr x; /* a first value */
32790    int n_x;
32791    xmlSchemaValPtr y; /* a second value */
32792    int n_y;
32793
32794    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
32795    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
32796        mem_base = xmlMemBlocks();
32797        x = gen_xmlSchemaValPtr(n_x, 0);
32798        y = gen_xmlSchemaValPtr(n_y, 1);
32799
32800        ret_val = xmlSchemaCompareValues(x, y);
32801        desret_int(ret_val);
32802        call_tests++;
32803        des_xmlSchemaValPtr(n_x, x, 0);
32804        des_xmlSchemaValPtr(n_y, y, 1);
32805        xmlResetLastError();
32806        if (mem_base != xmlMemBlocks()) {
32807            printf("Leak of %d blocks found in xmlSchemaCompareValues",
32808	           xmlMemBlocks() - mem_base);
32809	    test_ret++;
32810            printf(" %d", n_x);
32811            printf(" %d", n_y);
32812            printf("\n");
32813        }
32814    }
32815    }
32816    function_tests++;
32817#endif
32818
32819    return(test_ret);
32820}
32821
32822
32823static int
32824test_xmlSchemaCompareValuesWhtsp(void) {
32825    int test_ret = 0;
32826
32827#if defined(LIBXML_SCHEMAS_ENABLED)
32828    int mem_base;
32829    int ret_val;
32830    xmlSchemaValPtr x; /* a first value */
32831    int n_x;
32832    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
32833    int n_xws;
32834    xmlSchemaValPtr y; /* a second value */
32835    int n_y;
32836    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
32837    int n_yws;
32838
32839    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
32840    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
32841    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
32842    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
32843        mem_base = xmlMemBlocks();
32844        x = gen_xmlSchemaValPtr(n_x, 0);
32845        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
32846        y = gen_xmlSchemaValPtr(n_y, 2);
32847        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
32848
32849        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
32850        desret_int(ret_val);
32851        call_tests++;
32852        des_xmlSchemaValPtr(n_x, x, 0);
32853        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
32854        des_xmlSchemaValPtr(n_y, y, 2);
32855        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
32856        xmlResetLastError();
32857        if (mem_base != xmlMemBlocks()) {
32858            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
32859	           xmlMemBlocks() - mem_base);
32860	    test_ret++;
32861            printf(" %d", n_x);
32862            printf(" %d", n_xws);
32863            printf(" %d", n_y);
32864            printf(" %d", n_yws);
32865            printf("\n");
32866        }
32867    }
32868    }
32869    }
32870    }
32871    function_tests++;
32872#endif
32873
32874    return(test_ret);
32875}
32876
32877
32878static int
32879test_xmlSchemaCopyValue(void) {
32880    int test_ret = 0;
32881
32882
32883    /* missing type support */
32884    return(test_ret);
32885}
32886
32887
32888static int
32889test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
32890    int test_ret = 0;
32891
32892#if defined(LIBXML_SCHEMAS_ENABLED)
32893    int mem_base;
32894    xmlSchemaTypePtr ret_val;
32895    xmlSchemaTypePtr type; /* the built-in simple type. */
32896    int n_type;
32897
32898    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32899        mem_base = xmlMemBlocks();
32900        type = gen_xmlSchemaTypePtr(n_type, 0);
32901
32902        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
32903        desret_xmlSchemaTypePtr(ret_val);
32904        call_tests++;
32905        des_xmlSchemaTypePtr(n_type, type, 0);
32906        xmlResetLastError();
32907        if (mem_base != xmlMemBlocks()) {
32908            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
32909	           xmlMemBlocks() - mem_base);
32910	    test_ret++;
32911            printf(" %d", n_type);
32912            printf("\n");
32913        }
32914    }
32915    function_tests++;
32916#endif
32917
32918    return(test_ret);
32919}
32920
32921
32922static int
32923test_xmlSchemaGetBuiltInType(void) {
32924    int test_ret = 0;
32925
32926#if defined(LIBXML_SCHEMAS_ENABLED)
32927    xmlSchemaTypePtr ret_val;
32928    xmlSchemaValType type; /* the type of the built in type */
32929    int n_type;
32930
32931    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
32932        type = gen_xmlSchemaValType(n_type, 0);
32933
32934        ret_val = xmlSchemaGetBuiltInType(type);
32935        desret_xmlSchemaTypePtr(ret_val);
32936        call_tests++;
32937        des_xmlSchemaValType(n_type, type, 0);
32938        xmlResetLastError();
32939    }
32940    function_tests++;
32941#endif
32942
32943    return(test_ret);
32944}
32945
32946
32947static int
32948test_xmlSchemaGetCanonValue(void) {
32949    int test_ret = 0;
32950
32951#if defined(LIBXML_SCHEMAS_ENABLED)
32952    int mem_base;
32953    int ret_val;
32954    xmlSchemaValPtr val; /* the precomputed value */
32955    int n_val;
32956    xmlChar ** retValue; /* the returned value */
32957    int n_retValue;
32958
32959    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
32960    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
32961        mem_base = xmlMemBlocks();
32962        val = gen_xmlSchemaValPtr(n_val, 0);
32963        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
32964
32965        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
32966        desret_int(ret_val);
32967        call_tests++;
32968        des_xmlSchemaValPtr(n_val, val, 0);
32969        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
32970        xmlResetLastError();
32971        if (mem_base != xmlMemBlocks()) {
32972            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
32973	           xmlMemBlocks() - mem_base);
32974	    test_ret++;
32975            printf(" %d", n_val);
32976            printf(" %d", n_retValue);
32977            printf("\n");
32978        }
32979    }
32980    }
32981    function_tests++;
32982#endif
32983
32984    return(test_ret);
32985}
32986
32987
32988static int
32989test_xmlSchemaGetCanonValueWhtsp(void) {
32990    int test_ret = 0;
32991
32992#if defined(LIBXML_SCHEMAS_ENABLED)
32993    int mem_base;
32994    int ret_val;
32995    xmlSchemaValPtr val; /* the precomputed value */
32996    int n_val;
32997    xmlChar ** retValue; /* the returned value */
32998    int n_retValue;
32999    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
33000    int n_ws;
33001
33002    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33003    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
33004    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
33005        mem_base = xmlMemBlocks();
33006        val = gen_xmlSchemaValPtr(n_val, 0);
33007        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
33008        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
33009
33010        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
33011        desret_int(ret_val);
33012        call_tests++;
33013        des_xmlSchemaValPtr(n_val, val, 0);
33014        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
33015        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
33016        xmlResetLastError();
33017        if (mem_base != xmlMemBlocks()) {
33018            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
33019	           xmlMemBlocks() - mem_base);
33020	    test_ret++;
33021            printf(" %d", n_val);
33022            printf(" %d", n_retValue);
33023            printf(" %d", n_ws);
33024            printf("\n");
33025        }
33026    }
33027    }
33028    }
33029    function_tests++;
33030#endif
33031
33032    return(test_ret);
33033}
33034
33035
33036static int
33037test_xmlSchemaGetFacetValueAsULong(void) {
33038    int test_ret = 0;
33039
33040#if defined(LIBXML_SCHEMAS_ENABLED)
33041    int mem_base;
33042    unsigned long ret_val;
33043    xmlSchemaFacetPtr facet; /* an schemas type facet */
33044    int n_facet;
33045
33046    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33047        mem_base = xmlMemBlocks();
33048        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33049
33050        ret_val = xmlSchemaGetFacetValueAsULong(facet);
33051        desret_unsigned_long(ret_val);
33052        call_tests++;
33053        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33054        xmlResetLastError();
33055        if (mem_base != xmlMemBlocks()) {
33056            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
33057	           xmlMemBlocks() - mem_base);
33058	    test_ret++;
33059            printf(" %d", n_facet);
33060            printf("\n");
33061        }
33062    }
33063    function_tests++;
33064#endif
33065
33066    return(test_ret);
33067}
33068
33069
33070static int
33071test_xmlSchemaGetPredefinedType(void) {
33072    int test_ret = 0;
33073
33074#if defined(LIBXML_SCHEMAS_ENABLED)
33075    int mem_base;
33076    xmlSchemaTypePtr ret_val;
33077    xmlChar * name; /* the type name */
33078    int n_name;
33079    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
33080    int n_ns;
33081
33082    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
33083    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
33084        mem_base = xmlMemBlocks();
33085        name = gen_const_xmlChar_ptr(n_name, 0);
33086        ns = gen_const_xmlChar_ptr(n_ns, 1);
33087
33088        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
33089        desret_xmlSchemaTypePtr(ret_val);
33090        call_tests++;
33091        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
33092        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
33093        xmlResetLastError();
33094        if (mem_base != xmlMemBlocks()) {
33095            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
33096	           xmlMemBlocks() - mem_base);
33097	    test_ret++;
33098            printf(" %d", n_name);
33099            printf(" %d", n_ns);
33100            printf("\n");
33101        }
33102    }
33103    }
33104    function_tests++;
33105#endif
33106
33107    return(test_ret);
33108}
33109
33110
33111static int
33112test_xmlSchemaGetValType(void) {
33113    int test_ret = 0;
33114
33115#if defined(LIBXML_SCHEMAS_ENABLED)
33116    int mem_base;
33117    xmlSchemaValType ret_val;
33118    xmlSchemaValPtr val; /* a schemas value */
33119    int n_val;
33120
33121    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33122        mem_base = xmlMemBlocks();
33123        val = gen_xmlSchemaValPtr(n_val, 0);
33124
33125        ret_val = xmlSchemaGetValType(val);
33126        desret_xmlSchemaValType(ret_val);
33127        call_tests++;
33128        des_xmlSchemaValPtr(n_val, val, 0);
33129        xmlResetLastError();
33130        if (mem_base != xmlMemBlocks()) {
33131            printf("Leak of %d blocks found in xmlSchemaGetValType",
33132	           xmlMemBlocks() - mem_base);
33133	    test_ret++;
33134            printf(" %d", n_val);
33135            printf("\n");
33136        }
33137    }
33138    function_tests++;
33139#endif
33140
33141    return(test_ret);
33142}
33143
33144
33145static int
33146test_xmlSchemaInitTypes(void) {
33147    int test_ret = 0;
33148
33149#if defined(LIBXML_SCHEMAS_ENABLED)
33150
33151
33152        xmlSchemaInitTypes();
33153        call_tests++;
33154        xmlResetLastError();
33155    function_tests++;
33156#endif
33157
33158    return(test_ret);
33159}
33160
33161
33162static int
33163test_xmlSchemaIsBuiltInTypeFacet(void) {
33164    int test_ret = 0;
33165
33166#if defined(LIBXML_SCHEMAS_ENABLED)
33167    int mem_base;
33168    int ret_val;
33169    xmlSchemaTypePtr type; /* the built-in type */
33170    int n_type;
33171    int facetType; /* the facet type */
33172    int n_facetType;
33173
33174    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33175    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
33176        mem_base = xmlMemBlocks();
33177        type = gen_xmlSchemaTypePtr(n_type, 0);
33178        facetType = gen_int(n_facetType, 1);
33179
33180        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
33181        desret_int(ret_val);
33182        call_tests++;
33183        des_xmlSchemaTypePtr(n_type, type, 0);
33184        des_int(n_facetType, facetType, 1);
33185        xmlResetLastError();
33186        if (mem_base != xmlMemBlocks()) {
33187            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
33188	           xmlMemBlocks() - mem_base);
33189	    test_ret++;
33190            printf(" %d", n_type);
33191            printf(" %d", n_facetType);
33192            printf("\n");
33193        }
33194    }
33195    }
33196    function_tests++;
33197#endif
33198
33199    return(test_ret);
33200}
33201
33202
33203static int
33204test_xmlSchemaNewFacet(void) {
33205    int test_ret = 0;
33206
33207
33208    /* missing type support */
33209    return(test_ret);
33210}
33211
33212
33213static int
33214test_xmlSchemaNewNOTATIONValue(void) {
33215    int test_ret = 0;
33216
33217
33218    /* missing type support */
33219    return(test_ret);
33220}
33221
33222
33223static int
33224test_xmlSchemaNewStringValue(void) {
33225    int test_ret = 0;
33226
33227
33228    /* missing type support */
33229    return(test_ret);
33230}
33231
33232#ifdef LIBXML_SCHEMAS_ENABLED
33233
33234#define gen_nb_xmlSchemaValPtr_ptr 1
33235static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33236    return(NULL);
33237}
33238static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33239}
33240#endif
33241
33242
33243static int
33244test_xmlSchemaValPredefTypeNode(void) {
33245    int test_ret = 0;
33246
33247#if defined(LIBXML_SCHEMAS_ENABLED)
33248    int mem_base;
33249    int ret_val;
33250    xmlSchemaTypePtr type; /* the predefined type */
33251    int n_type;
33252    xmlChar * value; /* the value to check */
33253    int n_value;
33254    xmlSchemaValPtr * val; /* the return computed value */
33255    int n_val;
33256    xmlNodePtr node; /* the node containing the value */
33257    int n_node;
33258
33259    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33260    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33261    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
33262    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33263        mem_base = xmlMemBlocks();
33264        type = gen_xmlSchemaTypePtr(n_type, 0);
33265        value = gen_const_xmlChar_ptr(n_value, 1);
33266        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
33267        node = gen_xmlNodePtr(n_node, 3);
33268
33269        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
33270        desret_int(ret_val);
33271        call_tests++;
33272        des_xmlSchemaTypePtr(n_type, type, 0);
33273        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33274        des_xmlSchemaValPtr_ptr(n_val, val, 2);
33275        des_xmlNodePtr(n_node, node, 3);
33276        xmlResetLastError();
33277        if (mem_base != xmlMemBlocks()) {
33278            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
33279	           xmlMemBlocks() - mem_base);
33280	    test_ret++;
33281            printf(" %d", n_type);
33282            printf(" %d", n_value);
33283            printf(" %d", n_val);
33284            printf(" %d", n_node);
33285            printf("\n");
33286        }
33287    }
33288    }
33289    }
33290    }
33291    function_tests++;
33292#endif
33293
33294    return(test_ret);
33295}
33296
33297
33298static int
33299test_xmlSchemaValPredefTypeNodeNoNorm(void) {
33300    int test_ret = 0;
33301
33302#if defined(LIBXML_SCHEMAS_ENABLED)
33303    int mem_base;
33304    int ret_val;
33305    xmlSchemaTypePtr type; /* the predefined type */
33306    int n_type;
33307    xmlChar * value; /* the value to check */
33308    int n_value;
33309    xmlSchemaValPtr * val; /* the return computed value */
33310    int n_val;
33311    xmlNodePtr node; /* the node containing the value */
33312    int n_node;
33313
33314    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33315    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33316    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
33317    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33318        mem_base = xmlMemBlocks();
33319        type = gen_xmlSchemaTypePtr(n_type, 0);
33320        value = gen_const_xmlChar_ptr(n_value, 1);
33321        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
33322        node = gen_xmlNodePtr(n_node, 3);
33323
33324        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
33325        desret_int(ret_val);
33326        call_tests++;
33327        des_xmlSchemaTypePtr(n_type, type, 0);
33328        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33329        des_xmlSchemaValPtr_ptr(n_val, val, 2);
33330        des_xmlNodePtr(n_node, node, 3);
33331        xmlResetLastError();
33332        if (mem_base != xmlMemBlocks()) {
33333            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
33334	           xmlMemBlocks() - mem_base);
33335	    test_ret++;
33336            printf(" %d", n_type);
33337            printf(" %d", n_value);
33338            printf(" %d", n_val);
33339            printf(" %d", n_node);
33340            printf("\n");
33341        }
33342    }
33343    }
33344    }
33345    }
33346    function_tests++;
33347#endif
33348
33349    return(test_ret);
33350}
33351
33352
33353static int
33354test_xmlSchemaValidateFacet(void) {
33355    int test_ret = 0;
33356
33357#if defined(LIBXML_SCHEMAS_ENABLED)
33358    int mem_base;
33359    int ret_val;
33360    xmlSchemaTypePtr base; /* the base type */
33361    int n_base;
33362    xmlSchemaFacetPtr facet; /* the facet to check */
33363    int n_facet;
33364    xmlChar * value; /* the lexical repr of the value to validate */
33365    int n_value;
33366    xmlSchemaValPtr val; /* the precomputed value */
33367    int n_val;
33368
33369    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
33370    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33371    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33372    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33373        mem_base = xmlMemBlocks();
33374        base = gen_xmlSchemaTypePtr(n_base, 0);
33375        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
33376        value = gen_const_xmlChar_ptr(n_value, 2);
33377        val = gen_xmlSchemaValPtr(n_val, 3);
33378
33379        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
33380        desret_int(ret_val);
33381        call_tests++;
33382        des_xmlSchemaTypePtr(n_base, base, 0);
33383        des_xmlSchemaFacetPtr(n_facet, facet, 1);
33384        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
33385        des_xmlSchemaValPtr(n_val, val, 3);
33386        xmlResetLastError();
33387        if (mem_base != xmlMemBlocks()) {
33388            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
33389	           xmlMemBlocks() - mem_base);
33390	    test_ret++;
33391            printf(" %d", n_base);
33392            printf(" %d", n_facet);
33393            printf(" %d", n_value);
33394            printf(" %d", n_val);
33395            printf("\n");
33396        }
33397    }
33398    }
33399    }
33400    }
33401    function_tests++;
33402#endif
33403
33404    return(test_ret);
33405}
33406
33407
33408static int
33409test_xmlSchemaValidateFacetWhtsp(void) {
33410    int test_ret = 0;
33411
33412#if defined(LIBXML_SCHEMAS_ENABLED)
33413    int mem_base;
33414    int ret_val;
33415    xmlSchemaFacetPtr facet; /* the facet to check */
33416    int n_facet;
33417    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
33418    int n_fws;
33419    xmlSchemaValType valType; /* the built-in type of the value */
33420    int n_valType;
33421    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
33422    int n_value;
33423    xmlSchemaValPtr val; /* the precomputed value */
33424    int n_val;
33425    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
33426    int n_ws;
33427
33428    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33429    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
33430    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
33431    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33432    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33433    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
33434        mem_base = xmlMemBlocks();
33435        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33436        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
33437        valType = gen_xmlSchemaValType(n_valType, 2);
33438        value = gen_const_xmlChar_ptr(n_value, 3);
33439        val = gen_xmlSchemaValPtr(n_val, 4);
33440        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
33441
33442        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
33443        desret_int(ret_val);
33444        call_tests++;
33445        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33446        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
33447        des_xmlSchemaValType(n_valType, valType, 2);
33448        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
33449        des_xmlSchemaValPtr(n_val, val, 4);
33450        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
33451        xmlResetLastError();
33452        if (mem_base != xmlMemBlocks()) {
33453            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
33454	           xmlMemBlocks() - mem_base);
33455	    test_ret++;
33456            printf(" %d", n_facet);
33457            printf(" %d", n_fws);
33458            printf(" %d", n_valType);
33459            printf(" %d", n_value);
33460            printf(" %d", n_val);
33461            printf(" %d", n_ws);
33462            printf("\n");
33463        }
33464    }
33465    }
33466    }
33467    }
33468    }
33469    }
33470    function_tests++;
33471#endif
33472
33473    return(test_ret);
33474}
33475
33476
33477static int
33478test_xmlSchemaValidateLengthFacet(void) {
33479    int test_ret = 0;
33480
33481#if defined(LIBXML_SCHEMAS_ENABLED)
33482    int mem_base;
33483    int ret_val;
33484    xmlSchemaTypePtr type; /* the built-in type */
33485    int n_type;
33486    xmlSchemaFacetPtr facet; /* the facet to check */
33487    int n_facet;
33488    xmlChar * value; /* the lexical repr. of the value to be validated */
33489    int n_value;
33490    xmlSchemaValPtr val; /* the precomputed value */
33491    int n_val;
33492    unsigned long * length; /* the actual length of the value */
33493    int n_length;
33494
33495    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33496    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33497    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33498    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33499    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
33500        mem_base = xmlMemBlocks();
33501        type = gen_xmlSchemaTypePtr(n_type, 0);
33502        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
33503        value = gen_const_xmlChar_ptr(n_value, 2);
33504        val = gen_xmlSchemaValPtr(n_val, 3);
33505        length = gen_unsigned_long_ptr(n_length, 4);
33506
33507        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
33508        desret_int(ret_val);
33509        call_tests++;
33510        des_xmlSchemaTypePtr(n_type, type, 0);
33511        des_xmlSchemaFacetPtr(n_facet, facet, 1);
33512        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
33513        des_xmlSchemaValPtr(n_val, val, 3);
33514        des_unsigned_long_ptr(n_length, length, 4);
33515        xmlResetLastError();
33516        if (mem_base != xmlMemBlocks()) {
33517            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
33518	           xmlMemBlocks() - mem_base);
33519	    test_ret++;
33520            printf(" %d", n_type);
33521            printf(" %d", n_facet);
33522            printf(" %d", n_value);
33523            printf(" %d", n_val);
33524            printf(" %d", n_length);
33525            printf("\n");
33526        }
33527    }
33528    }
33529    }
33530    }
33531    }
33532    function_tests++;
33533#endif
33534
33535    return(test_ret);
33536}
33537
33538
33539static int
33540test_xmlSchemaValidateLengthFacetWhtsp(void) {
33541    int test_ret = 0;
33542
33543#if defined(LIBXML_SCHEMAS_ENABLED)
33544    int mem_base;
33545    int ret_val;
33546    xmlSchemaFacetPtr facet; /* the facet to check */
33547    int n_facet;
33548    xmlSchemaValType valType; /* the built-in type */
33549    int n_valType;
33550    xmlChar * value; /* the lexical repr. of the value to be validated */
33551    int n_value;
33552    xmlSchemaValPtr val; /* the precomputed value */
33553    int n_val;
33554    unsigned long * length; /* the actual length of the value */
33555    int n_length;
33556    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
33557    int n_ws;
33558
33559    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33560    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
33561    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33562    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33563    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
33564    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
33565        mem_base = xmlMemBlocks();
33566        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33567        valType = gen_xmlSchemaValType(n_valType, 1);
33568        value = gen_const_xmlChar_ptr(n_value, 2);
33569        val = gen_xmlSchemaValPtr(n_val, 3);
33570        length = gen_unsigned_long_ptr(n_length, 4);
33571        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
33572
33573        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
33574        desret_int(ret_val);
33575        call_tests++;
33576        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33577        des_xmlSchemaValType(n_valType, valType, 1);
33578        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
33579        des_xmlSchemaValPtr(n_val, val, 3);
33580        des_unsigned_long_ptr(n_length, length, 4);
33581        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
33582        xmlResetLastError();
33583        if (mem_base != xmlMemBlocks()) {
33584            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
33585	           xmlMemBlocks() - mem_base);
33586	    test_ret++;
33587            printf(" %d", n_facet);
33588            printf(" %d", n_valType);
33589            printf(" %d", n_value);
33590            printf(" %d", n_val);
33591            printf(" %d", n_length);
33592            printf(" %d", n_ws);
33593            printf("\n");
33594        }
33595    }
33596    }
33597    }
33598    }
33599    }
33600    }
33601    function_tests++;
33602#endif
33603
33604    return(test_ret);
33605}
33606
33607
33608static int
33609test_xmlSchemaValidateListSimpleTypeFacet(void) {
33610    int test_ret = 0;
33611
33612#if defined(LIBXML_SCHEMAS_ENABLED)
33613    int mem_base;
33614    int ret_val;
33615    xmlSchemaFacetPtr facet; /* the facet to check */
33616    int n_facet;
33617    xmlChar * value; /* the lexical repr of the value to validate */
33618    int n_value;
33619    unsigned long actualLen; /* the number of list items */
33620    int n_actualLen;
33621    unsigned long * expectedLen; /* the resulting expected number of list items */
33622    int n_expectedLen;
33623
33624    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33625    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33626    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
33627    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
33628        mem_base = xmlMemBlocks();
33629        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33630        value = gen_const_xmlChar_ptr(n_value, 1);
33631        actualLen = gen_unsigned_long(n_actualLen, 2);
33632        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
33633
33634        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
33635        desret_int(ret_val);
33636        call_tests++;
33637        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33638        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33639        des_unsigned_long(n_actualLen, actualLen, 2);
33640        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
33641        xmlResetLastError();
33642        if (mem_base != xmlMemBlocks()) {
33643            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
33644	           xmlMemBlocks() - mem_base);
33645	    test_ret++;
33646            printf(" %d", n_facet);
33647            printf(" %d", n_value);
33648            printf(" %d", n_actualLen);
33649            printf(" %d", n_expectedLen);
33650            printf("\n");
33651        }
33652    }
33653    }
33654    }
33655    }
33656    function_tests++;
33657#endif
33658
33659    return(test_ret);
33660}
33661
33662
33663static int
33664test_xmlSchemaValidatePredefinedType(void) {
33665    int test_ret = 0;
33666
33667#if defined(LIBXML_SCHEMAS_ENABLED)
33668    int mem_base;
33669    int ret_val;
33670    xmlSchemaTypePtr type; /* the predefined type */
33671    int n_type;
33672    xmlChar * value; /* the value to check */
33673    int n_value;
33674    xmlSchemaValPtr * val; /* the return computed value */
33675    int n_val;
33676
33677    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33678    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33679    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
33680        mem_base = xmlMemBlocks();
33681        type = gen_xmlSchemaTypePtr(n_type, 0);
33682        value = gen_const_xmlChar_ptr(n_value, 1);
33683        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
33684
33685        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
33686        desret_int(ret_val);
33687        call_tests++;
33688        des_xmlSchemaTypePtr(n_type, type, 0);
33689        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33690        des_xmlSchemaValPtr_ptr(n_val, val, 2);
33691        xmlResetLastError();
33692        if (mem_base != xmlMemBlocks()) {
33693            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
33694	           xmlMemBlocks() - mem_base);
33695	    test_ret++;
33696            printf(" %d", n_type);
33697            printf(" %d", n_value);
33698            printf(" %d", n_val);
33699            printf("\n");
33700        }
33701    }
33702    }
33703    }
33704    function_tests++;
33705#endif
33706
33707    return(test_ret);
33708}
33709
33710
33711static int
33712test_xmlSchemaWhiteSpaceReplace(void) {
33713    int test_ret = 0;
33714
33715#if defined(LIBXML_SCHEMAS_ENABLED)
33716    int mem_base;
33717    xmlChar * ret_val;
33718    xmlChar * value; /* a value */
33719    int n_value;
33720
33721    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33722        mem_base = xmlMemBlocks();
33723        value = gen_const_xmlChar_ptr(n_value, 0);
33724
33725        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
33726        desret_xmlChar_ptr(ret_val);
33727        call_tests++;
33728        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
33729        xmlResetLastError();
33730        if (mem_base != xmlMemBlocks()) {
33731            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
33732	           xmlMemBlocks() - mem_base);
33733	    test_ret++;
33734            printf(" %d", n_value);
33735            printf("\n");
33736        }
33737    }
33738    function_tests++;
33739#endif
33740
33741    return(test_ret);
33742}
33743
33744static int
33745test_xmlschemastypes(void) {
33746    int test_ret = 0;
33747
33748    if (quiet == 0) printf("Testing xmlschemastypes : 23 of 29 functions ...\n");
33749    test_ret += test_xmlSchemaCheckFacet();
33750    test_ret += test_xmlSchemaCleanupTypes();
33751    test_ret += test_xmlSchemaCollapseString();
33752    test_ret += test_xmlSchemaCompareValues();
33753    test_ret += test_xmlSchemaCompareValuesWhtsp();
33754    test_ret += test_xmlSchemaCopyValue();
33755    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
33756    test_ret += test_xmlSchemaGetBuiltInType();
33757    test_ret += test_xmlSchemaGetCanonValue();
33758    test_ret += test_xmlSchemaGetCanonValueWhtsp();
33759    test_ret += test_xmlSchemaGetFacetValueAsULong();
33760    test_ret += test_xmlSchemaGetPredefinedType();
33761    test_ret += test_xmlSchemaGetValType();
33762    test_ret += test_xmlSchemaInitTypes();
33763    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
33764    test_ret += test_xmlSchemaNewFacet();
33765    test_ret += test_xmlSchemaNewNOTATIONValue();
33766    test_ret += test_xmlSchemaNewStringValue();
33767    test_ret += test_xmlSchemaValPredefTypeNode();
33768    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
33769    test_ret += test_xmlSchemaValidateFacet();
33770    test_ret += test_xmlSchemaValidateFacetWhtsp();
33771    test_ret += test_xmlSchemaValidateLengthFacet();
33772    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
33773    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
33774    test_ret += test_xmlSchemaValidatePredefinedType();
33775    test_ret += test_xmlSchemaWhiteSpaceReplace();
33776
33777    if (test_ret != 0)
33778	printf("Module xmlschemastypes: %d errors\n", test_ret);
33779    return(test_ret);
33780}
33781
33782static int
33783test_xmlCharStrdup(void) {
33784    int test_ret = 0;
33785
33786    int mem_base;
33787    xmlChar * ret_val;
33788    char * cur; /* the input char * */
33789    int n_cur;
33790
33791    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
33792        mem_base = xmlMemBlocks();
33793        cur = gen_const_char_ptr(n_cur, 0);
33794
33795        ret_val = xmlCharStrdup((const char *)cur);
33796        desret_xmlChar_ptr(ret_val);
33797        call_tests++;
33798        des_const_char_ptr(n_cur, (const char *)cur, 0);
33799        xmlResetLastError();
33800        if (mem_base != xmlMemBlocks()) {
33801            printf("Leak of %d blocks found in xmlCharStrdup",
33802	           xmlMemBlocks() - mem_base);
33803	    test_ret++;
33804            printf(" %d", n_cur);
33805            printf("\n");
33806        }
33807    }
33808    function_tests++;
33809
33810    return(test_ret);
33811}
33812
33813
33814static int
33815test_xmlCharStrndup(void) {
33816    int test_ret = 0;
33817
33818    int mem_base;
33819    xmlChar * ret_val;
33820    char * cur; /* the input char * */
33821    int n_cur;
33822    int len; /* the len of @cur */
33823    int n_len;
33824
33825    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
33826    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33827        mem_base = xmlMemBlocks();
33828        cur = gen_const_char_ptr(n_cur, 0);
33829        len = gen_int(n_len, 1);
33830
33831        ret_val = xmlCharStrndup((const char *)cur, len);
33832        desret_xmlChar_ptr(ret_val);
33833        call_tests++;
33834        des_const_char_ptr(n_cur, (const char *)cur, 0);
33835        des_int(n_len, len, 1);
33836        xmlResetLastError();
33837        if (mem_base != xmlMemBlocks()) {
33838            printf("Leak of %d blocks found in xmlCharStrndup",
33839	           xmlMemBlocks() - mem_base);
33840	    test_ret++;
33841            printf(" %d", n_cur);
33842            printf(" %d", n_len);
33843            printf("\n");
33844        }
33845    }
33846    }
33847    function_tests++;
33848
33849    return(test_ret);
33850}
33851
33852
33853static int
33854test_xmlCheckUTF8(void) {
33855    int test_ret = 0;
33856
33857    int mem_base;
33858    int ret_val;
33859    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
33860    int n_utf;
33861
33862    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
33863        mem_base = xmlMemBlocks();
33864        utf = gen_const_unsigned_char_ptr(n_utf, 0);
33865
33866        ret_val = xmlCheckUTF8((const unsigned char *)utf);
33867        desret_int(ret_val);
33868        call_tests++;
33869        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
33870        xmlResetLastError();
33871        if (mem_base != xmlMemBlocks()) {
33872            printf("Leak of %d blocks found in xmlCheckUTF8",
33873	           xmlMemBlocks() - mem_base);
33874	    test_ret++;
33875            printf(" %d", n_utf);
33876            printf("\n");
33877        }
33878    }
33879    function_tests++;
33880
33881    return(test_ret);
33882}
33883
33884
33885static int
33886test_xmlGetUTF8Char(void) {
33887    int test_ret = 0;
33888
33889    int mem_base;
33890    int ret_val;
33891    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
33892    int n_utf;
33893    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. */
33894    int n_len;
33895
33896    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
33897    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
33898        mem_base = xmlMemBlocks();
33899        utf = gen_const_unsigned_char_ptr(n_utf, 0);
33900        len = gen_int_ptr(n_len, 1);
33901
33902        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
33903        desret_int(ret_val);
33904        call_tests++;
33905        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
33906        des_int_ptr(n_len, len, 1);
33907        xmlResetLastError();
33908        if (mem_base != xmlMemBlocks()) {
33909            printf("Leak of %d blocks found in xmlGetUTF8Char",
33910	           xmlMemBlocks() - mem_base);
33911	    test_ret++;
33912            printf(" %d", n_utf);
33913            printf(" %d", n_len);
33914            printf("\n");
33915        }
33916    }
33917    }
33918    function_tests++;
33919
33920    return(test_ret);
33921}
33922
33923
33924static int
33925test_xmlStrEqual(void) {
33926    int test_ret = 0;
33927
33928    int mem_base;
33929    int ret_val;
33930    xmlChar * str1; /* the first xmlChar * */
33931    int n_str1;
33932    xmlChar * str2; /* the second xmlChar * */
33933    int n_str2;
33934
33935    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
33936    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
33937        mem_base = xmlMemBlocks();
33938        str1 = gen_const_xmlChar_ptr(n_str1, 0);
33939        str2 = gen_const_xmlChar_ptr(n_str2, 1);
33940
33941        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
33942        desret_int(ret_val);
33943        call_tests++;
33944        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
33945        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
33946        xmlResetLastError();
33947        if (mem_base != xmlMemBlocks()) {
33948            printf("Leak of %d blocks found in xmlStrEqual",
33949	           xmlMemBlocks() - mem_base);
33950	    test_ret++;
33951            printf(" %d", n_str1);
33952            printf(" %d", n_str2);
33953            printf("\n");
33954        }
33955    }
33956    }
33957    function_tests++;
33958
33959    return(test_ret);
33960}
33961
33962
33963static int
33964test_xmlStrPrintf(void) {
33965    int test_ret = 0;
33966
33967
33968    /* missing type support */
33969    return(test_ret);
33970}
33971
33972
33973static int
33974test_xmlStrQEqual(void) {
33975    int test_ret = 0;
33976
33977    int mem_base;
33978    int ret_val;
33979    xmlChar * pref; /* the prefix of the QName */
33980    int n_pref;
33981    xmlChar * name; /* the localname of the QName */
33982    int n_name;
33983    xmlChar * str; /* the second xmlChar * */
33984    int n_str;
33985
33986    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
33987    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
33988    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33989        mem_base = xmlMemBlocks();
33990        pref = gen_const_xmlChar_ptr(n_pref, 0);
33991        name = gen_const_xmlChar_ptr(n_name, 1);
33992        str = gen_const_xmlChar_ptr(n_str, 2);
33993
33994        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
33995        desret_int(ret_val);
33996        call_tests++;
33997        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
33998        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
33999        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
34000        xmlResetLastError();
34001        if (mem_base != xmlMemBlocks()) {
34002            printf("Leak of %d blocks found in xmlStrQEqual",
34003	           xmlMemBlocks() - mem_base);
34004	    test_ret++;
34005            printf(" %d", n_pref);
34006            printf(" %d", n_name);
34007            printf(" %d", n_str);
34008            printf("\n");
34009        }
34010    }
34011    }
34012    }
34013    function_tests++;
34014
34015    return(test_ret);
34016}
34017
34018
34019static int
34020test_xmlStrVPrintf(void) {
34021    int test_ret = 0;
34022
34023
34024    /* missing type support */
34025    return(test_ret);
34026}
34027
34028
34029static int
34030test_xmlStrcasecmp(void) {
34031    int test_ret = 0;
34032
34033    int mem_base;
34034    int ret_val;
34035    xmlChar * str1; /* the first xmlChar * */
34036    int n_str1;
34037    xmlChar * str2; /* the second xmlChar * */
34038    int n_str2;
34039
34040    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34041    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34042        mem_base = xmlMemBlocks();
34043        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34044        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34045
34046        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
34047        desret_int(ret_val);
34048        call_tests++;
34049        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34050        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34051        xmlResetLastError();
34052        if (mem_base != xmlMemBlocks()) {
34053            printf("Leak of %d blocks found in xmlStrcasecmp",
34054	           xmlMemBlocks() - mem_base);
34055	    test_ret++;
34056            printf(" %d", n_str1);
34057            printf(" %d", n_str2);
34058            printf("\n");
34059        }
34060    }
34061    }
34062    function_tests++;
34063
34064    return(test_ret);
34065}
34066
34067
34068static int
34069test_xmlStrcasestr(void) {
34070    int test_ret = 0;
34071
34072    int mem_base;
34073    const xmlChar * ret_val;
34074    xmlChar * str; /* the xmlChar * array (haystack) */
34075    int n_str;
34076    xmlChar * val; /* the xmlChar to search (needle) */
34077    int n_val;
34078
34079    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34080    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
34081        mem_base = xmlMemBlocks();
34082        str = gen_const_xmlChar_ptr(n_str, 0);
34083        val = gen_xmlChar_ptr(n_val, 1);
34084
34085        ret_val = xmlStrcasestr((const xmlChar *)str, val);
34086        desret_const_xmlChar_ptr(ret_val);
34087        call_tests++;
34088        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34089        des_xmlChar_ptr(n_val, val, 1);
34090        xmlResetLastError();
34091        if (mem_base != xmlMemBlocks()) {
34092            printf("Leak of %d blocks found in xmlStrcasestr",
34093	           xmlMemBlocks() - mem_base);
34094	    test_ret++;
34095            printf(" %d", n_str);
34096            printf(" %d", n_val);
34097            printf("\n");
34098        }
34099    }
34100    }
34101    function_tests++;
34102
34103    return(test_ret);
34104}
34105
34106
34107static int
34108test_xmlStrchr(void) {
34109    int test_ret = 0;
34110
34111    int mem_base;
34112    const xmlChar * ret_val;
34113    xmlChar * str; /* the xmlChar * array */
34114    int n_str;
34115    xmlChar val; /* the xmlChar to search */
34116    int n_val;
34117
34118    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34119    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
34120        mem_base = xmlMemBlocks();
34121        str = gen_const_xmlChar_ptr(n_str, 0);
34122        val = gen_xmlChar(n_val, 1);
34123
34124        ret_val = xmlStrchr((const xmlChar *)str, val);
34125        desret_const_xmlChar_ptr(ret_val);
34126        call_tests++;
34127        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34128        des_xmlChar(n_val, val, 1);
34129        xmlResetLastError();
34130        if (mem_base != xmlMemBlocks()) {
34131            printf("Leak of %d blocks found in xmlStrchr",
34132	           xmlMemBlocks() - mem_base);
34133	    test_ret++;
34134            printf(" %d", n_str);
34135            printf(" %d", n_val);
34136            printf("\n");
34137        }
34138    }
34139    }
34140    function_tests++;
34141
34142    return(test_ret);
34143}
34144
34145
34146static int
34147test_xmlStrcmp(void) {
34148    int test_ret = 0;
34149
34150    int mem_base;
34151    int ret_val;
34152    xmlChar * str1; /* the first xmlChar * */
34153    int n_str1;
34154    xmlChar * str2; /* the second xmlChar * */
34155    int n_str2;
34156
34157    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34158    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34159        mem_base = xmlMemBlocks();
34160        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34161        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34162
34163        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
34164        desret_int(ret_val);
34165        call_tests++;
34166        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34167        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34168        xmlResetLastError();
34169        if (mem_base != xmlMemBlocks()) {
34170            printf("Leak of %d blocks found in xmlStrcmp",
34171	           xmlMemBlocks() - mem_base);
34172	    test_ret++;
34173            printf(" %d", n_str1);
34174            printf(" %d", n_str2);
34175            printf("\n");
34176        }
34177    }
34178    }
34179    function_tests++;
34180
34181    return(test_ret);
34182}
34183
34184
34185static int
34186test_xmlStrdup(void) {
34187    int test_ret = 0;
34188
34189    int mem_base;
34190    xmlChar * ret_val;
34191    xmlChar * cur; /* the input xmlChar * */
34192    int n_cur;
34193
34194    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
34195        mem_base = xmlMemBlocks();
34196        cur = gen_const_xmlChar_ptr(n_cur, 0);
34197
34198        ret_val = xmlStrdup((const xmlChar *)cur);
34199        desret_xmlChar_ptr(ret_val);
34200        call_tests++;
34201        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
34202        xmlResetLastError();
34203        if (mem_base != xmlMemBlocks()) {
34204            printf("Leak of %d blocks found in xmlStrdup",
34205	           xmlMemBlocks() - mem_base);
34206	    test_ret++;
34207            printf(" %d", n_cur);
34208            printf("\n");
34209        }
34210    }
34211    function_tests++;
34212
34213    return(test_ret);
34214}
34215
34216
34217static int
34218test_xmlStrlen(void) {
34219    int test_ret = 0;
34220
34221    int mem_base;
34222    int ret_val;
34223    xmlChar * str; /* the xmlChar * array */
34224    int n_str;
34225
34226    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34227        mem_base = xmlMemBlocks();
34228        str = gen_const_xmlChar_ptr(n_str, 0);
34229
34230        ret_val = xmlStrlen((const xmlChar *)str);
34231        desret_int(ret_val);
34232        call_tests++;
34233        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34234        xmlResetLastError();
34235        if (mem_base != xmlMemBlocks()) {
34236            printf("Leak of %d blocks found in xmlStrlen",
34237	           xmlMemBlocks() - mem_base);
34238	    test_ret++;
34239            printf(" %d", n_str);
34240            printf("\n");
34241        }
34242    }
34243    function_tests++;
34244
34245    return(test_ret);
34246}
34247
34248
34249static int
34250test_xmlStrncasecmp(void) {
34251    int test_ret = 0;
34252
34253    int mem_base;
34254    int ret_val;
34255    xmlChar * str1; /* the first xmlChar * */
34256    int n_str1;
34257    xmlChar * str2; /* the second xmlChar * */
34258    int n_str2;
34259    int len; /* the max comparison length */
34260    int n_len;
34261
34262    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34263    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34264    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34265        mem_base = xmlMemBlocks();
34266        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34267        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34268        len = gen_int(n_len, 2);
34269
34270        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
34271        desret_int(ret_val);
34272        call_tests++;
34273        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34274        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34275        des_int(n_len, len, 2);
34276        xmlResetLastError();
34277        if (mem_base != xmlMemBlocks()) {
34278            printf("Leak of %d blocks found in xmlStrncasecmp",
34279	           xmlMemBlocks() - mem_base);
34280	    test_ret++;
34281            printf(" %d", n_str1);
34282            printf(" %d", n_str2);
34283            printf(" %d", n_len);
34284            printf("\n");
34285        }
34286    }
34287    }
34288    }
34289    function_tests++;
34290
34291    return(test_ret);
34292}
34293
34294
34295static int
34296test_xmlStrncatNew(void) {
34297    int test_ret = 0;
34298
34299    int mem_base;
34300    xmlChar * ret_val;
34301    xmlChar * str1; /* first xmlChar string */
34302    int n_str1;
34303    xmlChar * str2; /* second xmlChar string */
34304    int n_str2;
34305    int len; /* the len of @str2 */
34306    int n_len;
34307
34308    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34309    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34310    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34311        mem_base = xmlMemBlocks();
34312        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34313        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34314        len = gen_int(n_len, 2);
34315
34316        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
34317        desret_xmlChar_ptr(ret_val);
34318        call_tests++;
34319        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34320        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34321        des_int(n_len, len, 2);
34322        xmlResetLastError();
34323        if (mem_base != xmlMemBlocks()) {
34324            printf("Leak of %d blocks found in xmlStrncatNew",
34325	           xmlMemBlocks() - mem_base);
34326	    test_ret++;
34327            printf(" %d", n_str1);
34328            printf(" %d", n_str2);
34329            printf(" %d", n_len);
34330            printf("\n");
34331        }
34332    }
34333    }
34334    }
34335    function_tests++;
34336
34337    return(test_ret);
34338}
34339
34340
34341static int
34342test_xmlStrncmp(void) {
34343    int test_ret = 0;
34344
34345    int mem_base;
34346    int ret_val;
34347    xmlChar * str1; /* the first xmlChar * */
34348    int n_str1;
34349    xmlChar * str2; /* the second xmlChar * */
34350    int n_str2;
34351    int len; /* the max comparison length */
34352    int n_len;
34353
34354    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34355    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34356    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34357        mem_base = xmlMemBlocks();
34358        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34359        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34360        len = gen_int(n_len, 2);
34361
34362        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
34363        desret_int(ret_val);
34364        call_tests++;
34365        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34366        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34367        des_int(n_len, len, 2);
34368        xmlResetLastError();
34369        if (mem_base != xmlMemBlocks()) {
34370            printf("Leak of %d blocks found in xmlStrncmp",
34371	           xmlMemBlocks() - mem_base);
34372	    test_ret++;
34373            printf(" %d", n_str1);
34374            printf(" %d", n_str2);
34375            printf(" %d", n_len);
34376            printf("\n");
34377        }
34378    }
34379    }
34380    }
34381    function_tests++;
34382
34383    return(test_ret);
34384}
34385
34386
34387static int
34388test_xmlStrndup(void) {
34389    int test_ret = 0;
34390
34391    int mem_base;
34392    xmlChar * ret_val;
34393    xmlChar * cur; /* the input xmlChar * */
34394    int n_cur;
34395    int len; /* the len of @cur */
34396    int n_len;
34397
34398    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
34399    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34400        mem_base = xmlMemBlocks();
34401        cur = gen_const_xmlChar_ptr(n_cur, 0);
34402        len = gen_int(n_len, 1);
34403
34404        ret_val = xmlStrndup((const xmlChar *)cur, len);
34405        desret_xmlChar_ptr(ret_val);
34406        call_tests++;
34407        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
34408        des_int(n_len, len, 1);
34409        xmlResetLastError();
34410        if (mem_base != xmlMemBlocks()) {
34411            printf("Leak of %d blocks found in xmlStrndup",
34412	           xmlMemBlocks() - mem_base);
34413	    test_ret++;
34414            printf(" %d", n_cur);
34415            printf(" %d", n_len);
34416            printf("\n");
34417        }
34418    }
34419    }
34420    function_tests++;
34421
34422    return(test_ret);
34423}
34424
34425
34426static int
34427test_xmlStrstr(void) {
34428    int test_ret = 0;
34429
34430    int mem_base;
34431    const xmlChar * ret_val;
34432    xmlChar * str; /* the xmlChar * array (haystack) */
34433    int n_str;
34434    xmlChar * val; /* the xmlChar to search (needle) */
34435    int n_val;
34436
34437    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34438    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
34439        mem_base = xmlMemBlocks();
34440        str = gen_const_xmlChar_ptr(n_str, 0);
34441        val = gen_const_xmlChar_ptr(n_val, 1);
34442
34443        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
34444        desret_const_xmlChar_ptr(ret_val);
34445        call_tests++;
34446        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34447        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
34448        xmlResetLastError();
34449        if (mem_base != xmlMemBlocks()) {
34450            printf("Leak of %d blocks found in xmlStrstr",
34451	           xmlMemBlocks() - mem_base);
34452	    test_ret++;
34453            printf(" %d", n_str);
34454            printf(" %d", n_val);
34455            printf("\n");
34456        }
34457    }
34458    }
34459    function_tests++;
34460
34461    return(test_ret);
34462}
34463
34464
34465static int
34466test_xmlStrsub(void) {
34467    int test_ret = 0;
34468
34469    int mem_base;
34470    xmlChar * ret_val;
34471    xmlChar * str; /* the xmlChar * array (haystack) */
34472    int n_str;
34473    int start; /* the index of the first char (zero based) */
34474    int n_start;
34475    int len; /* the length of the substring */
34476    int n_len;
34477
34478    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34479    for (n_start = 0;n_start < gen_nb_int;n_start++) {
34480    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34481        mem_base = xmlMemBlocks();
34482        str = gen_const_xmlChar_ptr(n_str, 0);
34483        start = gen_int(n_start, 1);
34484        len = gen_int(n_len, 2);
34485
34486        ret_val = xmlStrsub((const xmlChar *)str, start, len);
34487        desret_xmlChar_ptr(ret_val);
34488        call_tests++;
34489        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34490        des_int(n_start, start, 1);
34491        des_int(n_len, len, 2);
34492        xmlResetLastError();
34493        if (mem_base != xmlMemBlocks()) {
34494            printf("Leak of %d blocks found in xmlStrsub",
34495	           xmlMemBlocks() - mem_base);
34496	    test_ret++;
34497            printf(" %d", n_str);
34498            printf(" %d", n_start);
34499            printf(" %d", n_len);
34500            printf("\n");
34501        }
34502    }
34503    }
34504    }
34505    function_tests++;
34506
34507    return(test_ret);
34508}
34509
34510
34511static int
34512test_xmlUTF8Charcmp(void) {
34513    int test_ret = 0;
34514
34515    int mem_base;
34516    int ret_val;
34517    xmlChar * utf1; /* pointer to first UTF8 char */
34518    int n_utf1;
34519    xmlChar * utf2; /* pointer to second UTF8 char */
34520    int n_utf2;
34521
34522    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
34523    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
34524        mem_base = xmlMemBlocks();
34525        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
34526        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
34527
34528        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
34529        desret_int(ret_val);
34530        call_tests++;
34531        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
34532        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
34533        xmlResetLastError();
34534        if (mem_base != xmlMemBlocks()) {
34535            printf("Leak of %d blocks found in xmlUTF8Charcmp",
34536	           xmlMemBlocks() - mem_base);
34537	    test_ret++;
34538            printf(" %d", n_utf1);
34539            printf(" %d", n_utf2);
34540            printf("\n");
34541        }
34542    }
34543    }
34544    function_tests++;
34545
34546    return(test_ret);
34547}
34548
34549
34550static int
34551test_xmlUTF8Size(void) {
34552    int test_ret = 0;
34553
34554    int mem_base;
34555    int ret_val;
34556    xmlChar * utf; /* pointer to the UTF8 character */
34557    int n_utf;
34558
34559    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34560        mem_base = xmlMemBlocks();
34561        utf = gen_const_xmlChar_ptr(n_utf, 0);
34562
34563        ret_val = xmlUTF8Size((const xmlChar *)utf);
34564        desret_int(ret_val);
34565        call_tests++;
34566        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34567        xmlResetLastError();
34568        if (mem_base != xmlMemBlocks()) {
34569            printf("Leak of %d blocks found in xmlUTF8Size",
34570	           xmlMemBlocks() - mem_base);
34571	    test_ret++;
34572            printf(" %d", n_utf);
34573            printf("\n");
34574        }
34575    }
34576    function_tests++;
34577
34578    return(test_ret);
34579}
34580
34581
34582static int
34583test_xmlUTF8Strlen(void) {
34584    int test_ret = 0;
34585
34586    int mem_base;
34587    int ret_val;
34588    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
34589    int n_utf;
34590
34591    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34592        mem_base = xmlMemBlocks();
34593        utf = gen_const_xmlChar_ptr(n_utf, 0);
34594
34595        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
34596        desret_int(ret_val);
34597        call_tests++;
34598        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34599        xmlResetLastError();
34600        if (mem_base != xmlMemBlocks()) {
34601            printf("Leak of %d blocks found in xmlUTF8Strlen",
34602	           xmlMemBlocks() - mem_base);
34603	    test_ret++;
34604            printf(" %d", n_utf);
34605            printf("\n");
34606        }
34607    }
34608    function_tests++;
34609
34610    return(test_ret);
34611}
34612
34613
34614static int
34615test_xmlUTF8Strloc(void) {
34616    int test_ret = 0;
34617
34618    int mem_base;
34619    int ret_val;
34620    xmlChar * utf; /* the input UTF8 * */
34621    int n_utf;
34622    xmlChar * utfchar; /* the UTF8 character to be found */
34623    int n_utfchar;
34624
34625    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34626    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
34627        mem_base = xmlMemBlocks();
34628        utf = gen_const_xmlChar_ptr(n_utf, 0);
34629        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
34630
34631        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
34632        desret_int(ret_val);
34633        call_tests++;
34634        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34635        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
34636        xmlResetLastError();
34637        if (mem_base != xmlMemBlocks()) {
34638            printf("Leak of %d blocks found in xmlUTF8Strloc",
34639	           xmlMemBlocks() - mem_base);
34640	    test_ret++;
34641            printf(" %d", n_utf);
34642            printf(" %d", n_utfchar);
34643            printf("\n");
34644        }
34645    }
34646    }
34647    function_tests++;
34648
34649    return(test_ret);
34650}
34651
34652
34653static int
34654test_xmlUTF8Strndup(void) {
34655    int test_ret = 0;
34656
34657    int mem_base;
34658    xmlChar * ret_val;
34659    xmlChar * utf; /* the input UTF8 * */
34660    int n_utf;
34661    int len; /* the len of @utf (in chars) */
34662    int n_len;
34663
34664    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34665    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34666        mem_base = xmlMemBlocks();
34667        utf = gen_const_xmlChar_ptr(n_utf, 0);
34668        len = gen_int(n_len, 1);
34669
34670        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
34671        desret_xmlChar_ptr(ret_val);
34672        call_tests++;
34673        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34674        des_int(n_len, len, 1);
34675        xmlResetLastError();
34676        if (mem_base != xmlMemBlocks()) {
34677            printf("Leak of %d blocks found in xmlUTF8Strndup",
34678	           xmlMemBlocks() - mem_base);
34679	    test_ret++;
34680            printf(" %d", n_utf);
34681            printf(" %d", n_len);
34682            printf("\n");
34683        }
34684    }
34685    }
34686    function_tests++;
34687
34688    return(test_ret);
34689}
34690
34691
34692static int
34693test_xmlUTF8Strpos(void) {
34694    int test_ret = 0;
34695
34696    int mem_base;
34697    const xmlChar * ret_val;
34698    xmlChar * utf; /* the input UTF8 * */
34699    int n_utf;
34700    int pos; /* the position of the desired UTF8 char (in chars) */
34701    int n_pos;
34702
34703    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34704    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
34705        mem_base = xmlMemBlocks();
34706        utf = gen_const_xmlChar_ptr(n_utf, 0);
34707        pos = gen_int(n_pos, 1);
34708
34709        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
34710        desret_const_xmlChar_ptr(ret_val);
34711        call_tests++;
34712        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34713        des_int(n_pos, pos, 1);
34714        xmlResetLastError();
34715        if (mem_base != xmlMemBlocks()) {
34716            printf("Leak of %d blocks found in xmlUTF8Strpos",
34717	           xmlMemBlocks() - mem_base);
34718	    test_ret++;
34719            printf(" %d", n_utf);
34720            printf(" %d", n_pos);
34721            printf("\n");
34722        }
34723    }
34724    }
34725    function_tests++;
34726
34727    return(test_ret);
34728}
34729
34730
34731static int
34732test_xmlUTF8Strsize(void) {
34733    int test_ret = 0;
34734
34735    int mem_base;
34736    int ret_val;
34737    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
34738    int n_utf;
34739    int len; /* the number of characters in the array */
34740    int n_len;
34741
34742    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34743    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34744        mem_base = xmlMemBlocks();
34745        utf = gen_const_xmlChar_ptr(n_utf, 0);
34746        len = gen_int(n_len, 1);
34747
34748        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
34749        desret_int(ret_val);
34750        call_tests++;
34751        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34752        des_int(n_len, len, 1);
34753        xmlResetLastError();
34754        if (mem_base != xmlMemBlocks()) {
34755            printf("Leak of %d blocks found in xmlUTF8Strsize",
34756	           xmlMemBlocks() - mem_base);
34757	    test_ret++;
34758            printf(" %d", n_utf);
34759            printf(" %d", n_len);
34760            printf("\n");
34761        }
34762    }
34763    }
34764    function_tests++;
34765
34766    return(test_ret);
34767}
34768
34769
34770static int
34771test_xmlUTF8Strsub(void) {
34772    int test_ret = 0;
34773
34774    int mem_base;
34775    xmlChar * ret_val;
34776    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
34777    int n_utf;
34778    int start; /* relative pos of first char */
34779    int n_start;
34780    int len; /* total number to copy */
34781    int n_len;
34782
34783    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34784    for (n_start = 0;n_start < gen_nb_int;n_start++) {
34785    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34786        mem_base = xmlMemBlocks();
34787        utf = gen_const_xmlChar_ptr(n_utf, 0);
34788        start = gen_int(n_start, 1);
34789        len = gen_int(n_len, 2);
34790
34791        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
34792        desret_xmlChar_ptr(ret_val);
34793        call_tests++;
34794        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34795        des_int(n_start, start, 1);
34796        des_int(n_len, len, 2);
34797        xmlResetLastError();
34798        if (mem_base != xmlMemBlocks()) {
34799            printf("Leak of %d blocks found in xmlUTF8Strsub",
34800	           xmlMemBlocks() - mem_base);
34801	    test_ret++;
34802            printf(" %d", n_utf);
34803            printf(" %d", n_start);
34804            printf(" %d", n_len);
34805            printf("\n");
34806        }
34807    }
34808    }
34809    }
34810    function_tests++;
34811
34812    return(test_ret);
34813}
34814
34815static int
34816test_xmlstring(void) {
34817    int test_ret = 0;
34818
34819    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
34820    test_ret += test_xmlCharStrdup();
34821    test_ret += test_xmlCharStrndup();
34822    test_ret += test_xmlCheckUTF8();
34823    test_ret += test_xmlGetUTF8Char();
34824    test_ret += test_xmlStrEqual();
34825    test_ret += test_xmlStrPrintf();
34826    test_ret += test_xmlStrQEqual();
34827    test_ret += test_xmlStrVPrintf();
34828    test_ret += test_xmlStrcasecmp();
34829    test_ret += test_xmlStrcasestr();
34830    test_ret += test_xmlStrchr();
34831    test_ret += test_xmlStrcmp();
34832    test_ret += test_xmlStrdup();
34833    test_ret += test_xmlStrlen();
34834    test_ret += test_xmlStrncasecmp();
34835    test_ret += test_xmlStrncatNew();
34836    test_ret += test_xmlStrncmp();
34837    test_ret += test_xmlStrndup();
34838    test_ret += test_xmlStrstr();
34839    test_ret += test_xmlStrsub();
34840    test_ret += test_xmlUTF8Charcmp();
34841    test_ret += test_xmlUTF8Size();
34842    test_ret += test_xmlUTF8Strlen();
34843    test_ret += test_xmlUTF8Strloc();
34844    test_ret += test_xmlUTF8Strndup();
34845    test_ret += test_xmlUTF8Strpos();
34846    test_ret += test_xmlUTF8Strsize();
34847    test_ret += test_xmlUTF8Strsub();
34848
34849    if (test_ret != 0)
34850	printf("Module xmlstring: %d errors\n", test_ret);
34851    return(test_ret);
34852}
34853
34854static int
34855test_xmlUCSIsAegeanNumbers(void) {
34856    int test_ret = 0;
34857
34858#if defined(LIBXML_UNICODE_ENABLED)
34859    int mem_base;
34860    int ret_val;
34861    int code; /* UCS code point */
34862    int n_code;
34863
34864    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34865        mem_base = xmlMemBlocks();
34866        code = gen_int(n_code, 0);
34867
34868        ret_val = xmlUCSIsAegeanNumbers(code);
34869        desret_int(ret_val);
34870        call_tests++;
34871        des_int(n_code, code, 0);
34872        xmlResetLastError();
34873        if (mem_base != xmlMemBlocks()) {
34874            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
34875	           xmlMemBlocks() - mem_base);
34876	    test_ret++;
34877            printf(" %d", n_code);
34878            printf("\n");
34879        }
34880    }
34881    function_tests++;
34882#endif
34883
34884    return(test_ret);
34885}
34886
34887
34888static int
34889test_xmlUCSIsAlphabeticPresentationForms(void) {
34890    int test_ret = 0;
34891
34892#if defined(LIBXML_UNICODE_ENABLED)
34893    int mem_base;
34894    int ret_val;
34895    int code; /* UCS code point */
34896    int n_code;
34897
34898    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34899        mem_base = xmlMemBlocks();
34900        code = gen_int(n_code, 0);
34901
34902        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
34903        desret_int(ret_val);
34904        call_tests++;
34905        des_int(n_code, code, 0);
34906        xmlResetLastError();
34907        if (mem_base != xmlMemBlocks()) {
34908            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
34909	           xmlMemBlocks() - mem_base);
34910	    test_ret++;
34911            printf(" %d", n_code);
34912            printf("\n");
34913        }
34914    }
34915    function_tests++;
34916#endif
34917
34918    return(test_ret);
34919}
34920
34921
34922static int
34923test_xmlUCSIsArabic(void) {
34924    int test_ret = 0;
34925
34926#if defined(LIBXML_UNICODE_ENABLED)
34927    int mem_base;
34928    int ret_val;
34929    int code; /* UCS code point */
34930    int n_code;
34931
34932    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34933        mem_base = xmlMemBlocks();
34934        code = gen_int(n_code, 0);
34935
34936        ret_val = xmlUCSIsArabic(code);
34937        desret_int(ret_val);
34938        call_tests++;
34939        des_int(n_code, code, 0);
34940        xmlResetLastError();
34941        if (mem_base != xmlMemBlocks()) {
34942            printf("Leak of %d blocks found in xmlUCSIsArabic",
34943	           xmlMemBlocks() - mem_base);
34944	    test_ret++;
34945            printf(" %d", n_code);
34946            printf("\n");
34947        }
34948    }
34949    function_tests++;
34950#endif
34951
34952    return(test_ret);
34953}
34954
34955
34956static int
34957test_xmlUCSIsArabicPresentationFormsA(void) {
34958    int test_ret = 0;
34959
34960#if defined(LIBXML_UNICODE_ENABLED)
34961    int mem_base;
34962    int ret_val;
34963    int code; /* UCS code point */
34964    int n_code;
34965
34966    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34967        mem_base = xmlMemBlocks();
34968        code = gen_int(n_code, 0);
34969
34970        ret_val = xmlUCSIsArabicPresentationFormsA(code);
34971        desret_int(ret_val);
34972        call_tests++;
34973        des_int(n_code, code, 0);
34974        xmlResetLastError();
34975        if (mem_base != xmlMemBlocks()) {
34976            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
34977	           xmlMemBlocks() - mem_base);
34978	    test_ret++;
34979            printf(" %d", n_code);
34980            printf("\n");
34981        }
34982    }
34983    function_tests++;
34984#endif
34985
34986    return(test_ret);
34987}
34988
34989
34990static int
34991test_xmlUCSIsArabicPresentationFormsB(void) {
34992    int test_ret = 0;
34993
34994#if defined(LIBXML_UNICODE_ENABLED)
34995    int mem_base;
34996    int ret_val;
34997    int code; /* UCS code point */
34998    int n_code;
34999
35000    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35001        mem_base = xmlMemBlocks();
35002        code = gen_int(n_code, 0);
35003
35004        ret_val = xmlUCSIsArabicPresentationFormsB(code);
35005        desret_int(ret_val);
35006        call_tests++;
35007        des_int(n_code, code, 0);
35008        xmlResetLastError();
35009        if (mem_base != xmlMemBlocks()) {
35010            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
35011	           xmlMemBlocks() - mem_base);
35012	    test_ret++;
35013            printf(" %d", n_code);
35014            printf("\n");
35015        }
35016    }
35017    function_tests++;
35018#endif
35019
35020    return(test_ret);
35021}
35022
35023
35024static int
35025test_xmlUCSIsArmenian(void) {
35026    int test_ret = 0;
35027
35028#if defined(LIBXML_UNICODE_ENABLED)
35029    int mem_base;
35030    int ret_val;
35031    int code; /* UCS code point */
35032    int n_code;
35033
35034    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35035        mem_base = xmlMemBlocks();
35036        code = gen_int(n_code, 0);
35037
35038        ret_val = xmlUCSIsArmenian(code);
35039        desret_int(ret_val);
35040        call_tests++;
35041        des_int(n_code, code, 0);
35042        xmlResetLastError();
35043        if (mem_base != xmlMemBlocks()) {
35044            printf("Leak of %d blocks found in xmlUCSIsArmenian",
35045	           xmlMemBlocks() - mem_base);
35046	    test_ret++;
35047            printf(" %d", n_code);
35048            printf("\n");
35049        }
35050    }
35051    function_tests++;
35052#endif
35053
35054    return(test_ret);
35055}
35056
35057
35058static int
35059test_xmlUCSIsArrows(void) {
35060    int test_ret = 0;
35061
35062#if defined(LIBXML_UNICODE_ENABLED)
35063    int mem_base;
35064    int ret_val;
35065    int code; /* UCS code point */
35066    int n_code;
35067
35068    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35069        mem_base = xmlMemBlocks();
35070        code = gen_int(n_code, 0);
35071
35072        ret_val = xmlUCSIsArrows(code);
35073        desret_int(ret_val);
35074        call_tests++;
35075        des_int(n_code, code, 0);
35076        xmlResetLastError();
35077        if (mem_base != xmlMemBlocks()) {
35078            printf("Leak of %d blocks found in xmlUCSIsArrows",
35079	           xmlMemBlocks() - mem_base);
35080	    test_ret++;
35081            printf(" %d", n_code);
35082            printf("\n");
35083        }
35084    }
35085    function_tests++;
35086#endif
35087
35088    return(test_ret);
35089}
35090
35091
35092static int
35093test_xmlUCSIsBasicLatin(void) {
35094    int test_ret = 0;
35095
35096#if defined(LIBXML_UNICODE_ENABLED)
35097    int mem_base;
35098    int ret_val;
35099    int code; /* UCS code point */
35100    int n_code;
35101
35102    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35103        mem_base = xmlMemBlocks();
35104        code = gen_int(n_code, 0);
35105
35106        ret_val = xmlUCSIsBasicLatin(code);
35107        desret_int(ret_val);
35108        call_tests++;
35109        des_int(n_code, code, 0);
35110        xmlResetLastError();
35111        if (mem_base != xmlMemBlocks()) {
35112            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
35113	           xmlMemBlocks() - mem_base);
35114	    test_ret++;
35115            printf(" %d", n_code);
35116            printf("\n");
35117        }
35118    }
35119    function_tests++;
35120#endif
35121
35122    return(test_ret);
35123}
35124
35125
35126static int
35127test_xmlUCSIsBengali(void) {
35128    int test_ret = 0;
35129
35130#if defined(LIBXML_UNICODE_ENABLED)
35131    int mem_base;
35132    int ret_val;
35133    int code; /* UCS code point */
35134    int n_code;
35135
35136    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35137        mem_base = xmlMemBlocks();
35138        code = gen_int(n_code, 0);
35139
35140        ret_val = xmlUCSIsBengali(code);
35141        desret_int(ret_val);
35142        call_tests++;
35143        des_int(n_code, code, 0);
35144        xmlResetLastError();
35145        if (mem_base != xmlMemBlocks()) {
35146            printf("Leak of %d blocks found in xmlUCSIsBengali",
35147	           xmlMemBlocks() - mem_base);
35148	    test_ret++;
35149            printf(" %d", n_code);
35150            printf("\n");
35151        }
35152    }
35153    function_tests++;
35154#endif
35155
35156    return(test_ret);
35157}
35158
35159
35160static int
35161test_xmlUCSIsBlock(void) {
35162    int test_ret = 0;
35163
35164#if defined(LIBXML_UNICODE_ENABLED)
35165    int mem_base;
35166    int ret_val;
35167    int code; /* UCS code point */
35168    int n_code;
35169    char * block; /* UCS block name */
35170    int n_block;
35171
35172    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35173    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
35174        mem_base = xmlMemBlocks();
35175        code = gen_int(n_code, 0);
35176        block = gen_const_char_ptr(n_block, 1);
35177
35178        ret_val = xmlUCSIsBlock(code, (const char *)block);
35179        desret_int(ret_val);
35180        call_tests++;
35181        des_int(n_code, code, 0);
35182        des_const_char_ptr(n_block, (const char *)block, 1);
35183        xmlResetLastError();
35184        if (mem_base != xmlMemBlocks()) {
35185            printf("Leak of %d blocks found in xmlUCSIsBlock",
35186	           xmlMemBlocks() - mem_base);
35187	    test_ret++;
35188            printf(" %d", n_code);
35189            printf(" %d", n_block);
35190            printf("\n");
35191        }
35192    }
35193    }
35194    function_tests++;
35195#endif
35196
35197    return(test_ret);
35198}
35199
35200
35201static int
35202test_xmlUCSIsBlockElements(void) {
35203    int test_ret = 0;
35204
35205#if defined(LIBXML_UNICODE_ENABLED)
35206    int mem_base;
35207    int ret_val;
35208    int code; /* UCS code point */
35209    int n_code;
35210
35211    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35212        mem_base = xmlMemBlocks();
35213        code = gen_int(n_code, 0);
35214
35215        ret_val = xmlUCSIsBlockElements(code);
35216        desret_int(ret_val);
35217        call_tests++;
35218        des_int(n_code, code, 0);
35219        xmlResetLastError();
35220        if (mem_base != xmlMemBlocks()) {
35221            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
35222	           xmlMemBlocks() - mem_base);
35223	    test_ret++;
35224            printf(" %d", n_code);
35225            printf("\n");
35226        }
35227    }
35228    function_tests++;
35229#endif
35230
35231    return(test_ret);
35232}
35233
35234
35235static int
35236test_xmlUCSIsBopomofo(void) {
35237    int test_ret = 0;
35238
35239#if defined(LIBXML_UNICODE_ENABLED)
35240    int mem_base;
35241    int ret_val;
35242    int code; /* UCS code point */
35243    int n_code;
35244
35245    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35246        mem_base = xmlMemBlocks();
35247        code = gen_int(n_code, 0);
35248
35249        ret_val = xmlUCSIsBopomofo(code);
35250        desret_int(ret_val);
35251        call_tests++;
35252        des_int(n_code, code, 0);
35253        xmlResetLastError();
35254        if (mem_base != xmlMemBlocks()) {
35255            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
35256	           xmlMemBlocks() - mem_base);
35257	    test_ret++;
35258            printf(" %d", n_code);
35259            printf("\n");
35260        }
35261    }
35262    function_tests++;
35263#endif
35264
35265    return(test_ret);
35266}
35267
35268
35269static int
35270test_xmlUCSIsBopomofoExtended(void) {
35271    int test_ret = 0;
35272
35273#if defined(LIBXML_UNICODE_ENABLED)
35274    int mem_base;
35275    int ret_val;
35276    int code; /* UCS code point */
35277    int n_code;
35278
35279    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35280        mem_base = xmlMemBlocks();
35281        code = gen_int(n_code, 0);
35282
35283        ret_val = xmlUCSIsBopomofoExtended(code);
35284        desret_int(ret_val);
35285        call_tests++;
35286        des_int(n_code, code, 0);
35287        xmlResetLastError();
35288        if (mem_base != xmlMemBlocks()) {
35289            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
35290	           xmlMemBlocks() - mem_base);
35291	    test_ret++;
35292            printf(" %d", n_code);
35293            printf("\n");
35294        }
35295    }
35296    function_tests++;
35297#endif
35298
35299    return(test_ret);
35300}
35301
35302
35303static int
35304test_xmlUCSIsBoxDrawing(void) {
35305    int test_ret = 0;
35306
35307#if defined(LIBXML_UNICODE_ENABLED)
35308    int mem_base;
35309    int ret_val;
35310    int code; /* UCS code point */
35311    int n_code;
35312
35313    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35314        mem_base = xmlMemBlocks();
35315        code = gen_int(n_code, 0);
35316
35317        ret_val = xmlUCSIsBoxDrawing(code);
35318        desret_int(ret_val);
35319        call_tests++;
35320        des_int(n_code, code, 0);
35321        xmlResetLastError();
35322        if (mem_base != xmlMemBlocks()) {
35323            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
35324	           xmlMemBlocks() - mem_base);
35325	    test_ret++;
35326            printf(" %d", n_code);
35327            printf("\n");
35328        }
35329    }
35330    function_tests++;
35331#endif
35332
35333    return(test_ret);
35334}
35335
35336
35337static int
35338test_xmlUCSIsBraillePatterns(void) {
35339    int test_ret = 0;
35340
35341#if defined(LIBXML_UNICODE_ENABLED)
35342    int mem_base;
35343    int ret_val;
35344    int code; /* UCS code point */
35345    int n_code;
35346
35347    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35348        mem_base = xmlMemBlocks();
35349        code = gen_int(n_code, 0);
35350
35351        ret_val = xmlUCSIsBraillePatterns(code);
35352        desret_int(ret_val);
35353        call_tests++;
35354        des_int(n_code, code, 0);
35355        xmlResetLastError();
35356        if (mem_base != xmlMemBlocks()) {
35357            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
35358	           xmlMemBlocks() - mem_base);
35359	    test_ret++;
35360            printf(" %d", n_code);
35361            printf("\n");
35362        }
35363    }
35364    function_tests++;
35365#endif
35366
35367    return(test_ret);
35368}
35369
35370
35371static int
35372test_xmlUCSIsBuhid(void) {
35373    int test_ret = 0;
35374
35375#if defined(LIBXML_UNICODE_ENABLED)
35376    int mem_base;
35377    int ret_val;
35378    int code; /* UCS code point */
35379    int n_code;
35380
35381    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35382        mem_base = xmlMemBlocks();
35383        code = gen_int(n_code, 0);
35384
35385        ret_val = xmlUCSIsBuhid(code);
35386        desret_int(ret_val);
35387        call_tests++;
35388        des_int(n_code, code, 0);
35389        xmlResetLastError();
35390        if (mem_base != xmlMemBlocks()) {
35391            printf("Leak of %d blocks found in xmlUCSIsBuhid",
35392	           xmlMemBlocks() - mem_base);
35393	    test_ret++;
35394            printf(" %d", n_code);
35395            printf("\n");
35396        }
35397    }
35398    function_tests++;
35399#endif
35400
35401    return(test_ret);
35402}
35403
35404
35405static int
35406test_xmlUCSIsByzantineMusicalSymbols(void) {
35407    int test_ret = 0;
35408
35409#if defined(LIBXML_UNICODE_ENABLED)
35410    int mem_base;
35411    int ret_val;
35412    int code; /* UCS code point */
35413    int n_code;
35414
35415    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35416        mem_base = xmlMemBlocks();
35417        code = gen_int(n_code, 0);
35418
35419        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
35420        desret_int(ret_val);
35421        call_tests++;
35422        des_int(n_code, code, 0);
35423        xmlResetLastError();
35424        if (mem_base != xmlMemBlocks()) {
35425            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
35426	           xmlMemBlocks() - mem_base);
35427	    test_ret++;
35428            printf(" %d", n_code);
35429            printf("\n");
35430        }
35431    }
35432    function_tests++;
35433#endif
35434
35435    return(test_ret);
35436}
35437
35438
35439static int
35440test_xmlUCSIsCJKCompatibility(void) {
35441    int test_ret = 0;
35442
35443#if defined(LIBXML_UNICODE_ENABLED)
35444    int mem_base;
35445    int ret_val;
35446    int code; /* UCS code point */
35447    int n_code;
35448
35449    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35450        mem_base = xmlMemBlocks();
35451        code = gen_int(n_code, 0);
35452
35453        ret_val = xmlUCSIsCJKCompatibility(code);
35454        desret_int(ret_val);
35455        call_tests++;
35456        des_int(n_code, code, 0);
35457        xmlResetLastError();
35458        if (mem_base != xmlMemBlocks()) {
35459            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
35460	           xmlMemBlocks() - mem_base);
35461	    test_ret++;
35462            printf(" %d", n_code);
35463            printf("\n");
35464        }
35465    }
35466    function_tests++;
35467#endif
35468
35469    return(test_ret);
35470}
35471
35472
35473static int
35474test_xmlUCSIsCJKCompatibilityForms(void) {
35475    int test_ret = 0;
35476
35477#if defined(LIBXML_UNICODE_ENABLED)
35478    int mem_base;
35479    int ret_val;
35480    int code; /* UCS code point */
35481    int n_code;
35482
35483    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35484        mem_base = xmlMemBlocks();
35485        code = gen_int(n_code, 0);
35486
35487        ret_val = xmlUCSIsCJKCompatibilityForms(code);
35488        desret_int(ret_val);
35489        call_tests++;
35490        des_int(n_code, code, 0);
35491        xmlResetLastError();
35492        if (mem_base != xmlMemBlocks()) {
35493            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
35494	           xmlMemBlocks() - mem_base);
35495	    test_ret++;
35496            printf(" %d", n_code);
35497            printf("\n");
35498        }
35499    }
35500    function_tests++;
35501#endif
35502
35503    return(test_ret);
35504}
35505
35506
35507static int
35508test_xmlUCSIsCJKCompatibilityIdeographs(void) {
35509    int test_ret = 0;
35510
35511#if defined(LIBXML_UNICODE_ENABLED)
35512    int mem_base;
35513    int ret_val;
35514    int code; /* UCS code point */
35515    int n_code;
35516
35517    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35518        mem_base = xmlMemBlocks();
35519        code = gen_int(n_code, 0);
35520
35521        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
35522        desret_int(ret_val);
35523        call_tests++;
35524        des_int(n_code, code, 0);
35525        xmlResetLastError();
35526        if (mem_base != xmlMemBlocks()) {
35527            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
35528	           xmlMemBlocks() - mem_base);
35529	    test_ret++;
35530            printf(" %d", n_code);
35531            printf("\n");
35532        }
35533    }
35534    function_tests++;
35535#endif
35536
35537    return(test_ret);
35538}
35539
35540
35541static int
35542test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
35543    int test_ret = 0;
35544
35545#if defined(LIBXML_UNICODE_ENABLED)
35546    int mem_base;
35547    int ret_val;
35548    int code; /* UCS code point */
35549    int n_code;
35550
35551    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35552        mem_base = xmlMemBlocks();
35553        code = gen_int(n_code, 0);
35554
35555        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
35556        desret_int(ret_val);
35557        call_tests++;
35558        des_int(n_code, code, 0);
35559        xmlResetLastError();
35560        if (mem_base != xmlMemBlocks()) {
35561            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
35562	           xmlMemBlocks() - mem_base);
35563	    test_ret++;
35564            printf(" %d", n_code);
35565            printf("\n");
35566        }
35567    }
35568    function_tests++;
35569#endif
35570
35571    return(test_ret);
35572}
35573
35574
35575static int
35576test_xmlUCSIsCJKRadicalsSupplement(void) {
35577    int test_ret = 0;
35578
35579#if defined(LIBXML_UNICODE_ENABLED)
35580    int mem_base;
35581    int ret_val;
35582    int code; /* UCS code point */
35583    int n_code;
35584
35585    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35586        mem_base = xmlMemBlocks();
35587        code = gen_int(n_code, 0);
35588
35589        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
35590        desret_int(ret_val);
35591        call_tests++;
35592        des_int(n_code, code, 0);
35593        xmlResetLastError();
35594        if (mem_base != xmlMemBlocks()) {
35595            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
35596	           xmlMemBlocks() - mem_base);
35597	    test_ret++;
35598            printf(" %d", n_code);
35599            printf("\n");
35600        }
35601    }
35602    function_tests++;
35603#endif
35604
35605    return(test_ret);
35606}
35607
35608
35609static int
35610test_xmlUCSIsCJKSymbolsandPunctuation(void) {
35611    int test_ret = 0;
35612
35613#if defined(LIBXML_UNICODE_ENABLED)
35614    int mem_base;
35615    int ret_val;
35616    int code; /* UCS code point */
35617    int n_code;
35618
35619    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35620        mem_base = xmlMemBlocks();
35621        code = gen_int(n_code, 0);
35622
35623        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
35624        desret_int(ret_val);
35625        call_tests++;
35626        des_int(n_code, code, 0);
35627        xmlResetLastError();
35628        if (mem_base != xmlMemBlocks()) {
35629            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
35630	           xmlMemBlocks() - mem_base);
35631	    test_ret++;
35632            printf(" %d", n_code);
35633            printf("\n");
35634        }
35635    }
35636    function_tests++;
35637#endif
35638
35639    return(test_ret);
35640}
35641
35642
35643static int
35644test_xmlUCSIsCJKUnifiedIdeographs(void) {
35645    int test_ret = 0;
35646
35647#if defined(LIBXML_UNICODE_ENABLED)
35648    int mem_base;
35649    int ret_val;
35650    int code; /* UCS code point */
35651    int n_code;
35652
35653    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35654        mem_base = xmlMemBlocks();
35655        code = gen_int(n_code, 0);
35656
35657        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
35658        desret_int(ret_val);
35659        call_tests++;
35660        des_int(n_code, code, 0);
35661        xmlResetLastError();
35662        if (mem_base != xmlMemBlocks()) {
35663            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
35664	           xmlMemBlocks() - mem_base);
35665	    test_ret++;
35666            printf(" %d", n_code);
35667            printf("\n");
35668        }
35669    }
35670    function_tests++;
35671#endif
35672
35673    return(test_ret);
35674}
35675
35676
35677static int
35678test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
35679    int test_ret = 0;
35680
35681#if defined(LIBXML_UNICODE_ENABLED)
35682    int mem_base;
35683    int ret_val;
35684    int code; /* UCS code point */
35685    int n_code;
35686
35687    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35688        mem_base = xmlMemBlocks();
35689        code = gen_int(n_code, 0);
35690
35691        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
35692        desret_int(ret_val);
35693        call_tests++;
35694        des_int(n_code, code, 0);
35695        xmlResetLastError();
35696        if (mem_base != xmlMemBlocks()) {
35697            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
35698	           xmlMemBlocks() - mem_base);
35699	    test_ret++;
35700            printf(" %d", n_code);
35701            printf("\n");
35702        }
35703    }
35704    function_tests++;
35705#endif
35706
35707    return(test_ret);
35708}
35709
35710
35711static int
35712test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
35713    int test_ret = 0;
35714
35715#if defined(LIBXML_UNICODE_ENABLED)
35716    int mem_base;
35717    int ret_val;
35718    int code; /* UCS code point */
35719    int n_code;
35720
35721    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35722        mem_base = xmlMemBlocks();
35723        code = gen_int(n_code, 0);
35724
35725        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
35726        desret_int(ret_val);
35727        call_tests++;
35728        des_int(n_code, code, 0);
35729        xmlResetLastError();
35730        if (mem_base != xmlMemBlocks()) {
35731            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
35732	           xmlMemBlocks() - mem_base);
35733	    test_ret++;
35734            printf(" %d", n_code);
35735            printf("\n");
35736        }
35737    }
35738    function_tests++;
35739#endif
35740
35741    return(test_ret);
35742}
35743
35744
35745static int
35746test_xmlUCSIsCat(void) {
35747    int test_ret = 0;
35748
35749#if defined(LIBXML_UNICODE_ENABLED)
35750    int mem_base;
35751    int ret_val;
35752    int code; /* UCS code point */
35753    int n_code;
35754    char * cat; /* UCS Category name */
35755    int n_cat;
35756
35757    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35758    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
35759        mem_base = xmlMemBlocks();
35760        code = gen_int(n_code, 0);
35761        cat = gen_const_char_ptr(n_cat, 1);
35762
35763        ret_val = xmlUCSIsCat(code, (const char *)cat);
35764        desret_int(ret_val);
35765        call_tests++;
35766        des_int(n_code, code, 0);
35767        des_const_char_ptr(n_cat, (const char *)cat, 1);
35768        xmlResetLastError();
35769        if (mem_base != xmlMemBlocks()) {
35770            printf("Leak of %d blocks found in xmlUCSIsCat",
35771	           xmlMemBlocks() - mem_base);
35772	    test_ret++;
35773            printf(" %d", n_code);
35774            printf(" %d", n_cat);
35775            printf("\n");
35776        }
35777    }
35778    }
35779    function_tests++;
35780#endif
35781
35782    return(test_ret);
35783}
35784
35785
35786static int
35787test_xmlUCSIsCatC(void) {
35788    int test_ret = 0;
35789
35790#if defined(LIBXML_UNICODE_ENABLED)
35791    int mem_base;
35792    int ret_val;
35793    int code; /* UCS code point */
35794    int n_code;
35795
35796    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35797        mem_base = xmlMemBlocks();
35798        code = gen_int(n_code, 0);
35799
35800        ret_val = xmlUCSIsCatC(code);
35801        desret_int(ret_val);
35802        call_tests++;
35803        des_int(n_code, code, 0);
35804        xmlResetLastError();
35805        if (mem_base != xmlMemBlocks()) {
35806            printf("Leak of %d blocks found in xmlUCSIsCatC",
35807	           xmlMemBlocks() - mem_base);
35808	    test_ret++;
35809            printf(" %d", n_code);
35810            printf("\n");
35811        }
35812    }
35813    function_tests++;
35814#endif
35815
35816    return(test_ret);
35817}
35818
35819
35820static int
35821test_xmlUCSIsCatCc(void) {
35822    int test_ret = 0;
35823
35824#if defined(LIBXML_UNICODE_ENABLED)
35825    int mem_base;
35826    int ret_val;
35827    int code; /* UCS code point */
35828    int n_code;
35829
35830    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35831        mem_base = xmlMemBlocks();
35832        code = gen_int(n_code, 0);
35833
35834        ret_val = xmlUCSIsCatCc(code);
35835        desret_int(ret_val);
35836        call_tests++;
35837        des_int(n_code, code, 0);
35838        xmlResetLastError();
35839        if (mem_base != xmlMemBlocks()) {
35840            printf("Leak of %d blocks found in xmlUCSIsCatCc",
35841	           xmlMemBlocks() - mem_base);
35842	    test_ret++;
35843            printf(" %d", n_code);
35844            printf("\n");
35845        }
35846    }
35847    function_tests++;
35848#endif
35849
35850    return(test_ret);
35851}
35852
35853
35854static int
35855test_xmlUCSIsCatCf(void) {
35856    int test_ret = 0;
35857
35858#if defined(LIBXML_UNICODE_ENABLED)
35859    int mem_base;
35860    int ret_val;
35861    int code; /* UCS code point */
35862    int n_code;
35863
35864    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35865        mem_base = xmlMemBlocks();
35866        code = gen_int(n_code, 0);
35867
35868        ret_val = xmlUCSIsCatCf(code);
35869        desret_int(ret_val);
35870        call_tests++;
35871        des_int(n_code, code, 0);
35872        xmlResetLastError();
35873        if (mem_base != xmlMemBlocks()) {
35874            printf("Leak of %d blocks found in xmlUCSIsCatCf",
35875	           xmlMemBlocks() - mem_base);
35876	    test_ret++;
35877            printf(" %d", n_code);
35878            printf("\n");
35879        }
35880    }
35881    function_tests++;
35882#endif
35883
35884    return(test_ret);
35885}
35886
35887
35888static int
35889test_xmlUCSIsCatCo(void) {
35890    int test_ret = 0;
35891
35892#if defined(LIBXML_UNICODE_ENABLED)
35893    int mem_base;
35894    int ret_val;
35895    int code; /* UCS code point */
35896    int n_code;
35897
35898    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35899        mem_base = xmlMemBlocks();
35900        code = gen_int(n_code, 0);
35901
35902        ret_val = xmlUCSIsCatCo(code);
35903        desret_int(ret_val);
35904        call_tests++;
35905        des_int(n_code, code, 0);
35906        xmlResetLastError();
35907        if (mem_base != xmlMemBlocks()) {
35908            printf("Leak of %d blocks found in xmlUCSIsCatCo",
35909	           xmlMemBlocks() - mem_base);
35910	    test_ret++;
35911            printf(" %d", n_code);
35912            printf("\n");
35913        }
35914    }
35915    function_tests++;
35916#endif
35917
35918    return(test_ret);
35919}
35920
35921
35922static int
35923test_xmlUCSIsCatCs(void) {
35924    int test_ret = 0;
35925
35926#if defined(LIBXML_UNICODE_ENABLED)
35927    int mem_base;
35928    int ret_val;
35929    int code; /* UCS code point */
35930    int n_code;
35931
35932    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35933        mem_base = xmlMemBlocks();
35934        code = gen_int(n_code, 0);
35935
35936        ret_val = xmlUCSIsCatCs(code);
35937        desret_int(ret_val);
35938        call_tests++;
35939        des_int(n_code, code, 0);
35940        xmlResetLastError();
35941        if (mem_base != xmlMemBlocks()) {
35942            printf("Leak of %d blocks found in xmlUCSIsCatCs",
35943	           xmlMemBlocks() - mem_base);
35944	    test_ret++;
35945            printf(" %d", n_code);
35946            printf("\n");
35947        }
35948    }
35949    function_tests++;
35950#endif
35951
35952    return(test_ret);
35953}
35954
35955
35956static int
35957test_xmlUCSIsCatL(void) {
35958    int test_ret = 0;
35959
35960#if defined(LIBXML_UNICODE_ENABLED)
35961    int mem_base;
35962    int ret_val;
35963    int code; /* UCS code point */
35964    int n_code;
35965
35966    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35967        mem_base = xmlMemBlocks();
35968        code = gen_int(n_code, 0);
35969
35970        ret_val = xmlUCSIsCatL(code);
35971        desret_int(ret_val);
35972        call_tests++;
35973        des_int(n_code, code, 0);
35974        xmlResetLastError();
35975        if (mem_base != xmlMemBlocks()) {
35976            printf("Leak of %d blocks found in xmlUCSIsCatL",
35977	           xmlMemBlocks() - mem_base);
35978	    test_ret++;
35979            printf(" %d", n_code);
35980            printf("\n");
35981        }
35982    }
35983    function_tests++;
35984#endif
35985
35986    return(test_ret);
35987}
35988
35989
35990static int
35991test_xmlUCSIsCatLl(void) {
35992    int test_ret = 0;
35993
35994#if defined(LIBXML_UNICODE_ENABLED)
35995    int mem_base;
35996    int ret_val;
35997    int code; /* UCS code point */
35998    int n_code;
35999
36000    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36001        mem_base = xmlMemBlocks();
36002        code = gen_int(n_code, 0);
36003
36004        ret_val = xmlUCSIsCatLl(code);
36005        desret_int(ret_val);
36006        call_tests++;
36007        des_int(n_code, code, 0);
36008        xmlResetLastError();
36009        if (mem_base != xmlMemBlocks()) {
36010            printf("Leak of %d blocks found in xmlUCSIsCatLl",
36011	           xmlMemBlocks() - mem_base);
36012	    test_ret++;
36013            printf(" %d", n_code);
36014            printf("\n");
36015        }
36016    }
36017    function_tests++;
36018#endif
36019
36020    return(test_ret);
36021}
36022
36023
36024static int
36025test_xmlUCSIsCatLm(void) {
36026    int test_ret = 0;
36027
36028#if defined(LIBXML_UNICODE_ENABLED)
36029    int mem_base;
36030    int ret_val;
36031    int code; /* UCS code point */
36032    int n_code;
36033
36034    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36035        mem_base = xmlMemBlocks();
36036        code = gen_int(n_code, 0);
36037
36038        ret_val = xmlUCSIsCatLm(code);
36039        desret_int(ret_val);
36040        call_tests++;
36041        des_int(n_code, code, 0);
36042        xmlResetLastError();
36043        if (mem_base != xmlMemBlocks()) {
36044            printf("Leak of %d blocks found in xmlUCSIsCatLm",
36045	           xmlMemBlocks() - mem_base);
36046	    test_ret++;
36047            printf(" %d", n_code);
36048            printf("\n");
36049        }
36050    }
36051    function_tests++;
36052#endif
36053
36054    return(test_ret);
36055}
36056
36057
36058static int
36059test_xmlUCSIsCatLo(void) {
36060    int test_ret = 0;
36061
36062#if defined(LIBXML_UNICODE_ENABLED)
36063    int mem_base;
36064    int ret_val;
36065    int code; /* UCS code point */
36066    int n_code;
36067
36068    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36069        mem_base = xmlMemBlocks();
36070        code = gen_int(n_code, 0);
36071
36072        ret_val = xmlUCSIsCatLo(code);
36073        desret_int(ret_val);
36074        call_tests++;
36075        des_int(n_code, code, 0);
36076        xmlResetLastError();
36077        if (mem_base != xmlMemBlocks()) {
36078            printf("Leak of %d blocks found in xmlUCSIsCatLo",
36079	           xmlMemBlocks() - mem_base);
36080	    test_ret++;
36081            printf(" %d", n_code);
36082            printf("\n");
36083        }
36084    }
36085    function_tests++;
36086#endif
36087
36088    return(test_ret);
36089}
36090
36091
36092static int
36093test_xmlUCSIsCatLt(void) {
36094    int test_ret = 0;
36095
36096#if defined(LIBXML_UNICODE_ENABLED)
36097    int mem_base;
36098    int ret_val;
36099    int code; /* UCS code point */
36100    int n_code;
36101
36102    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36103        mem_base = xmlMemBlocks();
36104        code = gen_int(n_code, 0);
36105
36106        ret_val = xmlUCSIsCatLt(code);
36107        desret_int(ret_val);
36108        call_tests++;
36109        des_int(n_code, code, 0);
36110        xmlResetLastError();
36111        if (mem_base != xmlMemBlocks()) {
36112            printf("Leak of %d blocks found in xmlUCSIsCatLt",
36113	           xmlMemBlocks() - mem_base);
36114	    test_ret++;
36115            printf(" %d", n_code);
36116            printf("\n");
36117        }
36118    }
36119    function_tests++;
36120#endif
36121
36122    return(test_ret);
36123}
36124
36125
36126static int
36127test_xmlUCSIsCatLu(void) {
36128    int test_ret = 0;
36129
36130#if defined(LIBXML_UNICODE_ENABLED)
36131    int mem_base;
36132    int ret_val;
36133    int code; /* UCS code point */
36134    int n_code;
36135
36136    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36137        mem_base = xmlMemBlocks();
36138        code = gen_int(n_code, 0);
36139
36140        ret_val = xmlUCSIsCatLu(code);
36141        desret_int(ret_val);
36142        call_tests++;
36143        des_int(n_code, code, 0);
36144        xmlResetLastError();
36145        if (mem_base != xmlMemBlocks()) {
36146            printf("Leak of %d blocks found in xmlUCSIsCatLu",
36147	           xmlMemBlocks() - mem_base);
36148	    test_ret++;
36149            printf(" %d", n_code);
36150            printf("\n");
36151        }
36152    }
36153    function_tests++;
36154#endif
36155
36156    return(test_ret);
36157}
36158
36159
36160static int
36161test_xmlUCSIsCatM(void) {
36162    int test_ret = 0;
36163
36164#if defined(LIBXML_UNICODE_ENABLED)
36165    int mem_base;
36166    int ret_val;
36167    int code; /* UCS code point */
36168    int n_code;
36169
36170    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36171        mem_base = xmlMemBlocks();
36172        code = gen_int(n_code, 0);
36173
36174        ret_val = xmlUCSIsCatM(code);
36175        desret_int(ret_val);
36176        call_tests++;
36177        des_int(n_code, code, 0);
36178        xmlResetLastError();
36179        if (mem_base != xmlMemBlocks()) {
36180            printf("Leak of %d blocks found in xmlUCSIsCatM",
36181	           xmlMemBlocks() - mem_base);
36182	    test_ret++;
36183            printf(" %d", n_code);
36184            printf("\n");
36185        }
36186    }
36187    function_tests++;
36188#endif
36189
36190    return(test_ret);
36191}
36192
36193
36194static int
36195test_xmlUCSIsCatMc(void) {
36196    int test_ret = 0;
36197
36198#if defined(LIBXML_UNICODE_ENABLED)
36199    int mem_base;
36200    int ret_val;
36201    int code; /* UCS code point */
36202    int n_code;
36203
36204    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36205        mem_base = xmlMemBlocks();
36206        code = gen_int(n_code, 0);
36207
36208        ret_val = xmlUCSIsCatMc(code);
36209        desret_int(ret_val);
36210        call_tests++;
36211        des_int(n_code, code, 0);
36212        xmlResetLastError();
36213        if (mem_base != xmlMemBlocks()) {
36214            printf("Leak of %d blocks found in xmlUCSIsCatMc",
36215	           xmlMemBlocks() - mem_base);
36216	    test_ret++;
36217            printf(" %d", n_code);
36218            printf("\n");
36219        }
36220    }
36221    function_tests++;
36222#endif
36223
36224    return(test_ret);
36225}
36226
36227
36228static int
36229test_xmlUCSIsCatMe(void) {
36230    int test_ret = 0;
36231
36232#if defined(LIBXML_UNICODE_ENABLED)
36233    int mem_base;
36234    int ret_val;
36235    int code; /* UCS code point */
36236    int n_code;
36237
36238    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36239        mem_base = xmlMemBlocks();
36240        code = gen_int(n_code, 0);
36241
36242        ret_val = xmlUCSIsCatMe(code);
36243        desret_int(ret_val);
36244        call_tests++;
36245        des_int(n_code, code, 0);
36246        xmlResetLastError();
36247        if (mem_base != xmlMemBlocks()) {
36248            printf("Leak of %d blocks found in xmlUCSIsCatMe",
36249	           xmlMemBlocks() - mem_base);
36250	    test_ret++;
36251            printf(" %d", n_code);
36252            printf("\n");
36253        }
36254    }
36255    function_tests++;
36256#endif
36257
36258    return(test_ret);
36259}
36260
36261
36262static int
36263test_xmlUCSIsCatMn(void) {
36264    int test_ret = 0;
36265
36266#if defined(LIBXML_UNICODE_ENABLED)
36267    int mem_base;
36268    int ret_val;
36269    int code; /* UCS code point */
36270    int n_code;
36271
36272    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36273        mem_base = xmlMemBlocks();
36274        code = gen_int(n_code, 0);
36275
36276        ret_val = xmlUCSIsCatMn(code);
36277        desret_int(ret_val);
36278        call_tests++;
36279        des_int(n_code, code, 0);
36280        xmlResetLastError();
36281        if (mem_base != xmlMemBlocks()) {
36282            printf("Leak of %d blocks found in xmlUCSIsCatMn",
36283	           xmlMemBlocks() - mem_base);
36284	    test_ret++;
36285            printf(" %d", n_code);
36286            printf("\n");
36287        }
36288    }
36289    function_tests++;
36290#endif
36291
36292    return(test_ret);
36293}
36294
36295
36296static int
36297test_xmlUCSIsCatN(void) {
36298    int test_ret = 0;
36299
36300#if defined(LIBXML_UNICODE_ENABLED)
36301    int mem_base;
36302    int ret_val;
36303    int code; /* UCS code point */
36304    int n_code;
36305
36306    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36307        mem_base = xmlMemBlocks();
36308        code = gen_int(n_code, 0);
36309
36310        ret_val = xmlUCSIsCatN(code);
36311        desret_int(ret_val);
36312        call_tests++;
36313        des_int(n_code, code, 0);
36314        xmlResetLastError();
36315        if (mem_base != xmlMemBlocks()) {
36316            printf("Leak of %d blocks found in xmlUCSIsCatN",
36317	           xmlMemBlocks() - mem_base);
36318	    test_ret++;
36319            printf(" %d", n_code);
36320            printf("\n");
36321        }
36322    }
36323    function_tests++;
36324#endif
36325
36326    return(test_ret);
36327}
36328
36329
36330static int
36331test_xmlUCSIsCatNd(void) {
36332    int test_ret = 0;
36333
36334#if defined(LIBXML_UNICODE_ENABLED)
36335    int mem_base;
36336    int ret_val;
36337    int code; /* UCS code point */
36338    int n_code;
36339
36340    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36341        mem_base = xmlMemBlocks();
36342        code = gen_int(n_code, 0);
36343
36344        ret_val = xmlUCSIsCatNd(code);
36345        desret_int(ret_val);
36346        call_tests++;
36347        des_int(n_code, code, 0);
36348        xmlResetLastError();
36349        if (mem_base != xmlMemBlocks()) {
36350            printf("Leak of %d blocks found in xmlUCSIsCatNd",
36351	           xmlMemBlocks() - mem_base);
36352	    test_ret++;
36353            printf(" %d", n_code);
36354            printf("\n");
36355        }
36356    }
36357    function_tests++;
36358#endif
36359
36360    return(test_ret);
36361}
36362
36363
36364static int
36365test_xmlUCSIsCatNl(void) {
36366    int test_ret = 0;
36367
36368#if defined(LIBXML_UNICODE_ENABLED)
36369    int mem_base;
36370    int ret_val;
36371    int code; /* UCS code point */
36372    int n_code;
36373
36374    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36375        mem_base = xmlMemBlocks();
36376        code = gen_int(n_code, 0);
36377
36378        ret_val = xmlUCSIsCatNl(code);
36379        desret_int(ret_val);
36380        call_tests++;
36381        des_int(n_code, code, 0);
36382        xmlResetLastError();
36383        if (mem_base != xmlMemBlocks()) {
36384            printf("Leak of %d blocks found in xmlUCSIsCatNl",
36385	           xmlMemBlocks() - mem_base);
36386	    test_ret++;
36387            printf(" %d", n_code);
36388            printf("\n");
36389        }
36390    }
36391    function_tests++;
36392#endif
36393
36394    return(test_ret);
36395}
36396
36397
36398static int
36399test_xmlUCSIsCatNo(void) {
36400    int test_ret = 0;
36401
36402#if defined(LIBXML_UNICODE_ENABLED)
36403    int mem_base;
36404    int ret_val;
36405    int code; /* UCS code point */
36406    int n_code;
36407
36408    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36409        mem_base = xmlMemBlocks();
36410        code = gen_int(n_code, 0);
36411
36412        ret_val = xmlUCSIsCatNo(code);
36413        desret_int(ret_val);
36414        call_tests++;
36415        des_int(n_code, code, 0);
36416        xmlResetLastError();
36417        if (mem_base != xmlMemBlocks()) {
36418            printf("Leak of %d blocks found in xmlUCSIsCatNo",
36419	           xmlMemBlocks() - mem_base);
36420	    test_ret++;
36421            printf(" %d", n_code);
36422            printf("\n");
36423        }
36424    }
36425    function_tests++;
36426#endif
36427
36428    return(test_ret);
36429}
36430
36431
36432static int
36433test_xmlUCSIsCatP(void) {
36434    int test_ret = 0;
36435
36436#if defined(LIBXML_UNICODE_ENABLED)
36437    int mem_base;
36438    int ret_val;
36439    int code; /* UCS code point */
36440    int n_code;
36441
36442    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36443        mem_base = xmlMemBlocks();
36444        code = gen_int(n_code, 0);
36445
36446        ret_val = xmlUCSIsCatP(code);
36447        desret_int(ret_val);
36448        call_tests++;
36449        des_int(n_code, code, 0);
36450        xmlResetLastError();
36451        if (mem_base != xmlMemBlocks()) {
36452            printf("Leak of %d blocks found in xmlUCSIsCatP",
36453	           xmlMemBlocks() - mem_base);
36454	    test_ret++;
36455            printf(" %d", n_code);
36456            printf("\n");
36457        }
36458    }
36459    function_tests++;
36460#endif
36461
36462    return(test_ret);
36463}
36464
36465
36466static int
36467test_xmlUCSIsCatPc(void) {
36468    int test_ret = 0;
36469
36470#if defined(LIBXML_UNICODE_ENABLED)
36471    int mem_base;
36472    int ret_val;
36473    int code; /* UCS code point */
36474    int n_code;
36475
36476    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36477        mem_base = xmlMemBlocks();
36478        code = gen_int(n_code, 0);
36479
36480        ret_val = xmlUCSIsCatPc(code);
36481        desret_int(ret_val);
36482        call_tests++;
36483        des_int(n_code, code, 0);
36484        xmlResetLastError();
36485        if (mem_base != xmlMemBlocks()) {
36486            printf("Leak of %d blocks found in xmlUCSIsCatPc",
36487	           xmlMemBlocks() - mem_base);
36488	    test_ret++;
36489            printf(" %d", n_code);
36490            printf("\n");
36491        }
36492    }
36493    function_tests++;
36494#endif
36495
36496    return(test_ret);
36497}
36498
36499
36500static int
36501test_xmlUCSIsCatPd(void) {
36502    int test_ret = 0;
36503
36504#if defined(LIBXML_UNICODE_ENABLED)
36505    int mem_base;
36506    int ret_val;
36507    int code; /* UCS code point */
36508    int n_code;
36509
36510    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36511        mem_base = xmlMemBlocks();
36512        code = gen_int(n_code, 0);
36513
36514        ret_val = xmlUCSIsCatPd(code);
36515        desret_int(ret_val);
36516        call_tests++;
36517        des_int(n_code, code, 0);
36518        xmlResetLastError();
36519        if (mem_base != xmlMemBlocks()) {
36520            printf("Leak of %d blocks found in xmlUCSIsCatPd",
36521	           xmlMemBlocks() - mem_base);
36522	    test_ret++;
36523            printf(" %d", n_code);
36524            printf("\n");
36525        }
36526    }
36527    function_tests++;
36528#endif
36529
36530    return(test_ret);
36531}
36532
36533
36534static int
36535test_xmlUCSIsCatPe(void) {
36536    int test_ret = 0;
36537
36538#if defined(LIBXML_UNICODE_ENABLED)
36539    int mem_base;
36540    int ret_val;
36541    int code; /* UCS code point */
36542    int n_code;
36543
36544    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36545        mem_base = xmlMemBlocks();
36546        code = gen_int(n_code, 0);
36547
36548        ret_val = xmlUCSIsCatPe(code);
36549        desret_int(ret_val);
36550        call_tests++;
36551        des_int(n_code, code, 0);
36552        xmlResetLastError();
36553        if (mem_base != xmlMemBlocks()) {
36554            printf("Leak of %d blocks found in xmlUCSIsCatPe",
36555	           xmlMemBlocks() - mem_base);
36556	    test_ret++;
36557            printf(" %d", n_code);
36558            printf("\n");
36559        }
36560    }
36561    function_tests++;
36562#endif
36563
36564    return(test_ret);
36565}
36566
36567
36568static int
36569test_xmlUCSIsCatPf(void) {
36570    int test_ret = 0;
36571
36572#if defined(LIBXML_UNICODE_ENABLED)
36573    int mem_base;
36574    int ret_val;
36575    int code; /* UCS code point */
36576    int n_code;
36577
36578    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36579        mem_base = xmlMemBlocks();
36580        code = gen_int(n_code, 0);
36581
36582        ret_val = xmlUCSIsCatPf(code);
36583        desret_int(ret_val);
36584        call_tests++;
36585        des_int(n_code, code, 0);
36586        xmlResetLastError();
36587        if (mem_base != xmlMemBlocks()) {
36588            printf("Leak of %d blocks found in xmlUCSIsCatPf",
36589	           xmlMemBlocks() - mem_base);
36590	    test_ret++;
36591            printf(" %d", n_code);
36592            printf("\n");
36593        }
36594    }
36595    function_tests++;
36596#endif
36597
36598    return(test_ret);
36599}
36600
36601
36602static int
36603test_xmlUCSIsCatPi(void) {
36604    int test_ret = 0;
36605
36606#if defined(LIBXML_UNICODE_ENABLED)
36607    int mem_base;
36608    int ret_val;
36609    int code; /* UCS code point */
36610    int n_code;
36611
36612    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36613        mem_base = xmlMemBlocks();
36614        code = gen_int(n_code, 0);
36615
36616        ret_val = xmlUCSIsCatPi(code);
36617        desret_int(ret_val);
36618        call_tests++;
36619        des_int(n_code, code, 0);
36620        xmlResetLastError();
36621        if (mem_base != xmlMemBlocks()) {
36622            printf("Leak of %d blocks found in xmlUCSIsCatPi",
36623	           xmlMemBlocks() - mem_base);
36624	    test_ret++;
36625            printf(" %d", n_code);
36626            printf("\n");
36627        }
36628    }
36629    function_tests++;
36630#endif
36631
36632    return(test_ret);
36633}
36634
36635
36636static int
36637test_xmlUCSIsCatPo(void) {
36638    int test_ret = 0;
36639
36640#if defined(LIBXML_UNICODE_ENABLED)
36641    int mem_base;
36642    int ret_val;
36643    int code; /* UCS code point */
36644    int n_code;
36645
36646    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36647        mem_base = xmlMemBlocks();
36648        code = gen_int(n_code, 0);
36649
36650        ret_val = xmlUCSIsCatPo(code);
36651        desret_int(ret_val);
36652        call_tests++;
36653        des_int(n_code, code, 0);
36654        xmlResetLastError();
36655        if (mem_base != xmlMemBlocks()) {
36656            printf("Leak of %d blocks found in xmlUCSIsCatPo",
36657	           xmlMemBlocks() - mem_base);
36658	    test_ret++;
36659            printf(" %d", n_code);
36660            printf("\n");
36661        }
36662    }
36663    function_tests++;
36664#endif
36665
36666    return(test_ret);
36667}
36668
36669
36670static int
36671test_xmlUCSIsCatPs(void) {
36672    int test_ret = 0;
36673
36674#if defined(LIBXML_UNICODE_ENABLED)
36675    int mem_base;
36676    int ret_val;
36677    int code; /* UCS code point */
36678    int n_code;
36679
36680    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36681        mem_base = xmlMemBlocks();
36682        code = gen_int(n_code, 0);
36683
36684        ret_val = xmlUCSIsCatPs(code);
36685        desret_int(ret_val);
36686        call_tests++;
36687        des_int(n_code, code, 0);
36688        xmlResetLastError();
36689        if (mem_base != xmlMemBlocks()) {
36690            printf("Leak of %d blocks found in xmlUCSIsCatPs",
36691	           xmlMemBlocks() - mem_base);
36692	    test_ret++;
36693            printf(" %d", n_code);
36694            printf("\n");
36695        }
36696    }
36697    function_tests++;
36698#endif
36699
36700    return(test_ret);
36701}
36702
36703
36704static int
36705test_xmlUCSIsCatS(void) {
36706    int test_ret = 0;
36707
36708#if defined(LIBXML_UNICODE_ENABLED)
36709    int mem_base;
36710    int ret_val;
36711    int code; /* UCS code point */
36712    int n_code;
36713
36714    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36715        mem_base = xmlMemBlocks();
36716        code = gen_int(n_code, 0);
36717
36718        ret_val = xmlUCSIsCatS(code);
36719        desret_int(ret_val);
36720        call_tests++;
36721        des_int(n_code, code, 0);
36722        xmlResetLastError();
36723        if (mem_base != xmlMemBlocks()) {
36724            printf("Leak of %d blocks found in xmlUCSIsCatS",
36725	           xmlMemBlocks() - mem_base);
36726	    test_ret++;
36727            printf(" %d", n_code);
36728            printf("\n");
36729        }
36730    }
36731    function_tests++;
36732#endif
36733
36734    return(test_ret);
36735}
36736
36737
36738static int
36739test_xmlUCSIsCatSc(void) {
36740    int test_ret = 0;
36741
36742#if defined(LIBXML_UNICODE_ENABLED)
36743    int mem_base;
36744    int ret_val;
36745    int code; /* UCS code point */
36746    int n_code;
36747
36748    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36749        mem_base = xmlMemBlocks();
36750        code = gen_int(n_code, 0);
36751
36752        ret_val = xmlUCSIsCatSc(code);
36753        desret_int(ret_val);
36754        call_tests++;
36755        des_int(n_code, code, 0);
36756        xmlResetLastError();
36757        if (mem_base != xmlMemBlocks()) {
36758            printf("Leak of %d blocks found in xmlUCSIsCatSc",
36759	           xmlMemBlocks() - mem_base);
36760	    test_ret++;
36761            printf(" %d", n_code);
36762            printf("\n");
36763        }
36764    }
36765    function_tests++;
36766#endif
36767
36768    return(test_ret);
36769}
36770
36771
36772static int
36773test_xmlUCSIsCatSk(void) {
36774    int test_ret = 0;
36775
36776#if defined(LIBXML_UNICODE_ENABLED)
36777    int mem_base;
36778    int ret_val;
36779    int code; /* UCS code point */
36780    int n_code;
36781
36782    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36783        mem_base = xmlMemBlocks();
36784        code = gen_int(n_code, 0);
36785
36786        ret_val = xmlUCSIsCatSk(code);
36787        desret_int(ret_val);
36788        call_tests++;
36789        des_int(n_code, code, 0);
36790        xmlResetLastError();
36791        if (mem_base != xmlMemBlocks()) {
36792            printf("Leak of %d blocks found in xmlUCSIsCatSk",
36793	           xmlMemBlocks() - mem_base);
36794	    test_ret++;
36795            printf(" %d", n_code);
36796            printf("\n");
36797        }
36798    }
36799    function_tests++;
36800#endif
36801
36802    return(test_ret);
36803}
36804
36805
36806static int
36807test_xmlUCSIsCatSm(void) {
36808    int test_ret = 0;
36809
36810#if defined(LIBXML_UNICODE_ENABLED)
36811    int mem_base;
36812    int ret_val;
36813    int code; /* UCS code point */
36814    int n_code;
36815
36816    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36817        mem_base = xmlMemBlocks();
36818        code = gen_int(n_code, 0);
36819
36820        ret_val = xmlUCSIsCatSm(code);
36821        desret_int(ret_val);
36822        call_tests++;
36823        des_int(n_code, code, 0);
36824        xmlResetLastError();
36825        if (mem_base != xmlMemBlocks()) {
36826            printf("Leak of %d blocks found in xmlUCSIsCatSm",
36827	           xmlMemBlocks() - mem_base);
36828	    test_ret++;
36829            printf(" %d", n_code);
36830            printf("\n");
36831        }
36832    }
36833    function_tests++;
36834#endif
36835
36836    return(test_ret);
36837}
36838
36839
36840static int
36841test_xmlUCSIsCatSo(void) {
36842    int test_ret = 0;
36843
36844#if defined(LIBXML_UNICODE_ENABLED)
36845    int mem_base;
36846    int ret_val;
36847    int code; /* UCS code point */
36848    int n_code;
36849
36850    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36851        mem_base = xmlMemBlocks();
36852        code = gen_int(n_code, 0);
36853
36854        ret_val = xmlUCSIsCatSo(code);
36855        desret_int(ret_val);
36856        call_tests++;
36857        des_int(n_code, code, 0);
36858        xmlResetLastError();
36859        if (mem_base != xmlMemBlocks()) {
36860            printf("Leak of %d blocks found in xmlUCSIsCatSo",
36861	           xmlMemBlocks() - mem_base);
36862	    test_ret++;
36863            printf(" %d", n_code);
36864            printf("\n");
36865        }
36866    }
36867    function_tests++;
36868#endif
36869
36870    return(test_ret);
36871}
36872
36873
36874static int
36875test_xmlUCSIsCatZ(void) {
36876    int test_ret = 0;
36877
36878#if defined(LIBXML_UNICODE_ENABLED)
36879    int mem_base;
36880    int ret_val;
36881    int code; /* UCS code point */
36882    int n_code;
36883
36884    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36885        mem_base = xmlMemBlocks();
36886        code = gen_int(n_code, 0);
36887
36888        ret_val = xmlUCSIsCatZ(code);
36889        desret_int(ret_val);
36890        call_tests++;
36891        des_int(n_code, code, 0);
36892        xmlResetLastError();
36893        if (mem_base != xmlMemBlocks()) {
36894            printf("Leak of %d blocks found in xmlUCSIsCatZ",
36895	           xmlMemBlocks() - mem_base);
36896	    test_ret++;
36897            printf(" %d", n_code);
36898            printf("\n");
36899        }
36900    }
36901    function_tests++;
36902#endif
36903
36904    return(test_ret);
36905}
36906
36907
36908static int
36909test_xmlUCSIsCatZl(void) {
36910    int test_ret = 0;
36911
36912#if defined(LIBXML_UNICODE_ENABLED)
36913    int mem_base;
36914    int ret_val;
36915    int code; /* UCS code point */
36916    int n_code;
36917
36918    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36919        mem_base = xmlMemBlocks();
36920        code = gen_int(n_code, 0);
36921
36922        ret_val = xmlUCSIsCatZl(code);
36923        desret_int(ret_val);
36924        call_tests++;
36925        des_int(n_code, code, 0);
36926        xmlResetLastError();
36927        if (mem_base != xmlMemBlocks()) {
36928            printf("Leak of %d blocks found in xmlUCSIsCatZl",
36929	           xmlMemBlocks() - mem_base);
36930	    test_ret++;
36931            printf(" %d", n_code);
36932            printf("\n");
36933        }
36934    }
36935    function_tests++;
36936#endif
36937
36938    return(test_ret);
36939}
36940
36941
36942static int
36943test_xmlUCSIsCatZp(void) {
36944    int test_ret = 0;
36945
36946#if defined(LIBXML_UNICODE_ENABLED)
36947    int mem_base;
36948    int ret_val;
36949    int code; /* UCS code point */
36950    int n_code;
36951
36952    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36953        mem_base = xmlMemBlocks();
36954        code = gen_int(n_code, 0);
36955
36956        ret_val = xmlUCSIsCatZp(code);
36957        desret_int(ret_val);
36958        call_tests++;
36959        des_int(n_code, code, 0);
36960        xmlResetLastError();
36961        if (mem_base != xmlMemBlocks()) {
36962            printf("Leak of %d blocks found in xmlUCSIsCatZp",
36963	           xmlMemBlocks() - mem_base);
36964	    test_ret++;
36965            printf(" %d", n_code);
36966            printf("\n");
36967        }
36968    }
36969    function_tests++;
36970#endif
36971
36972    return(test_ret);
36973}
36974
36975
36976static int
36977test_xmlUCSIsCatZs(void) {
36978    int test_ret = 0;
36979
36980#if defined(LIBXML_UNICODE_ENABLED)
36981    int mem_base;
36982    int ret_val;
36983    int code; /* UCS code point */
36984    int n_code;
36985
36986    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36987        mem_base = xmlMemBlocks();
36988        code = gen_int(n_code, 0);
36989
36990        ret_val = xmlUCSIsCatZs(code);
36991        desret_int(ret_val);
36992        call_tests++;
36993        des_int(n_code, code, 0);
36994        xmlResetLastError();
36995        if (mem_base != xmlMemBlocks()) {
36996            printf("Leak of %d blocks found in xmlUCSIsCatZs",
36997	           xmlMemBlocks() - mem_base);
36998	    test_ret++;
36999            printf(" %d", n_code);
37000            printf("\n");
37001        }
37002    }
37003    function_tests++;
37004#endif
37005
37006    return(test_ret);
37007}
37008
37009
37010static int
37011test_xmlUCSIsCherokee(void) {
37012    int test_ret = 0;
37013
37014#if defined(LIBXML_UNICODE_ENABLED)
37015    int mem_base;
37016    int ret_val;
37017    int code; /* UCS code point */
37018    int n_code;
37019
37020    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37021        mem_base = xmlMemBlocks();
37022        code = gen_int(n_code, 0);
37023
37024        ret_val = xmlUCSIsCherokee(code);
37025        desret_int(ret_val);
37026        call_tests++;
37027        des_int(n_code, code, 0);
37028        xmlResetLastError();
37029        if (mem_base != xmlMemBlocks()) {
37030            printf("Leak of %d blocks found in xmlUCSIsCherokee",
37031	           xmlMemBlocks() - mem_base);
37032	    test_ret++;
37033            printf(" %d", n_code);
37034            printf("\n");
37035        }
37036    }
37037    function_tests++;
37038#endif
37039
37040    return(test_ret);
37041}
37042
37043
37044static int
37045test_xmlUCSIsCombiningDiacriticalMarks(void) {
37046    int test_ret = 0;
37047
37048#if defined(LIBXML_UNICODE_ENABLED)
37049    int mem_base;
37050    int ret_val;
37051    int code; /* UCS code point */
37052    int n_code;
37053
37054    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37055        mem_base = xmlMemBlocks();
37056        code = gen_int(n_code, 0);
37057
37058        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
37059        desret_int(ret_val);
37060        call_tests++;
37061        des_int(n_code, code, 0);
37062        xmlResetLastError();
37063        if (mem_base != xmlMemBlocks()) {
37064            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
37065	           xmlMemBlocks() - mem_base);
37066	    test_ret++;
37067            printf(" %d", n_code);
37068            printf("\n");
37069        }
37070    }
37071    function_tests++;
37072#endif
37073
37074    return(test_ret);
37075}
37076
37077
37078static int
37079test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
37080    int test_ret = 0;
37081
37082#if defined(LIBXML_UNICODE_ENABLED)
37083    int mem_base;
37084    int ret_val;
37085    int code; /* UCS code point */
37086    int n_code;
37087
37088    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37089        mem_base = xmlMemBlocks();
37090        code = gen_int(n_code, 0);
37091
37092        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
37093        desret_int(ret_val);
37094        call_tests++;
37095        des_int(n_code, code, 0);
37096        xmlResetLastError();
37097        if (mem_base != xmlMemBlocks()) {
37098            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
37099	           xmlMemBlocks() - mem_base);
37100	    test_ret++;
37101            printf(" %d", n_code);
37102            printf("\n");
37103        }
37104    }
37105    function_tests++;
37106#endif
37107
37108    return(test_ret);
37109}
37110
37111
37112static int
37113test_xmlUCSIsCombiningHalfMarks(void) {
37114    int test_ret = 0;
37115
37116#if defined(LIBXML_UNICODE_ENABLED)
37117    int mem_base;
37118    int ret_val;
37119    int code; /* UCS code point */
37120    int n_code;
37121
37122    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37123        mem_base = xmlMemBlocks();
37124        code = gen_int(n_code, 0);
37125
37126        ret_val = xmlUCSIsCombiningHalfMarks(code);
37127        desret_int(ret_val);
37128        call_tests++;
37129        des_int(n_code, code, 0);
37130        xmlResetLastError();
37131        if (mem_base != xmlMemBlocks()) {
37132            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
37133	           xmlMemBlocks() - mem_base);
37134	    test_ret++;
37135            printf(" %d", n_code);
37136            printf("\n");
37137        }
37138    }
37139    function_tests++;
37140#endif
37141
37142    return(test_ret);
37143}
37144
37145
37146static int
37147test_xmlUCSIsCombiningMarksforSymbols(void) {
37148    int test_ret = 0;
37149
37150#if defined(LIBXML_UNICODE_ENABLED)
37151    int mem_base;
37152    int ret_val;
37153    int code; /* UCS code point */
37154    int n_code;
37155
37156    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37157        mem_base = xmlMemBlocks();
37158        code = gen_int(n_code, 0);
37159
37160        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
37161        desret_int(ret_val);
37162        call_tests++;
37163        des_int(n_code, code, 0);
37164        xmlResetLastError();
37165        if (mem_base != xmlMemBlocks()) {
37166            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
37167	           xmlMemBlocks() - mem_base);
37168	    test_ret++;
37169            printf(" %d", n_code);
37170            printf("\n");
37171        }
37172    }
37173    function_tests++;
37174#endif
37175
37176    return(test_ret);
37177}
37178
37179
37180static int
37181test_xmlUCSIsControlPictures(void) {
37182    int test_ret = 0;
37183
37184#if defined(LIBXML_UNICODE_ENABLED)
37185    int mem_base;
37186    int ret_val;
37187    int code; /* UCS code point */
37188    int n_code;
37189
37190    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37191        mem_base = xmlMemBlocks();
37192        code = gen_int(n_code, 0);
37193
37194        ret_val = xmlUCSIsControlPictures(code);
37195        desret_int(ret_val);
37196        call_tests++;
37197        des_int(n_code, code, 0);
37198        xmlResetLastError();
37199        if (mem_base != xmlMemBlocks()) {
37200            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
37201	           xmlMemBlocks() - mem_base);
37202	    test_ret++;
37203            printf(" %d", n_code);
37204            printf("\n");
37205        }
37206    }
37207    function_tests++;
37208#endif
37209
37210    return(test_ret);
37211}
37212
37213
37214static int
37215test_xmlUCSIsCurrencySymbols(void) {
37216    int test_ret = 0;
37217
37218#if defined(LIBXML_UNICODE_ENABLED)
37219    int mem_base;
37220    int ret_val;
37221    int code; /* UCS code point */
37222    int n_code;
37223
37224    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37225        mem_base = xmlMemBlocks();
37226        code = gen_int(n_code, 0);
37227
37228        ret_val = xmlUCSIsCurrencySymbols(code);
37229        desret_int(ret_val);
37230        call_tests++;
37231        des_int(n_code, code, 0);
37232        xmlResetLastError();
37233        if (mem_base != xmlMemBlocks()) {
37234            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
37235	           xmlMemBlocks() - mem_base);
37236	    test_ret++;
37237            printf(" %d", n_code);
37238            printf("\n");
37239        }
37240    }
37241    function_tests++;
37242#endif
37243
37244    return(test_ret);
37245}
37246
37247
37248static int
37249test_xmlUCSIsCypriotSyllabary(void) {
37250    int test_ret = 0;
37251
37252#if defined(LIBXML_UNICODE_ENABLED)
37253    int mem_base;
37254    int ret_val;
37255    int code; /* UCS code point */
37256    int n_code;
37257
37258    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37259        mem_base = xmlMemBlocks();
37260        code = gen_int(n_code, 0);
37261
37262        ret_val = xmlUCSIsCypriotSyllabary(code);
37263        desret_int(ret_val);
37264        call_tests++;
37265        des_int(n_code, code, 0);
37266        xmlResetLastError();
37267        if (mem_base != xmlMemBlocks()) {
37268            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
37269	           xmlMemBlocks() - mem_base);
37270	    test_ret++;
37271            printf(" %d", n_code);
37272            printf("\n");
37273        }
37274    }
37275    function_tests++;
37276#endif
37277
37278    return(test_ret);
37279}
37280
37281
37282static int
37283test_xmlUCSIsCyrillic(void) {
37284    int test_ret = 0;
37285
37286#if defined(LIBXML_UNICODE_ENABLED)
37287    int mem_base;
37288    int ret_val;
37289    int code; /* UCS code point */
37290    int n_code;
37291
37292    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37293        mem_base = xmlMemBlocks();
37294        code = gen_int(n_code, 0);
37295
37296        ret_val = xmlUCSIsCyrillic(code);
37297        desret_int(ret_val);
37298        call_tests++;
37299        des_int(n_code, code, 0);
37300        xmlResetLastError();
37301        if (mem_base != xmlMemBlocks()) {
37302            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
37303	           xmlMemBlocks() - mem_base);
37304	    test_ret++;
37305            printf(" %d", n_code);
37306            printf("\n");
37307        }
37308    }
37309    function_tests++;
37310#endif
37311
37312    return(test_ret);
37313}
37314
37315
37316static int
37317test_xmlUCSIsCyrillicSupplement(void) {
37318    int test_ret = 0;
37319
37320#if defined(LIBXML_UNICODE_ENABLED)
37321    int mem_base;
37322    int ret_val;
37323    int code; /* UCS code point */
37324    int n_code;
37325
37326    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37327        mem_base = xmlMemBlocks();
37328        code = gen_int(n_code, 0);
37329
37330        ret_val = xmlUCSIsCyrillicSupplement(code);
37331        desret_int(ret_val);
37332        call_tests++;
37333        des_int(n_code, code, 0);
37334        xmlResetLastError();
37335        if (mem_base != xmlMemBlocks()) {
37336            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
37337	           xmlMemBlocks() - mem_base);
37338	    test_ret++;
37339            printf(" %d", n_code);
37340            printf("\n");
37341        }
37342    }
37343    function_tests++;
37344#endif
37345
37346    return(test_ret);
37347}
37348
37349
37350static int
37351test_xmlUCSIsDeseret(void) {
37352    int test_ret = 0;
37353
37354#if defined(LIBXML_UNICODE_ENABLED)
37355    int mem_base;
37356    int ret_val;
37357    int code; /* UCS code point */
37358    int n_code;
37359
37360    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37361        mem_base = xmlMemBlocks();
37362        code = gen_int(n_code, 0);
37363
37364        ret_val = xmlUCSIsDeseret(code);
37365        desret_int(ret_val);
37366        call_tests++;
37367        des_int(n_code, code, 0);
37368        xmlResetLastError();
37369        if (mem_base != xmlMemBlocks()) {
37370            printf("Leak of %d blocks found in xmlUCSIsDeseret",
37371	           xmlMemBlocks() - mem_base);
37372	    test_ret++;
37373            printf(" %d", n_code);
37374            printf("\n");
37375        }
37376    }
37377    function_tests++;
37378#endif
37379
37380    return(test_ret);
37381}
37382
37383
37384static int
37385test_xmlUCSIsDevanagari(void) {
37386    int test_ret = 0;
37387
37388#if defined(LIBXML_UNICODE_ENABLED)
37389    int mem_base;
37390    int ret_val;
37391    int code; /* UCS code point */
37392    int n_code;
37393
37394    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37395        mem_base = xmlMemBlocks();
37396        code = gen_int(n_code, 0);
37397
37398        ret_val = xmlUCSIsDevanagari(code);
37399        desret_int(ret_val);
37400        call_tests++;
37401        des_int(n_code, code, 0);
37402        xmlResetLastError();
37403        if (mem_base != xmlMemBlocks()) {
37404            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
37405	           xmlMemBlocks() - mem_base);
37406	    test_ret++;
37407            printf(" %d", n_code);
37408            printf("\n");
37409        }
37410    }
37411    function_tests++;
37412#endif
37413
37414    return(test_ret);
37415}
37416
37417
37418static int
37419test_xmlUCSIsDingbats(void) {
37420    int test_ret = 0;
37421
37422#if defined(LIBXML_UNICODE_ENABLED)
37423    int mem_base;
37424    int ret_val;
37425    int code; /* UCS code point */
37426    int n_code;
37427
37428    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37429        mem_base = xmlMemBlocks();
37430        code = gen_int(n_code, 0);
37431
37432        ret_val = xmlUCSIsDingbats(code);
37433        desret_int(ret_val);
37434        call_tests++;
37435        des_int(n_code, code, 0);
37436        xmlResetLastError();
37437        if (mem_base != xmlMemBlocks()) {
37438            printf("Leak of %d blocks found in xmlUCSIsDingbats",
37439	           xmlMemBlocks() - mem_base);
37440	    test_ret++;
37441            printf(" %d", n_code);
37442            printf("\n");
37443        }
37444    }
37445    function_tests++;
37446#endif
37447
37448    return(test_ret);
37449}
37450
37451
37452static int
37453test_xmlUCSIsEnclosedAlphanumerics(void) {
37454    int test_ret = 0;
37455
37456#if defined(LIBXML_UNICODE_ENABLED)
37457    int mem_base;
37458    int ret_val;
37459    int code; /* UCS code point */
37460    int n_code;
37461
37462    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37463        mem_base = xmlMemBlocks();
37464        code = gen_int(n_code, 0);
37465
37466        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
37467        desret_int(ret_val);
37468        call_tests++;
37469        des_int(n_code, code, 0);
37470        xmlResetLastError();
37471        if (mem_base != xmlMemBlocks()) {
37472            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
37473	           xmlMemBlocks() - mem_base);
37474	    test_ret++;
37475            printf(" %d", n_code);
37476            printf("\n");
37477        }
37478    }
37479    function_tests++;
37480#endif
37481
37482    return(test_ret);
37483}
37484
37485
37486static int
37487test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
37488    int test_ret = 0;
37489
37490#if defined(LIBXML_UNICODE_ENABLED)
37491    int mem_base;
37492    int ret_val;
37493    int code; /* UCS code point */
37494    int n_code;
37495
37496    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37497        mem_base = xmlMemBlocks();
37498        code = gen_int(n_code, 0);
37499
37500        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
37501        desret_int(ret_val);
37502        call_tests++;
37503        des_int(n_code, code, 0);
37504        xmlResetLastError();
37505        if (mem_base != xmlMemBlocks()) {
37506            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
37507	           xmlMemBlocks() - mem_base);
37508	    test_ret++;
37509            printf(" %d", n_code);
37510            printf("\n");
37511        }
37512    }
37513    function_tests++;
37514#endif
37515
37516    return(test_ret);
37517}
37518
37519
37520static int
37521test_xmlUCSIsEthiopic(void) {
37522    int test_ret = 0;
37523
37524#if defined(LIBXML_UNICODE_ENABLED)
37525    int mem_base;
37526    int ret_val;
37527    int code; /* UCS code point */
37528    int n_code;
37529
37530    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37531        mem_base = xmlMemBlocks();
37532        code = gen_int(n_code, 0);
37533
37534        ret_val = xmlUCSIsEthiopic(code);
37535        desret_int(ret_val);
37536        call_tests++;
37537        des_int(n_code, code, 0);
37538        xmlResetLastError();
37539        if (mem_base != xmlMemBlocks()) {
37540            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
37541	           xmlMemBlocks() - mem_base);
37542	    test_ret++;
37543            printf(" %d", n_code);
37544            printf("\n");
37545        }
37546    }
37547    function_tests++;
37548#endif
37549
37550    return(test_ret);
37551}
37552
37553
37554static int
37555test_xmlUCSIsGeneralPunctuation(void) {
37556    int test_ret = 0;
37557
37558#if defined(LIBXML_UNICODE_ENABLED)
37559    int mem_base;
37560    int ret_val;
37561    int code; /* UCS code point */
37562    int n_code;
37563
37564    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37565        mem_base = xmlMemBlocks();
37566        code = gen_int(n_code, 0);
37567
37568        ret_val = xmlUCSIsGeneralPunctuation(code);
37569        desret_int(ret_val);
37570        call_tests++;
37571        des_int(n_code, code, 0);
37572        xmlResetLastError();
37573        if (mem_base != xmlMemBlocks()) {
37574            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
37575	           xmlMemBlocks() - mem_base);
37576	    test_ret++;
37577            printf(" %d", n_code);
37578            printf("\n");
37579        }
37580    }
37581    function_tests++;
37582#endif
37583
37584    return(test_ret);
37585}
37586
37587
37588static int
37589test_xmlUCSIsGeometricShapes(void) {
37590    int test_ret = 0;
37591
37592#if defined(LIBXML_UNICODE_ENABLED)
37593    int mem_base;
37594    int ret_val;
37595    int code; /* UCS code point */
37596    int n_code;
37597
37598    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37599        mem_base = xmlMemBlocks();
37600        code = gen_int(n_code, 0);
37601
37602        ret_val = xmlUCSIsGeometricShapes(code);
37603        desret_int(ret_val);
37604        call_tests++;
37605        des_int(n_code, code, 0);
37606        xmlResetLastError();
37607        if (mem_base != xmlMemBlocks()) {
37608            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
37609	           xmlMemBlocks() - mem_base);
37610	    test_ret++;
37611            printf(" %d", n_code);
37612            printf("\n");
37613        }
37614    }
37615    function_tests++;
37616#endif
37617
37618    return(test_ret);
37619}
37620
37621
37622static int
37623test_xmlUCSIsGeorgian(void) {
37624    int test_ret = 0;
37625
37626#if defined(LIBXML_UNICODE_ENABLED)
37627    int mem_base;
37628    int ret_val;
37629    int code; /* UCS code point */
37630    int n_code;
37631
37632    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37633        mem_base = xmlMemBlocks();
37634        code = gen_int(n_code, 0);
37635
37636        ret_val = xmlUCSIsGeorgian(code);
37637        desret_int(ret_val);
37638        call_tests++;
37639        des_int(n_code, code, 0);
37640        xmlResetLastError();
37641        if (mem_base != xmlMemBlocks()) {
37642            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
37643	           xmlMemBlocks() - mem_base);
37644	    test_ret++;
37645            printf(" %d", n_code);
37646            printf("\n");
37647        }
37648    }
37649    function_tests++;
37650#endif
37651
37652    return(test_ret);
37653}
37654
37655
37656static int
37657test_xmlUCSIsGothic(void) {
37658    int test_ret = 0;
37659
37660#if defined(LIBXML_UNICODE_ENABLED)
37661    int mem_base;
37662    int ret_val;
37663    int code; /* UCS code point */
37664    int n_code;
37665
37666    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37667        mem_base = xmlMemBlocks();
37668        code = gen_int(n_code, 0);
37669
37670        ret_val = xmlUCSIsGothic(code);
37671        desret_int(ret_val);
37672        call_tests++;
37673        des_int(n_code, code, 0);
37674        xmlResetLastError();
37675        if (mem_base != xmlMemBlocks()) {
37676            printf("Leak of %d blocks found in xmlUCSIsGothic",
37677	           xmlMemBlocks() - mem_base);
37678	    test_ret++;
37679            printf(" %d", n_code);
37680            printf("\n");
37681        }
37682    }
37683    function_tests++;
37684#endif
37685
37686    return(test_ret);
37687}
37688
37689
37690static int
37691test_xmlUCSIsGreek(void) {
37692    int test_ret = 0;
37693
37694#if defined(LIBXML_UNICODE_ENABLED)
37695    int mem_base;
37696    int ret_val;
37697    int code; /* UCS code point */
37698    int n_code;
37699
37700    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37701        mem_base = xmlMemBlocks();
37702        code = gen_int(n_code, 0);
37703
37704        ret_val = xmlUCSIsGreek(code);
37705        desret_int(ret_val);
37706        call_tests++;
37707        des_int(n_code, code, 0);
37708        xmlResetLastError();
37709        if (mem_base != xmlMemBlocks()) {
37710            printf("Leak of %d blocks found in xmlUCSIsGreek",
37711	           xmlMemBlocks() - mem_base);
37712	    test_ret++;
37713            printf(" %d", n_code);
37714            printf("\n");
37715        }
37716    }
37717    function_tests++;
37718#endif
37719
37720    return(test_ret);
37721}
37722
37723
37724static int
37725test_xmlUCSIsGreekExtended(void) {
37726    int test_ret = 0;
37727
37728#if defined(LIBXML_UNICODE_ENABLED)
37729    int mem_base;
37730    int ret_val;
37731    int code; /* UCS code point */
37732    int n_code;
37733
37734    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37735        mem_base = xmlMemBlocks();
37736        code = gen_int(n_code, 0);
37737
37738        ret_val = xmlUCSIsGreekExtended(code);
37739        desret_int(ret_val);
37740        call_tests++;
37741        des_int(n_code, code, 0);
37742        xmlResetLastError();
37743        if (mem_base != xmlMemBlocks()) {
37744            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
37745	           xmlMemBlocks() - mem_base);
37746	    test_ret++;
37747            printf(" %d", n_code);
37748            printf("\n");
37749        }
37750    }
37751    function_tests++;
37752#endif
37753
37754    return(test_ret);
37755}
37756
37757
37758static int
37759test_xmlUCSIsGreekandCoptic(void) {
37760    int test_ret = 0;
37761
37762#if defined(LIBXML_UNICODE_ENABLED)
37763    int mem_base;
37764    int ret_val;
37765    int code; /* UCS code point */
37766    int n_code;
37767
37768    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37769        mem_base = xmlMemBlocks();
37770        code = gen_int(n_code, 0);
37771
37772        ret_val = xmlUCSIsGreekandCoptic(code);
37773        desret_int(ret_val);
37774        call_tests++;
37775        des_int(n_code, code, 0);
37776        xmlResetLastError();
37777        if (mem_base != xmlMemBlocks()) {
37778            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
37779	           xmlMemBlocks() - mem_base);
37780	    test_ret++;
37781            printf(" %d", n_code);
37782            printf("\n");
37783        }
37784    }
37785    function_tests++;
37786#endif
37787
37788    return(test_ret);
37789}
37790
37791
37792static int
37793test_xmlUCSIsGujarati(void) {
37794    int test_ret = 0;
37795
37796#if defined(LIBXML_UNICODE_ENABLED)
37797    int mem_base;
37798    int ret_val;
37799    int code; /* UCS code point */
37800    int n_code;
37801
37802    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37803        mem_base = xmlMemBlocks();
37804        code = gen_int(n_code, 0);
37805
37806        ret_val = xmlUCSIsGujarati(code);
37807        desret_int(ret_val);
37808        call_tests++;
37809        des_int(n_code, code, 0);
37810        xmlResetLastError();
37811        if (mem_base != xmlMemBlocks()) {
37812            printf("Leak of %d blocks found in xmlUCSIsGujarati",
37813	           xmlMemBlocks() - mem_base);
37814	    test_ret++;
37815            printf(" %d", n_code);
37816            printf("\n");
37817        }
37818    }
37819    function_tests++;
37820#endif
37821
37822    return(test_ret);
37823}
37824
37825
37826static int
37827test_xmlUCSIsGurmukhi(void) {
37828    int test_ret = 0;
37829
37830#if defined(LIBXML_UNICODE_ENABLED)
37831    int mem_base;
37832    int ret_val;
37833    int code; /* UCS code point */
37834    int n_code;
37835
37836    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37837        mem_base = xmlMemBlocks();
37838        code = gen_int(n_code, 0);
37839
37840        ret_val = xmlUCSIsGurmukhi(code);
37841        desret_int(ret_val);
37842        call_tests++;
37843        des_int(n_code, code, 0);
37844        xmlResetLastError();
37845        if (mem_base != xmlMemBlocks()) {
37846            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
37847	           xmlMemBlocks() - mem_base);
37848	    test_ret++;
37849            printf(" %d", n_code);
37850            printf("\n");
37851        }
37852    }
37853    function_tests++;
37854#endif
37855
37856    return(test_ret);
37857}
37858
37859
37860static int
37861test_xmlUCSIsHalfwidthandFullwidthForms(void) {
37862    int test_ret = 0;
37863
37864#if defined(LIBXML_UNICODE_ENABLED)
37865    int mem_base;
37866    int ret_val;
37867    int code; /* UCS code point */
37868    int n_code;
37869
37870    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37871        mem_base = xmlMemBlocks();
37872        code = gen_int(n_code, 0);
37873
37874        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
37875        desret_int(ret_val);
37876        call_tests++;
37877        des_int(n_code, code, 0);
37878        xmlResetLastError();
37879        if (mem_base != xmlMemBlocks()) {
37880            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
37881	           xmlMemBlocks() - mem_base);
37882	    test_ret++;
37883            printf(" %d", n_code);
37884            printf("\n");
37885        }
37886    }
37887    function_tests++;
37888#endif
37889
37890    return(test_ret);
37891}
37892
37893
37894static int
37895test_xmlUCSIsHangulCompatibilityJamo(void) {
37896    int test_ret = 0;
37897
37898#if defined(LIBXML_UNICODE_ENABLED)
37899    int mem_base;
37900    int ret_val;
37901    int code; /* UCS code point */
37902    int n_code;
37903
37904    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37905        mem_base = xmlMemBlocks();
37906        code = gen_int(n_code, 0);
37907
37908        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
37909        desret_int(ret_val);
37910        call_tests++;
37911        des_int(n_code, code, 0);
37912        xmlResetLastError();
37913        if (mem_base != xmlMemBlocks()) {
37914            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
37915	           xmlMemBlocks() - mem_base);
37916	    test_ret++;
37917            printf(" %d", n_code);
37918            printf("\n");
37919        }
37920    }
37921    function_tests++;
37922#endif
37923
37924    return(test_ret);
37925}
37926
37927
37928static int
37929test_xmlUCSIsHangulJamo(void) {
37930    int test_ret = 0;
37931
37932#if defined(LIBXML_UNICODE_ENABLED)
37933    int mem_base;
37934    int ret_val;
37935    int code; /* UCS code point */
37936    int n_code;
37937
37938    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37939        mem_base = xmlMemBlocks();
37940        code = gen_int(n_code, 0);
37941
37942        ret_val = xmlUCSIsHangulJamo(code);
37943        desret_int(ret_val);
37944        call_tests++;
37945        des_int(n_code, code, 0);
37946        xmlResetLastError();
37947        if (mem_base != xmlMemBlocks()) {
37948            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
37949	           xmlMemBlocks() - mem_base);
37950	    test_ret++;
37951            printf(" %d", n_code);
37952            printf("\n");
37953        }
37954    }
37955    function_tests++;
37956#endif
37957
37958    return(test_ret);
37959}
37960
37961
37962static int
37963test_xmlUCSIsHangulSyllables(void) {
37964    int test_ret = 0;
37965
37966#if defined(LIBXML_UNICODE_ENABLED)
37967    int mem_base;
37968    int ret_val;
37969    int code; /* UCS code point */
37970    int n_code;
37971
37972    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37973        mem_base = xmlMemBlocks();
37974        code = gen_int(n_code, 0);
37975
37976        ret_val = xmlUCSIsHangulSyllables(code);
37977        desret_int(ret_val);
37978        call_tests++;
37979        des_int(n_code, code, 0);
37980        xmlResetLastError();
37981        if (mem_base != xmlMemBlocks()) {
37982            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
37983	           xmlMemBlocks() - mem_base);
37984	    test_ret++;
37985            printf(" %d", n_code);
37986            printf("\n");
37987        }
37988    }
37989    function_tests++;
37990#endif
37991
37992    return(test_ret);
37993}
37994
37995
37996static int
37997test_xmlUCSIsHanunoo(void) {
37998    int test_ret = 0;
37999
38000#if defined(LIBXML_UNICODE_ENABLED)
38001    int mem_base;
38002    int ret_val;
38003    int code; /* UCS code point */
38004    int n_code;
38005
38006    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38007        mem_base = xmlMemBlocks();
38008        code = gen_int(n_code, 0);
38009
38010        ret_val = xmlUCSIsHanunoo(code);
38011        desret_int(ret_val);
38012        call_tests++;
38013        des_int(n_code, code, 0);
38014        xmlResetLastError();
38015        if (mem_base != xmlMemBlocks()) {
38016            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
38017	           xmlMemBlocks() - mem_base);
38018	    test_ret++;
38019            printf(" %d", n_code);
38020            printf("\n");
38021        }
38022    }
38023    function_tests++;
38024#endif
38025
38026    return(test_ret);
38027}
38028
38029
38030static int
38031test_xmlUCSIsHebrew(void) {
38032    int test_ret = 0;
38033
38034#if defined(LIBXML_UNICODE_ENABLED)
38035    int mem_base;
38036    int ret_val;
38037    int code; /* UCS code point */
38038    int n_code;
38039
38040    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38041        mem_base = xmlMemBlocks();
38042        code = gen_int(n_code, 0);
38043
38044        ret_val = xmlUCSIsHebrew(code);
38045        desret_int(ret_val);
38046        call_tests++;
38047        des_int(n_code, code, 0);
38048        xmlResetLastError();
38049        if (mem_base != xmlMemBlocks()) {
38050            printf("Leak of %d blocks found in xmlUCSIsHebrew",
38051	           xmlMemBlocks() - mem_base);
38052	    test_ret++;
38053            printf(" %d", n_code);
38054            printf("\n");
38055        }
38056    }
38057    function_tests++;
38058#endif
38059
38060    return(test_ret);
38061}
38062
38063
38064static int
38065test_xmlUCSIsHighPrivateUseSurrogates(void) {
38066    int test_ret = 0;
38067
38068#if defined(LIBXML_UNICODE_ENABLED)
38069    int mem_base;
38070    int ret_val;
38071    int code; /* UCS code point */
38072    int n_code;
38073
38074    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38075        mem_base = xmlMemBlocks();
38076        code = gen_int(n_code, 0);
38077
38078        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
38079        desret_int(ret_val);
38080        call_tests++;
38081        des_int(n_code, code, 0);
38082        xmlResetLastError();
38083        if (mem_base != xmlMemBlocks()) {
38084            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
38085	           xmlMemBlocks() - mem_base);
38086	    test_ret++;
38087            printf(" %d", n_code);
38088            printf("\n");
38089        }
38090    }
38091    function_tests++;
38092#endif
38093
38094    return(test_ret);
38095}
38096
38097
38098static int
38099test_xmlUCSIsHighSurrogates(void) {
38100    int test_ret = 0;
38101
38102#if defined(LIBXML_UNICODE_ENABLED)
38103    int mem_base;
38104    int ret_val;
38105    int code; /* UCS code point */
38106    int n_code;
38107
38108    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38109        mem_base = xmlMemBlocks();
38110        code = gen_int(n_code, 0);
38111
38112        ret_val = xmlUCSIsHighSurrogates(code);
38113        desret_int(ret_val);
38114        call_tests++;
38115        des_int(n_code, code, 0);
38116        xmlResetLastError();
38117        if (mem_base != xmlMemBlocks()) {
38118            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
38119	           xmlMemBlocks() - mem_base);
38120	    test_ret++;
38121            printf(" %d", n_code);
38122            printf("\n");
38123        }
38124    }
38125    function_tests++;
38126#endif
38127
38128    return(test_ret);
38129}
38130
38131
38132static int
38133test_xmlUCSIsHiragana(void) {
38134    int test_ret = 0;
38135
38136#if defined(LIBXML_UNICODE_ENABLED)
38137    int mem_base;
38138    int ret_val;
38139    int code; /* UCS code point */
38140    int n_code;
38141
38142    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38143        mem_base = xmlMemBlocks();
38144        code = gen_int(n_code, 0);
38145
38146        ret_val = xmlUCSIsHiragana(code);
38147        desret_int(ret_val);
38148        call_tests++;
38149        des_int(n_code, code, 0);
38150        xmlResetLastError();
38151        if (mem_base != xmlMemBlocks()) {
38152            printf("Leak of %d blocks found in xmlUCSIsHiragana",
38153	           xmlMemBlocks() - mem_base);
38154	    test_ret++;
38155            printf(" %d", n_code);
38156            printf("\n");
38157        }
38158    }
38159    function_tests++;
38160#endif
38161
38162    return(test_ret);
38163}
38164
38165
38166static int
38167test_xmlUCSIsIPAExtensions(void) {
38168    int test_ret = 0;
38169
38170#if defined(LIBXML_UNICODE_ENABLED)
38171    int mem_base;
38172    int ret_val;
38173    int code; /* UCS code point */
38174    int n_code;
38175
38176    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38177        mem_base = xmlMemBlocks();
38178        code = gen_int(n_code, 0);
38179
38180        ret_val = xmlUCSIsIPAExtensions(code);
38181        desret_int(ret_val);
38182        call_tests++;
38183        des_int(n_code, code, 0);
38184        xmlResetLastError();
38185        if (mem_base != xmlMemBlocks()) {
38186            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
38187	           xmlMemBlocks() - mem_base);
38188	    test_ret++;
38189            printf(" %d", n_code);
38190            printf("\n");
38191        }
38192    }
38193    function_tests++;
38194#endif
38195
38196    return(test_ret);
38197}
38198
38199
38200static int
38201test_xmlUCSIsIdeographicDescriptionCharacters(void) {
38202    int test_ret = 0;
38203
38204#if defined(LIBXML_UNICODE_ENABLED)
38205    int mem_base;
38206    int ret_val;
38207    int code; /* UCS code point */
38208    int n_code;
38209
38210    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38211        mem_base = xmlMemBlocks();
38212        code = gen_int(n_code, 0);
38213
38214        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
38215        desret_int(ret_val);
38216        call_tests++;
38217        des_int(n_code, code, 0);
38218        xmlResetLastError();
38219        if (mem_base != xmlMemBlocks()) {
38220            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
38221	           xmlMemBlocks() - mem_base);
38222	    test_ret++;
38223            printf(" %d", n_code);
38224            printf("\n");
38225        }
38226    }
38227    function_tests++;
38228#endif
38229
38230    return(test_ret);
38231}
38232
38233
38234static int
38235test_xmlUCSIsKanbun(void) {
38236    int test_ret = 0;
38237
38238#if defined(LIBXML_UNICODE_ENABLED)
38239    int mem_base;
38240    int ret_val;
38241    int code; /* UCS code point */
38242    int n_code;
38243
38244    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38245        mem_base = xmlMemBlocks();
38246        code = gen_int(n_code, 0);
38247
38248        ret_val = xmlUCSIsKanbun(code);
38249        desret_int(ret_val);
38250        call_tests++;
38251        des_int(n_code, code, 0);
38252        xmlResetLastError();
38253        if (mem_base != xmlMemBlocks()) {
38254            printf("Leak of %d blocks found in xmlUCSIsKanbun",
38255	           xmlMemBlocks() - mem_base);
38256	    test_ret++;
38257            printf(" %d", n_code);
38258            printf("\n");
38259        }
38260    }
38261    function_tests++;
38262#endif
38263
38264    return(test_ret);
38265}
38266
38267
38268static int
38269test_xmlUCSIsKangxiRadicals(void) {
38270    int test_ret = 0;
38271
38272#if defined(LIBXML_UNICODE_ENABLED)
38273    int mem_base;
38274    int ret_val;
38275    int code; /* UCS code point */
38276    int n_code;
38277
38278    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38279        mem_base = xmlMemBlocks();
38280        code = gen_int(n_code, 0);
38281
38282        ret_val = xmlUCSIsKangxiRadicals(code);
38283        desret_int(ret_val);
38284        call_tests++;
38285        des_int(n_code, code, 0);
38286        xmlResetLastError();
38287        if (mem_base != xmlMemBlocks()) {
38288            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
38289	           xmlMemBlocks() - mem_base);
38290	    test_ret++;
38291            printf(" %d", n_code);
38292            printf("\n");
38293        }
38294    }
38295    function_tests++;
38296#endif
38297
38298    return(test_ret);
38299}
38300
38301
38302static int
38303test_xmlUCSIsKannada(void) {
38304    int test_ret = 0;
38305
38306#if defined(LIBXML_UNICODE_ENABLED)
38307    int mem_base;
38308    int ret_val;
38309    int code; /* UCS code point */
38310    int n_code;
38311
38312    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38313        mem_base = xmlMemBlocks();
38314        code = gen_int(n_code, 0);
38315
38316        ret_val = xmlUCSIsKannada(code);
38317        desret_int(ret_val);
38318        call_tests++;
38319        des_int(n_code, code, 0);
38320        xmlResetLastError();
38321        if (mem_base != xmlMemBlocks()) {
38322            printf("Leak of %d blocks found in xmlUCSIsKannada",
38323	           xmlMemBlocks() - mem_base);
38324	    test_ret++;
38325            printf(" %d", n_code);
38326            printf("\n");
38327        }
38328    }
38329    function_tests++;
38330#endif
38331
38332    return(test_ret);
38333}
38334
38335
38336static int
38337test_xmlUCSIsKatakana(void) {
38338    int test_ret = 0;
38339
38340#if defined(LIBXML_UNICODE_ENABLED)
38341    int mem_base;
38342    int ret_val;
38343    int code; /* UCS code point */
38344    int n_code;
38345
38346    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38347        mem_base = xmlMemBlocks();
38348        code = gen_int(n_code, 0);
38349
38350        ret_val = xmlUCSIsKatakana(code);
38351        desret_int(ret_val);
38352        call_tests++;
38353        des_int(n_code, code, 0);
38354        xmlResetLastError();
38355        if (mem_base != xmlMemBlocks()) {
38356            printf("Leak of %d blocks found in xmlUCSIsKatakana",
38357	           xmlMemBlocks() - mem_base);
38358	    test_ret++;
38359            printf(" %d", n_code);
38360            printf("\n");
38361        }
38362    }
38363    function_tests++;
38364#endif
38365
38366    return(test_ret);
38367}
38368
38369
38370static int
38371test_xmlUCSIsKatakanaPhoneticExtensions(void) {
38372    int test_ret = 0;
38373
38374#if defined(LIBXML_UNICODE_ENABLED)
38375    int mem_base;
38376    int ret_val;
38377    int code; /* UCS code point */
38378    int n_code;
38379
38380    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38381        mem_base = xmlMemBlocks();
38382        code = gen_int(n_code, 0);
38383
38384        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
38385        desret_int(ret_val);
38386        call_tests++;
38387        des_int(n_code, code, 0);
38388        xmlResetLastError();
38389        if (mem_base != xmlMemBlocks()) {
38390            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
38391	           xmlMemBlocks() - mem_base);
38392	    test_ret++;
38393            printf(" %d", n_code);
38394            printf("\n");
38395        }
38396    }
38397    function_tests++;
38398#endif
38399
38400    return(test_ret);
38401}
38402
38403
38404static int
38405test_xmlUCSIsKhmer(void) {
38406    int test_ret = 0;
38407
38408#if defined(LIBXML_UNICODE_ENABLED)
38409    int mem_base;
38410    int ret_val;
38411    int code; /* UCS code point */
38412    int n_code;
38413
38414    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38415        mem_base = xmlMemBlocks();
38416        code = gen_int(n_code, 0);
38417
38418        ret_val = xmlUCSIsKhmer(code);
38419        desret_int(ret_val);
38420        call_tests++;
38421        des_int(n_code, code, 0);
38422        xmlResetLastError();
38423        if (mem_base != xmlMemBlocks()) {
38424            printf("Leak of %d blocks found in xmlUCSIsKhmer",
38425	           xmlMemBlocks() - mem_base);
38426	    test_ret++;
38427            printf(" %d", n_code);
38428            printf("\n");
38429        }
38430    }
38431    function_tests++;
38432#endif
38433
38434    return(test_ret);
38435}
38436
38437
38438static int
38439test_xmlUCSIsKhmerSymbols(void) {
38440    int test_ret = 0;
38441
38442#if defined(LIBXML_UNICODE_ENABLED)
38443    int mem_base;
38444    int ret_val;
38445    int code; /* UCS code point */
38446    int n_code;
38447
38448    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38449        mem_base = xmlMemBlocks();
38450        code = gen_int(n_code, 0);
38451
38452        ret_val = xmlUCSIsKhmerSymbols(code);
38453        desret_int(ret_val);
38454        call_tests++;
38455        des_int(n_code, code, 0);
38456        xmlResetLastError();
38457        if (mem_base != xmlMemBlocks()) {
38458            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
38459	           xmlMemBlocks() - mem_base);
38460	    test_ret++;
38461            printf(" %d", n_code);
38462            printf("\n");
38463        }
38464    }
38465    function_tests++;
38466#endif
38467
38468    return(test_ret);
38469}
38470
38471
38472static int
38473test_xmlUCSIsLao(void) {
38474    int test_ret = 0;
38475
38476#if defined(LIBXML_UNICODE_ENABLED)
38477    int mem_base;
38478    int ret_val;
38479    int code; /* UCS code point */
38480    int n_code;
38481
38482    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38483        mem_base = xmlMemBlocks();
38484        code = gen_int(n_code, 0);
38485
38486        ret_val = xmlUCSIsLao(code);
38487        desret_int(ret_val);
38488        call_tests++;
38489        des_int(n_code, code, 0);
38490        xmlResetLastError();
38491        if (mem_base != xmlMemBlocks()) {
38492            printf("Leak of %d blocks found in xmlUCSIsLao",
38493	           xmlMemBlocks() - mem_base);
38494	    test_ret++;
38495            printf(" %d", n_code);
38496            printf("\n");
38497        }
38498    }
38499    function_tests++;
38500#endif
38501
38502    return(test_ret);
38503}
38504
38505
38506static int
38507test_xmlUCSIsLatin1Supplement(void) {
38508    int test_ret = 0;
38509
38510#if defined(LIBXML_UNICODE_ENABLED)
38511    int mem_base;
38512    int ret_val;
38513    int code; /* UCS code point */
38514    int n_code;
38515
38516    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38517        mem_base = xmlMemBlocks();
38518        code = gen_int(n_code, 0);
38519
38520        ret_val = xmlUCSIsLatin1Supplement(code);
38521        desret_int(ret_val);
38522        call_tests++;
38523        des_int(n_code, code, 0);
38524        xmlResetLastError();
38525        if (mem_base != xmlMemBlocks()) {
38526            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
38527	           xmlMemBlocks() - mem_base);
38528	    test_ret++;
38529            printf(" %d", n_code);
38530            printf("\n");
38531        }
38532    }
38533    function_tests++;
38534#endif
38535
38536    return(test_ret);
38537}
38538
38539
38540static int
38541test_xmlUCSIsLatinExtendedA(void) {
38542    int test_ret = 0;
38543
38544#if defined(LIBXML_UNICODE_ENABLED)
38545    int mem_base;
38546    int ret_val;
38547    int code; /* UCS code point */
38548    int n_code;
38549
38550    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38551        mem_base = xmlMemBlocks();
38552        code = gen_int(n_code, 0);
38553
38554        ret_val = xmlUCSIsLatinExtendedA(code);
38555        desret_int(ret_val);
38556        call_tests++;
38557        des_int(n_code, code, 0);
38558        xmlResetLastError();
38559        if (mem_base != xmlMemBlocks()) {
38560            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
38561	           xmlMemBlocks() - mem_base);
38562	    test_ret++;
38563            printf(" %d", n_code);
38564            printf("\n");
38565        }
38566    }
38567    function_tests++;
38568#endif
38569
38570    return(test_ret);
38571}
38572
38573
38574static int
38575test_xmlUCSIsLatinExtendedAdditional(void) {
38576    int test_ret = 0;
38577
38578#if defined(LIBXML_UNICODE_ENABLED)
38579    int mem_base;
38580    int ret_val;
38581    int code; /* UCS code point */
38582    int n_code;
38583
38584    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38585        mem_base = xmlMemBlocks();
38586        code = gen_int(n_code, 0);
38587
38588        ret_val = xmlUCSIsLatinExtendedAdditional(code);
38589        desret_int(ret_val);
38590        call_tests++;
38591        des_int(n_code, code, 0);
38592        xmlResetLastError();
38593        if (mem_base != xmlMemBlocks()) {
38594            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
38595	           xmlMemBlocks() - mem_base);
38596	    test_ret++;
38597            printf(" %d", n_code);
38598            printf("\n");
38599        }
38600    }
38601    function_tests++;
38602#endif
38603
38604    return(test_ret);
38605}
38606
38607
38608static int
38609test_xmlUCSIsLatinExtendedB(void) {
38610    int test_ret = 0;
38611
38612#if defined(LIBXML_UNICODE_ENABLED)
38613    int mem_base;
38614    int ret_val;
38615    int code; /* UCS code point */
38616    int n_code;
38617
38618    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38619        mem_base = xmlMemBlocks();
38620        code = gen_int(n_code, 0);
38621
38622        ret_val = xmlUCSIsLatinExtendedB(code);
38623        desret_int(ret_val);
38624        call_tests++;
38625        des_int(n_code, code, 0);
38626        xmlResetLastError();
38627        if (mem_base != xmlMemBlocks()) {
38628            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
38629	           xmlMemBlocks() - mem_base);
38630	    test_ret++;
38631            printf(" %d", n_code);
38632            printf("\n");
38633        }
38634    }
38635    function_tests++;
38636#endif
38637
38638    return(test_ret);
38639}
38640
38641
38642static int
38643test_xmlUCSIsLetterlikeSymbols(void) {
38644    int test_ret = 0;
38645
38646#if defined(LIBXML_UNICODE_ENABLED)
38647    int mem_base;
38648    int ret_val;
38649    int code; /* UCS code point */
38650    int n_code;
38651
38652    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38653        mem_base = xmlMemBlocks();
38654        code = gen_int(n_code, 0);
38655
38656        ret_val = xmlUCSIsLetterlikeSymbols(code);
38657        desret_int(ret_val);
38658        call_tests++;
38659        des_int(n_code, code, 0);
38660        xmlResetLastError();
38661        if (mem_base != xmlMemBlocks()) {
38662            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
38663	           xmlMemBlocks() - mem_base);
38664	    test_ret++;
38665            printf(" %d", n_code);
38666            printf("\n");
38667        }
38668    }
38669    function_tests++;
38670#endif
38671
38672    return(test_ret);
38673}
38674
38675
38676static int
38677test_xmlUCSIsLimbu(void) {
38678    int test_ret = 0;
38679
38680#if defined(LIBXML_UNICODE_ENABLED)
38681    int mem_base;
38682    int ret_val;
38683    int code; /* UCS code point */
38684    int n_code;
38685
38686    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38687        mem_base = xmlMemBlocks();
38688        code = gen_int(n_code, 0);
38689
38690        ret_val = xmlUCSIsLimbu(code);
38691        desret_int(ret_val);
38692        call_tests++;
38693        des_int(n_code, code, 0);
38694        xmlResetLastError();
38695        if (mem_base != xmlMemBlocks()) {
38696            printf("Leak of %d blocks found in xmlUCSIsLimbu",
38697	           xmlMemBlocks() - mem_base);
38698	    test_ret++;
38699            printf(" %d", n_code);
38700            printf("\n");
38701        }
38702    }
38703    function_tests++;
38704#endif
38705
38706    return(test_ret);
38707}
38708
38709
38710static int
38711test_xmlUCSIsLinearBIdeograms(void) {
38712    int test_ret = 0;
38713
38714#if defined(LIBXML_UNICODE_ENABLED)
38715    int mem_base;
38716    int ret_val;
38717    int code; /* UCS code point */
38718    int n_code;
38719
38720    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38721        mem_base = xmlMemBlocks();
38722        code = gen_int(n_code, 0);
38723
38724        ret_val = xmlUCSIsLinearBIdeograms(code);
38725        desret_int(ret_val);
38726        call_tests++;
38727        des_int(n_code, code, 0);
38728        xmlResetLastError();
38729        if (mem_base != xmlMemBlocks()) {
38730            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
38731	           xmlMemBlocks() - mem_base);
38732	    test_ret++;
38733            printf(" %d", n_code);
38734            printf("\n");
38735        }
38736    }
38737    function_tests++;
38738#endif
38739
38740    return(test_ret);
38741}
38742
38743
38744static int
38745test_xmlUCSIsLinearBSyllabary(void) {
38746    int test_ret = 0;
38747
38748#if defined(LIBXML_UNICODE_ENABLED)
38749    int mem_base;
38750    int ret_val;
38751    int code; /* UCS code point */
38752    int n_code;
38753
38754    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38755        mem_base = xmlMemBlocks();
38756        code = gen_int(n_code, 0);
38757
38758        ret_val = xmlUCSIsLinearBSyllabary(code);
38759        desret_int(ret_val);
38760        call_tests++;
38761        des_int(n_code, code, 0);
38762        xmlResetLastError();
38763        if (mem_base != xmlMemBlocks()) {
38764            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
38765	           xmlMemBlocks() - mem_base);
38766	    test_ret++;
38767            printf(" %d", n_code);
38768            printf("\n");
38769        }
38770    }
38771    function_tests++;
38772#endif
38773
38774    return(test_ret);
38775}
38776
38777
38778static int
38779test_xmlUCSIsLowSurrogates(void) {
38780    int test_ret = 0;
38781
38782#if defined(LIBXML_UNICODE_ENABLED)
38783    int mem_base;
38784    int ret_val;
38785    int code; /* UCS code point */
38786    int n_code;
38787
38788    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38789        mem_base = xmlMemBlocks();
38790        code = gen_int(n_code, 0);
38791
38792        ret_val = xmlUCSIsLowSurrogates(code);
38793        desret_int(ret_val);
38794        call_tests++;
38795        des_int(n_code, code, 0);
38796        xmlResetLastError();
38797        if (mem_base != xmlMemBlocks()) {
38798            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
38799	           xmlMemBlocks() - mem_base);
38800	    test_ret++;
38801            printf(" %d", n_code);
38802            printf("\n");
38803        }
38804    }
38805    function_tests++;
38806#endif
38807
38808    return(test_ret);
38809}
38810
38811
38812static int
38813test_xmlUCSIsMalayalam(void) {
38814    int test_ret = 0;
38815
38816#if defined(LIBXML_UNICODE_ENABLED)
38817    int mem_base;
38818    int ret_val;
38819    int code; /* UCS code point */
38820    int n_code;
38821
38822    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38823        mem_base = xmlMemBlocks();
38824        code = gen_int(n_code, 0);
38825
38826        ret_val = xmlUCSIsMalayalam(code);
38827        desret_int(ret_val);
38828        call_tests++;
38829        des_int(n_code, code, 0);
38830        xmlResetLastError();
38831        if (mem_base != xmlMemBlocks()) {
38832            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
38833	           xmlMemBlocks() - mem_base);
38834	    test_ret++;
38835            printf(" %d", n_code);
38836            printf("\n");
38837        }
38838    }
38839    function_tests++;
38840#endif
38841
38842    return(test_ret);
38843}
38844
38845
38846static int
38847test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
38848    int test_ret = 0;
38849
38850#if defined(LIBXML_UNICODE_ENABLED)
38851    int mem_base;
38852    int ret_val;
38853    int code; /* UCS code point */
38854    int n_code;
38855
38856    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38857        mem_base = xmlMemBlocks();
38858        code = gen_int(n_code, 0);
38859
38860        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
38861        desret_int(ret_val);
38862        call_tests++;
38863        des_int(n_code, code, 0);
38864        xmlResetLastError();
38865        if (mem_base != xmlMemBlocks()) {
38866            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
38867	           xmlMemBlocks() - mem_base);
38868	    test_ret++;
38869            printf(" %d", n_code);
38870            printf("\n");
38871        }
38872    }
38873    function_tests++;
38874#endif
38875
38876    return(test_ret);
38877}
38878
38879
38880static int
38881test_xmlUCSIsMathematicalOperators(void) {
38882    int test_ret = 0;
38883
38884#if defined(LIBXML_UNICODE_ENABLED)
38885    int mem_base;
38886    int ret_val;
38887    int code; /* UCS code point */
38888    int n_code;
38889
38890    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38891        mem_base = xmlMemBlocks();
38892        code = gen_int(n_code, 0);
38893
38894        ret_val = xmlUCSIsMathematicalOperators(code);
38895        desret_int(ret_val);
38896        call_tests++;
38897        des_int(n_code, code, 0);
38898        xmlResetLastError();
38899        if (mem_base != xmlMemBlocks()) {
38900            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
38901	           xmlMemBlocks() - mem_base);
38902	    test_ret++;
38903            printf(" %d", n_code);
38904            printf("\n");
38905        }
38906    }
38907    function_tests++;
38908#endif
38909
38910    return(test_ret);
38911}
38912
38913
38914static int
38915test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
38916    int test_ret = 0;
38917
38918#if defined(LIBXML_UNICODE_ENABLED)
38919    int mem_base;
38920    int ret_val;
38921    int code; /* UCS code point */
38922    int n_code;
38923
38924    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38925        mem_base = xmlMemBlocks();
38926        code = gen_int(n_code, 0);
38927
38928        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
38929        desret_int(ret_val);
38930        call_tests++;
38931        des_int(n_code, code, 0);
38932        xmlResetLastError();
38933        if (mem_base != xmlMemBlocks()) {
38934            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
38935	           xmlMemBlocks() - mem_base);
38936	    test_ret++;
38937            printf(" %d", n_code);
38938            printf("\n");
38939        }
38940    }
38941    function_tests++;
38942#endif
38943
38944    return(test_ret);
38945}
38946
38947
38948static int
38949test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
38950    int test_ret = 0;
38951
38952#if defined(LIBXML_UNICODE_ENABLED)
38953    int mem_base;
38954    int ret_val;
38955    int code; /* UCS code point */
38956    int n_code;
38957
38958    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38959        mem_base = xmlMemBlocks();
38960        code = gen_int(n_code, 0);
38961
38962        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
38963        desret_int(ret_val);
38964        call_tests++;
38965        des_int(n_code, code, 0);
38966        xmlResetLastError();
38967        if (mem_base != xmlMemBlocks()) {
38968            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
38969	           xmlMemBlocks() - mem_base);
38970	    test_ret++;
38971            printf(" %d", n_code);
38972            printf("\n");
38973        }
38974    }
38975    function_tests++;
38976#endif
38977
38978    return(test_ret);
38979}
38980
38981
38982static int
38983test_xmlUCSIsMiscellaneousSymbols(void) {
38984    int test_ret = 0;
38985
38986#if defined(LIBXML_UNICODE_ENABLED)
38987    int mem_base;
38988    int ret_val;
38989    int code; /* UCS code point */
38990    int n_code;
38991
38992    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38993        mem_base = xmlMemBlocks();
38994        code = gen_int(n_code, 0);
38995
38996        ret_val = xmlUCSIsMiscellaneousSymbols(code);
38997        desret_int(ret_val);
38998        call_tests++;
38999        des_int(n_code, code, 0);
39000        xmlResetLastError();
39001        if (mem_base != xmlMemBlocks()) {
39002            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
39003	           xmlMemBlocks() - mem_base);
39004	    test_ret++;
39005            printf(" %d", n_code);
39006            printf("\n");
39007        }
39008    }
39009    function_tests++;
39010#endif
39011
39012    return(test_ret);
39013}
39014
39015
39016static int
39017test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
39018    int test_ret = 0;
39019
39020#if defined(LIBXML_UNICODE_ENABLED)
39021    int mem_base;
39022    int ret_val;
39023    int code; /* UCS code point */
39024    int n_code;
39025
39026    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39027        mem_base = xmlMemBlocks();
39028        code = gen_int(n_code, 0);
39029
39030        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
39031        desret_int(ret_val);
39032        call_tests++;
39033        des_int(n_code, code, 0);
39034        xmlResetLastError();
39035        if (mem_base != xmlMemBlocks()) {
39036            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
39037	           xmlMemBlocks() - mem_base);
39038	    test_ret++;
39039            printf(" %d", n_code);
39040            printf("\n");
39041        }
39042    }
39043    function_tests++;
39044#endif
39045
39046    return(test_ret);
39047}
39048
39049
39050static int
39051test_xmlUCSIsMiscellaneousTechnical(void) {
39052    int test_ret = 0;
39053
39054#if defined(LIBXML_UNICODE_ENABLED)
39055    int mem_base;
39056    int ret_val;
39057    int code; /* UCS code point */
39058    int n_code;
39059
39060    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39061        mem_base = xmlMemBlocks();
39062        code = gen_int(n_code, 0);
39063
39064        ret_val = xmlUCSIsMiscellaneousTechnical(code);
39065        desret_int(ret_val);
39066        call_tests++;
39067        des_int(n_code, code, 0);
39068        xmlResetLastError();
39069        if (mem_base != xmlMemBlocks()) {
39070            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
39071	           xmlMemBlocks() - mem_base);
39072	    test_ret++;
39073            printf(" %d", n_code);
39074            printf("\n");
39075        }
39076    }
39077    function_tests++;
39078#endif
39079
39080    return(test_ret);
39081}
39082
39083
39084static int
39085test_xmlUCSIsMongolian(void) {
39086    int test_ret = 0;
39087
39088#if defined(LIBXML_UNICODE_ENABLED)
39089    int mem_base;
39090    int ret_val;
39091    int code; /* UCS code point */
39092    int n_code;
39093
39094    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39095        mem_base = xmlMemBlocks();
39096        code = gen_int(n_code, 0);
39097
39098        ret_val = xmlUCSIsMongolian(code);
39099        desret_int(ret_val);
39100        call_tests++;
39101        des_int(n_code, code, 0);
39102        xmlResetLastError();
39103        if (mem_base != xmlMemBlocks()) {
39104            printf("Leak of %d blocks found in xmlUCSIsMongolian",
39105	           xmlMemBlocks() - mem_base);
39106	    test_ret++;
39107            printf(" %d", n_code);
39108            printf("\n");
39109        }
39110    }
39111    function_tests++;
39112#endif
39113
39114    return(test_ret);
39115}
39116
39117
39118static int
39119test_xmlUCSIsMusicalSymbols(void) {
39120    int test_ret = 0;
39121
39122#if defined(LIBXML_UNICODE_ENABLED)
39123    int mem_base;
39124    int ret_val;
39125    int code; /* UCS code point */
39126    int n_code;
39127
39128    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39129        mem_base = xmlMemBlocks();
39130        code = gen_int(n_code, 0);
39131
39132        ret_val = xmlUCSIsMusicalSymbols(code);
39133        desret_int(ret_val);
39134        call_tests++;
39135        des_int(n_code, code, 0);
39136        xmlResetLastError();
39137        if (mem_base != xmlMemBlocks()) {
39138            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
39139	           xmlMemBlocks() - mem_base);
39140	    test_ret++;
39141            printf(" %d", n_code);
39142            printf("\n");
39143        }
39144    }
39145    function_tests++;
39146#endif
39147
39148    return(test_ret);
39149}
39150
39151
39152static int
39153test_xmlUCSIsMyanmar(void) {
39154    int test_ret = 0;
39155
39156#if defined(LIBXML_UNICODE_ENABLED)
39157    int mem_base;
39158    int ret_val;
39159    int code; /* UCS code point */
39160    int n_code;
39161
39162    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39163        mem_base = xmlMemBlocks();
39164        code = gen_int(n_code, 0);
39165
39166        ret_val = xmlUCSIsMyanmar(code);
39167        desret_int(ret_val);
39168        call_tests++;
39169        des_int(n_code, code, 0);
39170        xmlResetLastError();
39171        if (mem_base != xmlMemBlocks()) {
39172            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
39173	           xmlMemBlocks() - mem_base);
39174	    test_ret++;
39175            printf(" %d", n_code);
39176            printf("\n");
39177        }
39178    }
39179    function_tests++;
39180#endif
39181
39182    return(test_ret);
39183}
39184
39185
39186static int
39187test_xmlUCSIsNumberForms(void) {
39188    int test_ret = 0;
39189
39190#if defined(LIBXML_UNICODE_ENABLED)
39191    int mem_base;
39192    int ret_val;
39193    int code; /* UCS code point */
39194    int n_code;
39195
39196    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39197        mem_base = xmlMemBlocks();
39198        code = gen_int(n_code, 0);
39199
39200        ret_val = xmlUCSIsNumberForms(code);
39201        desret_int(ret_val);
39202        call_tests++;
39203        des_int(n_code, code, 0);
39204        xmlResetLastError();
39205        if (mem_base != xmlMemBlocks()) {
39206            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
39207	           xmlMemBlocks() - mem_base);
39208	    test_ret++;
39209            printf(" %d", n_code);
39210            printf("\n");
39211        }
39212    }
39213    function_tests++;
39214#endif
39215
39216    return(test_ret);
39217}
39218
39219
39220static int
39221test_xmlUCSIsOgham(void) {
39222    int test_ret = 0;
39223
39224#if defined(LIBXML_UNICODE_ENABLED)
39225    int mem_base;
39226    int ret_val;
39227    int code; /* UCS code point */
39228    int n_code;
39229
39230    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39231        mem_base = xmlMemBlocks();
39232        code = gen_int(n_code, 0);
39233
39234        ret_val = xmlUCSIsOgham(code);
39235        desret_int(ret_val);
39236        call_tests++;
39237        des_int(n_code, code, 0);
39238        xmlResetLastError();
39239        if (mem_base != xmlMemBlocks()) {
39240            printf("Leak of %d blocks found in xmlUCSIsOgham",
39241	           xmlMemBlocks() - mem_base);
39242	    test_ret++;
39243            printf(" %d", n_code);
39244            printf("\n");
39245        }
39246    }
39247    function_tests++;
39248#endif
39249
39250    return(test_ret);
39251}
39252
39253
39254static int
39255test_xmlUCSIsOldItalic(void) {
39256    int test_ret = 0;
39257
39258#if defined(LIBXML_UNICODE_ENABLED)
39259    int mem_base;
39260    int ret_val;
39261    int code; /* UCS code point */
39262    int n_code;
39263
39264    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39265        mem_base = xmlMemBlocks();
39266        code = gen_int(n_code, 0);
39267
39268        ret_val = xmlUCSIsOldItalic(code);
39269        desret_int(ret_val);
39270        call_tests++;
39271        des_int(n_code, code, 0);
39272        xmlResetLastError();
39273        if (mem_base != xmlMemBlocks()) {
39274            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
39275	           xmlMemBlocks() - mem_base);
39276	    test_ret++;
39277            printf(" %d", n_code);
39278            printf("\n");
39279        }
39280    }
39281    function_tests++;
39282#endif
39283
39284    return(test_ret);
39285}
39286
39287
39288static int
39289test_xmlUCSIsOpticalCharacterRecognition(void) {
39290    int test_ret = 0;
39291
39292#if defined(LIBXML_UNICODE_ENABLED)
39293    int mem_base;
39294    int ret_val;
39295    int code; /* UCS code point */
39296    int n_code;
39297
39298    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39299        mem_base = xmlMemBlocks();
39300        code = gen_int(n_code, 0);
39301
39302        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
39303        desret_int(ret_val);
39304        call_tests++;
39305        des_int(n_code, code, 0);
39306        xmlResetLastError();
39307        if (mem_base != xmlMemBlocks()) {
39308            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
39309	           xmlMemBlocks() - mem_base);
39310	    test_ret++;
39311            printf(" %d", n_code);
39312            printf("\n");
39313        }
39314    }
39315    function_tests++;
39316#endif
39317
39318    return(test_ret);
39319}
39320
39321
39322static int
39323test_xmlUCSIsOriya(void) {
39324    int test_ret = 0;
39325
39326#if defined(LIBXML_UNICODE_ENABLED)
39327    int mem_base;
39328    int ret_val;
39329    int code; /* UCS code point */
39330    int n_code;
39331
39332    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39333        mem_base = xmlMemBlocks();
39334        code = gen_int(n_code, 0);
39335
39336        ret_val = xmlUCSIsOriya(code);
39337        desret_int(ret_val);
39338        call_tests++;
39339        des_int(n_code, code, 0);
39340        xmlResetLastError();
39341        if (mem_base != xmlMemBlocks()) {
39342            printf("Leak of %d blocks found in xmlUCSIsOriya",
39343	           xmlMemBlocks() - mem_base);
39344	    test_ret++;
39345            printf(" %d", n_code);
39346            printf("\n");
39347        }
39348    }
39349    function_tests++;
39350#endif
39351
39352    return(test_ret);
39353}
39354
39355
39356static int
39357test_xmlUCSIsOsmanya(void) {
39358    int test_ret = 0;
39359
39360#if defined(LIBXML_UNICODE_ENABLED)
39361    int mem_base;
39362    int ret_val;
39363    int code; /* UCS code point */
39364    int n_code;
39365
39366    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39367        mem_base = xmlMemBlocks();
39368        code = gen_int(n_code, 0);
39369
39370        ret_val = xmlUCSIsOsmanya(code);
39371        desret_int(ret_val);
39372        call_tests++;
39373        des_int(n_code, code, 0);
39374        xmlResetLastError();
39375        if (mem_base != xmlMemBlocks()) {
39376            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
39377	           xmlMemBlocks() - mem_base);
39378	    test_ret++;
39379            printf(" %d", n_code);
39380            printf("\n");
39381        }
39382    }
39383    function_tests++;
39384#endif
39385
39386    return(test_ret);
39387}
39388
39389
39390static int
39391test_xmlUCSIsPhoneticExtensions(void) {
39392    int test_ret = 0;
39393
39394#if defined(LIBXML_UNICODE_ENABLED)
39395    int mem_base;
39396    int ret_val;
39397    int code; /* UCS code point */
39398    int n_code;
39399
39400    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39401        mem_base = xmlMemBlocks();
39402        code = gen_int(n_code, 0);
39403
39404        ret_val = xmlUCSIsPhoneticExtensions(code);
39405        desret_int(ret_val);
39406        call_tests++;
39407        des_int(n_code, code, 0);
39408        xmlResetLastError();
39409        if (mem_base != xmlMemBlocks()) {
39410            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
39411	           xmlMemBlocks() - mem_base);
39412	    test_ret++;
39413            printf(" %d", n_code);
39414            printf("\n");
39415        }
39416    }
39417    function_tests++;
39418#endif
39419
39420    return(test_ret);
39421}
39422
39423
39424static int
39425test_xmlUCSIsPrivateUse(void) {
39426    int test_ret = 0;
39427
39428#if defined(LIBXML_UNICODE_ENABLED)
39429    int mem_base;
39430    int ret_val;
39431    int code; /* UCS code point */
39432    int n_code;
39433
39434    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39435        mem_base = xmlMemBlocks();
39436        code = gen_int(n_code, 0);
39437
39438        ret_val = xmlUCSIsPrivateUse(code);
39439        desret_int(ret_val);
39440        call_tests++;
39441        des_int(n_code, code, 0);
39442        xmlResetLastError();
39443        if (mem_base != xmlMemBlocks()) {
39444            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
39445	           xmlMemBlocks() - mem_base);
39446	    test_ret++;
39447            printf(" %d", n_code);
39448            printf("\n");
39449        }
39450    }
39451    function_tests++;
39452#endif
39453
39454    return(test_ret);
39455}
39456
39457
39458static int
39459test_xmlUCSIsPrivateUseArea(void) {
39460    int test_ret = 0;
39461
39462#if defined(LIBXML_UNICODE_ENABLED)
39463    int mem_base;
39464    int ret_val;
39465    int code; /* UCS code point */
39466    int n_code;
39467
39468    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39469        mem_base = xmlMemBlocks();
39470        code = gen_int(n_code, 0);
39471
39472        ret_val = xmlUCSIsPrivateUseArea(code);
39473        desret_int(ret_val);
39474        call_tests++;
39475        des_int(n_code, code, 0);
39476        xmlResetLastError();
39477        if (mem_base != xmlMemBlocks()) {
39478            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
39479	           xmlMemBlocks() - mem_base);
39480	    test_ret++;
39481            printf(" %d", n_code);
39482            printf("\n");
39483        }
39484    }
39485    function_tests++;
39486#endif
39487
39488    return(test_ret);
39489}
39490
39491
39492static int
39493test_xmlUCSIsRunic(void) {
39494    int test_ret = 0;
39495
39496#if defined(LIBXML_UNICODE_ENABLED)
39497    int mem_base;
39498    int ret_val;
39499    int code; /* UCS code point */
39500    int n_code;
39501
39502    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39503        mem_base = xmlMemBlocks();
39504        code = gen_int(n_code, 0);
39505
39506        ret_val = xmlUCSIsRunic(code);
39507        desret_int(ret_val);
39508        call_tests++;
39509        des_int(n_code, code, 0);
39510        xmlResetLastError();
39511        if (mem_base != xmlMemBlocks()) {
39512            printf("Leak of %d blocks found in xmlUCSIsRunic",
39513	           xmlMemBlocks() - mem_base);
39514	    test_ret++;
39515            printf(" %d", n_code);
39516            printf("\n");
39517        }
39518    }
39519    function_tests++;
39520#endif
39521
39522    return(test_ret);
39523}
39524
39525
39526static int
39527test_xmlUCSIsShavian(void) {
39528    int test_ret = 0;
39529
39530#if defined(LIBXML_UNICODE_ENABLED)
39531    int mem_base;
39532    int ret_val;
39533    int code; /* UCS code point */
39534    int n_code;
39535
39536    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39537        mem_base = xmlMemBlocks();
39538        code = gen_int(n_code, 0);
39539
39540        ret_val = xmlUCSIsShavian(code);
39541        desret_int(ret_val);
39542        call_tests++;
39543        des_int(n_code, code, 0);
39544        xmlResetLastError();
39545        if (mem_base != xmlMemBlocks()) {
39546            printf("Leak of %d blocks found in xmlUCSIsShavian",
39547	           xmlMemBlocks() - mem_base);
39548	    test_ret++;
39549            printf(" %d", n_code);
39550            printf("\n");
39551        }
39552    }
39553    function_tests++;
39554#endif
39555
39556    return(test_ret);
39557}
39558
39559
39560static int
39561test_xmlUCSIsSinhala(void) {
39562    int test_ret = 0;
39563
39564#if defined(LIBXML_UNICODE_ENABLED)
39565    int mem_base;
39566    int ret_val;
39567    int code; /* UCS code point */
39568    int n_code;
39569
39570    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39571        mem_base = xmlMemBlocks();
39572        code = gen_int(n_code, 0);
39573
39574        ret_val = xmlUCSIsSinhala(code);
39575        desret_int(ret_val);
39576        call_tests++;
39577        des_int(n_code, code, 0);
39578        xmlResetLastError();
39579        if (mem_base != xmlMemBlocks()) {
39580            printf("Leak of %d blocks found in xmlUCSIsSinhala",
39581	           xmlMemBlocks() - mem_base);
39582	    test_ret++;
39583            printf(" %d", n_code);
39584            printf("\n");
39585        }
39586    }
39587    function_tests++;
39588#endif
39589
39590    return(test_ret);
39591}
39592
39593
39594static int
39595test_xmlUCSIsSmallFormVariants(void) {
39596    int test_ret = 0;
39597
39598#if defined(LIBXML_UNICODE_ENABLED)
39599    int mem_base;
39600    int ret_val;
39601    int code; /* UCS code point */
39602    int n_code;
39603
39604    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39605        mem_base = xmlMemBlocks();
39606        code = gen_int(n_code, 0);
39607
39608        ret_val = xmlUCSIsSmallFormVariants(code);
39609        desret_int(ret_val);
39610        call_tests++;
39611        des_int(n_code, code, 0);
39612        xmlResetLastError();
39613        if (mem_base != xmlMemBlocks()) {
39614            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
39615	           xmlMemBlocks() - mem_base);
39616	    test_ret++;
39617            printf(" %d", n_code);
39618            printf("\n");
39619        }
39620    }
39621    function_tests++;
39622#endif
39623
39624    return(test_ret);
39625}
39626
39627
39628static int
39629test_xmlUCSIsSpacingModifierLetters(void) {
39630    int test_ret = 0;
39631
39632#if defined(LIBXML_UNICODE_ENABLED)
39633    int mem_base;
39634    int ret_val;
39635    int code; /* UCS code point */
39636    int n_code;
39637
39638    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39639        mem_base = xmlMemBlocks();
39640        code = gen_int(n_code, 0);
39641
39642        ret_val = xmlUCSIsSpacingModifierLetters(code);
39643        desret_int(ret_val);
39644        call_tests++;
39645        des_int(n_code, code, 0);
39646        xmlResetLastError();
39647        if (mem_base != xmlMemBlocks()) {
39648            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
39649	           xmlMemBlocks() - mem_base);
39650	    test_ret++;
39651            printf(" %d", n_code);
39652            printf("\n");
39653        }
39654    }
39655    function_tests++;
39656#endif
39657
39658    return(test_ret);
39659}
39660
39661
39662static int
39663test_xmlUCSIsSpecials(void) {
39664    int test_ret = 0;
39665
39666#if defined(LIBXML_UNICODE_ENABLED)
39667    int mem_base;
39668    int ret_val;
39669    int code; /* UCS code point */
39670    int n_code;
39671
39672    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39673        mem_base = xmlMemBlocks();
39674        code = gen_int(n_code, 0);
39675
39676        ret_val = xmlUCSIsSpecials(code);
39677        desret_int(ret_val);
39678        call_tests++;
39679        des_int(n_code, code, 0);
39680        xmlResetLastError();
39681        if (mem_base != xmlMemBlocks()) {
39682            printf("Leak of %d blocks found in xmlUCSIsSpecials",
39683	           xmlMemBlocks() - mem_base);
39684	    test_ret++;
39685            printf(" %d", n_code);
39686            printf("\n");
39687        }
39688    }
39689    function_tests++;
39690#endif
39691
39692    return(test_ret);
39693}
39694
39695
39696static int
39697test_xmlUCSIsSuperscriptsandSubscripts(void) {
39698    int test_ret = 0;
39699
39700#if defined(LIBXML_UNICODE_ENABLED)
39701    int mem_base;
39702    int ret_val;
39703    int code; /* UCS code point */
39704    int n_code;
39705
39706    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39707        mem_base = xmlMemBlocks();
39708        code = gen_int(n_code, 0);
39709
39710        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
39711        desret_int(ret_val);
39712        call_tests++;
39713        des_int(n_code, code, 0);
39714        xmlResetLastError();
39715        if (mem_base != xmlMemBlocks()) {
39716            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
39717	           xmlMemBlocks() - mem_base);
39718	    test_ret++;
39719            printf(" %d", n_code);
39720            printf("\n");
39721        }
39722    }
39723    function_tests++;
39724#endif
39725
39726    return(test_ret);
39727}
39728
39729
39730static int
39731test_xmlUCSIsSupplementalArrowsA(void) {
39732    int test_ret = 0;
39733
39734#if defined(LIBXML_UNICODE_ENABLED)
39735    int mem_base;
39736    int ret_val;
39737    int code; /* UCS code point */
39738    int n_code;
39739
39740    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39741        mem_base = xmlMemBlocks();
39742        code = gen_int(n_code, 0);
39743
39744        ret_val = xmlUCSIsSupplementalArrowsA(code);
39745        desret_int(ret_val);
39746        call_tests++;
39747        des_int(n_code, code, 0);
39748        xmlResetLastError();
39749        if (mem_base != xmlMemBlocks()) {
39750            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
39751	           xmlMemBlocks() - mem_base);
39752	    test_ret++;
39753            printf(" %d", n_code);
39754            printf("\n");
39755        }
39756    }
39757    function_tests++;
39758#endif
39759
39760    return(test_ret);
39761}
39762
39763
39764static int
39765test_xmlUCSIsSupplementalArrowsB(void) {
39766    int test_ret = 0;
39767
39768#if defined(LIBXML_UNICODE_ENABLED)
39769    int mem_base;
39770    int ret_val;
39771    int code; /* UCS code point */
39772    int n_code;
39773
39774    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39775        mem_base = xmlMemBlocks();
39776        code = gen_int(n_code, 0);
39777
39778        ret_val = xmlUCSIsSupplementalArrowsB(code);
39779        desret_int(ret_val);
39780        call_tests++;
39781        des_int(n_code, code, 0);
39782        xmlResetLastError();
39783        if (mem_base != xmlMemBlocks()) {
39784            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
39785	           xmlMemBlocks() - mem_base);
39786	    test_ret++;
39787            printf(" %d", n_code);
39788            printf("\n");
39789        }
39790    }
39791    function_tests++;
39792#endif
39793
39794    return(test_ret);
39795}
39796
39797
39798static int
39799test_xmlUCSIsSupplementalMathematicalOperators(void) {
39800    int test_ret = 0;
39801
39802#if defined(LIBXML_UNICODE_ENABLED)
39803    int mem_base;
39804    int ret_val;
39805    int code; /* UCS code point */
39806    int n_code;
39807
39808    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39809        mem_base = xmlMemBlocks();
39810        code = gen_int(n_code, 0);
39811
39812        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
39813        desret_int(ret_val);
39814        call_tests++;
39815        des_int(n_code, code, 0);
39816        xmlResetLastError();
39817        if (mem_base != xmlMemBlocks()) {
39818            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
39819	           xmlMemBlocks() - mem_base);
39820	    test_ret++;
39821            printf(" %d", n_code);
39822            printf("\n");
39823        }
39824    }
39825    function_tests++;
39826#endif
39827
39828    return(test_ret);
39829}
39830
39831
39832static int
39833test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
39834    int test_ret = 0;
39835
39836#if defined(LIBXML_UNICODE_ENABLED)
39837    int mem_base;
39838    int ret_val;
39839    int code; /* UCS code point */
39840    int n_code;
39841
39842    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39843        mem_base = xmlMemBlocks();
39844        code = gen_int(n_code, 0);
39845
39846        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
39847        desret_int(ret_val);
39848        call_tests++;
39849        des_int(n_code, code, 0);
39850        xmlResetLastError();
39851        if (mem_base != xmlMemBlocks()) {
39852            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
39853	           xmlMemBlocks() - mem_base);
39854	    test_ret++;
39855            printf(" %d", n_code);
39856            printf("\n");
39857        }
39858    }
39859    function_tests++;
39860#endif
39861
39862    return(test_ret);
39863}
39864
39865
39866static int
39867test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
39868    int test_ret = 0;
39869
39870#if defined(LIBXML_UNICODE_ENABLED)
39871    int mem_base;
39872    int ret_val;
39873    int code; /* UCS code point */
39874    int n_code;
39875
39876    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39877        mem_base = xmlMemBlocks();
39878        code = gen_int(n_code, 0);
39879
39880        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
39881        desret_int(ret_val);
39882        call_tests++;
39883        des_int(n_code, code, 0);
39884        xmlResetLastError();
39885        if (mem_base != xmlMemBlocks()) {
39886            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
39887	           xmlMemBlocks() - mem_base);
39888	    test_ret++;
39889            printf(" %d", n_code);
39890            printf("\n");
39891        }
39892    }
39893    function_tests++;
39894#endif
39895
39896    return(test_ret);
39897}
39898
39899
39900static int
39901test_xmlUCSIsSyriac(void) {
39902    int test_ret = 0;
39903
39904#if defined(LIBXML_UNICODE_ENABLED)
39905    int mem_base;
39906    int ret_val;
39907    int code; /* UCS code point */
39908    int n_code;
39909
39910    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39911        mem_base = xmlMemBlocks();
39912        code = gen_int(n_code, 0);
39913
39914        ret_val = xmlUCSIsSyriac(code);
39915        desret_int(ret_val);
39916        call_tests++;
39917        des_int(n_code, code, 0);
39918        xmlResetLastError();
39919        if (mem_base != xmlMemBlocks()) {
39920            printf("Leak of %d blocks found in xmlUCSIsSyriac",
39921	           xmlMemBlocks() - mem_base);
39922	    test_ret++;
39923            printf(" %d", n_code);
39924            printf("\n");
39925        }
39926    }
39927    function_tests++;
39928#endif
39929
39930    return(test_ret);
39931}
39932
39933
39934static int
39935test_xmlUCSIsTagalog(void) {
39936    int test_ret = 0;
39937
39938#if defined(LIBXML_UNICODE_ENABLED)
39939    int mem_base;
39940    int ret_val;
39941    int code; /* UCS code point */
39942    int n_code;
39943
39944    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39945        mem_base = xmlMemBlocks();
39946        code = gen_int(n_code, 0);
39947
39948        ret_val = xmlUCSIsTagalog(code);
39949        desret_int(ret_val);
39950        call_tests++;
39951        des_int(n_code, code, 0);
39952        xmlResetLastError();
39953        if (mem_base != xmlMemBlocks()) {
39954            printf("Leak of %d blocks found in xmlUCSIsTagalog",
39955	           xmlMemBlocks() - mem_base);
39956	    test_ret++;
39957            printf(" %d", n_code);
39958            printf("\n");
39959        }
39960    }
39961    function_tests++;
39962#endif
39963
39964    return(test_ret);
39965}
39966
39967
39968static int
39969test_xmlUCSIsTagbanwa(void) {
39970    int test_ret = 0;
39971
39972#if defined(LIBXML_UNICODE_ENABLED)
39973    int mem_base;
39974    int ret_val;
39975    int code; /* UCS code point */
39976    int n_code;
39977
39978    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39979        mem_base = xmlMemBlocks();
39980        code = gen_int(n_code, 0);
39981
39982        ret_val = xmlUCSIsTagbanwa(code);
39983        desret_int(ret_val);
39984        call_tests++;
39985        des_int(n_code, code, 0);
39986        xmlResetLastError();
39987        if (mem_base != xmlMemBlocks()) {
39988            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
39989	           xmlMemBlocks() - mem_base);
39990	    test_ret++;
39991            printf(" %d", n_code);
39992            printf("\n");
39993        }
39994    }
39995    function_tests++;
39996#endif
39997
39998    return(test_ret);
39999}
40000
40001
40002static int
40003test_xmlUCSIsTags(void) {
40004    int test_ret = 0;
40005
40006#if defined(LIBXML_UNICODE_ENABLED)
40007    int mem_base;
40008    int ret_val;
40009    int code; /* UCS code point */
40010    int n_code;
40011
40012    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40013        mem_base = xmlMemBlocks();
40014        code = gen_int(n_code, 0);
40015
40016        ret_val = xmlUCSIsTags(code);
40017        desret_int(ret_val);
40018        call_tests++;
40019        des_int(n_code, code, 0);
40020        xmlResetLastError();
40021        if (mem_base != xmlMemBlocks()) {
40022            printf("Leak of %d blocks found in xmlUCSIsTags",
40023	           xmlMemBlocks() - mem_base);
40024	    test_ret++;
40025            printf(" %d", n_code);
40026            printf("\n");
40027        }
40028    }
40029    function_tests++;
40030#endif
40031
40032    return(test_ret);
40033}
40034
40035
40036static int
40037test_xmlUCSIsTaiLe(void) {
40038    int test_ret = 0;
40039
40040#if defined(LIBXML_UNICODE_ENABLED)
40041    int mem_base;
40042    int ret_val;
40043    int code; /* UCS code point */
40044    int n_code;
40045
40046    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40047        mem_base = xmlMemBlocks();
40048        code = gen_int(n_code, 0);
40049
40050        ret_val = xmlUCSIsTaiLe(code);
40051        desret_int(ret_val);
40052        call_tests++;
40053        des_int(n_code, code, 0);
40054        xmlResetLastError();
40055        if (mem_base != xmlMemBlocks()) {
40056            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
40057	           xmlMemBlocks() - mem_base);
40058	    test_ret++;
40059            printf(" %d", n_code);
40060            printf("\n");
40061        }
40062    }
40063    function_tests++;
40064#endif
40065
40066    return(test_ret);
40067}
40068
40069
40070static int
40071test_xmlUCSIsTaiXuanJingSymbols(void) {
40072    int test_ret = 0;
40073
40074#if defined(LIBXML_UNICODE_ENABLED)
40075    int mem_base;
40076    int ret_val;
40077    int code; /* UCS code point */
40078    int n_code;
40079
40080    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40081        mem_base = xmlMemBlocks();
40082        code = gen_int(n_code, 0);
40083
40084        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
40085        desret_int(ret_val);
40086        call_tests++;
40087        des_int(n_code, code, 0);
40088        xmlResetLastError();
40089        if (mem_base != xmlMemBlocks()) {
40090            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
40091	           xmlMemBlocks() - mem_base);
40092	    test_ret++;
40093            printf(" %d", n_code);
40094            printf("\n");
40095        }
40096    }
40097    function_tests++;
40098#endif
40099
40100    return(test_ret);
40101}
40102
40103
40104static int
40105test_xmlUCSIsTamil(void) {
40106    int test_ret = 0;
40107
40108#if defined(LIBXML_UNICODE_ENABLED)
40109    int mem_base;
40110    int ret_val;
40111    int code; /* UCS code point */
40112    int n_code;
40113
40114    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40115        mem_base = xmlMemBlocks();
40116        code = gen_int(n_code, 0);
40117
40118        ret_val = xmlUCSIsTamil(code);
40119        desret_int(ret_val);
40120        call_tests++;
40121        des_int(n_code, code, 0);
40122        xmlResetLastError();
40123        if (mem_base != xmlMemBlocks()) {
40124            printf("Leak of %d blocks found in xmlUCSIsTamil",
40125	           xmlMemBlocks() - mem_base);
40126	    test_ret++;
40127            printf(" %d", n_code);
40128            printf("\n");
40129        }
40130    }
40131    function_tests++;
40132#endif
40133
40134    return(test_ret);
40135}
40136
40137
40138static int
40139test_xmlUCSIsTelugu(void) {
40140    int test_ret = 0;
40141
40142#if defined(LIBXML_UNICODE_ENABLED)
40143    int mem_base;
40144    int ret_val;
40145    int code; /* UCS code point */
40146    int n_code;
40147
40148    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40149        mem_base = xmlMemBlocks();
40150        code = gen_int(n_code, 0);
40151
40152        ret_val = xmlUCSIsTelugu(code);
40153        desret_int(ret_val);
40154        call_tests++;
40155        des_int(n_code, code, 0);
40156        xmlResetLastError();
40157        if (mem_base != xmlMemBlocks()) {
40158            printf("Leak of %d blocks found in xmlUCSIsTelugu",
40159	           xmlMemBlocks() - mem_base);
40160	    test_ret++;
40161            printf(" %d", n_code);
40162            printf("\n");
40163        }
40164    }
40165    function_tests++;
40166#endif
40167
40168    return(test_ret);
40169}
40170
40171
40172static int
40173test_xmlUCSIsThaana(void) {
40174    int test_ret = 0;
40175
40176#if defined(LIBXML_UNICODE_ENABLED)
40177    int mem_base;
40178    int ret_val;
40179    int code; /* UCS code point */
40180    int n_code;
40181
40182    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40183        mem_base = xmlMemBlocks();
40184        code = gen_int(n_code, 0);
40185
40186        ret_val = xmlUCSIsThaana(code);
40187        desret_int(ret_val);
40188        call_tests++;
40189        des_int(n_code, code, 0);
40190        xmlResetLastError();
40191        if (mem_base != xmlMemBlocks()) {
40192            printf("Leak of %d blocks found in xmlUCSIsThaana",
40193	           xmlMemBlocks() - mem_base);
40194	    test_ret++;
40195            printf(" %d", n_code);
40196            printf("\n");
40197        }
40198    }
40199    function_tests++;
40200#endif
40201
40202    return(test_ret);
40203}
40204
40205
40206static int
40207test_xmlUCSIsThai(void) {
40208    int test_ret = 0;
40209
40210#if defined(LIBXML_UNICODE_ENABLED)
40211    int mem_base;
40212    int ret_val;
40213    int code; /* UCS code point */
40214    int n_code;
40215
40216    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40217        mem_base = xmlMemBlocks();
40218        code = gen_int(n_code, 0);
40219
40220        ret_val = xmlUCSIsThai(code);
40221        desret_int(ret_val);
40222        call_tests++;
40223        des_int(n_code, code, 0);
40224        xmlResetLastError();
40225        if (mem_base != xmlMemBlocks()) {
40226            printf("Leak of %d blocks found in xmlUCSIsThai",
40227	           xmlMemBlocks() - mem_base);
40228	    test_ret++;
40229            printf(" %d", n_code);
40230            printf("\n");
40231        }
40232    }
40233    function_tests++;
40234#endif
40235
40236    return(test_ret);
40237}
40238
40239
40240static int
40241test_xmlUCSIsTibetan(void) {
40242    int test_ret = 0;
40243
40244#if defined(LIBXML_UNICODE_ENABLED)
40245    int mem_base;
40246    int ret_val;
40247    int code; /* UCS code point */
40248    int n_code;
40249
40250    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40251        mem_base = xmlMemBlocks();
40252        code = gen_int(n_code, 0);
40253
40254        ret_val = xmlUCSIsTibetan(code);
40255        desret_int(ret_val);
40256        call_tests++;
40257        des_int(n_code, code, 0);
40258        xmlResetLastError();
40259        if (mem_base != xmlMemBlocks()) {
40260            printf("Leak of %d blocks found in xmlUCSIsTibetan",
40261	           xmlMemBlocks() - mem_base);
40262	    test_ret++;
40263            printf(" %d", n_code);
40264            printf("\n");
40265        }
40266    }
40267    function_tests++;
40268#endif
40269
40270    return(test_ret);
40271}
40272
40273
40274static int
40275test_xmlUCSIsUgaritic(void) {
40276    int test_ret = 0;
40277
40278#if defined(LIBXML_UNICODE_ENABLED)
40279    int mem_base;
40280    int ret_val;
40281    int code; /* UCS code point */
40282    int n_code;
40283
40284    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40285        mem_base = xmlMemBlocks();
40286        code = gen_int(n_code, 0);
40287
40288        ret_val = xmlUCSIsUgaritic(code);
40289        desret_int(ret_val);
40290        call_tests++;
40291        des_int(n_code, code, 0);
40292        xmlResetLastError();
40293        if (mem_base != xmlMemBlocks()) {
40294            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
40295	           xmlMemBlocks() - mem_base);
40296	    test_ret++;
40297            printf(" %d", n_code);
40298            printf("\n");
40299        }
40300    }
40301    function_tests++;
40302#endif
40303
40304    return(test_ret);
40305}
40306
40307
40308static int
40309test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
40310    int test_ret = 0;
40311
40312#if defined(LIBXML_UNICODE_ENABLED)
40313    int mem_base;
40314    int ret_val;
40315    int code; /* UCS code point */
40316    int n_code;
40317
40318    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40319        mem_base = xmlMemBlocks();
40320        code = gen_int(n_code, 0);
40321
40322        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
40323        desret_int(ret_val);
40324        call_tests++;
40325        des_int(n_code, code, 0);
40326        xmlResetLastError();
40327        if (mem_base != xmlMemBlocks()) {
40328            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
40329	           xmlMemBlocks() - mem_base);
40330	    test_ret++;
40331            printf(" %d", n_code);
40332            printf("\n");
40333        }
40334    }
40335    function_tests++;
40336#endif
40337
40338    return(test_ret);
40339}
40340
40341
40342static int
40343test_xmlUCSIsVariationSelectors(void) {
40344    int test_ret = 0;
40345
40346#if defined(LIBXML_UNICODE_ENABLED)
40347    int mem_base;
40348    int ret_val;
40349    int code; /* UCS code point */
40350    int n_code;
40351
40352    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40353        mem_base = xmlMemBlocks();
40354        code = gen_int(n_code, 0);
40355
40356        ret_val = xmlUCSIsVariationSelectors(code);
40357        desret_int(ret_val);
40358        call_tests++;
40359        des_int(n_code, code, 0);
40360        xmlResetLastError();
40361        if (mem_base != xmlMemBlocks()) {
40362            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
40363	           xmlMemBlocks() - mem_base);
40364	    test_ret++;
40365            printf(" %d", n_code);
40366            printf("\n");
40367        }
40368    }
40369    function_tests++;
40370#endif
40371
40372    return(test_ret);
40373}
40374
40375
40376static int
40377test_xmlUCSIsVariationSelectorsSupplement(void) {
40378    int test_ret = 0;
40379
40380#if defined(LIBXML_UNICODE_ENABLED)
40381    int mem_base;
40382    int ret_val;
40383    int code; /* UCS code point */
40384    int n_code;
40385
40386    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40387        mem_base = xmlMemBlocks();
40388        code = gen_int(n_code, 0);
40389
40390        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
40391        desret_int(ret_val);
40392        call_tests++;
40393        des_int(n_code, code, 0);
40394        xmlResetLastError();
40395        if (mem_base != xmlMemBlocks()) {
40396            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
40397	           xmlMemBlocks() - mem_base);
40398	    test_ret++;
40399            printf(" %d", n_code);
40400            printf("\n");
40401        }
40402    }
40403    function_tests++;
40404#endif
40405
40406    return(test_ret);
40407}
40408
40409
40410static int
40411test_xmlUCSIsYiRadicals(void) {
40412    int test_ret = 0;
40413
40414#if defined(LIBXML_UNICODE_ENABLED)
40415    int mem_base;
40416    int ret_val;
40417    int code; /* UCS code point */
40418    int n_code;
40419
40420    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40421        mem_base = xmlMemBlocks();
40422        code = gen_int(n_code, 0);
40423
40424        ret_val = xmlUCSIsYiRadicals(code);
40425        desret_int(ret_val);
40426        call_tests++;
40427        des_int(n_code, code, 0);
40428        xmlResetLastError();
40429        if (mem_base != xmlMemBlocks()) {
40430            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
40431	           xmlMemBlocks() - mem_base);
40432	    test_ret++;
40433            printf(" %d", n_code);
40434            printf("\n");
40435        }
40436    }
40437    function_tests++;
40438#endif
40439
40440    return(test_ret);
40441}
40442
40443
40444static int
40445test_xmlUCSIsYiSyllables(void) {
40446    int test_ret = 0;
40447
40448#if defined(LIBXML_UNICODE_ENABLED)
40449    int mem_base;
40450    int ret_val;
40451    int code; /* UCS code point */
40452    int n_code;
40453
40454    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40455        mem_base = xmlMemBlocks();
40456        code = gen_int(n_code, 0);
40457
40458        ret_val = xmlUCSIsYiSyllables(code);
40459        desret_int(ret_val);
40460        call_tests++;
40461        des_int(n_code, code, 0);
40462        xmlResetLastError();
40463        if (mem_base != xmlMemBlocks()) {
40464            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
40465	           xmlMemBlocks() - mem_base);
40466	    test_ret++;
40467            printf(" %d", n_code);
40468            printf("\n");
40469        }
40470    }
40471    function_tests++;
40472#endif
40473
40474    return(test_ret);
40475}
40476
40477
40478static int
40479test_xmlUCSIsYijingHexagramSymbols(void) {
40480    int test_ret = 0;
40481
40482#if defined(LIBXML_UNICODE_ENABLED)
40483    int mem_base;
40484    int ret_val;
40485    int code; /* UCS code point */
40486    int n_code;
40487
40488    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40489        mem_base = xmlMemBlocks();
40490        code = gen_int(n_code, 0);
40491
40492        ret_val = xmlUCSIsYijingHexagramSymbols(code);
40493        desret_int(ret_val);
40494        call_tests++;
40495        des_int(n_code, code, 0);
40496        xmlResetLastError();
40497        if (mem_base != xmlMemBlocks()) {
40498            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
40499	           xmlMemBlocks() - mem_base);
40500	    test_ret++;
40501            printf(" %d", n_code);
40502            printf("\n");
40503        }
40504    }
40505    function_tests++;
40506#endif
40507
40508    return(test_ret);
40509}
40510
40511static int
40512test_xmlunicode(void) {
40513    int test_ret = 0;
40514
40515    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
40516    test_ret += test_xmlUCSIsAegeanNumbers();
40517    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
40518    test_ret += test_xmlUCSIsArabic();
40519    test_ret += test_xmlUCSIsArabicPresentationFormsA();
40520    test_ret += test_xmlUCSIsArabicPresentationFormsB();
40521    test_ret += test_xmlUCSIsArmenian();
40522    test_ret += test_xmlUCSIsArrows();
40523    test_ret += test_xmlUCSIsBasicLatin();
40524    test_ret += test_xmlUCSIsBengali();
40525    test_ret += test_xmlUCSIsBlock();
40526    test_ret += test_xmlUCSIsBlockElements();
40527    test_ret += test_xmlUCSIsBopomofo();
40528    test_ret += test_xmlUCSIsBopomofoExtended();
40529    test_ret += test_xmlUCSIsBoxDrawing();
40530    test_ret += test_xmlUCSIsBraillePatterns();
40531    test_ret += test_xmlUCSIsBuhid();
40532    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
40533    test_ret += test_xmlUCSIsCJKCompatibility();
40534    test_ret += test_xmlUCSIsCJKCompatibilityForms();
40535    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
40536    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
40537    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
40538    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
40539    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
40540    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
40541    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
40542    test_ret += test_xmlUCSIsCat();
40543    test_ret += test_xmlUCSIsCatC();
40544    test_ret += test_xmlUCSIsCatCc();
40545    test_ret += test_xmlUCSIsCatCf();
40546    test_ret += test_xmlUCSIsCatCo();
40547    test_ret += test_xmlUCSIsCatCs();
40548    test_ret += test_xmlUCSIsCatL();
40549    test_ret += test_xmlUCSIsCatLl();
40550    test_ret += test_xmlUCSIsCatLm();
40551    test_ret += test_xmlUCSIsCatLo();
40552    test_ret += test_xmlUCSIsCatLt();
40553    test_ret += test_xmlUCSIsCatLu();
40554    test_ret += test_xmlUCSIsCatM();
40555    test_ret += test_xmlUCSIsCatMc();
40556    test_ret += test_xmlUCSIsCatMe();
40557    test_ret += test_xmlUCSIsCatMn();
40558    test_ret += test_xmlUCSIsCatN();
40559    test_ret += test_xmlUCSIsCatNd();
40560    test_ret += test_xmlUCSIsCatNl();
40561    test_ret += test_xmlUCSIsCatNo();
40562    test_ret += test_xmlUCSIsCatP();
40563    test_ret += test_xmlUCSIsCatPc();
40564    test_ret += test_xmlUCSIsCatPd();
40565    test_ret += test_xmlUCSIsCatPe();
40566    test_ret += test_xmlUCSIsCatPf();
40567    test_ret += test_xmlUCSIsCatPi();
40568    test_ret += test_xmlUCSIsCatPo();
40569    test_ret += test_xmlUCSIsCatPs();
40570    test_ret += test_xmlUCSIsCatS();
40571    test_ret += test_xmlUCSIsCatSc();
40572    test_ret += test_xmlUCSIsCatSk();
40573    test_ret += test_xmlUCSIsCatSm();
40574    test_ret += test_xmlUCSIsCatSo();
40575    test_ret += test_xmlUCSIsCatZ();
40576    test_ret += test_xmlUCSIsCatZl();
40577    test_ret += test_xmlUCSIsCatZp();
40578    test_ret += test_xmlUCSIsCatZs();
40579    test_ret += test_xmlUCSIsCherokee();
40580    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
40581    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
40582    test_ret += test_xmlUCSIsCombiningHalfMarks();
40583    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
40584    test_ret += test_xmlUCSIsControlPictures();
40585    test_ret += test_xmlUCSIsCurrencySymbols();
40586    test_ret += test_xmlUCSIsCypriotSyllabary();
40587    test_ret += test_xmlUCSIsCyrillic();
40588    test_ret += test_xmlUCSIsCyrillicSupplement();
40589    test_ret += test_xmlUCSIsDeseret();
40590    test_ret += test_xmlUCSIsDevanagari();
40591    test_ret += test_xmlUCSIsDingbats();
40592    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
40593    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
40594    test_ret += test_xmlUCSIsEthiopic();
40595    test_ret += test_xmlUCSIsGeneralPunctuation();
40596    test_ret += test_xmlUCSIsGeometricShapes();
40597    test_ret += test_xmlUCSIsGeorgian();
40598    test_ret += test_xmlUCSIsGothic();
40599    test_ret += test_xmlUCSIsGreek();
40600    test_ret += test_xmlUCSIsGreekExtended();
40601    test_ret += test_xmlUCSIsGreekandCoptic();
40602    test_ret += test_xmlUCSIsGujarati();
40603    test_ret += test_xmlUCSIsGurmukhi();
40604    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
40605    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
40606    test_ret += test_xmlUCSIsHangulJamo();
40607    test_ret += test_xmlUCSIsHangulSyllables();
40608    test_ret += test_xmlUCSIsHanunoo();
40609    test_ret += test_xmlUCSIsHebrew();
40610    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
40611    test_ret += test_xmlUCSIsHighSurrogates();
40612    test_ret += test_xmlUCSIsHiragana();
40613    test_ret += test_xmlUCSIsIPAExtensions();
40614    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
40615    test_ret += test_xmlUCSIsKanbun();
40616    test_ret += test_xmlUCSIsKangxiRadicals();
40617    test_ret += test_xmlUCSIsKannada();
40618    test_ret += test_xmlUCSIsKatakana();
40619    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
40620    test_ret += test_xmlUCSIsKhmer();
40621    test_ret += test_xmlUCSIsKhmerSymbols();
40622    test_ret += test_xmlUCSIsLao();
40623    test_ret += test_xmlUCSIsLatin1Supplement();
40624    test_ret += test_xmlUCSIsLatinExtendedA();
40625    test_ret += test_xmlUCSIsLatinExtendedAdditional();
40626    test_ret += test_xmlUCSIsLatinExtendedB();
40627    test_ret += test_xmlUCSIsLetterlikeSymbols();
40628    test_ret += test_xmlUCSIsLimbu();
40629    test_ret += test_xmlUCSIsLinearBIdeograms();
40630    test_ret += test_xmlUCSIsLinearBSyllabary();
40631    test_ret += test_xmlUCSIsLowSurrogates();
40632    test_ret += test_xmlUCSIsMalayalam();
40633    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
40634    test_ret += test_xmlUCSIsMathematicalOperators();
40635    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
40636    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
40637    test_ret += test_xmlUCSIsMiscellaneousSymbols();
40638    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
40639    test_ret += test_xmlUCSIsMiscellaneousTechnical();
40640    test_ret += test_xmlUCSIsMongolian();
40641    test_ret += test_xmlUCSIsMusicalSymbols();
40642    test_ret += test_xmlUCSIsMyanmar();
40643    test_ret += test_xmlUCSIsNumberForms();
40644    test_ret += test_xmlUCSIsOgham();
40645    test_ret += test_xmlUCSIsOldItalic();
40646    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
40647    test_ret += test_xmlUCSIsOriya();
40648    test_ret += test_xmlUCSIsOsmanya();
40649    test_ret += test_xmlUCSIsPhoneticExtensions();
40650    test_ret += test_xmlUCSIsPrivateUse();
40651    test_ret += test_xmlUCSIsPrivateUseArea();
40652    test_ret += test_xmlUCSIsRunic();
40653    test_ret += test_xmlUCSIsShavian();
40654    test_ret += test_xmlUCSIsSinhala();
40655    test_ret += test_xmlUCSIsSmallFormVariants();
40656    test_ret += test_xmlUCSIsSpacingModifierLetters();
40657    test_ret += test_xmlUCSIsSpecials();
40658    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
40659    test_ret += test_xmlUCSIsSupplementalArrowsA();
40660    test_ret += test_xmlUCSIsSupplementalArrowsB();
40661    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
40662    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
40663    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
40664    test_ret += test_xmlUCSIsSyriac();
40665    test_ret += test_xmlUCSIsTagalog();
40666    test_ret += test_xmlUCSIsTagbanwa();
40667    test_ret += test_xmlUCSIsTags();
40668    test_ret += test_xmlUCSIsTaiLe();
40669    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
40670    test_ret += test_xmlUCSIsTamil();
40671    test_ret += test_xmlUCSIsTelugu();
40672    test_ret += test_xmlUCSIsThaana();
40673    test_ret += test_xmlUCSIsThai();
40674    test_ret += test_xmlUCSIsTibetan();
40675    test_ret += test_xmlUCSIsUgaritic();
40676    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
40677    test_ret += test_xmlUCSIsVariationSelectors();
40678    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
40679    test_ret += test_xmlUCSIsYiRadicals();
40680    test_ret += test_xmlUCSIsYiSyllables();
40681    test_ret += test_xmlUCSIsYijingHexagramSymbols();
40682
40683    if (test_ret != 0)
40684	printf("Module xmlunicode: %d errors\n", test_ret);
40685    return(test_ret);
40686}
40687
40688static int
40689test_xmlNewTextWriter(void) {
40690    int test_ret = 0;
40691
40692#if defined(LIBXML_WRITER_ENABLED)
40693    int mem_base;
40694    xmlTextWriterPtr ret_val;
40695    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
40696    int n_out;
40697
40698    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
40699        mem_base = xmlMemBlocks();
40700        out = gen_xmlOutputBufferPtr(n_out, 0);
40701
40702        ret_val = xmlNewTextWriter(out);
40703        if (ret_val != NULL) out = NULL;
40704        desret_xmlTextWriterPtr(ret_val);
40705        call_tests++;
40706        des_xmlOutputBufferPtr(n_out, out, 0);
40707        xmlResetLastError();
40708        if (mem_base != xmlMemBlocks()) {
40709            printf("Leak of %d blocks found in xmlNewTextWriter",
40710	           xmlMemBlocks() - mem_base);
40711	    test_ret++;
40712            printf(" %d", n_out);
40713            printf("\n");
40714        }
40715    }
40716    function_tests++;
40717#endif
40718
40719    return(test_ret);
40720}
40721
40722
40723static int
40724test_xmlNewTextWriterFilename(void) {
40725    int test_ret = 0;
40726
40727#if defined(LIBXML_WRITER_ENABLED)
40728    int mem_base;
40729    xmlTextWriterPtr ret_val;
40730    const char * uri; /* the URI of the resource for the output */
40731    int n_uri;
40732    int compression; /* compress the output? */
40733    int n_compression;
40734
40735    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
40736    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40737        mem_base = xmlMemBlocks();
40738        uri = gen_fileoutput(n_uri, 0);
40739        compression = gen_int(n_compression, 1);
40740
40741        ret_val = xmlNewTextWriterFilename(uri, compression);
40742        desret_xmlTextWriterPtr(ret_val);
40743        call_tests++;
40744        des_fileoutput(n_uri, uri, 0);
40745        des_int(n_compression, compression, 1);
40746        xmlResetLastError();
40747        if (mem_base != xmlMemBlocks()) {
40748            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
40749	           xmlMemBlocks() - mem_base);
40750	    test_ret++;
40751            printf(" %d", n_uri);
40752            printf(" %d", n_compression);
40753            printf("\n");
40754        }
40755    }
40756    }
40757    function_tests++;
40758#endif
40759
40760    return(test_ret);
40761}
40762
40763
40764static int
40765test_xmlNewTextWriterMemory(void) {
40766    int test_ret = 0;
40767
40768#if defined(LIBXML_WRITER_ENABLED)
40769    int mem_base;
40770    xmlTextWriterPtr ret_val;
40771    xmlBufferPtr buf; /* xmlBufferPtr */
40772    int n_buf;
40773    int compression; /* compress the output? */
40774    int n_compression;
40775
40776    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
40777    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40778        mem_base = xmlMemBlocks();
40779        buf = gen_xmlBufferPtr(n_buf, 0);
40780        compression = gen_int(n_compression, 1);
40781
40782        ret_val = xmlNewTextWriterMemory(buf, compression);
40783        desret_xmlTextWriterPtr(ret_val);
40784        call_tests++;
40785        des_xmlBufferPtr(n_buf, buf, 0);
40786        des_int(n_compression, compression, 1);
40787        xmlResetLastError();
40788        if (mem_base != xmlMemBlocks()) {
40789            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
40790	           xmlMemBlocks() - mem_base);
40791	    test_ret++;
40792            printf(" %d", n_buf);
40793            printf(" %d", n_compression);
40794            printf("\n");
40795        }
40796    }
40797    }
40798    function_tests++;
40799#endif
40800
40801    return(test_ret);
40802}
40803
40804
40805static int
40806test_xmlNewTextWriterPushParser(void) {
40807    int test_ret = 0;
40808
40809#if defined(LIBXML_WRITER_ENABLED)
40810    int mem_base;
40811    xmlTextWriterPtr ret_val;
40812    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
40813    int n_ctxt;
40814    int compression; /* compress the output? */
40815    int n_compression;
40816
40817    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
40818    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40819        mem_base = xmlMemBlocks();
40820        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
40821        compression = gen_int(n_compression, 1);
40822
40823        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
40824        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
40825        desret_xmlTextWriterPtr(ret_val);
40826        call_tests++;
40827        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
40828        des_int(n_compression, compression, 1);
40829        xmlResetLastError();
40830        if (mem_base != xmlMemBlocks()) {
40831            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
40832	           xmlMemBlocks() - mem_base);
40833	    test_ret++;
40834            printf(" %d", n_ctxt);
40835            printf(" %d", n_compression);
40836            printf("\n");
40837        }
40838    }
40839    }
40840    function_tests++;
40841#endif
40842
40843    return(test_ret);
40844}
40845
40846
40847static int
40848test_xmlNewTextWriterTree(void) {
40849    int test_ret = 0;
40850
40851#if defined(LIBXML_WRITER_ENABLED)
40852    int mem_base;
40853    xmlTextWriterPtr ret_val;
40854    xmlDocPtr doc; /* xmlDocPtr */
40855    int n_doc;
40856    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
40857    int n_node;
40858    int compression; /* compress the output? */
40859    int n_compression;
40860
40861    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
40862    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
40863    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40864        mem_base = xmlMemBlocks();
40865        doc = gen_xmlDocPtr(n_doc, 0);
40866        node = gen_xmlNodePtr(n_node, 1);
40867        compression = gen_int(n_compression, 2);
40868
40869        ret_val = xmlNewTextWriterTree(doc, node, compression);
40870        desret_xmlTextWriterPtr(ret_val);
40871        call_tests++;
40872        des_xmlDocPtr(n_doc, doc, 0);
40873        des_xmlNodePtr(n_node, node, 1);
40874        des_int(n_compression, compression, 2);
40875        xmlResetLastError();
40876        if (mem_base != xmlMemBlocks()) {
40877            printf("Leak of %d blocks found in xmlNewTextWriterTree",
40878	           xmlMemBlocks() - mem_base);
40879	    test_ret++;
40880            printf(" %d", n_doc);
40881            printf(" %d", n_node);
40882            printf(" %d", n_compression);
40883            printf("\n");
40884        }
40885    }
40886    }
40887    }
40888    function_tests++;
40889#endif
40890
40891    return(test_ret);
40892}
40893
40894
40895static int
40896test_xmlTextWriterEndAttribute(void) {
40897    int test_ret = 0;
40898
40899#if defined(LIBXML_WRITER_ENABLED)
40900    int mem_base;
40901    int ret_val;
40902    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40903    int n_writer;
40904
40905    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40906        mem_base = xmlMemBlocks();
40907        writer = gen_xmlTextWriterPtr(n_writer, 0);
40908
40909        ret_val = xmlTextWriterEndAttribute(writer);
40910        desret_int(ret_val);
40911        call_tests++;
40912        des_xmlTextWriterPtr(n_writer, writer, 0);
40913        xmlResetLastError();
40914        if (mem_base != xmlMemBlocks()) {
40915            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
40916	           xmlMemBlocks() - mem_base);
40917	    test_ret++;
40918            printf(" %d", n_writer);
40919            printf("\n");
40920        }
40921    }
40922    function_tests++;
40923#endif
40924
40925    return(test_ret);
40926}
40927
40928
40929static int
40930test_xmlTextWriterEndCDATA(void) {
40931    int test_ret = 0;
40932
40933#if defined(LIBXML_WRITER_ENABLED)
40934    int mem_base;
40935    int ret_val;
40936    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40937    int n_writer;
40938
40939    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40940        mem_base = xmlMemBlocks();
40941        writer = gen_xmlTextWriterPtr(n_writer, 0);
40942
40943        ret_val = xmlTextWriterEndCDATA(writer);
40944        desret_int(ret_val);
40945        call_tests++;
40946        des_xmlTextWriterPtr(n_writer, writer, 0);
40947        xmlResetLastError();
40948        if (mem_base != xmlMemBlocks()) {
40949            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
40950	           xmlMemBlocks() - mem_base);
40951	    test_ret++;
40952            printf(" %d", n_writer);
40953            printf("\n");
40954        }
40955    }
40956    function_tests++;
40957#endif
40958
40959    return(test_ret);
40960}
40961
40962
40963static int
40964test_xmlTextWriterEndComment(void) {
40965    int test_ret = 0;
40966
40967#if defined(LIBXML_WRITER_ENABLED)
40968    int mem_base;
40969    int ret_val;
40970    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40971    int n_writer;
40972
40973    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40974        mem_base = xmlMemBlocks();
40975        writer = gen_xmlTextWriterPtr(n_writer, 0);
40976
40977        ret_val = xmlTextWriterEndComment(writer);
40978        desret_int(ret_val);
40979        call_tests++;
40980        des_xmlTextWriterPtr(n_writer, writer, 0);
40981        xmlResetLastError();
40982        if (mem_base != xmlMemBlocks()) {
40983            printf("Leak of %d blocks found in xmlTextWriterEndComment",
40984	           xmlMemBlocks() - mem_base);
40985	    test_ret++;
40986            printf(" %d", n_writer);
40987            printf("\n");
40988        }
40989    }
40990    function_tests++;
40991#endif
40992
40993    return(test_ret);
40994}
40995
40996
40997static int
40998test_xmlTextWriterEndDTD(void) {
40999    int test_ret = 0;
41000
41001#if defined(LIBXML_WRITER_ENABLED)
41002    int mem_base;
41003    int ret_val;
41004    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41005    int n_writer;
41006
41007    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41008        mem_base = xmlMemBlocks();
41009        writer = gen_xmlTextWriterPtr(n_writer, 0);
41010
41011        ret_val = xmlTextWriterEndDTD(writer);
41012        desret_int(ret_val);
41013        call_tests++;
41014        des_xmlTextWriterPtr(n_writer, writer, 0);
41015        xmlResetLastError();
41016        if (mem_base != xmlMemBlocks()) {
41017            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
41018	           xmlMemBlocks() - mem_base);
41019	    test_ret++;
41020            printf(" %d", n_writer);
41021            printf("\n");
41022        }
41023    }
41024    function_tests++;
41025#endif
41026
41027    return(test_ret);
41028}
41029
41030
41031static int
41032test_xmlTextWriterEndDTDAttlist(void) {
41033    int test_ret = 0;
41034
41035#if defined(LIBXML_WRITER_ENABLED)
41036    int mem_base;
41037    int ret_val;
41038    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41039    int n_writer;
41040
41041    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41042        mem_base = xmlMemBlocks();
41043        writer = gen_xmlTextWriterPtr(n_writer, 0);
41044
41045        ret_val = xmlTextWriterEndDTDAttlist(writer);
41046        desret_int(ret_val);
41047        call_tests++;
41048        des_xmlTextWriterPtr(n_writer, writer, 0);
41049        xmlResetLastError();
41050        if (mem_base != xmlMemBlocks()) {
41051            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
41052	           xmlMemBlocks() - mem_base);
41053	    test_ret++;
41054            printf(" %d", n_writer);
41055            printf("\n");
41056        }
41057    }
41058    function_tests++;
41059#endif
41060
41061    return(test_ret);
41062}
41063
41064
41065static int
41066test_xmlTextWriterEndDTDElement(void) {
41067    int test_ret = 0;
41068
41069#if defined(LIBXML_WRITER_ENABLED)
41070    int mem_base;
41071    int ret_val;
41072    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41073    int n_writer;
41074
41075    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41076        mem_base = xmlMemBlocks();
41077        writer = gen_xmlTextWriterPtr(n_writer, 0);
41078
41079        ret_val = xmlTextWriterEndDTDElement(writer);
41080        desret_int(ret_val);
41081        call_tests++;
41082        des_xmlTextWriterPtr(n_writer, writer, 0);
41083        xmlResetLastError();
41084        if (mem_base != xmlMemBlocks()) {
41085            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
41086	           xmlMemBlocks() - mem_base);
41087	    test_ret++;
41088            printf(" %d", n_writer);
41089            printf("\n");
41090        }
41091    }
41092    function_tests++;
41093#endif
41094
41095    return(test_ret);
41096}
41097
41098
41099static int
41100test_xmlTextWriterEndDTDEntity(void) {
41101    int test_ret = 0;
41102
41103#if defined(LIBXML_WRITER_ENABLED)
41104    int mem_base;
41105    int ret_val;
41106    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41107    int n_writer;
41108
41109    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41110        mem_base = xmlMemBlocks();
41111        writer = gen_xmlTextWriterPtr(n_writer, 0);
41112
41113        ret_val = xmlTextWriterEndDTDEntity(writer);
41114        desret_int(ret_val);
41115        call_tests++;
41116        des_xmlTextWriterPtr(n_writer, writer, 0);
41117        xmlResetLastError();
41118        if (mem_base != xmlMemBlocks()) {
41119            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
41120	           xmlMemBlocks() - mem_base);
41121	    test_ret++;
41122            printf(" %d", n_writer);
41123            printf("\n");
41124        }
41125    }
41126    function_tests++;
41127#endif
41128
41129    return(test_ret);
41130}
41131
41132
41133static int
41134test_xmlTextWriterEndDocument(void) {
41135    int test_ret = 0;
41136
41137#if defined(LIBXML_WRITER_ENABLED)
41138    int mem_base;
41139    int ret_val;
41140    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41141    int n_writer;
41142
41143    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41144        mem_base = xmlMemBlocks();
41145        writer = gen_xmlTextWriterPtr(n_writer, 0);
41146
41147        ret_val = xmlTextWriterEndDocument(writer);
41148        desret_int(ret_val);
41149        call_tests++;
41150        des_xmlTextWriterPtr(n_writer, writer, 0);
41151        xmlResetLastError();
41152        if (mem_base != xmlMemBlocks()) {
41153            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
41154	           xmlMemBlocks() - mem_base);
41155	    test_ret++;
41156            printf(" %d", n_writer);
41157            printf("\n");
41158        }
41159    }
41160    function_tests++;
41161#endif
41162
41163    return(test_ret);
41164}
41165
41166
41167static int
41168test_xmlTextWriterEndElement(void) {
41169    int test_ret = 0;
41170
41171#if defined(LIBXML_WRITER_ENABLED)
41172    int mem_base;
41173    int ret_val;
41174    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41175    int n_writer;
41176
41177    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41178        mem_base = xmlMemBlocks();
41179        writer = gen_xmlTextWriterPtr(n_writer, 0);
41180
41181        ret_val = xmlTextWriterEndElement(writer);
41182        desret_int(ret_val);
41183        call_tests++;
41184        des_xmlTextWriterPtr(n_writer, writer, 0);
41185        xmlResetLastError();
41186        if (mem_base != xmlMemBlocks()) {
41187            printf("Leak of %d blocks found in xmlTextWriterEndElement",
41188	           xmlMemBlocks() - mem_base);
41189	    test_ret++;
41190            printf(" %d", n_writer);
41191            printf("\n");
41192        }
41193    }
41194    function_tests++;
41195#endif
41196
41197    return(test_ret);
41198}
41199
41200
41201static int
41202test_xmlTextWriterEndPI(void) {
41203    int test_ret = 0;
41204
41205#if defined(LIBXML_WRITER_ENABLED)
41206    int mem_base;
41207    int ret_val;
41208    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41209    int n_writer;
41210
41211    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41212        mem_base = xmlMemBlocks();
41213        writer = gen_xmlTextWriterPtr(n_writer, 0);
41214
41215        ret_val = xmlTextWriterEndPI(writer);
41216        desret_int(ret_val);
41217        call_tests++;
41218        des_xmlTextWriterPtr(n_writer, writer, 0);
41219        xmlResetLastError();
41220        if (mem_base != xmlMemBlocks()) {
41221            printf("Leak of %d blocks found in xmlTextWriterEndPI",
41222	           xmlMemBlocks() - mem_base);
41223	    test_ret++;
41224            printf(" %d", n_writer);
41225            printf("\n");
41226        }
41227    }
41228    function_tests++;
41229#endif
41230
41231    return(test_ret);
41232}
41233
41234
41235static int
41236test_xmlTextWriterFlush(void) {
41237    int test_ret = 0;
41238
41239#if defined(LIBXML_WRITER_ENABLED)
41240    int mem_base;
41241    int ret_val;
41242    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41243    int n_writer;
41244
41245    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41246        mem_base = xmlMemBlocks();
41247        writer = gen_xmlTextWriterPtr(n_writer, 0);
41248
41249        ret_val = xmlTextWriterFlush(writer);
41250        desret_int(ret_val);
41251        call_tests++;
41252        des_xmlTextWriterPtr(n_writer, writer, 0);
41253        xmlResetLastError();
41254        if (mem_base != xmlMemBlocks()) {
41255            printf("Leak of %d blocks found in xmlTextWriterFlush",
41256	           xmlMemBlocks() - mem_base);
41257	    test_ret++;
41258            printf(" %d", n_writer);
41259            printf("\n");
41260        }
41261    }
41262    function_tests++;
41263#endif
41264
41265    return(test_ret);
41266}
41267
41268
41269static int
41270test_xmlTextWriterFullEndElement(void) {
41271    int test_ret = 0;
41272
41273#if defined(LIBXML_WRITER_ENABLED)
41274    int mem_base;
41275    int ret_val;
41276    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41277    int n_writer;
41278
41279    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41280        mem_base = xmlMemBlocks();
41281        writer = gen_xmlTextWriterPtr(n_writer, 0);
41282
41283        ret_val = xmlTextWriterFullEndElement(writer);
41284        desret_int(ret_val);
41285        call_tests++;
41286        des_xmlTextWriterPtr(n_writer, writer, 0);
41287        xmlResetLastError();
41288        if (mem_base != xmlMemBlocks()) {
41289            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
41290	           xmlMemBlocks() - mem_base);
41291	    test_ret++;
41292            printf(" %d", n_writer);
41293            printf("\n");
41294        }
41295    }
41296    function_tests++;
41297#endif
41298
41299    return(test_ret);
41300}
41301
41302
41303static int
41304test_xmlTextWriterSetIndent(void) {
41305    int test_ret = 0;
41306
41307#if defined(LIBXML_WRITER_ENABLED)
41308    int mem_base;
41309    int ret_val;
41310    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41311    int n_writer;
41312    int indent; /* do indentation? */
41313    int n_indent;
41314
41315    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41316    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
41317        mem_base = xmlMemBlocks();
41318        writer = gen_xmlTextWriterPtr(n_writer, 0);
41319        indent = gen_int(n_indent, 1);
41320
41321        ret_val = xmlTextWriterSetIndent(writer, indent);
41322        desret_int(ret_val);
41323        call_tests++;
41324        des_xmlTextWriterPtr(n_writer, writer, 0);
41325        des_int(n_indent, indent, 1);
41326        xmlResetLastError();
41327        if (mem_base != xmlMemBlocks()) {
41328            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
41329	           xmlMemBlocks() - mem_base);
41330	    test_ret++;
41331            printf(" %d", n_writer);
41332            printf(" %d", n_indent);
41333            printf("\n");
41334        }
41335    }
41336    }
41337    function_tests++;
41338#endif
41339
41340    return(test_ret);
41341}
41342
41343
41344static int
41345test_xmlTextWriterSetIndentString(void) {
41346    int test_ret = 0;
41347
41348#if defined(LIBXML_WRITER_ENABLED)
41349    int mem_base;
41350    int ret_val;
41351    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41352    int n_writer;
41353    xmlChar * str; /* the xmlChar string */
41354    int n_str;
41355
41356    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41357    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
41358        mem_base = xmlMemBlocks();
41359        writer = gen_xmlTextWriterPtr(n_writer, 0);
41360        str = gen_const_xmlChar_ptr(n_str, 1);
41361
41362        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
41363        desret_int(ret_val);
41364        call_tests++;
41365        des_xmlTextWriterPtr(n_writer, writer, 0);
41366        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
41367        xmlResetLastError();
41368        if (mem_base != xmlMemBlocks()) {
41369            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
41370	           xmlMemBlocks() - mem_base);
41371	    test_ret++;
41372            printf(" %d", n_writer);
41373            printf(" %d", n_str);
41374            printf("\n");
41375        }
41376    }
41377    }
41378    function_tests++;
41379#endif
41380
41381    return(test_ret);
41382}
41383
41384
41385static int
41386test_xmlTextWriterStartAttribute(void) {
41387    int test_ret = 0;
41388
41389#if defined(LIBXML_WRITER_ENABLED)
41390    int mem_base;
41391    int ret_val;
41392    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41393    int n_writer;
41394    xmlChar * name; /* element name */
41395    int n_name;
41396
41397    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41398    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41399        mem_base = xmlMemBlocks();
41400        writer = gen_xmlTextWriterPtr(n_writer, 0);
41401        name = gen_const_xmlChar_ptr(n_name, 1);
41402
41403        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
41404        desret_int(ret_val);
41405        call_tests++;
41406        des_xmlTextWriterPtr(n_writer, writer, 0);
41407        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41408        xmlResetLastError();
41409        if (mem_base != xmlMemBlocks()) {
41410            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
41411	           xmlMemBlocks() - mem_base);
41412	    test_ret++;
41413            printf(" %d", n_writer);
41414            printf(" %d", n_name);
41415            printf("\n");
41416        }
41417    }
41418    }
41419    function_tests++;
41420#endif
41421
41422    return(test_ret);
41423}
41424
41425
41426static int
41427test_xmlTextWriterStartAttributeNS(void) {
41428    int test_ret = 0;
41429
41430#if defined(LIBXML_WRITER_ENABLED)
41431    int mem_base;
41432    int ret_val;
41433    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41434    int n_writer;
41435    xmlChar * prefix; /* namespace prefix or NULL */
41436    int n_prefix;
41437    xmlChar * name; /* element local name */
41438    int n_name;
41439    xmlChar * namespaceURI; /* namespace URI or NULL */
41440    int n_namespaceURI;
41441
41442    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41443    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41444    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41445    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41446        mem_base = xmlMemBlocks();
41447        writer = gen_xmlTextWriterPtr(n_writer, 0);
41448        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
41449        name = gen_const_xmlChar_ptr(n_name, 2);
41450        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
41451
41452        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
41453        desret_int(ret_val);
41454        call_tests++;
41455        des_xmlTextWriterPtr(n_writer, writer, 0);
41456        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
41457        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41458        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
41459        xmlResetLastError();
41460        if (mem_base != xmlMemBlocks()) {
41461            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
41462	           xmlMemBlocks() - mem_base);
41463	    test_ret++;
41464            printf(" %d", n_writer);
41465            printf(" %d", n_prefix);
41466            printf(" %d", n_name);
41467            printf(" %d", n_namespaceURI);
41468            printf("\n");
41469        }
41470    }
41471    }
41472    }
41473    }
41474    function_tests++;
41475#endif
41476
41477    return(test_ret);
41478}
41479
41480
41481static int
41482test_xmlTextWriterStartCDATA(void) {
41483    int test_ret = 0;
41484
41485#if defined(LIBXML_WRITER_ENABLED)
41486    int mem_base;
41487    int ret_val;
41488    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41489    int n_writer;
41490
41491    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41492        mem_base = xmlMemBlocks();
41493        writer = gen_xmlTextWriterPtr(n_writer, 0);
41494
41495        ret_val = xmlTextWriterStartCDATA(writer);
41496        desret_int(ret_val);
41497        call_tests++;
41498        des_xmlTextWriterPtr(n_writer, writer, 0);
41499        xmlResetLastError();
41500        if (mem_base != xmlMemBlocks()) {
41501            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
41502	           xmlMemBlocks() - mem_base);
41503	    test_ret++;
41504            printf(" %d", n_writer);
41505            printf("\n");
41506        }
41507    }
41508    function_tests++;
41509#endif
41510
41511    return(test_ret);
41512}
41513
41514
41515static int
41516test_xmlTextWriterStartComment(void) {
41517    int test_ret = 0;
41518
41519#if defined(LIBXML_WRITER_ENABLED)
41520    int mem_base;
41521    int ret_val;
41522    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41523    int n_writer;
41524
41525    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41526        mem_base = xmlMemBlocks();
41527        writer = gen_xmlTextWriterPtr(n_writer, 0);
41528
41529        ret_val = xmlTextWriterStartComment(writer);
41530        desret_int(ret_val);
41531        call_tests++;
41532        des_xmlTextWriterPtr(n_writer, writer, 0);
41533        xmlResetLastError();
41534        if (mem_base != xmlMemBlocks()) {
41535            printf("Leak of %d blocks found in xmlTextWriterStartComment",
41536	           xmlMemBlocks() - mem_base);
41537	    test_ret++;
41538            printf(" %d", n_writer);
41539            printf("\n");
41540        }
41541    }
41542    function_tests++;
41543#endif
41544
41545    return(test_ret);
41546}
41547
41548
41549static int
41550test_xmlTextWriterStartDTD(void) {
41551    int test_ret = 0;
41552
41553#if defined(LIBXML_WRITER_ENABLED)
41554    int mem_base;
41555    int ret_val;
41556    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41557    int n_writer;
41558    xmlChar * name; /* the name of the DTD */
41559    int n_name;
41560    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
41561    int n_pubid;
41562    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
41563    int n_sysid;
41564
41565    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41566    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41567    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41568    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41569        mem_base = xmlMemBlocks();
41570        writer = gen_xmlTextWriterPtr(n_writer, 0);
41571        name = gen_const_xmlChar_ptr(n_name, 1);
41572        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
41573        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
41574
41575        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
41576        desret_int(ret_val);
41577        call_tests++;
41578        des_xmlTextWriterPtr(n_writer, writer, 0);
41579        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41580        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
41581        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
41582        xmlResetLastError();
41583        if (mem_base != xmlMemBlocks()) {
41584            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
41585	           xmlMemBlocks() - mem_base);
41586	    test_ret++;
41587            printf(" %d", n_writer);
41588            printf(" %d", n_name);
41589            printf(" %d", n_pubid);
41590            printf(" %d", n_sysid);
41591            printf("\n");
41592        }
41593    }
41594    }
41595    }
41596    }
41597    function_tests++;
41598#endif
41599
41600    return(test_ret);
41601}
41602
41603
41604static int
41605test_xmlTextWriterStartDTDAttlist(void) {
41606    int test_ret = 0;
41607
41608#if defined(LIBXML_WRITER_ENABLED)
41609    int mem_base;
41610    int ret_val;
41611    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41612    int n_writer;
41613    xmlChar * name; /* the name of the DTD ATTLIST */
41614    int n_name;
41615
41616    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41617    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41618        mem_base = xmlMemBlocks();
41619        writer = gen_xmlTextWriterPtr(n_writer, 0);
41620        name = gen_const_xmlChar_ptr(n_name, 1);
41621
41622        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
41623        desret_int(ret_val);
41624        call_tests++;
41625        des_xmlTextWriterPtr(n_writer, writer, 0);
41626        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41627        xmlResetLastError();
41628        if (mem_base != xmlMemBlocks()) {
41629            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
41630	           xmlMemBlocks() - mem_base);
41631	    test_ret++;
41632            printf(" %d", n_writer);
41633            printf(" %d", n_name);
41634            printf("\n");
41635        }
41636    }
41637    }
41638    function_tests++;
41639#endif
41640
41641    return(test_ret);
41642}
41643
41644
41645static int
41646test_xmlTextWriterStartDTDElement(void) {
41647    int test_ret = 0;
41648
41649#if defined(LIBXML_WRITER_ENABLED)
41650    int mem_base;
41651    int ret_val;
41652    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41653    int n_writer;
41654    xmlChar * name; /* the name of the DTD element */
41655    int n_name;
41656
41657    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41658    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41659        mem_base = xmlMemBlocks();
41660        writer = gen_xmlTextWriterPtr(n_writer, 0);
41661        name = gen_const_xmlChar_ptr(n_name, 1);
41662
41663        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
41664        desret_int(ret_val);
41665        call_tests++;
41666        des_xmlTextWriterPtr(n_writer, writer, 0);
41667        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41668        xmlResetLastError();
41669        if (mem_base != xmlMemBlocks()) {
41670            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
41671	           xmlMemBlocks() - mem_base);
41672	    test_ret++;
41673            printf(" %d", n_writer);
41674            printf(" %d", n_name);
41675            printf("\n");
41676        }
41677    }
41678    }
41679    function_tests++;
41680#endif
41681
41682    return(test_ret);
41683}
41684
41685
41686static int
41687test_xmlTextWriterStartDTDEntity(void) {
41688    int test_ret = 0;
41689
41690#if defined(LIBXML_WRITER_ENABLED)
41691    int mem_base;
41692    int ret_val;
41693    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41694    int n_writer;
41695    int pe; /* TRUE if this is a parameter entity, FALSE if not */
41696    int n_pe;
41697    xmlChar * name; /* the name of the DTD ATTLIST */
41698    int n_name;
41699
41700    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41701    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41702    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41703        mem_base = xmlMemBlocks();
41704        writer = gen_xmlTextWriterPtr(n_writer, 0);
41705        pe = gen_int(n_pe, 1);
41706        name = gen_const_xmlChar_ptr(n_name, 2);
41707
41708        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
41709        desret_int(ret_val);
41710        call_tests++;
41711        des_xmlTextWriterPtr(n_writer, writer, 0);
41712        des_int(n_pe, pe, 1);
41713        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41714        xmlResetLastError();
41715        if (mem_base != xmlMemBlocks()) {
41716            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
41717	           xmlMemBlocks() - mem_base);
41718	    test_ret++;
41719            printf(" %d", n_writer);
41720            printf(" %d", n_pe);
41721            printf(" %d", n_name);
41722            printf("\n");
41723        }
41724    }
41725    }
41726    }
41727    function_tests++;
41728#endif
41729
41730    return(test_ret);
41731}
41732
41733
41734static int
41735test_xmlTextWriterStartDocument(void) {
41736    int test_ret = 0;
41737
41738#if defined(LIBXML_WRITER_ENABLED)
41739    int mem_base;
41740    int ret_val;
41741    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41742    int n_writer;
41743    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
41744    int n_version;
41745    char * encoding; /* the encoding or NULL for default */
41746    int n_encoding;
41747    char * standalone; /* "yes" or "no" or NULL for default */
41748    int n_standalone;
41749
41750    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41751    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
41752    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
41753    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
41754        mem_base = xmlMemBlocks();
41755        writer = gen_xmlTextWriterPtr(n_writer, 0);
41756        version = gen_const_char_ptr(n_version, 1);
41757        encoding = gen_const_char_ptr(n_encoding, 2);
41758        standalone = gen_const_char_ptr(n_standalone, 3);
41759
41760        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
41761        desret_int(ret_val);
41762        call_tests++;
41763        des_xmlTextWriterPtr(n_writer, writer, 0);
41764        des_const_char_ptr(n_version, (const char *)version, 1);
41765        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
41766        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
41767        xmlResetLastError();
41768        if (mem_base != xmlMemBlocks()) {
41769            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
41770	           xmlMemBlocks() - mem_base);
41771	    test_ret++;
41772            printf(" %d", n_writer);
41773            printf(" %d", n_version);
41774            printf(" %d", n_encoding);
41775            printf(" %d", n_standalone);
41776            printf("\n");
41777        }
41778    }
41779    }
41780    }
41781    }
41782    function_tests++;
41783#endif
41784
41785    return(test_ret);
41786}
41787
41788
41789static int
41790test_xmlTextWriterStartElement(void) {
41791    int test_ret = 0;
41792
41793#if defined(LIBXML_WRITER_ENABLED)
41794    int mem_base;
41795    int ret_val;
41796    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41797    int n_writer;
41798    xmlChar * name; /* element name */
41799    int n_name;
41800
41801    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41802    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41803        mem_base = xmlMemBlocks();
41804        writer = gen_xmlTextWriterPtr(n_writer, 0);
41805        name = gen_const_xmlChar_ptr(n_name, 1);
41806
41807        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
41808        desret_int(ret_val);
41809        call_tests++;
41810        des_xmlTextWriterPtr(n_writer, writer, 0);
41811        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41812        xmlResetLastError();
41813        if (mem_base != xmlMemBlocks()) {
41814            printf("Leak of %d blocks found in xmlTextWriterStartElement",
41815	           xmlMemBlocks() - mem_base);
41816	    test_ret++;
41817            printf(" %d", n_writer);
41818            printf(" %d", n_name);
41819            printf("\n");
41820        }
41821    }
41822    }
41823    function_tests++;
41824#endif
41825
41826    return(test_ret);
41827}
41828
41829
41830static int
41831test_xmlTextWriterStartElementNS(void) {
41832    int test_ret = 0;
41833
41834#if defined(LIBXML_WRITER_ENABLED)
41835    int mem_base;
41836    int ret_val;
41837    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41838    int n_writer;
41839    xmlChar * prefix; /* namespace prefix or NULL */
41840    int n_prefix;
41841    xmlChar * name; /* element local name */
41842    int n_name;
41843    xmlChar * namespaceURI; /* namespace URI or NULL */
41844    int n_namespaceURI;
41845
41846    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41847    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41848    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41849    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41850        mem_base = xmlMemBlocks();
41851        writer = gen_xmlTextWriterPtr(n_writer, 0);
41852        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
41853        name = gen_const_xmlChar_ptr(n_name, 2);
41854        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
41855
41856        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
41857        desret_int(ret_val);
41858        call_tests++;
41859        des_xmlTextWriterPtr(n_writer, writer, 0);
41860        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
41861        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41862        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
41863        xmlResetLastError();
41864        if (mem_base != xmlMemBlocks()) {
41865            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
41866	           xmlMemBlocks() - mem_base);
41867	    test_ret++;
41868            printf(" %d", n_writer);
41869            printf(" %d", n_prefix);
41870            printf(" %d", n_name);
41871            printf(" %d", n_namespaceURI);
41872            printf("\n");
41873        }
41874    }
41875    }
41876    }
41877    }
41878    function_tests++;
41879#endif
41880
41881    return(test_ret);
41882}
41883
41884
41885static int
41886test_xmlTextWriterStartPI(void) {
41887    int test_ret = 0;
41888
41889#if defined(LIBXML_WRITER_ENABLED)
41890    int mem_base;
41891    int ret_val;
41892    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41893    int n_writer;
41894    xmlChar * target; /* PI target */
41895    int n_target;
41896
41897    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41898    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
41899        mem_base = xmlMemBlocks();
41900        writer = gen_xmlTextWriterPtr(n_writer, 0);
41901        target = gen_const_xmlChar_ptr(n_target, 1);
41902
41903        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
41904        desret_int(ret_val);
41905        call_tests++;
41906        des_xmlTextWriterPtr(n_writer, writer, 0);
41907        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
41908        xmlResetLastError();
41909        if (mem_base != xmlMemBlocks()) {
41910            printf("Leak of %d blocks found in xmlTextWriterStartPI",
41911	           xmlMemBlocks() - mem_base);
41912	    test_ret++;
41913            printf(" %d", n_writer);
41914            printf(" %d", n_target);
41915            printf("\n");
41916        }
41917    }
41918    }
41919    function_tests++;
41920#endif
41921
41922    return(test_ret);
41923}
41924
41925
41926static int
41927test_xmlTextWriterWriteAttribute(void) {
41928    int test_ret = 0;
41929
41930#if defined(LIBXML_WRITER_ENABLED)
41931    int mem_base;
41932    int ret_val;
41933    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41934    int n_writer;
41935    xmlChar * name; /* attribute name */
41936    int n_name;
41937    xmlChar * content; /* attribute content */
41938    int n_content;
41939
41940    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41941    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41942    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41943        mem_base = xmlMemBlocks();
41944        writer = gen_xmlTextWriterPtr(n_writer, 0);
41945        name = gen_const_xmlChar_ptr(n_name, 1);
41946        content = gen_const_xmlChar_ptr(n_content, 2);
41947
41948        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
41949        desret_int(ret_val);
41950        call_tests++;
41951        des_xmlTextWriterPtr(n_writer, writer, 0);
41952        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41953        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
41954        xmlResetLastError();
41955        if (mem_base != xmlMemBlocks()) {
41956            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
41957	           xmlMemBlocks() - mem_base);
41958	    test_ret++;
41959            printf(" %d", n_writer);
41960            printf(" %d", n_name);
41961            printf(" %d", n_content);
41962            printf("\n");
41963        }
41964    }
41965    }
41966    }
41967    function_tests++;
41968#endif
41969
41970    return(test_ret);
41971}
41972
41973
41974static int
41975test_xmlTextWriterWriteAttributeNS(void) {
41976    int test_ret = 0;
41977
41978#if defined(LIBXML_WRITER_ENABLED)
41979    int mem_base;
41980    int ret_val;
41981    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41982    int n_writer;
41983    xmlChar * prefix; /* namespace prefix */
41984    int n_prefix;
41985    xmlChar * name; /* attribute local name */
41986    int n_name;
41987    xmlChar * namespaceURI; /* namespace URI */
41988    int n_namespaceURI;
41989    xmlChar * content; /* attribute content */
41990    int n_content;
41991
41992    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41993    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41994    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41995    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41996    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41997        mem_base = xmlMemBlocks();
41998        writer = gen_xmlTextWriterPtr(n_writer, 0);
41999        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
42000        name = gen_const_xmlChar_ptr(n_name, 2);
42001        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
42002        content = gen_const_xmlChar_ptr(n_content, 4);
42003
42004        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
42005        desret_int(ret_val);
42006        call_tests++;
42007        des_xmlTextWriterPtr(n_writer, writer, 0);
42008        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
42009        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42010        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
42011        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
42012        xmlResetLastError();
42013        if (mem_base != xmlMemBlocks()) {
42014            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
42015	           xmlMemBlocks() - mem_base);
42016	    test_ret++;
42017            printf(" %d", n_writer);
42018            printf(" %d", n_prefix);
42019            printf(" %d", n_name);
42020            printf(" %d", n_namespaceURI);
42021            printf(" %d", n_content);
42022            printf("\n");
42023        }
42024    }
42025    }
42026    }
42027    }
42028    }
42029    function_tests++;
42030#endif
42031
42032    return(test_ret);
42033}
42034
42035
42036static int
42037test_xmlTextWriterWriteBase64(void) {
42038    int test_ret = 0;
42039
42040#if defined(LIBXML_WRITER_ENABLED)
42041    int mem_base;
42042    int ret_val;
42043    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42044    int n_writer;
42045    char * data; /* binary data */
42046    int n_data;
42047    int start; /* the position within the data of the first byte to encode */
42048    int n_start;
42049    int len; /* the number of bytes to encode */
42050    int n_len;
42051
42052    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42053    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
42054    for (n_start = 0;n_start < gen_nb_int;n_start++) {
42055    for (n_len = 0;n_len < gen_nb_int;n_len++) {
42056        mem_base = xmlMemBlocks();
42057        writer = gen_xmlTextWriterPtr(n_writer, 0);
42058        data = gen_const_char_ptr(n_data, 1);
42059        start = gen_int(n_start, 2);
42060        len = gen_int(n_len, 3);
42061
42062        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
42063        desret_int(ret_val);
42064        call_tests++;
42065        des_xmlTextWriterPtr(n_writer, writer, 0);
42066        des_const_char_ptr(n_data, (const char *)data, 1);
42067        des_int(n_start, start, 2);
42068        des_int(n_len, len, 3);
42069        xmlResetLastError();
42070        if (mem_base != xmlMemBlocks()) {
42071            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
42072	           xmlMemBlocks() - mem_base);
42073	    test_ret++;
42074            printf(" %d", n_writer);
42075            printf(" %d", n_data);
42076            printf(" %d", n_start);
42077            printf(" %d", n_len);
42078            printf("\n");
42079        }
42080    }
42081    }
42082    }
42083    }
42084    function_tests++;
42085#endif
42086
42087    return(test_ret);
42088}
42089
42090
42091static int
42092test_xmlTextWriterWriteBinHex(void) {
42093    int test_ret = 0;
42094
42095#if defined(LIBXML_WRITER_ENABLED)
42096    int mem_base;
42097    int ret_val;
42098    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42099    int n_writer;
42100    char * data; /* binary data */
42101    int n_data;
42102    int start; /* the position within the data of the first byte to encode */
42103    int n_start;
42104    int len; /* the number of bytes to encode */
42105    int n_len;
42106
42107    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42108    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
42109    for (n_start = 0;n_start < gen_nb_int;n_start++) {
42110    for (n_len = 0;n_len < gen_nb_int;n_len++) {
42111        mem_base = xmlMemBlocks();
42112        writer = gen_xmlTextWriterPtr(n_writer, 0);
42113        data = gen_const_char_ptr(n_data, 1);
42114        start = gen_int(n_start, 2);
42115        len = gen_int(n_len, 3);
42116
42117        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
42118        desret_int(ret_val);
42119        call_tests++;
42120        des_xmlTextWriterPtr(n_writer, writer, 0);
42121        des_const_char_ptr(n_data, (const char *)data, 1);
42122        des_int(n_start, start, 2);
42123        des_int(n_len, len, 3);
42124        xmlResetLastError();
42125        if (mem_base != xmlMemBlocks()) {
42126            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
42127	           xmlMemBlocks() - mem_base);
42128	    test_ret++;
42129            printf(" %d", n_writer);
42130            printf(" %d", n_data);
42131            printf(" %d", n_start);
42132            printf(" %d", n_len);
42133            printf("\n");
42134        }
42135    }
42136    }
42137    }
42138    }
42139    function_tests++;
42140#endif
42141
42142    return(test_ret);
42143}
42144
42145
42146static int
42147test_xmlTextWriterWriteCDATA(void) {
42148    int test_ret = 0;
42149
42150#if defined(LIBXML_WRITER_ENABLED)
42151    int mem_base;
42152    int ret_val;
42153    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42154    int n_writer;
42155    xmlChar * content; /* CDATA content */
42156    int n_content;
42157
42158    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42159    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42160        mem_base = xmlMemBlocks();
42161        writer = gen_xmlTextWriterPtr(n_writer, 0);
42162        content = gen_const_xmlChar_ptr(n_content, 1);
42163
42164        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
42165        desret_int(ret_val);
42166        call_tests++;
42167        des_xmlTextWriterPtr(n_writer, writer, 0);
42168        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
42169        xmlResetLastError();
42170        if (mem_base != xmlMemBlocks()) {
42171            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
42172	           xmlMemBlocks() - mem_base);
42173	    test_ret++;
42174            printf(" %d", n_writer);
42175            printf(" %d", n_content);
42176            printf("\n");
42177        }
42178    }
42179    }
42180    function_tests++;
42181#endif
42182
42183    return(test_ret);
42184}
42185
42186
42187static int
42188test_xmlTextWriterWriteComment(void) {
42189    int test_ret = 0;
42190
42191#if defined(LIBXML_WRITER_ENABLED)
42192    int mem_base;
42193    int ret_val;
42194    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42195    int n_writer;
42196    xmlChar * content; /* comment string */
42197    int n_content;
42198
42199    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42200    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42201        mem_base = xmlMemBlocks();
42202        writer = gen_xmlTextWriterPtr(n_writer, 0);
42203        content = gen_const_xmlChar_ptr(n_content, 1);
42204
42205        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
42206        desret_int(ret_val);
42207        call_tests++;
42208        des_xmlTextWriterPtr(n_writer, writer, 0);
42209        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
42210        xmlResetLastError();
42211        if (mem_base != xmlMemBlocks()) {
42212            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
42213	           xmlMemBlocks() - mem_base);
42214	    test_ret++;
42215            printf(" %d", n_writer);
42216            printf(" %d", n_content);
42217            printf("\n");
42218        }
42219    }
42220    }
42221    function_tests++;
42222#endif
42223
42224    return(test_ret);
42225}
42226
42227
42228static int
42229test_xmlTextWriterWriteDTD(void) {
42230    int test_ret = 0;
42231
42232#if defined(LIBXML_WRITER_ENABLED)
42233    int mem_base;
42234    int ret_val;
42235    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42236    int n_writer;
42237    xmlChar * name; /* the name of the DTD */
42238    int n_name;
42239    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42240    int n_pubid;
42241    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42242    int n_sysid;
42243    xmlChar * subset; /* string content of the DTD */
42244    int n_subset;
42245
42246    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42247    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42248    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42249    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42250    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
42251        mem_base = xmlMemBlocks();
42252        writer = gen_xmlTextWriterPtr(n_writer, 0);
42253        name = gen_const_xmlChar_ptr(n_name, 1);
42254        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
42255        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
42256        subset = gen_const_xmlChar_ptr(n_subset, 4);
42257
42258        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
42259        desret_int(ret_val);
42260        call_tests++;
42261        des_xmlTextWriterPtr(n_writer, writer, 0);
42262        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42263        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
42264        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
42265        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
42266        xmlResetLastError();
42267        if (mem_base != xmlMemBlocks()) {
42268            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
42269	           xmlMemBlocks() - mem_base);
42270	    test_ret++;
42271            printf(" %d", n_writer);
42272            printf(" %d", n_name);
42273            printf(" %d", n_pubid);
42274            printf(" %d", n_sysid);
42275            printf(" %d", n_subset);
42276            printf("\n");
42277        }
42278    }
42279    }
42280    }
42281    }
42282    }
42283    function_tests++;
42284#endif
42285
42286    return(test_ret);
42287}
42288
42289
42290static int
42291test_xmlTextWriterWriteDTDAttlist(void) {
42292    int test_ret = 0;
42293
42294#if defined(LIBXML_WRITER_ENABLED)
42295    int mem_base;
42296    int ret_val;
42297    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42298    int n_writer;
42299    xmlChar * name; /* the name of the DTD ATTLIST */
42300    int n_name;
42301    xmlChar * content; /* content of the ATTLIST */
42302    int n_content;
42303
42304    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42305    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42306    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42307        mem_base = xmlMemBlocks();
42308        writer = gen_xmlTextWriterPtr(n_writer, 0);
42309        name = gen_const_xmlChar_ptr(n_name, 1);
42310        content = gen_const_xmlChar_ptr(n_content, 2);
42311
42312        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
42313        desret_int(ret_val);
42314        call_tests++;
42315        des_xmlTextWriterPtr(n_writer, writer, 0);
42316        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42317        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42318        xmlResetLastError();
42319        if (mem_base != xmlMemBlocks()) {
42320            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
42321	           xmlMemBlocks() - mem_base);
42322	    test_ret++;
42323            printf(" %d", n_writer);
42324            printf(" %d", n_name);
42325            printf(" %d", n_content);
42326            printf("\n");
42327        }
42328    }
42329    }
42330    }
42331    function_tests++;
42332#endif
42333
42334    return(test_ret);
42335}
42336
42337
42338static int
42339test_xmlTextWriterWriteDTDElement(void) {
42340    int test_ret = 0;
42341
42342#if defined(LIBXML_WRITER_ENABLED)
42343    int mem_base;
42344    int ret_val;
42345    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42346    int n_writer;
42347    xmlChar * name; /* the name of the DTD element */
42348    int n_name;
42349    xmlChar * content; /* content of the element */
42350    int n_content;
42351
42352    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42353    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42354    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42355        mem_base = xmlMemBlocks();
42356        writer = gen_xmlTextWriterPtr(n_writer, 0);
42357        name = gen_const_xmlChar_ptr(n_name, 1);
42358        content = gen_const_xmlChar_ptr(n_content, 2);
42359
42360        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
42361        desret_int(ret_val);
42362        call_tests++;
42363        des_xmlTextWriterPtr(n_writer, writer, 0);
42364        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42365        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42366        xmlResetLastError();
42367        if (mem_base != xmlMemBlocks()) {
42368            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
42369	           xmlMemBlocks() - mem_base);
42370	    test_ret++;
42371            printf(" %d", n_writer);
42372            printf(" %d", n_name);
42373            printf(" %d", n_content);
42374            printf("\n");
42375        }
42376    }
42377    }
42378    }
42379    function_tests++;
42380#endif
42381
42382    return(test_ret);
42383}
42384
42385
42386static int
42387test_xmlTextWriterWriteDTDEntity(void) {
42388    int test_ret = 0;
42389
42390#if defined(LIBXML_WRITER_ENABLED)
42391    int mem_base;
42392    int ret_val;
42393    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42394    int n_writer;
42395    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42396    int n_pe;
42397    xmlChar * name; /* the name of the DTD entity */
42398    int n_name;
42399    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42400    int n_pubid;
42401    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42402    int n_sysid;
42403    xmlChar * ndataid; /* the xml notation name. */
42404    int n_ndataid;
42405    xmlChar * content; /* content of the entity */
42406    int n_content;
42407
42408    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42409    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42410    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42411    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42412    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42413    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
42414    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42415        mem_base = xmlMemBlocks();
42416        writer = gen_xmlTextWriterPtr(n_writer, 0);
42417        pe = gen_int(n_pe, 1);
42418        name = gen_const_xmlChar_ptr(n_name, 2);
42419        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
42420        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
42421        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
42422        content = gen_const_xmlChar_ptr(n_content, 6);
42423
42424        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
42425        desret_int(ret_val);
42426        call_tests++;
42427        des_xmlTextWriterPtr(n_writer, writer, 0);
42428        des_int(n_pe, pe, 1);
42429        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42430        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
42431        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
42432        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
42433        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
42434        xmlResetLastError();
42435        if (mem_base != xmlMemBlocks()) {
42436            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
42437	           xmlMemBlocks() - mem_base);
42438	    test_ret++;
42439            printf(" %d", n_writer);
42440            printf(" %d", n_pe);
42441            printf(" %d", n_name);
42442            printf(" %d", n_pubid);
42443            printf(" %d", n_sysid);
42444            printf(" %d", n_ndataid);
42445            printf(" %d", n_content);
42446            printf("\n");
42447        }
42448    }
42449    }
42450    }
42451    }
42452    }
42453    }
42454    }
42455    function_tests++;
42456#endif
42457
42458    return(test_ret);
42459}
42460
42461
42462static int
42463test_xmlTextWriterWriteDTDExternalEntity(void) {
42464    int test_ret = 0;
42465
42466#if defined(LIBXML_WRITER_ENABLED)
42467    int mem_base;
42468    int ret_val;
42469    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42470    int n_writer;
42471    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42472    int n_pe;
42473    xmlChar * name; /* the name of the DTD entity */
42474    int n_name;
42475    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42476    int n_pubid;
42477    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42478    int n_sysid;
42479    xmlChar * ndataid; /* the xml notation name. */
42480    int n_ndataid;
42481
42482    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42483    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42484    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42485    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42486    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42487    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
42488        mem_base = xmlMemBlocks();
42489        writer = gen_xmlTextWriterPtr(n_writer, 0);
42490        pe = gen_int(n_pe, 1);
42491        name = gen_const_xmlChar_ptr(n_name, 2);
42492        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
42493        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
42494        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
42495
42496        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
42497        desret_int(ret_val);
42498        call_tests++;
42499        des_xmlTextWriterPtr(n_writer, writer, 0);
42500        des_int(n_pe, pe, 1);
42501        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42502        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
42503        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
42504        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
42505        xmlResetLastError();
42506        if (mem_base != xmlMemBlocks()) {
42507            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
42508	           xmlMemBlocks() - mem_base);
42509	    test_ret++;
42510            printf(" %d", n_writer);
42511            printf(" %d", n_pe);
42512            printf(" %d", n_name);
42513            printf(" %d", n_pubid);
42514            printf(" %d", n_sysid);
42515            printf(" %d", n_ndataid);
42516            printf("\n");
42517        }
42518    }
42519    }
42520    }
42521    }
42522    }
42523    }
42524    function_tests++;
42525#endif
42526
42527    return(test_ret);
42528}
42529
42530
42531static int
42532test_xmlTextWriterWriteDTDExternalEntityContents(void) {
42533    int test_ret = 0;
42534
42535#if defined(LIBXML_WRITER_ENABLED)
42536    int mem_base;
42537    int ret_val;
42538    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42539    int n_writer;
42540    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42541    int n_pubid;
42542    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42543    int n_sysid;
42544    xmlChar * ndataid; /* the xml notation name. */
42545    int n_ndataid;
42546
42547    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42548    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42549    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42550    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
42551        mem_base = xmlMemBlocks();
42552        writer = gen_xmlTextWriterPtr(n_writer, 0);
42553        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
42554        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
42555        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
42556
42557        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
42558        desret_int(ret_val);
42559        call_tests++;
42560        des_xmlTextWriterPtr(n_writer, writer, 0);
42561        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
42562        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
42563        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
42564        xmlResetLastError();
42565        if (mem_base != xmlMemBlocks()) {
42566            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
42567	           xmlMemBlocks() - mem_base);
42568	    test_ret++;
42569            printf(" %d", n_writer);
42570            printf(" %d", n_pubid);
42571            printf(" %d", n_sysid);
42572            printf(" %d", n_ndataid);
42573            printf("\n");
42574        }
42575    }
42576    }
42577    }
42578    }
42579    function_tests++;
42580#endif
42581
42582    return(test_ret);
42583}
42584
42585
42586static int
42587test_xmlTextWriterWriteDTDInternalEntity(void) {
42588    int test_ret = 0;
42589
42590#if defined(LIBXML_WRITER_ENABLED)
42591    int mem_base;
42592    int ret_val;
42593    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42594    int n_writer;
42595    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42596    int n_pe;
42597    xmlChar * name; /* the name of the DTD entity */
42598    int n_name;
42599    xmlChar * content; /* content of the entity */
42600    int n_content;
42601
42602    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42603    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42604    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42605    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42606        mem_base = xmlMemBlocks();
42607        writer = gen_xmlTextWriterPtr(n_writer, 0);
42608        pe = gen_int(n_pe, 1);
42609        name = gen_const_xmlChar_ptr(n_name, 2);
42610        content = gen_const_xmlChar_ptr(n_content, 3);
42611
42612        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
42613        desret_int(ret_val);
42614        call_tests++;
42615        des_xmlTextWriterPtr(n_writer, writer, 0);
42616        des_int(n_pe, pe, 1);
42617        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42618        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
42619        xmlResetLastError();
42620        if (mem_base != xmlMemBlocks()) {
42621            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
42622	           xmlMemBlocks() - mem_base);
42623	    test_ret++;
42624            printf(" %d", n_writer);
42625            printf(" %d", n_pe);
42626            printf(" %d", n_name);
42627            printf(" %d", n_content);
42628            printf("\n");
42629        }
42630    }
42631    }
42632    }
42633    }
42634    function_tests++;
42635#endif
42636
42637    return(test_ret);
42638}
42639
42640
42641static int
42642test_xmlTextWriterWriteDTDNotation(void) {
42643    int test_ret = 0;
42644
42645#if defined(LIBXML_WRITER_ENABLED)
42646    int mem_base;
42647    int ret_val;
42648    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42649    int n_writer;
42650    xmlChar * name; /* the name of the xml notation */
42651    int n_name;
42652    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42653    int n_pubid;
42654    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42655    int n_sysid;
42656
42657    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42658    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42659    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42660    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42661        mem_base = xmlMemBlocks();
42662        writer = gen_xmlTextWriterPtr(n_writer, 0);
42663        name = gen_const_xmlChar_ptr(n_name, 1);
42664        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
42665        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
42666
42667        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
42668        desret_int(ret_val);
42669        call_tests++;
42670        des_xmlTextWriterPtr(n_writer, writer, 0);
42671        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42672        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
42673        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
42674        xmlResetLastError();
42675        if (mem_base != xmlMemBlocks()) {
42676            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
42677	           xmlMemBlocks() - mem_base);
42678	    test_ret++;
42679            printf(" %d", n_writer);
42680            printf(" %d", n_name);
42681            printf(" %d", n_pubid);
42682            printf(" %d", n_sysid);
42683            printf("\n");
42684        }
42685    }
42686    }
42687    }
42688    }
42689    function_tests++;
42690#endif
42691
42692    return(test_ret);
42693}
42694
42695
42696static int
42697test_xmlTextWriterWriteElement(void) {
42698    int test_ret = 0;
42699
42700#if defined(LIBXML_WRITER_ENABLED)
42701    int mem_base;
42702    int ret_val;
42703    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42704    int n_writer;
42705    xmlChar * name; /* element name */
42706    int n_name;
42707    xmlChar * content; /* element content */
42708    int n_content;
42709
42710    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42711    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42712    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42713        mem_base = xmlMemBlocks();
42714        writer = gen_xmlTextWriterPtr(n_writer, 0);
42715        name = gen_const_xmlChar_ptr(n_name, 1);
42716        content = gen_const_xmlChar_ptr(n_content, 2);
42717
42718        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
42719        desret_int(ret_val);
42720        call_tests++;
42721        des_xmlTextWriterPtr(n_writer, writer, 0);
42722        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42723        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42724        xmlResetLastError();
42725        if (mem_base != xmlMemBlocks()) {
42726            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
42727	           xmlMemBlocks() - mem_base);
42728	    test_ret++;
42729            printf(" %d", n_writer);
42730            printf(" %d", n_name);
42731            printf(" %d", n_content);
42732            printf("\n");
42733        }
42734    }
42735    }
42736    }
42737    function_tests++;
42738#endif
42739
42740    return(test_ret);
42741}
42742
42743
42744static int
42745test_xmlTextWriterWriteElementNS(void) {
42746    int test_ret = 0;
42747
42748#if defined(LIBXML_WRITER_ENABLED)
42749    int mem_base;
42750    int ret_val;
42751    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42752    int n_writer;
42753    xmlChar * prefix; /* namespace prefix */
42754    int n_prefix;
42755    xmlChar * name; /* element local name */
42756    int n_name;
42757    xmlChar * namespaceURI; /* namespace URI */
42758    int n_namespaceURI;
42759    xmlChar * content; /* element content */
42760    int n_content;
42761
42762    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42763    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
42764    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42765    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
42766    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42767        mem_base = xmlMemBlocks();
42768        writer = gen_xmlTextWriterPtr(n_writer, 0);
42769        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
42770        name = gen_const_xmlChar_ptr(n_name, 2);
42771        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
42772        content = gen_const_xmlChar_ptr(n_content, 4);
42773
42774        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
42775        desret_int(ret_val);
42776        call_tests++;
42777        des_xmlTextWriterPtr(n_writer, writer, 0);
42778        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
42779        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42780        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
42781        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
42782        xmlResetLastError();
42783        if (mem_base != xmlMemBlocks()) {
42784            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
42785	           xmlMemBlocks() - mem_base);
42786	    test_ret++;
42787            printf(" %d", n_writer);
42788            printf(" %d", n_prefix);
42789            printf(" %d", n_name);
42790            printf(" %d", n_namespaceURI);
42791            printf(" %d", n_content);
42792            printf("\n");
42793        }
42794    }
42795    }
42796    }
42797    }
42798    }
42799    function_tests++;
42800#endif
42801
42802    return(test_ret);
42803}
42804
42805
42806static int
42807test_xmlTextWriterWriteFormatAttribute(void) {
42808    int test_ret = 0;
42809
42810
42811    /* missing type support */
42812    return(test_ret);
42813}
42814
42815
42816static int
42817test_xmlTextWriterWriteFormatAttributeNS(void) {
42818    int test_ret = 0;
42819
42820
42821    /* missing type support */
42822    return(test_ret);
42823}
42824
42825
42826static int
42827test_xmlTextWriterWriteFormatCDATA(void) {
42828    int test_ret = 0;
42829
42830
42831    /* missing type support */
42832    return(test_ret);
42833}
42834
42835
42836static int
42837test_xmlTextWriterWriteFormatComment(void) {
42838    int test_ret = 0;
42839
42840
42841    /* missing type support */
42842    return(test_ret);
42843}
42844
42845
42846static int
42847test_xmlTextWriterWriteFormatDTD(void) {
42848    int test_ret = 0;
42849
42850
42851    /* missing type support */
42852    return(test_ret);
42853}
42854
42855
42856static int
42857test_xmlTextWriterWriteFormatDTDAttlist(void) {
42858    int test_ret = 0;
42859
42860
42861    /* missing type support */
42862    return(test_ret);
42863}
42864
42865
42866static int
42867test_xmlTextWriterWriteFormatDTDElement(void) {
42868    int test_ret = 0;
42869
42870
42871    /* missing type support */
42872    return(test_ret);
42873}
42874
42875
42876static int
42877test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
42878    int test_ret = 0;
42879
42880
42881    /* missing type support */
42882    return(test_ret);
42883}
42884
42885
42886static int
42887test_xmlTextWriterWriteFormatElement(void) {
42888    int test_ret = 0;
42889
42890
42891    /* missing type support */
42892    return(test_ret);
42893}
42894
42895
42896static int
42897test_xmlTextWriterWriteFormatElementNS(void) {
42898    int test_ret = 0;
42899
42900
42901    /* missing type support */
42902    return(test_ret);
42903}
42904
42905
42906static int
42907test_xmlTextWriterWriteFormatPI(void) {
42908    int test_ret = 0;
42909
42910
42911    /* missing type support */
42912    return(test_ret);
42913}
42914
42915
42916static int
42917test_xmlTextWriterWriteFormatRaw(void) {
42918    int test_ret = 0;
42919
42920
42921    /* missing type support */
42922    return(test_ret);
42923}
42924
42925
42926static int
42927test_xmlTextWriterWriteFormatString(void) {
42928    int test_ret = 0;
42929
42930
42931    /* missing type support */
42932    return(test_ret);
42933}
42934
42935
42936static int
42937test_xmlTextWriterWritePI(void) {
42938    int test_ret = 0;
42939
42940#if defined(LIBXML_WRITER_ENABLED)
42941    int mem_base;
42942    int ret_val;
42943    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42944    int n_writer;
42945    xmlChar * target; /* PI target */
42946    int n_target;
42947    xmlChar * content; /* PI content */
42948    int n_content;
42949
42950    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42951    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
42952    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42953        mem_base = xmlMemBlocks();
42954        writer = gen_xmlTextWriterPtr(n_writer, 0);
42955        target = gen_const_xmlChar_ptr(n_target, 1);
42956        content = gen_const_xmlChar_ptr(n_content, 2);
42957
42958        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
42959        desret_int(ret_val);
42960        call_tests++;
42961        des_xmlTextWriterPtr(n_writer, writer, 0);
42962        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
42963        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42964        xmlResetLastError();
42965        if (mem_base != xmlMemBlocks()) {
42966            printf("Leak of %d blocks found in xmlTextWriterWritePI",
42967	           xmlMemBlocks() - mem_base);
42968	    test_ret++;
42969            printf(" %d", n_writer);
42970            printf(" %d", n_target);
42971            printf(" %d", n_content);
42972            printf("\n");
42973        }
42974    }
42975    }
42976    }
42977    function_tests++;
42978#endif
42979
42980    return(test_ret);
42981}
42982
42983
42984static int
42985test_xmlTextWriterWriteRaw(void) {
42986    int test_ret = 0;
42987
42988#if defined(LIBXML_WRITER_ENABLED)
42989    int mem_base;
42990    int ret_val;
42991    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42992    int n_writer;
42993    xmlChar * content; /* text string */
42994    int n_content;
42995
42996    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42997    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42998        mem_base = xmlMemBlocks();
42999        writer = gen_xmlTextWriterPtr(n_writer, 0);
43000        content = gen_const_xmlChar_ptr(n_content, 1);
43001
43002        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
43003        desret_int(ret_val);
43004        call_tests++;
43005        des_xmlTextWriterPtr(n_writer, writer, 0);
43006        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43007        xmlResetLastError();
43008        if (mem_base != xmlMemBlocks()) {
43009            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
43010	           xmlMemBlocks() - mem_base);
43011	    test_ret++;
43012            printf(" %d", n_writer);
43013            printf(" %d", n_content);
43014            printf("\n");
43015        }
43016    }
43017    }
43018    function_tests++;
43019#endif
43020
43021    return(test_ret);
43022}
43023
43024
43025static int
43026test_xmlTextWriterWriteRawLen(void) {
43027    int test_ret = 0;
43028
43029#if defined(LIBXML_WRITER_ENABLED)
43030    int mem_base;
43031    int ret_val;
43032    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43033    int n_writer;
43034    xmlChar * content; /* text string */
43035    int n_content;
43036    int len; /* length of the text string */
43037    int n_len;
43038
43039    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43040    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43041    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43042        mem_base = xmlMemBlocks();
43043        writer = gen_xmlTextWriterPtr(n_writer, 0);
43044        content = gen_const_xmlChar_ptr(n_content, 1);
43045        len = gen_int(n_len, 2);
43046
43047        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
43048        desret_int(ret_val);
43049        call_tests++;
43050        des_xmlTextWriterPtr(n_writer, writer, 0);
43051        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43052        des_int(n_len, len, 2);
43053        xmlResetLastError();
43054        if (mem_base != xmlMemBlocks()) {
43055            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
43056	           xmlMemBlocks() - mem_base);
43057	    test_ret++;
43058            printf(" %d", n_writer);
43059            printf(" %d", n_content);
43060            printf(" %d", n_len);
43061            printf("\n");
43062        }
43063    }
43064    }
43065    }
43066    function_tests++;
43067#endif
43068
43069    return(test_ret);
43070}
43071
43072
43073static int
43074test_xmlTextWriterWriteString(void) {
43075    int test_ret = 0;
43076
43077#if defined(LIBXML_WRITER_ENABLED)
43078    int mem_base;
43079    int ret_val;
43080    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43081    int n_writer;
43082    xmlChar * content; /* text string */
43083    int n_content;
43084
43085    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43086    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43087        mem_base = xmlMemBlocks();
43088        writer = gen_xmlTextWriterPtr(n_writer, 0);
43089        content = gen_const_xmlChar_ptr(n_content, 1);
43090
43091        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
43092        desret_int(ret_val);
43093        call_tests++;
43094        des_xmlTextWriterPtr(n_writer, writer, 0);
43095        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43096        xmlResetLastError();
43097        if (mem_base != xmlMemBlocks()) {
43098            printf("Leak of %d blocks found in xmlTextWriterWriteString",
43099	           xmlMemBlocks() - mem_base);
43100	    test_ret++;
43101            printf(" %d", n_writer);
43102            printf(" %d", n_content);
43103            printf("\n");
43104        }
43105    }
43106    }
43107    function_tests++;
43108#endif
43109
43110    return(test_ret);
43111}
43112
43113
43114static int
43115test_xmlTextWriterWriteVFormatAttribute(void) {
43116    int test_ret = 0;
43117
43118
43119    /* missing type support */
43120    return(test_ret);
43121}
43122
43123
43124static int
43125test_xmlTextWriterWriteVFormatAttributeNS(void) {
43126    int test_ret = 0;
43127
43128
43129    /* missing type support */
43130    return(test_ret);
43131}
43132
43133
43134static int
43135test_xmlTextWriterWriteVFormatCDATA(void) {
43136    int test_ret = 0;
43137
43138
43139    /* missing type support */
43140    return(test_ret);
43141}
43142
43143
43144static int
43145test_xmlTextWriterWriteVFormatComment(void) {
43146    int test_ret = 0;
43147
43148
43149    /* missing type support */
43150    return(test_ret);
43151}
43152
43153
43154static int
43155test_xmlTextWriterWriteVFormatDTD(void) {
43156    int test_ret = 0;
43157
43158
43159    /* missing type support */
43160    return(test_ret);
43161}
43162
43163
43164static int
43165test_xmlTextWriterWriteVFormatDTDAttlist(void) {
43166    int test_ret = 0;
43167
43168
43169    /* missing type support */
43170    return(test_ret);
43171}
43172
43173
43174static int
43175test_xmlTextWriterWriteVFormatDTDElement(void) {
43176    int test_ret = 0;
43177
43178
43179    /* missing type support */
43180    return(test_ret);
43181}
43182
43183
43184static int
43185test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
43186    int test_ret = 0;
43187
43188
43189    /* missing type support */
43190    return(test_ret);
43191}
43192
43193
43194static int
43195test_xmlTextWriterWriteVFormatElement(void) {
43196    int test_ret = 0;
43197
43198
43199    /* missing type support */
43200    return(test_ret);
43201}
43202
43203
43204static int
43205test_xmlTextWriterWriteVFormatElementNS(void) {
43206    int test_ret = 0;
43207
43208
43209    /* missing type support */
43210    return(test_ret);
43211}
43212
43213
43214static int
43215test_xmlTextWriterWriteVFormatPI(void) {
43216    int test_ret = 0;
43217
43218
43219    /* missing type support */
43220    return(test_ret);
43221}
43222
43223
43224static int
43225test_xmlTextWriterWriteVFormatRaw(void) {
43226    int test_ret = 0;
43227
43228
43229    /* missing type support */
43230    return(test_ret);
43231}
43232
43233
43234static int
43235test_xmlTextWriterWriteVFormatString(void) {
43236    int test_ret = 0;
43237
43238
43239    /* missing type support */
43240    return(test_ret);
43241}
43242
43243static int
43244test_xmlwriter(void) {
43245    int test_ret = 0;
43246
43247    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
43248    test_ret += test_xmlNewTextWriter();
43249    test_ret += test_xmlNewTextWriterFilename();
43250    test_ret += test_xmlNewTextWriterMemory();
43251    test_ret += test_xmlNewTextWriterPushParser();
43252    test_ret += test_xmlNewTextWriterTree();
43253    test_ret += test_xmlTextWriterEndAttribute();
43254    test_ret += test_xmlTextWriterEndCDATA();
43255    test_ret += test_xmlTextWriterEndComment();
43256    test_ret += test_xmlTextWriterEndDTD();
43257    test_ret += test_xmlTextWriterEndDTDAttlist();
43258    test_ret += test_xmlTextWriterEndDTDElement();
43259    test_ret += test_xmlTextWriterEndDTDEntity();
43260    test_ret += test_xmlTextWriterEndDocument();
43261    test_ret += test_xmlTextWriterEndElement();
43262    test_ret += test_xmlTextWriterEndPI();
43263    test_ret += test_xmlTextWriterFlush();
43264    test_ret += test_xmlTextWriterFullEndElement();
43265    test_ret += test_xmlTextWriterSetIndent();
43266    test_ret += test_xmlTextWriterSetIndentString();
43267    test_ret += test_xmlTextWriterStartAttribute();
43268    test_ret += test_xmlTextWriterStartAttributeNS();
43269    test_ret += test_xmlTextWriterStartCDATA();
43270    test_ret += test_xmlTextWriterStartComment();
43271    test_ret += test_xmlTextWriterStartDTD();
43272    test_ret += test_xmlTextWriterStartDTDAttlist();
43273    test_ret += test_xmlTextWriterStartDTDElement();
43274    test_ret += test_xmlTextWriterStartDTDEntity();
43275    test_ret += test_xmlTextWriterStartDocument();
43276    test_ret += test_xmlTextWriterStartElement();
43277    test_ret += test_xmlTextWriterStartElementNS();
43278    test_ret += test_xmlTextWriterStartPI();
43279    test_ret += test_xmlTextWriterWriteAttribute();
43280    test_ret += test_xmlTextWriterWriteAttributeNS();
43281    test_ret += test_xmlTextWriterWriteBase64();
43282    test_ret += test_xmlTextWriterWriteBinHex();
43283    test_ret += test_xmlTextWriterWriteCDATA();
43284    test_ret += test_xmlTextWriterWriteComment();
43285    test_ret += test_xmlTextWriterWriteDTD();
43286    test_ret += test_xmlTextWriterWriteDTDAttlist();
43287    test_ret += test_xmlTextWriterWriteDTDElement();
43288    test_ret += test_xmlTextWriterWriteDTDEntity();
43289    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
43290    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
43291    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
43292    test_ret += test_xmlTextWriterWriteDTDNotation();
43293    test_ret += test_xmlTextWriterWriteElement();
43294    test_ret += test_xmlTextWriterWriteElementNS();
43295    test_ret += test_xmlTextWriterWriteFormatAttribute();
43296    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
43297    test_ret += test_xmlTextWriterWriteFormatCDATA();
43298    test_ret += test_xmlTextWriterWriteFormatComment();
43299    test_ret += test_xmlTextWriterWriteFormatDTD();
43300    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
43301    test_ret += test_xmlTextWriterWriteFormatDTDElement();
43302    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
43303    test_ret += test_xmlTextWriterWriteFormatElement();
43304    test_ret += test_xmlTextWriterWriteFormatElementNS();
43305    test_ret += test_xmlTextWriterWriteFormatPI();
43306    test_ret += test_xmlTextWriterWriteFormatRaw();
43307    test_ret += test_xmlTextWriterWriteFormatString();
43308    test_ret += test_xmlTextWriterWritePI();
43309    test_ret += test_xmlTextWriterWriteRaw();
43310    test_ret += test_xmlTextWriterWriteRawLen();
43311    test_ret += test_xmlTextWriterWriteString();
43312    test_ret += test_xmlTextWriterWriteVFormatAttribute();
43313    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
43314    test_ret += test_xmlTextWriterWriteVFormatCDATA();
43315    test_ret += test_xmlTextWriterWriteVFormatComment();
43316    test_ret += test_xmlTextWriterWriteVFormatDTD();
43317    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
43318    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
43319    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
43320    test_ret += test_xmlTextWriterWriteVFormatElement();
43321    test_ret += test_xmlTextWriterWriteVFormatElementNS();
43322    test_ret += test_xmlTextWriterWriteVFormatPI();
43323    test_ret += test_xmlTextWriterWriteVFormatRaw();
43324    test_ret += test_xmlTextWriterWriteVFormatString();
43325
43326    if (test_ret != 0)
43327	printf("Module xmlwriter: %d errors\n", test_ret);
43328    return(test_ret);
43329}
43330
43331static int
43332test_xmlXPathCastBooleanToNumber(void) {
43333    int test_ret = 0;
43334
43335#if defined(LIBXML_XPATH_ENABLED)
43336    int mem_base;
43337    double ret_val;
43338    int val; /* a boolean */
43339    int n_val;
43340
43341    for (n_val = 0;n_val < gen_nb_int;n_val++) {
43342        mem_base = xmlMemBlocks();
43343        val = gen_int(n_val, 0);
43344
43345        ret_val = xmlXPathCastBooleanToNumber(val);
43346        desret_double(ret_val);
43347        call_tests++;
43348        des_int(n_val, val, 0);
43349        xmlResetLastError();
43350        if (mem_base != xmlMemBlocks()) {
43351            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
43352	           xmlMemBlocks() - mem_base);
43353	    test_ret++;
43354            printf(" %d", n_val);
43355            printf("\n");
43356        }
43357    }
43358    function_tests++;
43359#endif
43360
43361    return(test_ret);
43362}
43363
43364
43365static int
43366test_xmlXPathCastBooleanToString(void) {
43367    int test_ret = 0;
43368
43369#if defined(LIBXML_XPATH_ENABLED)
43370    int mem_base;
43371    xmlChar * ret_val;
43372    int val; /* a boolean */
43373    int n_val;
43374
43375    for (n_val = 0;n_val < gen_nb_int;n_val++) {
43376        mem_base = xmlMemBlocks();
43377        val = gen_int(n_val, 0);
43378
43379        ret_val = xmlXPathCastBooleanToString(val);
43380        desret_xmlChar_ptr(ret_val);
43381        call_tests++;
43382        des_int(n_val, val, 0);
43383        xmlResetLastError();
43384        if (mem_base != xmlMemBlocks()) {
43385            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
43386	           xmlMemBlocks() - mem_base);
43387	    test_ret++;
43388            printf(" %d", n_val);
43389            printf("\n");
43390        }
43391    }
43392    function_tests++;
43393#endif
43394
43395    return(test_ret);
43396}
43397
43398
43399static int
43400test_xmlXPathCastNodeSetToBoolean(void) {
43401    int test_ret = 0;
43402
43403#if defined(LIBXML_XPATH_ENABLED)
43404    int mem_base;
43405    int ret_val;
43406    xmlNodeSetPtr ns; /* a node-set */
43407    int n_ns;
43408
43409    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
43410        mem_base = xmlMemBlocks();
43411        ns = gen_xmlNodeSetPtr(n_ns, 0);
43412
43413        ret_val = xmlXPathCastNodeSetToBoolean(ns);
43414        desret_int(ret_val);
43415        call_tests++;
43416        des_xmlNodeSetPtr(n_ns, ns, 0);
43417        xmlResetLastError();
43418        if (mem_base != xmlMemBlocks()) {
43419            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
43420	           xmlMemBlocks() - mem_base);
43421	    test_ret++;
43422            printf(" %d", n_ns);
43423            printf("\n");
43424        }
43425    }
43426    function_tests++;
43427#endif
43428
43429    return(test_ret);
43430}
43431
43432
43433static int
43434test_xmlXPathCastNodeSetToNumber(void) {
43435    int test_ret = 0;
43436
43437#if defined(LIBXML_XPATH_ENABLED)
43438    int mem_base;
43439    double ret_val;
43440    xmlNodeSetPtr ns; /* a node-set */
43441    int n_ns;
43442
43443    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
43444        mem_base = xmlMemBlocks();
43445        ns = gen_xmlNodeSetPtr(n_ns, 0);
43446
43447        ret_val = xmlXPathCastNodeSetToNumber(ns);
43448        desret_double(ret_val);
43449        call_tests++;
43450        des_xmlNodeSetPtr(n_ns, ns, 0);
43451        xmlResetLastError();
43452        if (mem_base != xmlMemBlocks()) {
43453            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
43454	           xmlMemBlocks() - mem_base);
43455	    test_ret++;
43456            printf(" %d", n_ns);
43457            printf("\n");
43458        }
43459    }
43460    function_tests++;
43461#endif
43462
43463    return(test_ret);
43464}
43465
43466
43467static int
43468test_xmlXPathCastNodeSetToString(void) {
43469    int test_ret = 0;
43470
43471#if defined(LIBXML_XPATH_ENABLED)
43472    int mem_base;
43473    xmlChar * ret_val;
43474    xmlNodeSetPtr ns; /* a node-set */
43475    int n_ns;
43476
43477    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
43478        mem_base = xmlMemBlocks();
43479        ns = gen_xmlNodeSetPtr(n_ns, 0);
43480
43481        ret_val = xmlXPathCastNodeSetToString(ns);
43482        desret_xmlChar_ptr(ret_val);
43483        call_tests++;
43484        des_xmlNodeSetPtr(n_ns, ns, 0);
43485        xmlResetLastError();
43486        if (mem_base != xmlMemBlocks()) {
43487            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
43488	           xmlMemBlocks() - mem_base);
43489	    test_ret++;
43490            printf(" %d", n_ns);
43491            printf("\n");
43492        }
43493    }
43494    function_tests++;
43495#endif
43496
43497    return(test_ret);
43498}
43499
43500
43501static int
43502test_xmlXPathCastNodeToNumber(void) {
43503    int test_ret = 0;
43504
43505#if defined(LIBXML_XPATH_ENABLED)
43506    int mem_base;
43507    double ret_val;
43508    xmlNodePtr node; /* a node */
43509    int n_node;
43510
43511    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43512        mem_base = xmlMemBlocks();
43513        node = gen_xmlNodePtr(n_node, 0);
43514
43515        ret_val = xmlXPathCastNodeToNumber(node);
43516        desret_double(ret_val);
43517        call_tests++;
43518        des_xmlNodePtr(n_node, node, 0);
43519        xmlResetLastError();
43520        if (mem_base != xmlMemBlocks()) {
43521            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
43522	           xmlMemBlocks() - mem_base);
43523	    test_ret++;
43524            printf(" %d", n_node);
43525            printf("\n");
43526        }
43527    }
43528    function_tests++;
43529#endif
43530
43531    return(test_ret);
43532}
43533
43534
43535static int
43536test_xmlXPathCastNodeToString(void) {
43537    int test_ret = 0;
43538
43539#if defined(LIBXML_XPATH_ENABLED)
43540    int mem_base;
43541    xmlChar * ret_val;
43542    xmlNodePtr node; /* a node */
43543    int n_node;
43544
43545    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43546        mem_base = xmlMemBlocks();
43547        node = gen_xmlNodePtr(n_node, 0);
43548
43549        ret_val = xmlXPathCastNodeToString(node);
43550        desret_xmlChar_ptr(ret_val);
43551        call_tests++;
43552        des_xmlNodePtr(n_node, node, 0);
43553        xmlResetLastError();
43554        if (mem_base != xmlMemBlocks()) {
43555            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
43556	           xmlMemBlocks() - mem_base);
43557	    test_ret++;
43558            printf(" %d", n_node);
43559            printf("\n");
43560        }
43561    }
43562    function_tests++;
43563#endif
43564
43565    return(test_ret);
43566}
43567
43568
43569static int
43570test_xmlXPathCastNumberToBoolean(void) {
43571    int test_ret = 0;
43572
43573#if defined(LIBXML_XPATH_ENABLED)
43574    int mem_base;
43575    int ret_val;
43576    double val; /* a number */
43577    int n_val;
43578
43579    for (n_val = 0;n_val < gen_nb_double;n_val++) {
43580        mem_base = xmlMemBlocks();
43581        val = gen_double(n_val, 0);
43582
43583        ret_val = xmlXPathCastNumberToBoolean(val);
43584        desret_int(ret_val);
43585        call_tests++;
43586        des_double(n_val, val, 0);
43587        xmlResetLastError();
43588        if (mem_base != xmlMemBlocks()) {
43589            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
43590	           xmlMemBlocks() - mem_base);
43591	    test_ret++;
43592            printf(" %d", n_val);
43593            printf("\n");
43594        }
43595    }
43596    function_tests++;
43597#endif
43598
43599    return(test_ret);
43600}
43601
43602
43603static int
43604test_xmlXPathCastNumberToString(void) {
43605    int test_ret = 0;
43606
43607#if defined(LIBXML_XPATH_ENABLED)
43608    int mem_base;
43609    xmlChar * ret_val;
43610    double val; /* a number */
43611    int n_val;
43612
43613    for (n_val = 0;n_val < gen_nb_double;n_val++) {
43614        mem_base = xmlMemBlocks();
43615        val = gen_double(n_val, 0);
43616
43617        ret_val = xmlXPathCastNumberToString(val);
43618        desret_xmlChar_ptr(ret_val);
43619        call_tests++;
43620        des_double(n_val, val, 0);
43621        xmlResetLastError();
43622        if (mem_base != xmlMemBlocks()) {
43623            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
43624	           xmlMemBlocks() - mem_base);
43625	    test_ret++;
43626            printf(" %d", n_val);
43627            printf("\n");
43628        }
43629    }
43630    function_tests++;
43631#endif
43632
43633    return(test_ret);
43634}
43635
43636
43637static int
43638test_xmlXPathCastStringToBoolean(void) {
43639    int test_ret = 0;
43640
43641#if defined(LIBXML_XPATH_ENABLED)
43642    int mem_base;
43643    int ret_val;
43644    xmlChar * val; /* a string */
43645    int n_val;
43646
43647    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
43648        mem_base = xmlMemBlocks();
43649        val = gen_const_xmlChar_ptr(n_val, 0);
43650
43651        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
43652        desret_int(ret_val);
43653        call_tests++;
43654        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
43655        xmlResetLastError();
43656        if (mem_base != xmlMemBlocks()) {
43657            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
43658	           xmlMemBlocks() - mem_base);
43659	    test_ret++;
43660            printf(" %d", n_val);
43661            printf("\n");
43662        }
43663    }
43664    function_tests++;
43665#endif
43666
43667    return(test_ret);
43668}
43669
43670
43671static int
43672test_xmlXPathCastStringToNumber(void) {
43673    int test_ret = 0;
43674
43675#if defined(LIBXML_XPATH_ENABLED)
43676    int mem_base;
43677    double ret_val;
43678    xmlChar * val; /* a string */
43679    int n_val;
43680
43681    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
43682        mem_base = xmlMemBlocks();
43683        val = gen_const_xmlChar_ptr(n_val, 0);
43684
43685        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
43686        desret_double(ret_val);
43687        call_tests++;
43688        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
43689        xmlResetLastError();
43690        if (mem_base != xmlMemBlocks()) {
43691            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
43692	           xmlMemBlocks() - mem_base);
43693	    test_ret++;
43694            printf(" %d", n_val);
43695            printf("\n");
43696        }
43697    }
43698    function_tests++;
43699#endif
43700
43701    return(test_ret);
43702}
43703
43704
43705static int
43706test_xmlXPathCastToBoolean(void) {
43707    int test_ret = 0;
43708
43709#if defined(LIBXML_XPATH_ENABLED)
43710    int mem_base;
43711    int ret_val;
43712    xmlXPathObjectPtr val; /* an XPath object */
43713    int n_val;
43714
43715    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43716        mem_base = xmlMemBlocks();
43717        val = gen_xmlXPathObjectPtr(n_val, 0);
43718
43719        ret_val = xmlXPathCastToBoolean(val);
43720        desret_int(ret_val);
43721        call_tests++;
43722        des_xmlXPathObjectPtr(n_val, val, 0);
43723        xmlResetLastError();
43724        if (mem_base != xmlMemBlocks()) {
43725            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
43726	           xmlMemBlocks() - mem_base);
43727	    test_ret++;
43728            printf(" %d", n_val);
43729            printf("\n");
43730        }
43731    }
43732    function_tests++;
43733#endif
43734
43735    return(test_ret);
43736}
43737
43738
43739static int
43740test_xmlXPathCastToNumber(void) {
43741    int test_ret = 0;
43742
43743#if defined(LIBXML_XPATH_ENABLED)
43744    int mem_base;
43745    double ret_val;
43746    xmlXPathObjectPtr val; /* an XPath object */
43747    int n_val;
43748
43749    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43750        mem_base = xmlMemBlocks();
43751        val = gen_xmlXPathObjectPtr(n_val, 0);
43752
43753        ret_val = xmlXPathCastToNumber(val);
43754        desret_double(ret_val);
43755        call_tests++;
43756        des_xmlXPathObjectPtr(n_val, val, 0);
43757        xmlResetLastError();
43758        if (mem_base != xmlMemBlocks()) {
43759            printf("Leak of %d blocks found in xmlXPathCastToNumber",
43760	           xmlMemBlocks() - mem_base);
43761	    test_ret++;
43762            printf(" %d", n_val);
43763            printf("\n");
43764        }
43765    }
43766    function_tests++;
43767#endif
43768
43769    return(test_ret);
43770}
43771
43772
43773static int
43774test_xmlXPathCastToString(void) {
43775    int test_ret = 0;
43776
43777#if defined(LIBXML_XPATH_ENABLED)
43778    int mem_base;
43779    xmlChar * ret_val;
43780    xmlXPathObjectPtr val; /* an XPath object */
43781    int n_val;
43782
43783    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43784        mem_base = xmlMemBlocks();
43785        val = gen_xmlXPathObjectPtr(n_val, 0);
43786
43787        ret_val = xmlXPathCastToString(val);
43788        desret_xmlChar_ptr(ret_val);
43789        call_tests++;
43790        des_xmlXPathObjectPtr(n_val, val, 0);
43791        xmlResetLastError();
43792        if (mem_base != xmlMemBlocks()) {
43793            printf("Leak of %d blocks found in xmlXPathCastToString",
43794	           xmlMemBlocks() - mem_base);
43795	    test_ret++;
43796            printf(" %d", n_val);
43797            printf("\n");
43798        }
43799    }
43800    function_tests++;
43801#endif
43802
43803    return(test_ret);
43804}
43805
43806
43807static int
43808test_xmlXPathCmpNodes(void) {
43809    int test_ret = 0;
43810
43811#if defined(LIBXML_XPATH_ENABLED)
43812    int mem_base;
43813    int ret_val;
43814    xmlNodePtr node1; /* the first node */
43815    int n_node1;
43816    xmlNodePtr node2; /* the second node */
43817    int n_node2;
43818
43819    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
43820    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
43821        mem_base = xmlMemBlocks();
43822        node1 = gen_xmlNodePtr(n_node1, 0);
43823        node2 = gen_xmlNodePtr(n_node2, 1);
43824
43825        ret_val = xmlXPathCmpNodes(node1, node2);
43826        desret_int(ret_val);
43827        call_tests++;
43828        des_xmlNodePtr(n_node1, node1, 0);
43829        des_xmlNodePtr(n_node2, node2, 1);
43830        xmlResetLastError();
43831        if (mem_base != xmlMemBlocks()) {
43832            printf("Leak of %d blocks found in xmlXPathCmpNodes",
43833	           xmlMemBlocks() - mem_base);
43834	    test_ret++;
43835            printf(" %d", n_node1);
43836            printf(" %d", n_node2);
43837            printf("\n");
43838        }
43839    }
43840    }
43841    function_tests++;
43842#endif
43843
43844    return(test_ret);
43845}
43846
43847
43848static int
43849test_xmlXPathCompile(void) {
43850    int test_ret = 0;
43851
43852
43853    /* missing type support */
43854    return(test_ret);
43855}
43856
43857#ifdef LIBXML_XPATH_ENABLED
43858
43859#define gen_nb_xmlXPathCompExprPtr 1
43860static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43861    return(NULL);
43862}
43863static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43864}
43865#endif
43866
43867#ifdef LIBXML_XPATH_ENABLED
43868
43869#define gen_nb_xmlXPathContextPtr 1
43870static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43871    return(NULL);
43872}
43873static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43874}
43875#endif
43876
43877
43878static int
43879test_xmlXPathCompiledEval(void) {
43880    int test_ret = 0;
43881
43882#if defined(LIBXML_XPATH_ENABLED)
43883    int mem_base;
43884    xmlXPathObjectPtr ret_val;
43885    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
43886    int n_comp;
43887    xmlXPathContextPtr ctx; /* the XPath context */
43888    int n_ctx;
43889
43890    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
43891    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
43892        mem_base = xmlMemBlocks();
43893        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
43894        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
43895
43896        ret_val = xmlXPathCompiledEval(comp, ctx);
43897        desret_xmlXPathObjectPtr(ret_val);
43898        call_tests++;
43899        des_xmlXPathCompExprPtr(n_comp, comp, 0);
43900        des_xmlXPathContextPtr(n_ctx, ctx, 1);
43901        xmlResetLastError();
43902        if (mem_base != xmlMemBlocks()) {
43903            printf("Leak of %d blocks found in xmlXPathCompiledEval",
43904	           xmlMemBlocks() - mem_base);
43905	    test_ret++;
43906            printf(" %d", n_comp);
43907            printf(" %d", n_ctx);
43908            printf("\n");
43909        }
43910    }
43911    }
43912    function_tests++;
43913#endif
43914
43915    return(test_ret);
43916}
43917
43918
43919static int
43920test_xmlXPathConvertBoolean(void) {
43921    int test_ret = 0;
43922
43923#if defined(LIBXML_XPATH_ENABLED)
43924    int mem_base;
43925    xmlXPathObjectPtr ret_val;
43926    xmlXPathObjectPtr val; /* an XPath object */
43927    int n_val;
43928
43929    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43930        mem_base = xmlMemBlocks();
43931        val = gen_xmlXPathObjectPtr(n_val, 0);
43932
43933        ret_val = xmlXPathConvertBoolean(val);
43934        val = NULL;
43935        desret_xmlXPathObjectPtr(ret_val);
43936        call_tests++;
43937        des_xmlXPathObjectPtr(n_val, val, 0);
43938        xmlResetLastError();
43939        if (mem_base != xmlMemBlocks()) {
43940            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
43941	           xmlMemBlocks() - mem_base);
43942	    test_ret++;
43943            printf(" %d", n_val);
43944            printf("\n");
43945        }
43946    }
43947    function_tests++;
43948#endif
43949
43950    return(test_ret);
43951}
43952
43953
43954static int
43955test_xmlXPathConvertNumber(void) {
43956    int test_ret = 0;
43957
43958#if defined(LIBXML_XPATH_ENABLED)
43959    int mem_base;
43960    xmlXPathObjectPtr ret_val;
43961    xmlXPathObjectPtr val; /* an XPath object */
43962    int n_val;
43963
43964    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43965        mem_base = xmlMemBlocks();
43966        val = gen_xmlXPathObjectPtr(n_val, 0);
43967
43968        ret_val = xmlXPathConvertNumber(val);
43969        val = NULL;
43970        desret_xmlXPathObjectPtr(ret_val);
43971        call_tests++;
43972        des_xmlXPathObjectPtr(n_val, val, 0);
43973        xmlResetLastError();
43974        if (mem_base != xmlMemBlocks()) {
43975            printf("Leak of %d blocks found in xmlXPathConvertNumber",
43976	           xmlMemBlocks() - mem_base);
43977	    test_ret++;
43978            printf(" %d", n_val);
43979            printf("\n");
43980        }
43981    }
43982    function_tests++;
43983#endif
43984
43985    return(test_ret);
43986}
43987
43988
43989static int
43990test_xmlXPathConvertString(void) {
43991    int test_ret = 0;
43992
43993#if defined(LIBXML_XPATH_ENABLED)
43994    int mem_base;
43995    xmlXPathObjectPtr ret_val;
43996    xmlXPathObjectPtr val; /* an XPath object */
43997    int n_val;
43998
43999    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
44000        mem_base = xmlMemBlocks();
44001        val = gen_xmlXPathObjectPtr(n_val, 0);
44002
44003        ret_val = xmlXPathConvertString(val);
44004        val = NULL;
44005        desret_xmlXPathObjectPtr(ret_val);
44006        call_tests++;
44007        des_xmlXPathObjectPtr(n_val, val, 0);
44008        xmlResetLastError();
44009        if (mem_base != xmlMemBlocks()) {
44010            printf("Leak of %d blocks found in xmlXPathConvertString",
44011	           xmlMemBlocks() - mem_base);
44012	    test_ret++;
44013            printf(" %d", n_val);
44014            printf("\n");
44015        }
44016    }
44017    function_tests++;
44018#endif
44019
44020    return(test_ret);
44021}
44022
44023
44024static int
44025test_xmlXPathCtxtCompile(void) {
44026    int test_ret = 0;
44027
44028
44029    /* missing type support */
44030    return(test_ret);
44031}
44032
44033
44034static int
44035test_xmlXPathEval(void) {
44036    int test_ret = 0;
44037
44038#if defined(LIBXML_XPATH_ENABLED)
44039    int mem_base;
44040    xmlXPathObjectPtr ret_val;
44041    xmlChar * str; /* the XPath expression */
44042    int n_str;
44043    xmlXPathContextPtr ctx; /* the XPath context */
44044    int n_ctx;
44045
44046    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
44047    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
44048        mem_base = xmlMemBlocks();
44049        str = gen_const_xmlChar_ptr(n_str, 0);
44050        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
44051
44052        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
44053        desret_xmlXPathObjectPtr(ret_val);
44054        call_tests++;
44055        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
44056        des_xmlXPathContextPtr(n_ctx, ctx, 1);
44057        xmlResetLastError();
44058        if (mem_base != xmlMemBlocks()) {
44059            printf("Leak of %d blocks found in xmlXPathEval",
44060	           xmlMemBlocks() - mem_base);
44061	    test_ret++;
44062            printf(" %d", n_str);
44063            printf(" %d", n_ctx);
44064            printf("\n");
44065        }
44066    }
44067    }
44068    function_tests++;
44069#endif
44070
44071    return(test_ret);
44072}
44073
44074
44075static int
44076test_xmlXPathEvalExpression(void) {
44077    int test_ret = 0;
44078
44079#if defined(LIBXML_XPATH_ENABLED)
44080    int mem_base;
44081    xmlXPathObjectPtr ret_val;
44082    xmlChar * str; /* the XPath expression */
44083    int n_str;
44084    xmlXPathContextPtr ctxt; /* the XPath context */
44085    int n_ctxt;
44086
44087    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
44088    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
44089        mem_base = xmlMemBlocks();
44090        str = gen_const_xmlChar_ptr(n_str, 0);
44091        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
44092
44093        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
44094        desret_xmlXPathObjectPtr(ret_val);
44095        call_tests++;
44096        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
44097        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
44098        xmlResetLastError();
44099        if (mem_base != xmlMemBlocks()) {
44100            printf("Leak of %d blocks found in xmlXPathEvalExpression",
44101	           xmlMemBlocks() - mem_base);
44102	    test_ret++;
44103            printf(" %d", n_str);
44104            printf(" %d", n_ctxt);
44105            printf("\n");
44106        }
44107    }
44108    }
44109    function_tests++;
44110#endif
44111
44112    return(test_ret);
44113}
44114
44115
44116static int
44117test_xmlXPathEvalPredicate(void) {
44118    int test_ret = 0;
44119
44120#if defined(LIBXML_XPATH_ENABLED)
44121    int mem_base;
44122    int ret_val;
44123    xmlXPathContextPtr ctxt; /* the XPath context */
44124    int n_ctxt;
44125    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
44126    int n_res;
44127
44128    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
44129    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
44130        mem_base = xmlMemBlocks();
44131        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
44132        res = gen_xmlXPathObjectPtr(n_res, 1);
44133
44134        ret_val = xmlXPathEvalPredicate(ctxt, res);
44135        desret_int(ret_val);
44136        call_tests++;
44137        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
44138        des_xmlXPathObjectPtr(n_res, res, 1);
44139        xmlResetLastError();
44140        if (mem_base != xmlMemBlocks()) {
44141            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
44142	           xmlMemBlocks() - mem_base);
44143	    test_ret++;
44144            printf(" %d", n_ctxt);
44145            printf(" %d", n_res);
44146            printf("\n");
44147        }
44148    }
44149    }
44150    function_tests++;
44151#endif
44152
44153    return(test_ret);
44154}
44155
44156
44157static int
44158test_xmlXPathInit(void) {
44159    int test_ret = 0;
44160
44161#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
44162    int mem_base;
44163
44164        mem_base = xmlMemBlocks();
44165
44166        xmlXPathInit();
44167        call_tests++;
44168        xmlResetLastError();
44169        if (mem_base != xmlMemBlocks()) {
44170            printf("Leak of %d blocks found in xmlXPathInit",
44171	           xmlMemBlocks() - mem_base);
44172	    test_ret++;
44173            printf("\n");
44174        }
44175    function_tests++;
44176#endif
44177
44178    return(test_ret);
44179}
44180
44181
44182static int
44183test_xmlXPathIsInf(void) {
44184    int test_ret = 0;
44185
44186#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
44187    int mem_base;
44188    int ret_val;
44189    double val; /* a double value */
44190    int n_val;
44191
44192    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44193        mem_base = xmlMemBlocks();
44194        val = gen_double(n_val, 0);
44195
44196        ret_val = xmlXPathIsInf(val);
44197        desret_int(ret_val);
44198        call_tests++;
44199        des_double(n_val, val, 0);
44200        xmlResetLastError();
44201        if (mem_base != xmlMemBlocks()) {
44202            printf("Leak of %d blocks found in xmlXPathIsInf",
44203	           xmlMemBlocks() - mem_base);
44204	    test_ret++;
44205            printf(" %d", n_val);
44206            printf("\n");
44207        }
44208    }
44209    function_tests++;
44210#endif
44211
44212    return(test_ret);
44213}
44214
44215
44216static int
44217test_xmlXPathIsNaN(void) {
44218    int test_ret = 0;
44219
44220#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
44221    int mem_base;
44222    int ret_val;
44223    double val; /* a double value */
44224    int n_val;
44225
44226    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44227        mem_base = xmlMemBlocks();
44228        val = gen_double(n_val, 0);
44229
44230        ret_val = xmlXPathIsNaN(val);
44231        desret_int(ret_val);
44232        call_tests++;
44233        des_double(n_val, val, 0);
44234        xmlResetLastError();
44235        if (mem_base != xmlMemBlocks()) {
44236            printf("Leak of %d blocks found in xmlXPathIsNaN",
44237	           xmlMemBlocks() - mem_base);
44238	    test_ret++;
44239            printf(" %d", n_val);
44240            printf("\n");
44241        }
44242    }
44243    function_tests++;
44244#endif
44245
44246    return(test_ret);
44247}
44248
44249
44250static int
44251test_xmlXPathNewContext(void) {
44252    int test_ret = 0;
44253
44254
44255    /* missing type support */
44256    return(test_ret);
44257}
44258
44259
44260static int
44261test_xmlXPathNodeSetCreate(void) {
44262    int test_ret = 0;
44263
44264#if defined(LIBXML_XPATH_ENABLED)
44265    int mem_base;
44266    xmlNodeSetPtr ret_val;
44267    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
44268    int n_val;
44269
44270    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
44271        mem_base = xmlMemBlocks();
44272        val = gen_xmlNodePtr(n_val, 0);
44273
44274        ret_val = xmlXPathNodeSetCreate(val);
44275        desret_xmlNodeSetPtr(ret_val);
44276        call_tests++;
44277        des_xmlNodePtr(n_val, val, 0);
44278        xmlResetLastError();
44279        if (mem_base != xmlMemBlocks()) {
44280            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
44281	           xmlMemBlocks() - mem_base);
44282	    test_ret++;
44283            printf(" %d", n_val);
44284            printf("\n");
44285        }
44286    }
44287    function_tests++;
44288#endif
44289
44290    return(test_ret);
44291}
44292
44293
44294static int
44295test_xmlXPathObjectCopy(void) {
44296    int test_ret = 0;
44297
44298#if defined(LIBXML_XPATH_ENABLED)
44299    int mem_base;
44300    xmlXPathObjectPtr ret_val;
44301    xmlXPathObjectPtr val; /* the original object */
44302    int n_val;
44303
44304    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
44305        mem_base = xmlMemBlocks();
44306        val = gen_xmlXPathObjectPtr(n_val, 0);
44307
44308        ret_val = xmlXPathObjectCopy(val);
44309        desret_xmlXPathObjectPtr(ret_val);
44310        call_tests++;
44311        des_xmlXPathObjectPtr(n_val, val, 0);
44312        xmlResetLastError();
44313        if (mem_base != xmlMemBlocks()) {
44314            printf("Leak of %d blocks found in xmlXPathObjectCopy",
44315	           xmlMemBlocks() - mem_base);
44316	    test_ret++;
44317            printf(" %d", n_val);
44318            printf("\n");
44319        }
44320    }
44321    function_tests++;
44322#endif
44323
44324    return(test_ret);
44325}
44326
44327
44328static int
44329test_xmlXPathOrderDocElems(void) {
44330    int test_ret = 0;
44331
44332#if defined(LIBXML_XPATH_ENABLED)
44333    int mem_base;
44334    long ret_val;
44335    xmlDocPtr doc; /* an input document */
44336    int n_doc;
44337
44338    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
44339        mem_base = xmlMemBlocks();
44340        doc = gen_xmlDocPtr(n_doc, 0);
44341
44342        ret_val = xmlXPathOrderDocElems(doc);
44343        desret_long(ret_val);
44344        call_tests++;
44345        des_xmlDocPtr(n_doc, doc, 0);
44346        xmlResetLastError();
44347        if (mem_base != xmlMemBlocks()) {
44348            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
44349	           xmlMemBlocks() - mem_base);
44350	    test_ret++;
44351            printf(" %d", n_doc);
44352            printf("\n");
44353        }
44354    }
44355    function_tests++;
44356#endif
44357
44358    return(test_ret);
44359}
44360
44361static int
44362test_xpath(void) {
44363    int test_ret = 0;
44364
44365    if (quiet == 0) printf("Testing xpath : 28 of 36 functions ...\n");
44366    test_ret += test_xmlXPathCastBooleanToNumber();
44367    test_ret += test_xmlXPathCastBooleanToString();
44368    test_ret += test_xmlXPathCastNodeSetToBoolean();
44369    test_ret += test_xmlXPathCastNodeSetToNumber();
44370    test_ret += test_xmlXPathCastNodeSetToString();
44371    test_ret += test_xmlXPathCastNodeToNumber();
44372    test_ret += test_xmlXPathCastNodeToString();
44373    test_ret += test_xmlXPathCastNumberToBoolean();
44374    test_ret += test_xmlXPathCastNumberToString();
44375    test_ret += test_xmlXPathCastStringToBoolean();
44376    test_ret += test_xmlXPathCastStringToNumber();
44377    test_ret += test_xmlXPathCastToBoolean();
44378    test_ret += test_xmlXPathCastToNumber();
44379    test_ret += test_xmlXPathCastToString();
44380    test_ret += test_xmlXPathCmpNodes();
44381    test_ret += test_xmlXPathCompile();
44382    test_ret += test_xmlXPathCompiledEval();
44383    test_ret += test_xmlXPathConvertBoolean();
44384    test_ret += test_xmlXPathConvertNumber();
44385    test_ret += test_xmlXPathConvertString();
44386    test_ret += test_xmlXPathCtxtCompile();
44387    test_ret += test_xmlXPathEval();
44388    test_ret += test_xmlXPathEvalExpression();
44389    test_ret += test_xmlXPathEvalPredicate();
44390    test_ret += test_xmlXPathInit();
44391    test_ret += test_xmlXPathIsInf();
44392    test_ret += test_xmlXPathIsNaN();
44393    test_ret += test_xmlXPathNewContext();
44394    test_ret += test_xmlXPathNodeSetCreate();
44395    test_ret += test_xmlXPathObjectCopy();
44396    test_ret += test_xmlXPathOrderDocElems();
44397
44398    if (test_ret != 0)
44399	printf("Module xpath: %d errors\n", test_ret);
44400    return(test_ret);
44401}
44402#ifdef LIBXML_XPATH_ENABLED
44403
44404#define gen_nb_xmlXPathParserContextPtr 1
44405static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
44406    return(NULL);
44407}
44408static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
44409}
44410#endif
44411
44412
44413static int
44414test_valuePop(void) {
44415    int test_ret = 0;
44416
44417#if defined(LIBXML_XPATH_ENABLED)
44418    int mem_base;
44419    xmlXPathObjectPtr ret_val;
44420    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
44421    int n_ctxt;
44422
44423    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44424        mem_base = xmlMemBlocks();
44425        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44426
44427        ret_val = valuePop(ctxt);
44428        desret_xmlXPathObjectPtr(ret_val);
44429        call_tests++;
44430        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44431        xmlResetLastError();
44432        if (mem_base != xmlMemBlocks()) {
44433            printf("Leak of %d blocks found in valuePop",
44434	           xmlMemBlocks() - mem_base);
44435	    test_ret++;
44436            printf(" %d", n_ctxt);
44437            printf("\n");
44438        }
44439    }
44440    function_tests++;
44441#endif
44442
44443    return(test_ret);
44444}
44445
44446
44447static int
44448test_valuePush(void) {
44449    int test_ret = 0;
44450
44451#if defined(LIBXML_XPATH_ENABLED)
44452    int mem_base;
44453    int ret_val;
44454    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
44455    int n_ctxt;
44456    xmlXPathObjectPtr value; /* the XPath object */
44457    int n_value;
44458
44459    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44460    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
44461        mem_base = xmlMemBlocks();
44462        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44463        value = gen_xmlXPathObjectPtr(n_value, 1);
44464
44465        ret_val = valuePush(ctxt, value);
44466        desret_int(ret_val);
44467        call_tests++;
44468        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44469        des_xmlXPathObjectPtr(n_value, value, 1);
44470        xmlResetLastError();
44471        if (mem_base != xmlMemBlocks()) {
44472            printf("Leak of %d blocks found in valuePush",
44473	           xmlMemBlocks() - mem_base);
44474	    test_ret++;
44475            printf(" %d", n_ctxt);
44476            printf(" %d", n_value);
44477            printf("\n");
44478        }
44479    }
44480    }
44481    function_tests++;
44482#endif
44483
44484    return(test_ret);
44485}
44486
44487
44488static int
44489test_xmlXPathAddValues(void) {
44490    int test_ret = 0;
44491
44492#if defined(LIBXML_XPATH_ENABLED)
44493    int mem_base;
44494    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44495    int n_ctxt;
44496
44497    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44498        mem_base = xmlMemBlocks();
44499        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44500
44501        xmlXPathAddValues(ctxt);
44502        call_tests++;
44503        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44504        xmlResetLastError();
44505        if (mem_base != xmlMemBlocks()) {
44506            printf("Leak of %d blocks found in xmlXPathAddValues",
44507	           xmlMemBlocks() - mem_base);
44508	    test_ret++;
44509            printf(" %d", n_ctxt);
44510            printf("\n");
44511        }
44512    }
44513    function_tests++;
44514#endif
44515
44516    return(test_ret);
44517}
44518
44519
44520static int
44521test_xmlXPathBooleanFunction(void) {
44522    int test_ret = 0;
44523
44524#if defined(LIBXML_XPATH_ENABLED)
44525    int mem_base;
44526    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44527    int n_ctxt;
44528    int nargs; /* the number of arguments */
44529    int n_nargs;
44530
44531    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44532    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44533        mem_base = xmlMemBlocks();
44534        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44535        nargs = gen_int(n_nargs, 1);
44536
44537        xmlXPathBooleanFunction(ctxt, nargs);
44538        call_tests++;
44539        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44540        des_int(n_nargs, nargs, 1);
44541        xmlResetLastError();
44542        if (mem_base != xmlMemBlocks()) {
44543            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
44544	           xmlMemBlocks() - mem_base);
44545	    test_ret++;
44546            printf(" %d", n_ctxt);
44547            printf(" %d", n_nargs);
44548            printf("\n");
44549        }
44550    }
44551    }
44552    function_tests++;
44553#endif
44554
44555    return(test_ret);
44556}
44557
44558
44559static int
44560test_xmlXPathCeilingFunction(void) {
44561    int test_ret = 0;
44562
44563#if defined(LIBXML_XPATH_ENABLED)
44564    int mem_base;
44565    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44566    int n_ctxt;
44567    int nargs; /* the number of arguments */
44568    int n_nargs;
44569
44570    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44571    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44572        mem_base = xmlMemBlocks();
44573        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44574        nargs = gen_int(n_nargs, 1);
44575
44576        xmlXPathCeilingFunction(ctxt, nargs);
44577        call_tests++;
44578        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44579        des_int(n_nargs, nargs, 1);
44580        xmlResetLastError();
44581        if (mem_base != xmlMemBlocks()) {
44582            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
44583	           xmlMemBlocks() - mem_base);
44584	    test_ret++;
44585            printf(" %d", n_ctxt);
44586            printf(" %d", n_nargs);
44587            printf("\n");
44588        }
44589    }
44590    }
44591    function_tests++;
44592#endif
44593
44594    return(test_ret);
44595}
44596
44597
44598static int
44599test_xmlXPathCompareValues(void) {
44600    int test_ret = 0;
44601
44602#if defined(LIBXML_XPATH_ENABLED)
44603    int mem_base;
44604    int ret_val;
44605    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44606    int n_ctxt;
44607    int inf; /* less than (1) or greater than (0) */
44608    int n_inf;
44609    int strict; /* is the comparison strict */
44610    int n_strict;
44611
44612    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44613    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
44614    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
44615        mem_base = xmlMemBlocks();
44616        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44617        inf = gen_int(n_inf, 1);
44618        strict = gen_int(n_strict, 2);
44619
44620        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
44621        desret_int(ret_val);
44622        call_tests++;
44623        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44624        des_int(n_inf, inf, 1);
44625        des_int(n_strict, strict, 2);
44626        xmlResetLastError();
44627        if (mem_base != xmlMemBlocks()) {
44628            printf("Leak of %d blocks found in xmlXPathCompareValues",
44629	           xmlMemBlocks() - mem_base);
44630	    test_ret++;
44631            printf(" %d", n_ctxt);
44632            printf(" %d", n_inf);
44633            printf(" %d", n_strict);
44634            printf("\n");
44635        }
44636    }
44637    }
44638    }
44639    function_tests++;
44640#endif
44641
44642    return(test_ret);
44643}
44644
44645
44646static int
44647test_xmlXPathConcatFunction(void) {
44648    int test_ret = 0;
44649
44650#if defined(LIBXML_XPATH_ENABLED)
44651    int mem_base;
44652    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44653    int n_ctxt;
44654    int nargs; /* the number of arguments */
44655    int n_nargs;
44656
44657    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44658    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44659        mem_base = xmlMemBlocks();
44660        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44661        nargs = gen_int(n_nargs, 1);
44662
44663        xmlXPathConcatFunction(ctxt, nargs);
44664        call_tests++;
44665        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44666        des_int(n_nargs, nargs, 1);
44667        xmlResetLastError();
44668        if (mem_base != xmlMemBlocks()) {
44669            printf("Leak of %d blocks found in xmlXPathConcatFunction",
44670	           xmlMemBlocks() - mem_base);
44671	    test_ret++;
44672            printf(" %d", n_ctxt);
44673            printf(" %d", n_nargs);
44674            printf("\n");
44675        }
44676    }
44677    }
44678    function_tests++;
44679#endif
44680
44681    return(test_ret);
44682}
44683
44684
44685static int
44686test_xmlXPathContainsFunction(void) {
44687    int test_ret = 0;
44688
44689#if defined(LIBXML_XPATH_ENABLED)
44690    int mem_base;
44691    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44692    int n_ctxt;
44693    int nargs; /* the number of arguments */
44694    int n_nargs;
44695
44696    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44697    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44698        mem_base = xmlMemBlocks();
44699        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44700        nargs = gen_int(n_nargs, 1);
44701
44702        xmlXPathContainsFunction(ctxt, nargs);
44703        call_tests++;
44704        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44705        des_int(n_nargs, nargs, 1);
44706        xmlResetLastError();
44707        if (mem_base != xmlMemBlocks()) {
44708            printf("Leak of %d blocks found in xmlXPathContainsFunction",
44709	           xmlMemBlocks() - mem_base);
44710	    test_ret++;
44711            printf(" %d", n_ctxt);
44712            printf(" %d", n_nargs);
44713            printf("\n");
44714        }
44715    }
44716    }
44717    function_tests++;
44718#endif
44719
44720    return(test_ret);
44721}
44722
44723
44724static int
44725test_xmlXPathCountFunction(void) {
44726    int test_ret = 0;
44727
44728#if defined(LIBXML_XPATH_ENABLED)
44729    int mem_base;
44730    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44731    int n_ctxt;
44732    int nargs; /* the number of arguments */
44733    int n_nargs;
44734
44735    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44736    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44737        mem_base = xmlMemBlocks();
44738        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44739        nargs = gen_int(n_nargs, 1);
44740
44741        xmlXPathCountFunction(ctxt, nargs);
44742        call_tests++;
44743        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44744        des_int(n_nargs, nargs, 1);
44745        xmlResetLastError();
44746        if (mem_base != xmlMemBlocks()) {
44747            printf("Leak of %d blocks found in xmlXPathCountFunction",
44748	           xmlMemBlocks() - mem_base);
44749	    test_ret++;
44750            printf(" %d", n_ctxt);
44751            printf(" %d", n_nargs);
44752            printf("\n");
44753        }
44754    }
44755    }
44756    function_tests++;
44757#endif
44758
44759    return(test_ret);
44760}
44761
44762
44763static int
44764test_xmlXPathDebugDumpCompExpr(void) {
44765    int test_ret = 0;
44766
44767#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
44768    int mem_base;
44769    FILE * output; /* the FILE * for the output */
44770    int n_output;
44771    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
44772    int n_comp;
44773    int depth; /* the indentation level. */
44774    int n_depth;
44775
44776    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
44777    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
44778    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
44779        mem_base = xmlMemBlocks();
44780        output = gen_FILE_ptr(n_output, 0);
44781        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
44782        depth = gen_int(n_depth, 2);
44783
44784        xmlXPathDebugDumpCompExpr(output, comp, depth);
44785        call_tests++;
44786        des_FILE_ptr(n_output, output, 0);
44787        des_xmlXPathCompExprPtr(n_comp, comp, 1);
44788        des_int(n_depth, depth, 2);
44789        xmlResetLastError();
44790        if (mem_base != xmlMemBlocks()) {
44791            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
44792	           xmlMemBlocks() - mem_base);
44793	    test_ret++;
44794            printf(" %d", n_output);
44795            printf(" %d", n_comp);
44796            printf(" %d", n_depth);
44797            printf("\n");
44798        }
44799    }
44800    }
44801    }
44802    function_tests++;
44803#endif
44804
44805    return(test_ret);
44806}
44807
44808
44809static int
44810test_xmlXPathDebugDumpObject(void) {
44811    int test_ret = 0;
44812
44813#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
44814    int mem_base;
44815    FILE * output; /* the FILE * to dump the output */
44816    int n_output;
44817    xmlXPathObjectPtr cur; /* the object to inspect */
44818    int n_cur;
44819    int depth; /* indentation level */
44820    int n_depth;
44821
44822    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
44823    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
44824    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
44825        mem_base = xmlMemBlocks();
44826        output = gen_FILE_ptr(n_output, 0);
44827        cur = gen_xmlXPathObjectPtr(n_cur, 1);
44828        depth = gen_int(n_depth, 2);
44829
44830        xmlXPathDebugDumpObject(output, cur, depth);
44831        call_tests++;
44832        des_FILE_ptr(n_output, output, 0);
44833        des_xmlXPathObjectPtr(n_cur, cur, 1);
44834        des_int(n_depth, depth, 2);
44835        xmlResetLastError();
44836        if (mem_base != xmlMemBlocks()) {
44837            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
44838	           xmlMemBlocks() - mem_base);
44839	    test_ret++;
44840            printf(" %d", n_output);
44841            printf(" %d", n_cur);
44842            printf(" %d", n_depth);
44843            printf("\n");
44844        }
44845    }
44846    }
44847    }
44848    function_tests++;
44849#endif
44850
44851    return(test_ret);
44852}
44853
44854
44855static int
44856test_xmlXPathDifference(void) {
44857    int test_ret = 0;
44858
44859#if defined(LIBXML_XPATH_ENABLED)
44860    int mem_base;
44861    xmlNodeSetPtr ret_val;
44862    xmlNodeSetPtr nodes1; /* a node-set */
44863    int n_nodes1;
44864    xmlNodeSetPtr nodes2; /* a node-set */
44865    int n_nodes2;
44866
44867    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
44868    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
44869        mem_base = xmlMemBlocks();
44870        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
44871        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
44872
44873        ret_val = xmlXPathDifference(nodes1, nodes2);
44874        desret_xmlNodeSetPtr(ret_val);
44875        call_tests++;
44876        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
44877        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
44878        xmlResetLastError();
44879        if (mem_base != xmlMemBlocks()) {
44880            printf("Leak of %d blocks found in xmlXPathDifference",
44881	           xmlMemBlocks() - mem_base);
44882	    test_ret++;
44883            printf(" %d", n_nodes1);
44884            printf(" %d", n_nodes2);
44885            printf("\n");
44886        }
44887    }
44888    }
44889    function_tests++;
44890#endif
44891
44892    return(test_ret);
44893}
44894
44895
44896static int
44897test_xmlXPathDistinct(void) {
44898    int test_ret = 0;
44899
44900#if defined(LIBXML_XPATH_ENABLED)
44901    int mem_base;
44902    xmlNodeSetPtr ret_val;
44903    xmlNodeSetPtr nodes; /* a node-set */
44904    int n_nodes;
44905
44906    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
44907        mem_base = xmlMemBlocks();
44908        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
44909
44910        ret_val = xmlXPathDistinct(nodes);
44911        desret_xmlNodeSetPtr(ret_val);
44912        call_tests++;
44913        des_xmlNodeSetPtr(n_nodes, nodes, 0);
44914        xmlResetLastError();
44915        if (mem_base != xmlMemBlocks()) {
44916            printf("Leak of %d blocks found in xmlXPathDistinct",
44917	           xmlMemBlocks() - mem_base);
44918	    test_ret++;
44919            printf(" %d", n_nodes);
44920            printf("\n");
44921        }
44922    }
44923    function_tests++;
44924#endif
44925
44926    return(test_ret);
44927}
44928
44929
44930static int
44931test_xmlXPathDistinctSorted(void) {
44932    int test_ret = 0;
44933
44934#if defined(LIBXML_XPATH_ENABLED)
44935    int mem_base;
44936    xmlNodeSetPtr ret_val;
44937    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
44938    int n_nodes;
44939
44940    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
44941        mem_base = xmlMemBlocks();
44942        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
44943
44944        ret_val = xmlXPathDistinctSorted(nodes);
44945        desret_xmlNodeSetPtr(ret_val);
44946        call_tests++;
44947        des_xmlNodeSetPtr(n_nodes, nodes, 0);
44948        xmlResetLastError();
44949        if (mem_base != xmlMemBlocks()) {
44950            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
44951	           xmlMemBlocks() - mem_base);
44952	    test_ret++;
44953            printf(" %d", n_nodes);
44954            printf("\n");
44955        }
44956    }
44957    function_tests++;
44958#endif
44959
44960    return(test_ret);
44961}
44962
44963
44964static int
44965test_xmlXPathDivValues(void) {
44966    int test_ret = 0;
44967
44968#if defined(LIBXML_XPATH_ENABLED)
44969    int mem_base;
44970    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44971    int n_ctxt;
44972
44973    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44974        mem_base = xmlMemBlocks();
44975        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44976
44977        xmlXPathDivValues(ctxt);
44978        call_tests++;
44979        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44980        xmlResetLastError();
44981        if (mem_base != xmlMemBlocks()) {
44982            printf("Leak of %d blocks found in xmlXPathDivValues",
44983	           xmlMemBlocks() - mem_base);
44984	    test_ret++;
44985            printf(" %d", n_ctxt);
44986            printf("\n");
44987        }
44988    }
44989    function_tests++;
44990#endif
44991
44992    return(test_ret);
44993}
44994
44995
44996static int
44997test_xmlXPathEqualValues(void) {
44998    int test_ret = 0;
44999
45000#if defined(LIBXML_XPATH_ENABLED)
45001    int mem_base;
45002    int ret_val;
45003    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45004    int n_ctxt;
45005
45006    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45007        mem_base = xmlMemBlocks();
45008        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45009
45010        ret_val = xmlXPathEqualValues(ctxt);
45011        desret_int(ret_val);
45012        call_tests++;
45013        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45014        xmlResetLastError();
45015        if (mem_base != xmlMemBlocks()) {
45016            printf("Leak of %d blocks found in xmlXPathEqualValues",
45017	           xmlMemBlocks() - mem_base);
45018	    test_ret++;
45019            printf(" %d", n_ctxt);
45020            printf("\n");
45021        }
45022    }
45023    function_tests++;
45024#endif
45025
45026    return(test_ret);
45027}
45028
45029
45030static int
45031test_xmlXPathErr(void) {
45032    int test_ret = 0;
45033
45034#if defined(LIBXML_XPATH_ENABLED)
45035    int mem_base;
45036    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
45037    int n_ctxt;
45038    int error; /* the error code */
45039    int n_error;
45040
45041    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45042    for (n_error = 0;n_error < gen_nb_int;n_error++) {
45043        mem_base = xmlMemBlocks();
45044        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45045        error = gen_int(n_error, 1);
45046
45047        xmlXPathErr(ctxt, error);
45048        call_tests++;
45049        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45050        des_int(n_error, error, 1);
45051        xmlResetLastError();
45052        if (mem_base != xmlMemBlocks()) {
45053            printf("Leak of %d blocks found in xmlXPathErr",
45054	           xmlMemBlocks() - mem_base);
45055	    test_ret++;
45056            printf(" %d", n_ctxt);
45057            printf(" %d", n_error);
45058            printf("\n");
45059        }
45060    }
45061    }
45062    function_tests++;
45063#endif
45064
45065    return(test_ret);
45066}
45067
45068
45069static int
45070test_xmlXPathEvalExpr(void) {
45071    int test_ret = 0;
45072
45073#if defined(LIBXML_XPATH_ENABLED)
45074    int mem_base;
45075    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45076    int n_ctxt;
45077
45078    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45079        mem_base = xmlMemBlocks();
45080        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45081
45082        xmlXPathEvalExpr(ctxt);
45083        call_tests++;
45084        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45085        xmlResetLastError();
45086        if (mem_base != xmlMemBlocks()) {
45087            printf("Leak of %d blocks found in xmlXPathEvalExpr",
45088	           xmlMemBlocks() - mem_base);
45089	    test_ret++;
45090            printf(" %d", n_ctxt);
45091            printf("\n");
45092        }
45093    }
45094    function_tests++;
45095#endif
45096
45097    return(test_ret);
45098}
45099
45100
45101static int
45102test_xmlXPathEvaluatePredicateResult(void) {
45103    int test_ret = 0;
45104
45105#if defined(LIBXML_XPATH_ENABLED)
45106    int mem_base;
45107    int ret_val;
45108    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45109    int n_ctxt;
45110    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
45111    int n_res;
45112
45113    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45114    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
45115        mem_base = xmlMemBlocks();
45116        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45117        res = gen_xmlXPathObjectPtr(n_res, 1);
45118
45119        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
45120        desret_int(ret_val);
45121        call_tests++;
45122        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45123        des_xmlXPathObjectPtr(n_res, res, 1);
45124        xmlResetLastError();
45125        if (mem_base != xmlMemBlocks()) {
45126            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
45127	           xmlMemBlocks() - mem_base);
45128	    test_ret++;
45129            printf(" %d", n_ctxt);
45130            printf(" %d", n_res);
45131            printf("\n");
45132        }
45133    }
45134    }
45135    function_tests++;
45136#endif
45137
45138    return(test_ret);
45139}
45140
45141
45142static int
45143test_xmlXPathFalseFunction(void) {
45144    int test_ret = 0;
45145
45146#if defined(LIBXML_XPATH_ENABLED)
45147    int mem_base;
45148    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45149    int n_ctxt;
45150    int nargs; /* the number of arguments */
45151    int n_nargs;
45152
45153    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45154    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45155        mem_base = xmlMemBlocks();
45156        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45157        nargs = gen_int(n_nargs, 1);
45158
45159        xmlXPathFalseFunction(ctxt, nargs);
45160        call_tests++;
45161        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45162        des_int(n_nargs, nargs, 1);
45163        xmlResetLastError();
45164        if (mem_base != xmlMemBlocks()) {
45165            printf("Leak of %d blocks found in xmlXPathFalseFunction",
45166	           xmlMemBlocks() - mem_base);
45167	    test_ret++;
45168            printf(" %d", n_ctxt);
45169            printf(" %d", n_nargs);
45170            printf("\n");
45171        }
45172    }
45173    }
45174    function_tests++;
45175#endif
45176
45177    return(test_ret);
45178}
45179
45180
45181static int
45182test_xmlXPathFloorFunction(void) {
45183    int test_ret = 0;
45184
45185#if defined(LIBXML_XPATH_ENABLED)
45186    int mem_base;
45187    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45188    int n_ctxt;
45189    int nargs; /* the number of arguments */
45190    int n_nargs;
45191
45192    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45193    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45194        mem_base = xmlMemBlocks();
45195        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45196        nargs = gen_int(n_nargs, 1);
45197
45198        xmlXPathFloorFunction(ctxt, nargs);
45199        call_tests++;
45200        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45201        des_int(n_nargs, nargs, 1);
45202        xmlResetLastError();
45203        if (mem_base != xmlMemBlocks()) {
45204            printf("Leak of %d blocks found in xmlXPathFloorFunction",
45205	           xmlMemBlocks() - mem_base);
45206	    test_ret++;
45207            printf(" %d", n_ctxt);
45208            printf(" %d", n_nargs);
45209            printf("\n");
45210        }
45211    }
45212    }
45213    function_tests++;
45214#endif
45215
45216    return(test_ret);
45217}
45218
45219
45220static int
45221test_xmlXPathFunctionLookup(void) {
45222    int test_ret = 0;
45223
45224
45225    /* missing type support */
45226    return(test_ret);
45227}
45228
45229
45230static int
45231test_xmlXPathFunctionLookupNS(void) {
45232    int test_ret = 0;
45233
45234
45235    /* missing type support */
45236    return(test_ret);
45237}
45238
45239
45240static int
45241test_xmlXPathHasSameNodes(void) {
45242    int test_ret = 0;
45243
45244#if defined(LIBXML_XPATH_ENABLED)
45245    int mem_base;
45246    int ret_val;
45247    xmlNodeSetPtr nodes1; /* a node-set */
45248    int n_nodes1;
45249    xmlNodeSetPtr nodes2; /* a node-set */
45250    int n_nodes2;
45251
45252    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45253    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45254        mem_base = xmlMemBlocks();
45255        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45256        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45257
45258        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
45259        desret_int(ret_val);
45260        call_tests++;
45261        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45262        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45263        xmlResetLastError();
45264        if (mem_base != xmlMemBlocks()) {
45265            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
45266	           xmlMemBlocks() - mem_base);
45267	    test_ret++;
45268            printf(" %d", n_nodes1);
45269            printf(" %d", n_nodes2);
45270            printf("\n");
45271        }
45272    }
45273    }
45274    function_tests++;
45275#endif
45276
45277    return(test_ret);
45278}
45279
45280
45281static int
45282test_xmlXPathIdFunction(void) {
45283    int test_ret = 0;
45284
45285#if defined(LIBXML_XPATH_ENABLED)
45286    int mem_base;
45287    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45288    int n_ctxt;
45289    int nargs; /* the number of arguments */
45290    int n_nargs;
45291
45292    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45293    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45294        mem_base = xmlMemBlocks();
45295        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45296        nargs = gen_int(n_nargs, 1);
45297
45298        xmlXPathIdFunction(ctxt, nargs);
45299        call_tests++;
45300        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45301        des_int(n_nargs, nargs, 1);
45302        xmlResetLastError();
45303        if (mem_base != xmlMemBlocks()) {
45304            printf("Leak of %d blocks found in xmlXPathIdFunction",
45305	           xmlMemBlocks() - mem_base);
45306	    test_ret++;
45307            printf(" %d", n_ctxt);
45308            printf(" %d", n_nargs);
45309            printf("\n");
45310        }
45311    }
45312    }
45313    function_tests++;
45314#endif
45315
45316    return(test_ret);
45317}
45318
45319
45320static int
45321test_xmlXPathIntersection(void) {
45322    int test_ret = 0;
45323
45324#if defined(LIBXML_XPATH_ENABLED)
45325    int mem_base;
45326    xmlNodeSetPtr ret_val;
45327    xmlNodeSetPtr nodes1; /* a node-set */
45328    int n_nodes1;
45329    xmlNodeSetPtr nodes2; /* a node-set */
45330    int n_nodes2;
45331
45332    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45333    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45334        mem_base = xmlMemBlocks();
45335        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45336        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45337
45338        ret_val = xmlXPathIntersection(nodes1, nodes2);
45339        desret_xmlNodeSetPtr(ret_val);
45340        call_tests++;
45341        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45342        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45343        xmlResetLastError();
45344        if (mem_base != xmlMemBlocks()) {
45345            printf("Leak of %d blocks found in xmlXPathIntersection",
45346	           xmlMemBlocks() - mem_base);
45347	    test_ret++;
45348            printf(" %d", n_nodes1);
45349            printf(" %d", n_nodes2);
45350            printf("\n");
45351        }
45352    }
45353    }
45354    function_tests++;
45355#endif
45356
45357    return(test_ret);
45358}
45359
45360
45361static int
45362test_xmlXPathIsNodeType(void) {
45363    int test_ret = 0;
45364
45365#if defined(LIBXML_XPATH_ENABLED)
45366    int mem_base;
45367    int ret_val;
45368    xmlChar * name; /* a name string */
45369    int n_name;
45370
45371    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45372        mem_base = xmlMemBlocks();
45373        name = gen_const_xmlChar_ptr(n_name, 0);
45374
45375        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
45376        desret_int(ret_val);
45377        call_tests++;
45378        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
45379        xmlResetLastError();
45380        if (mem_base != xmlMemBlocks()) {
45381            printf("Leak of %d blocks found in xmlXPathIsNodeType",
45382	           xmlMemBlocks() - mem_base);
45383	    test_ret++;
45384            printf(" %d", n_name);
45385            printf("\n");
45386        }
45387    }
45388    function_tests++;
45389#endif
45390
45391    return(test_ret);
45392}
45393
45394
45395static int
45396test_xmlXPathLangFunction(void) {
45397    int test_ret = 0;
45398
45399#if defined(LIBXML_XPATH_ENABLED)
45400    int mem_base;
45401    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45402    int n_ctxt;
45403    int nargs; /* the number of arguments */
45404    int n_nargs;
45405
45406    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45407    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45408        mem_base = xmlMemBlocks();
45409        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45410        nargs = gen_int(n_nargs, 1);
45411
45412        xmlXPathLangFunction(ctxt, nargs);
45413        call_tests++;
45414        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45415        des_int(n_nargs, nargs, 1);
45416        xmlResetLastError();
45417        if (mem_base != xmlMemBlocks()) {
45418            printf("Leak of %d blocks found in xmlXPathLangFunction",
45419	           xmlMemBlocks() - mem_base);
45420	    test_ret++;
45421            printf(" %d", n_ctxt);
45422            printf(" %d", n_nargs);
45423            printf("\n");
45424        }
45425    }
45426    }
45427    function_tests++;
45428#endif
45429
45430    return(test_ret);
45431}
45432
45433
45434static int
45435test_xmlXPathLastFunction(void) {
45436    int test_ret = 0;
45437
45438#if defined(LIBXML_XPATH_ENABLED)
45439    int mem_base;
45440    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45441    int n_ctxt;
45442    int nargs; /* the number of arguments */
45443    int n_nargs;
45444
45445    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45446    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45447        mem_base = xmlMemBlocks();
45448        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45449        nargs = gen_int(n_nargs, 1);
45450
45451        xmlXPathLastFunction(ctxt, nargs);
45452        call_tests++;
45453        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45454        des_int(n_nargs, nargs, 1);
45455        xmlResetLastError();
45456        if (mem_base != xmlMemBlocks()) {
45457            printf("Leak of %d blocks found in xmlXPathLastFunction",
45458	           xmlMemBlocks() - mem_base);
45459	    test_ret++;
45460            printf(" %d", n_ctxt);
45461            printf(" %d", n_nargs);
45462            printf("\n");
45463        }
45464    }
45465    }
45466    function_tests++;
45467#endif
45468
45469    return(test_ret);
45470}
45471
45472
45473static int
45474test_xmlXPathLeading(void) {
45475    int test_ret = 0;
45476
45477#if defined(LIBXML_XPATH_ENABLED)
45478    int mem_base;
45479    xmlNodeSetPtr ret_val;
45480    xmlNodeSetPtr nodes1; /* a node-set */
45481    int n_nodes1;
45482    xmlNodeSetPtr nodes2; /* a node-set */
45483    int n_nodes2;
45484
45485    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45486    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45487        mem_base = xmlMemBlocks();
45488        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45489        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45490
45491        ret_val = xmlXPathLeading(nodes1, nodes2);
45492        desret_xmlNodeSetPtr(ret_val);
45493        call_tests++;
45494        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45495        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45496        xmlResetLastError();
45497        if (mem_base != xmlMemBlocks()) {
45498            printf("Leak of %d blocks found in xmlXPathLeading",
45499	           xmlMemBlocks() - mem_base);
45500	    test_ret++;
45501            printf(" %d", n_nodes1);
45502            printf(" %d", n_nodes2);
45503            printf("\n");
45504        }
45505    }
45506    }
45507    function_tests++;
45508#endif
45509
45510    return(test_ret);
45511}
45512
45513
45514static int
45515test_xmlXPathLeadingSorted(void) {
45516    int test_ret = 0;
45517
45518#if defined(LIBXML_XPATH_ENABLED)
45519    int mem_base;
45520    xmlNodeSetPtr ret_val;
45521    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
45522    int n_nodes1;
45523    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
45524    int n_nodes2;
45525
45526    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45527    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45528        mem_base = xmlMemBlocks();
45529        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45530        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45531
45532        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
45533        desret_xmlNodeSetPtr(ret_val);
45534        call_tests++;
45535        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45536        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45537        xmlResetLastError();
45538        if (mem_base != xmlMemBlocks()) {
45539            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
45540	           xmlMemBlocks() - mem_base);
45541	    test_ret++;
45542            printf(" %d", n_nodes1);
45543            printf(" %d", n_nodes2);
45544            printf("\n");
45545        }
45546    }
45547    }
45548    function_tests++;
45549#endif
45550
45551    return(test_ret);
45552}
45553
45554
45555static int
45556test_xmlXPathLocalNameFunction(void) {
45557    int test_ret = 0;
45558
45559#if defined(LIBXML_XPATH_ENABLED)
45560    int mem_base;
45561    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45562    int n_ctxt;
45563    int nargs; /* the number of arguments */
45564    int n_nargs;
45565
45566    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45567    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45568        mem_base = xmlMemBlocks();
45569        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45570        nargs = gen_int(n_nargs, 1);
45571
45572        xmlXPathLocalNameFunction(ctxt, nargs);
45573        call_tests++;
45574        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45575        des_int(n_nargs, nargs, 1);
45576        xmlResetLastError();
45577        if (mem_base != xmlMemBlocks()) {
45578            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
45579	           xmlMemBlocks() - mem_base);
45580	    test_ret++;
45581            printf(" %d", n_ctxt);
45582            printf(" %d", n_nargs);
45583            printf("\n");
45584        }
45585    }
45586    }
45587    function_tests++;
45588#endif
45589
45590    return(test_ret);
45591}
45592
45593
45594static int
45595test_xmlXPathModValues(void) {
45596    int test_ret = 0;
45597
45598#if defined(LIBXML_XPATH_ENABLED)
45599    int mem_base;
45600    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45601    int n_ctxt;
45602
45603    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45604        mem_base = xmlMemBlocks();
45605        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45606
45607        xmlXPathModValues(ctxt);
45608        call_tests++;
45609        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45610        xmlResetLastError();
45611        if (mem_base != xmlMemBlocks()) {
45612            printf("Leak of %d blocks found in xmlXPathModValues",
45613	           xmlMemBlocks() - mem_base);
45614	    test_ret++;
45615            printf(" %d", n_ctxt);
45616            printf("\n");
45617        }
45618    }
45619    function_tests++;
45620#endif
45621
45622    return(test_ret);
45623}
45624
45625
45626static int
45627test_xmlXPathMultValues(void) {
45628    int test_ret = 0;
45629
45630#if defined(LIBXML_XPATH_ENABLED)
45631    int mem_base;
45632    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45633    int n_ctxt;
45634
45635    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45636        mem_base = xmlMemBlocks();
45637        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45638
45639        xmlXPathMultValues(ctxt);
45640        call_tests++;
45641        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45642        xmlResetLastError();
45643        if (mem_base != xmlMemBlocks()) {
45644            printf("Leak of %d blocks found in xmlXPathMultValues",
45645	           xmlMemBlocks() - mem_base);
45646	    test_ret++;
45647            printf(" %d", n_ctxt);
45648            printf("\n");
45649        }
45650    }
45651    function_tests++;
45652#endif
45653
45654    return(test_ret);
45655}
45656
45657
45658static int
45659test_xmlXPathNamespaceURIFunction(void) {
45660    int test_ret = 0;
45661
45662#if defined(LIBXML_XPATH_ENABLED)
45663    int mem_base;
45664    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45665    int n_ctxt;
45666    int nargs; /* the number of arguments */
45667    int n_nargs;
45668
45669    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45670    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45671        mem_base = xmlMemBlocks();
45672        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45673        nargs = gen_int(n_nargs, 1);
45674
45675        xmlXPathNamespaceURIFunction(ctxt, nargs);
45676        call_tests++;
45677        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45678        des_int(n_nargs, nargs, 1);
45679        xmlResetLastError();
45680        if (mem_base != xmlMemBlocks()) {
45681            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
45682	           xmlMemBlocks() - mem_base);
45683	    test_ret++;
45684            printf(" %d", n_ctxt);
45685            printf(" %d", n_nargs);
45686            printf("\n");
45687        }
45688    }
45689    }
45690    function_tests++;
45691#endif
45692
45693    return(test_ret);
45694}
45695
45696
45697static int
45698test_xmlXPathNewBoolean(void) {
45699    int test_ret = 0;
45700
45701#if defined(LIBXML_XPATH_ENABLED)
45702    int mem_base;
45703    xmlXPathObjectPtr ret_val;
45704    int val; /* the boolean value */
45705    int n_val;
45706
45707    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45708        mem_base = xmlMemBlocks();
45709        val = gen_int(n_val, 0);
45710
45711        ret_val = xmlXPathNewBoolean(val);
45712        desret_xmlXPathObjectPtr(ret_val);
45713        call_tests++;
45714        des_int(n_val, val, 0);
45715        xmlResetLastError();
45716        if (mem_base != xmlMemBlocks()) {
45717            printf("Leak of %d blocks found in xmlXPathNewBoolean",
45718	           xmlMemBlocks() - mem_base);
45719	    test_ret++;
45720            printf(" %d", n_val);
45721            printf("\n");
45722        }
45723    }
45724    function_tests++;
45725#endif
45726
45727    return(test_ret);
45728}
45729
45730
45731static int
45732test_xmlXPathNewCString(void) {
45733    int test_ret = 0;
45734
45735#if defined(LIBXML_XPATH_ENABLED)
45736    int mem_base;
45737    xmlXPathObjectPtr ret_val;
45738    char * val; /* the char * value */
45739    int n_val;
45740
45741    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
45742        mem_base = xmlMemBlocks();
45743        val = gen_const_char_ptr(n_val, 0);
45744
45745        ret_val = xmlXPathNewCString((const char *)val);
45746        desret_xmlXPathObjectPtr(ret_val);
45747        call_tests++;
45748        des_const_char_ptr(n_val, (const char *)val, 0);
45749        xmlResetLastError();
45750        if (mem_base != xmlMemBlocks()) {
45751            printf("Leak of %d blocks found in xmlXPathNewCString",
45752	           xmlMemBlocks() - mem_base);
45753	    test_ret++;
45754            printf(" %d", n_val);
45755            printf("\n");
45756        }
45757    }
45758    function_tests++;
45759#endif
45760
45761    return(test_ret);
45762}
45763
45764
45765static int
45766test_xmlXPathNewFloat(void) {
45767    int test_ret = 0;
45768
45769#if defined(LIBXML_XPATH_ENABLED)
45770    int mem_base;
45771    xmlXPathObjectPtr ret_val;
45772    double val; /* the double value */
45773    int n_val;
45774
45775    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45776        mem_base = xmlMemBlocks();
45777        val = gen_double(n_val, 0);
45778
45779        ret_val = xmlXPathNewFloat(val);
45780        desret_xmlXPathObjectPtr(ret_val);
45781        call_tests++;
45782        des_double(n_val, val, 0);
45783        xmlResetLastError();
45784        if (mem_base != xmlMemBlocks()) {
45785            printf("Leak of %d blocks found in xmlXPathNewFloat",
45786	           xmlMemBlocks() - mem_base);
45787	    test_ret++;
45788            printf(" %d", n_val);
45789            printf("\n");
45790        }
45791    }
45792    function_tests++;
45793#endif
45794
45795    return(test_ret);
45796}
45797
45798
45799static int
45800test_xmlXPathNewNodeSet(void) {
45801    int test_ret = 0;
45802
45803#if defined(LIBXML_XPATH_ENABLED)
45804    int mem_base;
45805    xmlXPathObjectPtr ret_val;
45806    xmlNodePtr val; /* the NodePtr value */
45807    int n_val;
45808
45809    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45810        mem_base = xmlMemBlocks();
45811        val = gen_xmlNodePtr(n_val, 0);
45812
45813        ret_val = xmlXPathNewNodeSet(val);
45814        desret_xmlXPathObjectPtr(ret_val);
45815        call_tests++;
45816        des_xmlNodePtr(n_val, val, 0);
45817        xmlResetLastError();
45818        if (mem_base != xmlMemBlocks()) {
45819            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
45820	           xmlMemBlocks() - mem_base);
45821	    test_ret++;
45822            printf(" %d", n_val);
45823            printf("\n");
45824        }
45825    }
45826    function_tests++;
45827#endif
45828
45829    return(test_ret);
45830}
45831
45832
45833static int
45834test_xmlXPathNewNodeSetList(void) {
45835    int test_ret = 0;
45836
45837#if defined(LIBXML_XPATH_ENABLED)
45838    int mem_base;
45839    xmlXPathObjectPtr ret_val;
45840    xmlNodeSetPtr val; /* an existing NodeSet */
45841    int n_val;
45842
45843    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
45844        mem_base = xmlMemBlocks();
45845        val = gen_xmlNodeSetPtr(n_val, 0);
45846
45847        ret_val = xmlXPathNewNodeSetList(val);
45848        desret_xmlXPathObjectPtr(ret_val);
45849        call_tests++;
45850        des_xmlNodeSetPtr(n_val, val, 0);
45851        xmlResetLastError();
45852        if (mem_base != xmlMemBlocks()) {
45853            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
45854	           xmlMemBlocks() - mem_base);
45855	    test_ret++;
45856            printf(" %d", n_val);
45857            printf("\n");
45858        }
45859    }
45860    function_tests++;
45861#endif
45862
45863    return(test_ret);
45864}
45865
45866
45867static int
45868test_xmlXPathNewParserContext(void) {
45869    int test_ret = 0;
45870
45871
45872    /* missing type support */
45873    return(test_ret);
45874}
45875
45876
45877static int
45878test_xmlXPathNewString(void) {
45879    int test_ret = 0;
45880
45881#if defined(LIBXML_XPATH_ENABLED)
45882    int mem_base;
45883    xmlXPathObjectPtr ret_val;
45884    xmlChar * val; /* the xmlChar * value */
45885    int n_val;
45886
45887    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45888        mem_base = xmlMemBlocks();
45889        val = gen_const_xmlChar_ptr(n_val, 0);
45890
45891        ret_val = xmlXPathNewString((const xmlChar *)val);
45892        desret_xmlXPathObjectPtr(ret_val);
45893        call_tests++;
45894        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45895        xmlResetLastError();
45896        if (mem_base != xmlMemBlocks()) {
45897            printf("Leak of %d blocks found in xmlXPathNewString",
45898	           xmlMemBlocks() - mem_base);
45899	    test_ret++;
45900            printf(" %d", n_val);
45901            printf("\n");
45902        }
45903    }
45904    function_tests++;
45905#endif
45906
45907    return(test_ret);
45908}
45909
45910
45911static int
45912test_xmlXPathNextAncestor(void) {
45913    int test_ret = 0;
45914
45915#if defined(LIBXML_XPATH_ENABLED)
45916    int mem_base;
45917    xmlNodePtr ret_val;
45918    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45919    int n_ctxt;
45920    xmlNodePtr cur; /* the current node in the traversal */
45921    int n_cur;
45922
45923    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45924    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45925        mem_base = xmlMemBlocks();
45926        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45927        cur = gen_xmlNodePtr(n_cur, 1);
45928
45929        ret_val = xmlXPathNextAncestor(ctxt, cur);
45930        desret_xmlNodePtr(ret_val);
45931        call_tests++;
45932        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45933        des_xmlNodePtr(n_cur, cur, 1);
45934        xmlResetLastError();
45935        if (mem_base != xmlMemBlocks()) {
45936            printf("Leak of %d blocks found in xmlXPathNextAncestor",
45937	           xmlMemBlocks() - mem_base);
45938	    test_ret++;
45939            printf(" %d", n_ctxt);
45940            printf(" %d", n_cur);
45941            printf("\n");
45942        }
45943    }
45944    }
45945    function_tests++;
45946#endif
45947
45948    return(test_ret);
45949}
45950
45951
45952static int
45953test_xmlXPathNextAncestorOrSelf(void) {
45954    int test_ret = 0;
45955
45956#if defined(LIBXML_XPATH_ENABLED)
45957    int mem_base;
45958    xmlNodePtr ret_val;
45959    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45960    int n_ctxt;
45961    xmlNodePtr cur; /* the current node in the traversal */
45962    int n_cur;
45963
45964    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45965    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45966        mem_base = xmlMemBlocks();
45967        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45968        cur = gen_xmlNodePtr(n_cur, 1);
45969
45970        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
45971        desret_xmlNodePtr(ret_val);
45972        call_tests++;
45973        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45974        des_xmlNodePtr(n_cur, cur, 1);
45975        xmlResetLastError();
45976        if (mem_base != xmlMemBlocks()) {
45977            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
45978	           xmlMemBlocks() - mem_base);
45979	    test_ret++;
45980            printf(" %d", n_ctxt);
45981            printf(" %d", n_cur);
45982            printf("\n");
45983        }
45984    }
45985    }
45986    function_tests++;
45987#endif
45988
45989    return(test_ret);
45990}
45991
45992
45993static int
45994test_xmlXPathNextAttribute(void) {
45995    int test_ret = 0;
45996
45997#if defined(LIBXML_XPATH_ENABLED)
45998    int mem_base;
45999    xmlNodePtr ret_val;
46000    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46001    int n_ctxt;
46002    xmlNodePtr cur; /* the current attribute in the traversal */
46003    int n_cur;
46004
46005    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46006    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46007        mem_base = xmlMemBlocks();
46008        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46009        cur = gen_xmlNodePtr(n_cur, 1);
46010
46011        ret_val = xmlXPathNextAttribute(ctxt, cur);
46012        desret_xmlNodePtr(ret_val);
46013        call_tests++;
46014        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46015        des_xmlNodePtr(n_cur, cur, 1);
46016        xmlResetLastError();
46017        if (mem_base != xmlMemBlocks()) {
46018            printf("Leak of %d blocks found in xmlXPathNextAttribute",
46019	           xmlMemBlocks() - mem_base);
46020	    test_ret++;
46021            printf(" %d", n_ctxt);
46022            printf(" %d", n_cur);
46023            printf("\n");
46024        }
46025    }
46026    }
46027    function_tests++;
46028#endif
46029
46030    return(test_ret);
46031}
46032
46033
46034static int
46035test_xmlXPathNextChild(void) {
46036    int test_ret = 0;
46037
46038#if defined(LIBXML_XPATH_ENABLED)
46039    int mem_base;
46040    xmlNodePtr ret_val;
46041    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46042    int n_ctxt;
46043    xmlNodePtr cur; /* the current node in the traversal */
46044    int n_cur;
46045
46046    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46047    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46048        mem_base = xmlMemBlocks();
46049        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46050        cur = gen_xmlNodePtr(n_cur, 1);
46051
46052        ret_val = xmlXPathNextChild(ctxt, cur);
46053        desret_xmlNodePtr(ret_val);
46054        call_tests++;
46055        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46056        des_xmlNodePtr(n_cur, cur, 1);
46057        xmlResetLastError();
46058        if (mem_base != xmlMemBlocks()) {
46059            printf("Leak of %d blocks found in xmlXPathNextChild",
46060	           xmlMemBlocks() - mem_base);
46061	    test_ret++;
46062            printf(" %d", n_ctxt);
46063            printf(" %d", n_cur);
46064            printf("\n");
46065        }
46066    }
46067    }
46068    function_tests++;
46069#endif
46070
46071    return(test_ret);
46072}
46073
46074
46075static int
46076test_xmlXPathNextDescendant(void) {
46077    int test_ret = 0;
46078
46079#if defined(LIBXML_XPATH_ENABLED)
46080    int mem_base;
46081    xmlNodePtr ret_val;
46082    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46083    int n_ctxt;
46084    xmlNodePtr cur; /* the current node in the traversal */
46085    int n_cur;
46086
46087    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46088    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46089        mem_base = xmlMemBlocks();
46090        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46091        cur = gen_xmlNodePtr(n_cur, 1);
46092
46093        ret_val = xmlXPathNextDescendant(ctxt, cur);
46094        desret_xmlNodePtr(ret_val);
46095        call_tests++;
46096        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46097        des_xmlNodePtr(n_cur, cur, 1);
46098        xmlResetLastError();
46099        if (mem_base != xmlMemBlocks()) {
46100            printf("Leak of %d blocks found in xmlXPathNextDescendant",
46101	           xmlMemBlocks() - mem_base);
46102	    test_ret++;
46103            printf(" %d", n_ctxt);
46104            printf(" %d", n_cur);
46105            printf("\n");
46106        }
46107    }
46108    }
46109    function_tests++;
46110#endif
46111
46112    return(test_ret);
46113}
46114
46115
46116static int
46117test_xmlXPathNextDescendantOrSelf(void) {
46118    int test_ret = 0;
46119
46120#if defined(LIBXML_XPATH_ENABLED)
46121    int mem_base;
46122    xmlNodePtr ret_val;
46123    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46124    int n_ctxt;
46125    xmlNodePtr cur; /* the current node in the traversal */
46126    int n_cur;
46127
46128    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46129    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46130        mem_base = xmlMemBlocks();
46131        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46132        cur = gen_xmlNodePtr(n_cur, 1);
46133
46134        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
46135        desret_xmlNodePtr(ret_val);
46136        call_tests++;
46137        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46138        des_xmlNodePtr(n_cur, cur, 1);
46139        xmlResetLastError();
46140        if (mem_base != xmlMemBlocks()) {
46141            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
46142	           xmlMemBlocks() - mem_base);
46143	    test_ret++;
46144            printf(" %d", n_ctxt);
46145            printf(" %d", n_cur);
46146            printf("\n");
46147        }
46148    }
46149    }
46150    function_tests++;
46151#endif
46152
46153    return(test_ret);
46154}
46155
46156
46157static int
46158test_xmlXPathNextFollowing(void) {
46159    int test_ret = 0;
46160
46161#if defined(LIBXML_XPATH_ENABLED)
46162    int mem_base;
46163    xmlNodePtr ret_val;
46164    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46165    int n_ctxt;
46166    xmlNodePtr cur; /* the current node in the traversal */
46167    int n_cur;
46168
46169    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46170    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46171        mem_base = xmlMemBlocks();
46172        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46173        cur = gen_xmlNodePtr(n_cur, 1);
46174
46175        ret_val = xmlXPathNextFollowing(ctxt, cur);
46176        desret_xmlNodePtr(ret_val);
46177        call_tests++;
46178        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46179        des_xmlNodePtr(n_cur, cur, 1);
46180        xmlResetLastError();
46181        if (mem_base != xmlMemBlocks()) {
46182            printf("Leak of %d blocks found in xmlXPathNextFollowing",
46183	           xmlMemBlocks() - mem_base);
46184	    test_ret++;
46185            printf(" %d", n_ctxt);
46186            printf(" %d", n_cur);
46187            printf("\n");
46188        }
46189    }
46190    }
46191    function_tests++;
46192#endif
46193
46194    return(test_ret);
46195}
46196
46197
46198static int
46199test_xmlXPathNextFollowingSibling(void) {
46200    int test_ret = 0;
46201
46202#if defined(LIBXML_XPATH_ENABLED)
46203    int mem_base;
46204    xmlNodePtr ret_val;
46205    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46206    int n_ctxt;
46207    xmlNodePtr cur; /* the current node in the traversal */
46208    int n_cur;
46209
46210    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46211    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46212        mem_base = xmlMemBlocks();
46213        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46214        cur = gen_xmlNodePtr(n_cur, 1);
46215
46216        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
46217        desret_xmlNodePtr(ret_val);
46218        call_tests++;
46219        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46220        des_xmlNodePtr(n_cur, cur, 1);
46221        xmlResetLastError();
46222        if (mem_base != xmlMemBlocks()) {
46223            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
46224	           xmlMemBlocks() - mem_base);
46225	    test_ret++;
46226            printf(" %d", n_ctxt);
46227            printf(" %d", n_cur);
46228            printf("\n");
46229        }
46230    }
46231    }
46232    function_tests++;
46233#endif
46234
46235    return(test_ret);
46236}
46237
46238
46239static int
46240test_xmlXPathNextNamespace(void) {
46241    int test_ret = 0;
46242
46243#if defined(LIBXML_XPATH_ENABLED)
46244    int mem_base;
46245    xmlNodePtr ret_val;
46246    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46247    int n_ctxt;
46248    xmlNodePtr cur; /* the current attribute in the traversal */
46249    int n_cur;
46250
46251    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46252    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46253        mem_base = xmlMemBlocks();
46254        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46255        cur = gen_xmlNodePtr(n_cur, 1);
46256
46257        ret_val = xmlXPathNextNamespace(ctxt, cur);
46258        desret_xmlNodePtr(ret_val);
46259        call_tests++;
46260        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46261        des_xmlNodePtr(n_cur, cur, 1);
46262        xmlResetLastError();
46263        if (mem_base != xmlMemBlocks()) {
46264            printf("Leak of %d blocks found in xmlXPathNextNamespace",
46265	           xmlMemBlocks() - mem_base);
46266	    test_ret++;
46267            printf(" %d", n_ctxt);
46268            printf(" %d", n_cur);
46269            printf("\n");
46270        }
46271    }
46272    }
46273    function_tests++;
46274#endif
46275
46276    return(test_ret);
46277}
46278
46279
46280static int
46281test_xmlXPathNextParent(void) {
46282    int test_ret = 0;
46283
46284#if defined(LIBXML_XPATH_ENABLED)
46285    int mem_base;
46286    xmlNodePtr ret_val;
46287    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46288    int n_ctxt;
46289    xmlNodePtr cur; /* the current node in the traversal */
46290    int n_cur;
46291
46292    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46293    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46294        mem_base = xmlMemBlocks();
46295        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46296        cur = gen_xmlNodePtr(n_cur, 1);
46297
46298        ret_val = xmlXPathNextParent(ctxt, cur);
46299        desret_xmlNodePtr(ret_val);
46300        call_tests++;
46301        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46302        des_xmlNodePtr(n_cur, cur, 1);
46303        xmlResetLastError();
46304        if (mem_base != xmlMemBlocks()) {
46305            printf("Leak of %d blocks found in xmlXPathNextParent",
46306	           xmlMemBlocks() - mem_base);
46307	    test_ret++;
46308            printf(" %d", n_ctxt);
46309            printf(" %d", n_cur);
46310            printf("\n");
46311        }
46312    }
46313    }
46314    function_tests++;
46315#endif
46316
46317    return(test_ret);
46318}
46319
46320
46321static int
46322test_xmlXPathNextPreceding(void) {
46323    int test_ret = 0;
46324
46325#if defined(LIBXML_XPATH_ENABLED)
46326    int mem_base;
46327    xmlNodePtr ret_val;
46328    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46329    int n_ctxt;
46330    xmlNodePtr cur; /* the current node in the traversal */
46331    int n_cur;
46332
46333    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46334    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46335        mem_base = xmlMemBlocks();
46336        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46337        cur = gen_xmlNodePtr(n_cur, 1);
46338
46339        ret_val = xmlXPathNextPreceding(ctxt, cur);
46340        desret_xmlNodePtr(ret_val);
46341        call_tests++;
46342        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46343        des_xmlNodePtr(n_cur, cur, 1);
46344        xmlResetLastError();
46345        if (mem_base != xmlMemBlocks()) {
46346            printf("Leak of %d blocks found in xmlXPathNextPreceding",
46347	           xmlMemBlocks() - mem_base);
46348	    test_ret++;
46349            printf(" %d", n_ctxt);
46350            printf(" %d", n_cur);
46351            printf("\n");
46352        }
46353    }
46354    }
46355    function_tests++;
46356#endif
46357
46358    return(test_ret);
46359}
46360
46361
46362static int
46363test_xmlXPathNextPrecedingSibling(void) {
46364    int test_ret = 0;
46365
46366#if defined(LIBXML_XPATH_ENABLED)
46367    int mem_base;
46368    xmlNodePtr ret_val;
46369    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46370    int n_ctxt;
46371    xmlNodePtr cur; /* the current node in the traversal */
46372    int n_cur;
46373
46374    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46375    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46376        mem_base = xmlMemBlocks();
46377        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46378        cur = gen_xmlNodePtr(n_cur, 1);
46379
46380        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
46381        desret_xmlNodePtr(ret_val);
46382        call_tests++;
46383        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46384        des_xmlNodePtr(n_cur, cur, 1);
46385        xmlResetLastError();
46386        if (mem_base != xmlMemBlocks()) {
46387            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
46388	           xmlMemBlocks() - mem_base);
46389	    test_ret++;
46390            printf(" %d", n_ctxt);
46391            printf(" %d", n_cur);
46392            printf("\n");
46393        }
46394    }
46395    }
46396    function_tests++;
46397#endif
46398
46399    return(test_ret);
46400}
46401
46402
46403static int
46404test_xmlXPathNextSelf(void) {
46405    int test_ret = 0;
46406
46407#if defined(LIBXML_XPATH_ENABLED)
46408    int mem_base;
46409    xmlNodePtr ret_val;
46410    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46411    int n_ctxt;
46412    xmlNodePtr cur; /* the current node in the traversal */
46413    int n_cur;
46414
46415    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46416    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46417        mem_base = xmlMemBlocks();
46418        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46419        cur = gen_xmlNodePtr(n_cur, 1);
46420
46421        ret_val = xmlXPathNextSelf(ctxt, cur);
46422        desret_xmlNodePtr(ret_val);
46423        call_tests++;
46424        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46425        des_xmlNodePtr(n_cur, cur, 1);
46426        xmlResetLastError();
46427        if (mem_base != xmlMemBlocks()) {
46428            printf("Leak of %d blocks found in xmlXPathNextSelf",
46429	           xmlMemBlocks() - mem_base);
46430	    test_ret++;
46431            printf(" %d", n_ctxt);
46432            printf(" %d", n_cur);
46433            printf("\n");
46434        }
46435    }
46436    }
46437    function_tests++;
46438#endif
46439
46440    return(test_ret);
46441}
46442
46443
46444static int
46445test_xmlXPathNodeLeading(void) {
46446    int test_ret = 0;
46447
46448#if defined(LIBXML_XPATH_ENABLED)
46449    int mem_base;
46450    xmlNodeSetPtr ret_val;
46451    xmlNodeSetPtr nodes; /* a node-set */
46452    int n_nodes;
46453    xmlNodePtr node; /* a node */
46454    int n_node;
46455
46456    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46457    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46458        mem_base = xmlMemBlocks();
46459        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46460        node = gen_xmlNodePtr(n_node, 1);
46461
46462        ret_val = xmlXPathNodeLeading(nodes, node);
46463        desret_xmlNodeSetPtr(ret_val);
46464        call_tests++;
46465        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46466        des_xmlNodePtr(n_node, node, 1);
46467        xmlResetLastError();
46468        if (mem_base != xmlMemBlocks()) {
46469            printf("Leak of %d blocks found in xmlXPathNodeLeading",
46470	           xmlMemBlocks() - mem_base);
46471	    test_ret++;
46472            printf(" %d", n_nodes);
46473            printf(" %d", n_node);
46474            printf("\n");
46475        }
46476    }
46477    }
46478    function_tests++;
46479#endif
46480
46481    return(test_ret);
46482}
46483
46484
46485static int
46486test_xmlXPathNodeLeadingSorted(void) {
46487    int test_ret = 0;
46488
46489#if defined(LIBXML_XPATH_ENABLED)
46490    int mem_base;
46491    xmlNodeSetPtr ret_val;
46492    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46493    int n_nodes;
46494    xmlNodePtr node; /* a node */
46495    int n_node;
46496
46497    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46498    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46499        mem_base = xmlMemBlocks();
46500        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46501        node = gen_xmlNodePtr(n_node, 1);
46502
46503        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
46504        desret_xmlNodeSetPtr(ret_val);
46505        call_tests++;
46506        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46507        des_xmlNodePtr(n_node, node, 1);
46508        xmlResetLastError();
46509        if (mem_base != xmlMemBlocks()) {
46510            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
46511	           xmlMemBlocks() - mem_base);
46512	    test_ret++;
46513            printf(" %d", n_nodes);
46514            printf(" %d", n_node);
46515            printf("\n");
46516        }
46517    }
46518    }
46519    function_tests++;
46520#endif
46521
46522    return(test_ret);
46523}
46524
46525
46526static int
46527test_xmlXPathNodeSetAdd(void) {
46528    int test_ret = 0;
46529
46530#if defined(LIBXML_XPATH_ENABLED)
46531    int mem_base;
46532    xmlNodeSetPtr cur; /* the initial node set */
46533    int n_cur;
46534    xmlNodePtr val; /* a new xmlNodePtr */
46535    int n_val;
46536
46537    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46538    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46539        mem_base = xmlMemBlocks();
46540        cur = gen_xmlNodeSetPtr(n_cur, 0);
46541        val = gen_xmlNodePtr(n_val, 1);
46542
46543        xmlXPathNodeSetAdd(cur, val);
46544        call_tests++;
46545        des_xmlNodeSetPtr(n_cur, cur, 0);
46546        des_xmlNodePtr(n_val, val, 1);
46547        xmlResetLastError();
46548        if (mem_base != xmlMemBlocks()) {
46549            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
46550	           xmlMemBlocks() - mem_base);
46551	    test_ret++;
46552            printf(" %d", n_cur);
46553            printf(" %d", n_val);
46554            printf("\n");
46555        }
46556    }
46557    }
46558    function_tests++;
46559#endif
46560
46561    return(test_ret);
46562}
46563
46564
46565static int
46566test_xmlXPathNodeSetAddNs(void) {
46567    int test_ret = 0;
46568
46569#if defined(LIBXML_XPATH_ENABLED)
46570    int mem_base;
46571    xmlNodeSetPtr cur; /* the initial node set */
46572    int n_cur;
46573    xmlNodePtr node; /* the hosting node */
46574    int n_node;
46575    xmlNsPtr ns; /* a the namespace node */
46576    int n_ns;
46577
46578    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46579    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46580    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
46581        mem_base = xmlMemBlocks();
46582        cur = gen_xmlNodeSetPtr(n_cur, 0);
46583        node = gen_xmlNodePtr(n_node, 1);
46584        ns = gen_xmlNsPtr(n_ns, 2);
46585
46586        xmlXPathNodeSetAddNs(cur, node, ns);
46587        call_tests++;
46588        des_xmlNodeSetPtr(n_cur, cur, 0);
46589        des_xmlNodePtr(n_node, node, 1);
46590        des_xmlNsPtr(n_ns, ns, 2);
46591        xmlResetLastError();
46592        if (mem_base != xmlMemBlocks()) {
46593            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
46594	           xmlMemBlocks() - mem_base);
46595	    test_ret++;
46596            printf(" %d", n_cur);
46597            printf(" %d", n_node);
46598            printf(" %d", n_ns);
46599            printf("\n");
46600        }
46601    }
46602    }
46603    }
46604    function_tests++;
46605#endif
46606
46607    return(test_ret);
46608}
46609
46610
46611static int
46612test_xmlXPathNodeSetAddUnique(void) {
46613    int test_ret = 0;
46614
46615#if defined(LIBXML_XPATH_ENABLED)
46616    int mem_base;
46617    xmlNodeSetPtr cur; /* the initial node set */
46618    int n_cur;
46619    xmlNodePtr val; /* a new xmlNodePtr */
46620    int n_val;
46621
46622    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46623    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46624        mem_base = xmlMemBlocks();
46625        cur = gen_xmlNodeSetPtr(n_cur, 0);
46626        val = gen_xmlNodePtr(n_val, 1);
46627
46628        xmlXPathNodeSetAddUnique(cur, val);
46629        call_tests++;
46630        des_xmlNodeSetPtr(n_cur, cur, 0);
46631        des_xmlNodePtr(n_val, val, 1);
46632        xmlResetLastError();
46633        if (mem_base != xmlMemBlocks()) {
46634            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
46635	           xmlMemBlocks() - mem_base);
46636	    test_ret++;
46637            printf(" %d", n_cur);
46638            printf(" %d", n_val);
46639            printf("\n");
46640        }
46641    }
46642    }
46643    function_tests++;
46644#endif
46645
46646    return(test_ret);
46647}
46648
46649
46650static int
46651test_xmlXPathNodeSetContains(void) {
46652    int test_ret = 0;
46653
46654#if defined(LIBXML_XPATH_ENABLED)
46655    int mem_base;
46656    int ret_val;
46657    xmlNodeSetPtr cur; /* the node-set */
46658    int n_cur;
46659    xmlNodePtr val; /* the node */
46660    int n_val;
46661
46662    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46663    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46664        mem_base = xmlMemBlocks();
46665        cur = gen_xmlNodeSetPtr(n_cur, 0);
46666        val = gen_xmlNodePtr(n_val, 1);
46667
46668        ret_val = xmlXPathNodeSetContains(cur, val);
46669        desret_int(ret_val);
46670        call_tests++;
46671        des_xmlNodeSetPtr(n_cur, cur, 0);
46672        des_xmlNodePtr(n_val, val, 1);
46673        xmlResetLastError();
46674        if (mem_base != xmlMemBlocks()) {
46675            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
46676	           xmlMemBlocks() - mem_base);
46677	    test_ret++;
46678            printf(" %d", n_cur);
46679            printf(" %d", n_val);
46680            printf("\n");
46681        }
46682    }
46683    }
46684    function_tests++;
46685#endif
46686
46687    return(test_ret);
46688}
46689
46690
46691static int
46692test_xmlXPathNodeSetDel(void) {
46693    int test_ret = 0;
46694
46695#if defined(LIBXML_XPATH_ENABLED)
46696    int mem_base;
46697    xmlNodeSetPtr cur; /* the initial node set */
46698    int n_cur;
46699    xmlNodePtr val; /* an xmlNodePtr */
46700    int n_val;
46701
46702    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46703    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46704        mem_base = xmlMemBlocks();
46705        cur = gen_xmlNodeSetPtr(n_cur, 0);
46706        val = gen_xmlNodePtr(n_val, 1);
46707
46708        xmlXPathNodeSetDel(cur, val);
46709        call_tests++;
46710        des_xmlNodeSetPtr(n_cur, cur, 0);
46711        des_xmlNodePtr(n_val, val, 1);
46712        xmlResetLastError();
46713        if (mem_base != xmlMemBlocks()) {
46714            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
46715	           xmlMemBlocks() - mem_base);
46716	    test_ret++;
46717            printf(" %d", n_cur);
46718            printf(" %d", n_val);
46719            printf("\n");
46720        }
46721    }
46722    }
46723    function_tests++;
46724#endif
46725
46726    return(test_ret);
46727}
46728
46729
46730static int
46731test_xmlXPathNodeSetMerge(void) {
46732    int test_ret = 0;
46733
46734#if defined(LIBXML_XPATH_ENABLED)
46735    int mem_base;
46736    xmlNodeSetPtr ret_val;
46737    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
46738    int n_val1;
46739    xmlNodeSetPtr val2; /* the second NodeSet */
46740    int n_val2;
46741
46742    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
46743    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
46744        mem_base = xmlMemBlocks();
46745        val1 = gen_xmlNodeSetPtr(n_val1, 0);
46746        val2 = gen_xmlNodeSetPtr(n_val2, 1);
46747
46748        ret_val = xmlXPathNodeSetMerge(val1, val2);
46749        desret_xmlNodeSetPtr(ret_val);
46750        call_tests++;
46751        des_xmlNodeSetPtr(n_val1, val1, 0);
46752        des_xmlNodeSetPtr(n_val2, val2, 1);
46753        xmlResetLastError();
46754        if (mem_base != xmlMemBlocks()) {
46755            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
46756	           xmlMemBlocks() - mem_base);
46757	    test_ret++;
46758            printf(" %d", n_val1);
46759            printf(" %d", n_val2);
46760            printf("\n");
46761        }
46762    }
46763    }
46764    function_tests++;
46765#endif
46766
46767    return(test_ret);
46768}
46769
46770
46771static int
46772test_xmlXPathNodeSetRemove(void) {
46773    int test_ret = 0;
46774
46775#if defined(LIBXML_XPATH_ENABLED)
46776    int mem_base;
46777    xmlNodeSetPtr cur; /* the initial node set */
46778    int n_cur;
46779    int val; /* the index to remove */
46780    int n_val;
46781
46782    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46783    for (n_val = 0;n_val < gen_nb_int;n_val++) {
46784        mem_base = xmlMemBlocks();
46785        cur = gen_xmlNodeSetPtr(n_cur, 0);
46786        val = gen_int(n_val, 1);
46787
46788        xmlXPathNodeSetRemove(cur, val);
46789        call_tests++;
46790        des_xmlNodeSetPtr(n_cur, cur, 0);
46791        des_int(n_val, val, 1);
46792        xmlResetLastError();
46793        if (mem_base != xmlMemBlocks()) {
46794            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
46795	           xmlMemBlocks() - mem_base);
46796	    test_ret++;
46797            printf(" %d", n_cur);
46798            printf(" %d", n_val);
46799            printf("\n");
46800        }
46801    }
46802    }
46803    function_tests++;
46804#endif
46805
46806    return(test_ret);
46807}
46808
46809
46810static int
46811test_xmlXPathNodeSetSort(void) {
46812    int test_ret = 0;
46813
46814#if defined(LIBXML_XPATH_ENABLED)
46815    int mem_base;
46816    xmlNodeSetPtr set; /* the node set */
46817    int n_set;
46818
46819    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
46820        mem_base = xmlMemBlocks();
46821        set = gen_xmlNodeSetPtr(n_set, 0);
46822
46823        xmlXPathNodeSetSort(set);
46824        call_tests++;
46825        des_xmlNodeSetPtr(n_set, set, 0);
46826        xmlResetLastError();
46827        if (mem_base != xmlMemBlocks()) {
46828            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
46829	           xmlMemBlocks() - mem_base);
46830	    test_ret++;
46831            printf(" %d", n_set);
46832            printf("\n");
46833        }
46834    }
46835    function_tests++;
46836#endif
46837
46838    return(test_ret);
46839}
46840
46841
46842static int
46843test_xmlXPathNodeTrailing(void) {
46844    int test_ret = 0;
46845
46846#if defined(LIBXML_XPATH_ENABLED)
46847    int mem_base;
46848    xmlNodeSetPtr ret_val;
46849    xmlNodeSetPtr nodes; /* a node-set */
46850    int n_nodes;
46851    xmlNodePtr node; /* a node */
46852    int n_node;
46853
46854    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46855    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46856        mem_base = xmlMemBlocks();
46857        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46858        node = gen_xmlNodePtr(n_node, 1);
46859
46860        ret_val = xmlXPathNodeTrailing(nodes, node);
46861        desret_xmlNodeSetPtr(ret_val);
46862        call_tests++;
46863        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46864        des_xmlNodePtr(n_node, node, 1);
46865        xmlResetLastError();
46866        if (mem_base != xmlMemBlocks()) {
46867            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
46868	           xmlMemBlocks() - mem_base);
46869	    test_ret++;
46870            printf(" %d", n_nodes);
46871            printf(" %d", n_node);
46872            printf("\n");
46873        }
46874    }
46875    }
46876    function_tests++;
46877#endif
46878
46879    return(test_ret);
46880}
46881
46882
46883static int
46884test_xmlXPathNodeTrailingSorted(void) {
46885    int test_ret = 0;
46886
46887#if defined(LIBXML_XPATH_ENABLED)
46888    int mem_base;
46889    xmlNodeSetPtr ret_val;
46890    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46891    int n_nodes;
46892    xmlNodePtr node; /* a node */
46893    int n_node;
46894
46895    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46896    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46897        mem_base = xmlMemBlocks();
46898        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46899        node = gen_xmlNodePtr(n_node, 1);
46900
46901        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
46902        desret_xmlNodeSetPtr(ret_val);
46903        call_tests++;
46904        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46905        des_xmlNodePtr(n_node, node, 1);
46906        xmlResetLastError();
46907        if (mem_base != xmlMemBlocks()) {
46908            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
46909	           xmlMemBlocks() - mem_base);
46910	    test_ret++;
46911            printf(" %d", n_nodes);
46912            printf(" %d", n_node);
46913            printf("\n");
46914        }
46915    }
46916    }
46917    function_tests++;
46918#endif
46919
46920    return(test_ret);
46921}
46922
46923
46924static int
46925test_xmlXPathNormalizeFunction(void) {
46926    int test_ret = 0;
46927
46928#if defined(LIBXML_XPATH_ENABLED)
46929    int mem_base;
46930    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46931    int n_ctxt;
46932    int nargs; /* the number of arguments */
46933    int n_nargs;
46934
46935    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46936    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46937        mem_base = xmlMemBlocks();
46938        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46939        nargs = gen_int(n_nargs, 1);
46940
46941        xmlXPathNormalizeFunction(ctxt, nargs);
46942        call_tests++;
46943        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46944        des_int(n_nargs, nargs, 1);
46945        xmlResetLastError();
46946        if (mem_base != xmlMemBlocks()) {
46947            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
46948	           xmlMemBlocks() - mem_base);
46949	    test_ret++;
46950            printf(" %d", n_ctxt);
46951            printf(" %d", n_nargs);
46952            printf("\n");
46953        }
46954    }
46955    }
46956    function_tests++;
46957#endif
46958
46959    return(test_ret);
46960}
46961
46962
46963static int
46964test_xmlXPathNotEqualValues(void) {
46965    int test_ret = 0;
46966
46967#if defined(LIBXML_XPATH_ENABLED)
46968    int mem_base;
46969    int ret_val;
46970    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46971    int n_ctxt;
46972
46973    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46974        mem_base = xmlMemBlocks();
46975        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46976
46977        ret_val = xmlXPathNotEqualValues(ctxt);
46978        desret_int(ret_val);
46979        call_tests++;
46980        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46981        xmlResetLastError();
46982        if (mem_base != xmlMemBlocks()) {
46983            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
46984	           xmlMemBlocks() - mem_base);
46985	    test_ret++;
46986            printf(" %d", n_ctxt);
46987            printf("\n");
46988        }
46989    }
46990    function_tests++;
46991#endif
46992
46993    return(test_ret);
46994}
46995
46996
46997static int
46998test_xmlXPathNotFunction(void) {
46999    int test_ret = 0;
47000
47001#if defined(LIBXML_XPATH_ENABLED)
47002    int mem_base;
47003    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47004    int n_ctxt;
47005    int nargs; /* the number of arguments */
47006    int n_nargs;
47007
47008    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47009    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47010        mem_base = xmlMemBlocks();
47011        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47012        nargs = gen_int(n_nargs, 1);
47013
47014        xmlXPathNotFunction(ctxt, nargs);
47015        call_tests++;
47016        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47017        des_int(n_nargs, nargs, 1);
47018        xmlResetLastError();
47019        if (mem_base != xmlMemBlocks()) {
47020            printf("Leak of %d blocks found in xmlXPathNotFunction",
47021	           xmlMemBlocks() - mem_base);
47022	    test_ret++;
47023            printf(" %d", n_ctxt);
47024            printf(" %d", n_nargs);
47025            printf("\n");
47026        }
47027    }
47028    }
47029    function_tests++;
47030#endif
47031
47032    return(test_ret);
47033}
47034
47035
47036static int
47037test_xmlXPathNsLookup(void) {
47038    int test_ret = 0;
47039
47040#if defined(LIBXML_XPATH_ENABLED)
47041    int mem_base;
47042    const xmlChar * ret_val;
47043    xmlXPathContextPtr ctxt; /* the XPath context */
47044    int n_ctxt;
47045    xmlChar * prefix; /* the namespace prefix value */
47046    int n_prefix;
47047
47048    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47049    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
47050        mem_base = xmlMemBlocks();
47051        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47052        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
47053
47054        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
47055        desret_const_xmlChar_ptr(ret_val);
47056        call_tests++;
47057        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47058        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
47059        xmlResetLastError();
47060        if (mem_base != xmlMemBlocks()) {
47061            printf("Leak of %d blocks found in xmlXPathNsLookup",
47062	           xmlMemBlocks() - mem_base);
47063	    test_ret++;
47064            printf(" %d", n_ctxt);
47065            printf(" %d", n_prefix);
47066            printf("\n");
47067        }
47068    }
47069    }
47070    function_tests++;
47071#endif
47072
47073    return(test_ret);
47074}
47075
47076
47077static int
47078test_xmlXPathNumberFunction(void) {
47079    int test_ret = 0;
47080
47081#if defined(LIBXML_XPATH_ENABLED)
47082    int mem_base;
47083    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47084    int n_ctxt;
47085    int nargs; /* the number of arguments */
47086    int n_nargs;
47087
47088    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47089    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47090        mem_base = xmlMemBlocks();
47091        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47092        nargs = gen_int(n_nargs, 1);
47093
47094        xmlXPathNumberFunction(ctxt, nargs);
47095        call_tests++;
47096        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47097        des_int(n_nargs, nargs, 1);
47098        xmlResetLastError();
47099        if (mem_base != xmlMemBlocks()) {
47100            printf("Leak of %d blocks found in xmlXPathNumberFunction",
47101	           xmlMemBlocks() - mem_base);
47102	    test_ret++;
47103            printf(" %d", n_ctxt);
47104            printf(" %d", n_nargs);
47105            printf("\n");
47106        }
47107    }
47108    }
47109    function_tests++;
47110#endif
47111
47112    return(test_ret);
47113}
47114
47115
47116static int
47117test_xmlXPathParseNCName(void) {
47118    int test_ret = 0;
47119
47120#if defined(LIBXML_XPATH_ENABLED)
47121    int mem_base;
47122    xmlChar * ret_val;
47123    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47124    int n_ctxt;
47125
47126    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47127        mem_base = xmlMemBlocks();
47128        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47129
47130        ret_val = xmlXPathParseNCName(ctxt);
47131        desret_xmlChar_ptr(ret_val);
47132        call_tests++;
47133        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47134        xmlResetLastError();
47135        if (mem_base != xmlMemBlocks()) {
47136            printf("Leak of %d blocks found in xmlXPathParseNCName",
47137	           xmlMemBlocks() - mem_base);
47138	    test_ret++;
47139            printf(" %d", n_ctxt);
47140            printf("\n");
47141        }
47142    }
47143    function_tests++;
47144#endif
47145
47146    return(test_ret);
47147}
47148
47149
47150static int
47151test_xmlXPathParseName(void) {
47152    int test_ret = 0;
47153
47154#if defined(LIBXML_XPATH_ENABLED)
47155    int mem_base;
47156    xmlChar * ret_val;
47157    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47158    int n_ctxt;
47159
47160    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47161        mem_base = xmlMemBlocks();
47162        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47163
47164        ret_val = xmlXPathParseName(ctxt);
47165        desret_xmlChar_ptr(ret_val);
47166        call_tests++;
47167        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47168        xmlResetLastError();
47169        if (mem_base != xmlMemBlocks()) {
47170            printf("Leak of %d blocks found in xmlXPathParseName",
47171	           xmlMemBlocks() - mem_base);
47172	    test_ret++;
47173            printf(" %d", n_ctxt);
47174            printf("\n");
47175        }
47176    }
47177    function_tests++;
47178#endif
47179
47180    return(test_ret);
47181}
47182
47183
47184static int
47185test_xmlXPathPopBoolean(void) {
47186    int test_ret = 0;
47187
47188#if defined(LIBXML_XPATH_ENABLED)
47189    int mem_base;
47190    int ret_val;
47191    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47192    int n_ctxt;
47193
47194    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47195        mem_base = xmlMemBlocks();
47196        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47197
47198        ret_val = xmlXPathPopBoolean(ctxt);
47199        desret_int(ret_val);
47200        call_tests++;
47201        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47202        xmlResetLastError();
47203        if (mem_base != xmlMemBlocks()) {
47204            printf("Leak of %d blocks found in xmlXPathPopBoolean",
47205	           xmlMemBlocks() - mem_base);
47206	    test_ret++;
47207            printf(" %d", n_ctxt);
47208            printf("\n");
47209        }
47210    }
47211    function_tests++;
47212#endif
47213
47214    return(test_ret);
47215}
47216
47217
47218static int
47219test_xmlXPathPopExternal(void) {
47220    int test_ret = 0;
47221
47222#if defined(LIBXML_XPATH_ENABLED)
47223    int mem_base;
47224    void * ret_val;
47225    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47226    int n_ctxt;
47227
47228    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47229        mem_base = xmlMemBlocks();
47230        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47231
47232        ret_val = xmlXPathPopExternal(ctxt);
47233        desret_void_ptr(ret_val);
47234        call_tests++;
47235        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47236        xmlResetLastError();
47237        if (mem_base != xmlMemBlocks()) {
47238            printf("Leak of %d blocks found in xmlXPathPopExternal",
47239	           xmlMemBlocks() - mem_base);
47240	    test_ret++;
47241            printf(" %d", n_ctxt);
47242            printf("\n");
47243        }
47244    }
47245    function_tests++;
47246#endif
47247
47248    return(test_ret);
47249}
47250
47251
47252static int
47253test_xmlXPathPopNodeSet(void) {
47254    int test_ret = 0;
47255
47256#if defined(LIBXML_XPATH_ENABLED)
47257    int mem_base;
47258    xmlNodeSetPtr ret_val;
47259    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47260    int n_ctxt;
47261
47262    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47263        mem_base = xmlMemBlocks();
47264        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47265
47266        ret_val = xmlXPathPopNodeSet(ctxt);
47267        desret_xmlNodeSetPtr(ret_val);
47268        call_tests++;
47269        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47270        xmlResetLastError();
47271        if (mem_base != xmlMemBlocks()) {
47272            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
47273	           xmlMemBlocks() - mem_base);
47274	    test_ret++;
47275            printf(" %d", n_ctxt);
47276            printf("\n");
47277        }
47278    }
47279    function_tests++;
47280#endif
47281
47282    return(test_ret);
47283}
47284
47285
47286static int
47287test_xmlXPathPopNumber(void) {
47288    int test_ret = 0;
47289
47290#if defined(LIBXML_XPATH_ENABLED)
47291    int mem_base;
47292    double ret_val;
47293    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47294    int n_ctxt;
47295
47296    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47297        mem_base = xmlMemBlocks();
47298        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47299
47300        ret_val = xmlXPathPopNumber(ctxt);
47301        desret_double(ret_val);
47302        call_tests++;
47303        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47304        xmlResetLastError();
47305        if (mem_base != xmlMemBlocks()) {
47306            printf("Leak of %d blocks found in xmlXPathPopNumber",
47307	           xmlMemBlocks() - mem_base);
47308	    test_ret++;
47309            printf(" %d", n_ctxt);
47310            printf("\n");
47311        }
47312    }
47313    function_tests++;
47314#endif
47315
47316    return(test_ret);
47317}
47318
47319
47320static int
47321test_xmlXPathPopString(void) {
47322    int test_ret = 0;
47323
47324#if defined(LIBXML_XPATH_ENABLED)
47325    int mem_base;
47326    xmlChar * ret_val;
47327    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47328    int n_ctxt;
47329
47330    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47331        mem_base = xmlMemBlocks();
47332        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47333
47334        ret_val = xmlXPathPopString(ctxt);
47335        desret_xmlChar_ptr(ret_val);
47336        call_tests++;
47337        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47338        xmlResetLastError();
47339        if (mem_base != xmlMemBlocks()) {
47340            printf("Leak of %d blocks found in xmlXPathPopString",
47341	           xmlMemBlocks() - mem_base);
47342	    test_ret++;
47343            printf(" %d", n_ctxt);
47344            printf("\n");
47345        }
47346    }
47347    function_tests++;
47348#endif
47349
47350    return(test_ret);
47351}
47352
47353
47354static int
47355test_xmlXPathPositionFunction(void) {
47356    int test_ret = 0;
47357
47358#if defined(LIBXML_XPATH_ENABLED)
47359    int mem_base;
47360    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47361    int n_ctxt;
47362    int nargs; /* the number of arguments */
47363    int n_nargs;
47364
47365    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47366    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47367        mem_base = xmlMemBlocks();
47368        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47369        nargs = gen_int(n_nargs, 1);
47370
47371        xmlXPathPositionFunction(ctxt, nargs);
47372        call_tests++;
47373        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47374        des_int(n_nargs, nargs, 1);
47375        xmlResetLastError();
47376        if (mem_base != xmlMemBlocks()) {
47377            printf("Leak of %d blocks found in xmlXPathPositionFunction",
47378	           xmlMemBlocks() - mem_base);
47379	    test_ret++;
47380            printf(" %d", n_ctxt);
47381            printf(" %d", n_nargs);
47382            printf("\n");
47383        }
47384    }
47385    }
47386    function_tests++;
47387#endif
47388
47389    return(test_ret);
47390}
47391
47392
47393static int
47394test_xmlXPathRegisterAllFunctions(void) {
47395    int test_ret = 0;
47396
47397#if defined(LIBXML_XPATH_ENABLED)
47398    int mem_base;
47399    xmlXPathContextPtr ctxt; /* the XPath context */
47400    int n_ctxt;
47401
47402    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47403        mem_base = xmlMemBlocks();
47404        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47405
47406        xmlXPathRegisterAllFunctions(ctxt);
47407        call_tests++;
47408        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47409        xmlResetLastError();
47410        if (mem_base != xmlMemBlocks()) {
47411            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
47412	           xmlMemBlocks() - mem_base);
47413	    test_ret++;
47414            printf(" %d", n_ctxt);
47415            printf("\n");
47416        }
47417    }
47418    function_tests++;
47419#endif
47420
47421    return(test_ret);
47422}
47423
47424
47425static int
47426test_xmlXPathRegisterFunc(void) {
47427    int test_ret = 0;
47428
47429
47430    /* missing type support */
47431    return(test_ret);
47432}
47433
47434
47435static int
47436test_xmlXPathRegisterFuncLookup(void) {
47437    int test_ret = 0;
47438
47439
47440    /* missing type support */
47441    return(test_ret);
47442}
47443
47444
47445static int
47446test_xmlXPathRegisterFuncNS(void) {
47447    int test_ret = 0;
47448
47449
47450    /* missing type support */
47451    return(test_ret);
47452}
47453
47454
47455static int
47456test_xmlXPathRegisterNs(void) {
47457    int test_ret = 0;
47458
47459#if defined(LIBXML_XPATH_ENABLED)
47460    int mem_base;
47461    int ret_val;
47462    xmlXPathContextPtr ctxt; /* the XPath context */
47463    int n_ctxt;
47464    xmlChar * prefix; /* the namespace prefix */
47465    int n_prefix;
47466    xmlChar * ns_uri; /* the namespace name */
47467    int n_ns_uri;
47468
47469    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47470    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
47471    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
47472        mem_base = xmlMemBlocks();
47473        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47474        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
47475        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
47476
47477        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
47478        desret_int(ret_val);
47479        call_tests++;
47480        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47481        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
47482        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
47483        xmlResetLastError();
47484        if (mem_base != xmlMemBlocks()) {
47485            printf("Leak of %d blocks found in xmlXPathRegisterNs",
47486	           xmlMemBlocks() - mem_base);
47487	    test_ret++;
47488            printf(" %d", n_ctxt);
47489            printf(" %d", n_prefix);
47490            printf(" %d", n_ns_uri);
47491            printf("\n");
47492        }
47493    }
47494    }
47495    }
47496    function_tests++;
47497#endif
47498
47499    return(test_ret);
47500}
47501
47502
47503static int
47504test_xmlXPathRegisterVariable(void) {
47505    int test_ret = 0;
47506
47507#if defined(LIBXML_XPATH_ENABLED)
47508    int mem_base;
47509    int ret_val;
47510    xmlXPathContextPtr ctxt; /* the XPath context */
47511    int n_ctxt;
47512    xmlChar * name; /* the variable name */
47513    int n_name;
47514    xmlXPathObjectPtr value; /* the variable value or NULL */
47515    int n_value;
47516
47517    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47518    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47519    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47520        mem_base = xmlMemBlocks();
47521        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47522        name = gen_const_xmlChar_ptr(n_name, 1);
47523        value = gen_xmlXPathObjectPtr(n_value, 2);
47524
47525        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
47526        desret_int(ret_val);
47527        call_tests++;
47528        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47529        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
47530        des_xmlXPathObjectPtr(n_value, value, 2);
47531        xmlResetLastError();
47532        if (mem_base != xmlMemBlocks()) {
47533            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
47534	           xmlMemBlocks() - mem_base);
47535	    test_ret++;
47536            printf(" %d", n_ctxt);
47537            printf(" %d", n_name);
47538            printf(" %d", n_value);
47539            printf("\n");
47540        }
47541    }
47542    }
47543    }
47544    function_tests++;
47545#endif
47546
47547    return(test_ret);
47548}
47549
47550
47551static int
47552test_xmlXPathRegisterVariableLookup(void) {
47553    int test_ret = 0;
47554
47555
47556    /* missing type support */
47557    return(test_ret);
47558}
47559
47560
47561static int
47562test_xmlXPathRegisterVariableNS(void) {
47563    int test_ret = 0;
47564
47565#if defined(LIBXML_XPATH_ENABLED)
47566    int mem_base;
47567    int ret_val;
47568    xmlXPathContextPtr ctxt; /* the XPath context */
47569    int n_ctxt;
47570    xmlChar * name; /* the variable name */
47571    int n_name;
47572    xmlChar * ns_uri; /* the variable namespace URI */
47573    int n_ns_uri;
47574    xmlXPathObjectPtr value; /* the variable value or NULL */
47575    int n_value;
47576
47577    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47578    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47579    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
47580    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47581        mem_base = xmlMemBlocks();
47582        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47583        name = gen_const_xmlChar_ptr(n_name, 1);
47584        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
47585        value = gen_xmlXPathObjectPtr(n_value, 3);
47586
47587        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
47588        desret_int(ret_val);
47589        call_tests++;
47590        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47591        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
47592        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
47593        des_xmlXPathObjectPtr(n_value, value, 3);
47594        xmlResetLastError();
47595        if (mem_base != xmlMemBlocks()) {
47596            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
47597	           xmlMemBlocks() - mem_base);
47598	    test_ret++;
47599            printf(" %d", n_ctxt);
47600            printf(" %d", n_name);
47601            printf(" %d", n_ns_uri);
47602            printf(" %d", n_value);
47603            printf("\n");
47604        }
47605    }
47606    }
47607    }
47608    }
47609    function_tests++;
47610#endif
47611
47612    return(test_ret);
47613}
47614
47615
47616static int
47617test_xmlXPathRegisteredFuncsCleanup(void) {
47618    int test_ret = 0;
47619
47620#if defined(LIBXML_XPATH_ENABLED)
47621    int mem_base;
47622    xmlXPathContextPtr ctxt; /* the XPath context */
47623    int n_ctxt;
47624
47625    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47626        mem_base = xmlMemBlocks();
47627        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47628
47629        xmlXPathRegisteredFuncsCleanup(ctxt);
47630        call_tests++;
47631        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47632        xmlResetLastError();
47633        if (mem_base != xmlMemBlocks()) {
47634            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
47635	           xmlMemBlocks() - mem_base);
47636	    test_ret++;
47637            printf(" %d", n_ctxt);
47638            printf("\n");
47639        }
47640    }
47641    function_tests++;
47642#endif
47643
47644    return(test_ret);
47645}
47646
47647
47648static int
47649test_xmlXPathRegisteredNsCleanup(void) {
47650    int test_ret = 0;
47651
47652#if defined(LIBXML_XPATH_ENABLED)
47653    int mem_base;
47654    xmlXPathContextPtr ctxt; /* the XPath context */
47655    int n_ctxt;
47656
47657    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47658        mem_base = xmlMemBlocks();
47659        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47660
47661        xmlXPathRegisteredNsCleanup(ctxt);
47662        call_tests++;
47663        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47664        xmlResetLastError();
47665        if (mem_base != xmlMemBlocks()) {
47666            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
47667	           xmlMemBlocks() - mem_base);
47668	    test_ret++;
47669            printf(" %d", n_ctxt);
47670            printf("\n");
47671        }
47672    }
47673    function_tests++;
47674#endif
47675
47676    return(test_ret);
47677}
47678
47679
47680static int
47681test_xmlXPathRegisteredVariablesCleanup(void) {
47682    int test_ret = 0;
47683
47684#if defined(LIBXML_XPATH_ENABLED)
47685    int mem_base;
47686    xmlXPathContextPtr ctxt; /* the XPath context */
47687    int n_ctxt;
47688
47689    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47690        mem_base = xmlMemBlocks();
47691        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47692
47693        xmlXPathRegisteredVariablesCleanup(ctxt);
47694        call_tests++;
47695        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47696        xmlResetLastError();
47697        if (mem_base != xmlMemBlocks()) {
47698            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
47699	           xmlMemBlocks() - mem_base);
47700	    test_ret++;
47701            printf(" %d", n_ctxt);
47702            printf("\n");
47703        }
47704    }
47705    function_tests++;
47706#endif
47707
47708    return(test_ret);
47709}
47710
47711
47712static int
47713test_xmlXPathRoot(void) {
47714    int test_ret = 0;
47715
47716#if defined(LIBXML_XPATH_ENABLED)
47717    int mem_base;
47718    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47719    int n_ctxt;
47720
47721    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47722        mem_base = xmlMemBlocks();
47723        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47724
47725        xmlXPathRoot(ctxt);
47726        call_tests++;
47727        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47728        xmlResetLastError();
47729        if (mem_base != xmlMemBlocks()) {
47730            printf("Leak of %d blocks found in xmlXPathRoot",
47731	           xmlMemBlocks() - mem_base);
47732	    test_ret++;
47733            printf(" %d", n_ctxt);
47734            printf("\n");
47735        }
47736    }
47737    function_tests++;
47738#endif
47739
47740    return(test_ret);
47741}
47742
47743
47744static int
47745test_xmlXPathRoundFunction(void) {
47746    int test_ret = 0;
47747
47748#if defined(LIBXML_XPATH_ENABLED)
47749    int mem_base;
47750    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47751    int n_ctxt;
47752    int nargs; /* the number of arguments */
47753    int n_nargs;
47754
47755    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47756    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47757        mem_base = xmlMemBlocks();
47758        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47759        nargs = gen_int(n_nargs, 1);
47760
47761        xmlXPathRoundFunction(ctxt, nargs);
47762        call_tests++;
47763        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47764        des_int(n_nargs, nargs, 1);
47765        xmlResetLastError();
47766        if (mem_base != xmlMemBlocks()) {
47767            printf("Leak of %d blocks found in xmlXPathRoundFunction",
47768	           xmlMemBlocks() - mem_base);
47769	    test_ret++;
47770            printf(" %d", n_ctxt);
47771            printf(" %d", n_nargs);
47772            printf("\n");
47773        }
47774    }
47775    }
47776    function_tests++;
47777#endif
47778
47779    return(test_ret);
47780}
47781
47782
47783static int
47784test_xmlXPathStartsWithFunction(void) {
47785    int test_ret = 0;
47786
47787#if defined(LIBXML_XPATH_ENABLED)
47788    int mem_base;
47789    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47790    int n_ctxt;
47791    int nargs; /* the number of arguments */
47792    int n_nargs;
47793
47794    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47795    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47796        mem_base = xmlMemBlocks();
47797        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47798        nargs = gen_int(n_nargs, 1);
47799
47800        xmlXPathStartsWithFunction(ctxt, nargs);
47801        call_tests++;
47802        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47803        des_int(n_nargs, nargs, 1);
47804        xmlResetLastError();
47805        if (mem_base != xmlMemBlocks()) {
47806            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
47807	           xmlMemBlocks() - mem_base);
47808	    test_ret++;
47809            printf(" %d", n_ctxt);
47810            printf(" %d", n_nargs);
47811            printf("\n");
47812        }
47813    }
47814    }
47815    function_tests++;
47816#endif
47817
47818    return(test_ret);
47819}
47820
47821
47822static int
47823test_xmlXPathStringEvalNumber(void) {
47824    int test_ret = 0;
47825
47826#if defined(LIBXML_XPATH_ENABLED)
47827    int mem_base;
47828    double ret_val;
47829    xmlChar * str; /* A string to scan */
47830    int n_str;
47831
47832    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47833        mem_base = xmlMemBlocks();
47834        str = gen_const_xmlChar_ptr(n_str, 0);
47835
47836        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
47837        desret_double(ret_val);
47838        call_tests++;
47839        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
47840        xmlResetLastError();
47841        if (mem_base != xmlMemBlocks()) {
47842            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
47843	           xmlMemBlocks() - mem_base);
47844	    test_ret++;
47845            printf(" %d", n_str);
47846            printf("\n");
47847        }
47848    }
47849    function_tests++;
47850#endif
47851
47852    return(test_ret);
47853}
47854
47855
47856static int
47857test_xmlXPathStringFunction(void) {
47858    int test_ret = 0;
47859
47860#if defined(LIBXML_XPATH_ENABLED)
47861    int mem_base;
47862    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47863    int n_ctxt;
47864    int nargs; /* the number of arguments */
47865    int n_nargs;
47866
47867    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47868    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47869        mem_base = xmlMemBlocks();
47870        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47871        nargs = gen_int(n_nargs, 1);
47872
47873        xmlXPathStringFunction(ctxt, nargs);
47874        call_tests++;
47875        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47876        des_int(n_nargs, nargs, 1);
47877        xmlResetLastError();
47878        if (mem_base != xmlMemBlocks()) {
47879            printf("Leak of %d blocks found in xmlXPathStringFunction",
47880	           xmlMemBlocks() - mem_base);
47881	    test_ret++;
47882            printf(" %d", n_ctxt);
47883            printf(" %d", n_nargs);
47884            printf("\n");
47885        }
47886    }
47887    }
47888    function_tests++;
47889#endif
47890
47891    return(test_ret);
47892}
47893
47894
47895static int
47896test_xmlXPathStringLengthFunction(void) {
47897    int test_ret = 0;
47898
47899#if defined(LIBXML_XPATH_ENABLED)
47900    int mem_base;
47901    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47902    int n_ctxt;
47903    int nargs; /* the number of arguments */
47904    int n_nargs;
47905
47906    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47907    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47908        mem_base = xmlMemBlocks();
47909        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47910        nargs = gen_int(n_nargs, 1);
47911
47912        xmlXPathStringLengthFunction(ctxt, nargs);
47913        call_tests++;
47914        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47915        des_int(n_nargs, nargs, 1);
47916        xmlResetLastError();
47917        if (mem_base != xmlMemBlocks()) {
47918            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
47919	           xmlMemBlocks() - mem_base);
47920	    test_ret++;
47921            printf(" %d", n_ctxt);
47922            printf(" %d", n_nargs);
47923            printf("\n");
47924        }
47925    }
47926    }
47927    function_tests++;
47928#endif
47929
47930    return(test_ret);
47931}
47932
47933
47934static int
47935test_xmlXPathSubValues(void) {
47936    int test_ret = 0;
47937
47938#if defined(LIBXML_XPATH_ENABLED)
47939    int mem_base;
47940    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47941    int n_ctxt;
47942
47943    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47944        mem_base = xmlMemBlocks();
47945        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47946
47947        xmlXPathSubValues(ctxt);
47948        call_tests++;
47949        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47950        xmlResetLastError();
47951        if (mem_base != xmlMemBlocks()) {
47952            printf("Leak of %d blocks found in xmlXPathSubValues",
47953	           xmlMemBlocks() - mem_base);
47954	    test_ret++;
47955            printf(" %d", n_ctxt);
47956            printf("\n");
47957        }
47958    }
47959    function_tests++;
47960#endif
47961
47962    return(test_ret);
47963}
47964
47965
47966static int
47967test_xmlXPathSubstringAfterFunction(void) {
47968    int test_ret = 0;
47969
47970#if defined(LIBXML_XPATH_ENABLED)
47971    int mem_base;
47972    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47973    int n_ctxt;
47974    int nargs; /* the number of arguments */
47975    int n_nargs;
47976
47977    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47978    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47979        mem_base = xmlMemBlocks();
47980        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47981        nargs = gen_int(n_nargs, 1);
47982
47983        xmlXPathSubstringAfterFunction(ctxt, nargs);
47984        call_tests++;
47985        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47986        des_int(n_nargs, nargs, 1);
47987        xmlResetLastError();
47988        if (mem_base != xmlMemBlocks()) {
47989            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
47990	           xmlMemBlocks() - mem_base);
47991	    test_ret++;
47992            printf(" %d", n_ctxt);
47993            printf(" %d", n_nargs);
47994            printf("\n");
47995        }
47996    }
47997    }
47998    function_tests++;
47999#endif
48000
48001    return(test_ret);
48002}
48003
48004
48005static int
48006test_xmlXPathSubstringBeforeFunction(void) {
48007    int test_ret = 0;
48008
48009#if defined(LIBXML_XPATH_ENABLED)
48010    int mem_base;
48011    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48012    int n_ctxt;
48013    int nargs; /* the number of arguments */
48014    int n_nargs;
48015
48016    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48017    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48018        mem_base = xmlMemBlocks();
48019        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48020        nargs = gen_int(n_nargs, 1);
48021
48022        xmlXPathSubstringBeforeFunction(ctxt, nargs);
48023        call_tests++;
48024        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48025        des_int(n_nargs, nargs, 1);
48026        xmlResetLastError();
48027        if (mem_base != xmlMemBlocks()) {
48028            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
48029	           xmlMemBlocks() - mem_base);
48030	    test_ret++;
48031            printf(" %d", n_ctxt);
48032            printf(" %d", n_nargs);
48033            printf("\n");
48034        }
48035    }
48036    }
48037    function_tests++;
48038#endif
48039
48040    return(test_ret);
48041}
48042
48043
48044static int
48045test_xmlXPathSubstringFunction(void) {
48046    int test_ret = 0;
48047
48048#if defined(LIBXML_XPATH_ENABLED)
48049    int mem_base;
48050    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48051    int n_ctxt;
48052    int nargs; /* the number of arguments */
48053    int n_nargs;
48054
48055    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48056    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48057        mem_base = xmlMemBlocks();
48058        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48059        nargs = gen_int(n_nargs, 1);
48060
48061        xmlXPathSubstringFunction(ctxt, nargs);
48062        call_tests++;
48063        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48064        des_int(n_nargs, nargs, 1);
48065        xmlResetLastError();
48066        if (mem_base != xmlMemBlocks()) {
48067            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
48068	           xmlMemBlocks() - mem_base);
48069	    test_ret++;
48070            printf(" %d", n_ctxt);
48071            printf(" %d", n_nargs);
48072            printf("\n");
48073        }
48074    }
48075    }
48076    function_tests++;
48077#endif
48078
48079    return(test_ret);
48080}
48081
48082
48083static int
48084test_xmlXPathSumFunction(void) {
48085    int test_ret = 0;
48086
48087#if defined(LIBXML_XPATH_ENABLED)
48088    int mem_base;
48089    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48090    int n_ctxt;
48091    int nargs; /* the number of arguments */
48092    int n_nargs;
48093
48094    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48095    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48096        mem_base = xmlMemBlocks();
48097        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48098        nargs = gen_int(n_nargs, 1);
48099
48100        xmlXPathSumFunction(ctxt, nargs);
48101        call_tests++;
48102        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48103        des_int(n_nargs, nargs, 1);
48104        xmlResetLastError();
48105        if (mem_base != xmlMemBlocks()) {
48106            printf("Leak of %d blocks found in xmlXPathSumFunction",
48107	           xmlMemBlocks() - mem_base);
48108	    test_ret++;
48109            printf(" %d", n_ctxt);
48110            printf(" %d", n_nargs);
48111            printf("\n");
48112        }
48113    }
48114    }
48115    function_tests++;
48116#endif
48117
48118    return(test_ret);
48119}
48120
48121
48122static int
48123test_xmlXPathTrailing(void) {
48124    int test_ret = 0;
48125
48126#if defined(LIBXML_XPATH_ENABLED)
48127    int mem_base;
48128    xmlNodeSetPtr ret_val;
48129    xmlNodeSetPtr nodes1; /* a node-set */
48130    int n_nodes1;
48131    xmlNodeSetPtr nodes2; /* a node-set */
48132    int n_nodes2;
48133
48134    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48135    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48136        mem_base = xmlMemBlocks();
48137        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48138        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48139
48140        ret_val = xmlXPathTrailing(nodes1, nodes2);
48141        desret_xmlNodeSetPtr(ret_val);
48142        call_tests++;
48143        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48144        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48145        xmlResetLastError();
48146        if (mem_base != xmlMemBlocks()) {
48147            printf("Leak of %d blocks found in xmlXPathTrailing",
48148	           xmlMemBlocks() - mem_base);
48149	    test_ret++;
48150            printf(" %d", n_nodes1);
48151            printf(" %d", n_nodes2);
48152            printf("\n");
48153        }
48154    }
48155    }
48156    function_tests++;
48157#endif
48158
48159    return(test_ret);
48160}
48161
48162
48163static int
48164test_xmlXPathTrailingSorted(void) {
48165    int test_ret = 0;
48166
48167#if defined(LIBXML_XPATH_ENABLED)
48168    int mem_base;
48169    xmlNodeSetPtr ret_val;
48170    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48171    int n_nodes1;
48172    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48173    int n_nodes2;
48174
48175    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48176    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48177        mem_base = xmlMemBlocks();
48178        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48179        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48180
48181        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
48182        desret_xmlNodeSetPtr(ret_val);
48183        call_tests++;
48184        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48185        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48186        xmlResetLastError();
48187        if (mem_base != xmlMemBlocks()) {
48188            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
48189	           xmlMemBlocks() - mem_base);
48190	    test_ret++;
48191            printf(" %d", n_nodes1);
48192            printf(" %d", n_nodes2);
48193            printf("\n");
48194        }
48195    }
48196    }
48197    function_tests++;
48198#endif
48199
48200    return(test_ret);
48201}
48202
48203
48204static int
48205test_xmlXPathTranslateFunction(void) {
48206    int test_ret = 0;
48207
48208#if defined(LIBXML_XPATH_ENABLED)
48209    int mem_base;
48210    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48211    int n_ctxt;
48212    int nargs; /* the number of arguments */
48213    int n_nargs;
48214
48215    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48216    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48217        mem_base = xmlMemBlocks();
48218        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48219        nargs = gen_int(n_nargs, 1);
48220
48221        xmlXPathTranslateFunction(ctxt, nargs);
48222        call_tests++;
48223        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48224        des_int(n_nargs, nargs, 1);
48225        xmlResetLastError();
48226        if (mem_base != xmlMemBlocks()) {
48227            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
48228	           xmlMemBlocks() - mem_base);
48229	    test_ret++;
48230            printf(" %d", n_ctxt);
48231            printf(" %d", n_nargs);
48232            printf("\n");
48233        }
48234    }
48235    }
48236    function_tests++;
48237#endif
48238
48239    return(test_ret);
48240}
48241
48242
48243static int
48244test_xmlXPathTrueFunction(void) {
48245    int test_ret = 0;
48246
48247#if defined(LIBXML_XPATH_ENABLED)
48248    int mem_base;
48249    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48250    int n_ctxt;
48251    int nargs; /* the number of arguments */
48252    int n_nargs;
48253
48254    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48255    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48256        mem_base = xmlMemBlocks();
48257        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48258        nargs = gen_int(n_nargs, 1);
48259
48260        xmlXPathTrueFunction(ctxt, nargs);
48261        call_tests++;
48262        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48263        des_int(n_nargs, nargs, 1);
48264        xmlResetLastError();
48265        if (mem_base != xmlMemBlocks()) {
48266            printf("Leak of %d blocks found in xmlXPathTrueFunction",
48267	           xmlMemBlocks() - mem_base);
48268	    test_ret++;
48269            printf(" %d", n_ctxt);
48270            printf(" %d", n_nargs);
48271            printf("\n");
48272        }
48273    }
48274    }
48275    function_tests++;
48276#endif
48277
48278    return(test_ret);
48279}
48280
48281
48282static int
48283test_xmlXPathValueFlipSign(void) {
48284    int test_ret = 0;
48285
48286#if defined(LIBXML_XPATH_ENABLED)
48287    int mem_base;
48288    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48289    int n_ctxt;
48290
48291    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48292        mem_base = xmlMemBlocks();
48293        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48294
48295        xmlXPathValueFlipSign(ctxt);
48296        call_tests++;
48297        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48298        xmlResetLastError();
48299        if (mem_base != xmlMemBlocks()) {
48300            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
48301	           xmlMemBlocks() - mem_base);
48302	    test_ret++;
48303            printf(" %d", n_ctxt);
48304            printf("\n");
48305        }
48306    }
48307    function_tests++;
48308#endif
48309
48310    return(test_ret);
48311}
48312
48313
48314static int
48315test_xmlXPathVariableLookup(void) {
48316    int test_ret = 0;
48317
48318#if defined(LIBXML_XPATH_ENABLED)
48319    int mem_base;
48320    xmlXPathObjectPtr ret_val;
48321    xmlXPathContextPtr ctxt; /* the XPath context */
48322    int n_ctxt;
48323    xmlChar * name; /* the variable name */
48324    int n_name;
48325
48326    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48327    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48328        mem_base = xmlMemBlocks();
48329        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48330        name = gen_const_xmlChar_ptr(n_name, 1);
48331
48332        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
48333        desret_xmlXPathObjectPtr(ret_val);
48334        call_tests++;
48335        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48336        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48337        xmlResetLastError();
48338        if (mem_base != xmlMemBlocks()) {
48339            printf("Leak of %d blocks found in xmlXPathVariableLookup",
48340	           xmlMemBlocks() - mem_base);
48341	    test_ret++;
48342            printf(" %d", n_ctxt);
48343            printf(" %d", n_name);
48344            printf("\n");
48345        }
48346    }
48347    }
48348    function_tests++;
48349#endif
48350
48351    return(test_ret);
48352}
48353
48354
48355static int
48356test_xmlXPathVariableLookupNS(void) {
48357    int test_ret = 0;
48358
48359#if defined(LIBXML_XPATH_ENABLED)
48360    int mem_base;
48361    xmlXPathObjectPtr ret_val;
48362    xmlXPathContextPtr ctxt; /* the XPath context */
48363    int n_ctxt;
48364    xmlChar * name; /* the variable name */
48365    int n_name;
48366    xmlChar * ns_uri; /* the variable namespace URI */
48367    int n_ns_uri;
48368
48369    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48370    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48371    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
48372        mem_base = xmlMemBlocks();
48373        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48374        name = gen_const_xmlChar_ptr(n_name, 1);
48375        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
48376
48377        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
48378        desret_xmlXPathObjectPtr(ret_val);
48379        call_tests++;
48380        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48381        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48382        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
48383        xmlResetLastError();
48384        if (mem_base != xmlMemBlocks()) {
48385            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
48386	           xmlMemBlocks() - mem_base);
48387	    test_ret++;
48388            printf(" %d", n_ctxt);
48389            printf(" %d", n_name);
48390            printf(" %d", n_ns_uri);
48391            printf("\n");
48392        }
48393    }
48394    }
48395    }
48396    function_tests++;
48397#endif
48398
48399    return(test_ret);
48400}
48401
48402
48403static int
48404test_xmlXPathWrapCString(void) {
48405    int test_ret = 0;
48406
48407#if defined(LIBXML_XPATH_ENABLED)
48408    int mem_base;
48409    xmlXPathObjectPtr ret_val;
48410    char * val; /* the char * value */
48411    int n_val;
48412
48413    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
48414        mem_base = xmlMemBlocks();
48415        val = gen_char_ptr(n_val, 0);
48416
48417        ret_val = xmlXPathWrapCString(val);
48418        desret_xmlXPathObjectPtr(ret_val);
48419        call_tests++;
48420        des_char_ptr(n_val, val, 0);
48421        xmlResetLastError();
48422        if (mem_base != xmlMemBlocks()) {
48423            printf("Leak of %d blocks found in xmlXPathWrapCString",
48424	           xmlMemBlocks() - mem_base);
48425	    test_ret++;
48426            printf(" %d", n_val);
48427            printf("\n");
48428        }
48429    }
48430    function_tests++;
48431#endif
48432
48433    return(test_ret);
48434}
48435
48436
48437static int
48438test_xmlXPathWrapExternal(void) {
48439    int test_ret = 0;
48440
48441#if defined(LIBXML_XPATH_ENABLED)
48442    int mem_base;
48443    xmlXPathObjectPtr ret_val;
48444    void * val; /* the user data */
48445    int n_val;
48446
48447    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
48448        mem_base = xmlMemBlocks();
48449        val = gen_void_ptr(n_val, 0);
48450
48451        ret_val = xmlXPathWrapExternal(val);
48452        desret_xmlXPathObjectPtr(ret_val);
48453        call_tests++;
48454        des_void_ptr(n_val, val, 0);
48455        xmlResetLastError();
48456        if (mem_base != xmlMemBlocks()) {
48457            printf("Leak of %d blocks found in xmlXPathWrapExternal",
48458	           xmlMemBlocks() - mem_base);
48459	    test_ret++;
48460            printf(" %d", n_val);
48461            printf("\n");
48462        }
48463    }
48464    function_tests++;
48465#endif
48466
48467    return(test_ret);
48468}
48469
48470
48471static int
48472test_xmlXPathWrapNodeSet(void) {
48473    int test_ret = 0;
48474
48475#if defined(LIBXML_XPATH_ENABLED)
48476    int mem_base;
48477    xmlXPathObjectPtr ret_val;
48478    xmlNodeSetPtr val; /* the NodePtr value */
48479    int n_val;
48480
48481    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48482        mem_base = xmlMemBlocks();
48483        val = gen_xmlNodeSetPtr(n_val, 0);
48484
48485        ret_val = xmlXPathWrapNodeSet(val);
48486        desret_xmlXPathObjectPtr(ret_val);
48487        call_tests++;
48488        des_xmlNodeSetPtr(n_val, val, 0);
48489        xmlResetLastError();
48490        if (mem_base != xmlMemBlocks()) {
48491            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
48492	           xmlMemBlocks() - mem_base);
48493	    test_ret++;
48494            printf(" %d", n_val);
48495            printf("\n");
48496        }
48497    }
48498    function_tests++;
48499#endif
48500
48501    return(test_ret);
48502}
48503
48504
48505static int
48506test_xmlXPatherror(void) {
48507    int test_ret = 0;
48508
48509#if defined(LIBXML_XPATH_ENABLED)
48510    int mem_base;
48511    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48512    int n_ctxt;
48513    const char * file; /* the file name */
48514    int n_file;
48515    int line; /* the line number */
48516    int n_line;
48517    int no; /* the error number */
48518    int n_no;
48519
48520    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48521    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
48522    for (n_line = 0;n_line < gen_nb_int;n_line++) {
48523    for (n_no = 0;n_no < gen_nb_int;n_no++) {
48524        mem_base = xmlMemBlocks();
48525        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48526        file = gen_filepath(n_file, 1);
48527        line = gen_int(n_line, 2);
48528        no = gen_int(n_no, 3);
48529
48530        xmlXPatherror(ctxt, file, line, no);
48531        call_tests++;
48532        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48533        des_filepath(n_file, file, 1);
48534        des_int(n_line, line, 2);
48535        des_int(n_no, no, 3);
48536        xmlResetLastError();
48537        if (mem_base != xmlMemBlocks()) {
48538            printf("Leak of %d blocks found in xmlXPatherror",
48539	           xmlMemBlocks() - mem_base);
48540	    test_ret++;
48541            printf(" %d", n_ctxt);
48542            printf(" %d", n_file);
48543            printf(" %d", n_line);
48544            printf(" %d", n_no);
48545            printf("\n");
48546        }
48547    }
48548    }
48549    }
48550    }
48551    function_tests++;
48552#endif
48553
48554    return(test_ret);
48555}
48556
48557static int
48558test_xpathInternals(void) {
48559    int test_ret = 0;
48560
48561    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
48562    test_ret += test_valuePop();
48563    test_ret += test_valuePush();
48564    test_ret += test_xmlXPathAddValues();
48565    test_ret += test_xmlXPathBooleanFunction();
48566    test_ret += test_xmlXPathCeilingFunction();
48567    test_ret += test_xmlXPathCompareValues();
48568    test_ret += test_xmlXPathConcatFunction();
48569    test_ret += test_xmlXPathContainsFunction();
48570    test_ret += test_xmlXPathCountFunction();
48571    test_ret += test_xmlXPathDebugDumpCompExpr();
48572    test_ret += test_xmlXPathDebugDumpObject();
48573    test_ret += test_xmlXPathDifference();
48574    test_ret += test_xmlXPathDistinct();
48575    test_ret += test_xmlXPathDistinctSorted();
48576    test_ret += test_xmlXPathDivValues();
48577    test_ret += test_xmlXPathEqualValues();
48578    test_ret += test_xmlXPathErr();
48579    test_ret += test_xmlXPathEvalExpr();
48580    test_ret += test_xmlXPathEvaluatePredicateResult();
48581    test_ret += test_xmlXPathFalseFunction();
48582    test_ret += test_xmlXPathFloorFunction();
48583    test_ret += test_xmlXPathFunctionLookup();
48584    test_ret += test_xmlXPathFunctionLookupNS();
48585    test_ret += test_xmlXPathHasSameNodes();
48586    test_ret += test_xmlXPathIdFunction();
48587    test_ret += test_xmlXPathIntersection();
48588    test_ret += test_xmlXPathIsNodeType();
48589    test_ret += test_xmlXPathLangFunction();
48590    test_ret += test_xmlXPathLastFunction();
48591    test_ret += test_xmlXPathLeading();
48592    test_ret += test_xmlXPathLeadingSorted();
48593    test_ret += test_xmlXPathLocalNameFunction();
48594    test_ret += test_xmlXPathModValues();
48595    test_ret += test_xmlXPathMultValues();
48596    test_ret += test_xmlXPathNamespaceURIFunction();
48597    test_ret += test_xmlXPathNewBoolean();
48598    test_ret += test_xmlXPathNewCString();
48599    test_ret += test_xmlXPathNewFloat();
48600    test_ret += test_xmlXPathNewNodeSet();
48601    test_ret += test_xmlXPathNewNodeSetList();
48602    test_ret += test_xmlXPathNewParserContext();
48603    test_ret += test_xmlXPathNewString();
48604    test_ret += test_xmlXPathNextAncestor();
48605    test_ret += test_xmlXPathNextAncestorOrSelf();
48606    test_ret += test_xmlXPathNextAttribute();
48607    test_ret += test_xmlXPathNextChild();
48608    test_ret += test_xmlXPathNextDescendant();
48609    test_ret += test_xmlXPathNextDescendantOrSelf();
48610    test_ret += test_xmlXPathNextFollowing();
48611    test_ret += test_xmlXPathNextFollowingSibling();
48612    test_ret += test_xmlXPathNextNamespace();
48613    test_ret += test_xmlXPathNextParent();
48614    test_ret += test_xmlXPathNextPreceding();
48615    test_ret += test_xmlXPathNextPrecedingSibling();
48616    test_ret += test_xmlXPathNextSelf();
48617    test_ret += test_xmlXPathNodeLeading();
48618    test_ret += test_xmlXPathNodeLeadingSorted();
48619    test_ret += test_xmlXPathNodeSetAdd();
48620    test_ret += test_xmlXPathNodeSetAddNs();
48621    test_ret += test_xmlXPathNodeSetAddUnique();
48622    test_ret += test_xmlXPathNodeSetContains();
48623    test_ret += test_xmlXPathNodeSetDel();
48624    test_ret += test_xmlXPathNodeSetMerge();
48625    test_ret += test_xmlXPathNodeSetRemove();
48626    test_ret += test_xmlXPathNodeSetSort();
48627    test_ret += test_xmlXPathNodeTrailing();
48628    test_ret += test_xmlXPathNodeTrailingSorted();
48629    test_ret += test_xmlXPathNormalizeFunction();
48630    test_ret += test_xmlXPathNotEqualValues();
48631    test_ret += test_xmlXPathNotFunction();
48632    test_ret += test_xmlXPathNsLookup();
48633    test_ret += test_xmlXPathNumberFunction();
48634    test_ret += test_xmlXPathParseNCName();
48635    test_ret += test_xmlXPathParseName();
48636    test_ret += test_xmlXPathPopBoolean();
48637    test_ret += test_xmlXPathPopExternal();
48638    test_ret += test_xmlXPathPopNodeSet();
48639    test_ret += test_xmlXPathPopNumber();
48640    test_ret += test_xmlXPathPopString();
48641    test_ret += test_xmlXPathPositionFunction();
48642    test_ret += test_xmlXPathRegisterAllFunctions();
48643    test_ret += test_xmlXPathRegisterFunc();
48644    test_ret += test_xmlXPathRegisterFuncLookup();
48645    test_ret += test_xmlXPathRegisterFuncNS();
48646    test_ret += test_xmlXPathRegisterNs();
48647    test_ret += test_xmlXPathRegisterVariable();
48648    test_ret += test_xmlXPathRegisterVariableLookup();
48649    test_ret += test_xmlXPathRegisterVariableNS();
48650    test_ret += test_xmlXPathRegisteredFuncsCleanup();
48651    test_ret += test_xmlXPathRegisteredNsCleanup();
48652    test_ret += test_xmlXPathRegisteredVariablesCleanup();
48653    test_ret += test_xmlXPathRoot();
48654    test_ret += test_xmlXPathRoundFunction();
48655    test_ret += test_xmlXPathStartsWithFunction();
48656    test_ret += test_xmlXPathStringEvalNumber();
48657    test_ret += test_xmlXPathStringFunction();
48658    test_ret += test_xmlXPathStringLengthFunction();
48659    test_ret += test_xmlXPathSubValues();
48660    test_ret += test_xmlXPathSubstringAfterFunction();
48661    test_ret += test_xmlXPathSubstringBeforeFunction();
48662    test_ret += test_xmlXPathSubstringFunction();
48663    test_ret += test_xmlXPathSumFunction();
48664    test_ret += test_xmlXPathTrailing();
48665    test_ret += test_xmlXPathTrailingSorted();
48666    test_ret += test_xmlXPathTranslateFunction();
48667    test_ret += test_xmlXPathTrueFunction();
48668    test_ret += test_xmlXPathValueFlipSign();
48669    test_ret += test_xmlXPathVariableLookup();
48670    test_ret += test_xmlXPathVariableLookupNS();
48671    test_ret += test_xmlXPathWrapCString();
48672    test_ret += test_xmlXPathWrapExternal();
48673    test_ret += test_xmlXPathWrapNodeSet();
48674    test_ret += test_xmlXPatherror();
48675
48676    if (test_ret != 0)
48677	printf("Module xpathInternals: %d errors\n", test_ret);
48678    return(test_ret);
48679}
48680
48681static int
48682test_xmlXPtrBuildNodeList(void) {
48683    int test_ret = 0;
48684
48685#if defined(LIBXML_XPTR_ENABLED)
48686    int mem_base;
48687    xmlNodePtr ret_val;
48688    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
48689    int n_obj;
48690
48691    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
48692        mem_base = xmlMemBlocks();
48693        obj = gen_xmlXPathObjectPtr(n_obj, 0);
48694
48695        ret_val = xmlXPtrBuildNodeList(obj);
48696        desret_xmlNodePtr(ret_val);
48697        call_tests++;
48698        des_xmlXPathObjectPtr(n_obj, obj, 0);
48699        xmlResetLastError();
48700        if (mem_base != xmlMemBlocks()) {
48701            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
48702	           xmlMemBlocks() - mem_base);
48703	    test_ret++;
48704            printf(" %d", n_obj);
48705            printf("\n");
48706        }
48707    }
48708    function_tests++;
48709#endif
48710
48711    return(test_ret);
48712}
48713
48714
48715static int
48716test_xmlXPtrEval(void) {
48717    int test_ret = 0;
48718
48719#if defined(LIBXML_XPTR_ENABLED)
48720    int mem_base;
48721    xmlXPathObjectPtr ret_val;
48722    xmlChar * str; /* the XPointer expression */
48723    int n_str;
48724    xmlXPathContextPtr ctx; /* the XPointer context */
48725    int n_ctx;
48726
48727    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
48728    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
48729        mem_base = xmlMemBlocks();
48730        str = gen_const_xmlChar_ptr(n_str, 0);
48731        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
48732
48733        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
48734        desret_xmlXPathObjectPtr(ret_val);
48735        call_tests++;
48736        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
48737        des_xmlXPathContextPtr(n_ctx, ctx, 1);
48738        xmlResetLastError();
48739        if (mem_base != xmlMemBlocks()) {
48740            printf("Leak of %d blocks found in xmlXPtrEval",
48741	           xmlMemBlocks() - mem_base);
48742	    test_ret++;
48743            printf(" %d", n_str);
48744            printf(" %d", n_ctx);
48745            printf("\n");
48746        }
48747    }
48748    }
48749    function_tests++;
48750#endif
48751
48752    return(test_ret);
48753}
48754
48755
48756static int
48757test_xmlXPtrEvalRangePredicate(void) {
48758    int test_ret = 0;
48759
48760#if defined(LIBXML_XPTR_ENABLED)
48761    int mem_base;
48762    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
48763    int n_ctxt;
48764
48765    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48766        mem_base = xmlMemBlocks();
48767        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48768
48769        xmlXPtrEvalRangePredicate(ctxt);
48770        call_tests++;
48771        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48772        xmlResetLastError();
48773        if (mem_base != xmlMemBlocks()) {
48774            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
48775	           xmlMemBlocks() - mem_base);
48776	    test_ret++;
48777            printf(" %d", n_ctxt);
48778            printf("\n");
48779        }
48780    }
48781    function_tests++;
48782#endif
48783
48784    return(test_ret);
48785}
48786
48787#ifdef LIBXML_XPTR_ENABLED
48788
48789#define gen_nb_xmlLocationSetPtr 1
48790static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48791    return(NULL);
48792}
48793static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48794}
48795#endif
48796
48797
48798static int
48799test_xmlXPtrLocationSetAdd(void) {
48800    int test_ret = 0;
48801
48802#if defined(LIBXML_XPTR_ENABLED)
48803    int mem_base;
48804    xmlLocationSetPtr cur; /* the initial range set */
48805    int n_cur;
48806    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
48807    int n_val;
48808
48809    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
48810    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
48811        mem_base = xmlMemBlocks();
48812        cur = gen_xmlLocationSetPtr(n_cur, 0);
48813        val = gen_xmlXPathObjectPtr(n_val, 1);
48814
48815        xmlXPtrLocationSetAdd(cur, val);
48816        call_tests++;
48817        des_xmlLocationSetPtr(n_cur, cur, 0);
48818        des_xmlXPathObjectPtr(n_val, val, 1);
48819        xmlResetLastError();
48820        if (mem_base != xmlMemBlocks()) {
48821            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
48822	           xmlMemBlocks() - mem_base);
48823	    test_ret++;
48824            printf(" %d", n_cur);
48825            printf(" %d", n_val);
48826            printf("\n");
48827        }
48828    }
48829    }
48830    function_tests++;
48831#endif
48832
48833    return(test_ret);
48834}
48835
48836
48837static int
48838test_xmlXPtrLocationSetCreate(void) {
48839    int test_ret = 0;
48840
48841
48842    /* missing type support */
48843    return(test_ret);
48844}
48845
48846
48847static int
48848test_xmlXPtrLocationSetDel(void) {
48849    int test_ret = 0;
48850
48851#if defined(LIBXML_XPTR_ENABLED)
48852    int mem_base;
48853    xmlLocationSetPtr cur; /* the initial range set */
48854    int n_cur;
48855    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
48856    int n_val;
48857
48858    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
48859    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
48860        mem_base = xmlMemBlocks();
48861        cur = gen_xmlLocationSetPtr(n_cur, 0);
48862        val = gen_xmlXPathObjectPtr(n_val, 1);
48863
48864        xmlXPtrLocationSetDel(cur, val);
48865        call_tests++;
48866        des_xmlLocationSetPtr(n_cur, cur, 0);
48867        des_xmlXPathObjectPtr(n_val, val, 1);
48868        xmlResetLastError();
48869        if (mem_base != xmlMemBlocks()) {
48870            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
48871	           xmlMemBlocks() - mem_base);
48872	    test_ret++;
48873            printf(" %d", n_cur);
48874            printf(" %d", n_val);
48875            printf("\n");
48876        }
48877    }
48878    }
48879    function_tests++;
48880#endif
48881
48882    return(test_ret);
48883}
48884
48885
48886static int
48887test_xmlXPtrLocationSetMerge(void) {
48888    int test_ret = 0;
48889
48890
48891    /* missing type support */
48892    return(test_ret);
48893}
48894
48895
48896static int
48897test_xmlXPtrLocationSetRemove(void) {
48898    int test_ret = 0;
48899
48900#if defined(LIBXML_XPTR_ENABLED)
48901    int mem_base;
48902    xmlLocationSetPtr cur; /* the initial range set */
48903    int n_cur;
48904    int val; /* the index to remove */
48905    int n_val;
48906
48907    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
48908    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48909        mem_base = xmlMemBlocks();
48910        cur = gen_xmlLocationSetPtr(n_cur, 0);
48911        val = gen_int(n_val, 1);
48912
48913        xmlXPtrLocationSetRemove(cur, val);
48914        call_tests++;
48915        des_xmlLocationSetPtr(n_cur, cur, 0);
48916        des_int(n_val, val, 1);
48917        xmlResetLastError();
48918        if (mem_base != xmlMemBlocks()) {
48919            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
48920	           xmlMemBlocks() - mem_base);
48921	    test_ret++;
48922            printf(" %d", n_cur);
48923            printf(" %d", n_val);
48924            printf("\n");
48925        }
48926    }
48927    }
48928    function_tests++;
48929#endif
48930
48931    return(test_ret);
48932}
48933
48934
48935static int
48936test_xmlXPtrNewCollapsedRange(void) {
48937    int test_ret = 0;
48938
48939#if defined(LIBXML_XPTR_ENABLED)
48940    int mem_base;
48941    xmlXPathObjectPtr ret_val;
48942    xmlNodePtr start; /* the starting and ending node */
48943    int n_start;
48944
48945    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
48946        mem_base = xmlMemBlocks();
48947        start = gen_xmlNodePtr(n_start, 0);
48948
48949        ret_val = xmlXPtrNewCollapsedRange(start);
48950        desret_xmlXPathObjectPtr(ret_val);
48951        call_tests++;
48952        des_xmlNodePtr(n_start, start, 0);
48953        xmlResetLastError();
48954        if (mem_base != xmlMemBlocks()) {
48955            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
48956	           xmlMemBlocks() - mem_base);
48957	    test_ret++;
48958            printf(" %d", n_start);
48959            printf("\n");
48960        }
48961    }
48962    function_tests++;
48963#endif
48964
48965    return(test_ret);
48966}
48967
48968
48969static int
48970test_xmlXPtrNewContext(void) {
48971    int test_ret = 0;
48972
48973
48974    /* missing type support */
48975    return(test_ret);
48976}
48977
48978
48979static int
48980test_xmlXPtrNewLocationSetNodeSet(void) {
48981    int test_ret = 0;
48982
48983#if defined(LIBXML_XPTR_ENABLED)
48984    int mem_base;
48985    xmlXPathObjectPtr ret_val;
48986    xmlNodeSetPtr set; /* a node set */
48987    int n_set;
48988
48989    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48990        mem_base = xmlMemBlocks();
48991        set = gen_xmlNodeSetPtr(n_set, 0);
48992
48993        ret_val = xmlXPtrNewLocationSetNodeSet(set);
48994        desret_xmlXPathObjectPtr(ret_val);
48995        call_tests++;
48996        des_xmlNodeSetPtr(n_set, set, 0);
48997        xmlResetLastError();
48998        if (mem_base != xmlMemBlocks()) {
48999            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
49000	           xmlMemBlocks() - mem_base);
49001	    test_ret++;
49002            printf(" %d", n_set);
49003            printf("\n");
49004        }
49005    }
49006    function_tests++;
49007#endif
49008
49009    return(test_ret);
49010}
49011
49012
49013static int
49014test_xmlXPtrNewLocationSetNodes(void) {
49015    int test_ret = 0;
49016
49017#if defined(LIBXML_XPTR_ENABLED)
49018    int mem_base;
49019    xmlXPathObjectPtr ret_val;
49020    xmlNodePtr start; /* the start NodePtr value */
49021    int n_start;
49022    xmlNodePtr end; /* the end NodePtr value or NULL */
49023    int n_end;
49024
49025    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49026    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49027        mem_base = xmlMemBlocks();
49028        start = gen_xmlNodePtr(n_start, 0);
49029        end = gen_xmlNodePtr(n_end, 1);
49030
49031        ret_val = xmlXPtrNewLocationSetNodes(start, end);
49032        desret_xmlXPathObjectPtr(ret_val);
49033        call_tests++;
49034        des_xmlNodePtr(n_start, start, 0);
49035        des_xmlNodePtr(n_end, end, 1);
49036        xmlResetLastError();
49037        if (mem_base != xmlMemBlocks()) {
49038            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
49039	           xmlMemBlocks() - mem_base);
49040	    test_ret++;
49041            printf(" %d", n_start);
49042            printf(" %d", n_end);
49043            printf("\n");
49044        }
49045    }
49046    }
49047    function_tests++;
49048#endif
49049
49050    return(test_ret);
49051}
49052
49053
49054static int
49055test_xmlXPtrNewRange(void) {
49056    int test_ret = 0;
49057
49058#if defined(LIBXML_XPTR_ENABLED)
49059    int mem_base;
49060    xmlXPathObjectPtr ret_val;
49061    xmlNodePtr start; /* the starting node */
49062    int n_start;
49063    int startindex; /* the start index */
49064    int n_startindex;
49065    xmlNodePtr end; /* the ending point */
49066    int n_end;
49067    int endindex; /* the ending index */
49068    int n_endindex;
49069
49070    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49071    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
49072    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49073    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
49074        mem_base = xmlMemBlocks();
49075        start = gen_xmlNodePtr(n_start, 0);
49076        startindex = gen_int(n_startindex, 1);
49077        end = gen_xmlNodePtr(n_end, 2);
49078        endindex = gen_int(n_endindex, 3);
49079
49080        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
49081        desret_xmlXPathObjectPtr(ret_val);
49082        call_tests++;
49083        des_xmlNodePtr(n_start, start, 0);
49084        des_int(n_startindex, startindex, 1);
49085        des_xmlNodePtr(n_end, end, 2);
49086        des_int(n_endindex, endindex, 3);
49087        xmlResetLastError();
49088        if (mem_base != xmlMemBlocks()) {
49089            printf("Leak of %d blocks found in xmlXPtrNewRange",
49090	           xmlMemBlocks() - mem_base);
49091	    test_ret++;
49092            printf(" %d", n_start);
49093            printf(" %d", n_startindex);
49094            printf(" %d", n_end);
49095            printf(" %d", n_endindex);
49096            printf("\n");
49097        }
49098    }
49099    }
49100    }
49101    }
49102    function_tests++;
49103#endif
49104
49105    return(test_ret);
49106}
49107
49108
49109static int
49110test_xmlXPtrNewRangeNodeObject(void) {
49111    int test_ret = 0;
49112
49113#if defined(LIBXML_XPTR_ENABLED)
49114    int mem_base;
49115    xmlXPathObjectPtr ret_val;
49116    xmlNodePtr start; /* the starting node */
49117    int n_start;
49118    xmlXPathObjectPtr end; /* the ending object */
49119    int n_end;
49120
49121    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49122    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
49123        mem_base = xmlMemBlocks();
49124        start = gen_xmlNodePtr(n_start, 0);
49125        end = gen_xmlXPathObjectPtr(n_end, 1);
49126
49127        ret_val = xmlXPtrNewRangeNodeObject(start, end);
49128        desret_xmlXPathObjectPtr(ret_val);
49129        call_tests++;
49130        des_xmlNodePtr(n_start, start, 0);
49131        des_xmlXPathObjectPtr(n_end, end, 1);
49132        xmlResetLastError();
49133        if (mem_base != xmlMemBlocks()) {
49134            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
49135	           xmlMemBlocks() - mem_base);
49136	    test_ret++;
49137            printf(" %d", n_start);
49138            printf(" %d", n_end);
49139            printf("\n");
49140        }
49141    }
49142    }
49143    function_tests++;
49144#endif
49145
49146    return(test_ret);
49147}
49148
49149
49150static int
49151test_xmlXPtrNewRangeNodePoint(void) {
49152    int test_ret = 0;
49153
49154#if defined(LIBXML_XPTR_ENABLED)
49155    int mem_base;
49156    xmlXPathObjectPtr ret_val;
49157    xmlNodePtr start; /* the starting node */
49158    int n_start;
49159    xmlXPathObjectPtr end; /* the ending point */
49160    int n_end;
49161
49162    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49163    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
49164        mem_base = xmlMemBlocks();
49165        start = gen_xmlNodePtr(n_start, 0);
49166        end = gen_xmlXPathObjectPtr(n_end, 1);
49167
49168        ret_val = xmlXPtrNewRangeNodePoint(start, end);
49169        desret_xmlXPathObjectPtr(ret_val);
49170        call_tests++;
49171        des_xmlNodePtr(n_start, start, 0);
49172        des_xmlXPathObjectPtr(n_end, end, 1);
49173        xmlResetLastError();
49174        if (mem_base != xmlMemBlocks()) {
49175            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
49176	           xmlMemBlocks() - mem_base);
49177	    test_ret++;
49178            printf(" %d", n_start);
49179            printf(" %d", n_end);
49180            printf("\n");
49181        }
49182    }
49183    }
49184    function_tests++;
49185#endif
49186
49187    return(test_ret);
49188}
49189
49190
49191static int
49192test_xmlXPtrNewRangeNodes(void) {
49193    int test_ret = 0;
49194
49195#if defined(LIBXML_XPTR_ENABLED)
49196    int mem_base;
49197    xmlXPathObjectPtr ret_val;
49198    xmlNodePtr start; /* the starting node */
49199    int n_start;
49200    xmlNodePtr end; /* the ending node */
49201    int n_end;
49202
49203    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49204    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49205        mem_base = xmlMemBlocks();
49206        start = gen_xmlNodePtr(n_start, 0);
49207        end = gen_xmlNodePtr(n_end, 1);
49208
49209        ret_val = xmlXPtrNewRangeNodes(start, end);
49210        desret_xmlXPathObjectPtr(ret_val);
49211        call_tests++;
49212        des_xmlNodePtr(n_start, start, 0);
49213        des_xmlNodePtr(n_end, end, 1);
49214        xmlResetLastError();
49215        if (mem_base != xmlMemBlocks()) {
49216            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
49217	           xmlMemBlocks() - mem_base);
49218	    test_ret++;
49219            printf(" %d", n_start);
49220            printf(" %d", n_end);
49221            printf("\n");
49222        }
49223    }
49224    }
49225    function_tests++;
49226#endif
49227
49228    return(test_ret);
49229}
49230
49231
49232static int
49233test_xmlXPtrNewRangePointNode(void) {
49234    int test_ret = 0;
49235
49236#if defined(LIBXML_XPTR_ENABLED)
49237    int mem_base;
49238    xmlXPathObjectPtr ret_val;
49239    xmlXPathObjectPtr start; /* the starting point */
49240    int n_start;
49241    xmlNodePtr end; /* the ending node */
49242    int n_end;
49243
49244    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
49245    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49246        mem_base = xmlMemBlocks();
49247        start = gen_xmlXPathObjectPtr(n_start, 0);
49248        end = gen_xmlNodePtr(n_end, 1);
49249
49250        ret_val = xmlXPtrNewRangePointNode(start, end);
49251        desret_xmlXPathObjectPtr(ret_val);
49252        call_tests++;
49253        des_xmlXPathObjectPtr(n_start, start, 0);
49254        des_xmlNodePtr(n_end, end, 1);
49255        xmlResetLastError();
49256        if (mem_base != xmlMemBlocks()) {
49257            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
49258	           xmlMemBlocks() - mem_base);
49259	    test_ret++;
49260            printf(" %d", n_start);
49261            printf(" %d", n_end);
49262            printf("\n");
49263        }
49264    }
49265    }
49266    function_tests++;
49267#endif
49268
49269    return(test_ret);
49270}
49271
49272
49273static int
49274test_xmlXPtrNewRangePoints(void) {
49275    int test_ret = 0;
49276
49277#if defined(LIBXML_XPTR_ENABLED)
49278    int mem_base;
49279    xmlXPathObjectPtr ret_val;
49280    xmlXPathObjectPtr start; /* the starting point */
49281    int n_start;
49282    xmlXPathObjectPtr end; /* the ending point */
49283    int n_end;
49284
49285    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
49286    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
49287        mem_base = xmlMemBlocks();
49288        start = gen_xmlXPathObjectPtr(n_start, 0);
49289        end = gen_xmlXPathObjectPtr(n_end, 1);
49290
49291        ret_val = xmlXPtrNewRangePoints(start, end);
49292        desret_xmlXPathObjectPtr(ret_val);
49293        call_tests++;
49294        des_xmlXPathObjectPtr(n_start, start, 0);
49295        des_xmlXPathObjectPtr(n_end, end, 1);
49296        xmlResetLastError();
49297        if (mem_base != xmlMemBlocks()) {
49298            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
49299	           xmlMemBlocks() - mem_base);
49300	    test_ret++;
49301            printf(" %d", n_start);
49302            printf(" %d", n_end);
49303            printf("\n");
49304        }
49305    }
49306    }
49307    function_tests++;
49308#endif
49309
49310    return(test_ret);
49311}
49312
49313
49314static int
49315test_xmlXPtrRangeToFunction(void) {
49316    int test_ret = 0;
49317
49318#if defined(LIBXML_XPTR_ENABLED)
49319    int mem_base;
49320    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
49321    int n_ctxt;
49322    int nargs; /* the number of args */
49323    int n_nargs;
49324
49325    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49326    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49327        mem_base = xmlMemBlocks();
49328        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49329        nargs = gen_int(n_nargs, 1);
49330
49331        xmlXPtrRangeToFunction(ctxt, nargs);
49332        call_tests++;
49333        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49334        des_int(n_nargs, nargs, 1);
49335        xmlResetLastError();
49336        if (mem_base != xmlMemBlocks()) {
49337            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
49338	           xmlMemBlocks() - mem_base);
49339	    test_ret++;
49340            printf(" %d", n_ctxt);
49341            printf(" %d", n_nargs);
49342            printf("\n");
49343        }
49344    }
49345    }
49346    function_tests++;
49347#endif
49348
49349    return(test_ret);
49350}
49351
49352
49353static int
49354test_xmlXPtrWrapLocationSet(void) {
49355    int test_ret = 0;
49356
49357#if defined(LIBXML_XPTR_ENABLED)
49358    int mem_base;
49359    xmlXPathObjectPtr ret_val;
49360    xmlLocationSetPtr val; /* the LocationSet value */
49361    int n_val;
49362
49363    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
49364        mem_base = xmlMemBlocks();
49365        val = gen_xmlLocationSetPtr(n_val, 0);
49366
49367        ret_val = xmlXPtrWrapLocationSet(val);
49368        desret_xmlXPathObjectPtr(ret_val);
49369        call_tests++;
49370        des_xmlLocationSetPtr(n_val, val, 0);
49371        xmlResetLastError();
49372        if (mem_base != xmlMemBlocks()) {
49373            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
49374	           xmlMemBlocks() - mem_base);
49375	    test_ret++;
49376            printf(" %d", n_val);
49377            printf("\n");
49378        }
49379    }
49380    function_tests++;
49381#endif
49382
49383    return(test_ret);
49384}
49385
49386static int
49387test_xpointer(void) {
49388    int test_ret = 0;
49389
49390    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
49391    test_ret += test_xmlXPtrBuildNodeList();
49392    test_ret += test_xmlXPtrEval();
49393    test_ret += test_xmlXPtrEvalRangePredicate();
49394    test_ret += test_xmlXPtrLocationSetAdd();
49395    test_ret += test_xmlXPtrLocationSetCreate();
49396    test_ret += test_xmlXPtrLocationSetDel();
49397    test_ret += test_xmlXPtrLocationSetMerge();
49398    test_ret += test_xmlXPtrLocationSetRemove();
49399    test_ret += test_xmlXPtrNewCollapsedRange();
49400    test_ret += test_xmlXPtrNewContext();
49401    test_ret += test_xmlXPtrNewLocationSetNodeSet();
49402    test_ret += test_xmlXPtrNewLocationSetNodes();
49403    test_ret += test_xmlXPtrNewRange();
49404    test_ret += test_xmlXPtrNewRangeNodeObject();
49405    test_ret += test_xmlXPtrNewRangeNodePoint();
49406    test_ret += test_xmlXPtrNewRangeNodes();
49407    test_ret += test_xmlXPtrNewRangePointNode();
49408    test_ret += test_xmlXPtrNewRangePoints();
49409    test_ret += test_xmlXPtrRangeToFunction();
49410    test_ret += test_xmlXPtrWrapLocationSet();
49411
49412    if (test_ret != 0)
49413	printf("Module xpointer: %d errors\n", test_ret);
49414    return(test_ret);
49415}
49416static int
49417test_module(const char *module) {
49418    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
49419    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
49420    if (!strcmp(module, "SAX2")) return(test_SAX2());
49421    if (!strcmp(module, "c14n")) return(test_c14n());
49422    if (!strcmp(module, "catalog")) return(test_catalog());
49423    if (!strcmp(module, "chvalid")) return(test_chvalid());
49424    if (!strcmp(module, "debugXML")) return(test_debugXML());
49425    if (!strcmp(module, "dict")) return(test_dict());
49426    if (!strcmp(module, "encoding")) return(test_encoding());
49427    if (!strcmp(module, "entities")) return(test_entities());
49428    if (!strcmp(module, "hash")) return(test_hash());
49429    if (!strcmp(module, "list")) return(test_list());
49430    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
49431    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
49432    if (!strcmp(module, "parser")) return(test_parser());
49433    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
49434    if (!strcmp(module, "pattern")) return(test_pattern());
49435    if (!strcmp(module, "relaxng")) return(test_relaxng());
49436    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
49437    if (!strcmp(module, "tree")) return(test_tree());
49438    if (!strcmp(module, "uri")) return(test_uri());
49439    if (!strcmp(module, "valid")) return(test_valid());
49440    if (!strcmp(module, "xinclude")) return(test_xinclude());
49441    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
49442    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
49443    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
49444    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
49445    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
49446    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
49447    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
49448    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
49449    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
49450    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
49451    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
49452    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
49453    if (!strcmp(module, "xpath")) return(test_xpath());
49454    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
49455    if (!strcmp(module, "xpointer")) return(test_xpointer());
49456    return(0);
49457}
49458