testapi.c revision 8aa7afa698ddeb12ddaf071124f41a0a287fc6c9
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}
817#endif
818#ifdef LIBXML_HTTP_ENABLED
819static void desret_xmlNanoHTTPCtxtPtr(void *val) {
820    xmlNanoHTTPClose(val);
821}
822#endif
823#ifdef LIBXML_FTP_ENABLED
824static void desret_xmlNanoFTPCtxtPtr(void *val) {
825    xmlNanoFTPClose(val);
826}
827#endif
828/* cut and pasted from autogenerated to avoid troubles */
829#define gen_nb_const_xmlChar_ptr_ptr 1
830static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
831    return(NULL);
832}
833static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
834}
835
836#define gen_nb_unsigned_char_ptr 1
837static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
838    return(NULL);
839}
840static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
841}
842
843#define gen_nb_const_unsigned_char_ptr 1
844static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
845    return(NULL);
846}
847static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
848}
849
850#ifdef LIBXML_HTML_ENABLED
851#define gen_nb_const_htmlNodePtr 1
852static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
853    return(NULL);
854}
855static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
856}
857#endif
858
859#ifdef LIBXML_HTML_ENABLED
860#define gen_nb_htmlDocPtr 3
861static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
862    if (no == 0) return(htmlNewDoc(NULL, NULL));
863    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
864    return(NULL);
865}
866static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
867    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
868        xmlFreeDoc(val);
869}
870static void desret_htmlDocPtr(htmlDocPtr val) {
871    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
872        xmlFreeDoc(val);
873}
874#define gen_nb_htmlParserCtxtPtr 3
875static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
876    if (no == 0) return(xmlNewParserCtxt());
877    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
878    return(NULL);
879}
880static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
881    if (val != NULL)
882        htmlFreeParserCtxt(val);
883}
884static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
885    if (val != NULL)
886        htmlFreeParserCtxt(val);
887}
888#endif
889
890#ifdef LIBXML_XPATH_ENABLED
891#define gen_nb_xmlNodeSetPtr 1
892static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893    return(NULL);
894}
895static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
896}
897#endif
898
899#ifdef LIBXML_DEBUG_ENABLED
900#ifdef LIBXML_XPATH_ENABLED
901#define gen_nb_xmlShellCtxtPtr 1
902static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
903    return(NULL);
904}
905static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
906}
907#endif
908#endif
909
910#ifdef LIBXML_PATTERN_ENABLED
911#define gen_nb_xmlPatternPtr 1
912static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
913    return(NULL);
914}
915static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
916}
917#endif
918
919#define gen_nb_xmlElementContentPtr 1
920static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
921    return(NULL);
922}
923static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
924    if (val != NULL)
925        xmlFreeElementContent(val);
926}
927static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
928    if (val != NULL)
929        xmlFreeElementContent(val);
930}
931
932#define gen_nb_xmlParserNodeInfoSeqPtr 1
933static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
934    return(NULL);
935}
936static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
937}
938
939static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
940}
941
942/************************************************************************
943 *									*
944 *   WARNING: end of the manually maintained part of the test code	*
945 *            do not remove or alter the CUT HERE line			*
946 *									*
947 ************************************************************************/
948
949/* CUT HERE: everything below that line is generated */
950#ifdef LIBXML_HTML_ENABLED
951static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
952}
953
954#endif
955
956#define gen_nb_xmlAttributeDefault 4
957static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
958    if (no == 1) return(XML_ATTRIBUTE_FIXED);
959    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
960    if (no == 3) return(XML_ATTRIBUTE_NONE);
961    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
962    return(0);
963}
964
965static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
966}
967
968#define gen_nb_xmlAttributeType 4
969static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
970    if (no == 1) return(XML_ATTRIBUTE_CDATA);
971    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
972    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
973    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
974    return(0);
975}
976
977static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
978}
979
980#define gen_nb_xmlBufferAllocationScheme 3
981static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
982    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
983    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
984    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
985    return(0);
986}
987
988static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
989}
990
991static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
992}
993
994#ifdef LIBXML_CATALOG_ENABLED
995#define gen_nb_xmlCatalogAllow 4
996static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
997    if (no == 1) return(XML_CATA_ALLOW_ALL);
998    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
999    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1000    if (no == 4) return(XML_CATA_ALLOW_NONE);
1001    return(0);
1002}
1003
1004static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1005}
1006
1007static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1008}
1009
1010#endif
1011
1012#ifdef LIBXML_CATALOG_ENABLED
1013#define gen_nb_xmlCatalogPrefer 3
1014static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1015    if (no == 1) return(XML_CATA_PREFER_NONE);
1016    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1017    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1018    return(0);
1019}
1020
1021static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1022}
1023
1024static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1025}
1026
1027#endif
1028
1029#define gen_nb_xmlElementContentType 4
1030static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1031    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1032    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1033    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1034    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1035    return(0);
1036}
1037
1038static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1039}
1040
1041#define gen_nb_xmlElementTypeVal 4
1042static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1043    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1044    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1045    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1046    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1047    return(0);
1048}
1049
1050static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1051}
1052
1053static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1054}
1055
1056#ifdef LIBXML_SCHEMAS_ENABLED
1057#define gen_nb_xmlSchemaValType 4
1058static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1059    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1060    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1061    if (no == 3) return(XML_SCHEMAS_ANYURI);
1062    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1063    return(0);
1064}
1065
1066static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1067}
1068
1069static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1070}
1071
1072#endif
1073
1074#ifdef LIBXML_SCHEMAS_ENABLED
1075#define gen_nb_xmlSchemaWhitespaceValueType 4
1076static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1077    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1078    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1079    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1080    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1081    return(0);
1082}
1083
1084static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1085}
1086
1087#endif
1088
1089#include <libxml/HTMLparser.h>
1090#include <libxml/HTMLtree.h>
1091#include <libxml/SAX2.h>
1092#include <libxml/c14n.h>
1093#include <libxml/catalog.h>
1094#include <libxml/chvalid.h>
1095#include <libxml/debugXML.h>
1096#include <libxml/dict.h>
1097#include <libxml/encoding.h>
1098#include <libxml/entities.h>
1099#include <libxml/hash.h>
1100#include <libxml/list.h>
1101#include <libxml/nanoftp.h>
1102#include <libxml/nanohttp.h>
1103#include <libxml/parser.h>
1104#include <libxml/parserInternals.h>
1105#include <libxml/pattern.h>
1106#include <libxml/relaxng.h>
1107#include <libxml/schemasInternals.h>
1108#include <libxml/tree.h>
1109#include <libxml/uri.h>
1110#include <libxml/valid.h>
1111#include <libxml/xinclude.h>
1112#include <libxml/xmlIO.h>
1113#include <libxml/xmlautomata.h>
1114#include <libxml/xmlerror.h>
1115#include <libxml/xmlmodule.h>
1116#include <libxml/xmlreader.h>
1117#include <libxml/xmlregexp.h>
1118#include <libxml/xmlsave.h>
1119#include <libxml/xmlschemas.h>
1120#include <libxml/xmlschemastypes.h>
1121#include <libxml/xmlstring.h>
1122#include <libxml/xmlunicode.h>
1123#include <libxml/xmlwriter.h>
1124#include <libxml/xpath.h>
1125#include <libxml/xpathInternals.h>
1126#include <libxml/xpointer.h>
1127static int test_HTMLparser(void);
1128static int test_HTMLtree(void);
1129static int test_SAX2(void);
1130static int test_c14n(void);
1131static int test_catalog(void);
1132static int test_chvalid(void);
1133static int test_debugXML(void);
1134static int test_dict(void);
1135static int test_encoding(void);
1136static int test_entities(void);
1137static int test_hash(void);
1138static int test_list(void);
1139static int test_nanoftp(void);
1140static int test_nanohttp(void);
1141static int test_parser(void);
1142static int test_parserInternals(void);
1143static int test_pattern(void);
1144static int test_relaxng(void);
1145static int test_schemasInternals(void);
1146static int test_tree(void);
1147static int test_uri(void);
1148static int test_valid(void);
1149static int test_xinclude(void);
1150static int test_xmlIO(void);
1151static int test_xmlautomata(void);
1152static int test_xmlerror(void);
1153static int test_xmlmodule(void);
1154static int test_xmlreader(void);
1155static int test_xmlregexp(void);
1156static int test_xmlsave(void);
1157static int test_xmlschemas(void);
1158static int test_xmlschemastypes(void);
1159static int test_xmlstring(void);
1160static int test_xmlunicode(void);
1161static int test_xmlwriter(void);
1162static int test_xpath(void);
1163static int test_xpathInternals(void);
1164static int test_xpointer(void);
1165
1166/**
1167 * testlibxml2:
1168 *
1169 * Main entry point of the tester for the full libxml2 module,
1170 * it calls all the tester entry point for each module.
1171 *
1172 * Returns the number of error found
1173 */
1174static int
1175testlibxml2(void)
1176{
1177    int test_ret = 0;
1178
1179    test_ret += test_HTMLparser();
1180    test_ret += test_HTMLtree();
1181    test_ret += test_SAX2();
1182    test_ret += test_c14n();
1183    test_ret += test_catalog();
1184    test_ret += test_chvalid();
1185    test_ret += test_debugXML();
1186    test_ret += test_dict();
1187    test_ret += test_encoding();
1188    test_ret += test_entities();
1189    test_ret += test_hash();
1190    test_ret += test_list();
1191    test_ret += test_nanoftp();
1192    test_ret += test_nanohttp();
1193    test_ret += test_parser();
1194    test_ret += test_parserInternals();
1195    test_ret += test_pattern();
1196    test_ret += test_relaxng();
1197    test_ret += test_schemasInternals();
1198    test_ret += test_tree();
1199    test_ret += test_uri();
1200    test_ret += test_valid();
1201    test_ret += test_xinclude();
1202    test_ret += test_xmlIO();
1203    test_ret += test_xmlautomata();
1204    test_ret += test_xmlerror();
1205    test_ret += test_xmlmodule();
1206    test_ret += test_xmlreader();
1207    test_ret += test_xmlregexp();
1208    test_ret += test_xmlsave();
1209    test_ret += test_xmlschemas();
1210    test_ret += test_xmlschemastypes();
1211    test_ret += test_xmlstring();
1212    test_ret += test_xmlunicode();
1213    test_ret += test_xmlwriter();
1214    test_ret += test_xpath();
1215    test_ret += test_xpathInternals();
1216    test_ret += test_xpointer();
1217
1218    printf("Total: %d functions, %d tests, %d errors\n",
1219           function_tests, call_tests, test_ret);
1220    return(test_ret);
1221}
1222
1223
1224static int
1225test_UTF8ToHtml(void) {
1226    int test_ret = 0;
1227
1228#if defined(LIBXML_HTML_ENABLED)
1229    int mem_base;
1230    int ret_val;
1231    unsigned char * out; /* a pointer to an array of bytes to store the result */
1232    int n_out;
1233    int * outlen; /* the length of @out */
1234    int n_outlen;
1235    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1236    int n_in;
1237    int * inlen; /* the length of @in */
1238    int n_inlen;
1239
1240    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1241    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1242    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1243    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1244        mem_base = xmlMemBlocks();
1245        out = gen_unsigned_char_ptr(n_out, 0);
1246        outlen = gen_int_ptr(n_outlen, 1);
1247        in = gen_const_unsigned_char_ptr(n_in, 2);
1248        inlen = gen_int_ptr(n_inlen, 3);
1249
1250        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1251        desret_int(ret_val);
1252        call_tests++;
1253        des_unsigned_char_ptr(n_out, out, 0);
1254        des_int_ptr(n_outlen, outlen, 1);
1255        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1256        des_int_ptr(n_inlen, inlen, 3);
1257        xmlResetLastError();
1258        if (mem_base != xmlMemBlocks()) {
1259            printf("Leak of %d blocks found in UTF8ToHtml",
1260	           xmlMemBlocks() - mem_base);
1261	    test_ret++;
1262            printf(" %d", n_out);
1263            printf(" %d", n_outlen);
1264            printf(" %d", n_in);
1265            printf(" %d", n_inlen);
1266            printf("\n");
1267        }
1268    }
1269    }
1270    }
1271    }
1272    function_tests++;
1273#endif
1274
1275    return(test_ret);
1276}
1277
1278#ifdef LIBXML_HTML_ENABLED
1279
1280#define gen_nb_const_htmlElemDesc_ptr 1
1281static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1282    return(NULL);
1283}
1284static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1285}
1286#endif
1287
1288
1289static int
1290test_htmlAttrAllowed(void) {
1291    int test_ret = 0;
1292
1293#if defined(LIBXML_HTML_ENABLED)
1294    int mem_base;
1295    htmlStatus ret_val;
1296    htmlElemDesc * elt; /* HTML element */
1297    int n_elt;
1298    xmlChar * attr; /* HTML attribute */
1299    int n_attr;
1300    int legacy; /* whether to allow deprecated attributes */
1301    int n_legacy;
1302
1303    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1304    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1305    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1306        mem_base = xmlMemBlocks();
1307        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1308        attr = gen_const_xmlChar_ptr(n_attr, 1);
1309        legacy = gen_int(n_legacy, 2);
1310
1311        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1312        desret_htmlStatus(ret_val);
1313        call_tests++;
1314        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1315        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1316        des_int(n_legacy, legacy, 2);
1317        xmlResetLastError();
1318        if (mem_base != xmlMemBlocks()) {
1319            printf("Leak of %d blocks found in htmlAttrAllowed",
1320	           xmlMemBlocks() - mem_base);
1321	    test_ret++;
1322            printf(" %d", n_elt);
1323            printf(" %d", n_attr);
1324            printf(" %d", n_legacy);
1325            printf("\n");
1326        }
1327    }
1328    }
1329    }
1330    function_tests++;
1331#endif
1332
1333    return(test_ret);
1334}
1335
1336#ifdef LIBXML_HTML_ENABLED
1337
1338#define gen_nb_htmlNodePtr 1
1339static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1340    return(NULL);
1341}
1342static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1343}
1344#endif
1345
1346
1347static int
1348test_htmlAutoCloseTag(void) {
1349    int test_ret = 0;
1350
1351#if defined(LIBXML_HTML_ENABLED)
1352    int mem_base;
1353    int ret_val;
1354    htmlDocPtr doc; /* the HTML document */
1355    int n_doc;
1356    xmlChar * name; /* The tag name */
1357    int n_name;
1358    htmlNodePtr elem; /* the HTML element */
1359    int n_elem;
1360
1361    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1362    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1363    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1364        mem_base = xmlMemBlocks();
1365        doc = gen_htmlDocPtr(n_doc, 0);
1366        name = gen_const_xmlChar_ptr(n_name, 1);
1367        elem = gen_htmlNodePtr(n_elem, 2);
1368
1369        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1370        desret_int(ret_val);
1371        call_tests++;
1372        des_htmlDocPtr(n_doc, doc, 0);
1373        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1374        des_htmlNodePtr(n_elem, elem, 2);
1375        xmlResetLastError();
1376        if (mem_base != xmlMemBlocks()) {
1377            printf("Leak of %d blocks found in htmlAutoCloseTag",
1378	           xmlMemBlocks() - mem_base);
1379	    test_ret++;
1380            printf(" %d", n_doc);
1381            printf(" %d", n_name);
1382            printf(" %d", n_elem);
1383            printf("\n");
1384        }
1385    }
1386    }
1387    }
1388    function_tests++;
1389#endif
1390
1391    return(test_ret);
1392}
1393
1394
1395static int
1396test_htmlCreateMemoryParserCtxt(void) {
1397    int test_ret = 0;
1398
1399#if defined(LIBXML_HTML_ENABLED)
1400    int mem_base;
1401    htmlParserCtxtPtr ret_val;
1402    char * buffer; /* a pointer to a char array */
1403    int n_buffer;
1404    int size; /* the size of the array */
1405    int n_size;
1406
1407    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1408    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1409        mem_base = xmlMemBlocks();
1410        buffer = gen_const_char_ptr(n_buffer, 0);
1411        size = gen_int(n_size, 1);
1412
1413        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1414        desret_htmlParserCtxtPtr(ret_val);
1415        call_tests++;
1416        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1417        des_int(n_size, size, 1);
1418        xmlResetLastError();
1419        if (mem_base != xmlMemBlocks()) {
1420            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1421	           xmlMemBlocks() - mem_base);
1422	    test_ret++;
1423            printf(" %d", n_buffer);
1424            printf(" %d", n_size);
1425            printf("\n");
1426        }
1427    }
1428    }
1429    function_tests++;
1430#endif
1431
1432    return(test_ret);
1433}
1434
1435#ifdef LIBXML_HTML_ENABLED
1436
1437#define gen_nb_htmlSAXHandlerPtr 1
1438static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1439    return(NULL);
1440}
1441static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1442}
1443#endif
1444
1445
1446static int
1447test_htmlCreatePushParserCtxt(void) {
1448    int test_ret = 0;
1449
1450#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1451    int mem_base;
1452    htmlParserCtxtPtr ret_val;
1453    htmlSAXHandlerPtr sax; /* a SAX handler */
1454    int n_sax;
1455    void * user_data; /* The user data returned on SAX callbacks */
1456    int n_user_data;
1457    char * chunk; /* a pointer to an array of chars */
1458    int n_chunk;
1459    int size; /* number of chars in the array */
1460    int n_size;
1461    const char * filename; /* an optional file name or URI */
1462    int n_filename;
1463    xmlCharEncoding enc; /* an optional encoding */
1464    int n_enc;
1465
1466    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1467    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1468    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1469    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1470    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1471    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1472        mem_base = xmlMemBlocks();
1473        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1474        user_data = gen_userdata(n_user_data, 1);
1475        chunk = gen_const_char_ptr(n_chunk, 2);
1476        size = gen_int(n_size, 3);
1477        filename = gen_fileoutput(n_filename, 4);
1478        enc = gen_xmlCharEncoding(n_enc, 5);
1479
1480        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1481        desret_htmlParserCtxtPtr(ret_val);
1482        call_tests++;
1483        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1484        des_userdata(n_user_data, user_data, 1);
1485        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1486        des_int(n_size, size, 3);
1487        des_fileoutput(n_filename, filename, 4);
1488        des_xmlCharEncoding(n_enc, enc, 5);
1489        xmlResetLastError();
1490        if (mem_base != xmlMemBlocks()) {
1491            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1492	           xmlMemBlocks() - mem_base);
1493	    test_ret++;
1494            printf(" %d", n_sax);
1495            printf(" %d", n_user_data);
1496            printf(" %d", n_chunk);
1497            printf(" %d", n_size);
1498            printf(" %d", n_filename);
1499            printf(" %d", n_enc);
1500            printf("\n");
1501        }
1502    }
1503    }
1504    }
1505    }
1506    }
1507    }
1508    function_tests++;
1509#endif
1510
1511    return(test_ret);
1512}
1513
1514
1515static int
1516test_htmlCtxtReadDoc(void) {
1517    int test_ret = 0;
1518
1519#if defined(LIBXML_HTML_ENABLED)
1520    int mem_base;
1521    htmlDocPtr ret_val;
1522    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1523    int n_ctxt;
1524    xmlChar * cur; /* a pointer to a zero terminated string */
1525    int n_cur;
1526    const char * URL; /* the base URL to use for the document */
1527    int n_URL;
1528    char * encoding; /* the document encoding, or NULL */
1529    int n_encoding;
1530    int options; /* a combination of htmlParserOption(s) */
1531    int n_options;
1532
1533    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1534    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1535    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1536    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1537    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1538        mem_base = xmlMemBlocks();
1539        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1540        cur = gen_const_xmlChar_ptr(n_cur, 1);
1541        URL = gen_filepath(n_URL, 2);
1542        encoding = gen_const_char_ptr(n_encoding, 3);
1543        options = gen_int(n_options, 4);
1544
1545        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1546        desret_htmlDocPtr(ret_val);
1547        call_tests++;
1548        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1549        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1550        des_filepath(n_URL, URL, 2);
1551        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1552        des_int(n_options, options, 4);
1553        xmlResetLastError();
1554        if (mem_base != xmlMemBlocks()) {
1555            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1556	           xmlMemBlocks() - mem_base);
1557	    test_ret++;
1558            printf(" %d", n_ctxt);
1559            printf(" %d", n_cur);
1560            printf(" %d", n_URL);
1561            printf(" %d", n_encoding);
1562            printf(" %d", n_options);
1563            printf("\n");
1564        }
1565    }
1566    }
1567    }
1568    }
1569    }
1570    function_tests++;
1571#endif
1572
1573    return(test_ret);
1574}
1575
1576
1577static int
1578test_htmlCtxtReadFile(void) {
1579    int test_ret = 0;
1580
1581#if defined(LIBXML_HTML_ENABLED)
1582    htmlDocPtr ret_val;
1583    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1584    int n_ctxt;
1585    const char * filename; /* a file or URL */
1586    int n_filename;
1587    char * encoding; /* the document encoding, or NULL */
1588    int n_encoding;
1589    int options; /* a combination of htmlParserOption(s) */
1590    int n_options;
1591
1592    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1593    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1594    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1595    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1596        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1597        filename = gen_filepath(n_filename, 1);
1598        encoding = gen_const_char_ptr(n_encoding, 2);
1599        options = gen_int(n_options, 3);
1600
1601        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1602        desret_htmlDocPtr(ret_val);
1603        call_tests++;
1604        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1605        des_filepath(n_filename, filename, 1);
1606        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1607        des_int(n_options, options, 3);
1608        xmlResetLastError();
1609    }
1610    }
1611    }
1612    }
1613    function_tests++;
1614#endif
1615
1616    return(test_ret);
1617}
1618
1619
1620static int
1621test_htmlCtxtReadMemory(void) {
1622    int test_ret = 0;
1623
1624#if defined(LIBXML_HTML_ENABLED)
1625    int mem_base;
1626    htmlDocPtr ret_val;
1627    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1628    int n_ctxt;
1629    char * buffer; /* a pointer to a char array */
1630    int n_buffer;
1631    int size; /* the size of the array */
1632    int n_size;
1633    const char * URL; /* the base URL to use for the document */
1634    int n_URL;
1635    char * encoding; /* the document encoding, or NULL */
1636    int n_encoding;
1637    int options; /* a combination of htmlParserOption(s) */
1638    int n_options;
1639
1640    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1641    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1642    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1643    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1644    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1645    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1646        mem_base = xmlMemBlocks();
1647        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1648        buffer = gen_const_char_ptr(n_buffer, 1);
1649        size = gen_int(n_size, 2);
1650        URL = gen_filepath(n_URL, 3);
1651        encoding = gen_const_char_ptr(n_encoding, 4);
1652        options = gen_int(n_options, 5);
1653
1654        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1655        desret_htmlDocPtr(ret_val);
1656        call_tests++;
1657        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1658        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1659        des_int(n_size, size, 2);
1660        des_filepath(n_URL, URL, 3);
1661        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1662        des_int(n_options, options, 5);
1663        xmlResetLastError();
1664        if (mem_base != xmlMemBlocks()) {
1665            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1666	           xmlMemBlocks() - mem_base);
1667	    test_ret++;
1668            printf(" %d", n_ctxt);
1669            printf(" %d", n_buffer);
1670            printf(" %d", n_size);
1671            printf(" %d", n_URL);
1672            printf(" %d", n_encoding);
1673            printf(" %d", n_options);
1674            printf("\n");
1675        }
1676    }
1677    }
1678    }
1679    }
1680    }
1681    }
1682    function_tests++;
1683#endif
1684
1685    return(test_ret);
1686}
1687
1688
1689static int
1690test_htmlCtxtReset(void) {
1691    int test_ret = 0;
1692
1693#if defined(LIBXML_HTML_ENABLED)
1694    int mem_base;
1695    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1696    int n_ctxt;
1697
1698    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1699        mem_base = xmlMemBlocks();
1700        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1701
1702        htmlCtxtReset(ctxt);
1703        call_tests++;
1704        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1705        xmlResetLastError();
1706        if (mem_base != xmlMemBlocks()) {
1707            printf("Leak of %d blocks found in htmlCtxtReset",
1708	           xmlMemBlocks() - mem_base);
1709	    test_ret++;
1710            printf(" %d", n_ctxt);
1711            printf("\n");
1712        }
1713    }
1714    function_tests++;
1715#endif
1716
1717    return(test_ret);
1718}
1719
1720
1721static int
1722test_htmlCtxtUseOptions(void) {
1723    int test_ret = 0;
1724
1725#if defined(LIBXML_HTML_ENABLED)
1726    int mem_base;
1727    int ret_val;
1728    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1729    int n_ctxt;
1730    int options; /* a combination of htmlParserOption(s) */
1731    int n_options;
1732
1733    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1734    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1735        mem_base = xmlMemBlocks();
1736        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1737        options = gen_int(n_options, 1);
1738
1739        ret_val = htmlCtxtUseOptions(ctxt, options);
1740        desret_int(ret_val);
1741        call_tests++;
1742        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1743        des_int(n_options, options, 1);
1744        xmlResetLastError();
1745        if (mem_base != xmlMemBlocks()) {
1746            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1747	           xmlMemBlocks() - mem_base);
1748	    test_ret++;
1749            printf(" %d", n_ctxt);
1750            printf(" %d", n_options);
1751            printf("\n");
1752        }
1753    }
1754    }
1755    function_tests++;
1756#endif
1757
1758    return(test_ret);
1759}
1760
1761
1762static int
1763test_htmlElementAllowedHere(void) {
1764    int test_ret = 0;
1765
1766#if defined(LIBXML_HTML_ENABLED)
1767    int mem_base;
1768    int ret_val;
1769    htmlElemDesc * parent; /* HTML parent element */
1770    int n_parent;
1771    xmlChar * elt; /* HTML element */
1772    int n_elt;
1773
1774    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1775    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1776        mem_base = xmlMemBlocks();
1777        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1778        elt = gen_const_xmlChar_ptr(n_elt, 1);
1779
1780        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1781        desret_int(ret_val);
1782        call_tests++;
1783        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1784        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1785        xmlResetLastError();
1786        if (mem_base != xmlMemBlocks()) {
1787            printf("Leak of %d blocks found in htmlElementAllowedHere",
1788	           xmlMemBlocks() - mem_base);
1789	    test_ret++;
1790            printf(" %d", n_parent);
1791            printf(" %d", n_elt);
1792            printf("\n");
1793        }
1794    }
1795    }
1796    function_tests++;
1797#endif
1798
1799    return(test_ret);
1800}
1801
1802
1803static int
1804test_htmlElementStatusHere(void) {
1805    int test_ret = 0;
1806
1807#if defined(LIBXML_HTML_ENABLED)
1808    int mem_base;
1809    htmlStatus ret_val;
1810    htmlElemDesc * parent; /* HTML parent element */
1811    int n_parent;
1812    htmlElemDesc * elt; /* HTML element */
1813    int n_elt;
1814
1815    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1816    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1817        mem_base = xmlMemBlocks();
1818        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1819        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1820
1821        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1822        desret_htmlStatus(ret_val);
1823        call_tests++;
1824        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1825        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1826        xmlResetLastError();
1827        if (mem_base != xmlMemBlocks()) {
1828            printf("Leak of %d blocks found in htmlElementStatusHere",
1829	           xmlMemBlocks() - mem_base);
1830	    test_ret++;
1831            printf(" %d", n_parent);
1832            printf(" %d", n_elt);
1833            printf("\n");
1834        }
1835    }
1836    }
1837    function_tests++;
1838#endif
1839
1840    return(test_ret);
1841}
1842
1843
1844static int
1845test_htmlEncodeEntities(void) {
1846    int test_ret = 0;
1847
1848#if defined(LIBXML_HTML_ENABLED)
1849    int mem_base;
1850    int ret_val;
1851    unsigned char * out; /* a pointer to an array of bytes to store the result */
1852    int n_out;
1853    int * outlen; /* the length of @out */
1854    int n_outlen;
1855    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1856    int n_in;
1857    int * inlen; /* the length of @in */
1858    int n_inlen;
1859    int quoteChar; /* the quote character to escape (' or ") or zero. */
1860    int n_quoteChar;
1861
1862    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1863    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1864    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1865    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1866    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1867        mem_base = xmlMemBlocks();
1868        out = gen_unsigned_char_ptr(n_out, 0);
1869        outlen = gen_int_ptr(n_outlen, 1);
1870        in = gen_const_unsigned_char_ptr(n_in, 2);
1871        inlen = gen_int_ptr(n_inlen, 3);
1872        quoteChar = gen_int(n_quoteChar, 4);
1873
1874        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1875        desret_int(ret_val);
1876        call_tests++;
1877        des_unsigned_char_ptr(n_out, out, 0);
1878        des_int_ptr(n_outlen, outlen, 1);
1879        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1880        des_int_ptr(n_inlen, inlen, 3);
1881        des_int(n_quoteChar, quoteChar, 4);
1882        xmlResetLastError();
1883        if (mem_base != xmlMemBlocks()) {
1884            printf("Leak of %d blocks found in htmlEncodeEntities",
1885	           xmlMemBlocks() - mem_base);
1886	    test_ret++;
1887            printf(" %d", n_out);
1888            printf(" %d", n_outlen);
1889            printf(" %d", n_in);
1890            printf(" %d", n_inlen);
1891            printf(" %d", n_quoteChar);
1892            printf("\n");
1893        }
1894    }
1895    }
1896    }
1897    }
1898    }
1899    function_tests++;
1900#endif
1901
1902    return(test_ret);
1903}
1904
1905
1906static int
1907test_htmlEntityLookup(void) {
1908    int test_ret = 0;
1909
1910#if defined(LIBXML_HTML_ENABLED)
1911    int mem_base;
1912    const htmlEntityDesc * ret_val;
1913    xmlChar * name; /* the entity name */
1914    int n_name;
1915
1916    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1917        mem_base = xmlMemBlocks();
1918        name = gen_const_xmlChar_ptr(n_name, 0);
1919
1920        ret_val = htmlEntityLookup((const xmlChar *)name);
1921        desret_const_htmlEntityDesc_ptr(ret_val);
1922        call_tests++;
1923        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1924        xmlResetLastError();
1925        if (mem_base != xmlMemBlocks()) {
1926            printf("Leak of %d blocks found in htmlEntityLookup",
1927	           xmlMemBlocks() - mem_base);
1928	    test_ret++;
1929            printf(" %d", n_name);
1930            printf("\n");
1931        }
1932    }
1933    function_tests++;
1934#endif
1935
1936    return(test_ret);
1937}
1938
1939
1940static int
1941test_htmlEntityValueLookup(void) {
1942    int test_ret = 0;
1943
1944#if defined(LIBXML_HTML_ENABLED)
1945    int mem_base;
1946    const htmlEntityDesc * ret_val;
1947    unsigned int value; /* the entity's unicode value */
1948    int n_value;
1949
1950    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
1951        mem_base = xmlMemBlocks();
1952        value = gen_unsigned_int(n_value, 0);
1953
1954        ret_val = htmlEntityValueLookup(value);
1955        desret_const_htmlEntityDesc_ptr(ret_val);
1956        call_tests++;
1957        des_unsigned_int(n_value, value, 0);
1958        xmlResetLastError();
1959        if (mem_base != xmlMemBlocks()) {
1960            printf("Leak of %d blocks found in htmlEntityValueLookup",
1961	           xmlMemBlocks() - mem_base);
1962	    test_ret++;
1963            printf(" %d", n_value);
1964            printf("\n");
1965        }
1966    }
1967    function_tests++;
1968#endif
1969
1970    return(test_ret);
1971}
1972
1973
1974static int
1975test_htmlHandleOmittedElem(void) {
1976    int test_ret = 0;
1977
1978#if defined(LIBXML_HTML_ENABLED)
1979    int mem_base;
1980    int ret_val;
1981    int val; /* int 0 or 1 */
1982    int n_val;
1983
1984    for (n_val = 0;n_val < gen_nb_int;n_val++) {
1985        mem_base = xmlMemBlocks();
1986        val = gen_int(n_val, 0);
1987
1988        ret_val = htmlHandleOmittedElem(val);
1989        desret_int(ret_val);
1990        call_tests++;
1991        des_int(n_val, val, 0);
1992        xmlResetLastError();
1993        if (mem_base != xmlMemBlocks()) {
1994            printf("Leak of %d blocks found in htmlHandleOmittedElem",
1995	           xmlMemBlocks() - mem_base);
1996	    test_ret++;
1997            printf(" %d", n_val);
1998            printf("\n");
1999        }
2000    }
2001    function_tests++;
2002#endif
2003
2004    return(test_ret);
2005}
2006
2007
2008static int
2009test_htmlIsAutoClosed(void) {
2010    int test_ret = 0;
2011
2012#if defined(LIBXML_HTML_ENABLED)
2013    int mem_base;
2014    int ret_val;
2015    htmlDocPtr doc; /* the HTML document */
2016    int n_doc;
2017    htmlNodePtr elem; /* the HTML element */
2018    int n_elem;
2019
2020    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2021    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2022        mem_base = xmlMemBlocks();
2023        doc = gen_htmlDocPtr(n_doc, 0);
2024        elem = gen_htmlNodePtr(n_elem, 1);
2025
2026        ret_val = htmlIsAutoClosed(doc, elem);
2027        desret_int(ret_val);
2028        call_tests++;
2029        des_htmlDocPtr(n_doc, doc, 0);
2030        des_htmlNodePtr(n_elem, elem, 1);
2031        xmlResetLastError();
2032        if (mem_base != xmlMemBlocks()) {
2033            printf("Leak of %d blocks found in htmlIsAutoClosed",
2034	           xmlMemBlocks() - mem_base);
2035	    test_ret++;
2036            printf(" %d", n_doc);
2037            printf(" %d", n_elem);
2038            printf("\n");
2039        }
2040    }
2041    }
2042    function_tests++;
2043#endif
2044
2045    return(test_ret);
2046}
2047
2048
2049static int
2050test_htmlIsScriptAttribute(void) {
2051    int test_ret = 0;
2052
2053#if defined(LIBXML_HTML_ENABLED)
2054    int mem_base;
2055    int ret_val;
2056    xmlChar * name; /* an attribute name */
2057    int n_name;
2058
2059    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2060        mem_base = xmlMemBlocks();
2061        name = gen_const_xmlChar_ptr(n_name, 0);
2062
2063        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2064        desret_int(ret_val);
2065        call_tests++;
2066        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2067        xmlResetLastError();
2068        if (mem_base != xmlMemBlocks()) {
2069            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2070	           xmlMemBlocks() - mem_base);
2071	    test_ret++;
2072            printf(" %d", n_name);
2073            printf("\n");
2074        }
2075    }
2076    function_tests++;
2077#endif
2078
2079    return(test_ret);
2080}
2081
2082
2083static int
2084test_htmlNodeStatus(void) {
2085    int test_ret = 0;
2086
2087#if defined(LIBXML_HTML_ENABLED)
2088    int mem_base;
2089    htmlStatus ret_val;
2090    htmlNodePtr node; /* an htmlNodePtr in a tree */
2091    int n_node;
2092    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2093    int n_legacy;
2094
2095    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2096    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2097        mem_base = xmlMemBlocks();
2098        node = gen_const_htmlNodePtr(n_node, 0);
2099        legacy = gen_int(n_legacy, 1);
2100
2101        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2102        desret_htmlStatus(ret_val);
2103        call_tests++;
2104        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2105        des_int(n_legacy, legacy, 1);
2106        xmlResetLastError();
2107        if (mem_base != xmlMemBlocks()) {
2108            printf("Leak of %d blocks found in htmlNodeStatus",
2109	           xmlMemBlocks() - mem_base);
2110	    test_ret++;
2111            printf(" %d", n_node);
2112            printf(" %d", n_legacy);
2113            printf("\n");
2114        }
2115    }
2116    }
2117    function_tests++;
2118#endif
2119
2120    return(test_ret);
2121}
2122
2123
2124static int
2125test_htmlParseCharRef(void) {
2126    int test_ret = 0;
2127
2128#if defined(LIBXML_HTML_ENABLED)
2129    int mem_base;
2130    int ret_val;
2131    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2132    int n_ctxt;
2133
2134    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2135        mem_base = xmlMemBlocks();
2136        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2137
2138        ret_val = htmlParseCharRef(ctxt);
2139        desret_int(ret_val);
2140        call_tests++;
2141        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2142        xmlResetLastError();
2143        if (mem_base != xmlMemBlocks()) {
2144            printf("Leak of %d blocks found in htmlParseCharRef",
2145	           xmlMemBlocks() - mem_base);
2146	    test_ret++;
2147            printf(" %d", n_ctxt);
2148            printf("\n");
2149        }
2150    }
2151    function_tests++;
2152#endif
2153
2154    return(test_ret);
2155}
2156
2157
2158static int
2159test_htmlParseChunk(void) {
2160    int test_ret = 0;
2161
2162#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2163    int mem_base;
2164    int ret_val;
2165    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2166    int n_ctxt;
2167    char * chunk; /* an char array */
2168    int n_chunk;
2169    int size; /* the size in byte of the chunk */
2170    int n_size;
2171    int terminate; /* last chunk indicator */
2172    int n_terminate;
2173
2174    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2175    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2176    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2177    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2178        mem_base = xmlMemBlocks();
2179        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2180        chunk = gen_const_char_ptr(n_chunk, 1);
2181        size = gen_int(n_size, 2);
2182        terminate = gen_int(n_terminate, 3);
2183
2184        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2185        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2186        desret_int(ret_val);
2187        call_tests++;
2188        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2189        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2190        des_int(n_size, size, 2);
2191        des_int(n_terminate, terminate, 3);
2192        xmlResetLastError();
2193        if (mem_base != xmlMemBlocks()) {
2194            printf("Leak of %d blocks found in htmlParseChunk",
2195	           xmlMemBlocks() - mem_base);
2196	    test_ret++;
2197            printf(" %d", n_ctxt);
2198            printf(" %d", n_chunk);
2199            printf(" %d", n_size);
2200            printf(" %d", n_terminate);
2201            printf("\n");
2202        }
2203    }
2204    }
2205    }
2206    }
2207    function_tests++;
2208#endif
2209
2210    return(test_ret);
2211}
2212
2213
2214static int
2215test_htmlParseDoc(void) {
2216    int test_ret = 0;
2217
2218#if defined(LIBXML_HTML_ENABLED)
2219    int mem_base;
2220    htmlDocPtr ret_val;
2221    xmlChar * cur; /* a pointer to an array of xmlChar */
2222    int n_cur;
2223    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2224    int n_encoding;
2225
2226    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2227    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2228        mem_base = xmlMemBlocks();
2229        cur = gen_xmlChar_ptr(n_cur, 0);
2230        encoding = gen_const_char_ptr(n_encoding, 1);
2231
2232        ret_val = htmlParseDoc(cur, (const char *)encoding);
2233        desret_htmlDocPtr(ret_val);
2234        call_tests++;
2235        des_xmlChar_ptr(n_cur, cur, 0);
2236        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2237        xmlResetLastError();
2238        if (mem_base != xmlMemBlocks()) {
2239            printf("Leak of %d blocks found in htmlParseDoc",
2240	           xmlMemBlocks() - mem_base);
2241	    test_ret++;
2242            printf(" %d", n_cur);
2243            printf(" %d", n_encoding);
2244            printf("\n");
2245        }
2246    }
2247    }
2248    function_tests++;
2249#endif
2250
2251    return(test_ret);
2252}
2253
2254
2255static int
2256test_htmlParseDocument(void) {
2257    int test_ret = 0;
2258
2259#if defined(LIBXML_HTML_ENABLED)
2260    int mem_base;
2261    int ret_val;
2262    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2263    int n_ctxt;
2264
2265    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2266        mem_base = xmlMemBlocks();
2267        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2268
2269        ret_val = htmlParseDocument(ctxt);
2270        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2271        desret_int(ret_val);
2272        call_tests++;
2273        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2274        xmlResetLastError();
2275        if (mem_base != xmlMemBlocks()) {
2276            printf("Leak of %d blocks found in htmlParseDocument",
2277	           xmlMemBlocks() - mem_base);
2278	    test_ret++;
2279            printf(" %d", n_ctxt);
2280            printf("\n");
2281        }
2282    }
2283    function_tests++;
2284#endif
2285
2286    return(test_ret);
2287}
2288
2289
2290static int
2291test_htmlParseElement(void) {
2292    int test_ret = 0;
2293
2294#if defined(LIBXML_HTML_ENABLED)
2295    int mem_base;
2296    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2297    int n_ctxt;
2298
2299    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2300        mem_base = xmlMemBlocks();
2301        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2302
2303        htmlParseElement(ctxt);
2304        call_tests++;
2305        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2306        xmlResetLastError();
2307        if (mem_base != xmlMemBlocks()) {
2308            printf("Leak of %d blocks found in htmlParseElement",
2309	           xmlMemBlocks() - mem_base);
2310	    test_ret++;
2311            printf(" %d", n_ctxt);
2312            printf("\n");
2313        }
2314    }
2315    function_tests++;
2316#endif
2317
2318    return(test_ret);
2319}
2320
2321
2322static int
2323test_htmlParseEntityRef(void) {
2324    int test_ret = 0;
2325
2326#if defined(LIBXML_HTML_ENABLED)
2327    int mem_base;
2328    const htmlEntityDesc * ret_val;
2329    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2330    int n_ctxt;
2331    xmlChar ** str; /* location to store the entity name */
2332    int n_str;
2333
2334    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2335    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2336        mem_base = xmlMemBlocks();
2337        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2338        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2339
2340        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2341        desret_const_htmlEntityDesc_ptr(ret_val);
2342        call_tests++;
2343        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2344        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2345        xmlResetLastError();
2346        if (mem_base != xmlMemBlocks()) {
2347            printf("Leak of %d blocks found in htmlParseEntityRef",
2348	           xmlMemBlocks() - mem_base);
2349	    test_ret++;
2350            printf(" %d", n_ctxt);
2351            printf(" %d", n_str);
2352            printf("\n");
2353        }
2354    }
2355    }
2356    function_tests++;
2357#endif
2358
2359    return(test_ret);
2360}
2361
2362
2363static int
2364test_htmlParseFile(void) {
2365    int test_ret = 0;
2366
2367#if defined(LIBXML_HTML_ENABLED)
2368    htmlDocPtr ret_val;
2369    const char * filename; /* the filename */
2370    int n_filename;
2371    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2372    int n_encoding;
2373
2374    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2375    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2376        filename = gen_filepath(n_filename, 0);
2377        encoding = gen_const_char_ptr(n_encoding, 1);
2378
2379        ret_val = htmlParseFile(filename, (const char *)encoding);
2380        desret_htmlDocPtr(ret_val);
2381        call_tests++;
2382        des_filepath(n_filename, filename, 0);
2383        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2384        xmlResetLastError();
2385    }
2386    }
2387    function_tests++;
2388#endif
2389
2390    return(test_ret);
2391}
2392
2393
2394static int
2395test_htmlReadDoc(void) {
2396    int test_ret = 0;
2397
2398#if defined(LIBXML_HTML_ENABLED)
2399    int mem_base;
2400    htmlDocPtr ret_val;
2401    xmlChar * cur; /* a pointer to a zero terminated string */
2402    int n_cur;
2403    const char * URL; /* the base URL to use for the document */
2404    int n_URL;
2405    char * encoding; /* the document encoding, or NULL */
2406    int n_encoding;
2407    int options; /* a combination of htmlParserOption(s) */
2408    int n_options;
2409
2410    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2411    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2412    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2413    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2414        mem_base = xmlMemBlocks();
2415        cur = gen_const_xmlChar_ptr(n_cur, 0);
2416        URL = gen_filepath(n_URL, 1);
2417        encoding = gen_const_char_ptr(n_encoding, 2);
2418        options = gen_int(n_options, 3);
2419
2420        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2421        desret_htmlDocPtr(ret_val);
2422        call_tests++;
2423        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2424        des_filepath(n_URL, URL, 1);
2425        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2426        des_int(n_options, options, 3);
2427        xmlResetLastError();
2428        if (mem_base != xmlMemBlocks()) {
2429            printf("Leak of %d blocks found in htmlReadDoc",
2430	           xmlMemBlocks() - mem_base);
2431	    test_ret++;
2432            printf(" %d", n_cur);
2433            printf(" %d", n_URL);
2434            printf(" %d", n_encoding);
2435            printf(" %d", n_options);
2436            printf("\n");
2437        }
2438    }
2439    }
2440    }
2441    }
2442    function_tests++;
2443#endif
2444
2445    return(test_ret);
2446}
2447
2448
2449static int
2450test_htmlReadFile(void) {
2451    int test_ret = 0;
2452
2453#if defined(LIBXML_HTML_ENABLED)
2454    int mem_base;
2455    htmlDocPtr ret_val;
2456    const char * filename; /* a file or URL */
2457    int n_filename;
2458    char * encoding; /* the document encoding, or NULL */
2459    int n_encoding;
2460    int options; /* a combination of htmlParserOption(s) */
2461    int n_options;
2462
2463    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2464    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2465    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2466        mem_base = xmlMemBlocks();
2467        filename = gen_filepath(n_filename, 0);
2468        encoding = gen_const_char_ptr(n_encoding, 1);
2469        options = gen_int(n_options, 2);
2470
2471        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2472        desret_htmlDocPtr(ret_val);
2473        call_tests++;
2474        des_filepath(n_filename, filename, 0);
2475        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2476        des_int(n_options, options, 2);
2477        xmlResetLastError();
2478        if (mem_base != xmlMemBlocks()) {
2479            printf("Leak of %d blocks found in htmlReadFile",
2480	           xmlMemBlocks() - mem_base);
2481	    test_ret++;
2482            printf(" %d", n_filename);
2483            printf(" %d", n_encoding);
2484            printf(" %d", n_options);
2485            printf("\n");
2486        }
2487    }
2488    }
2489    }
2490    function_tests++;
2491#endif
2492
2493    return(test_ret);
2494}
2495
2496
2497static int
2498test_htmlReadMemory(void) {
2499    int test_ret = 0;
2500
2501#if defined(LIBXML_HTML_ENABLED)
2502    int mem_base;
2503    htmlDocPtr ret_val;
2504    char * buffer; /* a pointer to a char array */
2505    int n_buffer;
2506    int size; /* the size of the array */
2507    int n_size;
2508    const char * URL; /* the base URL to use for the document */
2509    int n_URL;
2510    char * encoding; /* the document encoding, or NULL */
2511    int n_encoding;
2512    int options; /* a combination of htmlParserOption(s) */
2513    int n_options;
2514
2515    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2516    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2517    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2518    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2519    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2520        mem_base = xmlMemBlocks();
2521        buffer = gen_const_char_ptr(n_buffer, 0);
2522        size = gen_int(n_size, 1);
2523        URL = gen_filepath(n_URL, 2);
2524        encoding = gen_const_char_ptr(n_encoding, 3);
2525        options = gen_int(n_options, 4);
2526
2527        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2528        desret_htmlDocPtr(ret_val);
2529        call_tests++;
2530        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2531        des_int(n_size, size, 1);
2532        des_filepath(n_URL, URL, 2);
2533        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2534        des_int(n_options, options, 4);
2535        xmlResetLastError();
2536        if (mem_base != xmlMemBlocks()) {
2537            printf("Leak of %d blocks found in htmlReadMemory",
2538	           xmlMemBlocks() - mem_base);
2539	    test_ret++;
2540            printf(" %d", n_buffer);
2541            printf(" %d", n_size);
2542            printf(" %d", n_URL);
2543            printf(" %d", n_encoding);
2544            printf(" %d", n_options);
2545            printf("\n");
2546        }
2547    }
2548    }
2549    }
2550    }
2551    }
2552    function_tests++;
2553#endif
2554
2555    return(test_ret);
2556}
2557
2558
2559static int
2560test_htmlSAXParseDoc(void) {
2561    int test_ret = 0;
2562
2563#if defined(LIBXML_HTML_ENABLED)
2564    int mem_base;
2565    htmlDocPtr ret_val;
2566    xmlChar * cur; /* a pointer to an array of xmlChar */
2567    int n_cur;
2568    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2569    int n_encoding;
2570    htmlSAXHandlerPtr sax; /* the SAX handler block */
2571    int n_sax;
2572    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2573    int n_userData;
2574
2575    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2576    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2577    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2578    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2579        mem_base = xmlMemBlocks();
2580        cur = gen_xmlChar_ptr(n_cur, 0);
2581        encoding = gen_const_char_ptr(n_encoding, 1);
2582        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2583        userData = gen_userdata(n_userData, 3);
2584
2585        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2586        desret_htmlDocPtr(ret_val);
2587        call_tests++;
2588        des_xmlChar_ptr(n_cur, cur, 0);
2589        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2590        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2591        des_userdata(n_userData, userData, 3);
2592        xmlResetLastError();
2593        if (mem_base != xmlMemBlocks()) {
2594            printf("Leak of %d blocks found in htmlSAXParseDoc",
2595	           xmlMemBlocks() - mem_base);
2596	    test_ret++;
2597            printf(" %d", n_cur);
2598            printf(" %d", n_encoding);
2599            printf(" %d", n_sax);
2600            printf(" %d", n_userData);
2601            printf("\n");
2602        }
2603    }
2604    }
2605    }
2606    }
2607    function_tests++;
2608#endif
2609
2610    return(test_ret);
2611}
2612
2613
2614static int
2615test_htmlSAXParseFile(void) {
2616    int test_ret = 0;
2617
2618#if defined(LIBXML_HTML_ENABLED)
2619    int mem_base;
2620    htmlDocPtr ret_val;
2621    const char * filename; /* the filename */
2622    int n_filename;
2623    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2624    int n_encoding;
2625    htmlSAXHandlerPtr sax; /* the SAX handler block */
2626    int n_sax;
2627    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2628    int n_userData;
2629
2630    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2631    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2632    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2633    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2634        mem_base = xmlMemBlocks();
2635        filename = gen_filepath(n_filename, 0);
2636        encoding = gen_const_char_ptr(n_encoding, 1);
2637        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2638        userData = gen_userdata(n_userData, 3);
2639
2640        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2641        desret_htmlDocPtr(ret_val);
2642        call_tests++;
2643        des_filepath(n_filename, filename, 0);
2644        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2645        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2646        des_userdata(n_userData, userData, 3);
2647        xmlResetLastError();
2648        if (mem_base != xmlMemBlocks()) {
2649            printf("Leak of %d blocks found in htmlSAXParseFile",
2650	           xmlMemBlocks() - mem_base);
2651	    test_ret++;
2652            printf(" %d", n_filename);
2653            printf(" %d", n_encoding);
2654            printf(" %d", n_sax);
2655            printf(" %d", n_userData);
2656            printf("\n");
2657        }
2658    }
2659    }
2660    }
2661    }
2662    function_tests++;
2663#endif
2664
2665    return(test_ret);
2666}
2667
2668
2669static int
2670test_htmlTagLookup(void) {
2671    int test_ret = 0;
2672
2673
2674    /* missing type support */
2675    return(test_ret);
2676}
2677
2678static int
2679test_HTMLparser(void) {
2680    int test_ret = 0;
2681
2682    if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n");
2683    test_ret += test_UTF8ToHtml();
2684    test_ret += test_htmlAttrAllowed();
2685    test_ret += test_htmlAutoCloseTag();
2686    test_ret += test_htmlCreateMemoryParserCtxt();
2687    test_ret += test_htmlCreatePushParserCtxt();
2688    test_ret += test_htmlCtxtReadDoc();
2689    test_ret += test_htmlCtxtReadFile();
2690    test_ret += test_htmlCtxtReadMemory();
2691    test_ret += test_htmlCtxtReset();
2692    test_ret += test_htmlCtxtUseOptions();
2693    test_ret += test_htmlElementAllowedHere();
2694    test_ret += test_htmlElementStatusHere();
2695    test_ret += test_htmlEncodeEntities();
2696    test_ret += test_htmlEntityLookup();
2697    test_ret += test_htmlEntityValueLookup();
2698    test_ret += test_htmlHandleOmittedElem();
2699    test_ret += test_htmlIsAutoClosed();
2700    test_ret += test_htmlIsScriptAttribute();
2701    test_ret += test_htmlNodeStatus();
2702    test_ret += test_htmlParseCharRef();
2703    test_ret += test_htmlParseChunk();
2704    test_ret += test_htmlParseDoc();
2705    test_ret += test_htmlParseDocument();
2706    test_ret += test_htmlParseElement();
2707    test_ret += test_htmlParseEntityRef();
2708    test_ret += test_htmlParseFile();
2709    test_ret += test_htmlReadDoc();
2710    test_ret += test_htmlReadFile();
2711    test_ret += test_htmlReadMemory();
2712    test_ret += test_htmlSAXParseDoc();
2713    test_ret += test_htmlSAXParseFile();
2714    test_ret += test_htmlTagLookup();
2715
2716    if (test_ret != 0)
2717	printf("Module HTMLparser: %d errors\n", test_ret);
2718    return(test_ret);
2719}
2720
2721static int
2722test_htmlDocContentDumpFormatOutput(void) {
2723    int test_ret = 0;
2724
2725#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2726    int mem_base;
2727    xmlOutputBufferPtr buf; /* the HTML buffer output */
2728    int n_buf;
2729    xmlDocPtr cur; /* the document */
2730    int n_cur;
2731    char * encoding; /* the encoding string */
2732    int n_encoding;
2733    int format; /* should formatting spaces been added */
2734    int n_format;
2735
2736    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2737    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2738    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2739    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2740        mem_base = xmlMemBlocks();
2741        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2742        cur = gen_xmlDocPtr(n_cur, 1);
2743        encoding = gen_const_char_ptr(n_encoding, 2);
2744        format = gen_int(n_format, 3);
2745
2746        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2747        call_tests++;
2748        des_xmlOutputBufferPtr(n_buf, buf, 0);
2749        des_xmlDocPtr(n_cur, cur, 1);
2750        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2751        des_int(n_format, format, 3);
2752        xmlResetLastError();
2753        if (mem_base != xmlMemBlocks()) {
2754            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2755	           xmlMemBlocks() - mem_base);
2756	    test_ret++;
2757            printf(" %d", n_buf);
2758            printf(" %d", n_cur);
2759            printf(" %d", n_encoding);
2760            printf(" %d", n_format);
2761            printf("\n");
2762        }
2763    }
2764    }
2765    }
2766    }
2767    function_tests++;
2768#endif
2769
2770    return(test_ret);
2771}
2772
2773
2774static int
2775test_htmlDocContentDumpOutput(void) {
2776    int test_ret = 0;
2777
2778#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2779    int mem_base;
2780    xmlOutputBufferPtr buf; /* the HTML buffer output */
2781    int n_buf;
2782    xmlDocPtr cur; /* the document */
2783    int n_cur;
2784    char * encoding; /* the encoding string */
2785    int n_encoding;
2786
2787    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2788    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2789    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2790        mem_base = xmlMemBlocks();
2791        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2792        cur = gen_xmlDocPtr(n_cur, 1);
2793        encoding = gen_const_char_ptr(n_encoding, 2);
2794
2795        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2796        call_tests++;
2797        des_xmlOutputBufferPtr(n_buf, buf, 0);
2798        des_xmlDocPtr(n_cur, cur, 1);
2799        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2800        xmlResetLastError();
2801        if (mem_base != xmlMemBlocks()) {
2802            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2803	           xmlMemBlocks() - mem_base);
2804	    test_ret++;
2805            printf(" %d", n_buf);
2806            printf(" %d", n_cur);
2807            printf(" %d", n_encoding);
2808            printf("\n");
2809        }
2810    }
2811    }
2812    }
2813    function_tests++;
2814#endif
2815
2816    return(test_ret);
2817}
2818
2819
2820static int
2821test_htmlDocDump(void) {
2822    int test_ret = 0;
2823
2824#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2825    int mem_base;
2826    int ret_val;
2827    FILE * f; /* the FILE* */
2828    int n_f;
2829    xmlDocPtr cur; /* the document */
2830    int n_cur;
2831
2832    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2833    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2834        mem_base = xmlMemBlocks();
2835        f = gen_FILE_ptr(n_f, 0);
2836        cur = gen_xmlDocPtr(n_cur, 1);
2837
2838        ret_val = htmlDocDump(f, cur);
2839        desret_int(ret_val);
2840        call_tests++;
2841        des_FILE_ptr(n_f, f, 0);
2842        des_xmlDocPtr(n_cur, cur, 1);
2843        xmlResetLastError();
2844        if (mem_base != xmlMemBlocks()) {
2845            printf("Leak of %d blocks found in htmlDocDump",
2846	           xmlMemBlocks() - mem_base);
2847	    test_ret++;
2848            printf(" %d", n_f);
2849            printf(" %d", n_cur);
2850            printf("\n");
2851        }
2852    }
2853    }
2854    function_tests++;
2855#endif
2856
2857    return(test_ret);
2858}
2859
2860
2861#define gen_nb_xmlChar_ptr_ptr 1
2862static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2863    return(NULL);
2864}
2865static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2866}
2867
2868static int
2869test_htmlDocDumpMemory(void) {
2870    int test_ret = 0;
2871
2872#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2873    int mem_base;
2874    xmlDocPtr cur; /* the document */
2875    int n_cur;
2876    xmlChar ** mem; /* OUT: the memory pointer */
2877    int n_mem;
2878    int * size; /* OUT: the memory length */
2879    int n_size;
2880
2881    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2882    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2883    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2884        mem_base = xmlMemBlocks();
2885        cur = gen_xmlDocPtr(n_cur, 0);
2886        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2887        size = gen_int_ptr(n_size, 2);
2888
2889        htmlDocDumpMemory(cur, mem, size);
2890        call_tests++;
2891        des_xmlDocPtr(n_cur, cur, 0);
2892        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2893        des_int_ptr(n_size, size, 2);
2894        xmlResetLastError();
2895        if (mem_base != xmlMemBlocks()) {
2896            printf("Leak of %d blocks found in htmlDocDumpMemory",
2897	           xmlMemBlocks() - mem_base);
2898	    test_ret++;
2899            printf(" %d", n_cur);
2900            printf(" %d", n_mem);
2901            printf(" %d", n_size);
2902            printf("\n");
2903        }
2904    }
2905    }
2906    }
2907    function_tests++;
2908#endif
2909
2910    return(test_ret);
2911}
2912
2913
2914static int
2915test_htmlGetMetaEncoding(void) {
2916    int test_ret = 0;
2917
2918#if defined(LIBXML_HTML_ENABLED)
2919    int mem_base;
2920    const xmlChar * ret_val;
2921    htmlDocPtr doc; /* the document */
2922    int n_doc;
2923
2924    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2925        mem_base = xmlMemBlocks();
2926        doc = gen_htmlDocPtr(n_doc, 0);
2927
2928        ret_val = htmlGetMetaEncoding(doc);
2929        desret_const_xmlChar_ptr(ret_val);
2930        call_tests++;
2931        des_htmlDocPtr(n_doc, doc, 0);
2932        xmlResetLastError();
2933        if (mem_base != xmlMemBlocks()) {
2934            printf("Leak of %d blocks found in htmlGetMetaEncoding",
2935	           xmlMemBlocks() - mem_base);
2936	    test_ret++;
2937            printf(" %d", n_doc);
2938            printf("\n");
2939        }
2940    }
2941    function_tests++;
2942#endif
2943
2944    return(test_ret);
2945}
2946
2947
2948static int
2949test_htmlIsBooleanAttr(void) {
2950    int test_ret = 0;
2951
2952#if defined(LIBXML_HTML_ENABLED)
2953    int mem_base;
2954    int ret_val;
2955    xmlChar * name; /* the name of the attribute to check */
2956    int n_name;
2957
2958    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2959        mem_base = xmlMemBlocks();
2960        name = gen_const_xmlChar_ptr(n_name, 0);
2961
2962        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
2963        desret_int(ret_val);
2964        call_tests++;
2965        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2966        xmlResetLastError();
2967        if (mem_base != xmlMemBlocks()) {
2968            printf("Leak of %d blocks found in htmlIsBooleanAttr",
2969	           xmlMemBlocks() - mem_base);
2970	    test_ret++;
2971            printf(" %d", n_name);
2972            printf("\n");
2973        }
2974    }
2975    function_tests++;
2976#endif
2977
2978    return(test_ret);
2979}
2980
2981
2982static int
2983test_htmlNewDoc(void) {
2984    int test_ret = 0;
2985
2986#if defined(LIBXML_HTML_ENABLED)
2987    int mem_base;
2988    htmlDocPtr ret_val;
2989    xmlChar * URI; /* URI for the dtd, or NULL */
2990    int n_URI;
2991    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
2992    int n_ExternalID;
2993
2994    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
2995    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
2996        mem_base = xmlMemBlocks();
2997        URI = gen_const_xmlChar_ptr(n_URI, 0);
2998        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
2999
3000        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3001        desret_htmlDocPtr(ret_val);
3002        call_tests++;
3003        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3004        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3005        xmlResetLastError();
3006        if (mem_base != xmlMemBlocks()) {
3007            printf("Leak of %d blocks found in htmlNewDoc",
3008	           xmlMemBlocks() - mem_base);
3009	    test_ret++;
3010            printf(" %d", n_URI);
3011            printf(" %d", n_ExternalID);
3012            printf("\n");
3013        }
3014    }
3015    }
3016    function_tests++;
3017#endif
3018
3019    return(test_ret);
3020}
3021
3022
3023static int
3024test_htmlNewDocNoDtD(void) {
3025    int test_ret = 0;
3026
3027#if defined(LIBXML_HTML_ENABLED)
3028    int mem_base;
3029    htmlDocPtr ret_val;
3030    xmlChar * URI; /* URI for the dtd, or NULL */
3031    int n_URI;
3032    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3033    int n_ExternalID;
3034
3035    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3036    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3037        mem_base = xmlMemBlocks();
3038        URI = gen_const_xmlChar_ptr(n_URI, 0);
3039        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3040
3041        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3042        desret_htmlDocPtr(ret_val);
3043        call_tests++;
3044        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3045        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3046        xmlResetLastError();
3047        if (mem_base != xmlMemBlocks()) {
3048            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3049	           xmlMemBlocks() - mem_base);
3050	    test_ret++;
3051            printf(" %d", n_URI);
3052            printf(" %d", n_ExternalID);
3053            printf("\n");
3054        }
3055    }
3056    }
3057    function_tests++;
3058#endif
3059
3060    return(test_ret);
3061}
3062
3063
3064static int
3065test_htmlNodeDump(void) {
3066    int test_ret = 0;
3067
3068#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3069    int mem_base;
3070    int ret_val;
3071    xmlBufferPtr buf; /* the HTML buffer output */
3072    int n_buf;
3073    xmlDocPtr doc; /* the document */
3074    int n_doc;
3075    xmlNodePtr cur; /* the current node */
3076    int n_cur;
3077
3078    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3079    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3080    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3081        mem_base = xmlMemBlocks();
3082        buf = gen_xmlBufferPtr(n_buf, 0);
3083        doc = gen_xmlDocPtr(n_doc, 1);
3084        cur = gen_xmlNodePtr(n_cur, 2);
3085
3086        ret_val = htmlNodeDump(buf, doc, cur);
3087        desret_int(ret_val);
3088        call_tests++;
3089        des_xmlBufferPtr(n_buf, buf, 0);
3090        des_xmlDocPtr(n_doc, doc, 1);
3091        des_xmlNodePtr(n_cur, cur, 2);
3092        xmlResetLastError();
3093        if (mem_base != xmlMemBlocks()) {
3094            printf("Leak of %d blocks found in htmlNodeDump",
3095	           xmlMemBlocks() - mem_base);
3096	    test_ret++;
3097            printf(" %d", n_buf);
3098            printf(" %d", n_doc);
3099            printf(" %d", n_cur);
3100            printf("\n");
3101        }
3102    }
3103    }
3104    }
3105    function_tests++;
3106#endif
3107
3108    return(test_ret);
3109}
3110
3111
3112static int
3113test_htmlNodeDumpFile(void) {
3114    int test_ret = 0;
3115
3116#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3117    int mem_base;
3118    FILE * out; /* the FILE pointer */
3119    int n_out;
3120    xmlDocPtr doc; /* the document */
3121    int n_doc;
3122    xmlNodePtr cur; /* the current node */
3123    int n_cur;
3124
3125    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3126    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3127    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3128        mem_base = xmlMemBlocks();
3129        out = gen_FILE_ptr(n_out, 0);
3130        doc = gen_xmlDocPtr(n_doc, 1);
3131        cur = gen_xmlNodePtr(n_cur, 2);
3132
3133        htmlNodeDumpFile(out, doc, cur);
3134        call_tests++;
3135        des_FILE_ptr(n_out, out, 0);
3136        des_xmlDocPtr(n_doc, doc, 1);
3137        des_xmlNodePtr(n_cur, cur, 2);
3138        xmlResetLastError();
3139        if (mem_base != xmlMemBlocks()) {
3140            printf("Leak of %d blocks found in htmlNodeDumpFile",
3141	           xmlMemBlocks() - mem_base);
3142	    test_ret++;
3143            printf(" %d", n_out);
3144            printf(" %d", n_doc);
3145            printf(" %d", n_cur);
3146            printf("\n");
3147        }
3148    }
3149    }
3150    }
3151    function_tests++;
3152#endif
3153
3154    return(test_ret);
3155}
3156
3157
3158static int
3159test_htmlNodeDumpFileFormat(void) {
3160    int test_ret = 0;
3161
3162#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3163    int mem_base;
3164    int ret_val;
3165    FILE * out; /* the FILE pointer */
3166    int n_out;
3167    xmlDocPtr doc; /* the document */
3168    int n_doc;
3169    xmlNodePtr cur; /* the current node */
3170    int n_cur;
3171    char * encoding; /* the document encoding */
3172    int n_encoding;
3173    int format; /* should formatting spaces been added */
3174    int n_format;
3175
3176    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3177    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3178    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3179    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3180    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3181        mem_base = xmlMemBlocks();
3182        out = gen_FILE_ptr(n_out, 0);
3183        doc = gen_xmlDocPtr(n_doc, 1);
3184        cur = gen_xmlNodePtr(n_cur, 2);
3185        encoding = gen_const_char_ptr(n_encoding, 3);
3186        format = gen_int(n_format, 4);
3187
3188        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3189        desret_int(ret_val);
3190        call_tests++;
3191        des_FILE_ptr(n_out, out, 0);
3192        des_xmlDocPtr(n_doc, doc, 1);
3193        des_xmlNodePtr(n_cur, cur, 2);
3194        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3195        des_int(n_format, format, 4);
3196        xmlResetLastError();
3197        if (mem_base != xmlMemBlocks()) {
3198            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3199	           xmlMemBlocks() - mem_base);
3200	    test_ret++;
3201            printf(" %d", n_out);
3202            printf(" %d", n_doc);
3203            printf(" %d", n_cur);
3204            printf(" %d", n_encoding);
3205            printf(" %d", n_format);
3206            printf("\n");
3207        }
3208    }
3209    }
3210    }
3211    }
3212    }
3213    function_tests++;
3214#endif
3215
3216    return(test_ret);
3217}
3218
3219
3220static int
3221test_htmlNodeDumpFormatOutput(void) {
3222    int test_ret = 0;
3223
3224#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3225    int mem_base;
3226    xmlOutputBufferPtr buf; /* the HTML buffer output */
3227    int n_buf;
3228    xmlDocPtr doc; /* the document */
3229    int n_doc;
3230    xmlNodePtr cur; /* the current node */
3231    int n_cur;
3232    char * encoding; /* the encoding string */
3233    int n_encoding;
3234    int format; /* should formatting spaces been added */
3235    int n_format;
3236
3237    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3238    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3239    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3240    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3241    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3242        mem_base = xmlMemBlocks();
3243        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3244        doc = gen_xmlDocPtr(n_doc, 1);
3245        cur = gen_xmlNodePtr(n_cur, 2);
3246        encoding = gen_const_char_ptr(n_encoding, 3);
3247        format = gen_int(n_format, 4);
3248
3249        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3250        call_tests++;
3251        des_xmlOutputBufferPtr(n_buf, buf, 0);
3252        des_xmlDocPtr(n_doc, doc, 1);
3253        des_xmlNodePtr(n_cur, cur, 2);
3254        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3255        des_int(n_format, format, 4);
3256        xmlResetLastError();
3257        if (mem_base != xmlMemBlocks()) {
3258            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3259	           xmlMemBlocks() - mem_base);
3260	    test_ret++;
3261            printf(" %d", n_buf);
3262            printf(" %d", n_doc);
3263            printf(" %d", n_cur);
3264            printf(" %d", n_encoding);
3265            printf(" %d", n_format);
3266            printf("\n");
3267        }
3268    }
3269    }
3270    }
3271    }
3272    }
3273    function_tests++;
3274#endif
3275
3276    return(test_ret);
3277}
3278
3279
3280static int
3281test_htmlNodeDumpOutput(void) {
3282    int test_ret = 0;
3283
3284#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3285    int mem_base;
3286    xmlOutputBufferPtr buf; /* the HTML buffer output */
3287    int n_buf;
3288    xmlDocPtr doc; /* the document */
3289    int n_doc;
3290    xmlNodePtr cur; /* the current node */
3291    int n_cur;
3292    char * encoding; /* the encoding string */
3293    int n_encoding;
3294
3295    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3296    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3297    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3298    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3299        mem_base = xmlMemBlocks();
3300        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3301        doc = gen_xmlDocPtr(n_doc, 1);
3302        cur = gen_xmlNodePtr(n_cur, 2);
3303        encoding = gen_const_char_ptr(n_encoding, 3);
3304
3305        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3306        call_tests++;
3307        des_xmlOutputBufferPtr(n_buf, buf, 0);
3308        des_xmlDocPtr(n_doc, doc, 1);
3309        des_xmlNodePtr(n_cur, cur, 2);
3310        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3311        xmlResetLastError();
3312        if (mem_base != xmlMemBlocks()) {
3313            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3314	           xmlMemBlocks() - mem_base);
3315	    test_ret++;
3316            printf(" %d", n_buf);
3317            printf(" %d", n_doc);
3318            printf(" %d", n_cur);
3319            printf(" %d", n_encoding);
3320            printf("\n");
3321        }
3322    }
3323    }
3324    }
3325    }
3326    function_tests++;
3327#endif
3328
3329    return(test_ret);
3330}
3331
3332
3333static int
3334test_htmlSaveFile(void) {
3335    int test_ret = 0;
3336
3337#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3338    int mem_base;
3339    int ret_val;
3340    const char * filename; /* the filename (or URL) */
3341    int n_filename;
3342    xmlDocPtr cur; /* the document */
3343    int n_cur;
3344
3345    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3346    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3347        mem_base = xmlMemBlocks();
3348        filename = gen_fileoutput(n_filename, 0);
3349        cur = gen_xmlDocPtr(n_cur, 1);
3350
3351        ret_val = htmlSaveFile(filename, cur);
3352        desret_int(ret_val);
3353        call_tests++;
3354        des_fileoutput(n_filename, filename, 0);
3355        des_xmlDocPtr(n_cur, cur, 1);
3356        xmlResetLastError();
3357        if (mem_base != xmlMemBlocks()) {
3358            printf("Leak of %d blocks found in htmlSaveFile",
3359	           xmlMemBlocks() - mem_base);
3360	    test_ret++;
3361            printf(" %d", n_filename);
3362            printf(" %d", n_cur);
3363            printf("\n");
3364        }
3365    }
3366    }
3367    function_tests++;
3368#endif
3369
3370    return(test_ret);
3371}
3372
3373
3374static int
3375test_htmlSaveFileEnc(void) {
3376    int test_ret = 0;
3377
3378#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3379    int mem_base;
3380    int ret_val;
3381    const char * filename; /* the filename */
3382    int n_filename;
3383    xmlDocPtr cur; /* the document */
3384    int n_cur;
3385    char * encoding; /* the document encoding */
3386    int n_encoding;
3387
3388    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3389    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3390    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3391        mem_base = xmlMemBlocks();
3392        filename = gen_fileoutput(n_filename, 0);
3393        cur = gen_xmlDocPtr(n_cur, 1);
3394        encoding = gen_const_char_ptr(n_encoding, 2);
3395
3396        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3397        desret_int(ret_val);
3398        call_tests++;
3399        des_fileoutput(n_filename, filename, 0);
3400        des_xmlDocPtr(n_cur, cur, 1);
3401        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3402        xmlResetLastError();
3403        if (mem_base != xmlMemBlocks()) {
3404            printf("Leak of %d blocks found in htmlSaveFileEnc",
3405	           xmlMemBlocks() - mem_base);
3406	    test_ret++;
3407            printf(" %d", n_filename);
3408            printf(" %d", n_cur);
3409            printf(" %d", n_encoding);
3410            printf("\n");
3411        }
3412    }
3413    }
3414    }
3415    function_tests++;
3416#endif
3417
3418    return(test_ret);
3419}
3420
3421
3422static int
3423test_htmlSaveFileFormat(void) {
3424    int test_ret = 0;
3425
3426#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3427    int mem_base;
3428    int ret_val;
3429    const char * filename; /* the filename */
3430    int n_filename;
3431    xmlDocPtr cur; /* the document */
3432    int n_cur;
3433    char * encoding; /* the document encoding */
3434    int n_encoding;
3435    int format; /* should formatting spaces been added */
3436    int n_format;
3437
3438    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3439    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3440    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3441    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3442        mem_base = xmlMemBlocks();
3443        filename = gen_fileoutput(n_filename, 0);
3444        cur = gen_xmlDocPtr(n_cur, 1);
3445        encoding = gen_const_char_ptr(n_encoding, 2);
3446        format = gen_int(n_format, 3);
3447
3448        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3449        desret_int(ret_val);
3450        call_tests++;
3451        des_fileoutput(n_filename, filename, 0);
3452        des_xmlDocPtr(n_cur, cur, 1);
3453        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3454        des_int(n_format, format, 3);
3455        xmlResetLastError();
3456        if (mem_base != xmlMemBlocks()) {
3457            printf("Leak of %d blocks found in htmlSaveFileFormat",
3458	           xmlMemBlocks() - mem_base);
3459	    test_ret++;
3460            printf(" %d", n_filename);
3461            printf(" %d", n_cur);
3462            printf(" %d", n_encoding);
3463            printf(" %d", n_format);
3464            printf("\n");
3465        }
3466    }
3467    }
3468    }
3469    }
3470    function_tests++;
3471#endif
3472
3473    return(test_ret);
3474}
3475
3476
3477static int
3478test_htmlSetMetaEncoding(void) {
3479    int test_ret = 0;
3480
3481#if defined(LIBXML_HTML_ENABLED)
3482    int mem_base;
3483    int ret_val;
3484    htmlDocPtr doc; /* the document */
3485    int n_doc;
3486    xmlChar * encoding; /* the encoding string */
3487    int n_encoding;
3488
3489    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3490    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3491        mem_base = xmlMemBlocks();
3492        doc = gen_htmlDocPtr(n_doc, 0);
3493        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3494
3495        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3496        desret_int(ret_val);
3497        call_tests++;
3498        des_htmlDocPtr(n_doc, doc, 0);
3499        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3500        xmlResetLastError();
3501        if (mem_base != xmlMemBlocks()) {
3502            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3503	           xmlMemBlocks() - mem_base);
3504	    test_ret++;
3505            printf(" %d", n_doc);
3506            printf(" %d", n_encoding);
3507            printf("\n");
3508        }
3509    }
3510    }
3511    function_tests++;
3512#endif
3513
3514    return(test_ret);
3515}
3516
3517static int
3518test_HTMLtree(void) {
3519    int test_ret = 0;
3520
3521    if (quiet == 0) printf("Testing HTMLtree : 17 of 17 functions ...\n");
3522    test_ret += test_htmlDocContentDumpFormatOutput();
3523    test_ret += test_htmlDocContentDumpOutput();
3524    test_ret += test_htmlDocDump();
3525    test_ret += test_htmlDocDumpMemory();
3526    test_ret += test_htmlGetMetaEncoding();
3527    test_ret += test_htmlIsBooleanAttr();
3528    test_ret += test_htmlNewDoc();
3529    test_ret += test_htmlNewDocNoDtD();
3530    test_ret += test_htmlNodeDump();
3531    test_ret += test_htmlNodeDumpFile();
3532    test_ret += test_htmlNodeDumpFileFormat();
3533    test_ret += test_htmlNodeDumpFormatOutput();
3534    test_ret += test_htmlNodeDumpOutput();
3535    test_ret += test_htmlSaveFile();
3536    test_ret += test_htmlSaveFileEnc();
3537    test_ret += test_htmlSaveFileFormat();
3538    test_ret += test_htmlSetMetaEncoding();
3539
3540    if (test_ret != 0)
3541	printf("Module HTMLtree: %d errors\n", test_ret);
3542    return(test_ret);
3543}
3544
3545static int
3546test_docbDefaultSAXHandlerInit(void) {
3547    int test_ret = 0;
3548
3549#if defined(LIBXML_DOCB_ENABLED)
3550#ifdef LIBXML_DOCB_ENABLED
3551    int mem_base;
3552
3553        mem_base = xmlMemBlocks();
3554
3555        docbDefaultSAXHandlerInit();
3556        call_tests++;
3557        xmlResetLastError();
3558        if (mem_base != xmlMemBlocks()) {
3559            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3560	           xmlMemBlocks() - mem_base);
3561	    test_ret++;
3562            printf("\n");
3563        }
3564    function_tests++;
3565#endif
3566#endif
3567
3568    return(test_ret);
3569}
3570
3571
3572static int
3573test_htmlDefaultSAXHandlerInit(void) {
3574    int test_ret = 0;
3575
3576#if defined(LIBXML_HTML_ENABLED)
3577#ifdef LIBXML_HTML_ENABLED
3578    int mem_base;
3579
3580        mem_base = xmlMemBlocks();
3581
3582        htmlDefaultSAXHandlerInit();
3583        call_tests++;
3584        xmlResetLastError();
3585        if (mem_base != xmlMemBlocks()) {
3586            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3587	           xmlMemBlocks() - mem_base);
3588	    test_ret++;
3589            printf("\n");
3590        }
3591    function_tests++;
3592#endif
3593#endif
3594
3595    return(test_ret);
3596}
3597
3598
3599static int
3600test_xmlDefaultSAXHandlerInit(void) {
3601    int test_ret = 0;
3602
3603    int mem_base;
3604
3605        mem_base = xmlMemBlocks();
3606
3607        xmlDefaultSAXHandlerInit();
3608        call_tests++;
3609        xmlResetLastError();
3610        if (mem_base != xmlMemBlocks()) {
3611            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3612	           xmlMemBlocks() - mem_base);
3613	    test_ret++;
3614            printf("\n");
3615        }
3616    function_tests++;
3617
3618    return(test_ret);
3619}
3620
3621
3622#define gen_nb_xmlEnumerationPtr 1
3623static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3624    return(NULL);
3625}
3626static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3627}
3628
3629static int
3630test_xmlSAX2AttributeDecl(void) {
3631    int test_ret = 0;
3632
3633    int mem_base;
3634    void * ctx; /* the user data (XML parser context) */
3635    int n_ctx;
3636    xmlChar * elem; /* the name of the element */
3637    int n_elem;
3638    xmlChar * fullname; /* the attribute name */
3639    int n_fullname;
3640    int type; /* the attribute type */
3641    int n_type;
3642    int def; /* the type of default value */
3643    int n_def;
3644    xmlChar * defaultValue; /* the attribute default value */
3645    int n_defaultValue;
3646    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3647    int n_tree;
3648
3649    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3650    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3651    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3652    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3653    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3654    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3655    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3656        mem_base = xmlMemBlocks();
3657        ctx = gen_void_ptr(n_ctx, 0);
3658        elem = gen_const_xmlChar_ptr(n_elem, 1);
3659        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3660        type = gen_int(n_type, 3);
3661        def = gen_int(n_def, 4);
3662        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3663        tree = gen_xmlEnumerationPtr(n_tree, 6);
3664
3665        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3666        call_tests++;
3667        des_void_ptr(n_ctx, ctx, 0);
3668        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3669        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3670        des_int(n_type, type, 3);
3671        des_int(n_def, def, 4);
3672        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3673        des_xmlEnumerationPtr(n_tree, tree, 6);
3674        xmlResetLastError();
3675        if (mem_base != xmlMemBlocks()) {
3676            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3677	           xmlMemBlocks() - mem_base);
3678	    test_ret++;
3679            printf(" %d", n_ctx);
3680            printf(" %d", n_elem);
3681            printf(" %d", n_fullname);
3682            printf(" %d", n_type);
3683            printf(" %d", n_def);
3684            printf(" %d", n_defaultValue);
3685            printf(" %d", n_tree);
3686            printf("\n");
3687        }
3688    }
3689    }
3690    }
3691    }
3692    }
3693    }
3694    }
3695    function_tests++;
3696
3697    return(test_ret);
3698}
3699
3700
3701static int
3702test_xmlSAX2CDataBlock(void) {
3703    int test_ret = 0;
3704
3705    int mem_base;
3706    void * ctx; /* the user data (XML parser context) */
3707    int n_ctx;
3708    xmlChar * value; /* The pcdata content */
3709    int n_value;
3710    int len; /* the block length */
3711    int n_len;
3712
3713    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3714    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3715    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3716        mem_base = xmlMemBlocks();
3717        ctx = gen_void_ptr(n_ctx, 0);
3718        value = gen_const_xmlChar_ptr(n_value, 1);
3719        len = gen_int(n_len, 2);
3720
3721        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3722        call_tests++;
3723        des_void_ptr(n_ctx, ctx, 0);
3724        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3725        des_int(n_len, len, 2);
3726        xmlResetLastError();
3727        if (mem_base != xmlMemBlocks()) {
3728            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3729	           xmlMemBlocks() - mem_base);
3730	    test_ret++;
3731            printf(" %d", n_ctx);
3732            printf(" %d", n_value);
3733            printf(" %d", n_len);
3734            printf("\n");
3735        }
3736    }
3737    }
3738    }
3739    function_tests++;
3740
3741    return(test_ret);
3742}
3743
3744
3745static int
3746test_xmlSAX2Characters(void) {
3747    int test_ret = 0;
3748
3749    int mem_base;
3750    void * ctx; /* the user data (XML parser context) */
3751    int n_ctx;
3752    xmlChar * ch; /* a xmlChar string */
3753    int n_ch;
3754    int len; /* the number of xmlChar */
3755    int n_len;
3756
3757    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3758    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3759    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3760        mem_base = xmlMemBlocks();
3761        ctx = gen_void_ptr(n_ctx, 0);
3762        ch = gen_const_xmlChar_ptr(n_ch, 1);
3763        len = gen_int(n_len, 2);
3764
3765        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3766        call_tests++;
3767        des_void_ptr(n_ctx, ctx, 0);
3768        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3769        des_int(n_len, len, 2);
3770        xmlResetLastError();
3771        if (mem_base != xmlMemBlocks()) {
3772            printf("Leak of %d blocks found in xmlSAX2Characters",
3773	           xmlMemBlocks() - mem_base);
3774	    test_ret++;
3775            printf(" %d", n_ctx);
3776            printf(" %d", n_ch);
3777            printf(" %d", n_len);
3778            printf("\n");
3779        }
3780    }
3781    }
3782    }
3783    function_tests++;
3784
3785    return(test_ret);
3786}
3787
3788
3789static int
3790test_xmlSAX2Comment(void) {
3791    int test_ret = 0;
3792
3793    int mem_base;
3794    void * ctx; /* the user data (XML parser context) */
3795    int n_ctx;
3796    xmlChar * value; /* the xmlSAX2Comment content */
3797    int n_value;
3798
3799    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3800    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3801        mem_base = xmlMemBlocks();
3802        ctx = gen_void_ptr(n_ctx, 0);
3803        value = gen_const_xmlChar_ptr(n_value, 1);
3804
3805        xmlSAX2Comment(ctx, (const xmlChar *)value);
3806        call_tests++;
3807        des_void_ptr(n_ctx, ctx, 0);
3808        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3809        xmlResetLastError();
3810        if (mem_base != xmlMemBlocks()) {
3811            printf("Leak of %d blocks found in xmlSAX2Comment",
3812	           xmlMemBlocks() - mem_base);
3813	    test_ret++;
3814            printf(" %d", n_ctx);
3815            printf(" %d", n_value);
3816            printf("\n");
3817        }
3818    }
3819    }
3820    function_tests++;
3821
3822    return(test_ret);
3823}
3824
3825
3826static int
3827test_xmlSAX2ElementDecl(void) {
3828    int test_ret = 0;
3829
3830    int mem_base;
3831    void * ctx; /* the user data (XML parser context) */
3832    int n_ctx;
3833    xmlChar * name; /* the element name */
3834    int n_name;
3835    int type; /* the element type */
3836    int n_type;
3837    xmlElementContentPtr content; /* the element value tree */
3838    int n_content;
3839
3840    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3841    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3842    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3843    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3844        mem_base = xmlMemBlocks();
3845        ctx = gen_void_ptr(n_ctx, 0);
3846        name = gen_const_xmlChar_ptr(n_name, 1);
3847        type = gen_int(n_type, 2);
3848        content = gen_xmlElementContentPtr(n_content, 3);
3849
3850        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3851        call_tests++;
3852        des_void_ptr(n_ctx, ctx, 0);
3853        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3854        des_int(n_type, type, 2);
3855        des_xmlElementContentPtr(n_content, content, 3);
3856        xmlResetLastError();
3857        if (mem_base != xmlMemBlocks()) {
3858            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
3859	           xmlMemBlocks() - mem_base);
3860	    test_ret++;
3861            printf(" %d", n_ctx);
3862            printf(" %d", n_name);
3863            printf(" %d", n_type);
3864            printf(" %d", n_content);
3865            printf("\n");
3866        }
3867    }
3868    }
3869    }
3870    }
3871    function_tests++;
3872
3873    return(test_ret);
3874}
3875
3876
3877static int
3878test_xmlSAX2EndDocument(void) {
3879    int test_ret = 0;
3880
3881    int mem_base;
3882    void * ctx; /* the user data (XML parser context) */
3883    int n_ctx;
3884
3885    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3886        mem_base = xmlMemBlocks();
3887        ctx = gen_void_ptr(n_ctx, 0);
3888
3889        xmlSAX2EndDocument(ctx);
3890        call_tests++;
3891        des_void_ptr(n_ctx, ctx, 0);
3892        xmlResetLastError();
3893        if (mem_base != xmlMemBlocks()) {
3894            printf("Leak of %d blocks found in xmlSAX2EndDocument",
3895	           xmlMemBlocks() - mem_base);
3896	    test_ret++;
3897            printf(" %d", n_ctx);
3898            printf("\n");
3899        }
3900    }
3901    function_tests++;
3902
3903    return(test_ret);
3904}
3905
3906
3907static int
3908test_xmlSAX2EndElement(void) {
3909    int test_ret = 0;
3910
3911#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
3912#ifdef LIBXML_SAX1_ENABLED
3913    int mem_base;
3914    void * ctx; /* the user data (XML parser context) */
3915    int n_ctx;
3916    xmlChar * name; /* The element name */
3917    int n_name;
3918
3919    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3920    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3921        mem_base = xmlMemBlocks();
3922        ctx = gen_void_ptr(n_ctx, 0);
3923        name = gen_const_xmlChar_ptr(n_name, 1);
3924
3925        xmlSAX2EndElement(ctx, (const xmlChar *)name);
3926        call_tests++;
3927        des_void_ptr(n_ctx, ctx, 0);
3928        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3929        xmlResetLastError();
3930        if (mem_base != xmlMemBlocks()) {
3931            printf("Leak of %d blocks found in xmlSAX2EndElement",
3932	           xmlMemBlocks() - mem_base);
3933	    test_ret++;
3934            printf(" %d", n_ctx);
3935            printf(" %d", n_name);
3936            printf("\n");
3937        }
3938    }
3939    }
3940    function_tests++;
3941#endif
3942#endif
3943
3944    return(test_ret);
3945}
3946
3947
3948static int
3949test_xmlSAX2EndElementNs(void) {
3950    int test_ret = 0;
3951
3952    int mem_base;
3953    void * ctx; /* the user data (XML parser context) */
3954    int n_ctx;
3955    xmlChar * localname; /* the local name of the element */
3956    int n_localname;
3957    xmlChar * prefix; /* the element namespace prefix if available */
3958    int n_prefix;
3959    xmlChar * URI; /* the element namespace name if available */
3960    int n_URI;
3961
3962    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3963    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
3964    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
3965    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3966        mem_base = xmlMemBlocks();
3967        ctx = gen_void_ptr(n_ctx, 0);
3968        localname = gen_const_xmlChar_ptr(n_localname, 1);
3969        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
3970        URI = gen_const_xmlChar_ptr(n_URI, 3);
3971
3972        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
3973        call_tests++;
3974        des_void_ptr(n_ctx, ctx, 0);
3975        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
3976        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
3977        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
3978        xmlResetLastError();
3979        if (mem_base != xmlMemBlocks()) {
3980            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
3981	           xmlMemBlocks() - mem_base);
3982	    test_ret++;
3983            printf(" %d", n_ctx);
3984            printf(" %d", n_localname);
3985            printf(" %d", n_prefix);
3986            printf(" %d", n_URI);
3987            printf("\n");
3988        }
3989    }
3990    }
3991    }
3992    }
3993    function_tests++;
3994
3995    return(test_ret);
3996}
3997
3998
3999static int
4000test_xmlSAX2EntityDecl(void) {
4001    int test_ret = 0;
4002
4003    int mem_base;
4004    void * ctx; /* the user data (XML parser context) */
4005    int n_ctx;
4006    xmlChar * name; /* the entity name */
4007    int n_name;
4008    int type; /* the entity type */
4009    int n_type;
4010    xmlChar * publicId; /* The public ID of the entity */
4011    int n_publicId;
4012    xmlChar * systemId; /* The system ID of the entity */
4013    int n_systemId;
4014    xmlChar * content; /* the entity value (without processing). */
4015    int n_content;
4016
4017    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4018    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4019    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4020    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4021    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4022    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4023        mem_base = xmlMemBlocks();
4024        ctx = gen_void_ptr(n_ctx, 0);
4025        name = gen_const_xmlChar_ptr(n_name, 1);
4026        type = gen_int(n_type, 2);
4027        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4028        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4029        content = gen_xmlChar_ptr(n_content, 5);
4030
4031        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4032        call_tests++;
4033        des_void_ptr(n_ctx, ctx, 0);
4034        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4035        des_int(n_type, type, 2);
4036        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4037        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4038        des_xmlChar_ptr(n_content, content, 5);
4039        xmlResetLastError();
4040        if (mem_base != xmlMemBlocks()) {
4041            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4042	           xmlMemBlocks() - mem_base);
4043	    test_ret++;
4044            printf(" %d", n_ctx);
4045            printf(" %d", n_name);
4046            printf(" %d", n_type);
4047            printf(" %d", n_publicId);
4048            printf(" %d", n_systemId);
4049            printf(" %d", n_content);
4050            printf("\n");
4051        }
4052    }
4053    }
4054    }
4055    }
4056    }
4057    }
4058    function_tests++;
4059
4060    return(test_ret);
4061}
4062
4063
4064static int
4065test_xmlSAX2ExternalSubset(void) {
4066    int test_ret = 0;
4067
4068    int mem_base;
4069    void * ctx; /* the user data (XML parser context) */
4070    int n_ctx;
4071    xmlChar * name; /* the root element name */
4072    int n_name;
4073    xmlChar * ExternalID; /* the external ID */
4074    int n_ExternalID;
4075    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4076    int n_SystemID;
4077
4078    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4079    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4080    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4081    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4082        mem_base = xmlMemBlocks();
4083        ctx = gen_void_ptr(n_ctx, 0);
4084        name = gen_const_xmlChar_ptr(n_name, 1);
4085        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4086        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4087
4088        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4089        call_tests++;
4090        des_void_ptr(n_ctx, ctx, 0);
4091        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4092        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4093        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4094        xmlResetLastError();
4095        if (mem_base != xmlMemBlocks()) {
4096            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4097	           xmlMemBlocks() - mem_base);
4098	    test_ret++;
4099            printf(" %d", n_ctx);
4100            printf(" %d", n_name);
4101            printf(" %d", n_ExternalID);
4102            printf(" %d", n_SystemID);
4103            printf("\n");
4104        }
4105    }
4106    }
4107    }
4108    }
4109    function_tests++;
4110
4111    return(test_ret);
4112}
4113
4114
4115static int
4116test_xmlSAX2GetColumnNumber(void) {
4117    int test_ret = 0;
4118
4119    int mem_base;
4120    int ret_val;
4121    void * ctx; /* the user data (XML parser context) */
4122    int n_ctx;
4123
4124    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4125        mem_base = xmlMemBlocks();
4126        ctx = gen_void_ptr(n_ctx, 0);
4127
4128        ret_val = xmlSAX2GetColumnNumber(ctx);
4129        desret_int(ret_val);
4130        call_tests++;
4131        des_void_ptr(n_ctx, ctx, 0);
4132        xmlResetLastError();
4133        if (mem_base != xmlMemBlocks()) {
4134            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4135	           xmlMemBlocks() - mem_base);
4136	    test_ret++;
4137            printf(" %d", n_ctx);
4138            printf("\n");
4139        }
4140    }
4141    function_tests++;
4142
4143    return(test_ret);
4144}
4145
4146
4147static int
4148test_xmlSAX2GetEntity(void) {
4149    int test_ret = 0;
4150
4151    int mem_base;
4152    xmlEntityPtr ret_val;
4153    void * ctx; /* the user data (XML parser context) */
4154    int n_ctx;
4155    xmlChar * name; /* The entity name */
4156    int n_name;
4157
4158    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4159    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4160        mem_base = xmlMemBlocks();
4161        ctx = gen_void_ptr(n_ctx, 0);
4162        name = gen_const_xmlChar_ptr(n_name, 1);
4163
4164        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4165        desret_xmlEntityPtr(ret_val);
4166        call_tests++;
4167        des_void_ptr(n_ctx, ctx, 0);
4168        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4169        xmlResetLastError();
4170        if (mem_base != xmlMemBlocks()) {
4171            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4172	           xmlMemBlocks() - mem_base);
4173	    test_ret++;
4174            printf(" %d", n_ctx);
4175            printf(" %d", n_name);
4176            printf("\n");
4177        }
4178    }
4179    }
4180    function_tests++;
4181
4182    return(test_ret);
4183}
4184
4185
4186static int
4187test_xmlSAX2GetLineNumber(void) {
4188    int test_ret = 0;
4189
4190    int mem_base;
4191    int ret_val;
4192    void * ctx; /* the user data (XML parser context) */
4193    int n_ctx;
4194
4195    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4196        mem_base = xmlMemBlocks();
4197        ctx = gen_void_ptr(n_ctx, 0);
4198
4199        ret_val = xmlSAX2GetLineNumber(ctx);
4200        desret_int(ret_val);
4201        call_tests++;
4202        des_void_ptr(n_ctx, ctx, 0);
4203        xmlResetLastError();
4204        if (mem_base != xmlMemBlocks()) {
4205            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4206	           xmlMemBlocks() - mem_base);
4207	    test_ret++;
4208            printf(" %d", n_ctx);
4209            printf("\n");
4210        }
4211    }
4212    function_tests++;
4213
4214    return(test_ret);
4215}
4216
4217
4218static int
4219test_xmlSAX2GetParameterEntity(void) {
4220    int test_ret = 0;
4221
4222    int mem_base;
4223    xmlEntityPtr ret_val;
4224    void * ctx; /* the user data (XML parser context) */
4225    int n_ctx;
4226    xmlChar * name; /* The entity name */
4227    int n_name;
4228
4229    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4230    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4231        mem_base = xmlMemBlocks();
4232        ctx = gen_void_ptr(n_ctx, 0);
4233        name = gen_const_xmlChar_ptr(n_name, 1);
4234
4235        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4236        desret_xmlEntityPtr(ret_val);
4237        call_tests++;
4238        des_void_ptr(n_ctx, ctx, 0);
4239        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4240        xmlResetLastError();
4241        if (mem_base != xmlMemBlocks()) {
4242            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4243	           xmlMemBlocks() - mem_base);
4244	    test_ret++;
4245            printf(" %d", n_ctx);
4246            printf(" %d", n_name);
4247            printf("\n");
4248        }
4249    }
4250    }
4251    function_tests++;
4252
4253    return(test_ret);
4254}
4255
4256
4257static int
4258test_xmlSAX2GetPublicId(void) {
4259    int test_ret = 0;
4260
4261    int mem_base;
4262    const xmlChar * ret_val;
4263    void * ctx; /* the user data (XML parser context) */
4264    int n_ctx;
4265
4266    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4267        mem_base = xmlMemBlocks();
4268        ctx = gen_void_ptr(n_ctx, 0);
4269
4270        ret_val = xmlSAX2GetPublicId(ctx);
4271        desret_const_xmlChar_ptr(ret_val);
4272        call_tests++;
4273        des_void_ptr(n_ctx, ctx, 0);
4274        xmlResetLastError();
4275        if (mem_base != xmlMemBlocks()) {
4276            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4277	           xmlMemBlocks() - mem_base);
4278	    test_ret++;
4279            printf(" %d", n_ctx);
4280            printf("\n");
4281        }
4282    }
4283    function_tests++;
4284
4285    return(test_ret);
4286}
4287
4288
4289static int
4290test_xmlSAX2GetSystemId(void) {
4291    int test_ret = 0;
4292
4293    int mem_base;
4294    const xmlChar * ret_val;
4295    void * ctx; /* the user data (XML parser context) */
4296    int n_ctx;
4297
4298    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4299        mem_base = xmlMemBlocks();
4300        ctx = gen_void_ptr(n_ctx, 0);
4301
4302        ret_val = xmlSAX2GetSystemId(ctx);
4303        desret_const_xmlChar_ptr(ret_val);
4304        call_tests++;
4305        des_void_ptr(n_ctx, ctx, 0);
4306        xmlResetLastError();
4307        if (mem_base != xmlMemBlocks()) {
4308            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4309	           xmlMemBlocks() - mem_base);
4310	    test_ret++;
4311            printf(" %d", n_ctx);
4312            printf("\n");
4313        }
4314    }
4315    function_tests++;
4316
4317    return(test_ret);
4318}
4319
4320
4321static int
4322test_xmlSAX2HasExternalSubset(void) {
4323    int test_ret = 0;
4324
4325    int mem_base;
4326    int ret_val;
4327    void * ctx; /* the user data (XML parser context) */
4328    int n_ctx;
4329
4330    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4331        mem_base = xmlMemBlocks();
4332        ctx = gen_void_ptr(n_ctx, 0);
4333
4334        ret_val = xmlSAX2HasExternalSubset(ctx);
4335        desret_int(ret_val);
4336        call_tests++;
4337        des_void_ptr(n_ctx, ctx, 0);
4338        xmlResetLastError();
4339        if (mem_base != xmlMemBlocks()) {
4340            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4341	           xmlMemBlocks() - mem_base);
4342	    test_ret++;
4343            printf(" %d", n_ctx);
4344            printf("\n");
4345        }
4346    }
4347    function_tests++;
4348
4349    return(test_ret);
4350}
4351
4352
4353static int
4354test_xmlSAX2HasInternalSubset(void) {
4355    int test_ret = 0;
4356
4357    int mem_base;
4358    int ret_val;
4359    void * ctx; /* the user data (XML parser context) */
4360    int n_ctx;
4361
4362    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4363        mem_base = xmlMemBlocks();
4364        ctx = gen_void_ptr(n_ctx, 0);
4365
4366        ret_val = xmlSAX2HasInternalSubset(ctx);
4367        desret_int(ret_val);
4368        call_tests++;
4369        des_void_ptr(n_ctx, ctx, 0);
4370        xmlResetLastError();
4371        if (mem_base != xmlMemBlocks()) {
4372            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4373	           xmlMemBlocks() - mem_base);
4374	    test_ret++;
4375            printf(" %d", n_ctx);
4376            printf("\n");
4377        }
4378    }
4379    function_tests++;
4380
4381    return(test_ret);
4382}
4383
4384
4385static int
4386test_xmlSAX2IgnorableWhitespace(void) {
4387    int test_ret = 0;
4388
4389    int mem_base;
4390    void * ctx; /* the user data (XML parser context) */
4391    int n_ctx;
4392    xmlChar * ch; /* a xmlChar string */
4393    int n_ch;
4394    int len; /* the number of xmlChar */
4395    int n_len;
4396
4397    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4398    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4399    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4400        mem_base = xmlMemBlocks();
4401        ctx = gen_void_ptr(n_ctx, 0);
4402        ch = gen_const_xmlChar_ptr(n_ch, 1);
4403        len = gen_int(n_len, 2);
4404
4405        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4406        call_tests++;
4407        des_void_ptr(n_ctx, ctx, 0);
4408        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4409        des_int(n_len, len, 2);
4410        xmlResetLastError();
4411        if (mem_base != xmlMemBlocks()) {
4412            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4413	           xmlMemBlocks() - mem_base);
4414	    test_ret++;
4415            printf(" %d", n_ctx);
4416            printf(" %d", n_ch);
4417            printf(" %d", n_len);
4418            printf("\n");
4419        }
4420    }
4421    }
4422    }
4423    function_tests++;
4424
4425    return(test_ret);
4426}
4427
4428
4429#define gen_nb_xmlSAXHandler_ptr 1
4430static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4431    return(NULL);
4432}
4433static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4434}
4435
4436static int
4437test_xmlSAX2InitDefaultSAXHandler(void) {
4438    int test_ret = 0;
4439
4440    int mem_base;
4441    xmlSAXHandler * hdlr; /* the SAX handler */
4442    int n_hdlr;
4443    int warning; /* flag if non-zero sets the handler warning procedure */
4444    int n_warning;
4445
4446    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4447    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4448        mem_base = xmlMemBlocks();
4449        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4450        warning = gen_int(n_warning, 1);
4451
4452        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4453        call_tests++;
4454        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4455        des_int(n_warning, warning, 1);
4456        xmlResetLastError();
4457        if (mem_base != xmlMemBlocks()) {
4458            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4459	           xmlMemBlocks() - mem_base);
4460	    test_ret++;
4461            printf(" %d", n_hdlr);
4462            printf(" %d", n_warning);
4463            printf("\n");
4464        }
4465    }
4466    }
4467    function_tests++;
4468
4469    return(test_ret);
4470}
4471
4472
4473static int
4474test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4475    int test_ret = 0;
4476
4477#if defined(LIBXML_DOCB_ENABLED)
4478    int mem_base;
4479    xmlSAXHandler * hdlr; /* the SAX handler */
4480    int n_hdlr;
4481
4482    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4483        mem_base = xmlMemBlocks();
4484        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4485
4486        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4487        call_tests++;
4488        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4489        xmlResetLastError();
4490        if (mem_base != xmlMemBlocks()) {
4491            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4492	           xmlMemBlocks() - mem_base);
4493	    test_ret++;
4494            printf(" %d", n_hdlr);
4495            printf("\n");
4496        }
4497    }
4498    function_tests++;
4499#endif
4500
4501    return(test_ret);
4502}
4503
4504
4505static int
4506test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4507    int test_ret = 0;
4508
4509#if defined(LIBXML_HTML_ENABLED)
4510    int mem_base;
4511    xmlSAXHandler * hdlr; /* the SAX handler */
4512    int n_hdlr;
4513
4514    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4515        mem_base = xmlMemBlocks();
4516        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4517
4518        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4519        call_tests++;
4520        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4521        xmlResetLastError();
4522        if (mem_base != xmlMemBlocks()) {
4523            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4524	           xmlMemBlocks() - mem_base);
4525	    test_ret++;
4526            printf(" %d", n_hdlr);
4527            printf("\n");
4528        }
4529    }
4530    function_tests++;
4531#endif
4532
4533    return(test_ret);
4534}
4535
4536
4537static int
4538test_xmlSAX2InternalSubset(void) {
4539    int test_ret = 0;
4540
4541    int mem_base;
4542    void * ctx; /* the user data (XML parser context) */
4543    int n_ctx;
4544    xmlChar * name; /* the root element name */
4545    int n_name;
4546    xmlChar * ExternalID; /* the external ID */
4547    int n_ExternalID;
4548    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4549    int n_SystemID;
4550
4551    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4552    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4553    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4554    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4555        mem_base = xmlMemBlocks();
4556        ctx = gen_void_ptr(n_ctx, 0);
4557        name = gen_const_xmlChar_ptr(n_name, 1);
4558        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4559        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4560
4561        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4562        call_tests++;
4563        des_void_ptr(n_ctx, ctx, 0);
4564        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4565        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4566        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4567        xmlResetLastError();
4568        if (mem_base != xmlMemBlocks()) {
4569            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4570	           xmlMemBlocks() - mem_base);
4571	    test_ret++;
4572            printf(" %d", n_ctx);
4573            printf(" %d", n_name);
4574            printf(" %d", n_ExternalID);
4575            printf(" %d", n_SystemID);
4576            printf("\n");
4577        }
4578    }
4579    }
4580    }
4581    }
4582    function_tests++;
4583
4584    return(test_ret);
4585}
4586
4587
4588static int
4589test_xmlSAX2IsStandalone(void) {
4590    int test_ret = 0;
4591
4592    int mem_base;
4593    int ret_val;
4594    void * ctx; /* the user data (XML parser context) */
4595    int n_ctx;
4596
4597    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4598        mem_base = xmlMemBlocks();
4599        ctx = gen_void_ptr(n_ctx, 0);
4600
4601        ret_val = xmlSAX2IsStandalone(ctx);
4602        desret_int(ret_val);
4603        call_tests++;
4604        des_void_ptr(n_ctx, ctx, 0);
4605        xmlResetLastError();
4606        if (mem_base != xmlMemBlocks()) {
4607            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4608	           xmlMemBlocks() - mem_base);
4609	    test_ret++;
4610            printf(" %d", n_ctx);
4611            printf("\n");
4612        }
4613    }
4614    function_tests++;
4615
4616    return(test_ret);
4617}
4618
4619
4620static int
4621test_xmlSAX2NotationDecl(void) {
4622    int test_ret = 0;
4623
4624    int mem_base;
4625    void * ctx; /* the user data (XML parser context) */
4626    int n_ctx;
4627    xmlChar * name; /* The name of the notation */
4628    int n_name;
4629    xmlChar * publicId; /* The public ID of the entity */
4630    int n_publicId;
4631    xmlChar * systemId; /* The system ID of the entity */
4632    int n_systemId;
4633
4634    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4635    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4636    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4637    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4638        mem_base = xmlMemBlocks();
4639        ctx = gen_void_ptr(n_ctx, 0);
4640        name = gen_const_xmlChar_ptr(n_name, 1);
4641        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4642        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4643
4644        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4645        call_tests++;
4646        des_void_ptr(n_ctx, ctx, 0);
4647        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4648        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4649        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4650        xmlResetLastError();
4651        if (mem_base != xmlMemBlocks()) {
4652            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4653	           xmlMemBlocks() - mem_base);
4654	    test_ret++;
4655            printf(" %d", n_ctx);
4656            printf(" %d", n_name);
4657            printf(" %d", n_publicId);
4658            printf(" %d", n_systemId);
4659            printf("\n");
4660        }
4661    }
4662    }
4663    }
4664    }
4665    function_tests++;
4666
4667    return(test_ret);
4668}
4669
4670
4671static int
4672test_xmlSAX2ProcessingInstruction(void) {
4673    int test_ret = 0;
4674
4675    int mem_base;
4676    void * ctx; /* the user data (XML parser context) */
4677    int n_ctx;
4678    xmlChar * target; /* the target name */
4679    int n_target;
4680    xmlChar * data; /* the PI data's */
4681    int n_data;
4682
4683    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4684    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4685    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4686        mem_base = xmlMemBlocks();
4687        ctx = gen_void_ptr(n_ctx, 0);
4688        target = gen_const_xmlChar_ptr(n_target, 1);
4689        data = gen_const_xmlChar_ptr(n_data, 2);
4690
4691        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4692        call_tests++;
4693        des_void_ptr(n_ctx, ctx, 0);
4694        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4695        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4696        xmlResetLastError();
4697        if (mem_base != xmlMemBlocks()) {
4698            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4699	           xmlMemBlocks() - mem_base);
4700	    test_ret++;
4701            printf(" %d", n_ctx);
4702            printf(" %d", n_target);
4703            printf(" %d", n_data);
4704            printf("\n");
4705        }
4706    }
4707    }
4708    }
4709    function_tests++;
4710
4711    return(test_ret);
4712}
4713
4714
4715static int
4716test_xmlSAX2Reference(void) {
4717    int test_ret = 0;
4718
4719    int mem_base;
4720    void * ctx; /* the user data (XML parser context) */
4721    int n_ctx;
4722    xmlChar * name; /* The entity name */
4723    int n_name;
4724
4725    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4726    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4727        mem_base = xmlMemBlocks();
4728        ctx = gen_void_ptr(n_ctx, 0);
4729        name = gen_const_xmlChar_ptr(n_name, 1);
4730
4731        xmlSAX2Reference(ctx, (const xmlChar *)name);
4732        call_tests++;
4733        des_void_ptr(n_ctx, ctx, 0);
4734        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4735        xmlResetLastError();
4736        if (mem_base != xmlMemBlocks()) {
4737            printf("Leak of %d blocks found in xmlSAX2Reference",
4738	           xmlMemBlocks() - mem_base);
4739	    test_ret++;
4740            printf(" %d", n_ctx);
4741            printf(" %d", n_name);
4742            printf("\n");
4743        }
4744    }
4745    }
4746    function_tests++;
4747
4748    return(test_ret);
4749}
4750
4751
4752static int
4753test_xmlSAX2ResolveEntity(void) {
4754    int test_ret = 0;
4755
4756    int mem_base;
4757    xmlParserInputPtr ret_val;
4758    void * ctx; /* the user data (XML parser context) */
4759    int n_ctx;
4760    xmlChar * publicId; /* The public ID of the entity */
4761    int n_publicId;
4762    xmlChar * systemId; /* The system ID of the entity */
4763    int n_systemId;
4764
4765    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4766    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4767    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4768        mem_base = xmlMemBlocks();
4769        ctx = gen_void_ptr(n_ctx, 0);
4770        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4771        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4772
4773        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4774        desret_xmlParserInputPtr(ret_val);
4775        call_tests++;
4776        des_void_ptr(n_ctx, ctx, 0);
4777        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4778        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4779        xmlResetLastError();
4780        if (mem_base != xmlMemBlocks()) {
4781            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4782	           xmlMemBlocks() - mem_base);
4783	    test_ret++;
4784            printf(" %d", n_ctx);
4785            printf(" %d", n_publicId);
4786            printf(" %d", n_systemId);
4787            printf("\n");
4788        }
4789    }
4790    }
4791    }
4792    function_tests++;
4793
4794    return(test_ret);
4795}
4796
4797
4798#define gen_nb_xmlSAXLocatorPtr 1
4799static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4800    return(NULL);
4801}
4802static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4803}
4804
4805static int
4806test_xmlSAX2SetDocumentLocator(void) {
4807    int test_ret = 0;
4808
4809    int mem_base;
4810    void * ctx; /* the user data (XML parser context) */
4811    int n_ctx;
4812    xmlSAXLocatorPtr loc; /* A SAX Locator */
4813    int n_loc;
4814
4815    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4816    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4817        mem_base = xmlMemBlocks();
4818        ctx = gen_void_ptr(n_ctx, 0);
4819        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4820
4821        xmlSAX2SetDocumentLocator(ctx, loc);
4822        call_tests++;
4823        des_void_ptr(n_ctx, ctx, 0);
4824        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4825        xmlResetLastError();
4826        if (mem_base != xmlMemBlocks()) {
4827            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4828	           xmlMemBlocks() - mem_base);
4829	    test_ret++;
4830            printf(" %d", n_ctx);
4831            printf(" %d", n_loc);
4832            printf("\n");
4833        }
4834    }
4835    }
4836    function_tests++;
4837
4838    return(test_ret);
4839}
4840
4841
4842static int
4843test_xmlSAX2StartDocument(void) {
4844    int test_ret = 0;
4845
4846    int mem_base;
4847    void * ctx; /* the user data (XML parser context) */
4848    int n_ctx;
4849
4850    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4851        mem_base = xmlMemBlocks();
4852        ctx = gen_void_ptr(n_ctx, 0);
4853
4854        xmlSAX2StartDocument(ctx);
4855        call_tests++;
4856        des_void_ptr(n_ctx, ctx, 0);
4857        xmlResetLastError();
4858        if (mem_base != xmlMemBlocks()) {
4859            printf("Leak of %d blocks found in xmlSAX2StartDocument",
4860	           xmlMemBlocks() - mem_base);
4861	    test_ret++;
4862            printf(" %d", n_ctx);
4863            printf("\n");
4864        }
4865    }
4866    function_tests++;
4867
4868    return(test_ret);
4869}
4870
4871
4872static int
4873test_xmlSAX2StartElement(void) {
4874    int test_ret = 0;
4875
4876#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
4877#ifdef LIBXML_SAX1_ENABLED
4878    int mem_base;
4879    void * ctx; /* the user data (XML parser context) */
4880    int n_ctx;
4881    xmlChar * fullname; /* The element name, including namespace prefix */
4882    int n_fullname;
4883    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
4884    int n_atts;
4885
4886    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4887    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
4888    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
4889        mem_base = xmlMemBlocks();
4890        ctx = gen_void_ptr(n_ctx, 0);
4891        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
4892        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
4893
4894        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
4895        call_tests++;
4896        des_void_ptr(n_ctx, ctx, 0);
4897        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
4898        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
4899        xmlResetLastError();
4900        if (mem_base != xmlMemBlocks()) {
4901            printf("Leak of %d blocks found in xmlSAX2StartElement",
4902	           xmlMemBlocks() - mem_base);
4903	    test_ret++;
4904            printf(" %d", n_ctx);
4905            printf(" %d", n_fullname);
4906            printf(" %d", n_atts);
4907            printf("\n");
4908        }
4909    }
4910    }
4911    }
4912    function_tests++;
4913#endif
4914#endif
4915
4916    return(test_ret);
4917}
4918
4919
4920static int
4921test_xmlSAX2StartElementNs(void) {
4922    int test_ret = 0;
4923
4924    int mem_base;
4925    void * ctx; /* the user data (XML parser context) */
4926    int n_ctx;
4927    xmlChar * localname; /* the local name of the element */
4928    int n_localname;
4929    xmlChar * prefix; /* the element namespace prefix if available */
4930    int n_prefix;
4931    xmlChar * URI; /* the element namespace name if available */
4932    int n_URI;
4933    int nb_namespaces; /* number of namespace definitions on that node */
4934    int n_nb_namespaces;
4935    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
4936    int n_namespaces;
4937    int nb_attributes; /* the number of attributes on that node */
4938    int n_nb_attributes;
4939    int nb_defaulted; /* the number of defaulted attributes. */
4940    int n_nb_defaulted;
4941    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
4942    int n_attributes;
4943
4944    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4945    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4946    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4947    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4948    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
4949    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
4950    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
4951    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
4952    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
4953        mem_base = xmlMemBlocks();
4954        ctx = gen_void_ptr(n_ctx, 0);
4955        localname = gen_const_xmlChar_ptr(n_localname, 1);
4956        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4957        URI = gen_const_xmlChar_ptr(n_URI, 3);
4958        nb_namespaces = gen_int(n_nb_namespaces, 4);
4959        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
4960        nb_attributes = gen_int(n_nb_attributes, 6);
4961        nb_defaulted = gen_int(n_nb_defaulted, 7);
4962        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
4963
4964        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
4965        call_tests++;
4966        des_void_ptr(n_ctx, ctx, 0);
4967        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4968        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4969        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4970        des_int(n_nb_namespaces, nb_namespaces, 4);
4971        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
4972        des_int(n_nb_attributes, nb_attributes, 6);
4973        des_int(n_nb_defaulted, nb_defaulted, 7);
4974        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
4975        xmlResetLastError();
4976        if (mem_base != xmlMemBlocks()) {
4977            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
4978	           xmlMemBlocks() - mem_base);
4979	    test_ret++;
4980            printf(" %d", n_ctx);
4981            printf(" %d", n_localname);
4982            printf(" %d", n_prefix);
4983            printf(" %d", n_URI);
4984            printf(" %d", n_nb_namespaces);
4985            printf(" %d", n_namespaces);
4986            printf(" %d", n_nb_attributes);
4987            printf(" %d", n_nb_defaulted);
4988            printf(" %d", n_attributes);
4989            printf("\n");
4990        }
4991    }
4992    }
4993    }
4994    }
4995    }
4996    }
4997    }
4998    }
4999    }
5000    function_tests++;
5001
5002    return(test_ret);
5003}
5004
5005
5006static int
5007test_xmlSAX2UnparsedEntityDecl(void) {
5008    int test_ret = 0;
5009
5010    int mem_base;
5011    void * ctx; /* the user data (XML parser context) */
5012    int n_ctx;
5013    xmlChar * name; /* The name of the entity */
5014    int n_name;
5015    xmlChar * publicId; /* The public ID of the entity */
5016    int n_publicId;
5017    xmlChar * systemId; /* The system ID of the entity */
5018    int n_systemId;
5019    xmlChar * notationName; /* the name of the notation */
5020    int n_notationName;
5021
5022    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5023    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5024    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5025    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5026    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5027        mem_base = xmlMemBlocks();
5028        ctx = gen_void_ptr(n_ctx, 0);
5029        name = gen_const_xmlChar_ptr(n_name, 1);
5030        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5031        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5032        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5033
5034        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5035        call_tests++;
5036        des_void_ptr(n_ctx, ctx, 0);
5037        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5038        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5039        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5040        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5041        xmlResetLastError();
5042        if (mem_base != xmlMemBlocks()) {
5043            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5044	           xmlMemBlocks() - mem_base);
5045	    test_ret++;
5046            printf(" %d", n_ctx);
5047            printf(" %d", n_name);
5048            printf(" %d", n_publicId);
5049            printf(" %d", n_systemId);
5050            printf(" %d", n_notationName);
5051            printf("\n");
5052        }
5053    }
5054    }
5055    }
5056    }
5057    }
5058    function_tests++;
5059
5060    return(test_ret);
5061}
5062
5063
5064static int
5065test_xmlSAXDefaultVersion(void) {
5066    int test_ret = 0;
5067
5068#if defined(LIBXML_SAX1_ENABLED)
5069#ifdef LIBXML_SAX1_ENABLED
5070    int mem_base;
5071    int ret_val;
5072    int version; /* the version, 1 or 2 */
5073    int n_version;
5074
5075    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5076        mem_base = xmlMemBlocks();
5077        version = gen_int(n_version, 0);
5078
5079        ret_val = xmlSAXDefaultVersion(version);
5080        desret_int(ret_val);
5081        call_tests++;
5082        des_int(n_version, version, 0);
5083        xmlResetLastError();
5084        if (mem_base != xmlMemBlocks()) {
5085            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5086	           xmlMemBlocks() - mem_base);
5087	    test_ret++;
5088            printf(" %d", n_version);
5089            printf("\n");
5090        }
5091    }
5092    function_tests++;
5093#endif
5094#endif
5095
5096    return(test_ret);
5097}
5098
5099
5100static int
5101test_xmlSAXVersion(void) {
5102    int test_ret = 0;
5103
5104    int mem_base;
5105    int ret_val;
5106    xmlSAXHandler * hdlr; /* the SAX handler */
5107    int n_hdlr;
5108    int version; /* the version, 1 or 2 */
5109    int n_version;
5110
5111    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5112    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5113        mem_base = xmlMemBlocks();
5114        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5115        version = gen_int(n_version, 1);
5116
5117        ret_val = xmlSAXVersion(hdlr, version);
5118        desret_int(ret_val);
5119        call_tests++;
5120        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5121        des_int(n_version, version, 1);
5122        xmlResetLastError();
5123        if (mem_base != xmlMemBlocks()) {
5124            printf("Leak of %d blocks found in xmlSAXVersion",
5125	           xmlMemBlocks() - mem_base);
5126	    test_ret++;
5127            printf(" %d", n_hdlr);
5128            printf(" %d", n_version);
5129            printf("\n");
5130        }
5131    }
5132    }
5133    function_tests++;
5134
5135    return(test_ret);
5136}
5137
5138static int
5139test_SAX2(void) {
5140    int test_ret = 0;
5141
5142    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5143    test_ret += test_docbDefaultSAXHandlerInit();
5144    test_ret += test_htmlDefaultSAXHandlerInit();
5145    test_ret += test_xmlDefaultSAXHandlerInit();
5146    test_ret += test_xmlSAX2AttributeDecl();
5147    test_ret += test_xmlSAX2CDataBlock();
5148    test_ret += test_xmlSAX2Characters();
5149    test_ret += test_xmlSAX2Comment();
5150    test_ret += test_xmlSAX2ElementDecl();
5151    test_ret += test_xmlSAX2EndDocument();
5152    test_ret += test_xmlSAX2EndElement();
5153    test_ret += test_xmlSAX2EndElementNs();
5154    test_ret += test_xmlSAX2EntityDecl();
5155    test_ret += test_xmlSAX2ExternalSubset();
5156    test_ret += test_xmlSAX2GetColumnNumber();
5157    test_ret += test_xmlSAX2GetEntity();
5158    test_ret += test_xmlSAX2GetLineNumber();
5159    test_ret += test_xmlSAX2GetParameterEntity();
5160    test_ret += test_xmlSAX2GetPublicId();
5161    test_ret += test_xmlSAX2GetSystemId();
5162    test_ret += test_xmlSAX2HasExternalSubset();
5163    test_ret += test_xmlSAX2HasInternalSubset();
5164    test_ret += test_xmlSAX2IgnorableWhitespace();
5165    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5166    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5167    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5168    test_ret += test_xmlSAX2InternalSubset();
5169    test_ret += test_xmlSAX2IsStandalone();
5170    test_ret += test_xmlSAX2NotationDecl();
5171    test_ret += test_xmlSAX2ProcessingInstruction();
5172    test_ret += test_xmlSAX2Reference();
5173    test_ret += test_xmlSAX2ResolveEntity();
5174    test_ret += test_xmlSAX2SetDocumentLocator();
5175    test_ret += test_xmlSAX2StartDocument();
5176    test_ret += test_xmlSAX2StartElement();
5177    test_ret += test_xmlSAX2StartElementNs();
5178    test_ret += test_xmlSAX2UnparsedEntityDecl();
5179    test_ret += test_xmlSAXDefaultVersion();
5180    test_ret += test_xmlSAXVersion();
5181
5182    if (test_ret != 0)
5183	printf("Module SAX2: %d errors\n", test_ret);
5184    return(test_ret);
5185}
5186
5187static int
5188test_xmlC14NDocDumpMemory(void) {
5189    int test_ret = 0;
5190
5191#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5192    int mem_base;
5193    int ret_val;
5194    xmlDocPtr doc; /* the XML document for canonization */
5195    int n_doc;
5196    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5197    int n_nodes;
5198    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5199    int n_exclusive;
5200    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) */
5201    int n_inclusive_ns_prefixes;
5202    int with_comments; /* include comments in the result (!=0) or not (==0) */
5203    int n_with_comments;
5204    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 */
5205    int n_doc_txt_ptr;
5206
5207    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5208    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5209    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5210    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5211    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5212    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5213        mem_base = xmlMemBlocks();
5214        doc = gen_xmlDocPtr(n_doc, 0);
5215        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5216        exclusive = gen_int(n_exclusive, 2);
5217        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5218        with_comments = gen_int(n_with_comments, 4);
5219        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5220
5221        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5222        desret_int(ret_val);
5223        call_tests++;
5224        des_xmlDocPtr(n_doc, doc, 0);
5225        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5226        des_int(n_exclusive, exclusive, 2);
5227        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5228        des_int(n_with_comments, with_comments, 4);
5229        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5230        xmlResetLastError();
5231        if (mem_base != xmlMemBlocks()) {
5232            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5233	           xmlMemBlocks() - mem_base);
5234	    test_ret++;
5235            printf(" %d", n_doc);
5236            printf(" %d", n_nodes);
5237            printf(" %d", n_exclusive);
5238            printf(" %d", n_inclusive_ns_prefixes);
5239            printf(" %d", n_with_comments);
5240            printf(" %d", n_doc_txt_ptr);
5241            printf("\n");
5242        }
5243    }
5244    }
5245    }
5246    }
5247    }
5248    }
5249    function_tests++;
5250#endif
5251
5252    return(test_ret);
5253}
5254
5255
5256static int
5257test_xmlC14NDocSave(void) {
5258    int test_ret = 0;
5259
5260#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5261    int mem_base;
5262    int ret_val;
5263    xmlDocPtr doc; /* the XML document for canonization */
5264    int n_doc;
5265    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5266    int n_nodes;
5267    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5268    int n_exclusive;
5269    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) */
5270    int n_inclusive_ns_prefixes;
5271    int with_comments; /* include comments in the result (!=0) or not (==0) */
5272    int n_with_comments;
5273    const char * filename; /* the filename to store canonical XML image */
5274    int n_filename;
5275    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5276    int n_compression;
5277
5278    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5279    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5280    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5281    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5282    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5283    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5284    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5285        mem_base = xmlMemBlocks();
5286        doc = gen_xmlDocPtr(n_doc, 0);
5287        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5288        exclusive = gen_int(n_exclusive, 2);
5289        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5290        with_comments = gen_int(n_with_comments, 4);
5291        filename = gen_fileoutput(n_filename, 5);
5292        compression = gen_int(n_compression, 6);
5293
5294        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5295        desret_int(ret_val);
5296        call_tests++;
5297        des_xmlDocPtr(n_doc, doc, 0);
5298        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5299        des_int(n_exclusive, exclusive, 2);
5300        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5301        des_int(n_with_comments, with_comments, 4);
5302        des_fileoutput(n_filename, filename, 5);
5303        des_int(n_compression, compression, 6);
5304        xmlResetLastError();
5305        if (mem_base != xmlMemBlocks()) {
5306            printf("Leak of %d blocks found in xmlC14NDocSave",
5307	           xmlMemBlocks() - mem_base);
5308	    test_ret++;
5309            printf(" %d", n_doc);
5310            printf(" %d", n_nodes);
5311            printf(" %d", n_exclusive);
5312            printf(" %d", n_inclusive_ns_prefixes);
5313            printf(" %d", n_with_comments);
5314            printf(" %d", n_filename);
5315            printf(" %d", n_compression);
5316            printf("\n");
5317        }
5318    }
5319    }
5320    }
5321    }
5322    }
5323    }
5324    }
5325    function_tests++;
5326#endif
5327
5328    return(test_ret);
5329}
5330
5331
5332static int
5333test_xmlC14NDocSaveTo(void) {
5334    int test_ret = 0;
5335
5336#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5337    int mem_base;
5338    int ret_val;
5339    xmlDocPtr doc; /* the XML document for canonization */
5340    int n_doc;
5341    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5342    int n_nodes;
5343    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5344    int n_exclusive;
5345    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) */
5346    int n_inclusive_ns_prefixes;
5347    int with_comments; /* include comments in the result (!=0) or not (==0) */
5348    int n_with_comments;
5349    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5350    int n_buf;
5351
5352    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5353    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5354    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5355    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5356    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5357    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5358        mem_base = xmlMemBlocks();
5359        doc = gen_xmlDocPtr(n_doc, 0);
5360        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5361        exclusive = gen_int(n_exclusive, 2);
5362        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5363        with_comments = gen_int(n_with_comments, 4);
5364        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5365
5366        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5367        desret_int(ret_val);
5368        call_tests++;
5369        des_xmlDocPtr(n_doc, doc, 0);
5370        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5371        des_int(n_exclusive, exclusive, 2);
5372        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5373        des_int(n_with_comments, with_comments, 4);
5374        des_xmlOutputBufferPtr(n_buf, buf, 5);
5375        xmlResetLastError();
5376        if (mem_base != xmlMemBlocks()) {
5377            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5378	           xmlMemBlocks() - mem_base);
5379	    test_ret++;
5380            printf(" %d", n_doc);
5381            printf(" %d", n_nodes);
5382            printf(" %d", n_exclusive);
5383            printf(" %d", n_inclusive_ns_prefixes);
5384            printf(" %d", n_with_comments);
5385            printf(" %d", n_buf);
5386            printf("\n");
5387        }
5388    }
5389    }
5390    }
5391    }
5392    }
5393    }
5394    function_tests++;
5395#endif
5396
5397    return(test_ret);
5398}
5399
5400
5401static int
5402test_xmlC14NExecute(void) {
5403    int test_ret = 0;
5404
5405
5406    /* missing type support */
5407    return(test_ret);
5408}
5409
5410static int
5411test_c14n(void) {
5412    int test_ret = 0;
5413
5414    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5415    test_ret += test_xmlC14NDocDumpMemory();
5416    test_ret += test_xmlC14NDocSave();
5417    test_ret += test_xmlC14NDocSaveTo();
5418    test_ret += test_xmlC14NExecute();
5419
5420    if (test_ret != 0)
5421	printf("Module c14n: %d errors\n", test_ret);
5422    return(test_ret);
5423}
5424#ifdef LIBXML_CATALOG_ENABLED
5425
5426#define gen_nb_xmlCatalogPtr 1
5427static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5428    return(NULL);
5429}
5430static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5431}
5432#endif
5433
5434
5435static int
5436test_xmlACatalogAdd(void) {
5437    int test_ret = 0;
5438
5439#if defined(LIBXML_CATALOG_ENABLED)
5440    int mem_base;
5441    int ret_val;
5442    xmlCatalogPtr catal; /* a Catalog */
5443    int n_catal;
5444    xmlChar * type; /* the type of record to add to the catalog */
5445    int n_type;
5446    xmlChar * orig; /* the system, public or prefix to match */
5447    int n_orig;
5448    xmlChar * replace; /* the replacement value for the match */
5449    int n_replace;
5450
5451    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5452    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5453    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5454    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5455        mem_base = xmlMemBlocks();
5456        catal = gen_xmlCatalogPtr(n_catal, 0);
5457        type = gen_const_xmlChar_ptr(n_type, 1);
5458        orig = gen_const_xmlChar_ptr(n_orig, 2);
5459        replace = gen_const_xmlChar_ptr(n_replace, 3);
5460
5461        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5462        desret_int(ret_val);
5463        call_tests++;
5464        des_xmlCatalogPtr(n_catal, catal, 0);
5465        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5466        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5467        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5468        xmlResetLastError();
5469        if (mem_base != xmlMemBlocks()) {
5470            printf("Leak of %d blocks found in xmlACatalogAdd",
5471	           xmlMemBlocks() - mem_base);
5472	    test_ret++;
5473            printf(" %d", n_catal);
5474            printf(" %d", n_type);
5475            printf(" %d", n_orig);
5476            printf(" %d", n_replace);
5477            printf("\n");
5478        }
5479    }
5480    }
5481    }
5482    }
5483    function_tests++;
5484#endif
5485
5486    return(test_ret);
5487}
5488
5489
5490static int
5491test_xmlACatalogDump(void) {
5492    int test_ret = 0;
5493
5494#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5495    int mem_base;
5496    xmlCatalogPtr catal; /* a Catalog */
5497    int n_catal;
5498    FILE * out; /* the file. */
5499    int n_out;
5500
5501    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5502    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5503        mem_base = xmlMemBlocks();
5504        catal = gen_xmlCatalogPtr(n_catal, 0);
5505        out = gen_FILE_ptr(n_out, 1);
5506
5507        xmlACatalogDump(catal, out);
5508        call_tests++;
5509        des_xmlCatalogPtr(n_catal, catal, 0);
5510        des_FILE_ptr(n_out, out, 1);
5511        xmlResetLastError();
5512        if (mem_base != xmlMemBlocks()) {
5513            printf("Leak of %d blocks found in xmlACatalogDump",
5514	           xmlMemBlocks() - mem_base);
5515	    test_ret++;
5516            printf(" %d", n_catal);
5517            printf(" %d", n_out);
5518            printf("\n");
5519        }
5520    }
5521    }
5522    function_tests++;
5523#endif
5524
5525    return(test_ret);
5526}
5527
5528
5529static int
5530test_xmlACatalogRemove(void) {
5531    int test_ret = 0;
5532
5533#if defined(LIBXML_CATALOG_ENABLED)
5534    int mem_base;
5535    int ret_val;
5536    xmlCatalogPtr catal; /* a Catalog */
5537    int n_catal;
5538    xmlChar * value; /* the value to remove */
5539    int n_value;
5540
5541    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5542    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5543        mem_base = xmlMemBlocks();
5544        catal = gen_xmlCatalogPtr(n_catal, 0);
5545        value = gen_const_xmlChar_ptr(n_value, 1);
5546
5547        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5548        desret_int(ret_val);
5549        call_tests++;
5550        des_xmlCatalogPtr(n_catal, catal, 0);
5551        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5552        xmlResetLastError();
5553        if (mem_base != xmlMemBlocks()) {
5554            printf("Leak of %d blocks found in xmlACatalogRemove",
5555	           xmlMemBlocks() - mem_base);
5556	    test_ret++;
5557            printf(" %d", n_catal);
5558            printf(" %d", n_value);
5559            printf("\n");
5560        }
5561    }
5562    }
5563    function_tests++;
5564#endif
5565
5566    return(test_ret);
5567}
5568
5569
5570static int
5571test_xmlACatalogResolve(void) {
5572    int test_ret = 0;
5573
5574#if defined(LIBXML_CATALOG_ENABLED)
5575    int mem_base;
5576    xmlChar * ret_val;
5577    xmlCatalogPtr catal; /* a Catalog */
5578    int n_catal;
5579    xmlChar * pubID; /* the public ID string */
5580    int n_pubID;
5581    xmlChar * sysID; /* the system ID string */
5582    int n_sysID;
5583
5584    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5585    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5586    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5587        mem_base = xmlMemBlocks();
5588        catal = gen_xmlCatalogPtr(n_catal, 0);
5589        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5590        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5591
5592        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5593        desret_xmlChar_ptr(ret_val);
5594        call_tests++;
5595        des_xmlCatalogPtr(n_catal, catal, 0);
5596        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5597        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5598        xmlResetLastError();
5599        if (mem_base != xmlMemBlocks()) {
5600            printf("Leak of %d blocks found in xmlACatalogResolve",
5601	           xmlMemBlocks() - mem_base);
5602	    test_ret++;
5603            printf(" %d", n_catal);
5604            printf(" %d", n_pubID);
5605            printf(" %d", n_sysID);
5606            printf("\n");
5607        }
5608    }
5609    }
5610    }
5611    function_tests++;
5612#endif
5613
5614    return(test_ret);
5615}
5616
5617
5618static int
5619test_xmlACatalogResolvePublic(void) {
5620    int test_ret = 0;
5621
5622#if defined(LIBXML_CATALOG_ENABLED)
5623    int mem_base;
5624    xmlChar * ret_val;
5625    xmlCatalogPtr catal; /* a Catalog */
5626    int n_catal;
5627    xmlChar * pubID; /* the public ID string */
5628    int n_pubID;
5629
5630    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5631    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5632        mem_base = xmlMemBlocks();
5633        catal = gen_xmlCatalogPtr(n_catal, 0);
5634        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5635
5636        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5637        desret_xmlChar_ptr(ret_val);
5638        call_tests++;
5639        des_xmlCatalogPtr(n_catal, catal, 0);
5640        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5641        xmlResetLastError();
5642        if (mem_base != xmlMemBlocks()) {
5643            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5644	           xmlMemBlocks() - mem_base);
5645	    test_ret++;
5646            printf(" %d", n_catal);
5647            printf(" %d", n_pubID);
5648            printf("\n");
5649        }
5650    }
5651    }
5652    function_tests++;
5653#endif
5654
5655    return(test_ret);
5656}
5657
5658
5659static int
5660test_xmlACatalogResolveSystem(void) {
5661    int test_ret = 0;
5662
5663#if defined(LIBXML_CATALOG_ENABLED)
5664    int mem_base;
5665    xmlChar * ret_val;
5666    xmlCatalogPtr catal; /* a Catalog */
5667    int n_catal;
5668    xmlChar * sysID; /* the system ID string */
5669    int n_sysID;
5670
5671    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5672    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5673        mem_base = xmlMemBlocks();
5674        catal = gen_xmlCatalogPtr(n_catal, 0);
5675        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5676
5677        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5678        desret_xmlChar_ptr(ret_val);
5679        call_tests++;
5680        des_xmlCatalogPtr(n_catal, catal, 0);
5681        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5682        xmlResetLastError();
5683        if (mem_base != xmlMemBlocks()) {
5684            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5685	           xmlMemBlocks() - mem_base);
5686	    test_ret++;
5687            printf(" %d", n_catal);
5688            printf(" %d", n_sysID);
5689            printf("\n");
5690        }
5691    }
5692    }
5693    function_tests++;
5694#endif
5695
5696    return(test_ret);
5697}
5698
5699
5700static int
5701test_xmlACatalogResolveURI(void) {
5702    int test_ret = 0;
5703
5704#if defined(LIBXML_CATALOG_ENABLED)
5705    int mem_base;
5706    xmlChar * ret_val;
5707    xmlCatalogPtr catal; /* a Catalog */
5708    int n_catal;
5709    xmlChar * URI; /* the URI */
5710    int n_URI;
5711
5712    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5713    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5714        mem_base = xmlMemBlocks();
5715        catal = gen_xmlCatalogPtr(n_catal, 0);
5716        URI = gen_const_xmlChar_ptr(n_URI, 1);
5717
5718        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5719        desret_xmlChar_ptr(ret_val);
5720        call_tests++;
5721        des_xmlCatalogPtr(n_catal, catal, 0);
5722        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5723        xmlResetLastError();
5724        if (mem_base != xmlMemBlocks()) {
5725            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5726	           xmlMemBlocks() - mem_base);
5727	    test_ret++;
5728            printf(" %d", n_catal);
5729            printf(" %d", n_URI);
5730            printf("\n");
5731        }
5732    }
5733    }
5734    function_tests++;
5735#endif
5736
5737    return(test_ret);
5738}
5739
5740
5741static int
5742test_xmlCatalogAdd(void) {
5743    int test_ret = 0;
5744
5745#if defined(LIBXML_CATALOG_ENABLED)
5746    int mem_base;
5747    int ret_val;
5748    xmlChar * type; /* the type of record to add to the catalog */
5749    int n_type;
5750    xmlChar * orig; /* the system, public or prefix to match */
5751    int n_orig;
5752    xmlChar * replace; /* the replacement value for the match */
5753    int n_replace;
5754
5755    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5756    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5757    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5758        mem_base = xmlMemBlocks();
5759        type = gen_const_xmlChar_ptr(n_type, 0);
5760        orig = gen_const_xmlChar_ptr(n_orig, 1);
5761        replace = gen_const_xmlChar_ptr(n_replace, 2);
5762
5763        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5764        desret_int(ret_val);
5765        call_tests++;
5766        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5767        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5768        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5769        xmlResetLastError();
5770        if (mem_base != xmlMemBlocks()) {
5771            printf("Leak of %d blocks found in xmlCatalogAdd",
5772	           xmlMemBlocks() - mem_base);
5773	    test_ret++;
5774            printf(" %d", n_type);
5775            printf(" %d", n_orig);
5776            printf(" %d", n_replace);
5777            printf("\n");
5778        }
5779    }
5780    }
5781    }
5782    function_tests++;
5783#endif
5784
5785    return(test_ret);
5786}
5787
5788
5789static int
5790test_xmlCatalogCleanup(void) {
5791    int test_ret = 0;
5792
5793#if defined(LIBXML_CATALOG_ENABLED)
5794
5795
5796        xmlCatalogCleanup();
5797        call_tests++;
5798        xmlResetLastError();
5799    function_tests++;
5800#endif
5801
5802    return(test_ret);
5803}
5804
5805
5806static int
5807test_xmlCatalogConvert(void) {
5808    int test_ret = 0;
5809
5810#if defined(LIBXML_CATALOG_ENABLED)
5811    int ret_val;
5812
5813
5814        ret_val = xmlCatalogConvert();
5815        desret_int(ret_val);
5816        call_tests++;
5817        xmlResetLastError();
5818    function_tests++;
5819#endif
5820
5821    return(test_ret);
5822}
5823
5824
5825static int
5826test_xmlCatalogDump(void) {
5827    int test_ret = 0;
5828
5829#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5830    int mem_base;
5831    FILE * out; /* the file. */
5832    int n_out;
5833
5834    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5835        mem_base = xmlMemBlocks();
5836        out = gen_FILE_ptr(n_out, 0);
5837
5838        xmlCatalogDump(out);
5839        call_tests++;
5840        des_FILE_ptr(n_out, out, 0);
5841        xmlResetLastError();
5842        if (mem_base != xmlMemBlocks()) {
5843            printf("Leak of %d blocks found in xmlCatalogDump",
5844	           xmlMemBlocks() - mem_base);
5845	    test_ret++;
5846            printf(" %d", n_out);
5847            printf("\n");
5848        }
5849    }
5850    function_tests++;
5851#endif
5852
5853    return(test_ret);
5854}
5855
5856
5857static int
5858test_xmlCatalogGetDefaults(void) {
5859    int test_ret = 0;
5860
5861#if defined(LIBXML_CATALOG_ENABLED)
5862    int mem_base;
5863    xmlCatalogAllow ret_val;
5864
5865        mem_base = xmlMemBlocks();
5866
5867        ret_val = xmlCatalogGetDefaults();
5868        desret_xmlCatalogAllow(ret_val);
5869        call_tests++;
5870        xmlResetLastError();
5871        if (mem_base != xmlMemBlocks()) {
5872            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
5873	           xmlMemBlocks() - mem_base);
5874	    test_ret++;
5875            printf("\n");
5876        }
5877    function_tests++;
5878#endif
5879
5880    return(test_ret);
5881}
5882
5883
5884static int
5885test_xmlCatalogIsEmpty(void) {
5886    int test_ret = 0;
5887
5888#if defined(LIBXML_CATALOG_ENABLED)
5889    int mem_base;
5890    int ret_val;
5891    xmlCatalogPtr catal; /* should this create an SGML catalog */
5892    int n_catal;
5893
5894    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5895        mem_base = xmlMemBlocks();
5896        catal = gen_xmlCatalogPtr(n_catal, 0);
5897
5898        ret_val = xmlCatalogIsEmpty(catal);
5899        desret_int(ret_val);
5900        call_tests++;
5901        des_xmlCatalogPtr(n_catal, catal, 0);
5902        xmlResetLastError();
5903        if (mem_base != xmlMemBlocks()) {
5904            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
5905	           xmlMemBlocks() - mem_base);
5906	    test_ret++;
5907            printf(" %d", n_catal);
5908            printf("\n");
5909        }
5910    }
5911    function_tests++;
5912#endif
5913
5914    return(test_ret);
5915}
5916
5917
5918static int
5919test_xmlCatalogLocalResolve(void) {
5920    int test_ret = 0;
5921
5922#if defined(LIBXML_CATALOG_ENABLED)
5923    int mem_base;
5924    xmlChar * ret_val;
5925    void * catalogs; /* a document's list of catalogs */
5926    int n_catalogs;
5927    xmlChar * pubID; /* the public ID string */
5928    int n_pubID;
5929    xmlChar * sysID; /* the system ID string */
5930    int n_sysID;
5931
5932    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5933    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5934    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5935        mem_base = xmlMemBlocks();
5936        catalogs = gen_void_ptr(n_catalogs, 0);
5937        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5938        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5939
5940        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
5941        desret_xmlChar_ptr(ret_val);
5942        call_tests++;
5943        des_void_ptr(n_catalogs, catalogs, 0);
5944        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5945        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5946        xmlResetLastError();
5947        if (mem_base != xmlMemBlocks()) {
5948            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
5949	           xmlMemBlocks() - mem_base);
5950	    test_ret++;
5951            printf(" %d", n_catalogs);
5952            printf(" %d", n_pubID);
5953            printf(" %d", n_sysID);
5954            printf("\n");
5955        }
5956    }
5957    }
5958    }
5959    function_tests++;
5960#endif
5961
5962    return(test_ret);
5963}
5964
5965
5966static int
5967test_xmlCatalogLocalResolveURI(void) {
5968    int test_ret = 0;
5969
5970#if defined(LIBXML_CATALOG_ENABLED)
5971    int mem_base;
5972    xmlChar * ret_val;
5973    void * catalogs; /* a document's list of catalogs */
5974    int n_catalogs;
5975    xmlChar * URI; /* the URI */
5976    int n_URI;
5977
5978    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5979    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5980        mem_base = xmlMemBlocks();
5981        catalogs = gen_void_ptr(n_catalogs, 0);
5982        URI = gen_const_xmlChar_ptr(n_URI, 1);
5983
5984        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
5985        desret_xmlChar_ptr(ret_val);
5986        call_tests++;
5987        des_void_ptr(n_catalogs, catalogs, 0);
5988        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5989        xmlResetLastError();
5990        if (mem_base != xmlMemBlocks()) {
5991            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
5992	           xmlMemBlocks() - mem_base);
5993	    test_ret++;
5994            printf(" %d", n_catalogs);
5995            printf(" %d", n_URI);
5996            printf("\n");
5997        }
5998    }
5999    }
6000    function_tests++;
6001#endif
6002
6003    return(test_ret);
6004}
6005
6006
6007static int
6008test_xmlCatalogRemove(void) {
6009    int test_ret = 0;
6010
6011#if defined(LIBXML_CATALOG_ENABLED)
6012    int ret_val;
6013    xmlChar * value; /* the value to remove */
6014    int n_value;
6015
6016    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6017        value = gen_const_xmlChar_ptr(n_value, 0);
6018
6019        ret_val = xmlCatalogRemove((const xmlChar *)value);
6020        desret_int(ret_val);
6021        call_tests++;
6022        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6023        xmlResetLastError();
6024    }
6025    function_tests++;
6026#endif
6027
6028    return(test_ret);
6029}
6030
6031
6032static int
6033test_xmlCatalogResolve(void) {
6034    int test_ret = 0;
6035
6036#if defined(LIBXML_CATALOG_ENABLED)
6037    int mem_base;
6038    xmlChar * ret_val;
6039    xmlChar * pubID; /* the public ID string */
6040    int n_pubID;
6041    xmlChar * sysID; /* the system ID string */
6042    int n_sysID;
6043
6044    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6045    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6046        mem_base = xmlMemBlocks();
6047        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6048        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6049
6050        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6051        desret_xmlChar_ptr(ret_val);
6052        call_tests++;
6053        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6054        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6055        xmlResetLastError();
6056        if (mem_base != xmlMemBlocks()) {
6057            printf("Leak of %d blocks found in xmlCatalogResolve",
6058	           xmlMemBlocks() - mem_base);
6059	    test_ret++;
6060            printf(" %d", n_pubID);
6061            printf(" %d", n_sysID);
6062            printf("\n");
6063        }
6064    }
6065    }
6066    function_tests++;
6067#endif
6068
6069    return(test_ret);
6070}
6071
6072
6073static int
6074test_xmlCatalogResolvePublic(void) {
6075    int test_ret = 0;
6076
6077#if defined(LIBXML_CATALOG_ENABLED)
6078    int mem_base;
6079    xmlChar * ret_val;
6080    xmlChar * pubID; /* the public ID string */
6081    int n_pubID;
6082
6083    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6084        mem_base = xmlMemBlocks();
6085        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6086
6087        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6088        desret_xmlChar_ptr(ret_val);
6089        call_tests++;
6090        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6091        xmlResetLastError();
6092        if (mem_base != xmlMemBlocks()) {
6093            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6094	           xmlMemBlocks() - mem_base);
6095	    test_ret++;
6096            printf(" %d", n_pubID);
6097            printf("\n");
6098        }
6099    }
6100    function_tests++;
6101#endif
6102
6103    return(test_ret);
6104}
6105
6106
6107static int
6108test_xmlCatalogResolveSystem(void) {
6109    int test_ret = 0;
6110
6111#if defined(LIBXML_CATALOG_ENABLED)
6112    int mem_base;
6113    xmlChar * ret_val;
6114    xmlChar * sysID; /* the system ID string */
6115    int n_sysID;
6116
6117    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6118        mem_base = xmlMemBlocks();
6119        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6120
6121        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6122        desret_xmlChar_ptr(ret_val);
6123        call_tests++;
6124        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6125        xmlResetLastError();
6126        if (mem_base != xmlMemBlocks()) {
6127            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6128	           xmlMemBlocks() - mem_base);
6129	    test_ret++;
6130            printf(" %d", n_sysID);
6131            printf("\n");
6132        }
6133    }
6134    function_tests++;
6135#endif
6136
6137    return(test_ret);
6138}
6139
6140
6141static int
6142test_xmlCatalogResolveURI(void) {
6143    int test_ret = 0;
6144
6145#if defined(LIBXML_CATALOG_ENABLED)
6146    int mem_base;
6147    xmlChar * ret_val;
6148    xmlChar * URI; /* the URI */
6149    int n_URI;
6150
6151    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6152        mem_base = xmlMemBlocks();
6153        URI = gen_const_xmlChar_ptr(n_URI, 0);
6154
6155        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6156        desret_xmlChar_ptr(ret_val);
6157        call_tests++;
6158        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6159        xmlResetLastError();
6160        if (mem_base != xmlMemBlocks()) {
6161            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6162	           xmlMemBlocks() - mem_base);
6163	    test_ret++;
6164            printf(" %d", n_URI);
6165            printf("\n");
6166        }
6167    }
6168    function_tests++;
6169#endif
6170
6171    return(test_ret);
6172}
6173
6174
6175static int
6176test_xmlCatalogSetDefaultPrefer(void) {
6177    int test_ret = 0;
6178
6179#if defined(LIBXML_CATALOG_ENABLED)
6180    int mem_base;
6181    xmlCatalogPrefer ret_val;
6182    xmlCatalogPrefer prefer; /* the default preference for delegation */
6183    int n_prefer;
6184
6185    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6186        mem_base = xmlMemBlocks();
6187        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6188
6189        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6190        desret_xmlCatalogPrefer(ret_val);
6191        call_tests++;
6192        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6193        xmlResetLastError();
6194        if (mem_base != xmlMemBlocks()) {
6195            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6196	           xmlMemBlocks() - mem_base);
6197	    test_ret++;
6198            printf(" %d", n_prefer);
6199            printf("\n");
6200        }
6201    }
6202    function_tests++;
6203#endif
6204
6205    return(test_ret);
6206}
6207
6208
6209static int
6210test_xmlCatalogSetDefaults(void) {
6211    int test_ret = 0;
6212
6213#if defined(LIBXML_CATALOG_ENABLED)
6214    int mem_base;
6215    xmlCatalogAllow allow; /* what catalogs should be accepted */
6216    int n_allow;
6217
6218    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6219        mem_base = xmlMemBlocks();
6220        allow = gen_xmlCatalogAllow(n_allow, 0);
6221
6222        xmlCatalogSetDefaults(allow);
6223        call_tests++;
6224        des_xmlCatalogAllow(n_allow, allow, 0);
6225        xmlResetLastError();
6226        if (mem_base != xmlMemBlocks()) {
6227            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6228	           xmlMemBlocks() - mem_base);
6229	    test_ret++;
6230            printf(" %d", n_allow);
6231            printf("\n");
6232        }
6233    }
6234    function_tests++;
6235#endif
6236
6237    return(test_ret);
6238}
6239
6240
6241static int
6242test_xmlConvertSGMLCatalog(void) {
6243    int test_ret = 0;
6244
6245#if defined(LIBXML_CATALOG_ENABLED)
6246    int mem_base;
6247    int ret_val;
6248    xmlCatalogPtr catal; /* the catalog */
6249    int n_catal;
6250
6251    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6252        mem_base = xmlMemBlocks();
6253        catal = gen_xmlCatalogPtr(n_catal, 0);
6254
6255        ret_val = xmlConvertSGMLCatalog(catal);
6256        desret_int(ret_val);
6257        call_tests++;
6258        des_xmlCatalogPtr(n_catal, catal, 0);
6259        xmlResetLastError();
6260        if (mem_base != xmlMemBlocks()) {
6261            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6262	           xmlMemBlocks() - mem_base);
6263	    test_ret++;
6264            printf(" %d", n_catal);
6265            printf("\n");
6266        }
6267    }
6268    function_tests++;
6269#endif
6270
6271    return(test_ret);
6272}
6273
6274
6275static int
6276test_xmlInitializeCatalog(void) {
6277    int test_ret = 0;
6278
6279#if defined(LIBXML_CATALOG_ENABLED)
6280    int mem_base;
6281
6282        mem_base = xmlMemBlocks();
6283
6284        xmlInitializeCatalog();
6285        call_tests++;
6286        xmlResetLastError();
6287        if (mem_base != xmlMemBlocks()) {
6288            printf("Leak of %d blocks found in xmlInitializeCatalog",
6289	           xmlMemBlocks() - mem_base);
6290	    test_ret++;
6291            printf("\n");
6292        }
6293    function_tests++;
6294#endif
6295
6296    return(test_ret);
6297}
6298
6299
6300static int
6301test_xmlLoadACatalog(void) {
6302    int test_ret = 0;
6303
6304
6305    /* missing type support */
6306    return(test_ret);
6307}
6308
6309
6310static int
6311test_xmlLoadCatalog(void) {
6312    int test_ret = 0;
6313
6314#if defined(LIBXML_CATALOG_ENABLED)
6315    int ret_val;
6316    const char * filename; /* a file path */
6317    int n_filename;
6318
6319    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6320        filename = gen_filepath(n_filename, 0);
6321
6322        ret_val = xmlLoadCatalog(filename);
6323        desret_int(ret_val);
6324        call_tests++;
6325        des_filepath(n_filename, filename, 0);
6326        xmlResetLastError();
6327    }
6328    function_tests++;
6329#endif
6330
6331    return(test_ret);
6332}
6333
6334
6335static int
6336test_xmlLoadCatalogs(void) {
6337    int test_ret = 0;
6338
6339#if defined(LIBXML_CATALOG_ENABLED)
6340    char * pathss; /* a list of directories separated by a colon or a space. */
6341    int n_pathss;
6342
6343    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6344        pathss = gen_const_char_ptr(n_pathss, 0);
6345
6346        xmlLoadCatalogs((const char *)pathss);
6347        call_tests++;
6348        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6349        xmlResetLastError();
6350    }
6351    function_tests++;
6352#endif
6353
6354    return(test_ret);
6355}
6356
6357
6358static int
6359test_xmlLoadSGMLSuperCatalog(void) {
6360    int test_ret = 0;
6361
6362
6363    /* missing type support */
6364    return(test_ret);
6365}
6366
6367
6368static int
6369test_xmlNewCatalog(void) {
6370    int test_ret = 0;
6371
6372
6373    /* missing type support */
6374    return(test_ret);
6375}
6376
6377
6378static int
6379test_xmlParseCatalogFile(void) {
6380    int test_ret = 0;
6381
6382#if defined(LIBXML_CATALOG_ENABLED)
6383    int mem_base;
6384    xmlDocPtr ret_val;
6385    const char * filename; /* the filename */
6386    int n_filename;
6387
6388    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6389        mem_base = xmlMemBlocks();
6390        filename = gen_filepath(n_filename, 0);
6391
6392        ret_val = xmlParseCatalogFile(filename);
6393        desret_xmlDocPtr(ret_val);
6394        call_tests++;
6395        des_filepath(n_filename, filename, 0);
6396        xmlResetLastError();
6397        if (mem_base != xmlMemBlocks()) {
6398            printf("Leak of %d blocks found in xmlParseCatalogFile",
6399	           xmlMemBlocks() - mem_base);
6400	    test_ret++;
6401            printf(" %d", n_filename);
6402            printf("\n");
6403        }
6404    }
6405    function_tests++;
6406#endif
6407
6408    return(test_ret);
6409}
6410
6411static int
6412test_catalog(void) {
6413    int test_ret = 0;
6414
6415    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6416    test_ret += test_xmlACatalogAdd();
6417    test_ret += test_xmlACatalogDump();
6418    test_ret += test_xmlACatalogRemove();
6419    test_ret += test_xmlACatalogResolve();
6420    test_ret += test_xmlACatalogResolvePublic();
6421    test_ret += test_xmlACatalogResolveSystem();
6422    test_ret += test_xmlACatalogResolveURI();
6423    test_ret += test_xmlCatalogAdd();
6424    test_ret += test_xmlCatalogCleanup();
6425    test_ret += test_xmlCatalogConvert();
6426    test_ret += test_xmlCatalogDump();
6427    test_ret += test_xmlCatalogGetDefaults();
6428    test_ret += test_xmlCatalogIsEmpty();
6429    test_ret += test_xmlCatalogLocalResolve();
6430    test_ret += test_xmlCatalogLocalResolveURI();
6431    test_ret += test_xmlCatalogRemove();
6432    test_ret += test_xmlCatalogResolve();
6433    test_ret += test_xmlCatalogResolvePublic();
6434    test_ret += test_xmlCatalogResolveSystem();
6435    test_ret += test_xmlCatalogResolveURI();
6436    test_ret += test_xmlCatalogSetDefaultPrefer();
6437    test_ret += test_xmlCatalogSetDefaults();
6438    test_ret += test_xmlConvertSGMLCatalog();
6439    test_ret += test_xmlInitializeCatalog();
6440    test_ret += test_xmlLoadACatalog();
6441    test_ret += test_xmlLoadCatalog();
6442    test_ret += test_xmlLoadCatalogs();
6443    test_ret += test_xmlLoadSGMLSuperCatalog();
6444    test_ret += test_xmlNewCatalog();
6445    test_ret += test_xmlParseCatalogFile();
6446
6447    if (test_ret != 0)
6448	printf("Module catalog: %d errors\n", test_ret);
6449    return(test_ret);
6450}
6451
6452#define gen_nb_const_xmlChRangeGroupPtr 1
6453static xmlChRangeGroupPtr gen_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6454    return(NULL);
6455}
6456static void des_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroupPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6457}
6458
6459static int
6460test_xmlCharInRange(void) {
6461    int test_ret = 0;
6462
6463    int mem_base;
6464    int ret_val;
6465    unsigned int val; /* character to be validated */
6466    int n_val;
6467    xmlChRangeGroupPtr rptr; /* pointer to range to be used to validate */
6468    int n_rptr;
6469
6470    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6471    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroupPtr;n_rptr++) {
6472        mem_base = xmlMemBlocks();
6473        val = gen_unsigned_int(n_val, 0);
6474        rptr = gen_const_xmlChRangeGroupPtr(n_rptr, 1);
6475
6476        ret_val = xmlCharInRange(val, (const xmlChRangeGroupPtr)rptr);
6477        desret_int(ret_val);
6478        call_tests++;
6479        des_unsigned_int(n_val, val, 0);
6480        des_const_xmlChRangeGroupPtr(n_rptr, (const xmlChRangeGroupPtr)rptr, 1);
6481        xmlResetLastError();
6482        if (mem_base != xmlMemBlocks()) {
6483            printf("Leak of %d blocks found in xmlCharInRange",
6484	           xmlMemBlocks() - mem_base);
6485	    test_ret++;
6486            printf(" %d", n_val);
6487            printf(" %d", n_rptr);
6488            printf("\n");
6489        }
6490    }
6491    }
6492    function_tests++;
6493
6494    return(test_ret);
6495}
6496
6497
6498static int
6499test_xmlIsBaseChar(void) {
6500    int test_ret = 0;
6501
6502    int mem_base;
6503    int ret_val;
6504    unsigned int ch; /* character to validate */
6505    int n_ch;
6506
6507    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6508        mem_base = xmlMemBlocks();
6509        ch = gen_unsigned_int(n_ch, 0);
6510
6511        ret_val = xmlIsBaseChar(ch);
6512        desret_int(ret_val);
6513        call_tests++;
6514        des_unsigned_int(n_ch, ch, 0);
6515        xmlResetLastError();
6516        if (mem_base != xmlMemBlocks()) {
6517            printf("Leak of %d blocks found in xmlIsBaseChar",
6518	           xmlMemBlocks() - mem_base);
6519	    test_ret++;
6520            printf(" %d", n_ch);
6521            printf("\n");
6522        }
6523    }
6524    function_tests++;
6525
6526    return(test_ret);
6527}
6528
6529
6530static int
6531test_xmlIsBlank(void) {
6532    int test_ret = 0;
6533
6534    int mem_base;
6535    int ret_val;
6536    unsigned int ch; /* character to validate */
6537    int n_ch;
6538
6539    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6540        mem_base = xmlMemBlocks();
6541        ch = gen_unsigned_int(n_ch, 0);
6542
6543        ret_val = xmlIsBlank(ch);
6544        desret_int(ret_val);
6545        call_tests++;
6546        des_unsigned_int(n_ch, ch, 0);
6547        xmlResetLastError();
6548        if (mem_base != xmlMemBlocks()) {
6549            printf("Leak of %d blocks found in xmlIsBlank",
6550	           xmlMemBlocks() - mem_base);
6551	    test_ret++;
6552            printf(" %d", n_ch);
6553            printf("\n");
6554        }
6555    }
6556    function_tests++;
6557
6558    return(test_ret);
6559}
6560
6561
6562static int
6563test_xmlIsChar(void) {
6564    int test_ret = 0;
6565
6566    int mem_base;
6567    int ret_val;
6568    unsigned int ch; /* character to validate */
6569    int n_ch;
6570
6571    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6572        mem_base = xmlMemBlocks();
6573        ch = gen_unsigned_int(n_ch, 0);
6574
6575        ret_val = xmlIsChar(ch);
6576        desret_int(ret_val);
6577        call_tests++;
6578        des_unsigned_int(n_ch, ch, 0);
6579        xmlResetLastError();
6580        if (mem_base != xmlMemBlocks()) {
6581            printf("Leak of %d blocks found in xmlIsChar",
6582	           xmlMemBlocks() - mem_base);
6583	    test_ret++;
6584            printf(" %d", n_ch);
6585            printf("\n");
6586        }
6587    }
6588    function_tests++;
6589
6590    return(test_ret);
6591}
6592
6593
6594static int
6595test_xmlIsCombining(void) {
6596    int test_ret = 0;
6597
6598    int mem_base;
6599    int ret_val;
6600    unsigned int ch; /* character to validate */
6601    int n_ch;
6602
6603    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6604        mem_base = xmlMemBlocks();
6605        ch = gen_unsigned_int(n_ch, 0);
6606
6607        ret_val = xmlIsCombining(ch);
6608        desret_int(ret_val);
6609        call_tests++;
6610        des_unsigned_int(n_ch, ch, 0);
6611        xmlResetLastError();
6612        if (mem_base != xmlMemBlocks()) {
6613            printf("Leak of %d blocks found in xmlIsCombining",
6614	           xmlMemBlocks() - mem_base);
6615	    test_ret++;
6616            printf(" %d", n_ch);
6617            printf("\n");
6618        }
6619    }
6620    function_tests++;
6621
6622    return(test_ret);
6623}
6624
6625
6626static int
6627test_xmlIsDigit(void) {
6628    int test_ret = 0;
6629
6630    int mem_base;
6631    int ret_val;
6632    unsigned int ch; /* character to validate */
6633    int n_ch;
6634
6635    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6636        mem_base = xmlMemBlocks();
6637        ch = gen_unsigned_int(n_ch, 0);
6638
6639        ret_val = xmlIsDigit(ch);
6640        desret_int(ret_val);
6641        call_tests++;
6642        des_unsigned_int(n_ch, ch, 0);
6643        xmlResetLastError();
6644        if (mem_base != xmlMemBlocks()) {
6645            printf("Leak of %d blocks found in xmlIsDigit",
6646	           xmlMemBlocks() - mem_base);
6647	    test_ret++;
6648            printf(" %d", n_ch);
6649            printf("\n");
6650        }
6651    }
6652    function_tests++;
6653
6654    return(test_ret);
6655}
6656
6657
6658static int
6659test_xmlIsExtender(void) {
6660    int test_ret = 0;
6661
6662    int mem_base;
6663    int ret_val;
6664    unsigned int ch; /* character to validate */
6665    int n_ch;
6666
6667    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6668        mem_base = xmlMemBlocks();
6669        ch = gen_unsigned_int(n_ch, 0);
6670
6671        ret_val = xmlIsExtender(ch);
6672        desret_int(ret_val);
6673        call_tests++;
6674        des_unsigned_int(n_ch, ch, 0);
6675        xmlResetLastError();
6676        if (mem_base != xmlMemBlocks()) {
6677            printf("Leak of %d blocks found in xmlIsExtender",
6678	           xmlMemBlocks() - mem_base);
6679	    test_ret++;
6680            printf(" %d", n_ch);
6681            printf("\n");
6682        }
6683    }
6684    function_tests++;
6685
6686    return(test_ret);
6687}
6688
6689
6690static int
6691test_xmlIsIdeographic(void) {
6692    int test_ret = 0;
6693
6694    int mem_base;
6695    int ret_val;
6696    unsigned int ch; /* character to validate */
6697    int n_ch;
6698
6699    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6700        mem_base = xmlMemBlocks();
6701        ch = gen_unsigned_int(n_ch, 0);
6702
6703        ret_val = xmlIsIdeographic(ch);
6704        desret_int(ret_val);
6705        call_tests++;
6706        des_unsigned_int(n_ch, ch, 0);
6707        xmlResetLastError();
6708        if (mem_base != xmlMemBlocks()) {
6709            printf("Leak of %d blocks found in xmlIsIdeographic",
6710	           xmlMemBlocks() - mem_base);
6711	    test_ret++;
6712            printf(" %d", n_ch);
6713            printf("\n");
6714        }
6715    }
6716    function_tests++;
6717
6718    return(test_ret);
6719}
6720
6721
6722static int
6723test_xmlIsPubidChar(void) {
6724    int test_ret = 0;
6725
6726    int mem_base;
6727    int ret_val;
6728    unsigned int ch; /* character to validate */
6729    int n_ch;
6730
6731    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6732        mem_base = xmlMemBlocks();
6733        ch = gen_unsigned_int(n_ch, 0);
6734
6735        ret_val = xmlIsPubidChar(ch);
6736        desret_int(ret_val);
6737        call_tests++;
6738        des_unsigned_int(n_ch, ch, 0);
6739        xmlResetLastError();
6740        if (mem_base != xmlMemBlocks()) {
6741            printf("Leak of %d blocks found in xmlIsPubidChar",
6742	           xmlMemBlocks() - mem_base);
6743	    test_ret++;
6744            printf(" %d", n_ch);
6745            printf("\n");
6746        }
6747    }
6748    function_tests++;
6749
6750    return(test_ret);
6751}
6752
6753static int
6754test_chvalid(void) {
6755    int test_ret = 0;
6756
6757    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6758    test_ret += test_xmlCharInRange();
6759    test_ret += test_xmlIsBaseChar();
6760    test_ret += test_xmlIsBlank();
6761    test_ret += test_xmlIsChar();
6762    test_ret += test_xmlIsCombining();
6763    test_ret += test_xmlIsDigit();
6764    test_ret += test_xmlIsExtender();
6765    test_ret += test_xmlIsIdeographic();
6766    test_ret += test_xmlIsPubidChar();
6767
6768    if (test_ret != 0)
6769	printf("Module chvalid: %d errors\n", test_ret);
6770    return(test_ret);
6771}
6772
6773static int
6774test_xmlBoolToText(void) {
6775    int test_ret = 0;
6776
6777#if defined(LIBXML_DEBUG_ENABLED)
6778    int mem_base;
6779    const char * ret_val;
6780    int boolval; /* a bool to turn into text */
6781    int n_boolval;
6782
6783    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6784        mem_base = xmlMemBlocks();
6785        boolval = gen_int(n_boolval, 0);
6786
6787        ret_val = xmlBoolToText(boolval);
6788        desret_const_char_ptr(ret_val);
6789        call_tests++;
6790        des_int(n_boolval, boolval, 0);
6791        xmlResetLastError();
6792        if (mem_base != xmlMemBlocks()) {
6793            printf("Leak of %d blocks found in xmlBoolToText",
6794	           xmlMemBlocks() - mem_base);
6795	    test_ret++;
6796            printf(" %d", n_boolval);
6797            printf("\n");
6798        }
6799    }
6800    function_tests++;
6801#endif
6802
6803    return(test_ret);
6804}
6805
6806
6807static int
6808test_xmlDebugCheckDocument(void) {
6809    int test_ret = 0;
6810
6811#if defined(LIBXML_DEBUG_ENABLED)
6812    int mem_base;
6813    int ret_val;
6814    FILE * output; /* the FILE * for the output */
6815    int n_output;
6816    xmlDocPtr doc; /* the document */
6817    int n_doc;
6818
6819    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6820    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6821        mem_base = xmlMemBlocks();
6822        output = gen_debug_FILE_ptr(n_output, 0);
6823        doc = gen_xmlDocPtr(n_doc, 1);
6824
6825        ret_val = xmlDebugCheckDocument(output, doc);
6826        desret_int(ret_val);
6827        call_tests++;
6828        des_debug_FILE_ptr(n_output, output, 0);
6829        des_xmlDocPtr(n_doc, doc, 1);
6830        xmlResetLastError();
6831        if (mem_base != xmlMemBlocks()) {
6832            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6833	           xmlMemBlocks() - mem_base);
6834	    test_ret++;
6835            printf(" %d", n_output);
6836            printf(" %d", n_doc);
6837            printf("\n");
6838        }
6839    }
6840    }
6841    function_tests++;
6842#endif
6843
6844    return(test_ret);
6845}
6846
6847
6848static int
6849test_xmlDebugDumpAttr(void) {
6850    int test_ret = 0;
6851
6852#if defined(LIBXML_DEBUG_ENABLED)
6853    int mem_base;
6854    FILE * output; /* the FILE * for the output */
6855    int n_output;
6856    xmlAttrPtr attr; /* the attribute */
6857    int n_attr;
6858    int depth; /* the indentation level. */
6859    int n_depth;
6860
6861    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6862    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6863    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6864        mem_base = xmlMemBlocks();
6865        output = gen_debug_FILE_ptr(n_output, 0);
6866        attr = gen_xmlAttrPtr(n_attr, 1);
6867        depth = gen_int(n_depth, 2);
6868
6869        xmlDebugDumpAttr(output, attr, depth);
6870        call_tests++;
6871        des_debug_FILE_ptr(n_output, output, 0);
6872        des_xmlAttrPtr(n_attr, attr, 1);
6873        des_int(n_depth, depth, 2);
6874        xmlResetLastError();
6875        if (mem_base != xmlMemBlocks()) {
6876            printf("Leak of %d blocks found in xmlDebugDumpAttr",
6877	           xmlMemBlocks() - mem_base);
6878	    test_ret++;
6879            printf(" %d", n_output);
6880            printf(" %d", n_attr);
6881            printf(" %d", n_depth);
6882            printf("\n");
6883        }
6884    }
6885    }
6886    }
6887    function_tests++;
6888#endif
6889
6890    return(test_ret);
6891}
6892
6893
6894static int
6895test_xmlDebugDumpAttrList(void) {
6896    int test_ret = 0;
6897
6898#if defined(LIBXML_DEBUG_ENABLED)
6899    int mem_base;
6900    FILE * output; /* the FILE * for the output */
6901    int n_output;
6902    xmlAttrPtr attr; /* the attribute list */
6903    int n_attr;
6904    int depth; /* the indentation level. */
6905    int n_depth;
6906
6907    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6908    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6909    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6910        mem_base = xmlMemBlocks();
6911        output = gen_debug_FILE_ptr(n_output, 0);
6912        attr = gen_xmlAttrPtr(n_attr, 1);
6913        depth = gen_int(n_depth, 2);
6914
6915        xmlDebugDumpAttrList(output, attr, depth);
6916        call_tests++;
6917        des_debug_FILE_ptr(n_output, output, 0);
6918        des_xmlAttrPtr(n_attr, attr, 1);
6919        des_int(n_depth, depth, 2);
6920        xmlResetLastError();
6921        if (mem_base != xmlMemBlocks()) {
6922            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
6923	           xmlMemBlocks() - mem_base);
6924	    test_ret++;
6925            printf(" %d", n_output);
6926            printf(" %d", n_attr);
6927            printf(" %d", n_depth);
6928            printf("\n");
6929        }
6930    }
6931    }
6932    }
6933    function_tests++;
6934#endif
6935
6936    return(test_ret);
6937}
6938
6939
6940static int
6941test_xmlDebugDumpDTD(void) {
6942    int test_ret = 0;
6943
6944#if defined(LIBXML_DEBUG_ENABLED)
6945    int mem_base;
6946    FILE * output; /* the FILE * for the output */
6947    int n_output;
6948    xmlDtdPtr dtd; /* the DTD */
6949    int n_dtd;
6950
6951    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6952    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
6953        mem_base = xmlMemBlocks();
6954        output = gen_debug_FILE_ptr(n_output, 0);
6955        dtd = gen_xmlDtdPtr(n_dtd, 1);
6956
6957        xmlDebugDumpDTD(output, dtd);
6958        call_tests++;
6959        des_debug_FILE_ptr(n_output, output, 0);
6960        des_xmlDtdPtr(n_dtd, dtd, 1);
6961        xmlResetLastError();
6962        if (mem_base != xmlMemBlocks()) {
6963            printf("Leak of %d blocks found in xmlDebugDumpDTD",
6964	           xmlMemBlocks() - mem_base);
6965	    test_ret++;
6966            printf(" %d", n_output);
6967            printf(" %d", n_dtd);
6968            printf("\n");
6969        }
6970    }
6971    }
6972    function_tests++;
6973#endif
6974
6975    return(test_ret);
6976}
6977
6978
6979static int
6980test_xmlDebugDumpDocument(void) {
6981    int test_ret = 0;
6982
6983#if defined(LIBXML_DEBUG_ENABLED)
6984    int mem_base;
6985    FILE * output; /* the FILE * for the output */
6986    int n_output;
6987    xmlDocPtr doc; /* the document */
6988    int n_doc;
6989
6990    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6991    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6992        mem_base = xmlMemBlocks();
6993        output = gen_debug_FILE_ptr(n_output, 0);
6994        doc = gen_xmlDocPtr(n_doc, 1);
6995
6996        xmlDebugDumpDocument(output, doc);
6997        call_tests++;
6998        des_debug_FILE_ptr(n_output, output, 0);
6999        des_xmlDocPtr(n_doc, doc, 1);
7000        xmlResetLastError();
7001        if (mem_base != xmlMemBlocks()) {
7002            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7003	           xmlMemBlocks() - mem_base);
7004	    test_ret++;
7005            printf(" %d", n_output);
7006            printf(" %d", n_doc);
7007            printf("\n");
7008        }
7009    }
7010    }
7011    function_tests++;
7012#endif
7013
7014    return(test_ret);
7015}
7016
7017
7018static int
7019test_xmlDebugDumpDocumentHead(void) {
7020    int test_ret = 0;
7021
7022#if defined(LIBXML_DEBUG_ENABLED)
7023    int mem_base;
7024    FILE * output; /* the FILE * for the output */
7025    int n_output;
7026    xmlDocPtr doc; /* the document */
7027    int n_doc;
7028
7029    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7030    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7031        mem_base = xmlMemBlocks();
7032        output = gen_debug_FILE_ptr(n_output, 0);
7033        doc = gen_xmlDocPtr(n_doc, 1);
7034
7035        xmlDebugDumpDocumentHead(output, doc);
7036        call_tests++;
7037        des_debug_FILE_ptr(n_output, output, 0);
7038        des_xmlDocPtr(n_doc, doc, 1);
7039        xmlResetLastError();
7040        if (mem_base != xmlMemBlocks()) {
7041            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7042	           xmlMemBlocks() - mem_base);
7043	    test_ret++;
7044            printf(" %d", n_output);
7045            printf(" %d", n_doc);
7046            printf("\n");
7047        }
7048    }
7049    }
7050    function_tests++;
7051#endif
7052
7053    return(test_ret);
7054}
7055
7056
7057static int
7058test_xmlDebugDumpEntities(void) {
7059    int test_ret = 0;
7060
7061#if defined(LIBXML_DEBUG_ENABLED)
7062    int mem_base;
7063    FILE * output; /* the FILE * for the output */
7064    int n_output;
7065    xmlDocPtr doc; /* the document */
7066    int n_doc;
7067
7068    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7069    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7070        mem_base = xmlMemBlocks();
7071        output = gen_debug_FILE_ptr(n_output, 0);
7072        doc = gen_xmlDocPtr(n_doc, 1);
7073
7074        xmlDebugDumpEntities(output, doc);
7075        call_tests++;
7076        des_debug_FILE_ptr(n_output, output, 0);
7077        des_xmlDocPtr(n_doc, doc, 1);
7078        xmlResetLastError();
7079        if (mem_base != xmlMemBlocks()) {
7080            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7081	           xmlMemBlocks() - mem_base);
7082	    test_ret++;
7083            printf(" %d", n_output);
7084            printf(" %d", n_doc);
7085            printf("\n");
7086        }
7087    }
7088    }
7089    function_tests++;
7090#endif
7091
7092    return(test_ret);
7093}
7094
7095
7096static int
7097test_xmlDebugDumpNode(void) {
7098    int test_ret = 0;
7099
7100#if defined(LIBXML_DEBUG_ENABLED)
7101    int mem_base;
7102    FILE * output; /* the FILE * for the output */
7103    int n_output;
7104    xmlNodePtr node; /* the node */
7105    int n_node;
7106    int depth; /* the indentation level. */
7107    int n_depth;
7108
7109    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7110    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7111    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7112        mem_base = xmlMemBlocks();
7113        output = gen_debug_FILE_ptr(n_output, 0);
7114        node = gen_xmlNodePtr(n_node, 1);
7115        depth = gen_int(n_depth, 2);
7116
7117        xmlDebugDumpNode(output, node, depth);
7118        call_tests++;
7119        des_debug_FILE_ptr(n_output, output, 0);
7120        des_xmlNodePtr(n_node, node, 1);
7121        des_int(n_depth, depth, 2);
7122        xmlResetLastError();
7123        if (mem_base != xmlMemBlocks()) {
7124            printf("Leak of %d blocks found in xmlDebugDumpNode",
7125	           xmlMemBlocks() - mem_base);
7126	    test_ret++;
7127            printf(" %d", n_output);
7128            printf(" %d", n_node);
7129            printf(" %d", n_depth);
7130            printf("\n");
7131        }
7132    }
7133    }
7134    }
7135    function_tests++;
7136#endif
7137
7138    return(test_ret);
7139}
7140
7141
7142static int
7143test_xmlDebugDumpNodeList(void) {
7144    int test_ret = 0;
7145
7146#if defined(LIBXML_DEBUG_ENABLED)
7147    int mem_base;
7148    FILE * output; /* the FILE * for the output */
7149    int n_output;
7150    xmlNodePtr node; /* the node list */
7151    int n_node;
7152    int depth; /* the indentation level. */
7153    int n_depth;
7154
7155    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7156    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7157    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7158        mem_base = xmlMemBlocks();
7159        output = gen_debug_FILE_ptr(n_output, 0);
7160        node = gen_xmlNodePtr(n_node, 1);
7161        depth = gen_int(n_depth, 2);
7162
7163        xmlDebugDumpNodeList(output, node, depth);
7164        call_tests++;
7165        des_debug_FILE_ptr(n_output, output, 0);
7166        des_xmlNodePtr(n_node, node, 1);
7167        des_int(n_depth, depth, 2);
7168        xmlResetLastError();
7169        if (mem_base != xmlMemBlocks()) {
7170            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7171	           xmlMemBlocks() - mem_base);
7172	    test_ret++;
7173            printf(" %d", n_output);
7174            printf(" %d", n_node);
7175            printf(" %d", n_depth);
7176            printf("\n");
7177        }
7178    }
7179    }
7180    }
7181    function_tests++;
7182#endif
7183
7184    return(test_ret);
7185}
7186
7187
7188static int
7189test_xmlDebugDumpOneNode(void) {
7190    int test_ret = 0;
7191
7192#if defined(LIBXML_DEBUG_ENABLED)
7193    int mem_base;
7194    FILE * output; /* the FILE * for the output */
7195    int n_output;
7196    xmlNodePtr node; /* the node */
7197    int n_node;
7198    int depth; /* the indentation level. */
7199    int n_depth;
7200
7201    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7202    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7203    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7204        mem_base = xmlMemBlocks();
7205        output = gen_debug_FILE_ptr(n_output, 0);
7206        node = gen_xmlNodePtr(n_node, 1);
7207        depth = gen_int(n_depth, 2);
7208
7209        xmlDebugDumpOneNode(output, node, depth);
7210        call_tests++;
7211        des_debug_FILE_ptr(n_output, output, 0);
7212        des_xmlNodePtr(n_node, node, 1);
7213        des_int(n_depth, depth, 2);
7214        xmlResetLastError();
7215        if (mem_base != xmlMemBlocks()) {
7216            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7217	           xmlMemBlocks() - mem_base);
7218	    test_ret++;
7219            printf(" %d", n_output);
7220            printf(" %d", n_node);
7221            printf(" %d", n_depth);
7222            printf("\n");
7223        }
7224    }
7225    }
7226    }
7227    function_tests++;
7228#endif
7229
7230    return(test_ret);
7231}
7232
7233
7234static int
7235test_xmlDebugDumpString(void) {
7236    int test_ret = 0;
7237
7238#if defined(LIBXML_DEBUG_ENABLED)
7239    int mem_base;
7240    FILE * output; /* the FILE * for the output */
7241    int n_output;
7242    xmlChar * str; /* the string */
7243    int n_str;
7244
7245    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7246    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7247        mem_base = xmlMemBlocks();
7248        output = gen_debug_FILE_ptr(n_output, 0);
7249        str = gen_const_xmlChar_ptr(n_str, 1);
7250
7251        xmlDebugDumpString(output, (const xmlChar *)str);
7252        call_tests++;
7253        des_debug_FILE_ptr(n_output, output, 0);
7254        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7255        xmlResetLastError();
7256        if (mem_base != xmlMemBlocks()) {
7257            printf("Leak of %d blocks found in xmlDebugDumpString",
7258	           xmlMemBlocks() - mem_base);
7259	    test_ret++;
7260            printf(" %d", n_output);
7261            printf(" %d", n_str);
7262            printf("\n");
7263        }
7264    }
7265    }
7266    function_tests++;
7267#endif
7268
7269    return(test_ret);
7270}
7271
7272
7273static int
7274test_xmlLsCountNode(void) {
7275    int test_ret = 0;
7276
7277#if defined(LIBXML_DEBUG_ENABLED)
7278    int mem_base;
7279    int ret_val;
7280    xmlNodePtr node; /* the node to count */
7281    int n_node;
7282
7283    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7284        mem_base = xmlMemBlocks();
7285        node = gen_xmlNodePtr(n_node, 0);
7286
7287        ret_val = xmlLsCountNode(node);
7288        desret_int(ret_val);
7289        call_tests++;
7290        des_xmlNodePtr(n_node, node, 0);
7291        xmlResetLastError();
7292        if (mem_base != xmlMemBlocks()) {
7293            printf("Leak of %d blocks found in xmlLsCountNode",
7294	           xmlMemBlocks() - mem_base);
7295	    test_ret++;
7296            printf(" %d", n_node);
7297            printf("\n");
7298        }
7299    }
7300    function_tests++;
7301#endif
7302
7303    return(test_ret);
7304}
7305
7306
7307static int
7308test_xmlLsOneNode(void) {
7309    int test_ret = 0;
7310
7311#if defined(LIBXML_DEBUG_ENABLED)
7312    int mem_base;
7313    FILE * output; /* the FILE * for the output */
7314    int n_output;
7315    xmlNodePtr node; /* the node to dump */
7316    int n_node;
7317
7318    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7319    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7320        mem_base = xmlMemBlocks();
7321        output = gen_debug_FILE_ptr(n_output, 0);
7322        node = gen_xmlNodePtr(n_node, 1);
7323
7324        xmlLsOneNode(output, node);
7325        call_tests++;
7326        des_debug_FILE_ptr(n_output, output, 0);
7327        des_xmlNodePtr(n_node, node, 1);
7328        xmlResetLastError();
7329        if (mem_base != xmlMemBlocks()) {
7330            printf("Leak of %d blocks found in xmlLsOneNode",
7331	           xmlMemBlocks() - mem_base);
7332	    test_ret++;
7333            printf(" %d", n_output);
7334            printf(" %d", n_node);
7335            printf("\n");
7336        }
7337    }
7338    }
7339    function_tests++;
7340#endif
7341
7342    return(test_ret);
7343}
7344
7345
7346#define gen_nb_char_ptr 1
7347static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7348    return(NULL);
7349}
7350static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7351}
7352
7353static int
7354test_xmlShell(void) {
7355    int test_ret = 0;
7356
7357
7358    /* missing type support */
7359    return(test_ret);
7360}
7361
7362
7363static int
7364test_xmlShellBase(void) {
7365    int test_ret = 0;
7366
7367#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7368    int mem_base;
7369    int ret_val;
7370    xmlShellCtxtPtr ctxt; /* the shell context */
7371    int n_ctxt;
7372    char * arg; /* unused */
7373    int n_arg;
7374    xmlNodePtr node; /* a node */
7375    int n_node;
7376    xmlNodePtr node2; /* unused */
7377    int n_node2;
7378
7379    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7380    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7381    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7382    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7383        mem_base = xmlMemBlocks();
7384        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7385        arg = gen_char_ptr(n_arg, 1);
7386        node = gen_xmlNodePtr(n_node, 2);
7387        node2 = gen_xmlNodePtr(n_node2, 3);
7388
7389        ret_val = xmlShellBase(ctxt, arg, node, node2);
7390        desret_int(ret_val);
7391        call_tests++;
7392        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7393        des_char_ptr(n_arg, arg, 1);
7394        des_xmlNodePtr(n_node, node, 2);
7395        des_xmlNodePtr(n_node2, node2, 3);
7396        xmlResetLastError();
7397        if (mem_base != xmlMemBlocks()) {
7398            printf("Leak of %d blocks found in xmlShellBase",
7399	           xmlMemBlocks() - mem_base);
7400	    test_ret++;
7401            printf(" %d", n_ctxt);
7402            printf(" %d", n_arg);
7403            printf(" %d", n_node);
7404            printf(" %d", n_node2);
7405            printf("\n");
7406        }
7407    }
7408    }
7409    }
7410    }
7411    function_tests++;
7412#endif
7413
7414    return(test_ret);
7415}
7416
7417
7418static int
7419test_xmlShellCat(void) {
7420    int test_ret = 0;
7421
7422#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7423    int mem_base;
7424    int ret_val;
7425    xmlShellCtxtPtr ctxt; /* the shell context */
7426    int n_ctxt;
7427    char * arg; /* unused */
7428    int n_arg;
7429    xmlNodePtr node; /* a node */
7430    int n_node;
7431    xmlNodePtr node2; /* unused */
7432    int n_node2;
7433
7434    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7435    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7436    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7437    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7438        mem_base = xmlMemBlocks();
7439        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7440        arg = gen_char_ptr(n_arg, 1);
7441        node = gen_xmlNodePtr(n_node, 2);
7442        node2 = gen_xmlNodePtr(n_node2, 3);
7443
7444        ret_val = xmlShellCat(ctxt, arg, node, node2);
7445        desret_int(ret_val);
7446        call_tests++;
7447        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7448        des_char_ptr(n_arg, arg, 1);
7449        des_xmlNodePtr(n_node, node, 2);
7450        des_xmlNodePtr(n_node2, node2, 3);
7451        xmlResetLastError();
7452        if (mem_base != xmlMemBlocks()) {
7453            printf("Leak of %d blocks found in xmlShellCat",
7454	           xmlMemBlocks() - mem_base);
7455	    test_ret++;
7456            printf(" %d", n_ctxt);
7457            printf(" %d", n_arg);
7458            printf(" %d", n_node);
7459            printf(" %d", n_node2);
7460            printf("\n");
7461        }
7462    }
7463    }
7464    }
7465    }
7466    function_tests++;
7467#endif
7468
7469    return(test_ret);
7470}
7471
7472
7473static int
7474test_xmlShellDir(void) {
7475    int test_ret = 0;
7476
7477#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7478    int mem_base;
7479    int ret_val;
7480    xmlShellCtxtPtr ctxt; /* the shell context */
7481    int n_ctxt;
7482    char * arg; /* unused */
7483    int n_arg;
7484    xmlNodePtr node; /* a node */
7485    int n_node;
7486    xmlNodePtr node2; /* unused */
7487    int n_node2;
7488
7489    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7490    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7491    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7492    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7493        mem_base = xmlMemBlocks();
7494        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7495        arg = gen_char_ptr(n_arg, 1);
7496        node = gen_xmlNodePtr(n_node, 2);
7497        node2 = gen_xmlNodePtr(n_node2, 3);
7498
7499        ret_val = xmlShellDir(ctxt, arg, node, node2);
7500        desret_int(ret_val);
7501        call_tests++;
7502        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7503        des_char_ptr(n_arg, arg, 1);
7504        des_xmlNodePtr(n_node, node, 2);
7505        des_xmlNodePtr(n_node2, node2, 3);
7506        xmlResetLastError();
7507        if (mem_base != xmlMemBlocks()) {
7508            printf("Leak of %d blocks found in xmlShellDir",
7509	           xmlMemBlocks() - mem_base);
7510	    test_ret++;
7511            printf(" %d", n_ctxt);
7512            printf(" %d", n_arg);
7513            printf(" %d", n_node);
7514            printf(" %d", n_node2);
7515            printf("\n");
7516        }
7517    }
7518    }
7519    }
7520    }
7521    function_tests++;
7522#endif
7523
7524    return(test_ret);
7525}
7526
7527
7528static int
7529test_xmlShellDu(void) {
7530    int test_ret = 0;
7531
7532#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7533    int mem_base;
7534    int ret_val;
7535    xmlShellCtxtPtr ctxt; /* the shell context */
7536    int n_ctxt;
7537    char * arg; /* unused */
7538    int n_arg;
7539    xmlNodePtr tree; /* a node defining a subtree */
7540    int n_tree;
7541    xmlNodePtr node2; /* unused */
7542    int n_node2;
7543
7544    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7545    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7546    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7547    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7548        mem_base = xmlMemBlocks();
7549        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7550        arg = gen_char_ptr(n_arg, 1);
7551        tree = gen_xmlNodePtr(n_tree, 2);
7552        node2 = gen_xmlNodePtr(n_node2, 3);
7553
7554        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7555        desret_int(ret_val);
7556        call_tests++;
7557        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7558        des_char_ptr(n_arg, arg, 1);
7559        des_xmlNodePtr(n_tree, tree, 2);
7560        des_xmlNodePtr(n_node2, node2, 3);
7561        xmlResetLastError();
7562        if (mem_base != xmlMemBlocks()) {
7563            printf("Leak of %d blocks found in xmlShellDu",
7564	           xmlMemBlocks() - mem_base);
7565	    test_ret++;
7566            printf(" %d", n_ctxt);
7567            printf(" %d", n_arg);
7568            printf(" %d", n_tree);
7569            printf(" %d", n_node2);
7570            printf("\n");
7571        }
7572    }
7573    }
7574    }
7575    }
7576    function_tests++;
7577#endif
7578
7579    return(test_ret);
7580}
7581
7582
7583static int
7584test_xmlShellList(void) {
7585    int test_ret = 0;
7586
7587#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7588    int mem_base;
7589    int ret_val;
7590    xmlShellCtxtPtr ctxt; /* the shell context */
7591    int n_ctxt;
7592    char * arg; /* unused */
7593    int n_arg;
7594    xmlNodePtr node; /* a node */
7595    int n_node;
7596    xmlNodePtr node2; /* unused */
7597    int n_node2;
7598
7599    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7600    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7601    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7602    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7603        mem_base = xmlMemBlocks();
7604        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7605        arg = gen_char_ptr(n_arg, 1);
7606        node = gen_xmlNodePtr(n_node, 2);
7607        node2 = gen_xmlNodePtr(n_node2, 3);
7608
7609        ret_val = xmlShellList(ctxt, arg, node, node2);
7610        desret_int(ret_val);
7611        call_tests++;
7612        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7613        des_char_ptr(n_arg, arg, 1);
7614        des_xmlNodePtr(n_node, node, 2);
7615        des_xmlNodePtr(n_node2, node2, 3);
7616        xmlResetLastError();
7617        if (mem_base != xmlMemBlocks()) {
7618            printf("Leak of %d blocks found in xmlShellList",
7619	           xmlMemBlocks() - mem_base);
7620	    test_ret++;
7621            printf(" %d", n_ctxt);
7622            printf(" %d", n_arg);
7623            printf(" %d", n_node);
7624            printf(" %d", n_node2);
7625            printf("\n");
7626        }
7627    }
7628    }
7629    }
7630    }
7631    function_tests++;
7632#endif
7633
7634    return(test_ret);
7635}
7636
7637
7638static int
7639test_xmlShellLoad(void) {
7640    int test_ret = 0;
7641
7642#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7643    int mem_base;
7644    int ret_val;
7645    xmlShellCtxtPtr ctxt; /* the shell context */
7646    int n_ctxt;
7647    char * filename; /* the file name */
7648    int n_filename;
7649    xmlNodePtr node; /* unused */
7650    int n_node;
7651    xmlNodePtr node2; /* unused */
7652    int n_node2;
7653
7654    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7655    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7656    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7657    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7658        mem_base = xmlMemBlocks();
7659        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7660        filename = gen_char_ptr(n_filename, 1);
7661        node = gen_xmlNodePtr(n_node, 2);
7662        node2 = gen_xmlNodePtr(n_node2, 3);
7663
7664        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7665        desret_int(ret_val);
7666        call_tests++;
7667        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7668        des_char_ptr(n_filename, filename, 1);
7669        des_xmlNodePtr(n_node, node, 2);
7670        des_xmlNodePtr(n_node2, node2, 3);
7671        xmlResetLastError();
7672        if (mem_base != xmlMemBlocks()) {
7673            printf("Leak of %d blocks found in xmlShellLoad",
7674	           xmlMemBlocks() - mem_base);
7675	    test_ret++;
7676            printf(" %d", n_ctxt);
7677            printf(" %d", n_filename);
7678            printf(" %d", n_node);
7679            printf(" %d", n_node2);
7680            printf("\n");
7681        }
7682    }
7683    }
7684    }
7685    }
7686    function_tests++;
7687#endif
7688
7689    return(test_ret);
7690}
7691
7692
7693static int
7694test_xmlShellPrintXPathResult(void) {
7695    int test_ret = 0;
7696
7697#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7698    int mem_base;
7699    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7700    int n_list;
7701
7702    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7703        mem_base = xmlMemBlocks();
7704        list = gen_xmlXPathObjectPtr(n_list, 0);
7705
7706        xmlShellPrintXPathResult(list);
7707        call_tests++;
7708        des_xmlXPathObjectPtr(n_list, list, 0);
7709        xmlResetLastError();
7710        if (mem_base != xmlMemBlocks()) {
7711            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7712	           xmlMemBlocks() - mem_base);
7713	    test_ret++;
7714            printf(" %d", n_list);
7715            printf("\n");
7716        }
7717    }
7718    function_tests++;
7719#endif
7720
7721    return(test_ret);
7722}
7723
7724
7725static int
7726test_xmlShellPwd(void) {
7727    int test_ret = 0;
7728
7729#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7730    int mem_base;
7731    int ret_val;
7732    xmlShellCtxtPtr ctxt; /* the shell context */
7733    int n_ctxt;
7734    char * buffer; /* the output buffer */
7735    int n_buffer;
7736    xmlNodePtr node; /* a node */
7737    int n_node;
7738    xmlNodePtr node2; /* unused */
7739    int n_node2;
7740
7741    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7742    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7743    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7744    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7745        mem_base = xmlMemBlocks();
7746        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7747        buffer = gen_char_ptr(n_buffer, 1);
7748        node = gen_xmlNodePtr(n_node, 2);
7749        node2 = gen_xmlNodePtr(n_node2, 3);
7750
7751        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7752        desret_int(ret_val);
7753        call_tests++;
7754        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7755        des_char_ptr(n_buffer, buffer, 1);
7756        des_xmlNodePtr(n_node, node, 2);
7757        des_xmlNodePtr(n_node2, node2, 3);
7758        xmlResetLastError();
7759        if (mem_base != xmlMemBlocks()) {
7760            printf("Leak of %d blocks found in xmlShellPwd",
7761	           xmlMemBlocks() - mem_base);
7762	    test_ret++;
7763            printf(" %d", n_ctxt);
7764            printf(" %d", n_buffer);
7765            printf(" %d", n_node);
7766            printf(" %d", n_node2);
7767            printf("\n");
7768        }
7769    }
7770    }
7771    }
7772    }
7773    function_tests++;
7774#endif
7775
7776    return(test_ret);
7777}
7778
7779
7780static int
7781test_xmlShellSave(void) {
7782    int test_ret = 0;
7783
7784#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7785    int mem_base;
7786    int ret_val;
7787    xmlShellCtxtPtr ctxt; /* the shell context */
7788    int n_ctxt;
7789    char * filename; /* the file name (optional) */
7790    int n_filename;
7791    xmlNodePtr node; /* unused */
7792    int n_node;
7793    xmlNodePtr node2; /* unused */
7794    int n_node2;
7795
7796    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7797    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7798    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7799    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7800        mem_base = xmlMemBlocks();
7801        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7802        filename = gen_char_ptr(n_filename, 1);
7803        node = gen_xmlNodePtr(n_node, 2);
7804        node2 = gen_xmlNodePtr(n_node2, 3);
7805
7806        ret_val = xmlShellSave(ctxt, filename, node, node2);
7807        desret_int(ret_val);
7808        call_tests++;
7809        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7810        des_char_ptr(n_filename, filename, 1);
7811        des_xmlNodePtr(n_node, node, 2);
7812        des_xmlNodePtr(n_node2, node2, 3);
7813        xmlResetLastError();
7814        if (mem_base != xmlMemBlocks()) {
7815            printf("Leak of %d blocks found in xmlShellSave",
7816	           xmlMemBlocks() - mem_base);
7817	    test_ret++;
7818            printf(" %d", n_ctxt);
7819            printf(" %d", n_filename);
7820            printf(" %d", n_node);
7821            printf(" %d", n_node2);
7822            printf("\n");
7823        }
7824    }
7825    }
7826    }
7827    }
7828    function_tests++;
7829#endif
7830
7831    return(test_ret);
7832}
7833
7834
7835static int
7836test_xmlShellValidate(void) {
7837    int test_ret = 0;
7838
7839#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7840    int mem_base;
7841    int ret_val;
7842    xmlShellCtxtPtr ctxt; /* the shell context */
7843    int n_ctxt;
7844    char * dtd; /* the DTD URI (optional) */
7845    int n_dtd;
7846    xmlNodePtr node; /* unused */
7847    int n_node;
7848    xmlNodePtr node2; /* unused */
7849    int n_node2;
7850
7851    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7852    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7853    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7854    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7855        mem_base = xmlMemBlocks();
7856        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7857        dtd = gen_char_ptr(n_dtd, 1);
7858        node = gen_xmlNodePtr(n_node, 2);
7859        node2 = gen_xmlNodePtr(n_node2, 3);
7860
7861        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
7862        desret_int(ret_val);
7863        call_tests++;
7864        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7865        des_char_ptr(n_dtd, dtd, 1);
7866        des_xmlNodePtr(n_node, node, 2);
7867        des_xmlNodePtr(n_node2, node2, 3);
7868        xmlResetLastError();
7869        if (mem_base != xmlMemBlocks()) {
7870            printf("Leak of %d blocks found in xmlShellValidate",
7871	           xmlMemBlocks() - mem_base);
7872	    test_ret++;
7873            printf(" %d", n_ctxt);
7874            printf(" %d", n_dtd);
7875            printf(" %d", n_node);
7876            printf(" %d", n_node2);
7877            printf("\n");
7878        }
7879    }
7880    }
7881    }
7882    }
7883    function_tests++;
7884#endif
7885
7886    return(test_ret);
7887}
7888
7889
7890static int
7891test_xmlShellWrite(void) {
7892    int test_ret = 0;
7893
7894#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7895    int mem_base;
7896    int ret_val;
7897    xmlShellCtxtPtr ctxt; /* the shell context */
7898    int n_ctxt;
7899    char * filename; /* the file name */
7900    int n_filename;
7901    xmlNodePtr node; /* a node in the tree */
7902    int n_node;
7903    xmlNodePtr node2; /* unused */
7904    int n_node2;
7905
7906    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7907    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7908    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7909    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7910        mem_base = xmlMemBlocks();
7911        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7912        filename = gen_char_ptr(n_filename, 1);
7913        node = gen_xmlNodePtr(n_node, 2);
7914        node2 = gen_xmlNodePtr(n_node2, 3);
7915
7916        ret_val = xmlShellWrite(ctxt, filename, node, node2);
7917        desret_int(ret_val);
7918        call_tests++;
7919        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7920        des_char_ptr(n_filename, filename, 1);
7921        des_xmlNodePtr(n_node, node, 2);
7922        des_xmlNodePtr(n_node2, node2, 3);
7923        xmlResetLastError();
7924        if (mem_base != xmlMemBlocks()) {
7925            printf("Leak of %d blocks found in xmlShellWrite",
7926	           xmlMemBlocks() - mem_base);
7927	    test_ret++;
7928            printf(" %d", n_ctxt);
7929            printf(" %d", n_filename);
7930            printf(" %d", n_node);
7931            printf(" %d", n_node2);
7932            printf("\n");
7933        }
7934    }
7935    }
7936    }
7937    }
7938    function_tests++;
7939#endif
7940
7941    return(test_ret);
7942}
7943
7944static int
7945test_debugXML(void) {
7946    int test_ret = 0;
7947
7948    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
7949    test_ret += test_xmlBoolToText();
7950    test_ret += test_xmlDebugCheckDocument();
7951    test_ret += test_xmlDebugDumpAttr();
7952    test_ret += test_xmlDebugDumpAttrList();
7953    test_ret += test_xmlDebugDumpDTD();
7954    test_ret += test_xmlDebugDumpDocument();
7955    test_ret += test_xmlDebugDumpDocumentHead();
7956    test_ret += test_xmlDebugDumpEntities();
7957    test_ret += test_xmlDebugDumpNode();
7958    test_ret += test_xmlDebugDumpNodeList();
7959    test_ret += test_xmlDebugDumpOneNode();
7960    test_ret += test_xmlDebugDumpString();
7961    test_ret += test_xmlLsCountNode();
7962    test_ret += test_xmlLsOneNode();
7963    test_ret += test_xmlShell();
7964    test_ret += test_xmlShellBase();
7965    test_ret += test_xmlShellCat();
7966    test_ret += test_xmlShellDir();
7967    test_ret += test_xmlShellDu();
7968    test_ret += test_xmlShellList();
7969    test_ret += test_xmlShellLoad();
7970    test_ret += test_xmlShellPrintXPathResult();
7971    test_ret += test_xmlShellPwd();
7972    test_ret += test_xmlShellSave();
7973    test_ret += test_xmlShellValidate();
7974    test_ret += test_xmlShellWrite();
7975
7976    if (test_ret != 0)
7977	printf("Module debugXML: %d errors\n", test_ret);
7978    return(test_ret);
7979}
7980
7981static int
7982test_xmlDictCleanup(void) {
7983    int test_ret = 0;
7984
7985    int mem_base;
7986
7987        mem_base = xmlMemBlocks();
7988
7989        xmlDictCleanup();
7990        call_tests++;
7991        xmlResetLastError();
7992        if (mem_base != xmlMemBlocks()) {
7993            printf("Leak of %d blocks found in xmlDictCleanup",
7994	           xmlMemBlocks() - mem_base);
7995	    test_ret++;
7996            printf("\n");
7997        }
7998    function_tests++;
7999
8000    return(test_ret);
8001}
8002
8003
8004static int
8005test_xmlDictCreate(void) {
8006    int test_ret = 0;
8007
8008    int mem_base;
8009    xmlDictPtr ret_val;
8010
8011        mem_base = xmlMemBlocks();
8012
8013        ret_val = xmlDictCreate();
8014        desret_xmlDictPtr(ret_val);
8015        call_tests++;
8016        xmlResetLastError();
8017        if (mem_base != xmlMemBlocks()) {
8018            printf("Leak of %d blocks found in xmlDictCreate",
8019	           xmlMemBlocks() - mem_base);
8020	    test_ret++;
8021            printf("\n");
8022        }
8023    function_tests++;
8024
8025    return(test_ret);
8026}
8027
8028
8029static int
8030test_xmlDictCreateSub(void) {
8031    int test_ret = 0;
8032
8033    int mem_base;
8034    xmlDictPtr ret_val;
8035    xmlDictPtr sub; /* an existing dictionnary */
8036    int n_sub;
8037
8038    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8039        mem_base = xmlMemBlocks();
8040        sub = gen_xmlDictPtr(n_sub, 0);
8041
8042        ret_val = xmlDictCreateSub(sub);
8043        desret_xmlDictPtr(ret_val);
8044        call_tests++;
8045        des_xmlDictPtr(n_sub, sub, 0);
8046        xmlResetLastError();
8047        if (mem_base != xmlMemBlocks()) {
8048            printf("Leak of %d blocks found in xmlDictCreateSub",
8049	           xmlMemBlocks() - mem_base);
8050	    test_ret++;
8051            printf(" %d", n_sub);
8052            printf("\n");
8053        }
8054    }
8055    function_tests++;
8056
8057    return(test_ret);
8058}
8059
8060
8061static int
8062test_xmlDictExists(void) {
8063    int test_ret = 0;
8064
8065    int mem_base;
8066    const xmlChar * ret_val;
8067    xmlDictPtr dict; /* the dictionnary */
8068    int n_dict;
8069    xmlChar * name; /* the name of the userdata */
8070    int n_name;
8071    int len; /* the length of the name, if -1 it is recomputed */
8072    int n_len;
8073
8074    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8075    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8076    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8077        mem_base = xmlMemBlocks();
8078        dict = gen_xmlDictPtr(n_dict, 0);
8079        name = gen_const_xmlChar_ptr(n_name, 1);
8080        len = gen_int(n_len, 2);
8081
8082        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8083        desret_const_xmlChar_ptr(ret_val);
8084        call_tests++;
8085        des_xmlDictPtr(n_dict, dict, 0);
8086        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8087        des_int(n_len, len, 2);
8088        xmlResetLastError();
8089        if (mem_base != xmlMemBlocks()) {
8090            printf("Leak of %d blocks found in xmlDictExists",
8091	           xmlMemBlocks() - mem_base);
8092	    test_ret++;
8093            printf(" %d", n_dict);
8094            printf(" %d", n_name);
8095            printf(" %d", n_len);
8096            printf("\n");
8097        }
8098    }
8099    }
8100    }
8101    function_tests++;
8102
8103    return(test_ret);
8104}
8105
8106
8107static int
8108test_xmlDictLookup(void) {
8109    int test_ret = 0;
8110
8111    int mem_base;
8112    const xmlChar * ret_val;
8113    xmlDictPtr dict; /* the dictionnary */
8114    int n_dict;
8115    xmlChar * name; /* the name of the userdata */
8116    int n_name;
8117    int len; /* the length of the name, if -1 it is recomputed */
8118    int n_len;
8119
8120    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8121    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8122    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8123        mem_base = xmlMemBlocks();
8124        dict = gen_xmlDictPtr(n_dict, 0);
8125        name = gen_const_xmlChar_ptr(n_name, 1);
8126        len = gen_int(n_len, 2);
8127
8128        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8129        desret_const_xmlChar_ptr(ret_val);
8130        call_tests++;
8131        des_xmlDictPtr(n_dict, dict, 0);
8132        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8133        des_int(n_len, len, 2);
8134        xmlResetLastError();
8135        if (mem_base != xmlMemBlocks()) {
8136            printf("Leak of %d blocks found in xmlDictLookup",
8137	           xmlMemBlocks() - mem_base);
8138	    test_ret++;
8139            printf(" %d", n_dict);
8140            printf(" %d", n_name);
8141            printf(" %d", n_len);
8142            printf("\n");
8143        }
8144    }
8145    }
8146    }
8147    function_tests++;
8148
8149    return(test_ret);
8150}
8151
8152
8153static int
8154test_xmlDictOwns(void) {
8155    int test_ret = 0;
8156
8157    int mem_base;
8158    int ret_val;
8159    xmlDictPtr dict; /* the dictionnary */
8160    int n_dict;
8161    xmlChar * str; /* the string */
8162    int n_str;
8163
8164    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8165    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8166        mem_base = xmlMemBlocks();
8167        dict = gen_xmlDictPtr(n_dict, 0);
8168        str = gen_const_xmlChar_ptr(n_str, 1);
8169
8170        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8171        desret_int(ret_val);
8172        call_tests++;
8173        des_xmlDictPtr(n_dict, dict, 0);
8174        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8175        xmlResetLastError();
8176        if (mem_base != xmlMemBlocks()) {
8177            printf("Leak of %d blocks found in xmlDictOwns",
8178	           xmlMemBlocks() - mem_base);
8179	    test_ret++;
8180            printf(" %d", n_dict);
8181            printf(" %d", n_str);
8182            printf("\n");
8183        }
8184    }
8185    }
8186    function_tests++;
8187
8188    return(test_ret);
8189}
8190
8191
8192static int
8193test_xmlDictQLookup(void) {
8194    int test_ret = 0;
8195
8196    int mem_base;
8197    const xmlChar * ret_val;
8198    xmlDictPtr dict; /* the dictionnary */
8199    int n_dict;
8200    xmlChar * prefix; /* the prefix */
8201    int n_prefix;
8202    xmlChar * name; /* the name */
8203    int n_name;
8204
8205    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8206    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8207    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8208        mem_base = xmlMemBlocks();
8209        dict = gen_xmlDictPtr(n_dict, 0);
8210        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8211        name = gen_const_xmlChar_ptr(n_name, 2);
8212
8213        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8214        desret_const_xmlChar_ptr(ret_val);
8215        call_tests++;
8216        des_xmlDictPtr(n_dict, dict, 0);
8217        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8218        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8219        xmlResetLastError();
8220        if (mem_base != xmlMemBlocks()) {
8221            printf("Leak of %d blocks found in xmlDictQLookup",
8222	           xmlMemBlocks() - mem_base);
8223	    test_ret++;
8224            printf(" %d", n_dict);
8225            printf(" %d", n_prefix);
8226            printf(" %d", n_name);
8227            printf("\n");
8228        }
8229    }
8230    }
8231    }
8232    function_tests++;
8233
8234    return(test_ret);
8235}
8236
8237
8238static int
8239test_xmlDictReference(void) {
8240    int test_ret = 0;
8241
8242    int mem_base;
8243    int ret_val;
8244    xmlDictPtr dict; /* the dictionnary */
8245    int n_dict;
8246
8247    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8248        mem_base = xmlMemBlocks();
8249        dict = gen_xmlDictPtr(n_dict, 0);
8250
8251        ret_val = xmlDictReference(dict);
8252        xmlDictFree(dict);
8253        desret_int(ret_val);
8254        call_tests++;
8255        des_xmlDictPtr(n_dict, dict, 0);
8256        xmlResetLastError();
8257        if (mem_base != xmlMemBlocks()) {
8258            printf("Leak of %d blocks found in xmlDictReference",
8259	           xmlMemBlocks() - mem_base);
8260	    test_ret++;
8261            printf(" %d", n_dict);
8262            printf("\n");
8263        }
8264    }
8265    function_tests++;
8266
8267    return(test_ret);
8268}
8269
8270
8271static int
8272test_xmlDictSize(void) {
8273    int test_ret = 0;
8274
8275    int mem_base;
8276    int ret_val;
8277    xmlDictPtr dict; /* the dictionnary */
8278    int n_dict;
8279
8280    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8281        mem_base = xmlMemBlocks();
8282        dict = gen_xmlDictPtr(n_dict, 0);
8283
8284        ret_val = xmlDictSize(dict);
8285        desret_int(ret_val);
8286        call_tests++;
8287        des_xmlDictPtr(n_dict, dict, 0);
8288        xmlResetLastError();
8289        if (mem_base != xmlMemBlocks()) {
8290            printf("Leak of %d blocks found in xmlDictSize",
8291	           xmlMemBlocks() - mem_base);
8292	    test_ret++;
8293            printf(" %d", n_dict);
8294            printf("\n");
8295        }
8296    }
8297    function_tests++;
8298
8299    return(test_ret);
8300}
8301
8302static int
8303test_dict(void) {
8304    int test_ret = 0;
8305
8306    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8307    test_ret += test_xmlDictCleanup();
8308    test_ret += test_xmlDictCreate();
8309    test_ret += test_xmlDictCreateSub();
8310    test_ret += test_xmlDictExists();
8311    test_ret += test_xmlDictLookup();
8312    test_ret += test_xmlDictOwns();
8313    test_ret += test_xmlDictQLookup();
8314    test_ret += test_xmlDictReference();
8315    test_ret += test_xmlDictSize();
8316
8317    if (test_ret != 0)
8318	printf("Module dict: %d errors\n", test_ret);
8319    return(test_ret);
8320}
8321
8322static int
8323test_UTF8Toisolat1(void) {
8324    int test_ret = 0;
8325
8326#if defined(LIBXML_OUTPUT_ENABLED)
8327#ifdef LIBXML_OUTPUT_ENABLED
8328    int mem_base;
8329    int ret_val;
8330    unsigned char * out; /* a pointer to an array of bytes to store the result */
8331    int n_out;
8332    int * outlen; /* the length of @out */
8333    int n_outlen;
8334    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8335    int n_in;
8336    int * inlen; /* the length of @in */
8337    int n_inlen;
8338
8339    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8340    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8341    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8342    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8343        mem_base = xmlMemBlocks();
8344        out = gen_unsigned_char_ptr(n_out, 0);
8345        outlen = gen_int_ptr(n_outlen, 1);
8346        in = gen_const_unsigned_char_ptr(n_in, 2);
8347        inlen = gen_int_ptr(n_inlen, 3);
8348
8349        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8350        desret_int(ret_val);
8351        call_tests++;
8352        des_unsigned_char_ptr(n_out, out, 0);
8353        des_int_ptr(n_outlen, outlen, 1);
8354        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8355        des_int_ptr(n_inlen, inlen, 3);
8356        xmlResetLastError();
8357        if (mem_base != xmlMemBlocks()) {
8358            printf("Leak of %d blocks found in UTF8Toisolat1",
8359	           xmlMemBlocks() - mem_base);
8360	    test_ret++;
8361            printf(" %d", n_out);
8362            printf(" %d", n_outlen);
8363            printf(" %d", n_in);
8364            printf(" %d", n_inlen);
8365            printf("\n");
8366        }
8367    }
8368    }
8369    }
8370    }
8371    function_tests++;
8372#endif
8373#endif
8374
8375    return(test_ret);
8376}
8377
8378
8379static int
8380test_isolat1ToUTF8(void) {
8381    int test_ret = 0;
8382
8383    int mem_base;
8384    int ret_val;
8385    unsigned char * out; /* a pointer to an array of bytes to store the result */
8386    int n_out;
8387    int * outlen; /* the length of @out */
8388    int n_outlen;
8389    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8390    int n_in;
8391    int * inlen; /* the length of @in */
8392    int n_inlen;
8393
8394    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8395    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8396    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8397    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8398        mem_base = xmlMemBlocks();
8399        out = gen_unsigned_char_ptr(n_out, 0);
8400        outlen = gen_int_ptr(n_outlen, 1);
8401        in = gen_const_unsigned_char_ptr(n_in, 2);
8402        inlen = gen_int_ptr(n_inlen, 3);
8403
8404        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8405        desret_int(ret_val);
8406        call_tests++;
8407        des_unsigned_char_ptr(n_out, out, 0);
8408        des_int_ptr(n_outlen, outlen, 1);
8409        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8410        des_int_ptr(n_inlen, inlen, 3);
8411        xmlResetLastError();
8412        if (mem_base != xmlMemBlocks()) {
8413            printf("Leak of %d blocks found in isolat1ToUTF8",
8414	           xmlMemBlocks() - mem_base);
8415	    test_ret++;
8416            printf(" %d", n_out);
8417            printf(" %d", n_outlen);
8418            printf(" %d", n_in);
8419            printf(" %d", n_inlen);
8420            printf("\n");
8421        }
8422    }
8423    }
8424    }
8425    }
8426    function_tests++;
8427
8428    return(test_ret);
8429}
8430
8431
8432static int
8433test_xmlAddEncodingAlias(void) {
8434    int test_ret = 0;
8435
8436    int ret_val;
8437    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8438    int n_name;
8439    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8440    int n_alias;
8441
8442    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8443    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8444        name = gen_const_char_ptr(n_name, 0);
8445        alias = gen_const_char_ptr(n_alias, 1);
8446
8447        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8448        desret_int(ret_val);
8449        call_tests++;
8450        des_const_char_ptr(n_name, (const char *)name, 0);
8451        des_const_char_ptr(n_alias, (const char *)alias, 1);
8452        xmlResetLastError();
8453    }
8454    }
8455    function_tests++;
8456
8457    return(test_ret);
8458}
8459
8460
8461#define gen_nb_xmlCharEncodingHandler_ptr 1
8462static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8463    return(NULL);
8464}
8465static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8466}
8467
8468static int
8469test_xmlCharEncCloseFunc(void) {
8470    int test_ret = 0;
8471
8472    int mem_base;
8473    int ret_val;
8474    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8475    int n_handler;
8476
8477    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8478        mem_base = xmlMemBlocks();
8479        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8480
8481        ret_val = xmlCharEncCloseFunc(handler);
8482        desret_int(ret_val);
8483        call_tests++;
8484        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8485        xmlResetLastError();
8486        if (mem_base != xmlMemBlocks()) {
8487            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8488	           xmlMemBlocks() - mem_base);
8489	    test_ret++;
8490            printf(" %d", n_handler);
8491            printf("\n");
8492        }
8493    }
8494    function_tests++;
8495
8496    return(test_ret);
8497}
8498
8499
8500static int
8501test_xmlCharEncFirstLine(void) {
8502    int test_ret = 0;
8503
8504    int mem_base;
8505    int ret_val;
8506    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8507    int n_handler;
8508    xmlBufferPtr out; /* an xmlBuffer for the output. */
8509    int n_out;
8510    xmlBufferPtr in; /* an xmlBuffer for the input */
8511    int n_in;
8512
8513    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8514    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8515    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8516        mem_base = xmlMemBlocks();
8517        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8518        out = gen_xmlBufferPtr(n_out, 1);
8519        in = gen_xmlBufferPtr(n_in, 2);
8520
8521        ret_val = xmlCharEncFirstLine(handler, out, in);
8522        desret_int(ret_val);
8523        call_tests++;
8524        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8525        des_xmlBufferPtr(n_out, out, 1);
8526        des_xmlBufferPtr(n_in, in, 2);
8527        xmlResetLastError();
8528        if (mem_base != xmlMemBlocks()) {
8529            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8530	           xmlMemBlocks() - mem_base);
8531	    test_ret++;
8532            printf(" %d", n_handler);
8533            printf(" %d", n_out);
8534            printf(" %d", n_in);
8535            printf("\n");
8536        }
8537    }
8538    }
8539    }
8540    function_tests++;
8541
8542    return(test_ret);
8543}
8544
8545
8546static int
8547test_xmlCharEncInFunc(void) {
8548    int test_ret = 0;
8549
8550    int mem_base;
8551    int ret_val;
8552    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8553    int n_handler;
8554    xmlBufferPtr out; /* an xmlBuffer for the output. */
8555    int n_out;
8556    xmlBufferPtr in; /* an xmlBuffer for the input */
8557    int n_in;
8558
8559    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8560    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8561    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8562        mem_base = xmlMemBlocks();
8563        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8564        out = gen_xmlBufferPtr(n_out, 1);
8565        in = gen_xmlBufferPtr(n_in, 2);
8566
8567        ret_val = xmlCharEncInFunc(handler, out, in);
8568        desret_int(ret_val);
8569        call_tests++;
8570        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8571        des_xmlBufferPtr(n_out, out, 1);
8572        des_xmlBufferPtr(n_in, in, 2);
8573        xmlResetLastError();
8574        if (mem_base != xmlMemBlocks()) {
8575            printf("Leak of %d blocks found in xmlCharEncInFunc",
8576	           xmlMemBlocks() - mem_base);
8577	    test_ret++;
8578            printf(" %d", n_handler);
8579            printf(" %d", n_out);
8580            printf(" %d", n_in);
8581            printf("\n");
8582        }
8583    }
8584    }
8585    }
8586    function_tests++;
8587
8588    return(test_ret);
8589}
8590
8591
8592static int
8593test_xmlCharEncOutFunc(void) {
8594    int test_ret = 0;
8595
8596    int mem_base;
8597    int ret_val;
8598    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8599    int n_handler;
8600    xmlBufferPtr out; /* an xmlBuffer for the output. */
8601    int n_out;
8602    xmlBufferPtr in; /* an xmlBuffer for the input */
8603    int n_in;
8604
8605    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8606    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8607    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8608        mem_base = xmlMemBlocks();
8609        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8610        out = gen_xmlBufferPtr(n_out, 1);
8611        in = gen_xmlBufferPtr(n_in, 2);
8612
8613        ret_val = xmlCharEncOutFunc(handler, out, in);
8614        desret_int(ret_val);
8615        call_tests++;
8616        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8617        des_xmlBufferPtr(n_out, out, 1);
8618        des_xmlBufferPtr(n_in, in, 2);
8619        xmlResetLastError();
8620        if (mem_base != xmlMemBlocks()) {
8621            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8622	           xmlMemBlocks() - mem_base);
8623	    test_ret++;
8624            printf(" %d", n_handler);
8625            printf(" %d", n_out);
8626            printf(" %d", n_in);
8627            printf("\n");
8628        }
8629    }
8630    }
8631    }
8632    function_tests++;
8633
8634    return(test_ret);
8635}
8636
8637
8638static int
8639test_xmlCleanupCharEncodingHandlers(void) {
8640    int test_ret = 0;
8641
8642
8643
8644        xmlCleanupCharEncodingHandlers();
8645        call_tests++;
8646        xmlResetLastError();
8647    function_tests++;
8648
8649    return(test_ret);
8650}
8651
8652
8653static int
8654test_xmlCleanupEncodingAliases(void) {
8655    int test_ret = 0;
8656
8657    int mem_base;
8658
8659        mem_base = xmlMemBlocks();
8660
8661        xmlCleanupEncodingAliases();
8662        call_tests++;
8663        xmlResetLastError();
8664        if (mem_base != xmlMemBlocks()) {
8665            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8666	           xmlMemBlocks() - mem_base);
8667	    test_ret++;
8668            printf("\n");
8669        }
8670    function_tests++;
8671
8672    return(test_ret);
8673}
8674
8675
8676static int
8677test_xmlDelEncodingAlias(void) {
8678    int test_ret = 0;
8679
8680    int mem_base;
8681    int ret_val;
8682    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8683    int n_alias;
8684
8685    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8686        mem_base = xmlMemBlocks();
8687        alias = gen_const_char_ptr(n_alias, 0);
8688
8689        ret_val = xmlDelEncodingAlias((const char *)alias);
8690        desret_int(ret_val);
8691        call_tests++;
8692        des_const_char_ptr(n_alias, (const char *)alias, 0);
8693        xmlResetLastError();
8694        if (mem_base != xmlMemBlocks()) {
8695            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8696	           xmlMemBlocks() - mem_base);
8697	    test_ret++;
8698            printf(" %d", n_alias);
8699            printf("\n");
8700        }
8701    }
8702    function_tests++;
8703
8704    return(test_ret);
8705}
8706
8707
8708static int
8709test_xmlDetectCharEncoding(void) {
8710    int test_ret = 0;
8711
8712    int mem_base;
8713    xmlCharEncoding ret_val;
8714    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). */
8715    int n_in;
8716    int len; /* pointer to the length of the buffer */
8717    int n_len;
8718
8719    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8720    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8721        mem_base = xmlMemBlocks();
8722        in = gen_const_unsigned_char_ptr(n_in, 0);
8723        len = gen_int(n_len, 1);
8724
8725        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8726        desret_xmlCharEncoding(ret_val);
8727        call_tests++;
8728        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8729        des_int(n_len, len, 1);
8730        xmlResetLastError();
8731        if (mem_base != xmlMemBlocks()) {
8732            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8733	           xmlMemBlocks() - mem_base);
8734	    test_ret++;
8735            printf(" %d", n_in);
8736            printf(" %d", n_len);
8737            printf("\n");
8738        }
8739    }
8740    }
8741    function_tests++;
8742
8743    return(test_ret);
8744}
8745
8746
8747static int
8748test_xmlFindCharEncodingHandler(void) {
8749    int test_ret = 0;
8750
8751
8752    /* missing type support */
8753    return(test_ret);
8754}
8755
8756
8757static int
8758test_xmlGetCharEncodingHandler(void) {
8759    int test_ret = 0;
8760
8761
8762    /* missing type support */
8763    return(test_ret);
8764}
8765
8766
8767static int
8768test_xmlGetCharEncodingName(void) {
8769    int test_ret = 0;
8770
8771    int mem_base;
8772    const char * ret_val;
8773    xmlCharEncoding enc; /* the encoding */
8774    int n_enc;
8775
8776    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8777        mem_base = xmlMemBlocks();
8778        enc = gen_xmlCharEncoding(n_enc, 0);
8779
8780        ret_val = xmlGetCharEncodingName(enc);
8781        desret_const_char_ptr(ret_val);
8782        call_tests++;
8783        des_xmlCharEncoding(n_enc, enc, 0);
8784        xmlResetLastError();
8785        if (mem_base != xmlMemBlocks()) {
8786            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8787	           xmlMemBlocks() - mem_base);
8788	    test_ret++;
8789            printf(" %d", n_enc);
8790            printf("\n");
8791        }
8792    }
8793    function_tests++;
8794
8795    return(test_ret);
8796}
8797
8798
8799static int
8800test_xmlGetEncodingAlias(void) {
8801    int test_ret = 0;
8802
8803    int mem_base;
8804    const char * ret_val;
8805    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8806    int n_alias;
8807
8808    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8809        mem_base = xmlMemBlocks();
8810        alias = gen_const_char_ptr(n_alias, 0);
8811
8812        ret_val = xmlGetEncodingAlias((const char *)alias);
8813        desret_const_char_ptr(ret_val);
8814        call_tests++;
8815        des_const_char_ptr(n_alias, (const char *)alias, 0);
8816        xmlResetLastError();
8817        if (mem_base != xmlMemBlocks()) {
8818            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8819	           xmlMemBlocks() - mem_base);
8820	    test_ret++;
8821            printf(" %d", n_alias);
8822            printf("\n");
8823        }
8824    }
8825    function_tests++;
8826
8827    return(test_ret);
8828}
8829
8830
8831static int
8832test_xmlInitCharEncodingHandlers(void) {
8833    int test_ret = 0;
8834
8835
8836
8837        xmlInitCharEncodingHandlers();
8838        call_tests++;
8839        xmlResetLastError();
8840    function_tests++;
8841
8842    return(test_ret);
8843}
8844
8845
8846static int
8847test_xmlNewCharEncodingHandler(void) {
8848    int test_ret = 0;
8849
8850
8851    /* missing type support */
8852    return(test_ret);
8853}
8854
8855
8856static int
8857test_xmlParseCharEncoding(void) {
8858    int test_ret = 0;
8859
8860    int mem_base;
8861    xmlCharEncoding ret_val;
8862    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8863    int n_name;
8864
8865    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8866        mem_base = xmlMemBlocks();
8867        name = gen_const_char_ptr(n_name, 0);
8868
8869        ret_val = xmlParseCharEncoding((const char *)name);
8870        desret_xmlCharEncoding(ret_val);
8871        call_tests++;
8872        des_const_char_ptr(n_name, (const char *)name, 0);
8873        xmlResetLastError();
8874        if (mem_base != xmlMemBlocks()) {
8875            printf("Leak of %d blocks found in xmlParseCharEncoding",
8876	           xmlMemBlocks() - mem_base);
8877	    test_ret++;
8878            printf(" %d", n_name);
8879            printf("\n");
8880        }
8881    }
8882    function_tests++;
8883
8884    return(test_ret);
8885}
8886
8887
8888#define gen_nb_xmlCharEncodingHandlerPtr 1
8889static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8890    return(NULL);
8891}
8892static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8893}
8894
8895static int
8896test_xmlRegisterCharEncodingHandler(void) {
8897    int test_ret = 0;
8898
8899    int mem_base;
8900    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
8901    int n_handler;
8902
8903    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
8904        mem_base = xmlMemBlocks();
8905        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
8906
8907        xmlRegisterCharEncodingHandler(handler);
8908        call_tests++;
8909        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
8910        xmlResetLastError();
8911        if (mem_base != xmlMemBlocks()) {
8912            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
8913	           xmlMemBlocks() - mem_base);
8914	    test_ret++;
8915            printf(" %d", n_handler);
8916            printf("\n");
8917        }
8918    }
8919    function_tests++;
8920
8921    return(test_ret);
8922}
8923
8924static int
8925test_encoding(void) {
8926    int test_ret = 0;
8927
8928    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
8929    test_ret += test_UTF8Toisolat1();
8930    test_ret += test_isolat1ToUTF8();
8931    test_ret += test_xmlAddEncodingAlias();
8932    test_ret += test_xmlCharEncCloseFunc();
8933    test_ret += test_xmlCharEncFirstLine();
8934    test_ret += test_xmlCharEncInFunc();
8935    test_ret += test_xmlCharEncOutFunc();
8936    test_ret += test_xmlCleanupCharEncodingHandlers();
8937    test_ret += test_xmlCleanupEncodingAliases();
8938    test_ret += test_xmlDelEncodingAlias();
8939    test_ret += test_xmlDetectCharEncoding();
8940    test_ret += test_xmlFindCharEncodingHandler();
8941    test_ret += test_xmlGetCharEncodingHandler();
8942    test_ret += test_xmlGetCharEncodingName();
8943    test_ret += test_xmlGetEncodingAlias();
8944    test_ret += test_xmlInitCharEncodingHandlers();
8945    test_ret += test_xmlNewCharEncodingHandler();
8946    test_ret += test_xmlParseCharEncoding();
8947    test_ret += test_xmlRegisterCharEncodingHandler();
8948
8949    if (test_ret != 0)
8950	printf("Module encoding: %d errors\n", test_ret);
8951    return(test_ret);
8952}
8953
8954static int
8955test_xmlAddDocEntity(void) {
8956    int test_ret = 0;
8957
8958    int mem_base;
8959    xmlEntityPtr ret_val;
8960    xmlDocPtr doc; /* the document */
8961    int n_doc;
8962    xmlChar * name; /* the entity name */
8963    int n_name;
8964    int type; /* the entity type XML_xxx_yyy_ENTITY */
8965    int n_type;
8966    xmlChar * ExternalID; /* the entity external ID if available */
8967    int n_ExternalID;
8968    xmlChar * SystemID; /* the entity system ID if available */
8969    int n_SystemID;
8970    xmlChar * content; /* the entity content */
8971    int n_content;
8972
8973    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
8974    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8975    for (n_type = 0;n_type < gen_nb_int;n_type++) {
8976    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
8977    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
8978    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
8979        mem_base = xmlMemBlocks();
8980        doc = gen_xmlDocPtr(n_doc, 0);
8981        name = gen_const_xmlChar_ptr(n_name, 1);
8982        type = gen_int(n_type, 2);
8983        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
8984        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
8985        content = gen_const_xmlChar_ptr(n_content, 5);
8986
8987        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
8988        desret_xmlEntityPtr(ret_val);
8989        call_tests++;
8990        des_xmlDocPtr(n_doc, doc, 0);
8991        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8992        des_int(n_type, type, 2);
8993        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
8994        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
8995        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
8996        xmlResetLastError();
8997        if (mem_base != xmlMemBlocks()) {
8998            printf("Leak of %d blocks found in xmlAddDocEntity",
8999	           xmlMemBlocks() - mem_base);
9000	    test_ret++;
9001            printf(" %d", n_doc);
9002            printf(" %d", n_name);
9003            printf(" %d", n_type);
9004            printf(" %d", n_ExternalID);
9005            printf(" %d", n_SystemID);
9006            printf(" %d", n_content);
9007            printf("\n");
9008        }
9009    }
9010    }
9011    }
9012    }
9013    }
9014    }
9015    function_tests++;
9016
9017    return(test_ret);
9018}
9019
9020
9021static int
9022test_xmlAddDtdEntity(void) {
9023    int test_ret = 0;
9024
9025    int mem_base;
9026    xmlEntityPtr ret_val;
9027    xmlDocPtr doc; /* the document */
9028    int n_doc;
9029    xmlChar * name; /* the entity name */
9030    int n_name;
9031    int type; /* the entity type XML_xxx_yyy_ENTITY */
9032    int n_type;
9033    xmlChar * ExternalID; /* the entity external ID if available */
9034    int n_ExternalID;
9035    xmlChar * SystemID; /* the entity system ID if available */
9036    int n_SystemID;
9037    xmlChar * content; /* the entity content */
9038    int n_content;
9039
9040    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9041    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9042    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9043    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9044    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9045    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9046        mem_base = xmlMemBlocks();
9047        doc = gen_xmlDocPtr(n_doc, 0);
9048        name = gen_const_xmlChar_ptr(n_name, 1);
9049        type = gen_int(n_type, 2);
9050        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9051        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9052        content = gen_const_xmlChar_ptr(n_content, 5);
9053
9054        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9055        desret_xmlEntityPtr(ret_val);
9056        call_tests++;
9057        des_xmlDocPtr(n_doc, doc, 0);
9058        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9059        des_int(n_type, type, 2);
9060        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9061        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9062        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9063        xmlResetLastError();
9064        if (mem_base != xmlMemBlocks()) {
9065            printf("Leak of %d blocks found in xmlAddDtdEntity",
9066	           xmlMemBlocks() - mem_base);
9067	    test_ret++;
9068            printf(" %d", n_doc);
9069            printf(" %d", n_name);
9070            printf(" %d", n_type);
9071            printf(" %d", n_ExternalID);
9072            printf(" %d", n_SystemID);
9073            printf(" %d", n_content);
9074            printf("\n");
9075        }
9076    }
9077    }
9078    }
9079    }
9080    }
9081    }
9082    function_tests++;
9083
9084    return(test_ret);
9085}
9086
9087
9088static int
9089test_xmlCleanupPredefinedEntities(void) {
9090    int test_ret = 0;
9091
9092#if defined(LIBXML_LEGACY_ENABLED)
9093#ifdef LIBXML_LEGACY_ENABLED
9094    int mem_base;
9095
9096        mem_base = xmlMemBlocks();
9097
9098        xmlCleanupPredefinedEntities();
9099        call_tests++;
9100        xmlResetLastError();
9101        if (mem_base != xmlMemBlocks()) {
9102            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9103	           xmlMemBlocks() - mem_base);
9104	    test_ret++;
9105            printf("\n");
9106        }
9107    function_tests++;
9108#endif
9109#endif
9110
9111    return(test_ret);
9112}
9113
9114
9115#define gen_nb_xmlEntitiesTablePtr 1
9116static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9117    return(NULL);
9118}
9119static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9120}
9121
9122static int
9123test_xmlCopyEntitiesTable(void) {
9124    int test_ret = 0;
9125
9126
9127    /* missing type support */
9128    return(test_ret);
9129}
9130
9131
9132static int
9133test_xmlCreateEntitiesTable(void) {
9134    int test_ret = 0;
9135
9136
9137    /* missing type support */
9138    return(test_ret);
9139}
9140
9141
9142static int
9143test_xmlDumpEntitiesTable(void) {
9144    int test_ret = 0;
9145
9146#if defined(LIBXML_OUTPUT_ENABLED)
9147    int mem_base;
9148    xmlBufferPtr buf; /* An XML buffer. */
9149    int n_buf;
9150    xmlEntitiesTablePtr table; /* An entity table */
9151    int n_table;
9152
9153    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9154    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9155        mem_base = xmlMemBlocks();
9156        buf = gen_xmlBufferPtr(n_buf, 0);
9157        table = gen_xmlEntitiesTablePtr(n_table, 1);
9158
9159        xmlDumpEntitiesTable(buf, table);
9160        call_tests++;
9161        des_xmlBufferPtr(n_buf, buf, 0);
9162        des_xmlEntitiesTablePtr(n_table, table, 1);
9163        xmlResetLastError();
9164        if (mem_base != xmlMemBlocks()) {
9165            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9166	           xmlMemBlocks() - mem_base);
9167	    test_ret++;
9168            printf(" %d", n_buf);
9169            printf(" %d", n_table);
9170            printf("\n");
9171        }
9172    }
9173    }
9174    function_tests++;
9175#endif
9176
9177    return(test_ret);
9178}
9179
9180
9181#define gen_nb_xmlEntityPtr 1
9182static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9183    return(NULL);
9184}
9185static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9186}
9187
9188static int
9189test_xmlDumpEntityDecl(void) {
9190    int test_ret = 0;
9191
9192#if defined(LIBXML_OUTPUT_ENABLED)
9193    int mem_base;
9194    xmlBufferPtr buf; /* An XML buffer. */
9195    int n_buf;
9196    xmlEntityPtr ent; /* An entity table */
9197    int n_ent;
9198
9199    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9200    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9201        mem_base = xmlMemBlocks();
9202        buf = gen_xmlBufferPtr(n_buf, 0);
9203        ent = gen_xmlEntityPtr(n_ent, 1);
9204
9205        xmlDumpEntityDecl(buf, ent);
9206        call_tests++;
9207        des_xmlBufferPtr(n_buf, buf, 0);
9208        des_xmlEntityPtr(n_ent, ent, 1);
9209        xmlResetLastError();
9210        if (mem_base != xmlMemBlocks()) {
9211            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9212	           xmlMemBlocks() - mem_base);
9213	    test_ret++;
9214            printf(" %d", n_buf);
9215            printf(" %d", n_ent);
9216            printf("\n");
9217        }
9218    }
9219    }
9220    function_tests++;
9221#endif
9222
9223    return(test_ret);
9224}
9225
9226
9227static int
9228test_xmlEncodeEntitiesReentrant(void) {
9229    int test_ret = 0;
9230
9231    int mem_base;
9232    xmlChar * ret_val;
9233    xmlDocPtr doc; /* the document containing the string */
9234    int n_doc;
9235    xmlChar * input; /* A string to convert to XML. */
9236    int n_input;
9237
9238    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9239    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9240        mem_base = xmlMemBlocks();
9241        doc = gen_xmlDocPtr(n_doc, 0);
9242        input = gen_const_xmlChar_ptr(n_input, 1);
9243
9244        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9245        desret_xmlChar_ptr(ret_val);
9246        call_tests++;
9247        des_xmlDocPtr(n_doc, doc, 0);
9248        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9249        xmlResetLastError();
9250        if (mem_base != xmlMemBlocks()) {
9251            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9252	           xmlMemBlocks() - mem_base);
9253	    test_ret++;
9254            printf(" %d", n_doc);
9255            printf(" %d", n_input);
9256            printf("\n");
9257        }
9258    }
9259    }
9260    function_tests++;
9261
9262    return(test_ret);
9263}
9264
9265
9266static int
9267test_xmlEncodeSpecialChars(void) {
9268    int test_ret = 0;
9269
9270    int mem_base;
9271    xmlChar * ret_val;
9272    xmlDocPtr doc; /* the document containing the string */
9273    int n_doc;
9274    xmlChar * input; /* A string to convert to XML. */
9275    int n_input;
9276
9277    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9278    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9279        mem_base = xmlMemBlocks();
9280        doc = gen_xmlDocPtr(n_doc, 0);
9281        input = gen_const_xmlChar_ptr(n_input, 1);
9282
9283        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9284        desret_xmlChar_ptr(ret_val);
9285        call_tests++;
9286        des_xmlDocPtr(n_doc, doc, 0);
9287        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9288        xmlResetLastError();
9289        if (mem_base != xmlMemBlocks()) {
9290            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9291	           xmlMemBlocks() - mem_base);
9292	    test_ret++;
9293            printf(" %d", n_doc);
9294            printf(" %d", n_input);
9295            printf("\n");
9296        }
9297    }
9298    }
9299    function_tests++;
9300
9301    return(test_ret);
9302}
9303
9304
9305static int
9306test_xmlGetDocEntity(void) {
9307    int test_ret = 0;
9308
9309    int mem_base;
9310    xmlEntityPtr ret_val;
9311    xmlDocPtr doc; /* the document referencing the entity */
9312    int n_doc;
9313    xmlChar * name; /* the entity name */
9314    int n_name;
9315
9316    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9317    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9318        mem_base = xmlMemBlocks();
9319        doc = gen_xmlDocPtr(n_doc, 0);
9320        name = gen_const_xmlChar_ptr(n_name, 1);
9321
9322        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9323        desret_xmlEntityPtr(ret_val);
9324        call_tests++;
9325        des_xmlDocPtr(n_doc, doc, 0);
9326        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9327        xmlResetLastError();
9328        if (mem_base != xmlMemBlocks()) {
9329            printf("Leak of %d blocks found in xmlGetDocEntity",
9330	           xmlMemBlocks() - mem_base);
9331	    test_ret++;
9332            printf(" %d", n_doc);
9333            printf(" %d", n_name);
9334            printf("\n");
9335        }
9336    }
9337    }
9338    function_tests++;
9339
9340    return(test_ret);
9341}
9342
9343
9344static int
9345test_xmlGetDtdEntity(void) {
9346    int test_ret = 0;
9347
9348    int mem_base;
9349    xmlEntityPtr ret_val;
9350    xmlDocPtr doc; /* the document referencing the entity */
9351    int n_doc;
9352    xmlChar * name; /* the entity name */
9353    int n_name;
9354
9355    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9356    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9357        mem_base = xmlMemBlocks();
9358        doc = gen_xmlDocPtr(n_doc, 0);
9359        name = gen_const_xmlChar_ptr(n_name, 1);
9360
9361        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9362        desret_xmlEntityPtr(ret_val);
9363        call_tests++;
9364        des_xmlDocPtr(n_doc, doc, 0);
9365        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9366        xmlResetLastError();
9367        if (mem_base != xmlMemBlocks()) {
9368            printf("Leak of %d blocks found in xmlGetDtdEntity",
9369	           xmlMemBlocks() - mem_base);
9370	    test_ret++;
9371            printf(" %d", n_doc);
9372            printf(" %d", n_name);
9373            printf("\n");
9374        }
9375    }
9376    }
9377    function_tests++;
9378
9379    return(test_ret);
9380}
9381
9382
9383static int
9384test_xmlGetParameterEntity(void) {
9385    int test_ret = 0;
9386
9387    int mem_base;
9388    xmlEntityPtr ret_val;
9389    xmlDocPtr doc; /* the document referencing the entity */
9390    int n_doc;
9391    xmlChar * name; /* the entity name */
9392    int n_name;
9393
9394    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9395    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9396        mem_base = xmlMemBlocks();
9397        doc = gen_xmlDocPtr(n_doc, 0);
9398        name = gen_const_xmlChar_ptr(n_name, 1);
9399
9400        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9401        desret_xmlEntityPtr(ret_val);
9402        call_tests++;
9403        des_xmlDocPtr(n_doc, doc, 0);
9404        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9405        xmlResetLastError();
9406        if (mem_base != xmlMemBlocks()) {
9407            printf("Leak of %d blocks found in xmlGetParameterEntity",
9408	           xmlMemBlocks() - mem_base);
9409	    test_ret++;
9410            printf(" %d", n_doc);
9411            printf(" %d", n_name);
9412            printf("\n");
9413        }
9414    }
9415    }
9416    function_tests++;
9417
9418    return(test_ret);
9419}
9420
9421
9422static int
9423test_xmlGetPredefinedEntity(void) {
9424    int test_ret = 0;
9425
9426    int mem_base;
9427    xmlEntityPtr ret_val;
9428    xmlChar * name; /* the entity name */
9429    int n_name;
9430
9431    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9432        mem_base = xmlMemBlocks();
9433        name = gen_const_xmlChar_ptr(n_name, 0);
9434
9435        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9436        desret_xmlEntityPtr(ret_val);
9437        call_tests++;
9438        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9439        xmlResetLastError();
9440        if (mem_base != xmlMemBlocks()) {
9441            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9442	           xmlMemBlocks() - mem_base);
9443	    test_ret++;
9444            printf(" %d", n_name);
9445            printf("\n");
9446        }
9447    }
9448    function_tests++;
9449
9450    return(test_ret);
9451}
9452
9453
9454static int
9455test_xmlInitializePredefinedEntities(void) {
9456    int test_ret = 0;
9457
9458#if defined(LIBXML_LEGACY_ENABLED)
9459#ifdef LIBXML_LEGACY_ENABLED
9460    int mem_base;
9461
9462        mem_base = xmlMemBlocks();
9463
9464        xmlInitializePredefinedEntities();
9465        call_tests++;
9466        xmlResetLastError();
9467        if (mem_base != xmlMemBlocks()) {
9468            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9469	           xmlMemBlocks() - mem_base);
9470	    test_ret++;
9471            printf("\n");
9472        }
9473    function_tests++;
9474#endif
9475#endif
9476
9477    return(test_ret);
9478}
9479
9480static int
9481test_entities(void) {
9482    int test_ret = 0;
9483
9484    if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
9485    test_ret += test_xmlAddDocEntity();
9486    test_ret += test_xmlAddDtdEntity();
9487    test_ret += test_xmlCleanupPredefinedEntities();
9488    test_ret += test_xmlCopyEntitiesTable();
9489    test_ret += test_xmlCreateEntitiesTable();
9490    test_ret += test_xmlDumpEntitiesTable();
9491    test_ret += test_xmlDumpEntityDecl();
9492    test_ret += test_xmlEncodeEntitiesReentrant();
9493    test_ret += test_xmlEncodeSpecialChars();
9494    test_ret += test_xmlGetDocEntity();
9495    test_ret += test_xmlGetDtdEntity();
9496    test_ret += test_xmlGetParameterEntity();
9497    test_ret += test_xmlGetPredefinedEntity();
9498    test_ret += test_xmlInitializePredefinedEntities();
9499
9500    if (test_ret != 0)
9501	printf("Module entities: %d errors\n", test_ret);
9502    return(test_ret);
9503}
9504
9505static int
9506test_xmlHashAddEntry(void) {
9507    int test_ret = 0;
9508
9509    int mem_base;
9510    int ret_val;
9511    xmlHashTablePtr table; /* the hash table */
9512    int n_table;
9513    xmlChar * name; /* the name of the userdata */
9514    int n_name;
9515    void * userdata; /* a pointer to the userdata */
9516    int n_userdata;
9517
9518    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9519    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9520    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9521        mem_base = xmlMemBlocks();
9522        table = gen_xmlHashTablePtr(n_table, 0);
9523        name = gen_const_xmlChar_ptr(n_name, 1);
9524        userdata = gen_userdata(n_userdata, 2);
9525
9526        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9527        desret_int(ret_val);
9528        call_tests++;
9529        des_xmlHashTablePtr(n_table, table, 0);
9530        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9531        des_userdata(n_userdata, userdata, 2);
9532        xmlResetLastError();
9533        if (mem_base != xmlMemBlocks()) {
9534            printf("Leak of %d blocks found in xmlHashAddEntry",
9535	           xmlMemBlocks() - mem_base);
9536	    test_ret++;
9537            printf(" %d", n_table);
9538            printf(" %d", n_name);
9539            printf(" %d", n_userdata);
9540            printf("\n");
9541        }
9542    }
9543    }
9544    }
9545    function_tests++;
9546
9547    return(test_ret);
9548}
9549
9550
9551static int
9552test_xmlHashAddEntry2(void) {
9553    int test_ret = 0;
9554
9555    int mem_base;
9556    int ret_val;
9557    xmlHashTablePtr table; /* the hash table */
9558    int n_table;
9559    xmlChar * name; /* the name of the userdata */
9560    int n_name;
9561    xmlChar * name2; /* a second name of the userdata */
9562    int n_name2;
9563    void * userdata; /* a pointer to the userdata */
9564    int n_userdata;
9565
9566    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9567    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9568    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9569    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9570        mem_base = xmlMemBlocks();
9571        table = gen_xmlHashTablePtr(n_table, 0);
9572        name = gen_const_xmlChar_ptr(n_name, 1);
9573        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9574        userdata = gen_userdata(n_userdata, 3);
9575
9576        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9577        desret_int(ret_val);
9578        call_tests++;
9579        des_xmlHashTablePtr(n_table, table, 0);
9580        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9581        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9582        des_userdata(n_userdata, userdata, 3);
9583        xmlResetLastError();
9584        if (mem_base != xmlMemBlocks()) {
9585            printf("Leak of %d blocks found in xmlHashAddEntry2",
9586	           xmlMemBlocks() - mem_base);
9587	    test_ret++;
9588            printf(" %d", n_table);
9589            printf(" %d", n_name);
9590            printf(" %d", n_name2);
9591            printf(" %d", n_userdata);
9592            printf("\n");
9593        }
9594    }
9595    }
9596    }
9597    }
9598    function_tests++;
9599
9600    return(test_ret);
9601}
9602
9603
9604static int
9605test_xmlHashAddEntry3(void) {
9606    int test_ret = 0;
9607
9608    int mem_base;
9609    int ret_val;
9610    xmlHashTablePtr table; /* the hash table */
9611    int n_table;
9612    xmlChar * name; /* the name of the userdata */
9613    int n_name;
9614    xmlChar * name2; /* a second name of the userdata */
9615    int n_name2;
9616    xmlChar * name3; /* a third name of the userdata */
9617    int n_name3;
9618    void * userdata; /* a pointer to the userdata */
9619    int n_userdata;
9620
9621    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9622    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9623    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9624    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9625    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9626        mem_base = xmlMemBlocks();
9627        table = gen_xmlHashTablePtr(n_table, 0);
9628        name = gen_const_xmlChar_ptr(n_name, 1);
9629        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9630        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9631        userdata = gen_userdata(n_userdata, 4);
9632
9633        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9634        desret_int(ret_val);
9635        call_tests++;
9636        des_xmlHashTablePtr(n_table, table, 0);
9637        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9638        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9639        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9640        des_userdata(n_userdata, userdata, 4);
9641        xmlResetLastError();
9642        if (mem_base != xmlMemBlocks()) {
9643            printf("Leak of %d blocks found in xmlHashAddEntry3",
9644	           xmlMemBlocks() - mem_base);
9645	    test_ret++;
9646            printf(" %d", n_table);
9647            printf(" %d", n_name);
9648            printf(" %d", n_name2);
9649            printf(" %d", n_name3);
9650            printf(" %d", n_userdata);
9651            printf("\n");
9652        }
9653    }
9654    }
9655    }
9656    }
9657    }
9658    function_tests++;
9659
9660    return(test_ret);
9661}
9662
9663
9664static int
9665test_xmlHashCopy(void) {
9666    int test_ret = 0;
9667
9668
9669    /* missing type support */
9670    return(test_ret);
9671}
9672
9673
9674static int
9675test_xmlHashCreate(void) {
9676    int test_ret = 0;
9677
9678
9679    /* missing type support */
9680    return(test_ret);
9681}
9682
9683
9684static int
9685test_xmlHashCreateDict(void) {
9686    int test_ret = 0;
9687
9688
9689    /* missing type support */
9690    return(test_ret);
9691}
9692
9693
9694static int
9695test_xmlHashLookup(void) {
9696    int test_ret = 0;
9697
9698    int mem_base;
9699    void * ret_val;
9700    xmlHashTablePtr table; /* the hash table */
9701    int n_table;
9702    xmlChar * name; /* the name of the userdata */
9703    int n_name;
9704
9705    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9706    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9707        mem_base = xmlMemBlocks();
9708        table = gen_xmlHashTablePtr(n_table, 0);
9709        name = gen_const_xmlChar_ptr(n_name, 1);
9710
9711        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9712        desret_void_ptr(ret_val);
9713        call_tests++;
9714        des_xmlHashTablePtr(n_table, table, 0);
9715        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9716        xmlResetLastError();
9717        if (mem_base != xmlMemBlocks()) {
9718            printf("Leak of %d blocks found in xmlHashLookup",
9719	           xmlMemBlocks() - mem_base);
9720	    test_ret++;
9721            printf(" %d", n_table);
9722            printf(" %d", n_name);
9723            printf("\n");
9724        }
9725    }
9726    }
9727    function_tests++;
9728
9729    return(test_ret);
9730}
9731
9732
9733static int
9734test_xmlHashLookup2(void) {
9735    int test_ret = 0;
9736
9737    int mem_base;
9738    void * ret_val;
9739    xmlHashTablePtr table; /* the hash table */
9740    int n_table;
9741    xmlChar * name; /* the name of the userdata */
9742    int n_name;
9743    xmlChar * name2; /* a second name of the userdata */
9744    int n_name2;
9745
9746    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9747    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9748    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9749        mem_base = xmlMemBlocks();
9750        table = gen_xmlHashTablePtr(n_table, 0);
9751        name = gen_const_xmlChar_ptr(n_name, 1);
9752        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9753
9754        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9755        desret_void_ptr(ret_val);
9756        call_tests++;
9757        des_xmlHashTablePtr(n_table, table, 0);
9758        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9759        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9760        xmlResetLastError();
9761        if (mem_base != xmlMemBlocks()) {
9762            printf("Leak of %d blocks found in xmlHashLookup2",
9763	           xmlMemBlocks() - mem_base);
9764	    test_ret++;
9765            printf(" %d", n_table);
9766            printf(" %d", n_name);
9767            printf(" %d", n_name2);
9768            printf("\n");
9769        }
9770    }
9771    }
9772    }
9773    function_tests++;
9774
9775    return(test_ret);
9776}
9777
9778
9779static int
9780test_xmlHashLookup3(void) {
9781    int test_ret = 0;
9782
9783    int mem_base;
9784    void * ret_val;
9785    xmlHashTablePtr table; /* the hash table */
9786    int n_table;
9787    xmlChar * name; /* the name of the userdata */
9788    int n_name;
9789    xmlChar * name2; /* a second name of the userdata */
9790    int n_name2;
9791    xmlChar * name3; /* a third name of the userdata */
9792    int n_name3;
9793
9794    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9795    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9796    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9797    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9798        mem_base = xmlMemBlocks();
9799        table = gen_xmlHashTablePtr(n_table, 0);
9800        name = gen_const_xmlChar_ptr(n_name, 1);
9801        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9802        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9803
9804        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
9805        desret_void_ptr(ret_val);
9806        call_tests++;
9807        des_xmlHashTablePtr(n_table, table, 0);
9808        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9809        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9810        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9811        xmlResetLastError();
9812        if (mem_base != xmlMemBlocks()) {
9813            printf("Leak of %d blocks found in xmlHashLookup3",
9814	           xmlMemBlocks() - mem_base);
9815	    test_ret++;
9816            printf(" %d", n_table);
9817            printf(" %d", n_name);
9818            printf(" %d", n_name2);
9819            printf(" %d", n_name3);
9820            printf("\n");
9821        }
9822    }
9823    }
9824    }
9825    }
9826    function_tests++;
9827
9828    return(test_ret);
9829}
9830
9831
9832static int
9833test_xmlHashQLookup(void) {
9834    int test_ret = 0;
9835
9836    int mem_base;
9837    void * ret_val;
9838    xmlHashTablePtr table; /* the hash table */
9839    int n_table;
9840    xmlChar * prefix; /* the prefix of the userdata */
9841    int n_prefix;
9842    xmlChar * name; /* the name of the userdata */
9843    int n_name;
9844
9845    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9846    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9847    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9848        mem_base = xmlMemBlocks();
9849        table = gen_xmlHashTablePtr(n_table, 0);
9850        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9851        name = gen_const_xmlChar_ptr(n_name, 2);
9852
9853        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
9854        desret_void_ptr(ret_val);
9855        call_tests++;
9856        des_xmlHashTablePtr(n_table, table, 0);
9857        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9858        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9859        xmlResetLastError();
9860        if (mem_base != xmlMemBlocks()) {
9861            printf("Leak of %d blocks found in xmlHashQLookup",
9862	           xmlMemBlocks() - mem_base);
9863	    test_ret++;
9864            printf(" %d", n_table);
9865            printf(" %d", n_prefix);
9866            printf(" %d", n_name);
9867            printf("\n");
9868        }
9869    }
9870    }
9871    }
9872    function_tests++;
9873
9874    return(test_ret);
9875}
9876
9877
9878static int
9879test_xmlHashQLookup2(void) {
9880    int test_ret = 0;
9881
9882    int mem_base;
9883    void * ret_val;
9884    xmlHashTablePtr table; /* the hash table */
9885    int n_table;
9886    xmlChar * prefix; /* the prefix of the userdata */
9887    int n_prefix;
9888    xmlChar * name; /* the name of the userdata */
9889    int n_name;
9890    xmlChar * prefix2; /* the second prefix of the userdata */
9891    int n_prefix2;
9892    xmlChar * name2; /* a second name of the userdata */
9893    int n_name2;
9894
9895    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9896    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9897    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9898    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9899    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9900        mem_base = xmlMemBlocks();
9901        table = gen_xmlHashTablePtr(n_table, 0);
9902        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9903        name = gen_const_xmlChar_ptr(n_name, 2);
9904        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9905        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9906
9907        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
9908        desret_void_ptr(ret_val);
9909        call_tests++;
9910        des_xmlHashTablePtr(n_table, table, 0);
9911        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9912        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9913        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9914        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9915        xmlResetLastError();
9916        if (mem_base != xmlMemBlocks()) {
9917            printf("Leak of %d blocks found in xmlHashQLookup2",
9918	           xmlMemBlocks() - mem_base);
9919	    test_ret++;
9920            printf(" %d", n_table);
9921            printf(" %d", n_prefix);
9922            printf(" %d", n_name);
9923            printf(" %d", n_prefix2);
9924            printf(" %d", n_name2);
9925            printf("\n");
9926        }
9927    }
9928    }
9929    }
9930    }
9931    }
9932    function_tests++;
9933
9934    return(test_ret);
9935}
9936
9937
9938static int
9939test_xmlHashQLookup3(void) {
9940    int test_ret = 0;
9941
9942    int mem_base;
9943    void * ret_val;
9944    xmlHashTablePtr table; /* the hash table */
9945    int n_table;
9946    xmlChar * prefix; /* the prefix of the userdata */
9947    int n_prefix;
9948    xmlChar * name; /* the name of the userdata */
9949    int n_name;
9950    xmlChar * prefix2; /* the second prefix of the userdata */
9951    int n_prefix2;
9952    xmlChar * name2; /* a second name of the userdata */
9953    int n_name2;
9954    xmlChar * prefix3; /* the third prefix of the userdata */
9955    int n_prefix3;
9956    xmlChar * name3; /* a third name of the userdata */
9957    int n_name3;
9958
9959    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9960    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9961    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9962    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9963    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9964    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
9965    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9966        mem_base = xmlMemBlocks();
9967        table = gen_xmlHashTablePtr(n_table, 0);
9968        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9969        name = gen_const_xmlChar_ptr(n_name, 2);
9970        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9971        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9972        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
9973        name3 = gen_const_xmlChar_ptr(n_name3, 6);
9974
9975        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
9976        desret_void_ptr(ret_val);
9977        call_tests++;
9978        des_xmlHashTablePtr(n_table, table, 0);
9979        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9980        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9981        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9982        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9983        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
9984        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
9985        xmlResetLastError();
9986        if (mem_base != xmlMemBlocks()) {
9987            printf("Leak of %d blocks found in xmlHashQLookup3",
9988	           xmlMemBlocks() - mem_base);
9989	    test_ret++;
9990            printf(" %d", n_table);
9991            printf(" %d", n_prefix);
9992            printf(" %d", n_name);
9993            printf(" %d", n_prefix2);
9994            printf(" %d", n_name2);
9995            printf(" %d", n_prefix3);
9996            printf(" %d", n_name3);
9997            printf("\n");
9998        }
9999    }
10000    }
10001    }
10002    }
10003    }
10004    }
10005    }
10006    function_tests++;
10007
10008    return(test_ret);
10009}
10010
10011
10012static int
10013test_xmlHashRemoveEntry(void) {
10014    int test_ret = 0;
10015
10016    int mem_base;
10017    int ret_val;
10018    xmlHashTablePtr table; /* the hash table */
10019    int n_table;
10020    xmlChar * name; /* the name of the userdata */
10021    int n_name;
10022    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10023    int n_f;
10024
10025    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10026    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10027    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10028        mem_base = xmlMemBlocks();
10029        table = gen_xmlHashTablePtr(n_table, 0);
10030        name = gen_const_xmlChar_ptr(n_name, 1);
10031        f = gen_xmlHashDeallocator(n_f, 2);
10032
10033        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10034        desret_int(ret_val);
10035        call_tests++;
10036        des_xmlHashTablePtr(n_table, table, 0);
10037        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10038        des_xmlHashDeallocator(n_f, f, 2);
10039        xmlResetLastError();
10040        if (mem_base != xmlMemBlocks()) {
10041            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10042	           xmlMemBlocks() - mem_base);
10043	    test_ret++;
10044            printf(" %d", n_table);
10045            printf(" %d", n_name);
10046            printf(" %d", n_f);
10047            printf("\n");
10048        }
10049    }
10050    }
10051    }
10052    function_tests++;
10053
10054    return(test_ret);
10055}
10056
10057
10058static int
10059test_xmlHashRemoveEntry2(void) {
10060    int test_ret = 0;
10061
10062    int mem_base;
10063    int ret_val;
10064    xmlHashTablePtr table; /* the hash table */
10065    int n_table;
10066    xmlChar * name; /* the name of the userdata */
10067    int n_name;
10068    xmlChar * name2; /* a second name of the userdata */
10069    int n_name2;
10070    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10071    int n_f;
10072
10073    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10074    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10075    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10076    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10077        mem_base = xmlMemBlocks();
10078        table = gen_xmlHashTablePtr(n_table, 0);
10079        name = gen_const_xmlChar_ptr(n_name, 1);
10080        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10081        f = gen_xmlHashDeallocator(n_f, 3);
10082
10083        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10084        desret_int(ret_val);
10085        call_tests++;
10086        des_xmlHashTablePtr(n_table, table, 0);
10087        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10088        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10089        des_xmlHashDeallocator(n_f, f, 3);
10090        xmlResetLastError();
10091        if (mem_base != xmlMemBlocks()) {
10092            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10093	           xmlMemBlocks() - mem_base);
10094	    test_ret++;
10095            printf(" %d", n_table);
10096            printf(" %d", n_name);
10097            printf(" %d", n_name2);
10098            printf(" %d", n_f);
10099            printf("\n");
10100        }
10101    }
10102    }
10103    }
10104    }
10105    function_tests++;
10106
10107    return(test_ret);
10108}
10109
10110
10111static int
10112test_xmlHashRemoveEntry3(void) {
10113    int test_ret = 0;
10114
10115    int mem_base;
10116    int ret_val;
10117    xmlHashTablePtr table; /* the hash table */
10118    int n_table;
10119    xmlChar * name; /* the name of the userdata */
10120    int n_name;
10121    xmlChar * name2; /* a second name of the userdata */
10122    int n_name2;
10123    xmlChar * name3; /* a third name of the userdata */
10124    int n_name3;
10125    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10126    int n_f;
10127
10128    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10129    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10130    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10131    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10132    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10133        mem_base = xmlMemBlocks();
10134        table = gen_xmlHashTablePtr(n_table, 0);
10135        name = gen_const_xmlChar_ptr(n_name, 1);
10136        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10137        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10138        f = gen_xmlHashDeallocator(n_f, 4);
10139
10140        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10141        desret_int(ret_val);
10142        call_tests++;
10143        des_xmlHashTablePtr(n_table, table, 0);
10144        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10145        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10146        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10147        des_xmlHashDeallocator(n_f, f, 4);
10148        xmlResetLastError();
10149        if (mem_base != xmlMemBlocks()) {
10150            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10151	           xmlMemBlocks() - mem_base);
10152	    test_ret++;
10153            printf(" %d", n_table);
10154            printf(" %d", n_name);
10155            printf(" %d", n_name2);
10156            printf(" %d", n_name3);
10157            printf(" %d", n_f);
10158            printf("\n");
10159        }
10160    }
10161    }
10162    }
10163    }
10164    }
10165    function_tests++;
10166
10167    return(test_ret);
10168}
10169
10170
10171static int
10172test_xmlHashScan(void) {
10173    int test_ret = 0;
10174
10175
10176    /* missing type support */
10177    return(test_ret);
10178}
10179
10180
10181static int
10182test_xmlHashScan3(void) {
10183    int test_ret = 0;
10184
10185
10186    /* missing type support */
10187    return(test_ret);
10188}
10189
10190
10191static int
10192test_xmlHashScanFull(void) {
10193    int test_ret = 0;
10194
10195
10196    /* missing type support */
10197    return(test_ret);
10198}
10199
10200
10201static int
10202test_xmlHashScanFull3(void) {
10203    int test_ret = 0;
10204
10205
10206    /* missing type support */
10207    return(test_ret);
10208}
10209
10210
10211static int
10212test_xmlHashSize(void) {
10213    int test_ret = 0;
10214
10215    int mem_base;
10216    int ret_val;
10217    xmlHashTablePtr table; /* the hash table */
10218    int n_table;
10219
10220    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10221        mem_base = xmlMemBlocks();
10222        table = gen_xmlHashTablePtr(n_table, 0);
10223
10224        ret_val = xmlHashSize(table);
10225        desret_int(ret_val);
10226        call_tests++;
10227        des_xmlHashTablePtr(n_table, table, 0);
10228        xmlResetLastError();
10229        if (mem_base != xmlMemBlocks()) {
10230            printf("Leak of %d blocks found in xmlHashSize",
10231	           xmlMemBlocks() - mem_base);
10232	    test_ret++;
10233            printf(" %d", n_table);
10234            printf("\n");
10235        }
10236    }
10237    function_tests++;
10238
10239    return(test_ret);
10240}
10241
10242
10243static int
10244test_xmlHashUpdateEntry(void) {
10245    int test_ret = 0;
10246
10247    int mem_base;
10248    int ret_val;
10249    xmlHashTablePtr table; /* the hash table */
10250    int n_table;
10251    xmlChar * name; /* the name of the userdata */
10252    int n_name;
10253    void * userdata; /* a pointer to the userdata */
10254    int n_userdata;
10255    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10256    int n_f;
10257
10258    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10259    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10260    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10261    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10262        mem_base = xmlMemBlocks();
10263        table = gen_xmlHashTablePtr(n_table, 0);
10264        name = gen_const_xmlChar_ptr(n_name, 1);
10265        userdata = gen_userdata(n_userdata, 2);
10266        f = gen_xmlHashDeallocator(n_f, 3);
10267
10268        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10269        desret_int(ret_val);
10270        call_tests++;
10271        des_xmlHashTablePtr(n_table, table, 0);
10272        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10273        des_userdata(n_userdata, userdata, 2);
10274        des_xmlHashDeallocator(n_f, f, 3);
10275        xmlResetLastError();
10276        if (mem_base != xmlMemBlocks()) {
10277            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10278	           xmlMemBlocks() - mem_base);
10279	    test_ret++;
10280            printf(" %d", n_table);
10281            printf(" %d", n_name);
10282            printf(" %d", n_userdata);
10283            printf(" %d", n_f);
10284            printf("\n");
10285        }
10286    }
10287    }
10288    }
10289    }
10290    function_tests++;
10291
10292    return(test_ret);
10293}
10294
10295
10296static int
10297test_xmlHashUpdateEntry2(void) {
10298    int test_ret = 0;
10299
10300    int mem_base;
10301    int ret_val;
10302    xmlHashTablePtr table; /* the hash table */
10303    int n_table;
10304    xmlChar * name; /* the name of the userdata */
10305    int n_name;
10306    xmlChar * name2; /* a second name of the userdata */
10307    int n_name2;
10308    void * userdata; /* a pointer to the userdata */
10309    int n_userdata;
10310    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10311    int n_f;
10312
10313    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10314    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10315    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10316    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10317    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10318        mem_base = xmlMemBlocks();
10319        table = gen_xmlHashTablePtr(n_table, 0);
10320        name = gen_const_xmlChar_ptr(n_name, 1);
10321        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10322        userdata = gen_userdata(n_userdata, 3);
10323        f = gen_xmlHashDeallocator(n_f, 4);
10324
10325        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10326        desret_int(ret_val);
10327        call_tests++;
10328        des_xmlHashTablePtr(n_table, table, 0);
10329        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10330        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10331        des_userdata(n_userdata, userdata, 3);
10332        des_xmlHashDeallocator(n_f, f, 4);
10333        xmlResetLastError();
10334        if (mem_base != xmlMemBlocks()) {
10335            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10336	           xmlMemBlocks() - mem_base);
10337	    test_ret++;
10338            printf(" %d", n_table);
10339            printf(" %d", n_name);
10340            printf(" %d", n_name2);
10341            printf(" %d", n_userdata);
10342            printf(" %d", n_f);
10343            printf("\n");
10344        }
10345    }
10346    }
10347    }
10348    }
10349    }
10350    function_tests++;
10351
10352    return(test_ret);
10353}
10354
10355
10356static int
10357test_xmlHashUpdateEntry3(void) {
10358    int test_ret = 0;
10359
10360    int mem_base;
10361    int ret_val;
10362    xmlHashTablePtr table; /* the hash table */
10363    int n_table;
10364    xmlChar * name; /* the name of the userdata */
10365    int n_name;
10366    xmlChar * name2; /* a second name of the userdata */
10367    int n_name2;
10368    xmlChar * name3; /* a third name of the userdata */
10369    int n_name3;
10370    void * userdata; /* a pointer to the userdata */
10371    int n_userdata;
10372    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10373    int n_f;
10374
10375    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10376    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10377    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10378    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10379    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10380    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10381        mem_base = xmlMemBlocks();
10382        table = gen_xmlHashTablePtr(n_table, 0);
10383        name = gen_const_xmlChar_ptr(n_name, 1);
10384        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10385        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10386        userdata = gen_userdata(n_userdata, 4);
10387        f = gen_xmlHashDeallocator(n_f, 5);
10388
10389        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10390        desret_int(ret_val);
10391        call_tests++;
10392        des_xmlHashTablePtr(n_table, table, 0);
10393        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10394        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10395        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10396        des_userdata(n_userdata, userdata, 4);
10397        des_xmlHashDeallocator(n_f, f, 5);
10398        xmlResetLastError();
10399        if (mem_base != xmlMemBlocks()) {
10400            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10401	           xmlMemBlocks() - mem_base);
10402	    test_ret++;
10403            printf(" %d", n_table);
10404            printf(" %d", n_name);
10405            printf(" %d", n_name2);
10406            printf(" %d", n_name3);
10407            printf(" %d", n_userdata);
10408            printf(" %d", n_f);
10409            printf("\n");
10410        }
10411    }
10412    }
10413    }
10414    }
10415    }
10416    }
10417    function_tests++;
10418
10419    return(test_ret);
10420}
10421
10422static int
10423test_hash(void) {
10424    int test_ret = 0;
10425
10426    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10427    test_ret += test_xmlHashAddEntry();
10428    test_ret += test_xmlHashAddEntry2();
10429    test_ret += test_xmlHashAddEntry3();
10430    test_ret += test_xmlHashCopy();
10431    test_ret += test_xmlHashCreate();
10432    test_ret += test_xmlHashCreateDict();
10433    test_ret += test_xmlHashLookup();
10434    test_ret += test_xmlHashLookup2();
10435    test_ret += test_xmlHashLookup3();
10436    test_ret += test_xmlHashQLookup();
10437    test_ret += test_xmlHashQLookup2();
10438    test_ret += test_xmlHashQLookup3();
10439    test_ret += test_xmlHashRemoveEntry();
10440    test_ret += test_xmlHashRemoveEntry2();
10441    test_ret += test_xmlHashRemoveEntry3();
10442    test_ret += test_xmlHashScan();
10443    test_ret += test_xmlHashScan3();
10444    test_ret += test_xmlHashScanFull();
10445    test_ret += test_xmlHashScanFull3();
10446    test_ret += test_xmlHashSize();
10447    test_ret += test_xmlHashUpdateEntry();
10448    test_ret += test_xmlHashUpdateEntry2();
10449    test_ret += test_xmlHashUpdateEntry3();
10450
10451    if (test_ret != 0)
10452	printf("Module hash: %d errors\n", test_ret);
10453    return(test_ret);
10454}
10455
10456#define gen_nb_xmlLinkPtr 1
10457static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10458    return(NULL);
10459}
10460static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10461}
10462
10463static int
10464test_xmlLinkGetData(void) {
10465    int test_ret = 0;
10466
10467    int mem_base;
10468    void * ret_val;
10469    xmlLinkPtr lk; /* a link */
10470    int n_lk;
10471
10472    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10473        mem_base = xmlMemBlocks();
10474        lk = gen_xmlLinkPtr(n_lk, 0);
10475
10476        ret_val = xmlLinkGetData(lk);
10477        desret_void_ptr(ret_val);
10478        call_tests++;
10479        des_xmlLinkPtr(n_lk, lk, 0);
10480        xmlResetLastError();
10481        if (mem_base != xmlMemBlocks()) {
10482            printf("Leak of %d blocks found in xmlLinkGetData",
10483	           xmlMemBlocks() - mem_base);
10484	    test_ret++;
10485            printf(" %d", n_lk);
10486            printf("\n");
10487        }
10488    }
10489    function_tests++;
10490
10491    return(test_ret);
10492}
10493
10494
10495static int
10496test_xmlListAppend(void) {
10497    int test_ret = 0;
10498
10499    int mem_base;
10500    int ret_val;
10501    xmlListPtr l; /* a list */
10502    int n_l;
10503    void * data; /* the data */
10504    int n_data;
10505
10506    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10507    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10508        mem_base = xmlMemBlocks();
10509        l = gen_xmlListPtr(n_l, 0);
10510        data = gen_userdata(n_data, 1);
10511
10512        ret_val = xmlListAppend(l, data);
10513        desret_int(ret_val);
10514        call_tests++;
10515        des_xmlListPtr(n_l, l, 0);
10516        des_userdata(n_data, data, 1);
10517        xmlResetLastError();
10518        if (mem_base != xmlMemBlocks()) {
10519            printf("Leak of %d blocks found in xmlListAppend",
10520	           xmlMemBlocks() - mem_base);
10521	    test_ret++;
10522            printf(" %d", n_l);
10523            printf(" %d", n_data);
10524            printf("\n");
10525        }
10526    }
10527    }
10528    function_tests++;
10529
10530    return(test_ret);
10531}
10532
10533
10534static int
10535test_xmlListClear(void) {
10536    int test_ret = 0;
10537
10538    int mem_base;
10539    xmlListPtr l; /* a list */
10540    int n_l;
10541
10542    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10543        mem_base = xmlMemBlocks();
10544        l = gen_xmlListPtr(n_l, 0);
10545
10546        xmlListClear(l);
10547        call_tests++;
10548        des_xmlListPtr(n_l, l, 0);
10549        xmlResetLastError();
10550        if (mem_base != xmlMemBlocks()) {
10551            printf("Leak of %d blocks found in xmlListClear",
10552	           xmlMemBlocks() - mem_base);
10553	    test_ret++;
10554            printf(" %d", n_l);
10555            printf("\n");
10556        }
10557    }
10558    function_tests++;
10559
10560    return(test_ret);
10561}
10562
10563
10564#define gen_nb_const_xmlListPtr 1
10565static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10566    return(NULL);
10567}
10568static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10569}
10570
10571static int
10572test_xmlListCopy(void) {
10573    int test_ret = 0;
10574
10575    int mem_base;
10576    int ret_val;
10577    xmlListPtr cur; /* the new list */
10578    int n_cur;
10579    xmlListPtr old; /* the old list */
10580    int n_old;
10581
10582    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10583    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10584        mem_base = xmlMemBlocks();
10585        cur = gen_xmlListPtr(n_cur, 0);
10586        old = gen_const_xmlListPtr(n_old, 1);
10587
10588        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10589        desret_int(ret_val);
10590        call_tests++;
10591        des_xmlListPtr(n_cur, cur, 0);
10592        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10593        xmlResetLastError();
10594        if (mem_base != xmlMemBlocks()) {
10595            printf("Leak of %d blocks found in xmlListCopy",
10596	           xmlMemBlocks() - mem_base);
10597	    test_ret++;
10598            printf(" %d", n_cur);
10599            printf(" %d", n_old);
10600            printf("\n");
10601        }
10602    }
10603    }
10604    function_tests++;
10605
10606    return(test_ret);
10607}
10608
10609
10610static int
10611test_xmlListCreate(void) {
10612    int test_ret = 0;
10613
10614
10615    /* missing type support */
10616    return(test_ret);
10617}
10618
10619
10620static int
10621test_xmlListDup(void) {
10622    int test_ret = 0;
10623
10624
10625    /* missing type support */
10626    return(test_ret);
10627}
10628
10629
10630static int
10631test_xmlListEmpty(void) {
10632    int test_ret = 0;
10633
10634    int mem_base;
10635    int ret_val;
10636    xmlListPtr l; /* a list */
10637    int n_l;
10638
10639    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10640        mem_base = xmlMemBlocks();
10641        l = gen_xmlListPtr(n_l, 0);
10642
10643        ret_val = xmlListEmpty(l);
10644        desret_int(ret_val);
10645        call_tests++;
10646        des_xmlListPtr(n_l, l, 0);
10647        xmlResetLastError();
10648        if (mem_base != xmlMemBlocks()) {
10649            printf("Leak of %d blocks found in xmlListEmpty",
10650	           xmlMemBlocks() - mem_base);
10651	    test_ret++;
10652            printf(" %d", n_l);
10653            printf("\n");
10654        }
10655    }
10656    function_tests++;
10657
10658    return(test_ret);
10659}
10660
10661
10662static int
10663test_xmlListEnd(void) {
10664    int test_ret = 0;
10665
10666
10667    /* missing type support */
10668    return(test_ret);
10669}
10670
10671
10672static int
10673test_xmlListFront(void) {
10674    int test_ret = 0;
10675
10676
10677    /* missing type support */
10678    return(test_ret);
10679}
10680
10681
10682static int
10683test_xmlListInsert(void) {
10684    int test_ret = 0;
10685
10686    int mem_base;
10687    int ret_val;
10688    xmlListPtr l; /* a list */
10689    int n_l;
10690    void * data; /* the data */
10691    int n_data;
10692
10693    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10694    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10695        mem_base = xmlMemBlocks();
10696        l = gen_xmlListPtr(n_l, 0);
10697        data = gen_userdata(n_data, 1);
10698
10699        ret_val = xmlListInsert(l, data);
10700        desret_int(ret_val);
10701        call_tests++;
10702        des_xmlListPtr(n_l, l, 0);
10703        des_userdata(n_data, data, 1);
10704        xmlResetLastError();
10705        if (mem_base != xmlMemBlocks()) {
10706            printf("Leak of %d blocks found in xmlListInsert",
10707	           xmlMemBlocks() - mem_base);
10708	    test_ret++;
10709            printf(" %d", n_l);
10710            printf(" %d", n_data);
10711            printf("\n");
10712        }
10713    }
10714    }
10715    function_tests++;
10716
10717    return(test_ret);
10718}
10719
10720
10721static int
10722test_xmlListMerge(void) {
10723    int test_ret = 0;
10724
10725    int mem_base;
10726    xmlListPtr l1; /* the original list */
10727    int n_l1;
10728    xmlListPtr l2; /* the new list */
10729    int n_l2;
10730
10731    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10732    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10733        mem_base = xmlMemBlocks();
10734        l1 = gen_xmlListPtr(n_l1, 0);
10735        l2 = gen_xmlListPtr(n_l2, 1);
10736
10737        xmlListMerge(l1, l2);
10738        call_tests++;
10739        des_xmlListPtr(n_l1, l1, 0);
10740        des_xmlListPtr(n_l2, l2, 1);
10741        xmlResetLastError();
10742        if (mem_base != xmlMemBlocks()) {
10743            printf("Leak of %d blocks found in xmlListMerge",
10744	           xmlMemBlocks() - mem_base);
10745	    test_ret++;
10746            printf(" %d", n_l1);
10747            printf(" %d", n_l2);
10748            printf("\n");
10749        }
10750    }
10751    }
10752    function_tests++;
10753
10754    return(test_ret);
10755}
10756
10757
10758static int
10759test_xmlListPopBack(void) {
10760    int test_ret = 0;
10761
10762    int mem_base;
10763    xmlListPtr l; /* a list */
10764    int n_l;
10765
10766    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10767        mem_base = xmlMemBlocks();
10768        l = gen_xmlListPtr(n_l, 0);
10769
10770        xmlListPopBack(l);
10771        call_tests++;
10772        des_xmlListPtr(n_l, l, 0);
10773        xmlResetLastError();
10774        if (mem_base != xmlMemBlocks()) {
10775            printf("Leak of %d blocks found in xmlListPopBack",
10776	           xmlMemBlocks() - mem_base);
10777	    test_ret++;
10778            printf(" %d", n_l);
10779            printf("\n");
10780        }
10781    }
10782    function_tests++;
10783
10784    return(test_ret);
10785}
10786
10787
10788static int
10789test_xmlListPopFront(void) {
10790    int test_ret = 0;
10791
10792    int mem_base;
10793    xmlListPtr l; /* a list */
10794    int n_l;
10795
10796    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10797        mem_base = xmlMemBlocks();
10798        l = gen_xmlListPtr(n_l, 0);
10799
10800        xmlListPopFront(l);
10801        call_tests++;
10802        des_xmlListPtr(n_l, l, 0);
10803        xmlResetLastError();
10804        if (mem_base != xmlMemBlocks()) {
10805            printf("Leak of %d blocks found in xmlListPopFront",
10806	           xmlMemBlocks() - mem_base);
10807	    test_ret++;
10808            printf(" %d", n_l);
10809            printf("\n");
10810        }
10811    }
10812    function_tests++;
10813
10814    return(test_ret);
10815}
10816
10817
10818static int
10819test_xmlListPushBack(void) {
10820    int test_ret = 0;
10821
10822    int mem_base;
10823    int ret_val;
10824    xmlListPtr l; /* a list */
10825    int n_l;
10826    void * data; /* new data */
10827    int n_data;
10828
10829    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10830    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10831        mem_base = xmlMemBlocks();
10832        l = gen_xmlListPtr(n_l, 0);
10833        data = gen_userdata(n_data, 1);
10834
10835        ret_val = xmlListPushBack(l, data);
10836        desret_int(ret_val);
10837        call_tests++;
10838        des_xmlListPtr(n_l, l, 0);
10839        des_userdata(n_data, data, 1);
10840        xmlResetLastError();
10841        if (mem_base != xmlMemBlocks()) {
10842            printf("Leak of %d blocks found in xmlListPushBack",
10843	           xmlMemBlocks() - mem_base);
10844	    test_ret++;
10845            printf(" %d", n_l);
10846            printf(" %d", n_data);
10847            printf("\n");
10848        }
10849    }
10850    }
10851    function_tests++;
10852
10853    return(test_ret);
10854}
10855
10856
10857static int
10858test_xmlListPushFront(void) {
10859    int test_ret = 0;
10860
10861    int mem_base;
10862    int ret_val;
10863    xmlListPtr l; /* a list */
10864    int n_l;
10865    void * data; /* new data */
10866    int n_data;
10867
10868    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10869    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10870        mem_base = xmlMemBlocks();
10871        l = gen_xmlListPtr(n_l, 0);
10872        data = gen_userdata(n_data, 1);
10873
10874        ret_val = xmlListPushFront(l, data);
10875        desret_int(ret_val);
10876        call_tests++;
10877        des_xmlListPtr(n_l, l, 0);
10878        des_userdata(n_data, data, 1);
10879        xmlResetLastError();
10880        if (mem_base != xmlMemBlocks()) {
10881            printf("Leak of %d blocks found in xmlListPushFront",
10882	           xmlMemBlocks() - mem_base);
10883	    test_ret++;
10884            printf(" %d", n_l);
10885            printf(" %d", n_data);
10886            printf("\n");
10887        }
10888    }
10889    }
10890    function_tests++;
10891
10892    return(test_ret);
10893}
10894
10895
10896static int
10897test_xmlListRemoveAll(void) {
10898    int test_ret = 0;
10899
10900    int mem_base;
10901    int ret_val;
10902    xmlListPtr l; /* a list */
10903    int n_l;
10904    void * data; /* list data */
10905    int n_data;
10906
10907    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10908    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10909        mem_base = xmlMemBlocks();
10910        l = gen_xmlListPtr(n_l, 0);
10911        data = gen_userdata(n_data, 1);
10912
10913        ret_val = xmlListRemoveAll(l, data);
10914        desret_int(ret_val);
10915        call_tests++;
10916        des_xmlListPtr(n_l, l, 0);
10917        des_userdata(n_data, data, 1);
10918        xmlResetLastError();
10919        if (mem_base != xmlMemBlocks()) {
10920            printf("Leak of %d blocks found in xmlListRemoveAll",
10921	           xmlMemBlocks() - mem_base);
10922	    test_ret++;
10923            printf(" %d", n_l);
10924            printf(" %d", n_data);
10925            printf("\n");
10926        }
10927    }
10928    }
10929    function_tests++;
10930
10931    return(test_ret);
10932}
10933
10934
10935static int
10936test_xmlListRemoveFirst(void) {
10937    int test_ret = 0;
10938
10939    int mem_base;
10940    int ret_val;
10941    xmlListPtr l; /* a list */
10942    int n_l;
10943    void * data; /* list data */
10944    int n_data;
10945
10946    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10947    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10948        mem_base = xmlMemBlocks();
10949        l = gen_xmlListPtr(n_l, 0);
10950        data = gen_userdata(n_data, 1);
10951
10952        ret_val = xmlListRemoveFirst(l, data);
10953        desret_int(ret_val);
10954        call_tests++;
10955        des_xmlListPtr(n_l, l, 0);
10956        des_userdata(n_data, data, 1);
10957        xmlResetLastError();
10958        if (mem_base != xmlMemBlocks()) {
10959            printf("Leak of %d blocks found in xmlListRemoveFirst",
10960	           xmlMemBlocks() - mem_base);
10961	    test_ret++;
10962            printf(" %d", n_l);
10963            printf(" %d", n_data);
10964            printf("\n");
10965        }
10966    }
10967    }
10968    function_tests++;
10969
10970    return(test_ret);
10971}
10972
10973
10974static int
10975test_xmlListRemoveLast(void) {
10976    int test_ret = 0;
10977
10978    int mem_base;
10979    int ret_val;
10980    xmlListPtr l; /* a list */
10981    int n_l;
10982    void * data; /* list data */
10983    int n_data;
10984
10985    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10986    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10987        mem_base = xmlMemBlocks();
10988        l = gen_xmlListPtr(n_l, 0);
10989        data = gen_userdata(n_data, 1);
10990
10991        ret_val = xmlListRemoveLast(l, data);
10992        desret_int(ret_val);
10993        call_tests++;
10994        des_xmlListPtr(n_l, l, 0);
10995        des_userdata(n_data, data, 1);
10996        xmlResetLastError();
10997        if (mem_base != xmlMemBlocks()) {
10998            printf("Leak of %d blocks found in xmlListRemoveLast",
10999	           xmlMemBlocks() - mem_base);
11000	    test_ret++;
11001            printf(" %d", n_l);
11002            printf(" %d", n_data);
11003            printf("\n");
11004        }
11005    }
11006    }
11007    function_tests++;
11008
11009    return(test_ret);
11010}
11011
11012
11013static int
11014test_xmlListReverse(void) {
11015    int test_ret = 0;
11016
11017    int mem_base;
11018    xmlListPtr l; /* a list */
11019    int n_l;
11020
11021    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11022        mem_base = xmlMemBlocks();
11023        l = gen_xmlListPtr(n_l, 0);
11024
11025        xmlListReverse(l);
11026        call_tests++;
11027        des_xmlListPtr(n_l, l, 0);
11028        xmlResetLastError();
11029        if (mem_base != xmlMemBlocks()) {
11030            printf("Leak of %d blocks found in xmlListReverse",
11031	           xmlMemBlocks() - mem_base);
11032	    test_ret++;
11033            printf(" %d", n_l);
11034            printf("\n");
11035        }
11036    }
11037    function_tests++;
11038
11039    return(test_ret);
11040}
11041
11042
11043static int
11044test_xmlListReverseSearch(void) {
11045    int test_ret = 0;
11046
11047    int mem_base;
11048    void * ret_val;
11049    xmlListPtr l; /* a list */
11050    int n_l;
11051    void * data; /* a search value */
11052    int n_data;
11053
11054    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11055    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11056        mem_base = xmlMemBlocks();
11057        l = gen_xmlListPtr(n_l, 0);
11058        data = gen_userdata(n_data, 1);
11059
11060        ret_val = xmlListReverseSearch(l, data);
11061        desret_void_ptr(ret_val);
11062        call_tests++;
11063        des_xmlListPtr(n_l, l, 0);
11064        des_userdata(n_data, data, 1);
11065        xmlResetLastError();
11066        if (mem_base != xmlMemBlocks()) {
11067            printf("Leak of %d blocks found in xmlListReverseSearch",
11068	           xmlMemBlocks() - mem_base);
11069	    test_ret++;
11070            printf(" %d", n_l);
11071            printf(" %d", n_data);
11072            printf("\n");
11073        }
11074    }
11075    }
11076    function_tests++;
11077
11078    return(test_ret);
11079}
11080
11081
11082static int
11083test_xmlListReverseWalk(void) {
11084    int test_ret = 0;
11085
11086
11087    /* missing type support */
11088    return(test_ret);
11089}
11090
11091
11092static int
11093test_xmlListSearch(void) {
11094    int test_ret = 0;
11095
11096    int mem_base;
11097    void * ret_val;
11098    xmlListPtr l; /* a list */
11099    int n_l;
11100    void * data; /* a search value */
11101    int n_data;
11102
11103    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11104    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11105        mem_base = xmlMemBlocks();
11106        l = gen_xmlListPtr(n_l, 0);
11107        data = gen_userdata(n_data, 1);
11108
11109        ret_val = xmlListSearch(l, data);
11110        desret_void_ptr(ret_val);
11111        call_tests++;
11112        des_xmlListPtr(n_l, l, 0);
11113        des_userdata(n_data, data, 1);
11114        xmlResetLastError();
11115        if (mem_base != xmlMemBlocks()) {
11116            printf("Leak of %d blocks found in xmlListSearch",
11117	           xmlMemBlocks() - mem_base);
11118	    test_ret++;
11119            printf(" %d", n_l);
11120            printf(" %d", n_data);
11121            printf("\n");
11122        }
11123    }
11124    }
11125    function_tests++;
11126
11127    return(test_ret);
11128}
11129
11130
11131static int
11132test_xmlListSize(void) {
11133    int test_ret = 0;
11134
11135    int mem_base;
11136    int ret_val;
11137    xmlListPtr l; /* a list */
11138    int n_l;
11139
11140    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11141        mem_base = xmlMemBlocks();
11142        l = gen_xmlListPtr(n_l, 0);
11143
11144        ret_val = xmlListSize(l);
11145        desret_int(ret_val);
11146        call_tests++;
11147        des_xmlListPtr(n_l, l, 0);
11148        xmlResetLastError();
11149        if (mem_base != xmlMemBlocks()) {
11150            printf("Leak of %d blocks found in xmlListSize",
11151	           xmlMemBlocks() - mem_base);
11152	    test_ret++;
11153            printf(" %d", n_l);
11154            printf("\n");
11155        }
11156    }
11157    function_tests++;
11158
11159    return(test_ret);
11160}
11161
11162
11163static int
11164test_xmlListSort(void) {
11165    int test_ret = 0;
11166
11167    int mem_base;
11168    xmlListPtr l; /* a list */
11169    int n_l;
11170
11171    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11172        mem_base = xmlMemBlocks();
11173        l = gen_xmlListPtr(n_l, 0);
11174
11175        xmlListSort(l);
11176        call_tests++;
11177        des_xmlListPtr(n_l, l, 0);
11178        xmlResetLastError();
11179        if (mem_base != xmlMemBlocks()) {
11180            printf("Leak of %d blocks found in xmlListSort",
11181	           xmlMemBlocks() - mem_base);
11182	    test_ret++;
11183            printf(" %d", n_l);
11184            printf("\n");
11185        }
11186    }
11187    function_tests++;
11188
11189    return(test_ret);
11190}
11191
11192
11193static int
11194test_xmlListWalk(void) {
11195    int test_ret = 0;
11196
11197
11198    /* missing type support */
11199    return(test_ret);
11200}
11201
11202static int
11203test_list(void) {
11204    int test_ret = 0;
11205
11206    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11207    test_ret += test_xmlLinkGetData();
11208    test_ret += test_xmlListAppend();
11209    test_ret += test_xmlListClear();
11210    test_ret += test_xmlListCopy();
11211    test_ret += test_xmlListCreate();
11212    test_ret += test_xmlListDup();
11213    test_ret += test_xmlListEmpty();
11214    test_ret += test_xmlListEnd();
11215    test_ret += test_xmlListFront();
11216    test_ret += test_xmlListInsert();
11217    test_ret += test_xmlListMerge();
11218    test_ret += test_xmlListPopBack();
11219    test_ret += test_xmlListPopFront();
11220    test_ret += test_xmlListPushBack();
11221    test_ret += test_xmlListPushFront();
11222    test_ret += test_xmlListRemoveAll();
11223    test_ret += test_xmlListRemoveFirst();
11224    test_ret += test_xmlListRemoveLast();
11225    test_ret += test_xmlListReverse();
11226    test_ret += test_xmlListReverseSearch();
11227    test_ret += test_xmlListReverseWalk();
11228    test_ret += test_xmlListSearch();
11229    test_ret += test_xmlListSize();
11230    test_ret += test_xmlListSort();
11231    test_ret += test_xmlListWalk();
11232
11233    if (test_ret != 0)
11234	printf("Module list: %d errors\n", test_ret);
11235    return(test_ret);
11236}
11237
11238static int
11239test_xmlNanoFTPCheckResponse(void) {
11240    int test_ret = 0;
11241
11242#if defined(LIBXML_FTP_ENABLED)
11243    int mem_base;
11244    int ret_val;
11245    void * ctx; /* an FTP context */
11246    int n_ctx;
11247
11248    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11249        mem_base = xmlMemBlocks();
11250        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11251
11252        ret_val = xmlNanoFTPCheckResponse(ctx);
11253        desret_int(ret_val);
11254        call_tests++;
11255        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11256        xmlResetLastError();
11257        if (mem_base != xmlMemBlocks()) {
11258            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11259	           xmlMemBlocks() - mem_base);
11260	    test_ret++;
11261            printf(" %d", n_ctx);
11262            printf("\n");
11263        }
11264    }
11265    function_tests++;
11266#endif
11267
11268    return(test_ret);
11269}
11270
11271
11272static int
11273test_xmlNanoFTPCleanup(void) {
11274    int test_ret = 0;
11275
11276#if defined(LIBXML_FTP_ENABLED)
11277    int mem_base;
11278
11279        mem_base = xmlMemBlocks();
11280
11281        xmlNanoFTPCleanup();
11282        call_tests++;
11283        xmlResetLastError();
11284        if (mem_base != xmlMemBlocks()) {
11285            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11286	           xmlMemBlocks() - mem_base);
11287	    test_ret++;
11288            printf("\n");
11289        }
11290    function_tests++;
11291#endif
11292
11293    return(test_ret);
11294}
11295
11296
11297static int
11298test_xmlNanoFTPCloseConnection(void) {
11299    int test_ret = 0;
11300
11301#if defined(LIBXML_FTP_ENABLED)
11302    int mem_base;
11303    int ret_val;
11304    void * ctx; /* an FTP context */
11305    int n_ctx;
11306
11307    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11308        mem_base = xmlMemBlocks();
11309        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11310
11311        ret_val = xmlNanoFTPCloseConnection(ctx);
11312        desret_int(ret_val);
11313        call_tests++;
11314        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11315        xmlResetLastError();
11316        if (mem_base != xmlMemBlocks()) {
11317            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11318	           xmlMemBlocks() - mem_base);
11319	    test_ret++;
11320            printf(" %d", n_ctx);
11321            printf("\n");
11322        }
11323    }
11324    function_tests++;
11325#endif
11326
11327    return(test_ret);
11328}
11329
11330
11331static int
11332test_xmlNanoFTPCwd(void) {
11333    int test_ret = 0;
11334
11335#if defined(LIBXML_FTP_ENABLED)
11336    int mem_base;
11337    int ret_val;
11338    void * ctx; /* an FTP context */
11339    int n_ctx;
11340    char * directory; /* a directory on the server */
11341    int n_directory;
11342
11343    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11344    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11345        mem_base = xmlMemBlocks();
11346        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11347        directory = gen_const_char_ptr(n_directory, 1);
11348
11349        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11350        desret_int(ret_val);
11351        call_tests++;
11352        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11353        des_const_char_ptr(n_directory, (const char *)directory, 1);
11354        xmlResetLastError();
11355        if (mem_base != xmlMemBlocks()) {
11356            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11357	           xmlMemBlocks() - mem_base);
11358	    test_ret++;
11359            printf(" %d", n_ctx);
11360            printf(" %d", n_directory);
11361            printf("\n");
11362        }
11363    }
11364    }
11365    function_tests++;
11366#endif
11367
11368    return(test_ret);
11369}
11370
11371
11372static int
11373test_xmlNanoFTPDele(void) {
11374    int test_ret = 0;
11375
11376#if defined(LIBXML_FTP_ENABLED)
11377    int mem_base;
11378    int ret_val;
11379    void * ctx; /* an FTP context */
11380    int n_ctx;
11381    const char * file; /* a file or directory on the server */
11382    int n_file;
11383
11384    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11385    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11386        mem_base = xmlMemBlocks();
11387        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11388        file = gen_filepath(n_file, 1);
11389
11390        ret_val = xmlNanoFTPDele(ctx, file);
11391        desret_int(ret_val);
11392        call_tests++;
11393        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11394        des_filepath(n_file, file, 1);
11395        xmlResetLastError();
11396        if (mem_base != xmlMemBlocks()) {
11397            printf("Leak of %d blocks found in xmlNanoFTPDele",
11398	           xmlMemBlocks() - mem_base);
11399	    test_ret++;
11400            printf(" %d", n_ctx);
11401            printf(" %d", n_file);
11402            printf("\n");
11403        }
11404    }
11405    }
11406    function_tests++;
11407#endif
11408
11409    return(test_ret);
11410}
11411
11412
11413static int
11414test_xmlNanoFTPGet(void) {
11415    int test_ret = 0;
11416
11417
11418    /* missing type support */
11419    return(test_ret);
11420}
11421
11422
11423static int
11424test_xmlNanoFTPGetConnection(void) {
11425    int test_ret = 0;
11426
11427#if defined(LIBXML_FTP_ENABLED)
11428    int mem_base;
11429    int ret_val;
11430    void * ctx; /* an FTP context */
11431    int n_ctx;
11432
11433    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11434        mem_base = xmlMemBlocks();
11435        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11436
11437        ret_val = xmlNanoFTPGetConnection(ctx);
11438        desret_int(ret_val);
11439        call_tests++;
11440        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11441        xmlResetLastError();
11442        if (mem_base != xmlMemBlocks()) {
11443            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11444	           xmlMemBlocks() - mem_base);
11445	    test_ret++;
11446            printf(" %d", n_ctx);
11447            printf("\n");
11448        }
11449    }
11450    function_tests++;
11451#endif
11452
11453    return(test_ret);
11454}
11455
11456
11457static int
11458test_xmlNanoFTPGetResponse(void) {
11459    int test_ret = 0;
11460
11461#if defined(LIBXML_FTP_ENABLED)
11462    int mem_base;
11463    int ret_val;
11464    void * ctx; /* an FTP context */
11465    int n_ctx;
11466
11467    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11468        mem_base = xmlMemBlocks();
11469        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11470
11471        ret_val = xmlNanoFTPGetResponse(ctx);
11472        desret_int(ret_val);
11473        call_tests++;
11474        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11475        xmlResetLastError();
11476        if (mem_base != xmlMemBlocks()) {
11477            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11478	           xmlMemBlocks() - mem_base);
11479	    test_ret++;
11480            printf(" %d", n_ctx);
11481            printf("\n");
11482        }
11483    }
11484    function_tests++;
11485#endif
11486
11487    return(test_ret);
11488}
11489
11490
11491static int
11492test_xmlNanoFTPGetSocket(void) {
11493    int test_ret = 0;
11494
11495#if defined(LIBXML_FTP_ENABLED)
11496    int mem_base;
11497    int ret_val;
11498    void * ctx; /* an FTP context */
11499    int n_ctx;
11500    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11501    int n_filename;
11502
11503    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11504    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11505        mem_base = xmlMemBlocks();
11506        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11507        filename = gen_filepath(n_filename, 1);
11508
11509        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11510        desret_int(ret_val);
11511        call_tests++;
11512        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11513        des_filepath(n_filename, filename, 1);
11514        xmlResetLastError();
11515        if (mem_base != xmlMemBlocks()) {
11516            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11517	           xmlMemBlocks() - mem_base);
11518	    test_ret++;
11519            printf(" %d", n_ctx);
11520            printf(" %d", n_filename);
11521            printf("\n");
11522        }
11523    }
11524    }
11525    function_tests++;
11526#endif
11527
11528    return(test_ret);
11529}
11530
11531
11532static int
11533test_xmlNanoFTPInit(void) {
11534    int test_ret = 0;
11535
11536#if defined(LIBXML_FTP_ENABLED)
11537    int mem_base;
11538
11539        mem_base = xmlMemBlocks();
11540
11541        xmlNanoFTPInit();
11542        call_tests++;
11543        xmlResetLastError();
11544        if (mem_base != xmlMemBlocks()) {
11545            printf("Leak of %d blocks found in xmlNanoFTPInit",
11546	           xmlMemBlocks() - mem_base);
11547	    test_ret++;
11548            printf("\n");
11549        }
11550    function_tests++;
11551#endif
11552
11553    return(test_ret);
11554}
11555
11556
11557static int
11558test_xmlNanoFTPList(void) {
11559    int test_ret = 0;
11560
11561
11562    /* missing type support */
11563    return(test_ret);
11564}
11565
11566
11567static int
11568test_xmlNanoFTPNewCtxt(void) {
11569    int test_ret = 0;
11570
11571#if defined(LIBXML_FTP_ENABLED)
11572    int mem_base;
11573    void * ret_val;
11574    const char * URL; /* The URL used to initialize the context */
11575    int n_URL;
11576
11577    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11578        mem_base = xmlMemBlocks();
11579        URL = gen_filepath(n_URL, 0);
11580
11581        ret_val = xmlNanoFTPNewCtxt(URL);
11582        desret_xmlNanoFTPCtxtPtr(ret_val);
11583        call_tests++;
11584        des_filepath(n_URL, URL, 0);
11585        xmlResetLastError();
11586        if (mem_base != xmlMemBlocks()) {
11587            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11588	           xmlMemBlocks() - mem_base);
11589	    test_ret++;
11590            printf(" %d", n_URL);
11591            printf("\n");
11592        }
11593    }
11594    function_tests++;
11595#endif
11596
11597    return(test_ret);
11598}
11599
11600
11601static int
11602test_xmlNanoFTPOpen(void) {
11603    int test_ret = 0;
11604
11605#if defined(LIBXML_FTP_ENABLED)
11606    int mem_base;
11607    void * ret_val;
11608    const char * URL; /* the URL to the resource */
11609    int n_URL;
11610
11611    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11612        mem_base = xmlMemBlocks();
11613        URL = gen_filepath(n_URL, 0);
11614
11615        ret_val = xmlNanoFTPOpen(URL);
11616        desret_xmlNanoFTPCtxtPtr(ret_val);
11617        call_tests++;
11618        des_filepath(n_URL, URL, 0);
11619        xmlResetLastError();
11620        if (mem_base != xmlMemBlocks()) {
11621            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11622	           xmlMemBlocks() - mem_base);
11623	    test_ret++;
11624            printf(" %d", n_URL);
11625            printf("\n");
11626        }
11627    }
11628    function_tests++;
11629#endif
11630
11631    return(test_ret);
11632}
11633
11634
11635static int
11636test_xmlNanoFTPProxy(void) {
11637    int test_ret = 0;
11638
11639#if defined(LIBXML_FTP_ENABLED)
11640    char * host; /* the proxy host name */
11641    int n_host;
11642    int port; /* the proxy port */
11643    int n_port;
11644    char * user; /* the proxy user name */
11645    int n_user;
11646    char * passwd; /* the proxy password */
11647    int n_passwd;
11648    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11649    int n_type;
11650
11651    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11652    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11653    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11654    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11655    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11656        host = gen_const_char_ptr(n_host, 0);
11657        port = gen_int(n_port, 1);
11658        user = gen_const_char_ptr(n_user, 2);
11659        passwd = gen_const_char_ptr(n_passwd, 3);
11660        type = gen_int(n_type, 4);
11661
11662        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11663        call_tests++;
11664        des_const_char_ptr(n_host, (const char *)host, 0);
11665        des_int(n_port, port, 1);
11666        des_const_char_ptr(n_user, (const char *)user, 2);
11667        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11668        des_int(n_type, type, 4);
11669        xmlResetLastError();
11670    }
11671    }
11672    }
11673    }
11674    }
11675    function_tests++;
11676#endif
11677
11678    return(test_ret);
11679}
11680
11681
11682static int
11683test_xmlNanoFTPQuit(void) {
11684    int test_ret = 0;
11685
11686#if defined(LIBXML_FTP_ENABLED)
11687    int mem_base;
11688    int ret_val;
11689    void * ctx; /* an FTP context */
11690    int n_ctx;
11691
11692    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11693        mem_base = xmlMemBlocks();
11694        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11695
11696        ret_val = xmlNanoFTPQuit(ctx);
11697        desret_int(ret_val);
11698        call_tests++;
11699        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11700        xmlResetLastError();
11701        if (mem_base != xmlMemBlocks()) {
11702            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11703	           xmlMemBlocks() - mem_base);
11704	    test_ret++;
11705            printf(" %d", n_ctx);
11706            printf("\n");
11707        }
11708    }
11709    function_tests++;
11710#endif
11711
11712    return(test_ret);
11713}
11714
11715
11716static int
11717test_xmlNanoFTPRead(void) {
11718    int test_ret = 0;
11719
11720#if defined(LIBXML_FTP_ENABLED)
11721    int mem_base;
11722    int ret_val;
11723    void * ctx; /* the FTP context */
11724    int n_ctx;
11725    void * dest; /* a buffer */
11726    int n_dest;
11727    int len; /* the buffer length */
11728    int n_len;
11729
11730    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11731    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11732    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11733        mem_base = xmlMemBlocks();
11734        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11735        dest = gen_void_ptr(n_dest, 1);
11736        len = gen_int(n_len, 2);
11737
11738        ret_val = xmlNanoFTPRead(ctx, dest, len);
11739        desret_int(ret_val);
11740        call_tests++;
11741        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11742        des_void_ptr(n_dest, dest, 1);
11743        des_int(n_len, len, 2);
11744        xmlResetLastError();
11745        if (mem_base != xmlMemBlocks()) {
11746            printf("Leak of %d blocks found in xmlNanoFTPRead",
11747	           xmlMemBlocks() - mem_base);
11748	    test_ret++;
11749            printf(" %d", n_ctx);
11750            printf(" %d", n_dest);
11751            printf(" %d", n_len);
11752            printf("\n");
11753        }
11754    }
11755    }
11756    }
11757    function_tests++;
11758#endif
11759
11760    return(test_ret);
11761}
11762
11763
11764static int
11765test_xmlNanoFTPScanProxy(void) {
11766    int test_ret = 0;
11767
11768#if defined(LIBXML_FTP_ENABLED)
11769    const char * URL; /* The proxy URL used to initialize the proxy context */
11770    int n_URL;
11771
11772    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11773        URL = gen_filepath(n_URL, 0);
11774
11775        xmlNanoFTPScanProxy(URL);
11776        call_tests++;
11777        des_filepath(n_URL, URL, 0);
11778        xmlResetLastError();
11779    }
11780    function_tests++;
11781#endif
11782
11783    return(test_ret);
11784}
11785
11786
11787static int
11788test_xmlNanoFTPUpdateURL(void) {
11789    int test_ret = 0;
11790
11791#if defined(LIBXML_FTP_ENABLED)
11792    int mem_base;
11793    int ret_val;
11794    void * ctx; /* an FTP context */
11795    int n_ctx;
11796    const char * URL; /* The URL used to update the context */
11797    int n_URL;
11798
11799    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11800    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11801        mem_base = xmlMemBlocks();
11802        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11803        URL = gen_filepath(n_URL, 1);
11804
11805        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11806        desret_int(ret_val);
11807        call_tests++;
11808        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11809        des_filepath(n_URL, URL, 1);
11810        xmlResetLastError();
11811        if (mem_base != xmlMemBlocks()) {
11812            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11813	           xmlMemBlocks() - mem_base);
11814	    test_ret++;
11815            printf(" %d", n_ctx);
11816            printf(" %d", n_URL);
11817            printf("\n");
11818        }
11819    }
11820    }
11821    function_tests++;
11822#endif
11823
11824    return(test_ret);
11825}
11826
11827static int
11828test_nanoftp(void) {
11829    int test_ret = 0;
11830
11831    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
11832    test_ret += test_xmlNanoFTPCheckResponse();
11833    test_ret += test_xmlNanoFTPCleanup();
11834    test_ret += test_xmlNanoFTPCloseConnection();
11835    test_ret += test_xmlNanoFTPCwd();
11836    test_ret += test_xmlNanoFTPDele();
11837    test_ret += test_xmlNanoFTPGet();
11838    test_ret += test_xmlNanoFTPGetConnection();
11839    test_ret += test_xmlNanoFTPGetResponse();
11840    test_ret += test_xmlNanoFTPGetSocket();
11841    test_ret += test_xmlNanoFTPInit();
11842    test_ret += test_xmlNanoFTPList();
11843    test_ret += test_xmlNanoFTPNewCtxt();
11844    test_ret += test_xmlNanoFTPOpen();
11845    test_ret += test_xmlNanoFTPProxy();
11846    test_ret += test_xmlNanoFTPQuit();
11847    test_ret += test_xmlNanoFTPRead();
11848    test_ret += test_xmlNanoFTPScanProxy();
11849    test_ret += test_xmlNanoFTPUpdateURL();
11850
11851    if (test_ret != 0)
11852	printf("Module nanoftp: %d errors\n", test_ret);
11853    return(test_ret);
11854}
11855
11856static int
11857test_xmlNanoHTTPAuthHeader(void) {
11858    int test_ret = 0;
11859
11860#if defined(LIBXML_HTTP_ENABLED)
11861    int mem_base;
11862    const char * ret_val;
11863    void * ctx; /* the HTTP context */
11864    int n_ctx;
11865
11866    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11867        mem_base = xmlMemBlocks();
11868        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11869
11870        ret_val = xmlNanoHTTPAuthHeader(ctx);
11871        desret_const_char_ptr(ret_val);
11872        call_tests++;
11873        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11874        xmlResetLastError();
11875        if (mem_base != xmlMemBlocks()) {
11876            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11877	           xmlMemBlocks() - mem_base);
11878	    test_ret++;
11879            printf(" %d", n_ctx);
11880            printf("\n");
11881        }
11882    }
11883    function_tests++;
11884#endif
11885
11886    return(test_ret);
11887}
11888
11889
11890static int
11891test_xmlNanoHTTPCleanup(void) {
11892    int test_ret = 0;
11893
11894#if defined(LIBXML_HTTP_ENABLED)
11895    int mem_base;
11896
11897        mem_base = xmlMemBlocks();
11898
11899        xmlNanoHTTPCleanup();
11900        call_tests++;
11901        xmlResetLastError();
11902        if (mem_base != xmlMemBlocks()) {
11903            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
11904	           xmlMemBlocks() - mem_base);
11905	    test_ret++;
11906            printf("\n");
11907        }
11908    function_tests++;
11909#endif
11910
11911    return(test_ret);
11912}
11913
11914
11915static int
11916test_xmlNanoHTTPContentLength(void) {
11917    int test_ret = 0;
11918
11919#if defined(LIBXML_HTTP_ENABLED)
11920    int mem_base;
11921    int ret_val;
11922    void * ctx; /* the HTTP context */
11923    int n_ctx;
11924
11925    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11926        mem_base = xmlMemBlocks();
11927        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11928
11929        ret_val = xmlNanoHTTPContentLength(ctx);
11930        desret_int(ret_val);
11931        call_tests++;
11932        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11933        xmlResetLastError();
11934        if (mem_base != xmlMemBlocks()) {
11935            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
11936	           xmlMemBlocks() - mem_base);
11937	    test_ret++;
11938            printf(" %d", n_ctx);
11939            printf("\n");
11940        }
11941    }
11942    function_tests++;
11943#endif
11944
11945    return(test_ret);
11946}
11947
11948
11949static int
11950test_xmlNanoHTTPEncoding(void) {
11951    int test_ret = 0;
11952
11953#if defined(LIBXML_HTTP_ENABLED)
11954    int mem_base;
11955    const char * ret_val;
11956    void * ctx; /* the HTTP context */
11957    int n_ctx;
11958
11959    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11960        mem_base = xmlMemBlocks();
11961        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11962
11963        ret_val = xmlNanoHTTPEncoding(ctx);
11964        desret_const_char_ptr(ret_val);
11965        call_tests++;
11966        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11967        xmlResetLastError();
11968        if (mem_base != xmlMemBlocks()) {
11969            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
11970	           xmlMemBlocks() - mem_base);
11971	    test_ret++;
11972            printf(" %d", n_ctx);
11973            printf("\n");
11974        }
11975    }
11976    function_tests++;
11977#endif
11978
11979    return(test_ret);
11980}
11981
11982
11983#define gen_nb_char_ptr_ptr 1
11984static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11985    return(NULL);
11986}
11987static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11988}
11989
11990static int
11991test_xmlNanoHTTPFetch(void) {
11992    int test_ret = 0;
11993
11994#if defined(LIBXML_HTTP_ENABLED)
11995    int mem_base;
11996    int ret_val;
11997    const char * URL; /* The URL to load */
11998    int n_URL;
11999    const char * filename; /* the filename where the content should be saved */
12000    int n_filename;
12001    char ** contentType; /* if available the Content-Type information will be returned at that location */
12002    int n_contentType;
12003
12004    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12005    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12006    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12007        mem_base = xmlMemBlocks();
12008        URL = gen_fileoutput(n_URL, 0);
12009        filename = gen_fileoutput(n_filename, 1);
12010        contentType = gen_char_ptr_ptr(n_contentType, 2);
12011
12012        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12013        desret_int(ret_val);
12014        call_tests++;
12015        des_fileoutput(n_URL, URL, 0);
12016        des_fileoutput(n_filename, filename, 1);
12017        des_char_ptr_ptr(n_contentType, contentType, 2);
12018        xmlResetLastError();
12019        if (mem_base != xmlMemBlocks()) {
12020            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12021	           xmlMemBlocks() - mem_base);
12022	    test_ret++;
12023            printf(" %d", n_URL);
12024            printf(" %d", n_filename);
12025            printf(" %d", n_contentType);
12026            printf("\n");
12027        }
12028    }
12029    }
12030    }
12031    function_tests++;
12032#endif
12033
12034    return(test_ret);
12035}
12036
12037
12038static int
12039test_xmlNanoHTTPInit(void) {
12040    int test_ret = 0;
12041
12042#if defined(LIBXML_HTTP_ENABLED)
12043    int mem_base;
12044
12045        mem_base = xmlMemBlocks();
12046
12047        xmlNanoHTTPInit();
12048        call_tests++;
12049        xmlResetLastError();
12050        if (mem_base != xmlMemBlocks()) {
12051            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12052	           xmlMemBlocks() - mem_base);
12053	    test_ret++;
12054            printf("\n");
12055        }
12056    function_tests++;
12057#endif
12058
12059    return(test_ret);
12060}
12061
12062
12063static int
12064test_xmlNanoHTTPMimeType(void) {
12065    int test_ret = 0;
12066
12067#if defined(LIBXML_HTTP_ENABLED)
12068    int mem_base;
12069    const char * ret_val;
12070    void * ctx; /* the HTTP context */
12071    int n_ctx;
12072
12073    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12074        mem_base = xmlMemBlocks();
12075        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12076
12077        ret_val = xmlNanoHTTPMimeType(ctx);
12078        desret_const_char_ptr(ret_val);
12079        call_tests++;
12080        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12081        xmlResetLastError();
12082        if (mem_base != xmlMemBlocks()) {
12083            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12084	           xmlMemBlocks() - mem_base);
12085	    test_ret++;
12086            printf(" %d", n_ctx);
12087            printf("\n");
12088        }
12089    }
12090    function_tests++;
12091#endif
12092
12093    return(test_ret);
12094}
12095
12096
12097static int
12098test_xmlNanoHTTPOpen(void) {
12099    int test_ret = 0;
12100
12101#if defined(LIBXML_HTTP_ENABLED)
12102    int mem_base;
12103    void * ret_val;
12104    const char * URL; /* The URL to load */
12105    int n_URL;
12106    char ** contentType; /* if available the Content-Type information will be returned at that location */
12107    int n_contentType;
12108
12109    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12110    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12111        mem_base = xmlMemBlocks();
12112        URL = gen_filepath(n_URL, 0);
12113        contentType = gen_char_ptr_ptr(n_contentType, 1);
12114
12115        ret_val = xmlNanoHTTPOpen(URL, contentType);
12116        desret_xmlNanoHTTPCtxtPtr(ret_val);
12117        call_tests++;
12118        des_filepath(n_URL, URL, 0);
12119        des_char_ptr_ptr(n_contentType, contentType, 1);
12120        xmlResetLastError();
12121        if (mem_base != xmlMemBlocks()) {
12122            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12123	           xmlMemBlocks() - mem_base);
12124	    test_ret++;
12125            printf(" %d", n_URL);
12126            printf(" %d", n_contentType);
12127            printf("\n");
12128        }
12129    }
12130    }
12131    function_tests++;
12132#endif
12133
12134    return(test_ret);
12135}
12136
12137
12138static int
12139test_xmlNanoHTTPOpenRedir(void) {
12140    int test_ret = 0;
12141
12142#if defined(LIBXML_HTTP_ENABLED)
12143    int mem_base;
12144    void * ret_val;
12145    const char * URL; /* The URL to load */
12146    int n_URL;
12147    char ** contentType; /* if available the Content-Type information will be returned at that location */
12148    int n_contentType;
12149    char ** redir; /* if available the redirected URL will be returned */
12150    int n_redir;
12151
12152    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12153    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12154    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12155        mem_base = xmlMemBlocks();
12156        URL = gen_filepath(n_URL, 0);
12157        contentType = gen_char_ptr_ptr(n_contentType, 1);
12158        redir = gen_char_ptr_ptr(n_redir, 2);
12159
12160        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12161        desret_xmlNanoHTTPCtxtPtr(ret_val);
12162        call_tests++;
12163        des_filepath(n_URL, URL, 0);
12164        des_char_ptr_ptr(n_contentType, contentType, 1);
12165        des_char_ptr_ptr(n_redir, redir, 2);
12166        xmlResetLastError();
12167        if (mem_base != xmlMemBlocks()) {
12168            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12169	           xmlMemBlocks() - mem_base);
12170	    test_ret++;
12171            printf(" %d", n_URL);
12172            printf(" %d", n_contentType);
12173            printf(" %d", n_redir);
12174            printf("\n");
12175        }
12176    }
12177    }
12178    }
12179    function_tests++;
12180#endif
12181
12182    return(test_ret);
12183}
12184
12185
12186static int
12187test_xmlNanoHTTPRead(void) {
12188    int test_ret = 0;
12189
12190#if defined(LIBXML_HTTP_ENABLED)
12191    int mem_base;
12192    int ret_val;
12193    void * ctx; /* the HTTP context */
12194    int n_ctx;
12195    void * dest; /* a buffer */
12196    int n_dest;
12197    int len; /* the buffer length */
12198    int n_len;
12199
12200    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12201    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12202    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12203        mem_base = xmlMemBlocks();
12204        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12205        dest = gen_void_ptr(n_dest, 1);
12206        len = gen_int(n_len, 2);
12207
12208        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12209        desret_int(ret_val);
12210        call_tests++;
12211        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12212        des_void_ptr(n_dest, dest, 1);
12213        des_int(n_len, len, 2);
12214        xmlResetLastError();
12215        if (mem_base != xmlMemBlocks()) {
12216            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12217	           xmlMemBlocks() - mem_base);
12218	    test_ret++;
12219            printf(" %d", n_ctx);
12220            printf(" %d", n_dest);
12221            printf(" %d", n_len);
12222            printf("\n");
12223        }
12224    }
12225    }
12226    }
12227    function_tests++;
12228#endif
12229
12230    return(test_ret);
12231}
12232
12233
12234static int
12235test_xmlNanoHTTPRedir(void) {
12236    int test_ret = 0;
12237
12238
12239    /* missing type support */
12240    return(test_ret);
12241}
12242
12243
12244static int
12245test_xmlNanoHTTPReturnCode(void) {
12246    int test_ret = 0;
12247
12248#if defined(LIBXML_HTTP_ENABLED)
12249    int mem_base;
12250    int ret_val;
12251    void * ctx; /* the HTTP context */
12252    int n_ctx;
12253
12254    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12255        mem_base = xmlMemBlocks();
12256        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12257
12258        ret_val = xmlNanoHTTPReturnCode(ctx);
12259        desret_int(ret_val);
12260        call_tests++;
12261        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12262        xmlResetLastError();
12263        if (mem_base != xmlMemBlocks()) {
12264            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12265	           xmlMemBlocks() - mem_base);
12266	    test_ret++;
12267            printf(" %d", n_ctx);
12268            printf("\n");
12269        }
12270    }
12271    function_tests++;
12272#endif
12273
12274    return(test_ret);
12275}
12276
12277
12278static int
12279test_xmlNanoHTTPSave(void) {
12280    int test_ret = 0;
12281
12282#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12283    int mem_base;
12284    int ret_val;
12285    void * ctxt; /* the HTTP context */
12286    int n_ctxt;
12287    const char * filename; /* the filename where the content should be saved */
12288    int n_filename;
12289
12290    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12291    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12292        mem_base = xmlMemBlocks();
12293        ctxt = gen_void_ptr(n_ctxt, 0);
12294        filename = gen_fileoutput(n_filename, 1);
12295
12296        ret_val = xmlNanoHTTPSave(ctxt, filename);
12297        desret_int(ret_val);
12298        call_tests++;
12299        des_void_ptr(n_ctxt, ctxt, 0);
12300        des_fileoutput(n_filename, filename, 1);
12301        xmlResetLastError();
12302        if (mem_base != xmlMemBlocks()) {
12303            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12304	           xmlMemBlocks() - mem_base);
12305	    test_ret++;
12306            printf(" %d", n_ctxt);
12307            printf(" %d", n_filename);
12308            printf("\n");
12309        }
12310    }
12311    }
12312    function_tests++;
12313#endif
12314
12315    return(test_ret);
12316}
12317
12318
12319static int
12320test_xmlNanoHTTPScanProxy(void) {
12321    int test_ret = 0;
12322
12323#if defined(LIBXML_HTTP_ENABLED)
12324    const char * URL; /* The proxy URL used to initialize the proxy context */
12325    int n_URL;
12326
12327    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12328        URL = gen_filepath(n_URL, 0);
12329
12330        xmlNanoHTTPScanProxy(URL);
12331        call_tests++;
12332        des_filepath(n_URL, URL, 0);
12333        xmlResetLastError();
12334    }
12335    function_tests++;
12336#endif
12337
12338    return(test_ret);
12339}
12340
12341static int
12342test_nanohttp(void) {
12343    int test_ret = 0;
12344
12345    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12346    test_ret += test_xmlNanoHTTPAuthHeader();
12347    test_ret += test_xmlNanoHTTPCleanup();
12348    test_ret += test_xmlNanoHTTPContentLength();
12349    test_ret += test_xmlNanoHTTPEncoding();
12350    test_ret += test_xmlNanoHTTPFetch();
12351    test_ret += test_xmlNanoHTTPInit();
12352    test_ret += test_xmlNanoHTTPMimeType();
12353    test_ret += test_xmlNanoHTTPOpen();
12354    test_ret += test_xmlNanoHTTPOpenRedir();
12355    test_ret += test_xmlNanoHTTPRead();
12356    test_ret += test_xmlNanoHTTPRedir();
12357    test_ret += test_xmlNanoHTTPReturnCode();
12358    test_ret += test_xmlNanoHTTPSave();
12359    test_ret += test_xmlNanoHTTPScanProxy();
12360
12361    if (test_ret != 0)
12362	printf("Module nanohttp: %d errors\n", test_ret);
12363    return(test_ret);
12364}
12365
12366static int
12367test_xmlByteConsumed(void) {
12368    int test_ret = 0;
12369
12370    int mem_base;
12371    long ret_val;
12372    xmlParserCtxtPtr ctxt; /* an XML parser context */
12373    int n_ctxt;
12374
12375    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12376        mem_base = xmlMemBlocks();
12377        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12378
12379        ret_val = xmlByteConsumed(ctxt);
12380        desret_long(ret_val);
12381        call_tests++;
12382        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12383        xmlResetLastError();
12384        if (mem_base != xmlMemBlocks()) {
12385            printf("Leak of %d blocks found in xmlByteConsumed",
12386	           xmlMemBlocks() - mem_base);
12387	    test_ret++;
12388            printf(" %d", n_ctxt);
12389            printf("\n");
12390        }
12391    }
12392    function_tests++;
12393
12394    return(test_ret);
12395}
12396
12397
12398static int
12399test_xmlClearNodeInfoSeq(void) {
12400    int test_ret = 0;
12401
12402    int mem_base;
12403    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12404    int n_seq;
12405
12406    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12407        mem_base = xmlMemBlocks();
12408        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12409
12410        xmlClearNodeInfoSeq(seq);
12411        call_tests++;
12412        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12413        xmlResetLastError();
12414        if (mem_base != xmlMemBlocks()) {
12415            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12416	           xmlMemBlocks() - mem_base);
12417	    test_ret++;
12418            printf(" %d", n_seq);
12419            printf("\n");
12420        }
12421    }
12422    function_tests++;
12423
12424    return(test_ret);
12425}
12426
12427
12428static int
12429test_xmlClearParserCtxt(void) {
12430    int test_ret = 0;
12431
12432    int mem_base;
12433    xmlParserCtxtPtr ctxt; /* an XML parser context */
12434    int n_ctxt;
12435
12436    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12437        mem_base = xmlMemBlocks();
12438        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12439
12440        xmlClearParserCtxt(ctxt);
12441        call_tests++;
12442        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12443        xmlResetLastError();
12444        if (mem_base != xmlMemBlocks()) {
12445            printf("Leak of %d blocks found in xmlClearParserCtxt",
12446	           xmlMemBlocks() - mem_base);
12447	    test_ret++;
12448            printf(" %d", n_ctxt);
12449            printf("\n");
12450        }
12451    }
12452    function_tests++;
12453
12454    return(test_ret);
12455}
12456
12457
12458static int
12459test_xmlCreateDocParserCtxt(void) {
12460    int test_ret = 0;
12461
12462    int mem_base;
12463    xmlParserCtxtPtr ret_val;
12464    xmlChar * cur; /* a pointer to an array of xmlChar */
12465    int n_cur;
12466
12467    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12468        mem_base = xmlMemBlocks();
12469        cur = gen_const_xmlChar_ptr(n_cur, 0);
12470
12471        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12472        desret_xmlParserCtxtPtr(ret_val);
12473        call_tests++;
12474        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12475        xmlResetLastError();
12476        if (mem_base != xmlMemBlocks()) {
12477            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12478	           xmlMemBlocks() - mem_base);
12479	    test_ret++;
12480            printf(" %d", n_cur);
12481            printf("\n");
12482        }
12483    }
12484    function_tests++;
12485
12486    return(test_ret);
12487}
12488
12489
12490static int
12491test_xmlCreatePushParserCtxt(void) {
12492    int test_ret = 0;
12493
12494#if defined(LIBXML_PUSH_ENABLED)
12495    int mem_base;
12496    xmlParserCtxtPtr ret_val;
12497    xmlSAXHandlerPtr sax; /* a SAX handler */
12498    int n_sax;
12499    void * user_data; /* The user data returned on SAX callbacks */
12500    int n_user_data;
12501    char * chunk; /* a pointer to an array of chars */
12502    int n_chunk;
12503    int size; /* number of chars in the array */
12504    int n_size;
12505    const char * filename; /* an optional file name or URI */
12506    int n_filename;
12507
12508    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12509    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12510    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12511    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12512    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12513        mem_base = xmlMemBlocks();
12514        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12515        user_data = gen_userdata(n_user_data, 1);
12516        chunk = gen_const_char_ptr(n_chunk, 2);
12517        size = gen_int(n_size, 3);
12518        filename = gen_fileoutput(n_filename, 4);
12519
12520        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12521        desret_xmlParserCtxtPtr(ret_val);
12522        call_tests++;
12523        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12524        des_userdata(n_user_data, user_data, 1);
12525        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12526        des_int(n_size, size, 3);
12527        des_fileoutput(n_filename, filename, 4);
12528        xmlResetLastError();
12529        if (mem_base != xmlMemBlocks()) {
12530            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12531	           xmlMemBlocks() - mem_base);
12532	    test_ret++;
12533            printf(" %d", n_sax);
12534            printf(" %d", n_user_data);
12535            printf(" %d", n_chunk);
12536            printf(" %d", n_size);
12537            printf(" %d", n_filename);
12538            printf("\n");
12539        }
12540    }
12541    }
12542    }
12543    }
12544    }
12545    function_tests++;
12546#endif
12547
12548    return(test_ret);
12549}
12550
12551
12552static int
12553test_xmlCtxtReadDoc(void) {
12554    int test_ret = 0;
12555
12556    int mem_base;
12557    xmlDocPtr ret_val;
12558    xmlParserCtxtPtr ctxt; /* an XML parser context */
12559    int n_ctxt;
12560    xmlChar * cur; /* a pointer to a zero terminated string */
12561    int n_cur;
12562    const char * URL; /* the base URL to use for the document */
12563    int n_URL;
12564    char * encoding; /* the document encoding, or NULL */
12565    int n_encoding;
12566    int options; /* a combination of xmlParserOption */
12567    int n_options;
12568
12569    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12570    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12571    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12572    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12573    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12574        mem_base = xmlMemBlocks();
12575        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12576        cur = gen_const_xmlChar_ptr(n_cur, 1);
12577        URL = gen_filepath(n_URL, 2);
12578        encoding = gen_const_char_ptr(n_encoding, 3);
12579        options = gen_parseroptions(n_options, 4);
12580
12581        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12582        desret_xmlDocPtr(ret_val);
12583        call_tests++;
12584        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12585        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12586        des_filepath(n_URL, URL, 2);
12587        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12588        des_parseroptions(n_options, options, 4);
12589        xmlResetLastError();
12590        if (mem_base != xmlMemBlocks()) {
12591            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12592	           xmlMemBlocks() - mem_base);
12593	    test_ret++;
12594            printf(" %d", n_ctxt);
12595            printf(" %d", n_cur);
12596            printf(" %d", n_URL);
12597            printf(" %d", n_encoding);
12598            printf(" %d", n_options);
12599            printf("\n");
12600        }
12601    }
12602    }
12603    }
12604    }
12605    }
12606    function_tests++;
12607
12608    return(test_ret);
12609}
12610
12611
12612static int
12613test_xmlCtxtReadFile(void) {
12614    int test_ret = 0;
12615
12616    int mem_base;
12617    xmlDocPtr ret_val;
12618    xmlParserCtxtPtr ctxt; /* an XML parser context */
12619    int n_ctxt;
12620    const char * filename; /* a file or URL */
12621    int n_filename;
12622    char * encoding; /* the document encoding, or NULL */
12623    int n_encoding;
12624    int options; /* a combination of xmlParserOption */
12625    int n_options;
12626
12627    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12628    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12629    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12630    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12631        mem_base = xmlMemBlocks();
12632        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12633        filename = gen_filepath(n_filename, 1);
12634        encoding = gen_const_char_ptr(n_encoding, 2);
12635        options = gen_parseroptions(n_options, 3);
12636
12637        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12638        desret_xmlDocPtr(ret_val);
12639        call_tests++;
12640        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12641        des_filepath(n_filename, filename, 1);
12642        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12643        des_parseroptions(n_options, options, 3);
12644        xmlResetLastError();
12645        if (mem_base != xmlMemBlocks()) {
12646            printf("Leak of %d blocks found in xmlCtxtReadFile",
12647	           xmlMemBlocks() - mem_base);
12648	    test_ret++;
12649            printf(" %d", n_ctxt);
12650            printf(" %d", n_filename);
12651            printf(" %d", n_encoding);
12652            printf(" %d", n_options);
12653            printf("\n");
12654        }
12655    }
12656    }
12657    }
12658    }
12659    function_tests++;
12660
12661    return(test_ret);
12662}
12663
12664
12665static int
12666test_xmlCtxtReadMemory(void) {
12667    int test_ret = 0;
12668
12669    int mem_base;
12670    xmlDocPtr ret_val;
12671    xmlParserCtxtPtr ctxt; /* an XML parser context */
12672    int n_ctxt;
12673    char * buffer; /* a pointer to a char array */
12674    int n_buffer;
12675    int size; /* the size of the array */
12676    int n_size;
12677    const char * URL; /* the base URL to use for the document */
12678    int n_URL;
12679    char * encoding; /* the document encoding, or NULL */
12680    int n_encoding;
12681    int options; /* a combination of xmlParserOption */
12682    int n_options;
12683
12684    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12685    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12686    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12687    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12688    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12689    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12690        mem_base = xmlMemBlocks();
12691        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12692        buffer = gen_const_char_ptr(n_buffer, 1);
12693        size = gen_int(n_size, 2);
12694        URL = gen_filepath(n_URL, 3);
12695        encoding = gen_const_char_ptr(n_encoding, 4);
12696        options = gen_parseroptions(n_options, 5);
12697
12698        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12699        desret_xmlDocPtr(ret_val);
12700        call_tests++;
12701        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12702        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12703        des_int(n_size, size, 2);
12704        des_filepath(n_URL, URL, 3);
12705        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12706        des_parseroptions(n_options, options, 5);
12707        xmlResetLastError();
12708        if (mem_base != xmlMemBlocks()) {
12709            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12710	           xmlMemBlocks() - mem_base);
12711	    test_ret++;
12712            printf(" %d", n_ctxt);
12713            printf(" %d", n_buffer);
12714            printf(" %d", n_size);
12715            printf(" %d", n_URL);
12716            printf(" %d", n_encoding);
12717            printf(" %d", n_options);
12718            printf("\n");
12719        }
12720    }
12721    }
12722    }
12723    }
12724    }
12725    }
12726    function_tests++;
12727
12728    return(test_ret);
12729}
12730
12731
12732static int
12733test_xmlCtxtReset(void) {
12734    int test_ret = 0;
12735
12736    int mem_base;
12737    xmlParserCtxtPtr ctxt; /* an XML parser context */
12738    int n_ctxt;
12739
12740    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12741        mem_base = xmlMemBlocks();
12742        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12743
12744        xmlCtxtReset(ctxt);
12745        call_tests++;
12746        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12747        xmlResetLastError();
12748        if (mem_base != xmlMemBlocks()) {
12749            printf("Leak of %d blocks found in xmlCtxtReset",
12750	           xmlMemBlocks() - mem_base);
12751	    test_ret++;
12752            printf(" %d", n_ctxt);
12753            printf("\n");
12754        }
12755    }
12756    function_tests++;
12757
12758    return(test_ret);
12759}
12760
12761
12762static int
12763test_xmlCtxtResetPush(void) {
12764    int test_ret = 0;
12765
12766    int mem_base;
12767    int ret_val;
12768    xmlParserCtxtPtr ctxt; /* an XML parser context */
12769    int n_ctxt;
12770    char * chunk; /* a pointer to an array of chars */
12771    int n_chunk;
12772    int size; /* number of chars in the array */
12773    int n_size;
12774    const char * filename; /* an optional file name or URI */
12775    int n_filename;
12776    char * encoding; /* the document encoding, or NULL */
12777    int n_encoding;
12778
12779    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12780    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12781    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12782    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12783    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12784        mem_base = xmlMemBlocks();
12785        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12786        chunk = gen_const_char_ptr(n_chunk, 1);
12787        size = gen_int(n_size, 2);
12788        filename = gen_filepath(n_filename, 3);
12789        encoding = gen_const_char_ptr(n_encoding, 4);
12790
12791        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12792        desret_int(ret_val);
12793        call_tests++;
12794        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12795        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12796        des_int(n_size, size, 2);
12797        des_filepath(n_filename, filename, 3);
12798        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12799        xmlResetLastError();
12800        if (mem_base != xmlMemBlocks()) {
12801            printf("Leak of %d blocks found in xmlCtxtResetPush",
12802	           xmlMemBlocks() - mem_base);
12803	    test_ret++;
12804            printf(" %d", n_ctxt);
12805            printf(" %d", n_chunk);
12806            printf(" %d", n_size);
12807            printf(" %d", n_filename);
12808            printf(" %d", n_encoding);
12809            printf("\n");
12810        }
12811    }
12812    }
12813    }
12814    }
12815    }
12816    function_tests++;
12817
12818    return(test_ret);
12819}
12820
12821
12822static int
12823test_xmlCtxtUseOptions(void) {
12824    int test_ret = 0;
12825
12826    int mem_base;
12827    int ret_val;
12828    xmlParserCtxtPtr ctxt; /* an XML parser context */
12829    int n_ctxt;
12830    int options; /* a combination of xmlParserOption */
12831    int n_options;
12832
12833    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12834    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12835        mem_base = xmlMemBlocks();
12836        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12837        options = gen_parseroptions(n_options, 1);
12838
12839        ret_val = xmlCtxtUseOptions(ctxt, options);
12840        desret_int(ret_val);
12841        call_tests++;
12842        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12843        des_parseroptions(n_options, options, 1);
12844        xmlResetLastError();
12845        if (mem_base != xmlMemBlocks()) {
12846            printf("Leak of %d blocks found in xmlCtxtUseOptions",
12847	           xmlMemBlocks() - mem_base);
12848	    test_ret++;
12849            printf(" %d", n_ctxt);
12850            printf(" %d", n_options);
12851            printf("\n");
12852        }
12853    }
12854    }
12855    function_tests++;
12856
12857    return(test_ret);
12858}
12859
12860
12861static int
12862test_xmlGetExternalEntityLoader(void) {
12863    int test_ret = 0;
12864
12865
12866    /* missing type support */
12867    return(test_ret);
12868}
12869
12870
12871static int
12872test_xmlGetFeature(void) {
12873    int test_ret = 0;
12874
12875#if defined(LIBXML_LEGACY_ENABLED)
12876#ifdef LIBXML_LEGACY_ENABLED
12877    int mem_base;
12878    int ret_val;
12879    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
12880    int n_ctxt;
12881    char * name; /* the feature name */
12882    int n_name;
12883    void * result; /* location to store the result */
12884    int n_result;
12885
12886    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12887    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
12888    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
12889        mem_base = xmlMemBlocks();
12890        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12891        name = gen_const_char_ptr(n_name, 1);
12892        result = gen_void_ptr(n_result, 2);
12893
12894        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
12895        desret_int(ret_val);
12896        call_tests++;
12897        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12898        des_const_char_ptr(n_name, (const char *)name, 1);
12899        des_void_ptr(n_result, result, 2);
12900        xmlResetLastError();
12901        if (mem_base != xmlMemBlocks()) {
12902            printf("Leak of %d blocks found in xmlGetFeature",
12903	           xmlMemBlocks() - mem_base);
12904	    test_ret++;
12905            printf(" %d", n_ctxt);
12906            printf(" %d", n_name);
12907            printf(" %d", n_result);
12908            printf("\n");
12909        }
12910    }
12911    }
12912    }
12913    function_tests++;
12914#endif
12915#endif
12916
12917    return(test_ret);
12918}
12919
12920
12921#define gen_nb_const_char_ptr_ptr 1
12922static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12923    return(NULL);
12924}
12925static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12926}
12927
12928static int
12929test_xmlGetFeaturesList(void) {
12930    int test_ret = 0;
12931
12932#if defined(LIBXML_LEGACY_ENABLED)
12933#ifdef LIBXML_LEGACY_ENABLED
12934    int mem_base;
12935    int ret_val;
12936    int * len; /* the length of the features name array (input/output) */
12937    int n_len;
12938    char ** result; /* an array of string to be filled with the features name. */
12939    int n_result;
12940
12941    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
12942    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
12943        mem_base = xmlMemBlocks();
12944        len = gen_int_ptr(n_len, 0);
12945        result = gen_const_char_ptr_ptr(n_result, 1);
12946
12947        ret_val = xmlGetFeaturesList(len, (const char **)result);
12948        desret_int(ret_val);
12949        call_tests++;
12950        des_int_ptr(n_len, len, 0);
12951        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
12952        xmlResetLastError();
12953        if (mem_base != xmlMemBlocks()) {
12954            printf("Leak of %d blocks found in xmlGetFeaturesList",
12955	           xmlMemBlocks() - mem_base);
12956	    test_ret++;
12957            printf(" %d", n_len);
12958            printf(" %d", n_result);
12959            printf("\n");
12960        }
12961    }
12962    }
12963    function_tests++;
12964#endif
12965#endif
12966
12967    return(test_ret);
12968}
12969
12970
12971static int
12972test_xmlIOParseDTD(void) {
12973    int test_ret = 0;
12974
12975#if defined(LIBXML_VALID_ENABLED)
12976#ifdef LIBXML_VALID_ENABLED
12977    int mem_base;
12978    xmlDtdPtr ret_val;
12979    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
12980    int n_sax;
12981    xmlParserInputBufferPtr input; /* an Input Buffer */
12982    int n_input;
12983    xmlCharEncoding enc; /* the charset encoding if known */
12984    int n_enc;
12985
12986    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12987    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
12988    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
12989        mem_base = xmlMemBlocks();
12990        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12991        input = gen_xmlParserInputBufferPtr(n_input, 1);
12992        enc = gen_xmlCharEncoding(n_enc, 2);
12993
12994        ret_val = xmlIOParseDTD(sax, input, enc);
12995        input = NULL;
12996        desret_xmlDtdPtr(ret_val);
12997        call_tests++;
12998        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12999        des_xmlParserInputBufferPtr(n_input, input, 1);
13000        des_xmlCharEncoding(n_enc, enc, 2);
13001        xmlResetLastError();
13002        if (mem_base != xmlMemBlocks()) {
13003            printf("Leak of %d blocks found in xmlIOParseDTD",
13004	           xmlMemBlocks() - mem_base);
13005	    test_ret++;
13006            printf(" %d", n_sax);
13007            printf(" %d", n_input);
13008            printf(" %d", n_enc);
13009            printf("\n");
13010        }
13011    }
13012    }
13013    }
13014    function_tests++;
13015#endif
13016#endif
13017
13018    return(test_ret);
13019}
13020
13021
13022static int
13023test_xmlInitNodeInfoSeq(void) {
13024    int test_ret = 0;
13025
13026    int mem_base;
13027    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13028    int n_seq;
13029
13030    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13031        mem_base = xmlMemBlocks();
13032        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13033
13034        xmlInitNodeInfoSeq(seq);
13035        call_tests++;
13036        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13037        xmlResetLastError();
13038        if (mem_base != xmlMemBlocks()) {
13039            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13040	           xmlMemBlocks() - mem_base);
13041	    test_ret++;
13042            printf(" %d", n_seq);
13043            printf("\n");
13044        }
13045    }
13046    function_tests++;
13047
13048    return(test_ret);
13049}
13050
13051
13052static int
13053test_xmlInitParser(void) {
13054    int test_ret = 0;
13055
13056    int mem_base;
13057
13058        mem_base = xmlMemBlocks();
13059
13060        xmlInitParser();
13061        call_tests++;
13062        xmlResetLastError();
13063        if (mem_base != xmlMemBlocks()) {
13064            printf("Leak of %d blocks found in xmlInitParser",
13065	           xmlMemBlocks() - mem_base);
13066	    test_ret++;
13067            printf("\n");
13068        }
13069    function_tests++;
13070
13071    return(test_ret);
13072}
13073
13074
13075static int
13076test_xmlInitParserCtxt(void) {
13077    int test_ret = 0;
13078
13079    int mem_base;
13080    int ret_val;
13081    xmlParserCtxtPtr ctxt; /* an XML parser context */
13082    int n_ctxt;
13083
13084    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13085        mem_base = xmlMemBlocks();
13086        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13087
13088        ret_val = xmlInitParserCtxt(ctxt);
13089        desret_int(ret_val);
13090        call_tests++;
13091        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13092        xmlResetLastError();
13093        if (mem_base != xmlMemBlocks()) {
13094            printf("Leak of %d blocks found in xmlInitParserCtxt",
13095	           xmlMemBlocks() - mem_base);
13096	    test_ret++;
13097            printf(" %d", n_ctxt);
13098            printf("\n");
13099        }
13100    }
13101    function_tests++;
13102
13103    return(test_ret);
13104}
13105
13106
13107static int
13108test_xmlKeepBlanksDefault(void) {
13109    int test_ret = 0;
13110
13111    int mem_base;
13112    int ret_val;
13113    int val; /* int 0 or 1 */
13114    int n_val;
13115
13116    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13117        mem_base = xmlMemBlocks();
13118        val = gen_int(n_val, 0);
13119
13120        ret_val = xmlKeepBlanksDefault(val);
13121        desret_int(ret_val);
13122        call_tests++;
13123        des_int(n_val, val, 0);
13124        xmlResetLastError();
13125        if (mem_base != xmlMemBlocks()) {
13126            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13127	           xmlMemBlocks() - mem_base);
13128	    test_ret++;
13129            printf(" %d", n_val);
13130            printf("\n");
13131        }
13132    }
13133    function_tests++;
13134
13135    return(test_ret);
13136}
13137
13138
13139static int
13140test_xmlLineNumbersDefault(void) {
13141    int test_ret = 0;
13142
13143    int mem_base;
13144    int ret_val;
13145    int val; /* int 0 or 1 */
13146    int n_val;
13147
13148    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13149        mem_base = xmlMemBlocks();
13150        val = gen_int(n_val, 0);
13151
13152        ret_val = xmlLineNumbersDefault(val);
13153        desret_int(ret_val);
13154        call_tests++;
13155        des_int(n_val, val, 0);
13156        xmlResetLastError();
13157        if (mem_base != xmlMemBlocks()) {
13158            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13159	           xmlMemBlocks() - mem_base);
13160	    test_ret++;
13161            printf(" %d", n_val);
13162            printf("\n");
13163        }
13164    }
13165    function_tests++;
13166
13167    return(test_ret);
13168}
13169
13170
13171static int
13172test_xmlLoadExternalEntity(void) {
13173    int test_ret = 0;
13174
13175    int mem_base;
13176    xmlParserInputPtr ret_val;
13177    const char * URL; /* the URL for the entity to load */
13178    int n_URL;
13179    char * ID; /* the Public ID for the entity to load */
13180    int n_ID;
13181    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13182    int n_ctxt;
13183
13184    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13185    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13186    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13187        mem_base = xmlMemBlocks();
13188        URL = gen_filepath(n_URL, 0);
13189        ID = gen_const_char_ptr(n_ID, 1);
13190        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13191
13192        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13193        desret_xmlParserInputPtr(ret_val);
13194        call_tests++;
13195        des_filepath(n_URL, URL, 0);
13196        des_const_char_ptr(n_ID, (const char *)ID, 1);
13197        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13198        xmlResetLastError();
13199        if (mem_base != xmlMemBlocks()) {
13200            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13201	           xmlMemBlocks() - mem_base);
13202	    test_ret++;
13203            printf(" %d", n_URL);
13204            printf(" %d", n_ID);
13205            printf(" %d", n_ctxt);
13206            printf("\n");
13207        }
13208    }
13209    }
13210    }
13211    function_tests++;
13212
13213    return(test_ret);
13214}
13215
13216
13217static int
13218test_xmlNewIOInputStream(void) {
13219    int test_ret = 0;
13220
13221    int mem_base;
13222    xmlParserInputPtr ret_val;
13223    xmlParserCtxtPtr ctxt; /* an XML parser context */
13224    int n_ctxt;
13225    xmlParserInputBufferPtr input; /* an I/O Input */
13226    int n_input;
13227    xmlCharEncoding enc; /* the charset encoding if known */
13228    int n_enc;
13229
13230    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13231    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13232    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13233        mem_base = xmlMemBlocks();
13234        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13235        input = gen_xmlParserInputBufferPtr(n_input, 1);
13236        enc = gen_xmlCharEncoding(n_enc, 2);
13237
13238        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13239        if (ret_val != NULL) input = NULL;
13240        desret_xmlParserInputPtr(ret_val);
13241        call_tests++;
13242        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13243        des_xmlParserInputBufferPtr(n_input, input, 1);
13244        des_xmlCharEncoding(n_enc, enc, 2);
13245        xmlResetLastError();
13246        if (mem_base != xmlMemBlocks()) {
13247            printf("Leak of %d blocks found in xmlNewIOInputStream",
13248	           xmlMemBlocks() - mem_base);
13249	    test_ret++;
13250            printf(" %d", n_ctxt);
13251            printf(" %d", n_input);
13252            printf(" %d", n_enc);
13253            printf("\n");
13254        }
13255    }
13256    }
13257    }
13258    function_tests++;
13259
13260    return(test_ret);
13261}
13262
13263
13264static int
13265test_xmlNewParserCtxt(void) {
13266    int test_ret = 0;
13267
13268    int mem_base;
13269    xmlParserCtxtPtr ret_val;
13270
13271        mem_base = xmlMemBlocks();
13272
13273        ret_val = xmlNewParserCtxt();
13274        desret_xmlParserCtxtPtr(ret_val);
13275        call_tests++;
13276        xmlResetLastError();
13277        if (mem_base != xmlMemBlocks()) {
13278            printf("Leak of %d blocks found in xmlNewParserCtxt",
13279	           xmlMemBlocks() - mem_base);
13280	    test_ret++;
13281            printf("\n");
13282        }
13283    function_tests++;
13284
13285    return(test_ret);
13286}
13287
13288
13289#define gen_nb_xmlNodePtr_ptr 1
13290static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13291    return(NULL);
13292}
13293static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13294}
13295
13296static int
13297test_xmlParseBalancedChunkMemory(void) {
13298    int test_ret = 0;
13299
13300#if defined(LIBXML_SAX1_ENABLED)
13301#ifdef LIBXML_SAX1_ENABLED
13302    int mem_base;
13303    int ret_val;
13304    xmlDocPtr doc; /* the document the chunk pertains to */
13305    int n_doc;
13306    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13307    int n_sax;
13308    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13309    int n_user_data;
13310    int depth; /* Used for loop detection, use 0 */
13311    int n_depth;
13312    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13313    int n_string;
13314    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13315    int n_lst;
13316
13317    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13318    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13319    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13320    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13321    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13322    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13323        mem_base = xmlMemBlocks();
13324        doc = gen_xmlDocPtr(n_doc, 0);
13325        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13326        user_data = gen_userdata(n_user_data, 2);
13327        depth = gen_int(n_depth, 3);
13328        string = gen_const_xmlChar_ptr(n_string, 4);
13329        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13330
13331#ifdef LIBXML_SAX1_ENABLED
13332        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13333#endif
13334
13335
13336        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13337        desret_int(ret_val);
13338        call_tests++;
13339        des_xmlDocPtr(n_doc, doc, 0);
13340        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13341        des_userdata(n_user_data, user_data, 2);
13342        des_int(n_depth, depth, 3);
13343        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13344        des_xmlNodePtr_ptr(n_lst, lst, 5);
13345        xmlResetLastError();
13346        if (mem_base != xmlMemBlocks()) {
13347            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13348	           xmlMemBlocks() - mem_base);
13349	    test_ret++;
13350            printf(" %d", n_doc);
13351            printf(" %d", n_sax);
13352            printf(" %d", n_user_data);
13353            printf(" %d", n_depth);
13354            printf(" %d", n_string);
13355            printf(" %d", n_lst);
13356            printf("\n");
13357        }
13358    }
13359    }
13360    }
13361    }
13362    }
13363    }
13364    function_tests++;
13365#endif
13366#endif
13367
13368    return(test_ret);
13369}
13370
13371
13372static int
13373test_xmlParseBalancedChunkMemoryRecover(void) {
13374    int test_ret = 0;
13375
13376#if defined(LIBXML_SAX1_ENABLED)
13377#ifdef LIBXML_SAX1_ENABLED
13378    int mem_base;
13379    int ret_val;
13380    xmlDocPtr doc; /* the document the chunk pertains to */
13381    int n_doc;
13382    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13383    int n_sax;
13384    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13385    int n_user_data;
13386    int depth; /* Used for loop detection, use 0 */
13387    int n_depth;
13388    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13389    int n_string;
13390    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13391    int n_lst;
13392    int recover; /* return nodes even if the data is broken (use 0) */
13393    int n_recover;
13394
13395    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13396    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13397    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13398    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13399    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13400    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13401    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13402        mem_base = xmlMemBlocks();
13403        doc = gen_xmlDocPtr(n_doc, 0);
13404        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13405        user_data = gen_userdata(n_user_data, 2);
13406        depth = gen_int(n_depth, 3);
13407        string = gen_const_xmlChar_ptr(n_string, 4);
13408        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13409        recover = gen_int(n_recover, 6);
13410
13411#ifdef LIBXML_SAX1_ENABLED
13412        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13413#endif
13414
13415
13416        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13417        desret_int(ret_val);
13418        call_tests++;
13419        des_xmlDocPtr(n_doc, doc, 0);
13420        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13421        des_userdata(n_user_data, user_data, 2);
13422        des_int(n_depth, depth, 3);
13423        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13424        des_xmlNodePtr_ptr(n_lst, lst, 5);
13425        des_int(n_recover, recover, 6);
13426        xmlResetLastError();
13427        if (mem_base != xmlMemBlocks()) {
13428            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13429	           xmlMemBlocks() - mem_base);
13430	    test_ret++;
13431            printf(" %d", n_doc);
13432            printf(" %d", n_sax);
13433            printf(" %d", n_user_data);
13434            printf(" %d", n_depth);
13435            printf(" %d", n_string);
13436            printf(" %d", n_lst);
13437            printf(" %d", n_recover);
13438            printf("\n");
13439        }
13440    }
13441    }
13442    }
13443    }
13444    }
13445    }
13446    }
13447    function_tests++;
13448#endif
13449#endif
13450
13451    return(test_ret);
13452}
13453
13454
13455static int
13456test_xmlParseChunk(void) {
13457    int test_ret = 0;
13458
13459#if defined(LIBXML_PUSH_ENABLED)
13460    int mem_base;
13461    int ret_val;
13462    xmlParserCtxtPtr ctxt; /* an XML parser context */
13463    int n_ctxt;
13464    char * chunk; /* an char array */
13465    int n_chunk;
13466    int size; /* the size in byte of the chunk */
13467    int n_size;
13468    int terminate; /* last chunk indicator */
13469    int n_terminate;
13470
13471    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13472    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13473    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13474    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13475        mem_base = xmlMemBlocks();
13476        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13477        chunk = gen_const_char_ptr(n_chunk, 1);
13478        size = gen_int(n_size, 2);
13479        terminate = gen_int(n_terminate, 3);
13480
13481        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13482        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13483        desret_int(ret_val);
13484        call_tests++;
13485        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13486        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13487        des_int(n_size, size, 2);
13488        des_int(n_terminate, terminate, 3);
13489        xmlResetLastError();
13490        if (mem_base != xmlMemBlocks()) {
13491            printf("Leak of %d blocks found in xmlParseChunk",
13492	           xmlMemBlocks() - mem_base);
13493	    test_ret++;
13494            printf(" %d", n_ctxt);
13495            printf(" %d", n_chunk);
13496            printf(" %d", n_size);
13497            printf(" %d", n_terminate);
13498            printf("\n");
13499        }
13500    }
13501    }
13502    }
13503    }
13504    function_tests++;
13505#endif
13506
13507    return(test_ret);
13508}
13509
13510
13511static int
13512test_xmlParseCtxtExternalEntity(void) {
13513    int test_ret = 0;
13514
13515    int mem_base;
13516    int ret_val;
13517    xmlParserCtxtPtr ctx; /* the existing parsing context */
13518    int n_ctx;
13519    xmlChar * URL; /* the URL for the entity to load */
13520    int n_URL;
13521    xmlChar * ID; /* the System ID for the entity to load */
13522    int n_ID;
13523    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13524    int n_lst;
13525
13526    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13527    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13528    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13529    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13530        mem_base = xmlMemBlocks();
13531        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13532        URL = gen_const_xmlChar_ptr(n_URL, 1);
13533        ID = gen_const_xmlChar_ptr(n_ID, 2);
13534        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13535
13536        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13537        desret_int(ret_val);
13538        call_tests++;
13539        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13540        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13541        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13542        des_xmlNodePtr_ptr(n_lst, lst, 3);
13543        xmlResetLastError();
13544        if (mem_base != xmlMemBlocks()) {
13545            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13546	           xmlMemBlocks() - mem_base);
13547	    test_ret++;
13548            printf(" %d", n_ctx);
13549            printf(" %d", n_URL);
13550            printf(" %d", n_ID);
13551            printf(" %d", n_lst);
13552            printf("\n");
13553        }
13554    }
13555    }
13556    }
13557    }
13558    function_tests++;
13559
13560    return(test_ret);
13561}
13562
13563
13564static int
13565test_xmlParseDTD(void) {
13566    int test_ret = 0;
13567
13568#if defined(LIBXML_VALID_ENABLED)
13569#ifdef LIBXML_VALID_ENABLED
13570    int mem_base;
13571    xmlDtdPtr ret_val;
13572    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13573    int n_ExternalID;
13574    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13575    int n_SystemID;
13576
13577    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13578    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13579        mem_base = xmlMemBlocks();
13580        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13581        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13582
13583        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13584        desret_xmlDtdPtr(ret_val);
13585        call_tests++;
13586        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13587        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13588        xmlResetLastError();
13589        if (mem_base != xmlMemBlocks()) {
13590            printf("Leak of %d blocks found in xmlParseDTD",
13591	           xmlMemBlocks() - mem_base);
13592	    test_ret++;
13593            printf(" %d", n_ExternalID);
13594            printf(" %d", n_SystemID);
13595            printf("\n");
13596        }
13597    }
13598    }
13599    function_tests++;
13600#endif
13601#endif
13602
13603    return(test_ret);
13604}
13605
13606
13607static int
13608test_xmlParseDoc(void) {
13609    int test_ret = 0;
13610
13611#if defined(LIBXML_SAX1_ENABLED)
13612#ifdef LIBXML_SAX1_ENABLED
13613    int mem_base;
13614    xmlDocPtr ret_val;
13615    xmlChar * cur; /* a pointer to an array of xmlChar */
13616    int n_cur;
13617
13618    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13619        mem_base = xmlMemBlocks();
13620        cur = gen_const_xmlChar_ptr(n_cur, 0);
13621
13622        ret_val = xmlParseDoc((const xmlChar *)cur);
13623        desret_xmlDocPtr(ret_val);
13624        call_tests++;
13625        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13626        xmlResetLastError();
13627        if (mem_base != xmlMemBlocks()) {
13628            printf("Leak of %d blocks found in xmlParseDoc",
13629	           xmlMemBlocks() - mem_base);
13630	    test_ret++;
13631            printf(" %d", n_cur);
13632            printf("\n");
13633        }
13634    }
13635    function_tests++;
13636#endif
13637#endif
13638
13639    return(test_ret);
13640}
13641
13642
13643static int
13644test_xmlParseDocument(void) {
13645    int test_ret = 0;
13646
13647    int mem_base;
13648    int ret_val;
13649    xmlParserCtxtPtr ctxt; /* an XML parser context */
13650    int n_ctxt;
13651
13652    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13653        mem_base = xmlMemBlocks();
13654        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13655
13656        ret_val = xmlParseDocument(ctxt);
13657        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13658        desret_int(ret_val);
13659        call_tests++;
13660        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13661        xmlResetLastError();
13662        if (mem_base != xmlMemBlocks()) {
13663            printf("Leak of %d blocks found in xmlParseDocument",
13664	           xmlMemBlocks() - mem_base);
13665	    test_ret++;
13666            printf(" %d", n_ctxt);
13667            printf("\n");
13668        }
13669    }
13670    function_tests++;
13671
13672    return(test_ret);
13673}
13674
13675
13676static int
13677test_xmlParseEntity(void) {
13678    int test_ret = 0;
13679
13680#if defined(LIBXML_SAX1_ENABLED)
13681#ifdef LIBXML_SAX1_ENABLED
13682    int mem_base;
13683    xmlDocPtr ret_val;
13684    const char * filename; /* the filename */
13685    int n_filename;
13686
13687    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13688        mem_base = xmlMemBlocks();
13689        filename = gen_filepath(n_filename, 0);
13690
13691        ret_val = xmlParseEntity(filename);
13692        desret_xmlDocPtr(ret_val);
13693        call_tests++;
13694        des_filepath(n_filename, filename, 0);
13695        xmlResetLastError();
13696        if (mem_base != xmlMemBlocks()) {
13697            printf("Leak of %d blocks found in xmlParseEntity",
13698	           xmlMemBlocks() - mem_base);
13699	    test_ret++;
13700            printf(" %d", n_filename);
13701            printf("\n");
13702        }
13703    }
13704    function_tests++;
13705#endif
13706#endif
13707
13708    return(test_ret);
13709}
13710
13711
13712static int
13713test_xmlParseExtParsedEnt(void) {
13714    int test_ret = 0;
13715
13716    int mem_base;
13717    int ret_val;
13718    xmlParserCtxtPtr ctxt; /* an XML parser context */
13719    int n_ctxt;
13720
13721    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13722        mem_base = xmlMemBlocks();
13723        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13724
13725        ret_val = xmlParseExtParsedEnt(ctxt);
13726        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13727        desret_int(ret_val);
13728        call_tests++;
13729        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13730        xmlResetLastError();
13731        if (mem_base != xmlMemBlocks()) {
13732            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13733	           xmlMemBlocks() - mem_base);
13734	    test_ret++;
13735            printf(" %d", n_ctxt);
13736            printf("\n");
13737        }
13738    }
13739    function_tests++;
13740
13741    return(test_ret);
13742}
13743
13744
13745static int
13746test_xmlParseExternalEntity(void) {
13747    int test_ret = 0;
13748
13749#if defined(LIBXML_SAX1_ENABLED)
13750#ifdef LIBXML_SAX1_ENABLED
13751    int mem_base;
13752    int ret_val;
13753    xmlDocPtr doc; /* the document the chunk pertains to */
13754    int n_doc;
13755    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13756    int n_sax;
13757    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13758    int n_user_data;
13759    int depth; /* Used for loop detection, use 0 */
13760    int n_depth;
13761    xmlChar * URL; /* the URL for the entity to load */
13762    int n_URL;
13763    xmlChar * ID; /* the System ID for the entity to load */
13764    int n_ID;
13765    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13766    int n_lst;
13767
13768    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13769    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13770    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13771    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13772    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13773    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13774    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13775        mem_base = xmlMemBlocks();
13776        doc = gen_xmlDocPtr(n_doc, 0);
13777        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13778        user_data = gen_userdata(n_user_data, 2);
13779        depth = gen_int(n_depth, 3);
13780        URL = gen_const_xmlChar_ptr(n_URL, 4);
13781        ID = gen_const_xmlChar_ptr(n_ID, 5);
13782        lst = gen_xmlNodePtr_ptr(n_lst, 6);
13783
13784        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13785        desret_int(ret_val);
13786        call_tests++;
13787        des_xmlDocPtr(n_doc, doc, 0);
13788        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13789        des_userdata(n_user_data, user_data, 2);
13790        des_int(n_depth, depth, 3);
13791        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13792        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13793        des_xmlNodePtr_ptr(n_lst, lst, 6);
13794        xmlResetLastError();
13795        if (mem_base != xmlMemBlocks()) {
13796            printf("Leak of %d blocks found in xmlParseExternalEntity",
13797	           xmlMemBlocks() - mem_base);
13798	    test_ret++;
13799            printf(" %d", n_doc);
13800            printf(" %d", n_sax);
13801            printf(" %d", n_user_data);
13802            printf(" %d", n_depth);
13803            printf(" %d", n_URL);
13804            printf(" %d", n_ID);
13805            printf(" %d", n_lst);
13806            printf("\n");
13807        }
13808    }
13809    }
13810    }
13811    }
13812    }
13813    }
13814    }
13815    function_tests++;
13816#endif
13817#endif
13818
13819    return(test_ret);
13820}
13821
13822
13823static int
13824test_xmlParseFile(void) {
13825    int test_ret = 0;
13826
13827#if defined(LIBXML_SAX1_ENABLED)
13828#ifdef LIBXML_SAX1_ENABLED
13829    int mem_base;
13830    xmlDocPtr ret_val;
13831    const char * filename; /* the filename */
13832    int n_filename;
13833
13834    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13835        mem_base = xmlMemBlocks();
13836        filename = gen_filepath(n_filename, 0);
13837
13838        ret_val = xmlParseFile(filename);
13839        desret_xmlDocPtr(ret_val);
13840        call_tests++;
13841        des_filepath(n_filename, filename, 0);
13842        xmlResetLastError();
13843        if (mem_base != xmlMemBlocks()) {
13844            printf("Leak of %d blocks found in xmlParseFile",
13845	           xmlMemBlocks() - mem_base);
13846	    test_ret++;
13847            printf(" %d", n_filename);
13848            printf("\n");
13849        }
13850    }
13851    function_tests++;
13852#endif
13853#endif
13854
13855    return(test_ret);
13856}
13857
13858
13859static int
13860test_xmlParseInNodeContext(void) {
13861    int test_ret = 0;
13862
13863    int mem_base;
13864    xmlParserErrors ret_val;
13865    xmlNodePtr node; /* the context node */
13866    int n_node;
13867    char * data; /* the input string */
13868    int n_data;
13869    int datalen; /* the input string length in bytes */
13870    int n_datalen;
13871    int options; /* a combination of xmlParserOption */
13872    int n_options;
13873    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13874    int n_lst;
13875
13876    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13877    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
13878    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
13879    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13880    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13881        mem_base = xmlMemBlocks();
13882        node = gen_xmlNodePtr(n_node, 0);
13883        data = gen_const_char_ptr(n_data, 1);
13884        datalen = gen_int(n_datalen, 2);
13885        options = gen_parseroptions(n_options, 3);
13886        lst = gen_xmlNodePtr_ptr(n_lst, 4);
13887
13888        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
13889        desret_xmlParserErrors(ret_val);
13890        call_tests++;
13891        des_xmlNodePtr(n_node, node, 0);
13892        des_const_char_ptr(n_data, (const char *)data, 1);
13893        des_int(n_datalen, datalen, 2);
13894        des_parseroptions(n_options, options, 3);
13895        des_xmlNodePtr_ptr(n_lst, lst, 4);
13896        xmlResetLastError();
13897        if (mem_base != xmlMemBlocks()) {
13898            printf("Leak of %d blocks found in xmlParseInNodeContext",
13899	           xmlMemBlocks() - mem_base);
13900	    test_ret++;
13901            printf(" %d", n_node);
13902            printf(" %d", n_data);
13903            printf(" %d", n_datalen);
13904            printf(" %d", n_options);
13905            printf(" %d", n_lst);
13906            printf("\n");
13907        }
13908    }
13909    }
13910    }
13911    }
13912    }
13913    function_tests++;
13914
13915    return(test_ret);
13916}
13917
13918
13919static int
13920test_xmlParseMemory(void) {
13921    int test_ret = 0;
13922
13923#if defined(LIBXML_SAX1_ENABLED)
13924#ifdef LIBXML_SAX1_ENABLED
13925    int mem_base;
13926    xmlDocPtr ret_val;
13927    char * buffer; /* an pointer to a char array */
13928    int n_buffer;
13929    int size; /* the size of the array */
13930    int n_size;
13931
13932    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
13933    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13934        mem_base = xmlMemBlocks();
13935        buffer = gen_const_char_ptr(n_buffer, 0);
13936        size = gen_int(n_size, 1);
13937
13938        ret_val = xmlParseMemory((const char *)buffer, size);
13939        desret_xmlDocPtr(ret_val);
13940        call_tests++;
13941        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
13942        des_int(n_size, size, 1);
13943        xmlResetLastError();
13944        if (mem_base != xmlMemBlocks()) {
13945            printf("Leak of %d blocks found in xmlParseMemory",
13946	           xmlMemBlocks() - mem_base);
13947	    test_ret++;
13948            printf(" %d", n_buffer);
13949            printf(" %d", n_size);
13950            printf("\n");
13951        }
13952    }
13953    }
13954    function_tests++;
13955#endif
13956#endif
13957
13958    return(test_ret);
13959}
13960
13961
13962#define gen_nb_const_xmlParserNodeInfoPtr 1
13963static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13964    return(NULL);
13965}
13966static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13967}
13968
13969static int
13970test_xmlParserAddNodeInfo(void) {
13971    int test_ret = 0;
13972
13973    int mem_base;
13974    xmlParserCtxtPtr ctxt; /* an XML parser context */
13975    int n_ctxt;
13976    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
13977    int n_info;
13978
13979    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13980    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
13981        mem_base = xmlMemBlocks();
13982        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13983        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
13984
13985        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
13986        call_tests++;
13987        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13988        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
13989        xmlResetLastError();
13990        if (mem_base != xmlMemBlocks()) {
13991            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
13992	           xmlMemBlocks() - mem_base);
13993	    test_ret++;
13994            printf(" %d", n_ctxt);
13995            printf(" %d", n_info);
13996            printf("\n");
13997        }
13998    }
13999    }
14000    function_tests++;
14001
14002    return(test_ret);
14003}
14004
14005
14006#define gen_nb_const_xmlParserCtxtPtr 1
14007static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14008    return(NULL);
14009}
14010static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14011}
14012
14013#define gen_nb_const_xmlNodePtr 1
14014static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14015    return(NULL);
14016}
14017static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14018}
14019
14020static int
14021test_xmlParserFindNodeInfo(void) {
14022    int test_ret = 0;
14023
14024    int mem_base;
14025    const xmlParserNodeInfo * ret_val;
14026    xmlParserCtxtPtr ctx; /* an XML parser context */
14027    int n_ctx;
14028    xmlNodePtr node; /* an XML node within the tree */
14029    int n_node;
14030
14031    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14032    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14033        mem_base = xmlMemBlocks();
14034        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14035        node = gen_const_xmlNodePtr(n_node, 1);
14036
14037        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14038        desret_const_xmlParserNodeInfo_ptr(ret_val);
14039        call_tests++;
14040        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14041        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14042        xmlResetLastError();
14043        if (mem_base != xmlMemBlocks()) {
14044            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14045	           xmlMemBlocks() - mem_base);
14046	    test_ret++;
14047            printf(" %d", n_ctx);
14048            printf(" %d", n_node);
14049            printf("\n");
14050        }
14051    }
14052    }
14053    function_tests++;
14054
14055    return(test_ret);
14056}
14057
14058
14059#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14060static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14061    return(NULL);
14062}
14063static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14064}
14065
14066static int
14067test_xmlParserFindNodeInfoIndex(void) {
14068    int test_ret = 0;
14069
14070    int mem_base;
14071    unsigned long ret_val;
14072    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14073    int n_seq;
14074    xmlNodePtr node; /* an XML node pointer */
14075    int n_node;
14076
14077    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14078    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14079        mem_base = xmlMemBlocks();
14080        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14081        node = gen_const_xmlNodePtr(n_node, 1);
14082
14083        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14084        desret_unsigned_long(ret_val);
14085        call_tests++;
14086        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14087        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14088        xmlResetLastError();
14089        if (mem_base != xmlMemBlocks()) {
14090            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14091	           xmlMemBlocks() - mem_base);
14092	    test_ret++;
14093            printf(" %d", n_seq);
14094            printf(" %d", n_node);
14095            printf("\n");
14096        }
14097    }
14098    }
14099    function_tests++;
14100
14101    return(test_ret);
14102}
14103
14104
14105#define gen_nb_xmlParserInputPtr 1
14106static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14107    return(NULL);
14108}
14109static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14110}
14111
14112static int
14113test_xmlParserInputGrow(void) {
14114    int test_ret = 0;
14115
14116    int mem_base;
14117    int ret_val;
14118    xmlParserInputPtr in; /* an XML parser input */
14119    int n_in;
14120    int len; /* an indicative size for the lookahead */
14121    int n_len;
14122
14123    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14124    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14125        mem_base = xmlMemBlocks();
14126        in = gen_xmlParserInputPtr(n_in, 0);
14127        len = gen_int(n_len, 1);
14128
14129        ret_val = xmlParserInputGrow(in, len);
14130        desret_int(ret_val);
14131        call_tests++;
14132        des_xmlParserInputPtr(n_in, in, 0);
14133        des_int(n_len, len, 1);
14134        xmlResetLastError();
14135        if (mem_base != xmlMemBlocks()) {
14136            printf("Leak of %d blocks found in xmlParserInputGrow",
14137	           xmlMemBlocks() - mem_base);
14138	    test_ret++;
14139            printf(" %d", n_in);
14140            printf(" %d", n_len);
14141            printf("\n");
14142        }
14143    }
14144    }
14145    function_tests++;
14146
14147    return(test_ret);
14148}
14149
14150
14151static int
14152test_xmlParserInputRead(void) {
14153    int test_ret = 0;
14154
14155    int mem_base;
14156    int ret_val;
14157    xmlParserInputPtr in; /* an XML parser input */
14158    int n_in;
14159    int len; /* an indicative size for the lookahead */
14160    int n_len;
14161
14162    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14163    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14164        mem_base = xmlMemBlocks();
14165        in = gen_xmlParserInputPtr(n_in, 0);
14166        len = gen_int(n_len, 1);
14167
14168        ret_val = xmlParserInputRead(in, len);
14169        desret_int(ret_val);
14170        call_tests++;
14171        des_xmlParserInputPtr(n_in, in, 0);
14172        des_int(n_len, len, 1);
14173        xmlResetLastError();
14174        if (mem_base != xmlMemBlocks()) {
14175            printf("Leak of %d blocks found in xmlParserInputRead",
14176	           xmlMemBlocks() - mem_base);
14177	    test_ret++;
14178            printf(" %d", n_in);
14179            printf(" %d", n_len);
14180            printf("\n");
14181        }
14182    }
14183    }
14184    function_tests++;
14185
14186    return(test_ret);
14187}
14188
14189
14190static int
14191test_xmlPedanticParserDefault(void) {
14192    int test_ret = 0;
14193
14194    int mem_base;
14195    int ret_val;
14196    int val; /* int 0 or 1 */
14197    int n_val;
14198
14199    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14200        mem_base = xmlMemBlocks();
14201        val = gen_int(n_val, 0);
14202
14203        ret_val = xmlPedanticParserDefault(val);
14204        desret_int(ret_val);
14205        call_tests++;
14206        des_int(n_val, val, 0);
14207        xmlResetLastError();
14208        if (mem_base != xmlMemBlocks()) {
14209            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14210	           xmlMemBlocks() - mem_base);
14211	    test_ret++;
14212            printf(" %d", n_val);
14213            printf("\n");
14214        }
14215    }
14216    function_tests++;
14217
14218    return(test_ret);
14219}
14220
14221
14222static int
14223test_xmlReadDoc(void) {
14224    int test_ret = 0;
14225
14226    int mem_base;
14227    xmlDocPtr ret_val;
14228    xmlChar * cur; /* a pointer to a zero terminated string */
14229    int n_cur;
14230    const char * URL; /* the base URL to use for the document */
14231    int n_URL;
14232    char * encoding; /* the document encoding, or NULL */
14233    int n_encoding;
14234    int options; /* a combination of xmlParserOption */
14235    int n_options;
14236
14237    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14238    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14239    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14240    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14241        mem_base = xmlMemBlocks();
14242        cur = gen_const_xmlChar_ptr(n_cur, 0);
14243        URL = gen_filepath(n_URL, 1);
14244        encoding = gen_const_char_ptr(n_encoding, 2);
14245        options = gen_parseroptions(n_options, 3);
14246
14247        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14248        desret_xmlDocPtr(ret_val);
14249        call_tests++;
14250        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14251        des_filepath(n_URL, URL, 1);
14252        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14253        des_parseroptions(n_options, options, 3);
14254        xmlResetLastError();
14255        if (mem_base != xmlMemBlocks()) {
14256            printf("Leak of %d blocks found in xmlReadDoc",
14257	           xmlMemBlocks() - mem_base);
14258	    test_ret++;
14259            printf(" %d", n_cur);
14260            printf(" %d", n_URL);
14261            printf(" %d", n_encoding);
14262            printf(" %d", n_options);
14263            printf("\n");
14264        }
14265    }
14266    }
14267    }
14268    }
14269    function_tests++;
14270
14271    return(test_ret);
14272}
14273
14274
14275static int
14276test_xmlReadFile(void) {
14277    int test_ret = 0;
14278
14279    int mem_base;
14280    xmlDocPtr ret_val;
14281    const char * filename; /* a file or URL */
14282    int n_filename;
14283    char * encoding; /* the document encoding, or NULL */
14284    int n_encoding;
14285    int options; /* a combination of xmlParserOption */
14286    int n_options;
14287
14288    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14289    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14290    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14291        mem_base = xmlMemBlocks();
14292        filename = gen_filepath(n_filename, 0);
14293        encoding = gen_const_char_ptr(n_encoding, 1);
14294        options = gen_parseroptions(n_options, 2);
14295
14296        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14297        desret_xmlDocPtr(ret_val);
14298        call_tests++;
14299        des_filepath(n_filename, filename, 0);
14300        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14301        des_parseroptions(n_options, options, 2);
14302        xmlResetLastError();
14303        if (mem_base != xmlMemBlocks()) {
14304            printf("Leak of %d blocks found in xmlReadFile",
14305	           xmlMemBlocks() - mem_base);
14306	    test_ret++;
14307            printf(" %d", n_filename);
14308            printf(" %d", n_encoding);
14309            printf(" %d", n_options);
14310            printf("\n");
14311        }
14312    }
14313    }
14314    }
14315    function_tests++;
14316
14317    return(test_ret);
14318}
14319
14320
14321static int
14322test_xmlReadMemory(void) {
14323    int test_ret = 0;
14324
14325    int mem_base;
14326    xmlDocPtr ret_val;
14327    char * buffer; /* a pointer to a char array */
14328    int n_buffer;
14329    int size; /* the size of the array */
14330    int n_size;
14331    const char * URL; /* the base URL to use for the document */
14332    int n_URL;
14333    char * encoding; /* the document encoding, or NULL */
14334    int n_encoding;
14335    int options; /* a combination of xmlParserOption */
14336    int n_options;
14337
14338    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14339    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14340    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14341    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14342    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14343        mem_base = xmlMemBlocks();
14344        buffer = gen_const_char_ptr(n_buffer, 0);
14345        size = gen_int(n_size, 1);
14346        URL = gen_filepath(n_URL, 2);
14347        encoding = gen_const_char_ptr(n_encoding, 3);
14348        options = gen_parseroptions(n_options, 4);
14349
14350        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14351        desret_xmlDocPtr(ret_val);
14352        call_tests++;
14353        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14354        des_int(n_size, size, 1);
14355        des_filepath(n_URL, URL, 2);
14356        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14357        des_parseroptions(n_options, options, 4);
14358        xmlResetLastError();
14359        if (mem_base != xmlMemBlocks()) {
14360            printf("Leak of %d blocks found in xmlReadMemory",
14361	           xmlMemBlocks() - mem_base);
14362	    test_ret++;
14363            printf(" %d", n_buffer);
14364            printf(" %d", n_size);
14365            printf(" %d", n_URL);
14366            printf(" %d", n_encoding);
14367            printf(" %d", n_options);
14368            printf("\n");
14369        }
14370    }
14371    }
14372    }
14373    }
14374    }
14375    function_tests++;
14376
14377    return(test_ret);
14378}
14379
14380
14381static int
14382test_xmlRecoverDoc(void) {
14383    int test_ret = 0;
14384
14385#if defined(LIBXML_SAX1_ENABLED)
14386#ifdef LIBXML_SAX1_ENABLED
14387    int mem_base;
14388    xmlDocPtr ret_val;
14389    xmlChar * cur; /* a pointer to an array of xmlChar */
14390    int n_cur;
14391
14392    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14393        mem_base = xmlMemBlocks();
14394        cur = gen_xmlChar_ptr(n_cur, 0);
14395
14396        ret_val = xmlRecoverDoc(cur);
14397        desret_xmlDocPtr(ret_val);
14398        call_tests++;
14399        des_xmlChar_ptr(n_cur, cur, 0);
14400        xmlResetLastError();
14401        if (mem_base != xmlMemBlocks()) {
14402            printf("Leak of %d blocks found in xmlRecoverDoc",
14403	           xmlMemBlocks() - mem_base);
14404	    test_ret++;
14405            printf(" %d", n_cur);
14406            printf("\n");
14407        }
14408    }
14409    function_tests++;
14410#endif
14411#endif
14412
14413    return(test_ret);
14414}
14415
14416
14417static int
14418test_xmlRecoverFile(void) {
14419    int test_ret = 0;
14420
14421#if defined(LIBXML_SAX1_ENABLED)
14422#ifdef LIBXML_SAX1_ENABLED
14423    int mem_base;
14424    xmlDocPtr ret_val;
14425    const char * filename; /* the filename */
14426    int n_filename;
14427
14428    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14429        mem_base = xmlMemBlocks();
14430        filename = gen_filepath(n_filename, 0);
14431
14432        ret_val = xmlRecoverFile(filename);
14433        desret_xmlDocPtr(ret_val);
14434        call_tests++;
14435        des_filepath(n_filename, filename, 0);
14436        xmlResetLastError();
14437        if (mem_base != xmlMemBlocks()) {
14438            printf("Leak of %d blocks found in xmlRecoverFile",
14439	           xmlMemBlocks() - mem_base);
14440	    test_ret++;
14441            printf(" %d", n_filename);
14442            printf("\n");
14443        }
14444    }
14445    function_tests++;
14446#endif
14447#endif
14448
14449    return(test_ret);
14450}
14451
14452
14453static int
14454test_xmlRecoverMemory(void) {
14455    int test_ret = 0;
14456
14457#if defined(LIBXML_SAX1_ENABLED)
14458#ifdef LIBXML_SAX1_ENABLED
14459    int mem_base;
14460    xmlDocPtr ret_val;
14461    char * buffer; /* an pointer to a char array */
14462    int n_buffer;
14463    int size; /* the size of the array */
14464    int n_size;
14465
14466    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14467    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14468        mem_base = xmlMemBlocks();
14469        buffer = gen_const_char_ptr(n_buffer, 0);
14470        size = gen_int(n_size, 1);
14471
14472        ret_val = xmlRecoverMemory((const char *)buffer, size);
14473        desret_xmlDocPtr(ret_val);
14474        call_tests++;
14475        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14476        des_int(n_size, size, 1);
14477        xmlResetLastError();
14478        if (mem_base != xmlMemBlocks()) {
14479            printf("Leak of %d blocks found in xmlRecoverMemory",
14480	           xmlMemBlocks() - mem_base);
14481	    test_ret++;
14482            printf(" %d", n_buffer);
14483            printf(" %d", n_size);
14484            printf("\n");
14485        }
14486    }
14487    }
14488    function_tests++;
14489#endif
14490#endif
14491
14492    return(test_ret);
14493}
14494
14495
14496static int
14497test_xmlSAXParseDTD(void) {
14498    int test_ret = 0;
14499
14500#if defined(LIBXML_VALID_ENABLED)
14501#ifdef LIBXML_SAX1_ENABLED
14502    int mem_base;
14503    xmlDtdPtr ret_val;
14504    xmlSAXHandlerPtr sax; /* the SAX handler block */
14505    int n_sax;
14506    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14507    int n_ExternalID;
14508    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14509    int n_SystemID;
14510
14511    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14512    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14513    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14514        mem_base = xmlMemBlocks();
14515        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14516        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14517        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14518
14519        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14520        desret_xmlDtdPtr(ret_val);
14521        call_tests++;
14522        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14523        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14524        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14525        xmlResetLastError();
14526        if (mem_base != xmlMemBlocks()) {
14527            printf("Leak of %d blocks found in xmlSAXParseDTD",
14528	           xmlMemBlocks() - mem_base);
14529	    test_ret++;
14530            printf(" %d", n_sax);
14531            printf(" %d", n_ExternalID);
14532            printf(" %d", n_SystemID);
14533            printf("\n");
14534        }
14535    }
14536    }
14537    }
14538    function_tests++;
14539#endif
14540#endif
14541
14542    return(test_ret);
14543}
14544
14545
14546static int
14547test_xmlSAXParseDoc(void) {
14548    int test_ret = 0;
14549
14550#if defined(LIBXML_SAX1_ENABLED)
14551#ifdef LIBXML_SAX1_ENABLED
14552    int mem_base;
14553    xmlDocPtr ret_val;
14554    xmlSAXHandlerPtr sax; /* the SAX handler block */
14555    int n_sax;
14556    xmlChar * cur; /* a pointer to an array of xmlChar */
14557    int n_cur;
14558    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14559    int n_recovery;
14560
14561    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14562    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14563    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14564        mem_base = xmlMemBlocks();
14565        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14566        cur = gen_const_xmlChar_ptr(n_cur, 1);
14567        recovery = gen_int(n_recovery, 2);
14568
14569        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14570        desret_xmlDocPtr(ret_val);
14571        call_tests++;
14572        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14573        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14574        des_int(n_recovery, recovery, 2);
14575        xmlResetLastError();
14576        if (mem_base != xmlMemBlocks()) {
14577            printf("Leak of %d blocks found in xmlSAXParseDoc",
14578	           xmlMemBlocks() - mem_base);
14579	    test_ret++;
14580            printf(" %d", n_sax);
14581            printf(" %d", n_cur);
14582            printf(" %d", n_recovery);
14583            printf("\n");
14584        }
14585    }
14586    }
14587    }
14588    function_tests++;
14589#endif
14590#endif
14591
14592    return(test_ret);
14593}
14594
14595
14596static int
14597test_xmlSAXParseEntity(void) {
14598    int test_ret = 0;
14599
14600#if defined(LIBXML_SAX1_ENABLED)
14601#ifdef LIBXML_SAX1_ENABLED
14602    int mem_base;
14603    xmlDocPtr ret_val;
14604    xmlSAXHandlerPtr sax; /* the SAX handler block */
14605    int n_sax;
14606    const char * filename; /* the filename */
14607    int n_filename;
14608
14609    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14610    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14611        mem_base = xmlMemBlocks();
14612        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14613        filename = gen_filepath(n_filename, 1);
14614
14615        ret_val = xmlSAXParseEntity(sax, filename);
14616        desret_xmlDocPtr(ret_val);
14617        call_tests++;
14618        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14619        des_filepath(n_filename, filename, 1);
14620        xmlResetLastError();
14621        if (mem_base != xmlMemBlocks()) {
14622            printf("Leak of %d blocks found in xmlSAXParseEntity",
14623	           xmlMemBlocks() - mem_base);
14624	    test_ret++;
14625            printf(" %d", n_sax);
14626            printf(" %d", n_filename);
14627            printf("\n");
14628        }
14629    }
14630    }
14631    function_tests++;
14632#endif
14633#endif
14634
14635    return(test_ret);
14636}
14637
14638
14639static int
14640test_xmlSAXParseFile(void) {
14641    int test_ret = 0;
14642
14643#if defined(LIBXML_SAX1_ENABLED)
14644#ifdef LIBXML_SAX1_ENABLED
14645    int mem_base;
14646    xmlDocPtr ret_val;
14647    xmlSAXHandlerPtr sax; /* the SAX handler block */
14648    int n_sax;
14649    const char * filename; /* the filename */
14650    int n_filename;
14651    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14652    int n_recovery;
14653
14654    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14655    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14656    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14657        mem_base = xmlMemBlocks();
14658        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14659        filename = gen_filepath(n_filename, 1);
14660        recovery = gen_int(n_recovery, 2);
14661
14662        ret_val = xmlSAXParseFile(sax, filename, recovery);
14663        desret_xmlDocPtr(ret_val);
14664        call_tests++;
14665        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14666        des_filepath(n_filename, filename, 1);
14667        des_int(n_recovery, recovery, 2);
14668        xmlResetLastError();
14669        if (mem_base != xmlMemBlocks()) {
14670            printf("Leak of %d blocks found in xmlSAXParseFile",
14671	           xmlMemBlocks() - mem_base);
14672	    test_ret++;
14673            printf(" %d", n_sax);
14674            printf(" %d", n_filename);
14675            printf(" %d", n_recovery);
14676            printf("\n");
14677        }
14678    }
14679    }
14680    }
14681    function_tests++;
14682#endif
14683#endif
14684
14685    return(test_ret);
14686}
14687
14688
14689static int
14690test_xmlSAXParseFileWithData(void) {
14691    int test_ret = 0;
14692
14693#if defined(LIBXML_SAX1_ENABLED)
14694#ifdef LIBXML_SAX1_ENABLED
14695    int mem_base;
14696    xmlDocPtr ret_val;
14697    xmlSAXHandlerPtr sax; /* the SAX handler block */
14698    int n_sax;
14699    const char * filename; /* the filename */
14700    int n_filename;
14701    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14702    int n_recovery;
14703    void * data; /* the userdata */
14704    int n_data;
14705
14706    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14707    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14708    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14709    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14710        mem_base = xmlMemBlocks();
14711        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14712        filename = gen_filepath(n_filename, 1);
14713        recovery = gen_int(n_recovery, 2);
14714        data = gen_userdata(n_data, 3);
14715
14716        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14717        desret_xmlDocPtr(ret_val);
14718        call_tests++;
14719        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14720        des_filepath(n_filename, filename, 1);
14721        des_int(n_recovery, recovery, 2);
14722        des_userdata(n_data, data, 3);
14723        xmlResetLastError();
14724        if (mem_base != xmlMemBlocks()) {
14725            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14726	           xmlMemBlocks() - mem_base);
14727	    test_ret++;
14728            printf(" %d", n_sax);
14729            printf(" %d", n_filename);
14730            printf(" %d", n_recovery);
14731            printf(" %d", n_data);
14732            printf("\n");
14733        }
14734    }
14735    }
14736    }
14737    }
14738    function_tests++;
14739#endif
14740#endif
14741
14742    return(test_ret);
14743}
14744
14745
14746static int
14747test_xmlSAXParseMemory(void) {
14748    int test_ret = 0;
14749
14750#if defined(LIBXML_SAX1_ENABLED)
14751#ifdef LIBXML_SAX1_ENABLED
14752    int mem_base;
14753    xmlDocPtr ret_val;
14754    xmlSAXHandlerPtr sax; /* the SAX handler block */
14755    int n_sax;
14756    char * buffer; /* an pointer to a char array */
14757    int n_buffer;
14758    int size; /* the size of the array */
14759    int n_size;
14760    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14761    int n_recovery;
14762
14763    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14764    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14765    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14766    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14767        mem_base = xmlMemBlocks();
14768        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14769        buffer = gen_const_char_ptr(n_buffer, 1);
14770        size = gen_int(n_size, 2);
14771        recovery = gen_int(n_recovery, 3);
14772
14773        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14774        desret_xmlDocPtr(ret_val);
14775        call_tests++;
14776        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14777        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14778        des_int(n_size, size, 2);
14779        des_int(n_recovery, recovery, 3);
14780        xmlResetLastError();
14781        if (mem_base != xmlMemBlocks()) {
14782            printf("Leak of %d blocks found in xmlSAXParseMemory",
14783	           xmlMemBlocks() - mem_base);
14784	    test_ret++;
14785            printf(" %d", n_sax);
14786            printf(" %d", n_buffer);
14787            printf(" %d", n_size);
14788            printf(" %d", n_recovery);
14789            printf("\n");
14790        }
14791    }
14792    }
14793    }
14794    }
14795    function_tests++;
14796#endif
14797#endif
14798
14799    return(test_ret);
14800}
14801
14802
14803static int
14804test_xmlSAXParseMemoryWithData(void) {
14805    int test_ret = 0;
14806
14807#if defined(LIBXML_SAX1_ENABLED)
14808#ifdef LIBXML_SAX1_ENABLED
14809    int mem_base;
14810    xmlDocPtr ret_val;
14811    xmlSAXHandlerPtr sax; /* the SAX handler block */
14812    int n_sax;
14813    char * buffer; /* an pointer to a char array */
14814    int n_buffer;
14815    int size; /* the size of the array */
14816    int n_size;
14817    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14818    int n_recovery;
14819    void * data; /* the userdata */
14820    int n_data;
14821
14822    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14823    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14824    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14825    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14826    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14827        mem_base = xmlMemBlocks();
14828        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14829        buffer = gen_const_char_ptr(n_buffer, 1);
14830        size = gen_int(n_size, 2);
14831        recovery = gen_int(n_recovery, 3);
14832        data = gen_userdata(n_data, 4);
14833
14834        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
14835        desret_xmlDocPtr(ret_val);
14836        call_tests++;
14837        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14838        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14839        des_int(n_size, size, 2);
14840        des_int(n_recovery, recovery, 3);
14841        des_userdata(n_data, data, 4);
14842        xmlResetLastError();
14843        if (mem_base != xmlMemBlocks()) {
14844            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14845	           xmlMemBlocks() - mem_base);
14846	    test_ret++;
14847            printf(" %d", n_sax);
14848            printf(" %d", n_buffer);
14849            printf(" %d", n_size);
14850            printf(" %d", n_recovery);
14851            printf(" %d", n_data);
14852            printf("\n");
14853        }
14854    }
14855    }
14856    }
14857    }
14858    }
14859    function_tests++;
14860#endif
14861#endif
14862
14863    return(test_ret);
14864}
14865
14866
14867static int
14868test_xmlSAXUserParseFile(void) {
14869    int test_ret = 0;
14870
14871#if defined(LIBXML_SAX1_ENABLED)
14872#ifdef LIBXML_SAX1_ENABLED
14873    int mem_base;
14874    int ret_val;
14875    xmlSAXHandlerPtr sax; /* a SAX handler */
14876    int n_sax;
14877    void * user_data; /* The user data returned on SAX callbacks */
14878    int n_user_data;
14879    const char * filename; /* a file name */
14880    int n_filename;
14881
14882    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14883    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14884    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14885        mem_base = xmlMemBlocks();
14886        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14887        user_data = gen_userdata(n_user_data, 1);
14888        filename = gen_filepath(n_filename, 2);
14889
14890#ifdef LIBXML_SAX1_ENABLED
14891        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14892#endif
14893
14894
14895        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
14896        desret_int(ret_val);
14897        call_tests++;
14898        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14899        des_userdata(n_user_data, user_data, 1);
14900        des_filepath(n_filename, filename, 2);
14901        xmlResetLastError();
14902        if (mem_base != xmlMemBlocks()) {
14903            printf("Leak of %d blocks found in xmlSAXUserParseFile",
14904	           xmlMemBlocks() - mem_base);
14905	    test_ret++;
14906            printf(" %d", n_sax);
14907            printf(" %d", n_user_data);
14908            printf(" %d", n_filename);
14909            printf("\n");
14910        }
14911    }
14912    }
14913    }
14914    function_tests++;
14915#endif
14916#endif
14917
14918    return(test_ret);
14919}
14920
14921
14922static int
14923test_xmlSAXUserParseMemory(void) {
14924    int test_ret = 0;
14925
14926#if defined(LIBXML_SAX1_ENABLED)
14927#ifdef LIBXML_SAX1_ENABLED
14928    int mem_base;
14929    int ret_val;
14930    xmlSAXHandlerPtr sax; /* a SAX handler */
14931    int n_sax;
14932    void * user_data; /* The user data returned on SAX callbacks */
14933    int n_user_data;
14934    char * buffer; /* an in-memory XML document input */
14935    int n_buffer;
14936    int size; /* the length of the XML document in bytes */
14937    int n_size;
14938
14939    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14940    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14941    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14942    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14943        mem_base = xmlMemBlocks();
14944        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14945        user_data = gen_userdata(n_user_data, 1);
14946        buffer = gen_const_char_ptr(n_buffer, 2);
14947        size = gen_int(n_size, 3);
14948
14949#ifdef LIBXML_SAX1_ENABLED
14950        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14951#endif
14952
14953
14954        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
14955        desret_int(ret_val);
14956        call_tests++;
14957        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14958        des_userdata(n_user_data, user_data, 1);
14959        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
14960        des_int(n_size, size, 3);
14961        xmlResetLastError();
14962        if (mem_base != xmlMemBlocks()) {
14963            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
14964	           xmlMemBlocks() - mem_base);
14965	    test_ret++;
14966            printf(" %d", n_sax);
14967            printf(" %d", n_user_data);
14968            printf(" %d", n_buffer);
14969            printf(" %d", n_size);
14970            printf("\n");
14971        }
14972    }
14973    }
14974    }
14975    }
14976    function_tests++;
14977#endif
14978#endif
14979
14980    return(test_ret);
14981}
14982
14983
14984static int
14985test_xmlSetExternalEntityLoader(void) {
14986    int test_ret = 0;
14987
14988
14989    /* missing type support */
14990    return(test_ret);
14991}
14992
14993
14994static int
14995test_xmlSetFeature(void) {
14996    int test_ret = 0;
14997
14998#if defined(LIBXML_LEGACY_ENABLED)
14999#ifdef LIBXML_LEGACY_ENABLED
15000    int mem_base;
15001    int ret_val;
15002    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15003    int n_ctxt;
15004    char * name; /* the feature name */
15005    int n_name;
15006    void * value; /* pointer to the location of the new value */
15007    int n_value;
15008
15009    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15010    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15011    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15012        mem_base = xmlMemBlocks();
15013        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15014        name = gen_const_char_ptr(n_name, 1);
15015        value = gen_void_ptr(n_value, 2);
15016
15017        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15018        desret_int(ret_val);
15019        call_tests++;
15020        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15021        des_const_char_ptr(n_name, (const char *)name, 1);
15022        des_void_ptr(n_value, value, 2);
15023        xmlResetLastError();
15024        if (mem_base != xmlMemBlocks()) {
15025            printf("Leak of %d blocks found in xmlSetFeature",
15026	           xmlMemBlocks() - mem_base);
15027	    test_ret++;
15028            printf(" %d", n_ctxt);
15029            printf(" %d", n_name);
15030            printf(" %d", n_value);
15031            printf("\n");
15032        }
15033    }
15034    }
15035    }
15036    function_tests++;
15037#endif
15038#endif
15039
15040    return(test_ret);
15041}
15042
15043
15044static int
15045test_xmlSetupParserForBuffer(void) {
15046    int test_ret = 0;
15047
15048#if defined(LIBXML_SAX1_ENABLED)
15049#ifdef LIBXML_SAX1_ENABLED
15050    int mem_base;
15051    xmlParserCtxtPtr ctxt; /* an XML parser context */
15052    int n_ctxt;
15053    xmlChar * buffer; /* a xmlChar * buffer */
15054    int n_buffer;
15055    const char * filename; /* a file name */
15056    int n_filename;
15057
15058    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15059    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15060    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15061        mem_base = xmlMemBlocks();
15062        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15063        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15064        filename = gen_filepath(n_filename, 2);
15065
15066        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15067        call_tests++;
15068        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15069        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15070        des_filepath(n_filename, filename, 2);
15071        xmlResetLastError();
15072        if (mem_base != xmlMemBlocks()) {
15073            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15074	           xmlMemBlocks() - mem_base);
15075	    test_ret++;
15076            printf(" %d", n_ctxt);
15077            printf(" %d", n_buffer);
15078            printf(" %d", n_filename);
15079            printf("\n");
15080        }
15081    }
15082    }
15083    }
15084    function_tests++;
15085#endif
15086#endif
15087
15088    return(test_ret);
15089}
15090
15091
15092static int
15093test_xmlStopParser(void) {
15094    int test_ret = 0;
15095
15096#if defined(LIBXML_PUSH_ENABLED)
15097#ifdef LIBXML_PUSH_ENABLED
15098    int mem_base;
15099    xmlParserCtxtPtr ctxt; /* an XML parser context */
15100    int n_ctxt;
15101
15102    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15103        mem_base = xmlMemBlocks();
15104        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15105
15106        xmlStopParser(ctxt);
15107        call_tests++;
15108        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15109        xmlResetLastError();
15110        if (mem_base != xmlMemBlocks()) {
15111            printf("Leak of %d blocks found in xmlStopParser",
15112	           xmlMemBlocks() - mem_base);
15113	    test_ret++;
15114            printf(" %d", n_ctxt);
15115            printf("\n");
15116        }
15117    }
15118    function_tests++;
15119#endif
15120#endif
15121
15122    return(test_ret);
15123}
15124
15125
15126static int
15127test_xmlSubstituteEntitiesDefault(void) {
15128    int test_ret = 0;
15129
15130    int mem_base;
15131    int ret_val;
15132    int val; /* int 0 or 1 */
15133    int n_val;
15134
15135    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15136        mem_base = xmlMemBlocks();
15137        val = gen_int(n_val, 0);
15138
15139        ret_val = xmlSubstituteEntitiesDefault(val);
15140        desret_int(ret_val);
15141        call_tests++;
15142        des_int(n_val, val, 0);
15143        xmlResetLastError();
15144        if (mem_base != xmlMemBlocks()) {
15145            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15146	           xmlMemBlocks() - mem_base);
15147	    test_ret++;
15148            printf(" %d", n_val);
15149            printf("\n");
15150        }
15151    }
15152    function_tests++;
15153
15154    return(test_ret);
15155}
15156
15157static int
15158test_parser(void) {
15159    int test_ret = 0;
15160
15161    if (quiet == 0) printf("Testing parser : 60 of 69 functions ...\n");
15162    test_ret += test_xmlByteConsumed();
15163    test_ret += test_xmlClearNodeInfoSeq();
15164    test_ret += test_xmlClearParserCtxt();
15165    test_ret += test_xmlCreateDocParserCtxt();
15166    test_ret += test_xmlCreatePushParserCtxt();
15167    test_ret += test_xmlCtxtReadDoc();
15168    test_ret += test_xmlCtxtReadFile();
15169    test_ret += test_xmlCtxtReadMemory();
15170    test_ret += test_xmlCtxtReset();
15171    test_ret += test_xmlCtxtResetPush();
15172    test_ret += test_xmlCtxtUseOptions();
15173    test_ret += test_xmlGetExternalEntityLoader();
15174    test_ret += test_xmlGetFeature();
15175    test_ret += test_xmlGetFeaturesList();
15176    test_ret += test_xmlIOParseDTD();
15177    test_ret += test_xmlInitNodeInfoSeq();
15178    test_ret += test_xmlInitParser();
15179    test_ret += test_xmlInitParserCtxt();
15180    test_ret += test_xmlKeepBlanksDefault();
15181    test_ret += test_xmlLineNumbersDefault();
15182    test_ret += test_xmlLoadExternalEntity();
15183    test_ret += test_xmlNewIOInputStream();
15184    test_ret += test_xmlNewParserCtxt();
15185    test_ret += test_xmlParseBalancedChunkMemory();
15186    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15187    test_ret += test_xmlParseChunk();
15188    test_ret += test_xmlParseCtxtExternalEntity();
15189    test_ret += test_xmlParseDTD();
15190    test_ret += test_xmlParseDoc();
15191    test_ret += test_xmlParseDocument();
15192    test_ret += test_xmlParseEntity();
15193    test_ret += test_xmlParseExtParsedEnt();
15194    test_ret += test_xmlParseExternalEntity();
15195    test_ret += test_xmlParseFile();
15196    test_ret += test_xmlParseInNodeContext();
15197    test_ret += test_xmlParseMemory();
15198    test_ret += test_xmlParserAddNodeInfo();
15199    test_ret += test_xmlParserFindNodeInfo();
15200    test_ret += test_xmlParserFindNodeInfoIndex();
15201    test_ret += test_xmlParserInputGrow();
15202    test_ret += test_xmlParserInputRead();
15203    test_ret += test_xmlPedanticParserDefault();
15204    test_ret += test_xmlReadDoc();
15205    test_ret += test_xmlReadFile();
15206    test_ret += test_xmlReadMemory();
15207    test_ret += test_xmlRecoverDoc();
15208    test_ret += test_xmlRecoverFile();
15209    test_ret += test_xmlRecoverMemory();
15210    test_ret += test_xmlSAXParseDTD();
15211    test_ret += test_xmlSAXParseDoc();
15212    test_ret += test_xmlSAXParseEntity();
15213    test_ret += test_xmlSAXParseFile();
15214    test_ret += test_xmlSAXParseFileWithData();
15215    test_ret += test_xmlSAXParseMemory();
15216    test_ret += test_xmlSAXParseMemoryWithData();
15217    test_ret += test_xmlSAXUserParseFile();
15218    test_ret += test_xmlSAXUserParseMemory();
15219    test_ret += test_xmlSetExternalEntityLoader();
15220    test_ret += test_xmlSetFeature();
15221    test_ret += test_xmlSetupParserForBuffer();
15222    test_ret += test_xmlStopParser();
15223    test_ret += test_xmlSubstituteEntitiesDefault();
15224
15225    if (test_ret != 0)
15226	printf("Module parser: %d errors\n", test_ret);
15227    return(test_ret);
15228}
15229
15230static int
15231test_htmlCreateFileParserCtxt(void) {
15232    int test_ret = 0;
15233
15234#if defined(LIBXML_HTML_ENABLED)
15235    int mem_base;
15236    htmlParserCtxtPtr ret_val;
15237    const char * filename; /* the filename */
15238    int n_filename;
15239    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15240    int n_encoding;
15241
15242    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15243    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15244        mem_base = xmlMemBlocks();
15245        filename = gen_fileoutput(n_filename, 0);
15246        encoding = gen_const_char_ptr(n_encoding, 1);
15247
15248        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15249        desret_htmlParserCtxtPtr(ret_val);
15250        call_tests++;
15251        des_fileoutput(n_filename, filename, 0);
15252        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15253        xmlResetLastError();
15254        if (mem_base != xmlMemBlocks()) {
15255            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15256	           xmlMemBlocks() - mem_base);
15257	    test_ret++;
15258            printf(" %d", n_filename);
15259            printf(" %d", n_encoding);
15260            printf("\n");
15261        }
15262    }
15263    }
15264    function_tests++;
15265#endif
15266
15267    return(test_ret);
15268}
15269
15270
15271static int
15272test_htmlInitAutoClose(void) {
15273    int test_ret = 0;
15274
15275#if defined(LIBXML_HTML_ENABLED)
15276    int mem_base;
15277
15278        mem_base = xmlMemBlocks();
15279
15280        htmlInitAutoClose();
15281        call_tests++;
15282        xmlResetLastError();
15283        if (mem_base != xmlMemBlocks()) {
15284            printf("Leak of %d blocks found in htmlInitAutoClose",
15285	           xmlMemBlocks() - mem_base);
15286	    test_ret++;
15287            printf("\n");
15288        }
15289    function_tests++;
15290#endif
15291
15292    return(test_ret);
15293}
15294
15295
15296static int
15297test_inputPop(void) {
15298    int test_ret = 0;
15299
15300    int mem_base;
15301    xmlParserInputPtr ret_val;
15302    xmlParserCtxtPtr ctxt; /* an XML parser context */
15303    int n_ctxt;
15304
15305    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15306        mem_base = xmlMemBlocks();
15307        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15308
15309        ret_val = inputPop(ctxt);
15310        desret_xmlParserInputPtr(ret_val);
15311        call_tests++;
15312        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15313        xmlResetLastError();
15314        if (mem_base != xmlMemBlocks()) {
15315            printf("Leak of %d blocks found in inputPop",
15316	           xmlMemBlocks() - mem_base);
15317	    test_ret++;
15318            printf(" %d", n_ctxt);
15319            printf("\n");
15320        }
15321    }
15322    function_tests++;
15323
15324    return(test_ret);
15325}
15326
15327
15328static int
15329test_inputPush(void) {
15330    int test_ret = 0;
15331
15332    int mem_base;
15333    int ret_val;
15334    xmlParserCtxtPtr ctxt; /* an XML parser context */
15335    int n_ctxt;
15336    xmlParserInputPtr value; /* the parser input */
15337    int n_value;
15338
15339    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15340    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15341        mem_base = xmlMemBlocks();
15342        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15343        value = gen_xmlParserInputPtr(n_value, 1);
15344
15345        ret_val = inputPush(ctxt, value);
15346        desret_int(ret_val);
15347        call_tests++;
15348        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15349        des_xmlParserInputPtr(n_value, value, 1);
15350        xmlResetLastError();
15351        if (mem_base != xmlMemBlocks()) {
15352            printf("Leak of %d blocks found in inputPush",
15353	           xmlMemBlocks() - mem_base);
15354	    test_ret++;
15355            printf(" %d", n_ctxt);
15356            printf(" %d", n_value);
15357            printf("\n");
15358        }
15359    }
15360    }
15361    function_tests++;
15362
15363    return(test_ret);
15364}
15365
15366
15367static int
15368test_namePop(void) {
15369    int test_ret = 0;
15370
15371    int mem_base;
15372    const xmlChar * ret_val;
15373    xmlParserCtxtPtr ctxt; /* an XML parser context */
15374    int n_ctxt;
15375
15376    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15377        mem_base = xmlMemBlocks();
15378        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15379
15380        ret_val = namePop(ctxt);
15381        desret_const_xmlChar_ptr(ret_val);
15382        call_tests++;
15383        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15384        xmlResetLastError();
15385        if (mem_base != xmlMemBlocks()) {
15386            printf("Leak of %d blocks found in namePop",
15387	           xmlMemBlocks() - mem_base);
15388	    test_ret++;
15389            printf(" %d", n_ctxt);
15390            printf("\n");
15391        }
15392    }
15393    function_tests++;
15394
15395    return(test_ret);
15396}
15397
15398
15399static int
15400test_namePush(void) {
15401    int test_ret = 0;
15402
15403    int mem_base;
15404    int ret_val;
15405    xmlParserCtxtPtr ctxt; /* an XML parser context */
15406    int n_ctxt;
15407    xmlChar * value; /* the element name */
15408    int n_value;
15409
15410    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15411    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15412        mem_base = xmlMemBlocks();
15413        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15414        value = gen_const_xmlChar_ptr(n_value, 1);
15415
15416        ret_val = namePush(ctxt, (const xmlChar *)value);
15417        desret_int(ret_val);
15418        call_tests++;
15419        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15420        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15421        xmlResetLastError();
15422        if (mem_base != xmlMemBlocks()) {
15423            printf("Leak of %d blocks found in namePush",
15424	           xmlMemBlocks() - mem_base);
15425	    test_ret++;
15426            printf(" %d", n_ctxt);
15427            printf(" %d", n_value);
15428            printf("\n");
15429        }
15430    }
15431    }
15432    function_tests++;
15433
15434    return(test_ret);
15435}
15436
15437
15438static int
15439test_nodePop(void) {
15440    int test_ret = 0;
15441
15442    int mem_base;
15443    xmlNodePtr ret_val;
15444    xmlParserCtxtPtr ctxt; /* an XML parser context */
15445    int n_ctxt;
15446
15447    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15448        mem_base = xmlMemBlocks();
15449        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15450
15451        ret_val = nodePop(ctxt);
15452        desret_xmlNodePtr(ret_val);
15453        call_tests++;
15454        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15455        xmlResetLastError();
15456        if (mem_base != xmlMemBlocks()) {
15457            printf("Leak of %d blocks found in nodePop",
15458	           xmlMemBlocks() - mem_base);
15459	    test_ret++;
15460            printf(" %d", n_ctxt);
15461            printf("\n");
15462        }
15463    }
15464    function_tests++;
15465
15466    return(test_ret);
15467}
15468
15469
15470static int
15471test_nodePush(void) {
15472    int test_ret = 0;
15473
15474    int mem_base;
15475    int ret_val;
15476    xmlParserCtxtPtr ctxt; /* an XML parser context */
15477    int n_ctxt;
15478    xmlNodePtr value; /* the element node */
15479    int n_value;
15480
15481    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15482    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15483        mem_base = xmlMemBlocks();
15484        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15485        value = gen_xmlNodePtr(n_value, 1);
15486
15487        ret_val = nodePush(ctxt, value);
15488        desret_int(ret_val);
15489        call_tests++;
15490        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15491        des_xmlNodePtr(n_value, value, 1);
15492        xmlResetLastError();
15493        if (mem_base != xmlMemBlocks()) {
15494            printf("Leak of %d blocks found in nodePush",
15495	           xmlMemBlocks() - mem_base);
15496	    test_ret++;
15497            printf(" %d", n_ctxt);
15498            printf(" %d", n_value);
15499            printf("\n");
15500        }
15501    }
15502    }
15503    function_tests++;
15504
15505    return(test_ret);
15506}
15507
15508
15509static int
15510test_xmlCheckLanguageID(void) {
15511    int test_ret = 0;
15512
15513    int mem_base;
15514    int ret_val;
15515    xmlChar * lang; /* pointer to the string value */
15516    int n_lang;
15517
15518    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15519        mem_base = xmlMemBlocks();
15520        lang = gen_const_xmlChar_ptr(n_lang, 0);
15521
15522        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15523        desret_int(ret_val);
15524        call_tests++;
15525        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15526        xmlResetLastError();
15527        if (mem_base != xmlMemBlocks()) {
15528            printf("Leak of %d blocks found in xmlCheckLanguageID",
15529	           xmlMemBlocks() - mem_base);
15530	    test_ret++;
15531            printf(" %d", n_lang);
15532            printf("\n");
15533        }
15534    }
15535    function_tests++;
15536
15537    return(test_ret);
15538}
15539
15540
15541static int
15542test_xmlCopyChar(void) {
15543    int test_ret = 0;
15544
15545    int mem_base;
15546    int ret_val;
15547    int len; /* Ignored, compatibility */
15548    int n_len;
15549    xmlChar * out; /* pointer to an array of xmlChar */
15550    int n_out;
15551    int val; /* the char value */
15552    int n_val;
15553
15554    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15555    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15556    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15557        mem_base = xmlMemBlocks();
15558        len = gen_int(n_len, 0);
15559        out = gen_xmlChar_ptr(n_out, 1);
15560        val = gen_int(n_val, 2);
15561
15562        ret_val = xmlCopyChar(len, out, val);
15563        desret_int(ret_val);
15564        call_tests++;
15565        des_int(n_len, len, 0);
15566        des_xmlChar_ptr(n_out, out, 1);
15567        des_int(n_val, val, 2);
15568        xmlResetLastError();
15569        if (mem_base != xmlMemBlocks()) {
15570            printf("Leak of %d blocks found in xmlCopyChar",
15571	           xmlMemBlocks() - mem_base);
15572	    test_ret++;
15573            printf(" %d", n_len);
15574            printf(" %d", n_out);
15575            printf(" %d", n_val);
15576            printf("\n");
15577        }
15578    }
15579    }
15580    }
15581    function_tests++;
15582
15583    return(test_ret);
15584}
15585
15586
15587static int
15588test_xmlCopyCharMultiByte(void) {
15589    int test_ret = 0;
15590
15591    int mem_base;
15592    int ret_val;
15593    xmlChar * out; /* pointer to an array of xmlChar */
15594    int n_out;
15595    int val; /* the char value */
15596    int n_val;
15597
15598    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15599    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15600        mem_base = xmlMemBlocks();
15601        out = gen_xmlChar_ptr(n_out, 0);
15602        val = gen_int(n_val, 1);
15603
15604        ret_val = xmlCopyCharMultiByte(out, val);
15605        desret_int(ret_val);
15606        call_tests++;
15607        des_xmlChar_ptr(n_out, out, 0);
15608        des_int(n_val, val, 1);
15609        xmlResetLastError();
15610        if (mem_base != xmlMemBlocks()) {
15611            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15612	           xmlMemBlocks() - mem_base);
15613	    test_ret++;
15614            printf(" %d", n_out);
15615            printf(" %d", n_val);
15616            printf("\n");
15617        }
15618    }
15619    }
15620    function_tests++;
15621
15622    return(test_ret);
15623}
15624
15625
15626static int
15627test_xmlCreateEntityParserCtxt(void) {
15628    int test_ret = 0;
15629
15630    int mem_base;
15631    xmlParserCtxtPtr ret_val;
15632    xmlChar * URL; /* the entity URL */
15633    int n_URL;
15634    xmlChar * ID; /* the entity PUBLIC ID */
15635    int n_ID;
15636    xmlChar * base; /* a possible base for the target URI */
15637    int n_base;
15638
15639    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15640    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15641    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15642        mem_base = xmlMemBlocks();
15643        URL = gen_const_xmlChar_ptr(n_URL, 0);
15644        ID = gen_const_xmlChar_ptr(n_ID, 1);
15645        base = gen_const_xmlChar_ptr(n_base, 2);
15646
15647        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15648        desret_xmlParserCtxtPtr(ret_val);
15649        call_tests++;
15650        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15651        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15652        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15653        xmlResetLastError();
15654        if (mem_base != xmlMemBlocks()) {
15655            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15656	           xmlMemBlocks() - mem_base);
15657	    test_ret++;
15658            printf(" %d", n_URL);
15659            printf(" %d", n_ID);
15660            printf(" %d", n_base);
15661            printf("\n");
15662        }
15663    }
15664    }
15665    }
15666    function_tests++;
15667
15668    return(test_ret);
15669}
15670
15671
15672static int
15673test_xmlCreateFileParserCtxt(void) {
15674    int test_ret = 0;
15675
15676    int mem_base;
15677    xmlParserCtxtPtr ret_val;
15678    const char * filename; /* the filename */
15679    int n_filename;
15680
15681    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15682        mem_base = xmlMemBlocks();
15683        filename = gen_fileoutput(n_filename, 0);
15684
15685        ret_val = xmlCreateFileParserCtxt(filename);
15686        desret_xmlParserCtxtPtr(ret_val);
15687        call_tests++;
15688        des_fileoutput(n_filename, filename, 0);
15689        xmlResetLastError();
15690        if (mem_base != xmlMemBlocks()) {
15691            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15692	           xmlMemBlocks() - mem_base);
15693	    test_ret++;
15694            printf(" %d", n_filename);
15695            printf("\n");
15696        }
15697    }
15698    function_tests++;
15699
15700    return(test_ret);
15701}
15702
15703
15704static int
15705test_xmlCreateMemoryParserCtxt(void) {
15706    int test_ret = 0;
15707
15708    int mem_base;
15709    xmlParserCtxtPtr ret_val;
15710    char * buffer; /* a pointer to a char array */
15711    int n_buffer;
15712    int size; /* the size of the array */
15713    int n_size;
15714
15715    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15716    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15717        mem_base = xmlMemBlocks();
15718        buffer = gen_const_char_ptr(n_buffer, 0);
15719        size = gen_int(n_size, 1);
15720
15721        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15722        desret_xmlParserCtxtPtr(ret_val);
15723        call_tests++;
15724        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15725        des_int(n_size, size, 1);
15726        xmlResetLastError();
15727        if (mem_base != xmlMemBlocks()) {
15728            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15729	           xmlMemBlocks() - mem_base);
15730	    test_ret++;
15731            printf(" %d", n_buffer);
15732            printf(" %d", n_size);
15733            printf("\n");
15734        }
15735    }
15736    }
15737    function_tests++;
15738
15739    return(test_ret);
15740}
15741
15742
15743static int
15744test_xmlCreateURLParserCtxt(void) {
15745    int test_ret = 0;
15746
15747    int mem_base;
15748    xmlParserCtxtPtr ret_val;
15749    const char * filename; /* the filename or URL */
15750    int n_filename;
15751    int options; /* a combination of xmlParserOption */
15752    int n_options;
15753
15754    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15755    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15756        mem_base = xmlMemBlocks();
15757        filename = gen_fileoutput(n_filename, 0);
15758        options = gen_int(n_options, 1);
15759
15760        ret_val = xmlCreateURLParserCtxt(filename, options);
15761        desret_xmlParserCtxtPtr(ret_val);
15762        call_tests++;
15763        des_fileoutput(n_filename, filename, 0);
15764        des_int(n_options, options, 1);
15765        xmlResetLastError();
15766        if (mem_base != xmlMemBlocks()) {
15767            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15768	           xmlMemBlocks() - mem_base);
15769	    test_ret++;
15770            printf(" %d", n_filename);
15771            printf(" %d", n_options);
15772            printf("\n");
15773        }
15774    }
15775    }
15776    function_tests++;
15777
15778    return(test_ret);
15779}
15780
15781
15782static int
15783test_xmlCurrentChar(void) {
15784    int test_ret = 0;
15785
15786    int mem_base;
15787    int ret_val;
15788    xmlParserCtxtPtr ctxt; /* the XML parser context */
15789    int n_ctxt;
15790    int * len; /* pointer to the length of the char read */
15791    int n_len;
15792
15793    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15794    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15795        mem_base = xmlMemBlocks();
15796        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15797        len = gen_int_ptr(n_len, 1);
15798
15799        ret_val = xmlCurrentChar(ctxt, len);
15800        desret_int(ret_val);
15801        call_tests++;
15802        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15803        des_int_ptr(n_len, len, 1);
15804        xmlResetLastError();
15805        if (mem_base != xmlMemBlocks()) {
15806            printf("Leak of %d blocks found in xmlCurrentChar",
15807	           xmlMemBlocks() - mem_base);
15808	    test_ret++;
15809            printf(" %d", n_ctxt);
15810            printf(" %d", n_len);
15811            printf("\n");
15812        }
15813    }
15814    }
15815    function_tests++;
15816
15817    return(test_ret);
15818}
15819
15820
15821static int
15822test_xmlErrMemory(void) {
15823    int test_ret = 0;
15824
15825    int mem_base;
15826    xmlParserCtxtPtr ctxt; /* an XML parser context */
15827    int n_ctxt;
15828    char * extra; /* extra informations */
15829    int n_extra;
15830
15831    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15832    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15833        mem_base = xmlMemBlocks();
15834        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15835        extra = gen_const_char_ptr(n_extra, 1);
15836
15837        xmlErrMemory(ctxt, (const char *)extra);
15838        call_tests++;
15839        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15840        des_const_char_ptr(n_extra, (const char *)extra, 1);
15841        xmlResetLastError();
15842        if (mem_base != xmlMemBlocks()) {
15843            printf("Leak of %d blocks found in xmlErrMemory",
15844	           xmlMemBlocks() - mem_base);
15845	    test_ret++;
15846            printf(" %d", n_ctxt);
15847            printf(" %d", n_extra);
15848            printf("\n");
15849        }
15850    }
15851    }
15852    function_tests++;
15853
15854    return(test_ret);
15855}
15856
15857
15858static int
15859test_xmlIsLetter(void) {
15860    int test_ret = 0;
15861
15862    int mem_base;
15863    int ret_val;
15864    int c; /* an unicode character (int) */
15865    int n_c;
15866
15867    for (n_c = 0;n_c < gen_nb_int;n_c++) {
15868        mem_base = xmlMemBlocks();
15869        c = gen_int(n_c, 0);
15870
15871        ret_val = xmlIsLetter(c);
15872        desret_int(ret_val);
15873        call_tests++;
15874        des_int(n_c, c, 0);
15875        xmlResetLastError();
15876        if (mem_base != xmlMemBlocks()) {
15877            printf("Leak of %d blocks found in xmlIsLetter",
15878	           xmlMemBlocks() - mem_base);
15879	    test_ret++;
15880            printf(" %d", n_c);
15881            printf("\n");
15882        }
15883    }
15884    function_tests++;
15885
15886    return(test_ret);
15887}
15888
15889
15890static int
15891test_xmlNewEntityInputStream(void) {
15892    int test_ret = 0;
15893
15894    int mem_base;
15895    xmlParserInputPtr ret_val;
15896    xmlParserCtxtPtr ctxt; /* an XML parser context */
15897    int n_ctxt;
15898    xmlEntityPtr entity; /* an Entity pointer */
15899    int n_entity;
15900
15901    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15902    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
15903        mem_base = xmlMemBlocks();
15904        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15905        entity = gen_xmlEntityPtr(n_entity, 1);
15906
15907        ret_val = xmlNewEntityInputStream(ctxt, entity);
15908        desret_xmlParserInputPtr(ret_val);
15909        call_tests++;
15910        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15911        des_xmlEntityPtr(n_entity, entity, 1);
15912        xmlResetLastError();
15913        if (mem_base != xmlMemBlocks()) {
15914            printf("Leak of %d blocks found in xmlNewEntityInputStream",
15915	           xmlMemBlocks() - mem_base);
15916	    test_ret++;
15917            printf(" %d", n_ctxt);
15918            printf(" %d", n_entity);
15919            printf("\n");
15920        }
15921    }
15922    }
15923    function_tests++;
15924
15925    return(test_ret);
15926}
15927
15928
15929static int
15930test_xmlNewInputFromFile(void) {
15931    int test_ret = 0;
15932
15933    int mem_base;
15934    xmlParserInputPtr ret_val;
15935    xmlParserCtxtPtr ctxt; /* an XML parser context */
15936    int n_ctxt;
15937    const char * filename; /* the filename to use as entity */
15938    int n_filename;
15939
15940    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15941    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15942        mem_base = xmlMemBlocks();
15943        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15944        filename = gen_filepath(n_filename, 1);
15945
15946        ret_val = xmlNewInputFromFile(ctxt, filename);
15947        desret_xmlParserInputPtr(ret_val);
15948        call_tests++;
15949        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15950        des_filepath(n_filename, filename, 1);
15951        xmlResetLastError();
15952        if (mem_base != xmlMemBlocks()) {
15953            printf("Leak of %d blocks found in xmlNewInputFromFile",
15954	           xmlMemBlocks() - mem_base);
15955	    test_ret++;
15956            printf(" %d", n_ctxt);
15957            printf(" %d", n_filename);
15958            printf("\n");
15959        }
15960    }
15961    }
15962    function_tests++;
15963
15964    return(test_ret);
15965}
15966
15967
15968static int
15969test_xmlNewInputStream(void) {
15970    int test_ret = 0;
15971
15972    int mem_base;
15973    xmlParserInputPtr ret_val;
15974    xmlParserCtxtPtr ctxt; /* an XML parser context */
15975    int n_ctxt;
15976
15977    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15978        mem_base = xmlMemBlocks();
15979        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15980
15981        ret_val = xmlNewInputStream(ctxt);
15982        desret_xmlParserInputPtr(ret_val);
15983        call_tests++;
15984        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15985        xmlResetLastError();
15986        if (mem_base != xmlMemBlocks()) {
15987            printf("Leak of %d blocks found in xmlNewInputStream",
15988	           xmlMemBlocks() - mem_base);
15989	    test_ret++;
15990            printf(" %d", n_ctxt);
15991            printf("\n");
15992        }
15993    }
15994    function_tests++;
15995
15996    return(test_ret);
15997}
15998
15999
16000static int
16001test_xmlNewStringInputStream(void) {
16002    int test_ret = 0;
16003
16004    int mem_base;
16005    xmlParserInputPtr ret_val;
16006    xmlParserCtxtPtr ctxt; /* an XML parser context */
16007    int n_ctxt;
16008    xmlChar * buffer; /* an memory buffer */
16009    int n_buffer;
16010
16011    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16012    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16013        mem_base = xmlMemBlocks();
16014        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16015        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16016
16017        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16018        desret_xmlParserInputPtr(ret_val);
16019        call_tests++;
16020        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16021        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16022        xmlResetLastError();
16023        if (mem_base != xmlMemBlocks()) {
16024            printf("Leak of %d blocks found in xmlNewStringInputStream",
16025	           xmlMemBlocks() - mem_base);
16026	    test_ret++;
16027            printf(" %d", n_ctxt);
16028            printf(" %d", n_buffer);
16029            printf("\n");
16030        }
16031    }
16032    }
16033    function_tests++;
16034
16035    return(test_ret);
16036}
16037
16038
16039static int
16040test_xmlNextChar(void) {
16041    int test_ret = 0;
16042
16043    int mem_base;
16044    xmlParserCtxtPtr ctxt; /* the XML parser context */
16045    int n_ctxt;
16046
16047    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16048        mem_base = xmlMemBlocks();
16049        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16050
16051        xmlNextChar(ctxt);
16052        call_tests++;
16053        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16054        xmlResetLastError();
16055        if (mem_base != xmlMemBlocks()) {
16056            printf("Leak of %d blocks found in xmlNextChar",
16057	           xmlMemBlocks() - mem_base);
16058	    test_ret++;
16059            printf(" %d", n_ctxt);
16060            printf("\n");
16061        }
16062    }
16063    function_tests++;
16064
16065    return(test_ret);
16066}
16067
16068
16069static int
16070test_xmlParserInputShrink(void) {
16071    int test_ret = 0;
16072
16073    int mem_base;
16074    xmlParserInputPtr in; /* an XML parser input */
16075    int n_in;
16076
16077    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16078        mem_base = xmlMemBlocks();
16079        in = gen_xmlParserInputPtr(n_in, 0);
16080
16081        xmlParserInputShrink(in);
16082        call_tests++;
16083        des_xmlParserInputPtr(n_in, in, 0);
16084        xmlResetLastError();
16085        if (mem_base != xmlMemBlocks()) {
16086            printf("Leak of %d blocks found in xmlParserInputShrink",
16087	           xmlMemBlocks() - mem_base);
16088	    test_ret++;
16089            printf(" %d", n_in);
16090            printf("\n");
16091        }
16092    }
16093    function_tests++;
16094
16095    return(test_ret);
16096}
16097
16098
16099static int
16100test_xmlPopInput(void) {
16101    int test_ret = 0;
16102
16103    int mem_base;
16104    xmlChar ret_val;
16105    xmlParserCtxtPtr ctxt; /* an XML parser context */
16106    int n_ctxt;
16107
16108    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16109        mem_base = xmlMemBlocks();
16110        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16111
16112        ret_val = xmlPopInput(ctxt);
16113        desret_xmlChar(ret_val);
16114        call_tests++;
16115        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16116        xmlResetLastError();
16117        if (mem_base != xmlMemBlocks()) {
16118            printf("Leak of %d blocks found in xmlPopInput",
16119	           xmlMemBlocks() - mem_base);
16120	    test_ret++;
16121            printf(" %d", n_ctxt);
16122            printf("\n");
16123        }
16124    }
16125    function_tests++;
16126
16127    return(test_ret);
16128}
16129
16130
16131static int
16132test_xmlPushInput(void) {
16133    int test_ret = 0;
16134
16135    int mem_base;
16136    xmlParserCtxtPtr ctxt; /* an XML parser context */
16137    int n_ctxt;
16138    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16139    int n_input;
16140
16141    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16142    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16143        mem_base = xmlMemBlocks();
16144        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16145        input = gen_xmlParserInputPtr(n_input, 1);
16146
16147        xmlPushInput(ctxt, input);
16148        call_tests++;
16149        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16150        des_xmlParserInputPtr(n_input, input, 1);
16151        xmlResetLastError();
16152        if (mem_base != xmlMemBlocks()) {
16153            printf("Leak of %d blocks found in xmlPushInput",
16154	           xmlMemBlocks() - mem_base);
16155	    test_ret++;
16156            printf(" %d", n_ctxt);
16157            printf(" %d", n_input);
16158            printf("\n");
16159        }
16160    }
16161    }
16162    function_tests++;
16163
16164    return(test_ret);
16165}
16166
16167
16168static int
16169test_xmlSetEntityReferenceFunc(void) {
16170    int test_ret = 0;
16171
16172
16173    /* missing type support */
16174    return(test_ret);
16175}
16176
16177
16178static int
16179test_xmlSplitQName(void) {
16180    int test_ret = 0;
16181
16182    int mem_base;
16183    xmlChar * ret_val;
16184    xmlParserCtxtPtr ctxt; /* an XML parser context */
16185    int n_ctxt;
16186    xmlChar * name; /* an XML parser context */
16187    int n_name;
16188    xmlChar ** prefix; /* a xmlChar ** */
16189    int n_prefix;
16190
16191    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16192    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16193    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16194        mem_base = xmlMemBlocks();
16195        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16196        name = gen_const_xmlChar_ptr(n_name, 1);
16197        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16198
16199        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16200        desret_xmlChar_ptr(ret_val);
16201        call_tests++;
16202        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16203        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16204        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16205        xmlResetLastError();
16206        if (mem_base != xmlMemBlocks()) {
16207            printf("Leak of %d blocks found in xmlSplitQName",
16208	           xmlMemBlocks() - mem_base);
16209	    test_ret++;
16210            printf(" %d", n_ctxt);
16211            printf(" %d", n_name);
16212            printf(" %d", n_prefix);
16213            printf("\n");
16214        }
16215    }
16216    }
16217    }
16218    function_tests++;
16219
16220    return(test_ret);
16221}
16222
16223
16224static int
16225test_xmlStringCurrentChar(void) {
16226    int test_ret = 0;
16227
16228    int mem_base;
16229    int ret_val;
16230    xmlParserCtxtPtr ctxt; /* the XML parser context */
16231    int n_ctxt;
16232    xmlChar * cur; /* pointer to the beginning of the char */
16233    int n_cur;
16234    int * len; /* pointer to the length of the char read */
16235    int n_len;
16236
16237    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16238    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16239    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16240        mem_base = xmlMemBlocks();
16241        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16242        cur = gen_const_xmlChar_ptr(n_cur, 1);
16243        len = gen_int_ptr(n_len, 2);
16244
16245        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16246        desret_int(ret_val);
16247        call_tests++;
16248        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16249        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16250        des_int_ptr(n_len, len, 2);
16251        xmlResetLastError();
16252        if (mem_base != xmlMemBlocks()) {
16253            printf("Leak of %d blocks found in xmlStringCurrentChar",
16254	           xmlMemBlocks() - mem_base);
16255	    test_ret++;
16256            printf(" %d", n_ctxt);
16257            printf(" %d", n_cur);
16258            printf(" %d", n_len);
16259            printf("\n");
16260        }
16261    }
16262    }
16263    }
16264    function_tests++;
16265
16266    return(test_ret);
16267}
16268
16269
16270static int
16271test_xmlStringDecodeEntities(void) {
16272    int test_ret = 0;
16273
16274    int mem_base;
16275    xmlChar * ret_val;
16276    xmlParserCtxtPtr ctxt; /* the parser context */
16277    int n_ctxt;
16278    xmlChar * str; /* the input string */
16279    int n_str;
16280    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16281    int n_what;
16282    xmlChar end; /* an end marker xmlChar, 0 if none */
16283    int n_end;
16284    xmlChar end2; /* an end marker xmlChar, 0 if none */
16285    int n_end2;
16286    xmlChar end3; /* an end marker xmlChar, 0 if none */
16287    int n_end3;
16288
16289    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16290    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16291    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16292    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16293    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16294    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16295        mem_base = xmlMemBlocks();
16296        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16297        str = gen_const_xmlChar_ptr(n_str, 1);
16298        what = gen_int(n_what, 2);
16299        end = gen_xmlChar(n_end, 3);
16300        end2 = gen_xmlChar(n_end2, 4);
16301        end3 = gen_xmlChar(n_end3, 5);
16302
16303        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16304        desret_xmlChar_ptr(ret_val);
16305        call_tests++;
16306        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16307        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16308        des_int(n_what, what, 2);
16309        des_xmlChar(n_end, end, 3);
16310        des_xmlChar(n_end2, end2, 4);
16311        des_xmlChar(n_end3, end3, 5);
16312        xmlResetLastError();
16313        if (mem_base != xmlMemBlocks()) {
16314            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16315	           xmlMemBlocks() - mem_base);
16316	    test_ret++;
16317            printf(" %d", n_ctxt);
16318            printf(" %d", n_str);
16319            printf(" %d", n_what);
16320            printf(" %d", n_end);
16321            printf(" %d", n_end2);
16322            printf(" %d", n_end3);
16323            printf("\n");
16324        }
16325    }
16326    }
16327    }
16328    }
16329    }
16330    }
16331    function_tests++;
16332
16333    return(test_ret);
16334}
16335
16336
16337static int
16338test_xmlStringLenDecodeEntities(void) {
16339    int test_ret = 0;
16340
16341    int mem_base;
16342    xmlChar * ret_val;
16343    xmlParserCtxtPtr ctxt; /* the parser context */
16344    int n_ctxt;
16345    xmlChar * str; /* the input string */
16346    int n_str;
16347    int len; /* the string length */
16348    int n_len;
16349    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16350    int n_what;
16351    xmlChar end; /* an end marker xmlChar, 0 if none */
16352    int n_end;
16353    xmlChar end2; /* an end marker xmlChar, 0 if none */
16354    int n_end2;
16355    xmlChar end3; /* an end marker xmlChar, 0 if none */
16356    int n_end3;
16357
16358    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16359    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16360    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16361    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16362    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16363    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16364    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16365        mem_base = xmlMemBlocks();
16366        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16367        str = gen_const_xmlChar_ptr(n_str, 1);
16368        len = gen_int(n_len, 2);
16369        what = gen_int(n_what, 3);
16370        end = gen_xmlChar(n_end, 4);
16371        end2 = gen_xmlChar(n_end2, 5);
16372        end3 = gen_xmlChar(n_end3, 6);
16373
16374        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16375        desret_xmlChar_ptr(ret_val);
16376        call_tests++;
16377        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16378        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16379        des_int(n_len, len, 2);
16380        des_int(n_what, what, 3);
16381        des_xmlChar(n_end, end, 4);
16382        des_xmlChar(n_end2, end2, 5);
16383        des_xmlChar(n_end3, end3, 6);
16384        xmlResetLastError();
16385        if (mem_base != xmlMemBlocks()) {
16386            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16387	           xmlMemBlocks() - mem_base);
16388	    test_ret++;
16389            printf(" %d", n_ctxt);
16390            printf(" %d", n_str);
16391            printf(" %d", n_len);
16392            printf(" %d", n_what);
16393            printf(" %d", n_end);
16394            printf(" %d", n_end2);
16395            printf(" %d", n_end3);
16396            printf("\n");
16397        }
16398    }
16399    }
16400    }
16401    }
16402    }
16403    }
16404    }
16405    function_tests++;
16406
16407    return(test_ret);
16408}
16409
16410
16411static int
16412test_xmlSwitchEncoding(void) {
16413    int test_ret = 0;
16414
16415    int mem_base;
16416    int ret_val;
16417    xmlParserCtxtPtr ctxt; /* the parser context */
16418    int n_ctxt;
16419    xmlCharEncoding enc; /* the encoding value (number) */
16420    int n_enc;
16421
16422    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16423    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16424        mem_base = xmlMemBlocks();
16425        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16426        enc = gen_xmlCharEncoding(n_enc, 1);
16427
16428        ret_val = xmlSwitchEncoding(ctxt, enc);
16429        desret_int(ret_val);
16430        call_tests++;
16431        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16432        des_xmlCharEncoding(n_enc, enc, 1);
16433        xmlResetLastError();
16434        if (mem_base != xmlMemBlocks()) {
16435            printf("Leak of %d blocks found in xmlSwitchEncoding",
16436	           xmlMemBlocks() - mem_base);
16437	    test_ret++;
16438            printf(" %d", n_ctxt);
16439            printf(" %d", n_enc);
16440            printf("\n");
16441        }
16442    }
16443    }
16444    function_tests++;
16445
16446    return(test_ret);
16447}
16448
16449
16450static int
16451test_xmlSwitchInputEncoding(void) {
16452    int test_ret = 0;
16453
16454    int mem_base;
16455    int ret_val;
16456    xmlParserCtxtPtr ctxt; /* the parser context */
16457    int n_ctxt;
16458    xmlParserInputPtr input; /* the input stream */
16459    int n_input;
16460    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16461    int n_handler;
16462
16463    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16464    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16465    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16466        mem_base = xmlMemBlocks();
16467        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16468        input = gen_xmlParserInputPtr(n_input, 1);
16469        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16470
16471        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16472        desret_int(ret_val);
16473        call_tests++;
16474        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16475        des_xmlParserInputPtr(n_input, input, 1);
16476        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16477        xmlResetLastError();
16478        if (mem_base != xmlMemBlocks()) {
16479            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16480	           xmlMemBlocks() - mem_base);
16481	    test_ret++;
16482            printf(" %d", n_ctxt);
16483            printf(" %d", n_input);
16484            printf(" %d", n_handler);
16485            printf("\n");
16486        }
16487    }
16488    }
16489    }
16490    function_tests++;
16491
16492    return(test_ret);
16493}
16494
16495
16496static int
16497test_xmlSwitchToEncoding(void) {
16498    int test_ret = 0;
16499
16500    int mem_base;
16501    int ret_val;
16502    xmlParserCtxtPtr ctxt; /* the parser context */
16503    int n_ctxt;
16504    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16505    int n_handler;
16506
16507    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16508    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16509        mem_base = xmlMemBlocks();
16510        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16511        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16512
16513        ret_val = xmlSwitchToEncoding(ctxt, handler);
16514        desret_int(ret_val);
16515        call_tests++;
16516        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16517        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16518        xmlResetLastError();
16519        if (mem_base != xmlMemBlocks()) {
16520            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16521	           xmlMemBlocks() - mem_base);
16522	    test_ret++;
16523            printf(" %d", n_ctxt);
16524            printf(" %d", n_handler);
16525            printf("\n");
16526        }
16527    }
16528    }
16529    function_tests++;
16530
16531    return(test_ret);
16532}
16533
16534static int
16535test_parserInternals(void) {
16536    int test_ret = 0;
16537
16538    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16539    test_ret += test_htmlCreateFileParserCtxt();
16540    test_ret += test_htmlInitAutoClose();
16541    test_ret += test_inputPop();
16542    test_ret += test_inputPush();
16543    test_ret += test_namePop();
16544    test_ret += test_namePush();
16545    test_ret += test_nodePop();
16546    test_ret += test_nodePush();
16547    test_ret += test_xmlCheckLanguageID();
16548    test_ret += test_xmlCopyChar();
16549    test_ret += test_xmlCopyCharMultiByte();
16550    test_ret += test_xmlCreateEntityParserCtxt();
16551    test_ret += test_xmlCreateFileParserCtxt();
16552    test_ret += test_xmlCreateMemoryParserCtxt();
16553    test_ret += test_xmlCreateURLParserCtxt();
16554    test_ret += test_xmlCurrentChar();
16555    test_ret += test_xmlErrMemory();
16556    test_ret += test_xmlIsLetter();
16557    test_ret += test_xmlNewEntityInputStream();
16558    test_ret += test_xmlNewInputFromFile();
16559    test_ret += test_xmlNewInputStream();
16560    test_ret += test_xmlNewStringInputStream();
16561    test_ret += test_xmlNextChar();
16562    test_ret += test_xmlParserInputShrink();
16563    test_ret += test_xmlPopInput();
16564    test_ret += test_xmlPushInput();
16565    test_ret += test_xmlSetEntityReferenceFunc();
16566    test_ret += test_xmlSplitQName();
16567    test_ret += test_xmlStringCurrentChar();
16568    test_ret += test_xmlStringDecodeEntities();
16569    test_ret += test_xmlStringLenDecodeEntities();
16570    test_ret += test_xmlSwitchEncoding();
16571    test_ret += test_xmlSwitchInputEncoding();
16572    test_ret += test_xmlSwitchToEncoding();
16573
16574    if (test_ret != 0)
16575	printf("Module parserInternals: %d errors\n", test_ret);
16576    return(test_ret);
16577}
16578
16579static int
16580test_xmlPatternFromRoot(void) {
16581    int test_ret = 0;
16582
16583#if defined(LIBXML_PATTERN_ENABLED)
16584    int mem_base;
16585    int ret_val;
16586    xmlPatternPtr comp; /* the precompiled pattern */
16587    int n_comp;
16588
16589    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16590        mem_base = xmlMemBlocks();
16591        comp = gen_xmlPatternPtr(n_comp, 0);
16592
16593        ret_val = xmlPatternFromRoot(comp);
16594        desret_int(ret_val);
16595        call_tests++;
16596        des_xmlPatternPtr(n_comp, comp, 0);
16597        xmlResetLastError();
16598        if (mem_base != xmlMemBlocks()) {
16599            printf("Leak of %d blocks found in xmlPatternFromRoot",
16600	           xmlMemBlocks() - mem_base);
16601	    test_ret++;
16602            printf(" %d", n_comp);
16603            printf("\n");
16604        }
16605    }
16606    function_tests++;
16607#endif
16608
16609    return(test_ret);
16610}
16611
16612
16613static int
16614test_xmlPatternGetStreamCtxt(void) {
16615    int test_ret = 0;
16616
16617
16618    /* missing type support */
16619    return(test_ret);
16620}
16621
16622
16623static int
16624test_xmlPatternMatch(void) {
16625    int test_ret = 0;
16626
16627#if defined(LIBXML_PATTERN_ENABLED)
16628    int mem_base;
16629    int ret_val;
16630    xmlPatternPtr comp; /* the precompiled pattern */
16631    int n_comp;
16632    xmlNodePtr node; /* a node */
16633    int n_node;
16634
16635    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16636    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16637        mem_base = xmlMemBlocks();
16638        comp = gen_xmlPatternPtr(n_comp, 0);
16639        node = gen_xmlNodePtr(n_node, 1);
16640
16641        ret_val = xmlPatternMatch(comp, node);
16642        desret_int(ret_val);
16643        call_tests++;
16644        des_xmlPatternPtr(n_comp, comp, 0);
16645        des_xmlNodePtr(n_node, node, 1);
16646        xmlResetLastError();
16647        if (mem_base != xmlMemBlocks()) {
16648            printf("Leak of %d blocks found in xmlPatternMatch",
16649	           xmlMemBlocks() - mem_base);
16650	    test_ret++;
16651            printf(" %d", n_comp);
16652            printf(" %d", n_node);
16653            printf("\n");
16654        }
16655    }
16656    }
16657    function_tests++;
16658#endif
16659
16660    return(test_ret);
16661}
16662
16663
16664static int
16665test_xmlPatternMaxDepth(void) {
16666    int test_ret = 0;
16667
16668#if defined(LIBXML_PATTERN_ENABLED)
16669    int mem_base;
16670    int ret_val;
16671    xmlPatternPtr comp; /* the precompiled pattern */
16672    int n_comp;
16673
16674    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16675        mem_base = xmlMemBlocks();
16676        comp = gen_xmlPatternPtr(n_comp, 0);
16677
16678        ret_val = xmlPatternMaxDepth(comp);
16679        desret_int(ret_val);
16680        call_tests++;
16681        des_xmlPatternPtr(n_comp, comp, 0);
16682        xmlResetLastError();
16683        if (mem_base != xmlMemBlocks()) {
16684            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16685	           xmlMemBlocks() - mem_base);
16686	    test_ret++;
16687            printf(" %d", n_comp);
16688            printf("\n");
16689        }
16690    }
16691    function_tests++;
16692#endif
16693
16694    return(test_ret);
16695}
16696
16697
16698static int
16699test_xmlPatternStreamable(void) {
16700    int test_ret = 0;
16701
16702#if defined(LIBXML_PATTERN_ENABLED)
16703    int mem_base;
16704    int ret_val;
16705    xmlPatternPtr comp; /* the precompiled pattern */
16706    int n_comp;
16707
16708    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16709        mem_base = xmlMemBlocks();
16710        comp = gen_xmlPatternPtr(n_comp, 0);
16711
16712        ret_val = xmlPatternStreamable(comp);
16713        desret_int(ret_val);
16714        call_tests++;
16715        des_xmlPatternPtr(n_comp, comp, 0);
16716        xmlResetLastError();
16717        if (mem_base != xmlMemBlocks()) {
16718            printf("Leak of %d blocks found in xmlPatternStreamable",
16719	           xmlMemBlocks() - mem_base);
16720	    test_ret++;
16721            printf(" %d", n_comp);
16722            printf("\n");
16723        }
16724    }
16725    function_tests++;
16726#endif
16727
16728    return(test_ret);
16729}
16730
16731
16732static int
16733test_xmlPatterncompile(void) {
16734    int test_ret = 0;
16735
16736
16737    /* missing type support */
16738    return(test_ret);
16739}
16740
16741#ifdef LIBXML_PATTERN_ENABLED
16742
16743#define gen_nb_xmlStreamCtxtPtr 1
16744static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16745    return(NULL);
16746}
16747static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16748}
16749#endif
16750
16751
16752static int
16753test_xmlStreamPop(void) {
16754    int test_ret = 0;
16755
16756#if defined(LIBXML_PATTERN_ENABLED)
16757    int mem_base;
16758    int ret_val;
16759    xmlStreamCtxtPtr stream; /* the stream context */
16760    int n_stream;
16761
16762    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16763        mem_base = xmlMemBlocks();
16764        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16765
16766        ret_val = xmlStreamPop(stream);
16767        desret_int(ret_val);
16768        call_tests++;
16769        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16770        xmlResetLastError();
16771        if (mem_base != xmlMemBlocks()) {
16772            printf("Leak of %d blocks found in xmlStreamPop",
16773	           xmlMemBlocks() - mem_base);
16774	    test_ret++;
16775            printf(" %d", n_stream);
16776            printf("\n");
16777        }
16778    }
16779    function_tests++;
16780#endif
16781
16782    return(test_ret);
16783}
16784
16785
16786static int
16787test_xmlStreamPush(void) {
16788    int test_ret = 0;
16789
16790#if defined(LIBXML_PATTERN_ENABLED)
16791    int mem_base;
16792    int ret_val;
16793    xmlStreamCtxtPtr stream; /* the stream context */
16794    int n_stream;
16795    xmlChar * name; /* the current name */
16796    int n_name;
16797    xmlChar * ns; /* the namespace name */
16798    int n_ns;
16799
16800    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16801    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16802    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16803        mem_base = xmlMemBlocks();
16804        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16805        name = gen_const_xmlChar_ptr(n_name, 1);
16806        ns = gen_const_xmlChar_ptr(n_ns, 2);
16807
16808        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
16809        desret_int(ret_val);
16810        call_tests++;
16811        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16812        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16813        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16814        xmlResetLastError();
16815        if (mem_base != xmlMemBlocks()) {
16816            printf("Leak of %d blocks found in xmlStreamPush",
16817	           xmlMemBlocks() - mem_base);
16818	    test_ret++;
16819            printf(" %d", n_stream);
16820            printf(" %d", n_name);
16821            printf(" %d", n_ns);
16822            printf("\n");
16823        }
16824    }
16825    }
16826    }
16827    function_tests++;
16828#endif
16829
16830    return(test_ret);
16831}
16832
16833
16834static int
16835test_xmlStreamPushAttr(void) {
16836    int test_ret = 0;
16837
16838#if defined(LIBXML_PATTERN_ENABLED)
16839    int mem_base;
16840    int ret_val;
16841    xmlStreamCtxtPtr stream; /* the stream context */
16842    int n_stream;
16843    xmlChar * name; /* the current name */
16844    int n_name;
16845    xmlChar * ns; /* the namespace name */
16846    int n_ns;
16847
16848    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16849    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16850    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16851        mem_base = xmlMemBlocks();
16852        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16853        name = gen_const_xmlChar_ptr(n_name, 1);
16854        ns = gen_const_xmlChar_ptr(n_ns, 2);
16855
16856        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
16857        desret_int(ret_val);
16858        call_tests++;
16859        des_xmlStreamCtxtPtr(n_stream, stream, 0);
16860        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16861        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
16862        xmlResetLastError();
16863        if (mem_base != xmlMemBlocks()) {
16864            printf("Leak of %d blocks found in xmlStreamPushAttr",
16865	           xmlMemBlocks() - mem_base);
16866	    test_ret++;
16867            printf(" %d", n_stream);
16868            printf(" %d", n_name);
16869            printf(" %d", n_ns);
16870            printf("\n");
16871        }
16872    }
16873    }
16874    }
16875    function_tests++;
16876#endif
16877
16878    return(test_ret);
16879}
16880
16881static int
16882test_pattern(void) {
16883    int test_ret = 0;
16884
16885    if (quiet == 0) printf("Testing pattern : 7 of 12 functions ...\n");
16886    test_ret += test_xmlPatternFromRoot();
16887    test_ret += test_xmlPatternGetStreamCtxt();
16888    test_ret += test_xmlPatternMatch();
16889    test_ret += test_xmlPatternMaxDepth();
16890    test_ret += test_xmlPatternStreamable();
16891    test_ret += test_xmlPatterncompile();
16892    test_ret += test_xmlStreamPop();
16893    test_ret += test_xmlStreamPush();
16894    test_ret += test_xmlStreamPushAttr();
16895
16896    if (test_ret != 0)
16897	printf("Module pattern: %d errors\n", test_ret);
16898    return(test_ret);
16899}
16900#ifdef LIBXML_SCHEMAS_ENABLED
16901
16902#define gen_nb_xmlRelaxNGPtr 1
16903static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16904    return(NULL);
16905}
16906static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16907}
16908#endif
16909
16910
16911static int
16912test_xmlRelaxNGDump(void) {
16913    int test_ret = 0;
16914
16915#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16916    int mem_base;
16917    FILE * output; /* the file output */
16918    int n_output;
16919    xmlRelaxNGPtr schema; /* a schema structure */
16920    int n_schema;
16921
16922    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16923    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16924        mem_base = xmlMemBlocks();
16925        output = gen_FILE_ptr(n_output, 0);
16926        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16927
16928        xmlRelaxNGDump(output, schema);
16929        call_tests++;
16930        des_FILE_ptr(n_output, output, 0);
16931        des_xmlRelaxNGPtr(n_schema, schema, 1);
16932        xmlResetLastError();
16933        if (mem_base != xmlMemBlocks()) {
16934            printf("Leak of %d blocks found in xmlRelaxNGDump",
16935	           xmlMemBlocks() - mem_base);
16936	    test_ret++;
16937            printf(" %d", n_output);
16938            printf(" %d", n_schema);
16939            printf("\n");
16940        }
16941    }
16942    }
16943    function_tests++;
16944#endif
16945
16946    return(test_ret);
16947}
16948
16949
16950static int
16951test_xmlRelaxNGDumpTree(void) {
16952    int test_ret = 0;
16953
16954#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
16955    int mem_base;
16956    FILE * output; /* the file output */
16957    int n_output;
16958    xmlRelaxNGPtr schema; /* a schema structure */
16959    int n_schema;
16960
16961    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16962    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16963        mem_base = xmlMemBlocks();
16964        output = gen_FILE_ptr(n_output, 0);
16965        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16966
16967        xmlRelaxNGDumpTree(output, schema);
16968        call_tests++;
16969        des_FILE_ptr(n_output, output, 0);
16970        des_xmlRelaxNGPtr(n_schema, schema, 1);
16971        xmlResetLastError();
16972        if (mem_base != xmlMemBlocks()) {
16973            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
16974	           xmlMemBlocks() - mem_base);
16975	    test_ret++;
16976            printf(" %d", n_output);
16977            printf(" %d", n_schema);
16978            printf("\n");
16979        }
16980    }
16981    }
16982    function_tests++;
16983#endif
16984
16985    return(test_ret);
16986}
16987
16988#ifdef LIBXML_SCHEMAS_ENABLED
16989
16990#define gen_nb_xmlRelaxNGParserCtxtPtr 1
16991static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16992    return(NULL);
16993}
16994static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16995}
16996#endif
16997
16998#ifdef LIBXML_SCHEMAS_ENABLED
16999
17000#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17001static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17002    return(NULL);
17003}
17004static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17005}
17006#endif
17007
17008#ifdef LIBXML_SCHEMAS_ENABLED
17009
17010#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17011static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17012    return(NULL);
17013}
17014static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17015}
17016#endif
17017
17018#ifdef LIBXML_SCHEMAS_ENABLED
17019
17020#define gen_nb_void_ptr_ptr 1
17021static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17022    return(NULL);
17023}
17024static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17025}
17026#endif
17027
17028
17029static int
17030test_xmlRelaxNGGetParserErrors(void) {
17031    int test_ret = 0;
17032
17033#if defined(LIBXML_SCHEMAS_ENABLED)
17034    int mem_base;
17035    int ret_val;
17036    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17037    int n_ctxt;
17038    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17039    int n_err;
17040    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17041    int n_warn;
17042    void ** ctx; /* contextual data for the callbacks result */
17043    int n_ctx;
17044
17045    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17046    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17047    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17048    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17049        mem_base = xmlMemBlocks();
17050        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17051        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17052        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17053        ctx = gen_void_ptr_ptr(n_ctx, 3);
17054
17055        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17056        desret_int(ret_val);
17057        call_tests++;
17058        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17059        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17060        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17061        des_void_ptr_ptr(n_ctx, ctx, 3);
17062        xmlResetLastError();
17063        if (mem_base != xmlMemBlocks()) {
17064            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17065	           xmlMemBlocks() - mem_base);
17066	    test_ret++;
17067            printf(" %d", n_ctxt);
17068            printf(" %d", n_err);
17069            printf(" %d", n_warn);
17070            printf(" %d", n_ctx);
17071            printf("\n");
17072        }
17073    }
17074    }
17075    }
17076    }
17077    function_tests++;
17078#endif
17079
17080    return(test_ret);
17081}
17082
17083#ifdef LIBXML_SCHEMAS_ENABLED
17084
17085#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17086static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17087    return(NULL);
17088}
17089static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17090}
17091#endif
17092
17093
17094static int
17095test_xmlRelaxNGGetValidErrors(void) {
17096    int test_ret = 0;
17097
17098#if defined(LIBXML_SCHEMAS_ENABLED)
17099    int mem_base;
17100    int ret_val;
17101    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17102    int n_ctxt;
17103    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17104    int n_err;
17105    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17106    int n_warn;
17107    void ** ctx; /* the functions context result */
17108    int n_ctx;
17109
17110    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17111    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17112    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17113    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17114        mem_base = xmlMemBlocks();
17115        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17116        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17117        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17118        ctx = gen_void_ptr_ptr(n_ctx, 3);
17119
17120        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17121        desret_int(ret_val);
17122        call_tests++;
17123        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17124        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17125        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17126        des_void_ptr_ptr(n_ctx, ctx, 3);
17127        xmlResetLastError();
17128        if (mem_base != xmlMemBlocks()) {
17129            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17130	           xmlMemBlocks() - mem_base);
17131	    test_ret++;
17132            printf(" %d", n_ctxt);
17133            printf(" %d", n_err);
17134            printf(" %d", n_warn);
17135            printf(" %d", n_ctx);
17136            printf("\n");
17137        }
17138    }
17139    }
17140    }
17141    }
17142    function_tests++;
17143#endif
17144
17145    return(test_ret);
17146}
17147
17148
17149static int
17150test_xmlRelaxNGInitTypes(void) {
17151    int test_ret = 0;
17152
17153#if defined(LIBXML_SCHEMAS_ENABLED)
17154    int mem_base;
17155    int ret_val;
17156
17157        mem_base = xmlMemBlocks();
17158
17159        ret_val = xmlRelaxNGInitTypes();
17160        desret_int(ret_val);
17161        call_tests++;
17162        xmlResetLastError();
17163        if (mem_base != xmlMemBlocks()) {
17164            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17165	           xmlMemBlocks() - mem_base);
17166	    test_ret++;
17167            printf("\n");
17168        }
17169    function_tests++;
17170#endif
17171
17172    return(test_ret);
17173}
17174
17175
17176static int
17177test_xmlRelaxNGNewDocParserCtxt(void) {
17178    int test_ret = 0;
17179
17180#if defined(LIBXML_SCHEMAS_ENABLED)
17181    int mem_base;
17182    xmlRelaxNGParserCtxtPtr ret_val;
17183    xmlDocPtr doc; /* a preparsed document tree */
17184    int n_doc;
17185
17186    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17187        mem_base = xmlMemBlocks();
17188        doc = gen_xmlDocPtr(n_doc, 0);
17189
17190        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17191        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17192        call_tests++;
17193        des_xmlDocPtr(n_doc, doc, 0);
17194        xmlResetLastError();
17195        if (mem_base != xmlMemBlocks()) {
17196            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17197	           xmlMemBlocks() - mem_base);
17198	    test_ret++;
17199            printf(" %d", n_doc);
17200            printf("\n");
17201        }
17202    }
17203    function_tests++;
17204#endif
17205
17206    return(test_ret);
17207}
17208
17209
17210static int
17211test_xmlRelaxNGNewMemParserCtxt(void) {
17212    int test_ret = 0;
17213
17214#if defined(LIBXML_SCHEMAS_ENABLED)
17215    int mem_base;
17216    xmlRelaxNGParserCtxtPtr ret_val;
17217    char * buffer; /* a pointer to a char array containing the schemas */
17218    int n_buffer;
17219    int size; /* the size of the array */
17220    int n_size;
17221
17222    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17223    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17224        mem_base = xmlMemBlocks();
17225        buffer = gen_const_char_ptr(n_buffer, 0);
17226        size = gen_int(n_size, 1);
17227
17228        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17229        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17230        call_tests++;
17231        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17232        des_int(n_size, size, 1);
17233        xmlResetLastError();
17234        if (mem_base != xmlMemBlocks()) {
17235            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17236	           xmlMemBlocks() - mem_base);
17237	    test_ret++;
17238            printf(" %d", n_buffer);
17239            printf(" %d", n_size);
17240            printf("\n");
17241        }
17242    }
17243    }
17244    function_tests++;
17245#endif
17246
17247    return(test_ret);
17248}
17249
17250
17251static int
17252test_xmlRelaxNGNewParserCtxt(void) {
17253    int test_ret = 0;
17254
17255#if defined(LIBXML_SCHEMAS_ENABLED)
17256    int mem_base;
17257    xmlRelaxNGParserCtxtPtr ret_val;
17258    char * URL; /* the location of the schema */
17259    int n_URL;
17260
17261    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17262        mem_base = xmlMemBlocks();
17263        URL = gen_const_char_ptr(n_URL, 0);
17264
17265        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17266        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17267        call_tests++;
17268        des_const_char_ptr(n_URL, (const char *)URL, 0);
17269        xmlResetLastError();
17270        if (mem_base != xmlMemBlocks()) {
17271            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17272	           xmlMemBlocks() - mem_base);
17273	    test_ret++;
17274            printf(" %d", n_URL);
17275            printf("\n");
17276        }
17277    }
17278    function_tests++;
17279#endif
17280
17281    return(test_ret);
17282}
17283
17284
17285static int
17286test_xmlRelaxNGNewValidCtxt(void) {
17287    int test_ret = 0;
17288
17289
17290    /* missing type support */
17291    return(test_ret);
17292}
17293
17294
17295static int
17296test_xmlRelaxNGParse(void) {
17297    int test_ret = 0;
17298
17299
17300    /* missing type support */
17301    return(test_ret);
17302}
17303
17304
17305static int
17306test_xmlRelaxNGSetParserErrors(void) {
17307    int test_ret = 0;
17308
17309
17310    /* missing type support */
17311    return(test_ret);
17312}
17313
17314
17315static int
17316test_xmlRelaxNGSetValidErrors(void) {
17317    int test_ret = 0;
17318
17319
17320    /* missing type support */
17321    return(test_ret);
17322}
17323
17324
17325static int
17326test_xmlRelaxNGValidateDoc(void) {
17327    int test_ret = 0;
17328
17329#if defined(LIBXML_SCHEMAS_ENABLED)
17330    int mem_base;
17331    int ret_val;
17332    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17333    int n_ctxt;
17334    xmlDocPtr doc; /* a parsed document tree */
17335    int n_doc;
17336
17337    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17338    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17339        mem_base = xmlMemBlocks();
17340        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17341        doc = gen_xmlDocPtr(n_doc, 1);
17342
17343        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17344        desret_int(ret_val);
17345        call_tests++;
17346        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17347        des_xmlDocPtr(n_doc, doc, 1);
17348        xmlResetLastError();
17349        if (mem_base != xmlMemBlocks()) {
17350            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17351	           xmlMemBlocks() - mem_base);
17352	    test_ret++;
17353            printf(" %d", n_ctxt);
17354            printf(" %d", n_doc);
17355            printf("\n");
17356        }
17357    }
17358    }
17359    function_tests++;
17360#endif
17361
17362    return(test_ret);
17363}
17364
17365
17366static int
17367test_xmlRelaxNGValidateFullElement(void) {
17368    int test_ret = 0;
17369
17370#if defined(LIBXML_SCHEMAS_ENABLED)
17371    int mem_base;
17372    int ret_val;
17373    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17374    int n_ctxt;
17375    xmlDocPtr doc; /* a document instance */
17376    int n_doc;
17377    xmlNodePtr elem; /* an element instance */
17378    int n_elem;
17379
17380    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17381    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17382    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17383        mem_base = xmlMemBlocks();
17384        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17385        doc = gen_xmlDocPtr(n_doc, 1);
17386        elem = gen_xmlNodePtr(n_elem, 2);
17387
17388        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17389        desret_int(ret_val);
17390        call_tests++;
17391        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17392        des_xmlDocPtr(n_doc, doc, 1);
17393        des_xmlNodePtr(n_elem, elem, 2);
17394        xmlResetLastError();
17395        if (mem_base != xmlMemBlocks()) {
17396            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17397	           xmlMemBlocks() - mem_base);
17398	    test_ret++;
17399            printf(" %d", n_ctxt);
17400            printf(" %d", n_doc);
17401            printf(" %d", n_elem);
17402            printf("\n");
17403        }
17404    }
17405    }
17406    }
17407    function_tests++;
17408#endif
17409
17410    return(test_ret);
17411}
17412
17413
17414static int
17415test_xmlRelaxNGValidatePopElement(void) {
17416    int test_ret = 0;
17417
17418#if defined(LIBXML_SCHEMAS_ENABLED)
17419    int mem_base;
17420    int ret_val;
17421    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17422    int n_ctxt;
17423    xmlDocPtr doc; /* a document instance */
17424    int n_doc;
17425    xmlNodePtr elem; /* an element instance */
17426    int n_elem;
17427
17428    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17429    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17430    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17431        mem_base = xmlMemBlocks();
17432        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17433        doc = gen_xmlDocPtr(n_doc, 1);
17434        elem = gen_xmlNodePtr(n_elem, 2);
17435
17436        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17437        desret_int(ret_val);
17438        call_tests++;
17439        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17440        des_xmlDocPtr(n_doc, doc, 1);
17441        des_xmlNodePtr(n_elem, elem, 2);
17442        xmlResetLastError();
17443        if (mem_base != xmlMemBlocks()) {
17444            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17445	           xmlMemBlocks() - mem_base);
17446	    test_ret++;
17447            printf(" %d", n_ctxt);
17448            printf(" %d", n_doc);
17449            printf(" %d", n_elem);
17450            printf("\n");
17451        }
17452    }
17453    }
17454    }
17455    function_tests++;
17456#endif
17457
17458    return(test_ret);
17459}
17460
17461
17462static int
17463test_xmlRelaxNGValidatePushCData(void) {
17464    int test_ret = 0;
17465
17466#if defined(LIBXML_SCHEMAS_ENABLED)
17467    int mem_base;
17468    int ret_val;
17469    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17470    int n_ctxt;
17471    xmlChar * data; /* some character data read */
17472    int n_data;
17473    int len; /* the lenght of the data */
17474    int n_len;
17475
17476    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17477    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17478    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17479        mem_base = xmlMemBlocks();
17480        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17481        data = gen_const_xmlChar_ptr(n_data, 1);
17482        len = gen_int(n_len, 2);
17483
17484        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17485        desret_int(ret_val);
17486        call_tests++;
17487        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17488        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17489        des_int(n_len, len, 2);
17490        xmlResetLastError();
17491        if (mem_base != xmlMemBlocks()) {
17492            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17493	           xmlMemBlocks() - mem_base);
17494	    test_ret++;
17495            printf(" %d", n_ctxt);
17496            printf(" %d", n_data);
17497            printf(" %d", n_len);
17498            printf("\n");
17499        }
17500    }
17501    }
17502    }
17503    function_tests++;
17504#endif
17505
17506    return(test_ret);
17507}
17508
17509
17510static int
17511test_xmlRelaxNGValidatePushElement(void) {
17512    int test_ret = 0;
17513
17514#if defined(LIBXML_SCHEMAS_ENABLED)
17515    int mem_base;
17516    int ret_val;
17517    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17518    int n_ctxt;
17519    xmlDocPtr doc; /* a document instance */
17520    int n_doc;
17521    xmlNodePtr elem; /* an element instance */
17522    int n_elem;
17523
17524    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17525    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17526    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17527        mem_base = xmlMemBlocks();
17528        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17529        doc = gen_xmlDocPtr(n_doc, 1);
17530        elem = gen_xmlNodePtr(n_elem, 2);
17531
17532        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17533        desret_int(ret_val);
17534        call_tests++;
17535        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17536        des_xmlDocPtr(n_doc, doc, 1);
17537        des_xmlNodePtr(n_elem, elem, 2);
17538        xmlResetLastError();
17539        if (mem_base != xmlMemBlocks()) {
17540            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17541	           xmlMemBlocks() - mem_base);
17542	    test_ret++;
17543            printf(" %d", n_ctxt);
17544            printf(" %d", n_doc);
17545            printf(" %d", n_elem);
17546            printf("\n");
17547        }
17548    }
17549    }
17550    }
17551    function_tests++;
17552#endif
17553
17554    return(test_ret);
17555}
17556
17557
17558static int
17559test_xmlRelaxParserSetFlag(void) {
17560    int test_ret = 0;
17561
17562#if defined(LIBXML_SCHEMAS_ENABLED)
17563    int mem_base;
17564    int ret_val;
17565    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17566    int n_ctxt;
17567    int flags; /* a set of flags values */
17568    int n_flags;
17569
17570    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17571    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17572        mem_base = xmlMemBlocks();
17573        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17574        flags = gen_int(n_flags, 1);
17575
17576        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17577        desret_int(ret_val);
17578        call_tests++;
17579        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17580        des_int(n_flags, flags, 1);
17581        xmlResetLastError();
17582        if (mem_base != xmlMemBlocks()) {
17583            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17584	           xmlMemBlocks() - mem_base);
17585	    test_ret++;
17586            printf(" %d", n_ctxt);
17587            printf(" %d", n_flags);
17588            printf("\n");
17589        }
17590    }
17591    }
17592    function_tests++;
17593#endif
17594
17595    return(test_ret);
17596}
17597
17598static int
17599test_relaxng(void) {
17600    int test_ret = 0;
17601
17602    if (quiet == 0) printf("Testing relaxng : 14 of 22 functions ...\n");
17603    test_ret += test_xmlRelaxNGDump();
17604    test_ret += test_xmlRelaxNGDumpTree();
17605    test_ret += test_xmlRelaxNGGetParserErrors();
17606    test_ret += test_xmlRelaxNGGetValidErrors();
17607    test_ret += test_xmlRelaxNGInitTypes();
17608    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17609    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17610    test_ret += test_xmlRelaxNGNewParserCtxt();
17611    test_ret += test_xmlRelaxNGNewValidCtxt();
17612    test_ret += test_xmlRelaxNGParse();
17613    test_ret += test_xmlRelaxNGSetParserErrors();
17614    test_ret += test_xmlRelaxNGSetValidErrors();
17615    test_ret += test_xmlRelaxNGValidateDoc();
17616    test_ret += test_xmlRelaxNGValidateFullElement();
17617    test_ret += test_xmlRelaxNGValidatePopElement();
17618    test_ret += test_xmlRelaxNGValidatePushCData();
17619    test_ret += test_xmlRelaxNGValidatePushElement();
17620    test_ret += test_xmlRelaxParserSetFlag();
17621
17622    if (test_ret != 0)
17623	printf("Module relaxng: %d errors\n", test_ret);
17624    return(test_ret);
17625}
17626static int
17627test_schemasInternals(void) {
17628    int test_ret = 0;
17629
17630    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17631
17632    if (test_ret != 0)
17633	printf("Module schemasInternals: %d errors\n", test_ret);
17634    return(test_ret);
17635}
17636
17637static int
17638test_xmlAddChild(void) {
17639    int test_ret = 0;
17640
17641    int mem_base;
17642    xmlNodePtr ret_val;
17643    xmlNodePtr parent; /* the parent node */
17644    int n_parent;
17645    xmlNodePtr cur; /* the child node */
17646    int n_cur;
17647
17648    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17649    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17650        mem_base = xmlMemBlocks();
17651        parent = gen_xmlNodePtr(n_parent, 0);
17652        cur = gen_xmlNodePtr_in(n_cur, 1);
17653
17654        ret_val = xmlAddChild(parent, cur);
17655        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
17656        desret_xmlNodePtr(ret_val);
17657        call_tests++;
17658        des_xmlNodePtr(n_parent, parent, 0);
17659        des_xmlNodePtr_in(n_cur, cur, 1);
17660        xmlResetLastError();
17661        if (mem_base != xmlMemBlocks()) {
17662            printf("Leak of %d blocks found in xmlAddChild",
17663	           xmlMemBlocks() - mem_base);
17664	    test_ret++;
17665            printf(" %d", n_parent);
17666            printf(" %d", n_cur);
17667            printf("\n");
17668        }
17669    }
17670    }
17671    function_tests++;
17672
17673    return(test_ret);
17674}
17675
17676
17677static int
17678test_xmlAddChildList(void) {
17679    int test_ret = 0;
17680
17681    int mem_base;
17682    xmlNodePtr ret_val;
17683    xmlNodePtr parent; /* the parent node */
17684    int n_parent;
17685    xmlNodePtr cur; /* the first node in the list */
17686    int n_cur;
17687
17688    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17689    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17690        mem_base = xmlMemBlocks();
17691        parent = gen_xmlNodePtr(n_parent, 0);
17692        cur = gen_xmlNodePtr_in(n_cur, 1);
17693
17694        ret_val = xmlAddChildList(parent, cur);
17695        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
17696        desret_xmlNodePtr(ret_val);
17697        call_tests++;
17698        des_xmlNodePtr(n_parent, parent, 0);
17699        des_xmlNodePtr_in(n_cur, cur, 1);
17700        xmlResetLastError();
17701        if (mem_base != xmlMemBlocks()) {
17702            printf("Leak of %d blocks found in xmlAddChildList",
17703	           xmlMemBlocks() - mem_base);
17704	    test_ret++;
17705            printf(" %d", n_parent);
17706            printf(" %d", n_cur);
17707            printf("\n");
17708        }
17709    }
17710    }
17711    function_tests++;
17712
17713    return(test_ret);
17714}
17715
17716
17717static int
17718test_xmlAddNextSibling(void) {
17719    int test_ret = 0;
17720
17721    int mem_base;
17722    xmlNodePtr ret_val;
17723    xmlNodePtr cur; /* the child node */
17724    int n_cur;
17725    xmlNodePtr elem; /* the new node */
17726    int n_elem;
17727
17728    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17729    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17730        mem_base = xmlMemBlocks();
17731        cur = gen_xmlNodePtr(n_cur, 0);
17732        elem = gen_xmlNodePtr_in(n_elem, 1);
17733
17734        ret_val = xmlAddNextSibling(cur, elem);
17735        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17736        desret_xmlNodePtr(ret_val);
17737        call_tests++;
17738        des_xmlNodePtr(n_cur, cur, 0);
17739        des_xmlNodePtr_in(n_elem, elem, 1);
17740        xmlResetLastError();
17741        if (mem_base != xmlMemBlocks()) {
17742            printf("Leak of %d blocks found in xmlAddNextSibling",
17743	           xmlMemBlocks() - mem_base);
17744	    test_ret++;
17745            printf(" %d", n_cur);
17746            printf(" %d", n_elem);
17747            printf("\n");
17748        }
17749    }
17750    }
17751    function_tests++;
17752
17753    return(test_ret);
17754}
17755
17756
17757static int
17758test_xmlAddPrevSibling(void) {
17759    int test_ret = 0;
17760
17761#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
17762    int mem_base;
17763    xmlNodePtr ret_val;
17764    xmlNodePtr cur; /* the child node */
17765    int n_cur;
17766    xmlNodePtr elem; /* the new node */
17767    int n_elem;
17768
17769    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17770    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17771        mem_base = xmlMemBlocks();
17772        cur = gen_xmlNodePtr(n_cur, 0);
17773        elem = gen_xmlNodePtr_in(n_elem, 1);
17774
17775        ret_val = xmlAddPrevSibling(cur, elem);
17776        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17777        desret_xmlNodePtr(ret_val);
17778        call_tests++;
17779        des_xmlNodePtr(n_cur, cur, 0);
17780        des_xmlNodePtr_in(n_elem, elem, 1);
17781        xmlResetLastError();
17782        if (mem_base != xmlMemBlocks()) {
17783            printf("Leak of %d blocks found in xmlAddPrevSibling",
17784	           xmlMemBlocks() - mem_base);
17785	    test_ret++;
17786            printf(" %d", n_cur);
17787            printf(" %d", n_elem);
17788            printf("\n");
17789        }
17790    }
17791    }
17792    function_tests++;
17793#endif
17794
17795    return(test_ret);
17796}
17797
17798
17799static int
17800test_xmlAddSibling(void) {
17801    int test_ret = 0;
17802
17803    int mem_base;
17804    xmlNodePtr ret_val;
17805    xmlNodePtr cur; /* the child node */
17806    int n_cur;
17807    xmlNodePtr elem; /* the new node */
17808    int n_elem;
17809
17810    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17811    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17812        mem_base = xmlMemBlocks();
17813        cur = gen_xmlNodePtr(n_cur, 0);
17814        elem = gen_xmlNodePtr_in(n_elem, 1);
17815
17816        ret_val = xmlAddSibling(cur, elem);
17817        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17818        desret_xmlNodePtr(ret_val);
17819        call_tests++;
17820        des_xmlNodePtr(n_cur, cur, 0);
17821        des_xmlNodePtr_in(n_elem, elem, 1);
17822        xmlResetLastError();
17823        if (mem_base != xmlMemBlocks()) {
17824            printf("Leak of %d blocks found in xmlAddSibling",
17825	           xmlMemBlocks() - mem_base);
17826	    test_ret++;
17827            printf(" %d", n_cur);
17828            printf(" %d", n_elem);
17829            printf("\n");
17830        }
17831    }
17832    }
17833    function_tests++;
17834
17835    return(test_ret);
17836}
17837
17838
17839static int
17840test_xmlAttrSerializeTxtContent(void) {
17841    int test_ret = 0;
17842
17843#if defined(LIBXML_OUTPUT_ENABLED)
17844#ifdef LIBXML_OUTPUT_ENABLED
17845    int mem_base;
17846    xmlBufferPtr buf; /* the XML buffer output */
17847    int n_buf;
17848    xmlDocPtr doc; /* the document */
17849    int n_doc;
17850    xmlAttrPtr attr; /* the attribute node */
17851    int n_attr;
17852    xmlChar * string; /* the text content */
17853    int n_string;
17854
17855    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17856    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17857    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
17858    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
17859        mem_base = xmlMemBlocks();
17860        buf = gen_xmlBufferPtr(n_buf, 0);
17861        doc = gen_xmlDocPtr(n_doc, 1);
17862        attr = gen_xmlAttrPtr(n_attr, 2);
17863        string = gen_const_xmlChar_ptr(n_string, 3);
17864
17865        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
17866        call_tests++;
17867        des_xmlBufferPtr(n_buf, buf, 0);
17868        des_xmlDocPtr(n_doc, doc, 1);
17869        des_xmlAttrPtr(n_attr, attr, 2);
17870        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
17871        xmlResetLastError();
17872        if (mem_base != xmlMemBlocks()) {
17873            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
17874	           xmlMemBlocks() - mem_base);
17875	    test_ret++;
17876            printf(" %d", n_buf);
17877            printf(" %d", n_doc);
17878            printf(" %d", n_attr);
17879            printf(" %d", n_string);
17880            printf("\n");
17881        }
17882    }
17883    }
17884    }
17885    }
17886    function_tests++;
17887#endif
17888#endif
17889
17890    return(test_ret);
17891}
17892
17893
17894static int
17895test_xmlBufferAdd(void) {
17896    int test_ret = 0;
17897
17898    int mem_base;
17899    int ret_val;
17900    xmlBufferPtr buf; /* the buffer to dump */
17901    int n_buf;
17902    xmlChar * str; /* the #xmlChar string */
17903    int n_str;
17904    int len; /* the number of #xmlChar to add */
17905    int n_len;
17906
17907    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17908    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17909    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17910        mem_base = xmlMemBlocks();
17911        buf = gen_xmlBufferPtr(n_buf, 0);
17912        str = gen_const_xmlChar_ptr(n_str, 1);
17913        len = gen_int(n_len, 2);
17914
17915        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
17916        desret_int(ret_val);
17917        call_tests++;
17918        des_xmlBufferPtr(n_buf, buf, 0);
17919        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17920        des_int(n_len, len, 2);
17921        xmlResetLastError();
17922        if (mem_base != xmlMemBlocks()) {
17923            printf("Leak of %d blocks found in xmlBufferAdd",
17924	           xmlMemBlocks() - mem_base);
17925	    test_ret++;
17926            printf(" %d", n_buf);
17927            printf(" %d", n_str);
17928            printf(" %d", n_len);
17929            printf("\n");
17930        }
17931    }
17932    }
17933    }
17934    function_tests++;
17935
17936    return(test_ret);
17937}
17938
17939
17940static int
17941test_xmlBufferAddHead(void) {
17942    int test_ret = 0;
17943
17944    int mem_base;
17945    int ret_val;
17946    xmlBufferPtr buf; /* the buffer */
17947    int n_buf;
17948    xmlChar * str; /* the #xmlChar string */
17949    int n_str;
17950    int len; /* the number of #xmlChar to add */
17951    int n_len;
17952
17953    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17954    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17955    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17956        mem_base = xmlMemBlocks();
17957        buf = gen_xmlBufferPtr(n_buf, 0);
17958        str = gen_const_xmlChar_ptr(n_str, 1);
17959        len = gen_int(n_len, 2);
17960
17961        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
17962        desret_int(ret_val);
17963        call_tests++;
17964        des_xmlBufferPtr(n_buf, buf, 0);
17965        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17966        des_int(n_len, len, 2);
17967        xmlResetLastError();
17968        if (mem_base != xmlMemBlocks()) {
17969            printf("Leak of %d blocks found in xmlBufferAddHead",
17970	           xmlMemBlocks() - mem_base);
17971	    test_ret++;
17972            printf(" %d", n_buf);
17973            printf(" %d", n_str);
17974            printf(" %d", n_len);
17975            printf("\n");
17976        }
17977    }
17978    }
17979    }
17980    function_tests++;
17981
17982    return(test_ret);
17983}
17984
17985
17986static int
17987test_xmlBufferCCat(void) {
17988    int test_ret = 0;
17989
17990    int mem_base;
17991    int ret_val;
17992    xmlBufferPtr buf; /* the buffer to dump */
17993    int n_buf;
17994    char * str; /* the C char string */
17995    int n_str;
17996
17997    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17998    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
17999        mem_base = xmlMemBlocks();
18000        buf = gen_xmlBufferPtr(n_buf, 0);
18001        str = gen_const_char_ptr(n_str, 1);
18002
18003        ret_val = xmlBufferCCat(buf, (const char *)str);
18004        desret_int(ret_val);
18005        call_tests++;
18006        des_xmlBufferPtr(n_buf, buf, 0);
18007        des_const_char_ptr(n_str, (const char *)str, 1);
18008        xmlResetLastError();
18009        if (mem_base != xmlMemBlocks()) {
18010            printf("Leak of %d blocks found in xmlBufferCCat",
18011	           xmlMemBlocks() - mem_base);
18012	    test_ret++;
18013            printf(" %d", n_buf);
18014            printf(" %d", n_str);
18015            printf("\n");
18016        }
18017    }
18018    }
18019    function_tests++;
18020
18021    return(test_ret);
18022}
18023
18024
18025static int
18026test_xmlBufferCat(void) {
18027    int test_ret = 0;
18028
18029    int mem_base;
18030    int ret_val;
18031    xmlBufferPtr buf; /* the buffer to add to */
18032    int n_buf;
18033    xmlChar * str; /* the #xmlChar string */
18034    int n_str;
18035
18036    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18037    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18038        mem_base = xmlMemBlocks();
18039        buf = gen_xmlBufferPtr(n_buf, 0);
18040        str = gen_const_xmlChar_ptr(n_str, 1);
18041
18042        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18043        desret_int(ret_val);
18044        call_tests++;
18045        des_xmlBufferPtr(n_buf, buf, 0);
18046        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18047        xmlResetLastError();
18048        if (mem_base != xmlMemBlocks()) {
18049            printf("Leak of %d blocks found in xmlBufferCat",
18050	           xmlMemBlocks() - mem_base);
18051	    test_ret++;
18052            printf(" %d", n_buf);
18053            printf(" %d", n_str);
18054            printf("\n");
18055        }
18056    }
18057    }
18058    function_tests++;
18059
18060    return(test_ret);
18061}
18062
18063
18064#define gen_nb_const_xmlBufferPtr 1
18065static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18066    return(NULL);
18067}
18068static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18069}
18070
18071static int
18072test_xmlBufferContent(void) {
18073    int test_ret = 0;
18074
18075    int mem_base;
18076    const xmlChar * ret_val;
18077    xmlBufferPtr buf; /* the buffer */
18078    int n_buf;
18079
18080    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18081        mem_base = xmlMemBlocks();
18082        buf = gen_const_xmlBufferPtr(n_buf, 0);
18083
18084        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18085        desret_const_xmlChar_ptr(ret_val);
18086        call_tests++;
18087        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18088        xmlResetLastError();
18089        if (mem_base != xmlMemBlocks()) {
18090            printf("Leak of %d blocks found in xmlBufferContent",
18091	           xmlMemBlocks() - mem_base);
18092	    test_ret++;
18093            printf(" %d", n_buf);
18094            printf("\n");
18095        }
18096    }
18097    function_tests++;
18098
18099    return(test_ret);
18100}
18101
18102
18103static int
18104test_xmlBufferCreate(void) {
18105    int test_ret = 0;
18106
18107    int mem_base;
18108    xmlBufferPtr ret_val;
18109
18110        mem_base = xmlMemBlocks();
18111
18112        ret_val = xmlBufferCreate();
18113        desret_xmlBufferPtr(ret_val);
18114        call_tests++;
18115        xmlResetLastError();
18116        if (mem_base != xmlMemBlocks()) {
18117            printf("Leak of %d blocks found in xmlBufferCreate",
18118	           xmlMemBlocks() - mem_base);
18119	    test_ret++;
18120            printf("\n");
18121        }
18122    function_tests++;
18123
18124    return(test_ret);
18125}
18126
18127
18128static int
18129test_xmlBufferCreateSize(void) {
18130    int test_ret = 0;
18131
18132
18133    /* missing type support */
18134    return(test_ret);
18135}
18136
18137
18138static int
18139test_xmlBufferCreateStatic(void) {
18140    int test_ret = 0;
18141
18142
18143    /* missing type support */
18144    return(test_ret);
18145}
18146
18147
18148static int
18149test_xmlBufferEmpty(void) {
18150    int test_ret = 0;
18151
18152    int mem_base;
18153    xmlBufferPtr buf; /* the buffer */
18154    int n_buf;
18155
18156    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18157        mem_base = xmlMemBlocks();
18158        buf = gen_xmlBufferPtr(n_buf, 0);
18159
18160        xmlBufferEmpty(buf);
18161        call_tests++;
18162        des_xmlBufferPtr(n_buf, buf, 0);
18163        xmlResetLastError();
18164        if (mem_base != xmlMemBlocks()) {
18165            printf("Leak of %d blocks found in xmlBufferEmpty",
18166	           xmlMemBlocks() - mem_base);
18167	    test_ret++;
18168            printf(" %d", n_buf);
18169            printf("\n");
18170        }
18171    }
18172    function_tests++;
18173
18174    return(test_ret);
18175}
18176
18177
18178static int
18179test_xmlBufferGrow(void) {
18180    int test_ret = 0;
18181
18182    int mem_base;
18183    int ret_val;
18184    xmlBufferPtr buf; /* the buffer */
18185    int n_buf;
18186    unsigned int len; /* the minimum free size to allocate */
18187    int n_len;
18188
18189    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18190    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18191        mem_base = xmlMemBlocks();
18192        buf = gen_xmlBufferPtr(n_buf, 0);
18193        len = gen_unsigned_int(n_len, 1);
18194
18195        ret_val = xmlBufferGrow(buf, len);
18196        desret_int(ret_val);
18197        call_tests++;
18198        des_xmlBufferPtr(n_buf, buf, 0);
18199        des_unsigned_int(n_len, len, 1);
18200        xmlResetLastError();
18201        if (mem_base != xmlMemBlocks()) {
18202            printf("Leak of %d blocks found in xmlBufferGrow",
18203	           xmlMemBlocks() - mem_base);
18204	    test_ret++;
18205            printf(" %d", n_buf);
18206            printf(" %d", n_len);
18207            printf("\n");
18208        }
18209    }
18210    }
18211    function_tests++;
18212
18213    return(test_ret);
18214}
18215
18216
18217static int
18218test_xmlBufferLength(void) {
18219    int test_ret = 0;
18220
18221    int mem_base;
18222    int ret_val;
18223    xmlBufferPtr buf; /* the buffer */
18224    int n_buf;
18225
18226    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18227        mem_base = xmlMemBlocks();
18228        buf = gen_const_xmlBufferPtr(n_buf, 0);
18229
18230        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18231        desret_int(ret_val);
18232        call_tests++;
18233        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18234        xmlResetLastError();
18235        if (mem_base != xmlMemBlocks()) {
18236            printf("Leak of %d blocks found in xmlBufferLength",
18237	           xmlMemBlocks() - mem_base);
18238	    test_ret++;
18239            printf(" %d", n_buf);
18240            printf("\n");
18241        }
18242    }
18243    function_tests++;
18244
18245    return(test_ret);
18246}
18247
18248
18249static int
18250test_xmlBufferResize(void) {
18251    int test_ret = 0;
18252
18253    int mem_base;
18254    int ret_val;
18255    xmlBufferPtr buf; /* the buffer to resize */
18256    int n_buf;
18257    unsigned int size; /* the desired size */
18258    int n_size;
18259
18260    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18261    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18262        mem_base = xmlMemBlocks();
18263        buf = gen_xmlBufferPtr(n_buf, 0);
18264        size = gen_unsigned_int(n_size, 1);
18265
18266        ret_val = xmlBufferResize(buf, size);
18267        desret_int(ret_val);
18268        call_tests++;
18269        des_xmlBufferPtr(n_buf, buf, 0);
18270        des_unsigned_int(n_size, size, 1);
18271        xmlResetLastError();
18272        if (mem_base != xmlMemBlocks()) {
18273            printf("Leak of %d blocks found in xmlBufferResize",
18274	           xmlMemBlocks() - mem_base);
18275	    test_ret++;
18276            printf(" %d", n_buf);
18277            printf(" %d", n_size);
18278            printf("\n");
18279        }
18280    }
18281    }
18282    function_tests++;
18283
18284    return(test_ret);
18285}
18286
18287
18288static int
18289test_xmlBufferSetAllocationScheme(void) {
18290    int test_ret = 0;
18291
18292    int mem_base;
18293    xmlBufferPtr buf; /* the buffer to tune */
18294    int n_buf;
18295    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18296    int n_scheme;
18297
18298    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18299    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18300        mem_base = xmlMemBlocks();
18301        buf = gen_xmlBufferPtr(n_buf, 0);
18302        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18303
18304        xmlBufferSetAllocationScheme(buf, scheme);
18305        call_tests++;
18306        des_xmlBufferPtr(n_buf, buf, 0);
18307        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18308        xmlResetLastError();
18309        if (mem_base != xmlMemBlocks()) {
18310            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18311	           xmlMemBlocks() - mem_base);
18312	    test_ret++;
18313            printf(" %d", n_buf);
18314            printf(" %d", n_scheme);
18315            printf("\n");
18316        }
18317    }
18318    }
18319    function_tests++;
18320
18321    return(test_ret);
18322}
18323
18324
18325static int
18326test_xmlBufferShrink(void) {
18327    int test_ret = 0;
18328
18329    int mem_base;
18330    int ret_val;
18331    xmlBufferPtr buf; /* the buffer to dump */
18332    int n_buf;
18333    unsigned int len; /* the number of xmlChar to remove */
18334    int n_len;
18335
18336    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18337    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18338        mem_base = xmlMemBlocks();
18339        buf = gen_xmlBufferPtr(n_buf, 0);
18340        len = gen_unsigned_int(n_len, 1);
18341
18342        ret_val = xmlBufferShrink(buf, len);
18343        desret_int(ret_val);
18344        call_tests++;
18345        des_xmlBufferPtr(n_buf, buf, 0);
18346        des_unsigned_int(n_len, len, 1);
18347        xmlResetLastError();
18348        if (mem_base != xmlMemBlocks()) {
18349            printf("Leak of %d blocks found in xmlBufferShrink",
18350	           xmlMemBlocks() - mem_base);
18351	    test_ret++;
18352            printf(" %d", n_buf);
18353            printf(" %d", n_len);
18354            printf("\n");
18355        }
18356    }
18357    }
18358    function_tests++;
18359
18360    return(test_ret);
18361}
18362
18363
18364static int
18365test_xmlBufferWriteCHAR(void) {
18366    int test_ret = 0;
18367
18368    int mem_base;
18369    xmlBufferPtr buf; /* the XML buffer */
18370    int n_buf;
18371    xmlChar * string; /* the string to add */
18372    int n_string;
18373
18374    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18375    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18376        mem_base = xmlMemBlocks();
18377        buf = gen_xmlBufferPtr(n_buf, 0);
18378        string = gen_const_xmlChar_ptr(n_string, 1);
18379
18380        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18381        call_tests++;
18382        des_xmlBufferPtr(n_buf, buf, 0);
18383        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18384        xmlResetLastError();
18385        if (mem_base != xmlMemBlocks()) {
18386            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18387	           xmlMemBlocks() - mem_base);
18388	    test_ret++;
18389            printf(" %d", n_buf);
18390            printf(" %d", n_string);
18391            printf("\n");
18392        }
18393    }
18394    }
18395    function_tests++;
18396
18397    return(test_ret);
18398}
18399
18400
18401static int
18402test_xmlBufferWriteChar(void) {
18403    int test_ret = 0;
18404
18405    int mem_base;
18406    xmlBufferPtr buf; /* the XML buffer output */
18407    int n_buf;
18408    char * string; /* the string to add */
18409    int n_string;
18410
18411    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18412    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18413        mem_base = xmlMemBlocks();
18414        buf = gen_xmlBufferPtr(n_buf, 0);
18415        string = gen_const_char_ptr(n_string, 1);
18416
18417        xmlBufferWriteChar(buf, (const char *)string);
18418        call_tests++;
18419        des_xmlBufferPtr(n_buf, buf, 0);
18420        des_const_char_ptr(n_string, (const char *)string, 1);
18421        xmlResetLastError();
18422        if (mem_base != xmlMemBlocks()) {
18423            printf("Leak of %d blocks found in xmlBufferWriteChar",
18424	           xmlMemBlocks() - mem_base);
18425	    test_ret++;
18426            printf(" %d", n_buf);
18427            printf(" %d", n_string);
18428            printf("\n");
18429        }
18430    }
18431    }
18432    function_tests++;
18433
18434    return(test_ret);
18435}
18436
18437
18438static int
18439test_xmlBufferWriteQuotedString(void) {
18440    int test_ret = 0;
18441
18442    int mem_base;
18443    xmlBufferPtr buf; /* the XML buffer output */
18444    int n_buf;
18445    xmlChar * string; /* the string to add */
18446    int n_string;
18447
18448    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18449    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18450        mem_base = xmlMemBlocks();
18451        buf = gen_xmlBufferPtr(n_buf, 0);
18452        string = gen_const_xmlChar_ptr(n_string, 1);
18453
18454        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18455        call_tests++;
18456        des_xmlBufferPtr(n_buf, buf, 0);
18457        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18458        xmlResetLastError();
18459        if (mem_base != xmlMemBlocks()) {
18460            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18461	           xmlMemBlocks() - mem_base);
18462	    test_ret++;
18463            printf(" %d", n_buf);
18464            printf(" %d", n_string);
18465            printf("\n");
18466        }
18467    }
18468    }
18469    function_tests++;
18470
18471    return(test_ret);
18472}
18473
18474
18475static int
18476test_xmlBuildQName(void) {
18477    int test_ret = 0;
18478
18479    int mem_base;
18480    xmlChar * ret_val;
18481    xmlChar * ncname; /* the Name */
18482    int n_ncname;
18483    xmlChar * prefix; /* the prefix */
18484    int n_prefix;
18485    xmlChar * memory; /* preallocated memory */
18486    int n_memory;
18487    int len; /* preallocated memory length */
18488    int n_len;
18489
18490    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18491    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18492    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18493    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18494        mem_base = xmlMemBlocks();
18495        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18496        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18497        memory = gen_xmlChar_ptr(n_memory, 2);
18498        len = gen_int(n_len, 3);
18499
18500        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18501        if ((ret_val != NULL) && (ret_val != ncname) &&
18502              (ret_val != prefix) && (ret_val != memory))
18503              xmlFree(ret_val);
18504	  ret_val = NULL;
18505        desret_xmlChar_ptr(ret_val);
18506        call_tests++;
18507        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18508        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18509        des_xmlChar_ptr(n_memory, memory, 2);
18510        des_int(n_len, len, 3);
18511        xmlResetLastError();
18512        if (mem_base != xmlMemBlocks()) {
18513            printf("Leak of %d blocks found in xmlBuildQName",
18514	           xmlMemBlocks() - mem_base);
18515	    test_ret++;
18516            printf(" %d", n_ncname);
18517            printf(" %d", n_prefix);
18518            printf(" %d", n_memory);
18519            printf(" %d", n_len);
18520            printf("\n");
18521        }
18522    }
18523    }
18524    }
18525    }
18526    function_tests++;
18527
18528    return(test_ret);
18529}
18530
18531
18532static int
18533test_xmlCopyDoc(void) {
18534    int test_ret = 0;
18535
18536#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18537    int mem_base;
18538    xmlDocPtr ret_val;
18539    xmlDocPtr doc; /* the document */
18540    int n_doc;
18541    int recursive; /* if not zero do a recursive copy. */
18542    int n_recursive;
18543
18544    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18545    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18546        mem_base = xmlMemBlocks();
18547        doc = gen_xmlDocPtr(n_doc, 0);
18548        recursive = gen_int(n_recursive, 1);
18549
18550        ret_val = xmlCopyDoc(doc, recursive);
18551        desret_xmlDocPtr(ret_val);
18552        call_tests++;
18553        des_xmlDocPtr(n_doc, doc, 0);
18554        des_int(n_recursive, recursive, 1);
18555        xmlResetLastError();
18556        if (mem_base != xmlMemBlocks()) {
18557            printf("Leak of %d blocks found in xmlCopyDoc",
18558	           xmlMemBlocks() - mem_base);
18559	    test_ret++;
18560            printf(" %d", n_doc);
18561            printf(" %d", n_recursive);
18562            printf("\n");
18563        }
18564    }
18565    }
18566    function_tests++;
18567#endif
18568
18569    return(test_ret);
18570}
18571
18572
18573static int
18574test_xmlCopyDtd(void) {
18575    int test_ret = 0;
18576
18577#if defined(LIBXML_TREE_ENABLED)
18578    int mem_base;
18579    xmlDtdPtr ret_val;
18580    xmlDtdPtr dtd; /* the dtd */
18581    int n_dtd;
18582
18583    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18584        mem_base = xmlMemBlocks();
18585        dtd = gen_xmlDtdPtr(n_dtd, 0);
18586
18587        ret_val = xmlCopyDtd(dtd);
18588        desret_xmlDtdPtr(ret_val);
18589        call_tests++;
18590        des_xmlDtdPtr(n_dtd, dtd, 0);
18591        xmlResetLastError();
18592        if (mem_base != xmlMemBlocks()) {
18593            printf("Leak of %d blocks found in xmlCopyDtd",
18594	           xmlMemBlocks() - mem_base);
18595	    test_ret++;
18596            printf(" %d", n_dtd);
18597            printf("\n");
18598        }
18599    }
18600    function_tests++;
18601#endif
18602
18603    return(test_ret);
18604}
18605
18606
18607static int
18608test_xmlCopyNamespace(void) {
18609    int test_ret = 0;
18610
18611    int mem_base;
18612    xmlNsPtr ret_val;
18613    xmlNsPtr cur; /* the namespace */
18614    int n_cur;
18615
18616    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18617        mem_base = xmlMemBlocks();
18618        cur = gen_xmlNsPtr(n_cur, 0);
18619
18620        ret_val = xmlCopyNamespace(cur);
18621        if (ret_val != NULL) xmlFreeNs(ret_val);
18622        desret_xmlNsPtr(ret_val);
18623        call_tests++;
18624        des_xmlNsPtr(n_cur, cur, 0);
18625        xmlResetLastError();
18626        if (mem_base != xmlMemBlocks()) {
18627            printf("Leak of %d blocks found in xmlCopyNamespace",
18628	           xmlMemBlocks() - mem_base);
18629	    test_ret++;
18630            printf(" %d", n_cur);
18631            printf("\n");
18632        }
18633    }
18634    function_tests++;
18635
18636    return(test_ret);
18637}
18638
18639
18640static int
18641test_xmlCopyNamespaceList(void) {
18642    int test_ret = 0;
18643
18644    int mem_base;
18645    xmlNsPtr ret_val;
18646    xmlNsPtr cur; /* the first namespace */
18647    int n_cur;
18648
18649    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18650        mem_base = xmlMemBlocks();
18651        cur = gen_xmlNsPtr(n_cur, 0);
18652
18653        ret_val = xmlCopyNamespaceList(cur);
18654        if (ret_val != NULL) xmlFreeNsList(ret_val);
18655        desret_xmlNsPtr(ret_val);
18656        call_tests++;
18657        des_xmlNsPtr(n_cur, cur, 0);
18658        xmlResetLastError();
18659        if (mem_base != xmlMemBlocks()) {
18660            printf("Leak of %d blocks found in xmlCopyNamespaceList",
18661	           xmlMemBlocks() - mem_base);
18662	    test_ret++;
18663            printf(" %d", n_cur);
18664            printf("\n");
18665        }
18666    }
18667    function_tests++;
18668
18669    return(test_ret);
18670}
18671
18672
18673static int
18674test_xmlCopyNode(void) {
18675    int test_ret = 0;
18676
18677    int mem_base;
18678    xmlNodePtr ret_val;
18679    xmlNodePtr node; /* the node */
18680    int n_node;
18681    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18682    int n_extended;
18683
18684    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18685    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18686        mem_base = xmlMemBlocks();
18687        node = gen_const_xmlNodePtr(n_node, 0);
18688        extended = gen_int(n_extended, 1);
18689
18690        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
18691        desret_xmlNodePtr(ret_val);
18692        call_tests++;
18693        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18694        des_int(n_extended, extended, 1);
18695        xmlResetLastError();
18696        if (mem_base != xmlMemBlocks()) {
18697            printf("Leak of %d blocks found in xmlCopyNode",
18698	           xmlMemBlocks() - mem_base);
18699	    test_ret++;
18700            printf(" %d", n_node);
18701            printf(" %d", n_extended);
18702            printf("\n");
18703        }
18704    }
18705    }
18706    function_tests++;
18707
18708    return(test_ret);
18709}
18710
18711
18712static int
18713test_xmlCopyNodeList(void) {
18714    int test_ret = 0;
18715
18716    int mem_base;
18717    xmlNodePtr ret_val;
18718    xmlNodePtr node; /* the first node in the list. */
18719    int n_node;
18720
18721    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18722        mem_base = xmlMemBlocks();
18723        node = gen_const_xmlNodePtr(n_node, 0);
18724
18725        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
18726        desret_xmlNodePtr(ret_val);
18727        call_tests++;
18728        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18729        xmlResetLastError();
18730        if (mem_base != xmlMemBlocks()) {
18731            printf("Leak of %d blocks found in xmlCopyNodeList",
18732	           xmlMemBlocks() - mem_base);
18733	    test_ret++;
18734            printf(" %d", n_node);
18735            printf("\n");
18736        }
18737    }
18738    function_tests++;
18739
18740    return(test_ret);
18741}
18742
18743
18744static int
18745test_xmlCopyProp(void) {
18746    int test_ret = 0;
18747
18748    int mem_base;
18749    xmlAttrPtr ret_val;
18750    xmlNodePtr target; /* the element where the attribute will be grafted */
18751    int n_target;
18752    xmlAttrPtr cur; /* the attribute */
18753    int n_cur;
18754
18755    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18756    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18757        mem_base = xmlMemBlocks();
18758        target = gen_xmlNodePtr(n_target, 0);
18759        cur = gen_xmlAttrPtr(n_cur, 1);
18760
18761        ret_val = xmlCopyProp(target, cur);
18762        desret_xmlAttrPtr(ret_val);
18763        call_tests++;
18764        des_xmlNodePtr(n_target, target, 0);
18765        des_xmlAttrPtr(n_cur, cur, 1);
18766        xmlResetLastError();
18767        if (mem_base != xmlMemBlocks()) {
18768            printf("Leak of %d blocks found in xmlCopyProp",
18769	           xmlMemBlocks() - mem_base);
18770	    test_ret++;
18771            printf(" %d", n_target);
18772            printf(" %d", n_cur);
18773            printf("\n");
18774        }
18775    }
18776    }
18777    function_tests++;
18778
18779    return(test_ret);
18780}
18781
18782
18783static int
18784test_xmlCopyPropList(void) {
18785    int test_ret = 0;
18786
18787    int mem_base;
18788    xmlAttrPtr ret_val;
18789    xmlNodePtr target; /* the element where the attributes will be grafted */
18790    int n_target;
18791    xmlAttrPtr cur; /* the first attribute */
18792    int n_cur;
18793
18794    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18795    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18796        mem_base = xmlMemBlocks();
18797        target = gen_xmlNodePtr(n_target, 0);
18798        cur = gen_xmlAttrPtr(n_cur, 1);
18799
18800        ret_val = xmlCopyPropList(target, cur);
18801        desret_xmlAttrPtr(ret_val);
18802        call_tests++;
18803        des_xmlNodePtr(n_target, target, 0);
18804        des_xmlAttrPtr(n_cur, cur, 1);
18805        xmlResetLastError();
18806        if (mem_base != xmlMemBlocks()) {
18807            printf("Leak of %d blocks found in xmlCopyPropList",
18808	           xmlMemBlocks() - mem_base);
18809	    test_ret++;
18810            printf(" %d", n_target);
18811            printf(" %d", n_cur);
18812            printf("\n");
18813        }
18814    }
18815    }
18816    function_tests++;
18817
18818    return(test_ret);
18819}
18820
18821
18822static int
18823test_xmlCreateIntSubset(void) {
18824    int test_ret = 0;
18825
18826    int mem_base;
18827    xmlDtdPtr ret_val;
18828    xmlDocPtr doc; /* the document pointer */
18829    int n_doc;
18830    xmlChar * name; /* the DTD name */
18831    int n_name;
18832    xmlChar * ExternalID; /* the external (PUBLIC) ID */
18833    int n_ExternalID;
18834    xmlChar * SystemID; /* the system ID */
18835    int n_SystemID;
18836
18837    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18838    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
18839    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
18840    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
18841        mem_base = xmlMemBlocks();
18842        doc = gen_xmlDocPtr(n_doc, 0);
18843        name = gen_const_xmlChar_ptr(n_name, 1);
18844        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
18845        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
18846
18847        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
18848        desret_xmlDtdPtr(ret_val);
18849        call_tests++;
18850        des_xmlDocPtr(n_doc, doc, 0);
18851        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
18852        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
18853        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
18854        xmlResetLastError();
18855        if (mem_base != xmlMemBlocks()) {
18856            printf("Leak of %d blocks found in xmlCreateIntSubset",
18857	           xmlMemBlocks() - mem_base);
18858	    test_ret++;
18859            printf(" %d", n_doc);
18860            printf(" %d", n_name);
18861            printf(" %d", n_ExternalID);
18862            printf(" %d", n_SystemID);
18863            printf("\n");
18864        }
18865    }
18866    }
18867    }
18868    }
18869    function_tests++;
18870
18871    return(test_ret);
18872}
18873
18874
18875static int
18876test_xmlDocCopyNode(void) {
18877    int test_ret = 0;
18878
18879    int mem_base;
18880    xmlNodePtr ret_val;
18881    xmlNodePtr node; /* the node */
18882    int n_node;
18883    xmlDocPtr doc; /* the document */
18884    int n_doc;
18885    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18886    int n_extended;
18887
18888    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18889    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18890    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18891        mem_base = xmlMemBlocks();
18892        node = gen_const_xmlNodePtr(n_node, 0);
18893        doc = gen_xmlDocPtr(n_doc, 1);
18894        extended = gen_int(n_extended, 2);
18895
18896        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
18897        desret_xmlNodePtr(ret_val);
18898        call_tests++;
18899        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18900        des_xmlDocPtr(n_doc, doc, 1);
18901        des_int(n_extended, extended, 2);
18902        xmlResetLastError();
18903        if (mem_base != xmlMemBlocks()) {
18904            printf("Leak of %d blocks found in xmlDocCopyNode",
18905	           xmlMemBlocks() - mem_base);
18906	    test_ret++;
18907            printf(" %d", n_node);
18908            printf(" %d", n_doc);
18909            printf(" %d", n_extended);
18910            printf("\n");
18911        }
18912    }
18913    }
18914    }
18915    function_tests++;
18916
18917    return(test_ret);
18918}
18919
18920
18921static int
18922test_xmlDocCopyNodeList(void) {
18923    int test_ret = 0;
18924
18925    int mem_base;
18926    xmlNodePtr ret_val;
18927    xmlDocPtr doc; /* the target document */
18928    int n_doc;
18929    xmlNodePtr node; /* the first node in the list. */
18930    int n_node;
18931
18932    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18933    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18934        mem_base = xmlMemBlocks();
18935        doc = gen_xmlDocPtr(n_doc, 0);
18936        node = gen_const_xmlNodePtr(n_node, 1);
18937
18938        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
18939        desret_xmlNodePtr(ret_val);
18940        call_tests++;
18941        des_xmlDocPtr(n_doc, doc, 0);
18942        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
18943        xmlResetLastError();
18944        if (mem_base != xmlMemBlocks()) {
18945            printf("Leak of %d blocks found in xmlDocCopyNodeList",
18946	           xmlMemBlocks() - mem_base);
18947	    test_ret++;
18948            printf(" %d", n_doc);
18949            printf(" %d", n_node);
18950            printf("\n");
18951        }
18952    }
18953    }
18954    function_tests++;
18955
18956    return(test_ret);
18957}
18958
18959
18960static int
18961test_xmlDocDump(void) {
18962    int test_ret = 0;
18963
18964#if defined(LIBXML_OUTPUT_ENABLED)
18965    int mem_base;
18966    int ret_val;
18967    FILE * f; /* the FILE* */
18968    int n_f;
18969    xmlDocPtr cur; /* the document */
18970    int n_cur;
18971
18972    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
18973    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18974        mem_base = xmlMemBlocks();
18975        f = gen_FILE_ptr(n_f, 0);
18976        cur = gen_xmlDocPtr(n_cur, 1);
18977
18978        ret_val = xmlDocDump(f, cur);
18979        desret_int(ret_val);
18980        call_tests++;
18981        des_FILE_ptr(n_f, f, 0);
18982        des_xmlDocPtr(n_cur, cur, 1);
18983        xmlResetLastError();
18984        if (mem_base != xmlMemBlocks()) {
18985            printf("Leak of %d blocks found in xmlDocDump",
18986	           xmlMemBlocks() - mem_base);
18987	    test_ret++;
18988            printf(" %d", n_f);
18989            printf(" %d", n_cur);
18990            printf("\n");
18991        }
18992    }
18993    }
18994    function_tests++;
18995#endif
18996
18997    return(test_ret);
18998}
18999
19000
19001static int
19002test_xmlDocDumpFormatMemory(void) {
19003    int test_ret = 0;
19004
19005#if defined(LIBXML_OUTPUT_ENABLED)
19006    int mem_base;
19007    xmlDocPtr cur; /* the document */
19008    int n_cur;
19009    xmlChar ** mem; /* OUT: the memory pointer */
19010    int n_mem;
19011    int * size; /* OUT: the memory length */
19012    int n_size;
19013    int format; /* should formatting spaces been added */
19014    int n_format;
19015
19016    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19017    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19018    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19019    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19020        mem_base = xmlMemBlocks();
19021        cur = gen_xmlDocPtr(n_cur, 0);
19022        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19023        size = gen_int_ptr(n_size, 2);
19024        format = gen_int(n_format, 3);
19025
19026        xmlDocDumpFormatMemory(cur, mem, size, format);
19027        call_tests++;
19028        des_xmlDocPtr(n_cur, cur, 0);
19029        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19030        des_int_ptr(n_size, size, 2);
19031        des_int(n_format, format, 3);
19032        xmlResetLastError();
19033        if (mem_base != xmlMemBlocks()) {
19034            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19035	           xmlMemBlocks() - mem_base);
19036	    test_ret++;
19037            printf(" %d", n_cur);
19038            printf(" %d", n_mem);
19039            printf(" %d", n_size);
19040            printf(" %d", n_format);
19041            printf("\n");
19042        }
19043    }
19044    }
19045    }
19046    }
19047    function_tests++;
19048#endif
19049
19050    return(test_ret);
19051}
19052
19053
19054static int
19055test_xmlDocDumpFormatMemoryEnc(void) {
19056    int test_ret = 0;
19057
19058#if defined(LIBXML_OUTPUT_ENABLED)
19059    int mem_base;
19060    xmlDocPtr out_doc; /* Document to generate XML text from */
19061    int n_out_doc;
19062    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19063    int n_doc_txt_ptr;
19064    int * doc_txt_len; /* Length of the generated XML text */
19065    int n_doc_txt_len;
19066    char * txt_encoding; /* Character encoding to use when generating XML text */
19067    int n_txt_encoding;
19068    int format; /* should formatting spaces been added */
19069    int n_format;
19070
19071    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19072    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19073    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19074    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19075    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19076        mem_base = xmlMemBlocks();
19077        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19078        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19079        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19080        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19081        format = gen_int(n_format, 4);
19082
19083        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19084        call_tests++;
19085        des_xmlDocPtr(n_out_doc, out_doc, 0);
19086        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19087        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19088        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19089        des_int(n_format, format, 4);
19090        xmlResetLastError();
19091        if (mem_base != xmlMemBlocks()) {
19092            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19093	           xmlMemBlocks() - mem_base);
19094	    test_ret++;
19095            printf(" %d", n_out_doc);
19096            printf(" %d", n_doc_txt_ptr);
19097            printf(" %d", n_doc_txt_len);
19098            printf(" %d", n_txt_encoding);
19099            printf(" %d", n_format);
19100            printf("\n");
19101        }
19102    }
19103    }
19104    }
19105    }
19106    }
19107    function_tests++;
19108#endif
19109
19110    return(test_ret);
19111}
19112
19113
19114static int
19115test_xmlDocDumpMemory(void) {
19116    int test_ret = 0;
19117
19118#if defined(LIBXML_OUTPUT_ENABLED)
19119    int mem_base;
19120    xmlDocPtr cur; /* the document */
19121    int n_cur;
19122    xmlChar ** mem; /* OUT: the memory pointer */
19123    int n_mem;
19124    int * size; /* OUT: the memory length */
19125    int n_size;
19126
19127    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19128    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19129    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19130        mem_base = xmlMemBlocks();
19131        cur = gen_xmlDocPtr(n_cur, 0);
19132        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19133        size = gen_int_ptr(n_size, 2);
19134
19135        xmlDocDumpMemory(cur, mem, size);
19136        call_tests++;
19137        des_xmlDocPtr(n_cur, cur, 0);
19138        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19139        des_int_ptr(n_size, size, 2);
19140        xmlResetLastError();
19141        if (mem_base != xmlMemBlocks()) {
19142            printf("Leak of %d blocks found in xmlDocDumpMemory",
19143	           xmlMemBlocks() - mem_base);
19144	    test_ret++;
19145            printf(" %d", n_cur);
19146            printf(" %d", n_mem);
19147            printf(" %d", n_size);
19148            printf("\n");
19149        }
19150    }
19151    }
19152    }
19153    function_tests++;
19154#endif
19155
19156    return(test_ret);
19157}
19158
19159
19160static int
19161test_xmlDocDumpMemoryEnc(void) {
19162    int test_ret = 0;
19163
19164#if defined(LIBXML_OUTPUT_ENABLED)
19165    int mem_base;
19166    xmlDocPtr out_doc; /* Document to generate XML text from */
19167    int n_out_doc;
19168    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19169    int n_doc_txt_ptr;
19170    int * doc_txt_len; /* Length of the generated XML text */
19171    int n_doc_txt_len;
19172    char * txt_encoding; /* Character encoding to use when generating XML text */
19173    int n_txt_encoding;
19174
19175    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19176    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19177    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19178    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19179        mem_base = xmlMemBlocks();
19180        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19181        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19182        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19183        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19184
19185        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19186        call_tests++;
19187        des_xmlDocPtr(n_out_doc, out_doc, 0);
19188        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19189        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19190        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19191        xmlResetLastError();
19192        if (mem_base != xmlMemBlocks()) {
19193            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19194	           xmlMemBlocks() - mem_base);
19195	    test_ret++;
19196            printf(" %d", n_out_doc);
19197            printf(" %d", n_doc_txt_ptr);
19198            printf(" %d", n_doc_txt_len);
19199            printf(" %d", n_txt_encoding);
19200            printf("\n");
19201        }
19202    }
19203    }
19204    }
19205    }
19206    function_tests++;
19207#endif
19208
19209    return(test_ret);
19210}
19211
19212
19213static int
19214test_xmlDocFormatDump(void) {
19215    int test_ret = 0;
19216
19217#if defined(LIBXML_OUTPUT_ENABLED)
19218    int mem_base;
19219    int ret_val;
19220    FILE * f; /* the FILE* */
19221    int n_f;
19222    xmlDocPtr cur; /* the document */
19223    int n_cur;
19224    int format; /* should formatting spaces been added */
19225    int n_format;
19226
19227    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19228    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19229    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19230        mem_base = xmlMemBlocks();
19231        f = gen_FILE_ptr(n_f, 0);
19232        cur = gen_xmlDocPtr(n_cur, 1);
19233        format = gen_int(n_format, 2);
19234
19235        ret_val = xmlDocFormatDump(f, cur, format);
19236        desret_int(ret_val);
19237        call_tests++;
19238        des_FILE_ptr(n_f, f, 0);
19239        des_xmlDocPtr(n_cur, cur, 1);
19240        des_int(n_format, format, 2);
19241        xmlResetLastError();
19242        if (mem_base != xmlMemBlocks()) {
19243            printf("Leak of %d blocks found in xmlDocFormatDump",
19244	           xmlMemBlocks() - mem_base);
19245	    test_ret++;
19246            printf(" %d", n_f);
19247            printf(" %d", n_cur);
19248            printf(" %d", n_format);
19249            printf("\n");
19250        }
19251    }
19252    }
19253    }
19254    function_tests++;
19255#endif
19256
19257    return(test_ret);
19258}
19259
19260
19261static int
19262test_xmlDocGetRootElement(void) {
19263    int test_ret = 0;
19264
19265    int mem_base;
19266    xmlNodePtr ret_val;
19267    xmlDocPtr doc; /* the document */
19268    int n_doc;
19269
19270    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19271        mem_base = xmlMemBlocks();
19272        doc = gen_xmlDocPtr(n_doc, 0);
19273
19274        ret_val = xmlDocGetRootElement(doc);
19275        desret_xmlNodePtr(ret_val);
19276        call_tests++;
19277        des_xmlDocPtr(n_doc, doc, 0);
19278        xmlResetLastError();
19279        if (mem_base != xmlMemBlocks()) {
19280            printf("Leak of %d blocks found in xmlDocGetRootElement",
19281	           xmlMemBlocks() - mem_base);
19282	    test_ret++;
19283            printf(" %d", n_doc);
19284            printf("\n");
19285        }
19286    }
19287    function_tests++;
19288
19289    return(test_ret);
19290}
19291
19292
19293static int
19294test_xmlDocSetRootElement(void) {
19295    int test_ret = 0;
19296
19297#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
19298    int mem_base;
19299    xmlNodePtr ret_val;
19300    xmlDocPtr doc; /* the document */
19301    int n_doc;
19302    xmlNodePtr root; /* the new document root element */
19303    int n_root;
19304
19305    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19306    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
19307        mem_base = xmlMemBlocks();
19308        doc = gen_xmlDocPtr(n_doc, 0);
19309        root = gen_xmlNodePtr_in(n_root, 1);
19310
19311        ret_val = xmlDocSetRootElement(doc, root);
19312        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
19313        desret_xmlNodePtr(ret_val);
19314        call_tests++;
19315        des_xmlDocPtr(n_doc, doc, 0);
19316        des_xmlNodePtr_in(n_root, root, 1);
19317        xmlResetLastError();
19318        if (mem_base != xmlMemBlocks()) {
19319            printf("Leak of %d blocks found in xmlDocSetRootElement",
19320	           xmlMemBlocks() - mem_base);
19321	    test_ret++;
19322            printf(" %d", n_doc);
19323            printf(" %d", n_root);
19324            printf("\n");
19325        }
19326    }
19327    }
19328    function_tests++;
19329#endif
19330
19331    return(test_ret);
19332}
19333
19334
19335static int
19336test_xmlElemDump(void) {
19337    int test_ret = 0;
19338
19339#if defined(LIBXML_OUTPUT_ENABLED)
19340    int mem_base;
19341    FILE * f; /* the FILE * for the output */
19342    int n_f;
19343    xmlDocPtr doc; /* the document */
19344    int n_doc;
19345    xmlNodePtr cur; /* the current node */
19346    int n_cur;
19347
19348    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19349    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19350    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
19351        mem_base = xmlMemBlocks();
19352        f = gen_FILE_ptr(n_f, 0);
19353        doc = gen_xmlDocPtr(n_doc, 1);
19354        cur = gen_xmlNodePtr(n_cur, 2);
19355
19356        xmlElemDump(f, doc, cur);
19357        call_tests++;
19358        des_FILE_ptr(n_f, f, 0);
19359        des_xmlDocPtr(n_doc, doc, 1);
19360        des_xmlNodePtr(n_cur, cur, 2);
19361        xmlResetLastError();
19362        if (mem_base != xmlMemBlocks()) {
19363            printf("Leak of %d blocks found in xmlElemDump",
19364	           xmlMemBlocks() - mem_base);
19365	    test_ret++;
19366            printf(" %d", n_f);
19367            printf(" %d", n_doc);
19368            printf(" %d", n_cur);
19369            printf("\n");
19370        }
19371    }
19372    }
19373    }
19374    function_tests++;
19375#endif
19376
19377    return(test_ret);
19378}
19379
19380
19381static int
19382test_xmlGetBufferAllocationScheme(void) {
19383    int test_ret = 0;
19384
19385    int mem_base;
19386    xmlBufferAllocationScheme ret_val;
19387
19388        mem_base = xmlMemBlocks();
19389
19390        ret_val = xmlGetBufferAllocationScheme();
19391        desret_xmlBufferAllocationScheme(ret_val);
19392        call_tests++;
19393        xmlResetLastError();
19394        if (mem_base != xmlMemBlocks()) {
19395            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
19396	           xmlMemBlocks() - mem_base);
19397	    test_ret++;
19398            printf("\n");
19399        }
19400    function_tests++;
19401
19402    return(test_ret);
19403}
19404
19405
19406static int
19407test_xmlGetCompressMode(void) {
19408    int test_ret = 0;
19409
19410    int mem_base;
19411    int ret_val;
19412
19413        mem_base = xmlMemBlocks();
19414
19415        ret_val = xmlGetCompressMode();
19416        desret_int(ret_val);
19417        call_tests++;
19418        xmlResetLastError();
19419        if (mem_base != xmlMemBlocks()) {
19420            printf("Leak of %d blocks found in xmlGetCompressMode",
19421	           xmlMemBlocks() - mem_base);
19422	    test_ret++;
19423            printf("\n");
19424        }
19425    function_tests++;
19426
19427    return(test_ret);
19428}
19429
19430
19431static int
19432test_xmlGetDocCompressMode(void) {
19433    int test_ret = 0;
19434
19435    int mem_base;
19436    int ret_val;
19437    xmlDocPtr doc; /* the document */
19438    int n_doc;
19439
19440    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19441        mem_base = xmlMemBlocks();
19442        doc = gen_xmlDocPtr(n_doc, 0);
19443
19444        ret_val = xmlGetDocCompressMode(doc);
19445        desret_int(ret_val);
19446        call_tests++;
19447        des_xmlDocPtr(n_doc, doc, 0);
19448        xmlResetLastError();
19449        if (mem_base != xmlMemBlocks()) {
19450            printf("Leak of %d blocks found in xmlGetDocCompressMode",
19451	           xmlMemBlocks() - mem_base);
19452	    test_ret++;
19453            printf(" %d", n_doc);
19454            printf("\n");
19455        }
19456    }
19457    function_tests++;
19458
19459    return(test_ret);
19460}
19461
19462
19463static int
19464test_xmlGetIntSubset(void) {
19465    int test_ret = 0;
19466
19467    int mem_base;
19468    xmlDtdPtr ret_val;
19469    xmlDocPtr doc; /* the document pointer */
19470    int n_doc;
19471
19472    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19473        mem_base = xmlMemBlocks();
19474        doc = gen_xmlDocPtr(n_doc, 0);
19475
19476        ret_val = xmlGetIntSubset(doc);
19477        desret_xmlDtdPtr(ret_val);
19478        call_tests++;
19479        des_xmlDocPtr(n_doc, doc, 0);
19480        xmlResetLastError();
19481        if (mem_base != xmlMemBlocks()) {
19482            printf("Leak of %d blocks found in xmlGetIntSubset",
19483	           xmlMemBlocks() - mem_base);
19484	    test_ret++;
19485            printf(" %d", n_doc);
19486            printf("\n");
19487        }
19488    }
19489    function_tests++;
19490
19491    return(test_ret);
19492}
19493
19494
19495static int
19496test_xmlGetLastChild(void) {
19497    int test_ret = 0;
19498
19499    int mem_base;
19500    xmlNodePtr ret_val;
19501    xmlNodePtr parent; /* the parent node */
19502    int n_parent;
19503
19504    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19505        mem_base = xmlMemBlocks();
19506        parent = gen_xmlNodePtr(n_parent, 0);
19507
19508        ret_val = xmlGetLastChild(parent);
19509        desret_xmlNodePtr(ret_val);
19510        call_tests++;
19511        des_xmlNodePtr(n_parent, parent, 0);
19512        xmlResetLastError();
19513        if (mem_base != xmlMemBlocks()) {
19514            printf("Leak of %d blocks found in xmlGetLastChild",
19515	           xmlMemBlocks() - mem_base);
19516	    test_ret++;
19517            printf(" %d", n_parent);
19518            printf("\n");
19519        }
19520    }
19521    function_tests++;
19522
19523    return(test_ret);
19524}
19525
19526
19527static int
19528test_xmlGetLineNo(void) {
19529    int test_ret = 0;
19530
19531    int mem_base;
19532    long ret_val;
19533    xmlNodePtr node; /* valid node */
19534    int n_node;
19535
19536    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19537        mem_base = xmlMemBlocks();
19538        node = gen_xmlNodePtr(n_node, 0);
19539
19540        ret_val = xmlGetLineNo(node);
19541        desret_long(ret_val);
19542        call_tests++;
19543        des_xmlNodePtr(n_node, node, 0);
19544        xmlResetLastError();
19545        if (mem_base != xmlMemBlocks()) {
19546            printf("Leak of %d blocks found in xmlGetLineNo",
19547	           xmlMemBlocks() - mem_base);
19548	    test_ret++;
19549            printf(" %d", n_node);
19550            printf("\n");
19551        }
19552    }
19553    function_tests++;
19554
19555    return(test_ret);
19556}
19557
19558
19559static int
19560test_xmlGetNoNsProp(void) {
19561    int test_ret = 0;
19562
19563    int mem_base;
19564    xmlChar * ret_val;
19565    xmlNodePtr node; /* the node */
19566    int n_node;
19567    xmlChar * name; /* the attribute name */
19568    int n_name;
19569
19570    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19571    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19572        mem_base = xmlMemBlocks();
19573        node = gen_xmlNodePtr(n_node, 0);
19574        name = gen_const_xmlChar_ptr(n_name, 1);
19575
19576        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
19577        desret_xmlChar_ptr(ret_val);
19578        call_tests++;
19579        des_xmlNodePtr(n_node, node, 0);
19580        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19581        xmlResetLastError();
19582        if (mem_base != xmlMemBlocks()) {
19583            printf("Leak of %d blocks found in xmlGetNoNsProp",
19584	           xmlMemBlocks() - mem_base);
19585	    test_ret++;
19586            printf(" %d", n_node);
19587            printf(" %d", n_name);
19588            printf("\n");
19589        }
19590    }
19591    }
19592    function_tests++;
19593
19594    return(test_ret);
19595}
19596
19597
19598static int
19599test_xmlGetNodePath(void) {
19600    int test_ret = 0;
19601
19602#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
19603    int mem_base;
19604    xmlChar * ret_val;
19605    xmlNodePtr node; /* a node */
19606    int n_node;
19607
19608    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19609        mem_base = xmlMemBlocks();
19610        node = gen_xmlNodePtr(n_node, 0);
19611
19612        ret_val = xmlGetNodePath(node);
19613        desret_xmlChar_ptr(ret_val);
19614        call_tests++;
19615        des_xmlNodePtr(n_node, node, 0);
19616        xmlResetLastError();
19617        if (mem_base != xmlMemBlocks()) {
19618            printf("Leak of %d blocks found in xmlGetNodePath",
19619	           xmlMemBlocks() - mem_base);
19620	    test_ret++;
19621            printf(" %d", n_node);
19622            printf("\n");
19623        }
19624    }
19625    function_tests++;
19626#endif
19627
19628    return(test_ret);
19629}
19630
19631
19632static int
19633test_xmlGetNsList(void) {
19634    int test_ret = 0;
19635
19636
19637    /* missing type support */
19638    return(test_ret);
19639}
19640
19641
19642static int
19643test_xmlGetNsProp(void) {
19644    int test_ret = 0;
19645
19646    int mem_base;
19647    xmlChar * ret_val;
19648    xmlNodePtr node; /* the node */
19649    int n_node;
19650    xmlChar * name; /* the attribute name */
19651    int n_name;
19652    xmlChar * nameSpace; /* the URI of the namespace */
19653    int n_nameSpace;
19654
19655    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19656    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19657    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19658        mem_base = xmlMemBlocks();
19659        node = gen_xmlNodePtr(n_node, 0);
19660        name = gen_const_xmlChar_ptr(n_name, 1);
19661        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
19662
19663        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
19664        desret_xmlChar_ptr(ret_val);
19665        call_tests++;
19666        des_xmlNodePtr(n_node, node, 0);
19667        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19668        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
19669        xmlResetLastError();
19670        if (mem_base != xmlMemBlocks()) {
19671            printf("Leak of %d blocks found in xmlGetNsProp",
19672	           xmlMemBlocks() - mem_base);
19673	    test_ret++;
19674            printf(" %d", n_node);
19675            printf(" %d", n_name);
19676            printf(" %d", n_nameSpace);
19677            printf("\n");
19678        }
19679    }
19680    }
19681    }
19682    function_tests++;
19683
19684    return(test_ret);
19685}
19686
19687
19688static int
19689test_xmlGetProp(void) {
19690    int test_ret = 0;
19691
19692    int mem_base;
19693    xmlChar * ret_val;
19694    xmlNodePtr node; /* the node */
19695    int n_node;
19696    xmlChar * name; /* the attribute name */
19697    int n_name;
19698
19699    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19700    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19701        mem_base = xmlMemBlocks();
19702        node = gen_xmlNodePtr(n_node, 0);
19703        name = gen_const_xmlChar_ptr(n_name, 1);
19704
19705        ret_val = xmlGetProp(node, (const xmlChar *)name);
19706        desret_xmlChar_ptr(ret_val);
19707        call_tests++;
19708        des_xmlNodePtr(n_node, node, 0);
19709        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19710        xmlResetLastError();
19711        if (mem_base != xmlMemBlocks()) {
19712            printf("Leak of %d blocks found in xmlGetProp",
19713	           xmlMemBlocks() - mem_base);
19714	    test_ret++;
19715            printf(" %d", n_node);
19716            printf(" %d", n_name);
19717            printf("\n");
19718        }
19719    }
19720    }
19721    function_tests++;
19722
19723    return(test_ret);
19724}
19725
19726
19727static int
19728test_xmlHasNsProp(void) {
19729    int test_ret = 0;
19730
19731    int mem_base;
19732    xmlAttrPtr ret_val;
19733    xmlNodePtr node; /* the node */
19734    int n_node;
19735    xmlChar * name; /* the attribute name */
19736    int n_name;
19737    xmlChar * nameSpace; /* the URI of the namespace */
19738    int n_nameSpace;
19739
19740    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19741    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19742    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19743        mem_base = xmlMemBlocks();
19744        node = gen_xmlNodePtr(n_node, 0);
19745        name = gen_const_xmlChar_ptr(n_name, 1);
19746        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
19747
19748        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
19749        desret_xmlAttrPtr(ret_val);
19750        call_tests++;
19751        des_xmlNodePtr(n_node, node, 0);
19752        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19753        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
19754        xmlResetLastError();
19755        if (mem_base != xmlMemBlocks()) {
19756            printf("Leak of %d blocks found in xmlHasNsProp",
19757	           xmlMemBlocks() - mem_base);
19758	    test_ret++;
19759            printf(" %d", n_node);
19760            printf(" %d", n_name);
19761            printf(" %d", n_nameSpace);
19762            printf("\n");
19763        }
19764    }
19765    }
19766    }
19767    function_tests++;
19768
19769    return(test_ret);
19770}
19771
19772
19773static int
19774test_xmlHasProp(void) {
19775    int test_ret = 0;
19776
19777    int mem_base;
19778    xmlAttrPtr ret_val;
19779    xmlNodePtr node; /* the node */
19780    int n_node;
19781    xmlChar * name; /* the attribute name */
19782    int n_name;
19783
19784    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19785    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19786        mem_base = xmlMemBlocks();
19787        node = gen_xmlNodePtr(n_node, 0);
19788        name = gen_const_xmlChar_ptr(n_name, 1);
19789
19790        ret_val = xmlHasProp(node, (const xmlChar *)name);
19791        desret_xmlAttrPtr(ret_val);
19792        call_tests++;
19793        des_xmlNodePtr(n_node, node, 0);
19794        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19795        xmlResetLastError();
19796        if (mem_base != xmlMemBlocks()) {
19797            printf("Leak of %d blocks found in xmlHasProp",
19798	           xmlMemBlocks() - mem_base);
19799	    test_ret++;
19800            printf(" %d", n_node);
19801            printf(" %d", n_name);
19802            printf("\n");
19803        }
19804    }
19805    }
19806    function_tests++;
19807
19808    return(test_ret);
19809}
19810
19811
19812static int
19813test_xmlIsBlankNode(void) {
19814    int test_ret = 0;
19815
19816    int mem_base;
19817    int ret_val;
19818    xmlNodePtr node; /* the node */
19819    int n_node;
19820
19821    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19822        mem_base = xmlMemBlocks();
19823        node = gen_xmlNodePtr(n_node, 0);
19824
19825        ret_val = xmlIsBlankNode(node);
19826        desret_int(ret_val);
19827        call_tests++;
19828        des_xmlNodePtr(n_node, node, 0);
19829        xmlResetLastError();
19830        if (mem_base != xmlMemBlocks()) {
19831            printf("Leak of %d blocks found in xmlIsBlankNode",
19832	           xmlMemBlocks() - mem_base);
19833	    test_ret++;
19834            printf(" %d", n_node);
19835            printf("\n");
19836        }
19837    }
19838    function_tests++;
19839
19840    return(test_ret);
19841}
19842
19843
19844static int
19845test_xmlIsXHTML(void) {
19846    int test_ret = 0;
19847
19848    int mem_base;
19849    int ret_val;
19850    xmlChar * systemID; /* the system identifier */
19851    int n_systemID;
19852    xmlChar * publicID; /* the public identifier */
19853    int n_publicID;
19854
19855    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
19856    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
19857        mem_base = xmlMemBlocks();
19858        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
19859        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
19860
19861        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
19862        desret_int(ret_val);
19863        call_tests++;
19864        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
19865        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
19866        xmlResetLastError();
19867        if (mem_base != xmlMemBlocks()) {
19868            printf("Leak of %d blocks found in xmlIsXHTML",
19869	           xmlMemBlocks() - mem_base);
19870	    test_ret++;
19871            printf(" %d", n_systemID);
19872            printf(" %d", n_publicID);
19873            printf("\n");
19874        }
19875    }
19876    }
19877    function_tests++;
19878
19879    return(test_ret);
19880}
19881
19882
19883static int
19884test_xmlNewCDataBlock(void) {
19885    int test_ret = 0;
19886
19887    int mem_base;
19888    xmlNodePtr ret_val;
19889    xmlDocPtr doc; /* the document */
19890    int n_doc;
19891    xmlChar * content; /* the CDATA block content content */
19892    int n_content;
19893    int len; /* the length of the block */
19894    int n_len;
19895
19896    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19897    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19898    for (n_len = 0;n_len < gen_nb_int;n_len++) {
19899        mem_base = xmlMemBlocks();
19900        doc = gen_xmlDocPtr(n_doc, 0);
19901        content = gen_const_xmlChar_ptr(n_content, 1);
19902        len = gen_int(n_len, 2);
19903
19904        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
19905        desret_xmlNodePtr(ret_val);
19906        call_tests++;
19907        des_xmlDocPtr(n_doc, doc, 0);
19908        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
19909        des_int(n_len, len, 2);
19910        xmlResetLastError();
19911        if (mem_base != xmlMemBlocks()) {
19912            printf("Leak of %d blocks found in xmlNewCDataBlock",
19913	           xmlMemBlocks() - mem_base);
19914	    test_ret++;
19915            printf(" %d", n_doc);
19916            printf(" %d", n_content);
19917            printf(" %d", n_len);
19918            printf("\n");
19919        }
19920    }
19921    }
19922    }
19923    function_tests++;
19924
19925    return(test_ret);
19926}
19927
19928
19929static int
19930test_xmlNewCharRef(void) {
19931    int test_ret = 0;
19932
19933    int mem_base;
19934    xmlNodePtr ret_val;
19935    xmlDocPtr doc; /* the document */
19936    int n_doc;
19937    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
19938    int n_name;
19939
19940    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19941    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19942        mem_base = xmlMemBlocks();
19943        doc = gen_xmlDocPtr(n_doc, 0);
19944        name = gen_const_xmlChar_ptr(n_name, 1);
19945
19946        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
19947        desret_xmlNodePtr(ret_val);
19948        call_tests++;
19949        des_xmlDocPtr(n_doc, doc, 0);
19950        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19951        xmlResetLastError();
19952        if (mem_base != xmlMemBlocks()) {
19953            printf("Leak of %d blocks found in xmlNewCharRef",
19954	           xmlMemBlocks() - mem_base);
19955	    test_ret++;
19956            printf(" %d", n_doc);
19957            printf(" %d", n_name);
19958            printf("\n");
19959        }
19960    }
19961    }
19962    function_tests++;
19963
19964    return(test_ret);
19965}
19966
19967
19968static int
19969test_xmlNewChild(void) {
19970    int test_ret = 0;
19971
19972#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19973#ifdef LIBXML_TREE_ENABLED
19974    int mem_base;
19975    xmlNodePtr ret_val;
19976    xmlNodePtr parent; /* the parent node */
19977    int n_parent;
19978    xmlNsPtr ns; /* a namespace if any */
19979    int n_ns;
19980    xmlChar * name; /* the name of the child */
19981    int n_name;
19982    xmlChar * content; /* the XML content of the child if any. */
19983    int n_content;
19984
19985    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19986    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
19987    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19988    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19989        mem_base = xmlMemBlocks();
19990        parent = gen_xmlNodePtr(n_parent, 0);
19991        ns = gen_xmlNsPtr(n_ns, 1);
19992        name = gen_const_xmlChar_ptr(n_name, 2);
19993        content = gen_const_xmlChar_ptr(n_content, 3);
19994
19995        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
19996        desret_xmlNodePtr(ret_val);
19997        call_tests++;
19998        des_xmlNodePtr(n_parent, parent, 0);
19999        des_xmlNsPtr(n_ns, ns, 1);
20000        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20001        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20002        xmlResetLastError();
20003        if (mem_base != xmlMemBlocks()) {
20004            printf("Leak of %d blocks found in xmlNewChild",
20005	           xmlMemBlocks() - mem_base);
20006	    test_ret++;
20007            printf(" %d", n_parent);
20008            printf(" %d", n_ns);
20009            printf(" %d", n_name);
20010            printf(" %d", n_content);
20011            printf("\n");
20012        }
20013    }
20014    }
20015    }
20016    }
20017    function_tests++;
20018#endif
20019#endif
20020
20021    return(test_ret);
20022}
20023
20024
20025static int
20026test_xmlNewComment(void) {
20027    int test_ret = 0;
20028
20029    int mem_base;
20030    xmlNodePtr ret_val;
20031    xmlChar * content; /* the comment content */
20032    int n_content;
20033
20034    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20035        mem_base = xmlMemBlocks();
20036        content = gen_const_xmlChar_ptr(n_content, 0);
20037
20038        ret_val = xmlNewComment((const xmlChar *)content);
20039        desret_xmlNodePtr(ret_val);
20040        call_tests++;
20041        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20042        xmlResetLastError();
20043        if (mem_base != xmlMemBlocks()) {
20044            printf("Leak of %d blocks found in xmlNewComment",
20045	           xmlMemBlocks() - mem_base);
20046	    test_ret++;
20047            printf(" %d", n_content);
20048            printf("\n");
20049        }
20050    }
20051    function_tests++;
20052
20053    return(test_ret);
20054}
20055
20056
20057static int
20058test_xmlNewDoc(void) {
20059    int test_ret = 0;
20060
20061    int mem_base;
20062    xmlDocPtr ret_val;
20063    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20064    int n_version;
20065
20066    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20067        mem_base = xmlMemBlocks();
20068        version = gen_const_xmlChar_ptr(n_version, 0);
20069
20070        ret_val = xmlNewDoc((const xmlChar *)version);
20071        desret_xmlDocPtr(ret_val);
20072        call_tests++;
20073        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20074        xmlResetLastError();
20075        if (mem_base != xmlMemBlocks()) {
20076            printf("Leak of %d blocks found in xmlNewDoc",
20077	           xmlMemBlocks() - mem_base);
20078	    test_ret++;
20079            printf(" %d", n_version);
20080            printf("\n");
20081        }
20082    }
20083    function_tests++;
20084
20085    return(test_ret);
20086}
20087
20088
20089static int
20090test_xmlNewDocComment(void) {
20091    int test_ret = 0;
20092
20093    int mem_base;
20094    xmlNodePtr ret_val;
20095    xmlDocPtr doc; /* the document */
20096    int n_doc;
20097    xmlChar * content; /* the comment content */
20098    int n_content;
20099
20100    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20101    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20102        mem_base = xmlMemBlocks();
20103        doc = gen_xmlDocPtr(n_doc, 0);
20104        content = gen_const_xmlChar_ptr(n_content, 1);
20105
20106        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20107        desret_xmlNodePtr(ret_val);
20108        call_tests++;
20109        des_xmlDocPtr(n_doc, doc, 0);
20110        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20111        xmlResetLastError();
20112        if (mem_base != xmlMemBlocks()) {
20113            printf("Leak of %d blocks found in xmlNewDocComment",
20114	           xmlMemBlocks() - mem_base);
20115	    test_ret++;
20116            printf(" %d", n_doc);
20117            printf(" %d", n_content);
20118            printf("\n");
20119        }
20120    }
20121    }
20122    function_tests++;
20123
20124    return(test_ret);
20125}
20126
20127
20128static int
20129test_xmlNewDocFragment(void) {
20130    int test_ret = 0;
20131
20132#if defined(LIBXML_TREE_ENABLED)
20133    int mem_base;
20134    xmlNodePtr ret_val;
20135    xmlDocPtr doc; /* the document owning the fragment */
20136    int n_doc;
20137
20138    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20139        mem_base = xmlMemBlocks();
20140        doc = gen_xmlDocPtr(n_doc, 0);
20141
20142        ret_val = xmlNewDocFragment(doc);
20143        desret_xmlNodePtr(ret_val);
20144        call_tests++;
20145        des_xmlDocPtr(n_doc, doc, 0);
20146        xmlResetLastError();
20147        if (mem_base != xmlMemBlocks()) {
20148            printf("Leak of %d blocks found in xmlNewDocFragment",
20149	           xmlMemBlocks() - mem_base);
20150	    test_ret++;
20151            printf(" %d", n_doc);
20152            printf("\n");
20153        }
20154    }
20155    function_tests++;
20156#endif
20157
20158    return(test_ret);
20159}
20160
20161
20162static int
20163test_xmlNewDocNode(void) {
20164    int test_ret = 0;
20165
20166    int mem_base;
20167    xmlNodePtr ret_val;
20168    xmlDocPtr doc; /* the document */
20169    int n_doc;
20170    xmlNsPtr ns; /* namespace if any */
20171    int n_ns;
20172    xmlChar * name; /* the node name */
20173    int n_name;
20174    xmlChar * content; /* the XML text content if any */
20175    int n_content;
20176
20177    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20178    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20179    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20180    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20181        mem_base = xmlMemBlocks();
20182        doc = gen_xmlDocPtr(n_doc, 0);
20183        ns = gen_xmlNsPtr(n_ns, 1);
20184        name = gen_const_xmlChar_ptr(n_name, 2);
20185        content = gen_const_xmlChar_ptr(n_content, 3);
20186
20187        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20188        desret_xmlNodePtr(ret_val);
20189        call_tests++;
20190        des_xmlDocPtr(n_doc, doc, 0);
20191        des_xmlNsPtr(n_ns, ns, 1);
20192        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20193        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20194        xmlResetLastError();
20195        if (mem_base != xmlMemBlocks()) {
20196            printf("Leak of %d blocks found in xmlNewDocNode",
20197	           xmlMemBlocks() - mem_base);
20198	    test_ret++;
20199            printf(" %d", n_doc);
20200            printf(" %d", n_ns);
20201            printf(" %d", n_name);
20202            printf(" %d", n_content);
20203            printf("\n");
20204        }
20205    }
20206    }
20207    }
20208    }
20209    function_tests++;
20210
20211    return(test_ret);
20212}
20213
20214
20215static int
20216test_xmlNewDocNodeEatName(void) {
20217    int test_ret = 0;
20218
20219    int mem_base;
20220    xmlNodePtr ret_val;
20221    xmlDocPtr doc; /* the document */
20222    int n_doc;
20223    xmlNsPtr ns; /* namespace if any */
20224    int n_ns;
20225    xmlChar * name; /* the node name */
20226    int n_name;
20227    xmlChar * content; /* the XML text content if any */
20228    int n_content;
20229
20230    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20231    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20232    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20233    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20234        mem_base = xmlMemBlocks();
20235        doc = gen_xmlDocPtr(n_doc, 0);
20236        ns = gen_xmlNsPtr(n_ns, 1);
20237        name = gen_eaten_name(n_name, 2);
20238        content = gen_const_xmlChar_ptr(n_content, 3);
20239
20240        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
20241        desret_xmlNodePtr(ret_val);
20242        call_tests++;
20243        des_xmlDocPtr(n_doc, doc, 0);
20244        des_xmlNsPtr(n_ns, ns, 1);
20245        des_eaten_name(n_name, name, 2);
20246        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20247        xmlResetLastError();
20248        if (mem_base != xmlMemBlocks()) {
20249            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20250	           xmlMemBlocks() - mem_base);
20251	    test_ret++;
20252            printf(" %d", n_doc);
20253            printf(" %d", n_ns);
20254            printf(" %d", n_name);
20255            printf(" %d", n_content);
20256            printf("\n");
20257        }
20258    }
20259    }
20260    }
20261    }
20262    function_tests++;
20263
20264    return(test_ret);
20265}
20266
20267
20268static int
20269test_xmlNewDocPI(void) {
20270    int test_ret = 0;
20271
20272    int mem_base;
20273    xmlNodePtr ret_val;
20274    xmlDocPtr doc; /* the target document */
20275    int n_doc;
20276    xmlChar * name; /* the processing instruction name */
20277    int n_name;
20278    xmlChar * content; /* the PI content */
20279    int n_content;
20280
20281    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20282    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20283    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20284        mem_base = xmlMemBlocks();
20285        doc = gen_xmlDocPtr(n_doc, 0);
20286        name = gen_const_xmlChar_ptr(n_name, 1);
20287        content = gen_const_xmlChar_ptr(n_content, 2);
20288
20289        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
20290        desret_xmlNodePtr(ret_val);
20291        call_tests++;
20292        des_xmlDocPtr(n_doc, doc, 0);
20293        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20294        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
20295        xmlResetLastError();
20296        if (mem_base != xmlMemBlocks()) {
20297            printf("Leak of %d blocks found in xmlNewDocPI",
20298	           xmlMemBlocks() - mem_base);
20299	    test_ret++;
20300            printf(" %d", n_doc);
20301            printf(" %d", n_name);
20302            printf(" %d", n_content);
20303            printf("\n");
20304        }
20305    }
20306    }
20307    }
20308    function_tests++;
20309
20310    return(test_ret);
20311}
20312
20313
20314static int
20315test_xmlNewDocProp(void) {
20316    int test_ret = 0;
20317
20318    int mem_base;
20319    xmlAttrPtr ret_val;
20320    xmlDocPtr doc; /* the document */
20321    int n_doc;
20322    xmlChar * name; /* the name of the attribute */
20323    int n_name;
20324    xmlChar * value; /* the value of the attribute */
20325    int n_value;
20326
20327    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20328    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20329    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20330        mem_base = xmlMemBlocks();
20331        doc = gen_xmlDocPtr(n_doc, 0);
20332        name = gen_const_xmlChar_ptr(n_name, 1);
20333        value = gen_const_xmlChar_ptr(n_value, 2);
20334
20335        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
20336        desret_xmlAttrPtr(ret_val);
20337        call_tests++;
20338        des_xmlDocPtr(n_doc, doc, 0);
20339        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20340        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20341        xmlResetLastError();
20342        if (mem_base != xmlMemBlocks()) {
20343            printf("Leak of %d blocks found in xmlNewDocProp",
20344	           xmlMemBlocks() - mem_base);
20345	    test_ret++;
20346            printf(" %d", n_doc);
20347            printf(" %d", n_name);
20348            printf(" %d", n_value);
20349            printf("\n");
20350        }
20351    }
20352    }
20353    }
20354    function_tests++;
20355
20356    return(test_ret);
20357}
20358
20359
20360static int
20361test_xmlNewDocRawNode(void) {
20362    int test_ret = 0;
20363
20364#if defined(LIBXML_TREE_ENABLED)
20365#ifdef LIBXML_TREE_ENABLED
20366    int mem_base;
20367    xmlNodePtr ret_val;
20368    xmlDocPtr doc; /* the document */
20369    int n_doc;
20370    xmlNsPtr ns; /* namespace if any */
20371    int n_ns;
20372    xmlChar * name; /* the node name */
20373    int n_name;
20374    xmlChar * content; /* the text content if any */
20375    int n_content;
20376
20377    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20378    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20379    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20380    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20381        mem_base = xmlMemBlocks();
20382        doc = gen_xmlDocPtr(n_doc, 0);
20383        ns = gen_xmlNsPtr(n_ns, 1);
20384        name = gen_const_xmlChar_ptr(n_name, 2);
20385        content = gen_const_xmlChar_ptr(n_content, 3);
20386
20387        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20388        desret_xmlNodePtr(ret_val);
20389        call_tests++;
20390        des_xmlDocPtr(n_doc, doc, 0);
20391        des_xmlNsPtr(n_ns, ns, 1);
20392        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20393        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20394        xmlResetLastError();
20395        if (mem_base != xmlMemBlocks()) {
20396            printf("Leak of %d blocks found in xmlNewDocRawNode",
20397	           xmlMemBlocks() - mem_base);
20398	    test_ret++;
20399            printf(" %d", n_doc);
20400            printf(" %d", n_ns);
20401            printf(" %d", n_name);
20402            printf(" %d", n_content);
20403            printf("\n");
20404        }
20405    }
20406    }
20407    }
20408    }
20409    function_tests++;
20410#endif
20411#endif
20412
20413    return(test_ret);
20414}
20415
20416
20417static int
20418test_xmlNewDocText(void) {
20419    int test_ret = 0;
20420
20421    int mem_base;
20422    xmlNodePtr ret_val;
20423    xmlDocPtr doc; /* the document */
20424    int n_doc;
20425    xmlChar * content; /* the text content */
20426    int n_content;
20427
20428    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20429    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20430        mem_base = xmlMemBlocks();
20431        doc = gen_xmlDocPtr(n_doc, 0);
20432        content = gen_const_xmlChar_ptr(n_content, 1);
20433
20434        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
20435        desret_xmlNodePtr(ret_val);
20436        call_tests++;
20437        des_xmlDocPtr(n_doc, doc, 0);
20438        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20439        xmlResetLastError();
20440        if (mem_base != xmlMemBlocks()) {
20441            printf("Leak of %d blocks found in xmlNewDocText",
20442	           xmlMemBlocks() - mem_base);
20443	    test_ret++;
20444            printf(" %d", n_doc);
20445            printf(" %d", n_content);
20446            printf("\n");
20447        }
20448    }
20449    }
20450    function_tests++;
20451
20452    return(test_ret);
20453}
20454
20455
20456static int
20457test_xmlNewDocTextLen(void) {
20458    int test_ret = 0;
20459
20460    int mem_base;
20461    xmlNodePtr ret_val;
20462    xmlDocPtr doc; /* the document */
20463    int n_doc;
20464    xmlChar * content; /* the text content */
20465    int n_content;
20466    int len; /* the text len. */
20467    int n_len;
20468
20469    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20470    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20471    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20472        mem_base = xmlMemBlocks();
20473        doc = gen_xmlDocPtr(n_doc, 0);
20474        content = gen_const_xmlChar_ptr(n_content, 1);
20475        len = gen_int(n_len, 2);
20476
20477        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
20478        desret_xmlNodePtr(ret_val);
20479        call_tests++;
20480        des_xmlDocPtr(n_doc, doc, 0);
20481        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20482        des_int(n_len, len, 2);
20483        xmlResetLastError();
20484        if (mem_base != xmlMemBlocks()) {
20485            printf("Leak of %d blocks found in xmlNewDocTextLen",
20486	           xmlMemBlocks() - mem_base);
20487	    test_ret++;
20488            printf(" %d", n_doc);
20489            printf(" %d", n_content);
20490            printf(" %d", n_len);
20491            printf("\n");
20492        }
20493    }
20494    }
20495    }
20496    function_tests++;
20497
20498    return(test_ret);
20499}
20500
20501
20502static int
20503test_xmlNewDtd(void) {
20504    int test_ret = 0;
20505
20506    int mem_base;
20507    xmlDtdPtr ret_val;
20508    xmlDocPtr doc; /* the document pointer */
20509    int n_doc;
20510    xmlChar * name; /* the DTD name */
20511    int n_name;
20512    xmlChar * ExternalID; /* the external ID */
20513    int n_ExternalID;
20514    xmlChar * SystemID; /* the system ID */
20515    int n_SystemID;
20516
20517    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20518    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20519    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20520    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20521        mem_base = xmlMemBlocks();
20522        doc = gen_xmlDocPtr(n_doc, 0);
20523        name = gen_const_xmlChar_ptr(n_name, 1);
20524        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20525        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20526
20527        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
20528        desret_xmlDtdPtr(ret_val);
20529        call_tests++;
20530        des_xmlDocPtr(n_doc, doc, 0);
20531        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20532        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
20533        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
20534        xmlResetLastError();
20535        if (mem_base != xmlMemBlocks()) {
20536            printf("Leak of %d blocks found in xmlNewDtd",
20537	           xmlMemBlocks() - mem_base);
20538	    test_ret++;
20539            printf(" %d", n_doc);
20540            printf(" %d", n_name);
20541            printf(" %d", n_ExternalID);
20542            printf(" %d", n_SystemID);
20543            printf("\n");
20544        }
20545    }
20546    }
20547    }
20548    }
20549    function_tests++;
20550
20551    return(test_ret);
20552}
20553
20554
20555static int
20556test_xmlNewNode(void) {
20557    int test_ret = 0;
20558
20559    int mem_base;
20560    xmlNodePtr ret_val;
20561    xmlNsPtr ns; /* namespace if any */
20562    int n_ns;
20563    xmlChar * name; /* the node name */
20564    int n_name;
20565
20566    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20567    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20568        mem_base = xmlMemBlocks();
20569        ns = gen_xmlNsPtr(n_ns, 0);
20570        name = gen_const_xmlChar_ptr(n_name, 1);
20571
20572        ret_val = xmlNewNode(ns, (const xmlChar *)name);
20573        desret_xmlNodePtr(ret_val);
20574        call_tests++;
20575        des_xmlNsPtr(n_ns, ns, 0);
20576        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20577        xmlResetLastError();
20578        if (mem_base != xmlMemBlocks()) {
20579            printf("Leak of %d blocks found in xmlNewNode",
20580	           xmlMemBlocks() - mem_base);
20581	    test_ret++;
20582            printf(" %d", n_ns);
20583            printf(" %d", n_name);
20584            printf("\n");
20585        }
20586    }
20587    }
20588    function_tests++;
20589
20590    return(test_ret);
20591}
20592
20593
20594static int
20595test_xmlNewNodeEatName(void) {
20596    int test_ret = 0;
20597
20598    int mem_base;
20599    xmlNodePtr ret_val;
20600    xmlNsPtr ns; /* namespace if any */
20601    int n_ns;
20602    xmlChar * name; /* the node name */
20603    int n_name;
20604
20605    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20606    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20607        mem_base = xmlMemBlocks();
20608        ns = gen_xmlNsPtr(n_ns, 0);
20609        name = gen_eaten_name(n_name, 1);
20610
20611        ret_val = xmlNewNodeEatName(ns, name);
20612        desret_xmlNodePtr(ret_val);
20613        call_tests++;
20614        des_xmlNsPtr(n_ns, ns, 0);
20615        des_eaten_name(n_name, name, 1);
20616        xmlResetLastError();
20617        if (mem_base != xmlMemBlocks()) {
20618            printf("Leak of %d blocks found in xmlNewNodeEatName",
20619	           xmlMemBlocks() - mem_base);
20620	    test_ret++;
20621            printf(" %d", n_ns);
20622            printf(" %d", n_name);
20623            printf("\n");
20624        }
20625    }
20626    }
20627    function_tests++;
20628
20629    return(test_ret);
20630}
20631
20632
20633static int
20634test_xmlNewNs(void) {
20635    int test_ret = 0;
20636
20637    int mem_base;
20638    xmlNsPtr ret_val;
20639    xmlNodePtr node; /* the element carrying the namespace */
20640    int n_node;
20641    xmlChar * href; /* the URI associated */
20642    int n_href;
20643    xmlChar * prefix; /* the prefix for the namespace */
20644    int n_prefix;
20645
20646    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20647    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
20648    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
20649        mem_base = xmlMemBlocks();
20650        node = gen_xmlNodePtr(n_node, 0);
20651        href = gen_const_xmlChar_ptr(n_href, 1);
20652        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
20653
20654        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
20655        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
20656        desret_xmlNsPtr(ret_val);
20657        call_tests++;
20658        des_xmlNodePtr(n_node, node, 0);
20659        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
20660        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
20661        xmlResetLastError();
20662        if (mem_base != xmlMemBlocks()) {
20663            printf("Leak of %d blocks found in xmlNewNs",
20664	           xmlMemBlocks() - mem_base);
20665	    test_ret++;
20666            printf(" %d", n_node);
20667            printf(" %d", n_href);
20668            printf(" %d", n_prefix);
20669            printf("\n");
20670        }
20671    }
20672    }
20673    }
20674    function_tests++;
20675
20676    return(test_ret);
20677}
20678
20679
20680static int
20681test_xmlNewNsProp(void) {
20682    int test_ret = 0;
20683
20684    int mem_base;
20685    xmlAttrPtr ret_val;
20686    xmlNodePtr node; /* the holding node */
20687    int n_node;
20688    xmlNsPtr ns; /* the namespace */
20689    int n_ns;
20690    xmlChar * name; /* the name of the attribute */
20691    int n_name;
20692    xmlChar * value; /* the value of the attribute */
20693    int n_value;
20694
20695    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20696    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20697    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20698    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20699        mem_base = xmlMemBlocks();
20700        node = gen_xmlNodePtr(n_node, 0);
20701        ns = gen_xmlNsPtr(n_ns, 1);
20702        name = gen_const_xmlChar_ptr(n_name, 2);
20703        value = gen_const_xmlChar_ptr(n_value, 3);
20704
20705        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
20706        desret_xmlAttrPtr(ret_val);
20707        call_tests++;
20708        des_xmlNodePtr(n_node, node, 0);
20709        des_xmlNsPtr(n_ns, ns, 1);
20710        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20711        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
20712        xmlResetLastError();
20713        if (mem_base != xmlMemBlocks()) {
20714            printf("Leak of %d blocks found in xmlNewNsProp",
20715	           xmlMemBlocks() - mem_base);
20716	    test_ret++;
20717            printf(" %d", n_node);
20718            printf(" %d", n_ns);
20719            printf(" %d", n_name);
20720            printf(" %d", n_value);
20721            printf("\n");
20722        }
20723    }
20724    }
20725    }
20726    }
20727    function_tests++;
20728
20729    return(test_ret);
20730}
20731
20732
20733static int
20734test_xmlNewNsPropEatName(void) {
20735    int test_ret = 0;
20736
20737    int mem_base;
20738    xmlAttrPtr ret_val;
20739    xmlNodePtr node; /* the holding node */
20740    int n_node;
20741    xmlNsPtr ns; /* the namespace */
20742    int n_ns;
20743    xmlChar * name; /* the name of the attribute */
20744    int n_name;
20745    xmlChar * value; /* the value of the attribute */
20746    int n_value;
20747
20748    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20749    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20750    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20751    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20752        mem_base = xmlMemBlocks();
20753        node = gen_xmlNodePtr(n_node, 0);
20754        ns = gen_xmlNsPtr(n_ns, 1);
20755        name = gen_eaten_name(n_name, 2);
20756        value = gen_const_xmlChar_ptr(n_value, 3);
20757
20758        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
20759        desret_xmlAttrPtr(ret_val);
20760        call_tests++;
20761        des_xmlNodePtr(n_node, node, 0);
20762        des_xmlNsPtr(n_ns, ns, 1);
20763        des_eaten_name(n_name, name, 2);
20764        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
20765        xmlResetLastError();
20766        if (mem_base != xmlMemBlocks()) {
20767            printf("Leak of %d blocks found in xmlNewNsPropEatName",
20768	           xmlMemBlocks() - mem_base);
20769	    test_ret++;
20770            printf(" %d", n_node);
20771            printf(" %d", n_ns);
20772            printf(" %d", n_name);
20773            printf(" %d", n_value);
20774            printf("\n");
20775        }
20776    }
20777    }
20778    }
20779    }
20780    function_tests++;
20781
20782    return(test_ret);
20783}
20784
20785
20786static int
20787test_xmlNewPI(void) {
20788    int test_ret = 0;
20789
20790    int mem_base;
20791    xmlNodePtr ret_val;
20792    xmlChar * name; /* the processing instruction name */
20793    int n_name;
20794    xmlChar * content; /* the PI content */
20795    int n_content;
20796
20797    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20798    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20799        mem_base = xmlMemBlocks();
20800        name = gen_const_xmlChar_ptr(n_name, 0);
20801        content = gen_const_xmlChar_ptr(n_content, 1);
20802
20803        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
20804        desret_xmlNodePtr(ret_val);
20805        call_tests++;
20806        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
20807        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20808        xmlResetLastError();
20809        if (mem_base != xmlMemBlocks()) {
20810            printf("Leak of %d blocks found in xmlNewPI",
20811	           xmlMemBlocks() - mem_base);
20812	    test_ret++;
20813            printf(" %d", n_name);
20814            printf(" %d", n_content);
20815            printf("\n");
20816        }
20817    }
20818    }
20819    function_tests++;
20820
20821    return(test_ret);
20822}
20823
20824
20825static int
20826test_xmlNewProp(void) {
20827    int test_ret = 0;
20828
20829#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20830#ifdef LIBXML_TREE_ENABLED
20831    int mem_base;
20832    xmlAttrPtr ret_val;
20833    xmlNodePtr node; /* the holding node */
20834    int n_node;
20835    xmlChar * name; /* the name of the attribute */
20836    int n_name;
20837    xmlChar * value; /* the value of the attribute */
20838    int n_value;
20839
20840    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20841    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20842    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20843        mem_base = xmlMemBlocks();
20844        node = gen_xmlNodePtr(n_node, 0);
20845        name = gen_const_xmlChar_ptr(n_name, 1);
20846        value = gen_const_xmlChar_ptr(n_value, 2);
20847
20848        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
20849        desret_xmlAttrPtr(ret_val);
20850        call_tests++;
20851        des_xmlNodePtr(n_node, node, 0);
20852        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20853        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20854        xmlResetLastError();
20855        if (mem_base != xmlMemBlocks()) {
20856            printf("Leak of %d blocks found in xmlNewProp",
20857	           xmlMemBlocks() - mem_base);
20858	    test_ret++;
20859            printf(" %d", n_node);
20860            printf(" %d", n_name);
20861            printf(" %d", n_value);
20862            printf("\n");
20863        }
20864    }
20865    }
20866    }
20867    function_tests++;
20868#endif
20869#endif
20870
20871    return(test_ret);
20872}
20873
20874
20875static int
20876test_xmlNewReference(void) {
20877    int test_ret = 0;
20878
20879    int mem_base;
20880    xmlNodePtr ret_val;
20881    xmlDocPtr doc; /* the document */
20882    int n_doc;
20883    xmlChar * name; /* the reference name, or the reference string with & and ; */
20884    int n_name;
20885
20886    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20887    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20888        mem_base = xmlMemBlocks();
20889        doc = gen_xmlDocPtr(n_doc, 0);
20890        name = gen_const_xmlChar_ptr(n_name, 1);
20891
20892        ret_val = xmlNewReference(doc, (const xmlChar *)name);
20893        desret_xmlNodePtr(ret_val);
20894        call_tests++;
20895        des_xmlDocPtr(n_doc, doc, 0);
20896        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20897        xmlResetLastError();
20898        if (mem_base != xmlMemBlocks()) {
20899            printf("Leak of %d blocks found in xmlNewReference",
20900	           xmlMemBlocks() - mem_base);
20901	    test_ret++;
20902            printf(" %d", n_doc);
20903            printf(" %d", n_name);
20904            printf("\n");
20905        }
20906    }
20907    }
20908    function_tests++;
20909
20910    return(test_ret);
20911}
20912
20913
20914static int
20915test_xmlNewText(void) {
20916    int test_ret = 0;
20917
20918    int mem_base;
20919    xmlNodePtr ret_val;
20920    xmlChar * content; /* the text content */
20921    int n_content;
20922
20923    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20924        mem_base = xmlMemBlocks();
20925        content = gen_const_xmlChar_ptr(n_content, 0);
20926
20927        ret_val = xmlNewText((const xmlChar *)content);
20928        desret_xmlNodePtr(ret_val);
20929        call_tests++;
20930        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20931        xmlResetLastError();
20932        if (mem_base != xmlMemBlocks()) {
20933            printf("Leak of %d blocks found in xmlNewText",
20934	           xmlMemBlocks() - mem_base);
20935	    test_ret++;
20936            printf(" %d", n_content);
20937            printf("\n");
20938        }
20939    }
20940    function_tests++;
20941
20942    return(test_ret);
20943}
20944
20945
20946static int
20947test_xmlNewTextChild(void) {
20948    int test_ret = 0;
20949
20950#if defined(LIBXML_TREE_ENABLED)
20951#ifdef LIBXML_TREE_ENABLED
20952    int mem_base;
20953    xmlNodePtr ret_val;
20954    xmlNodePtr parent; /* the parent node */
20955    int n_parent;
20956    xmlNsPtr ns; /* a namespace if any */
20957    int n_ns;
20958    xmlChar * name; /* the name of the child */
20959    int n_name;
20960    xmlChar * content; /* the text content of the child if any. */
20961    int n_content;
20962
20963    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20964    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20965    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20966    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20967        mem_base = xmlMemBlocks();
20968        parent = gen_xmlNodePtr(n_parent, 0);
20969        ns = gen_xmlNsPtr(n_ns, 1);
20970        name = gen_const_xmlChar_ptr(n_name, 2);
20971        content = gen_const_xmlChar_ptr(n_content, 3);
20972
20973        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20974        desret_xmlNodePtr(ret_val);
20975        call_tests++;
20976        des_xmlNodePtr(n_parent, parent, 0);
20977        des_xmlNsPtr(n_ns, ns, 1);
20978        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20979        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20980        xmlResetLastError();
20981        if (mem_base != xmlMemBlocks()) {
20982            printf("Leak of %d blocks found in xmlNewTextChild",
20983	           xmlMemBlocks() - mem_base);
20984	    test_ret++;
20985            printf(" %d", n_parent);
20986            printf(" %d", n_ns);
20987            printf(" %d", n_name);
20988            printf(" %d", n_content);
20989            printf("\n");
20990        }
20991    }
20992    }
20993    }
20994    }
20995    function_tests++;
20996#endif
20997#endif
20998
20999    return(test_ret);
21000}
21001
21002
21003static int
21004test_xmlNewTextLen(void) {
21005    int test_ret = 0;
21006
21007    int mem_base;
21008    xmlNodePtr ret_val;
21009    xmlChar * content; /* the text content */
21010    int n_content;
21011    int len; /* the text len. */
21012    int n_len;
21013
21014    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21015    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21016        mem_base = xmlMemBlocks();
21017        content = gen_const_xmlChar_ptr(n_content, 0);
21018        len = gen_int(n_len, 1);
21019
21020        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21021        desret_xmlNodePtr(ret_val);
21022        call_tests++;
21023        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21024        des_int(n_len, len, 1);
21025        xmlResetLastError();
21026        if (mem_base != xmlMemBlocks()) {
21027            printf("Leak of %d blocks found in xmlNewTextLen",
21028	           xmlMemBlocks() - mem_base);
21029	    test_ret++;
21030            printf(" %d", n_content);
21031            printf(" %d", n_len);
21032            printf("\n");
21033        }
21034    }
21035    }
21036    function_tests++;
21037
21038    return(test_ret);
21039}
21040
21041
21042static int
21043test_xmlNodeAddContent(void) {
21044    int test_ret = 0;
21045
21046    int mem_base;
21047    xmlNodePtr cur; /* the node being modified */
21048    int n_cur;
21049    xmlChar * content; /* extra content */
21050    int n_content;
21051
21052    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21053    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21054        mem_base = xmlMemBlocks();
21055        cur = gen_xmlNodePtr(n_cur, 0);
21056        content = gen_const_xmlChar_ptr(n_content, 1);
21057
21058        xmlNodeAddContent(cur, (const xmlChar *)content);
21059        call_tests++;
21060        des_xmlNodePtr(n_cur, cur, 0);
21061        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21062        xmlResetLastError();
21063        if (mem_base != xmlMemBlocks()) {
21064            printf("Leak of %d blocks found in xmlNodeAddContent",
21065	           xmlMemBlocks() - mem_base);
21066	    test_ret++;
21067            printf(" %d", n_cur);
21068            printf(" %d", n_content);
21069            printf("\n");
21070        }
21071    }
21072    }
21073    function_tests++;
21074
21075    return(test_ret);
21076}
21077
21078
21079static int
21080test_xmlNodeAddContentLen(void) {
21081    int test_ret = 0;
21082
21083    int mem_base;
21084    xmlNodePtr cur; /* the node being modified */
21085    int n_cur;
21086    xmlChar * content; /* extra content */
21087    int n_content;
21088    int len; /* the size of @content */
21089    int n_len;
21090
21091    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21092    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21093    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21094        mem_base = xmlMemBlocks();
21095        cur = gen_xmlNodePtr(n_cur, 0);
21096        content = gen_const_xmlChar_ptr(n_content, 1);
21097        len = gen_int(n_len, 2);
21098
21099        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21100        call_tests++;
21101        des_xmlNodePtr(n_cur, cur, 0);
21102        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21103        des_int(n_len, len, 2);
21104        xmlResetLastError();
21105        if (mem_base != xmlMemBlocks()) {
21106            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21107	           xmlMemBlocks() - mem_base);
21108	    test_ret++;
21109            printf(" %d", n_cur);
21110            printf(" %d", n_content);
21111            printf(" %d", n_len);
21112            printf("\n");
21113        }
21114    }
21115    }
21116    }
21117    function_tests++;
21118
21119    return(test_ret);
21120}
21121
21122
21123static int
21124test_xmlNodeBufGetContent(void) {
21125    int test_ret = 0;
21126
21127    int mem_base;
21128    int ret_val;
21129    xmlBufferPtr buffer; /* a buffer */
21130    int n_buffer;
21131    xmlNodePtr cur; /* the node being read */
21132    int n_cur;
21133
21134    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21135    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21136        mem_base = xmlMemBlocks();
21137        buffer = gen_xmlBufferPtr(n_buffer, 0);
21138        cur = gen_xmlNodePtr(n_cur, 1);
21139
21140        ret_val = xmlNodeBufGetContent(buffer, cur);
21141        desret_int(ret_val);
21142        call_tests++;
21143        des_xmlBufferPtr(n_buffer, buffer, 0);
21144        des_xmlNodePtr(n_cur, cur, 1);
21145        xmlResetLastError();
21146        if (mem_base != xmlMemBlocks()) {
21147            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21148	           xmlMemBlocks() - mem_base);
21149	    test_ret++;
21150            printf(" %d", n_buffer);
21151            printf(" %d", n_cur);
21152            printf("\n");
21153        }
21154    }
21155    }
21156    function_tests++;
21157
21158    return(test_ret);
21159}
21160
21161
21162static int
21163test_xmlNodeDump(void) {
21164    int test_ret = 0;
21165
21166#if defined(LIBXML_OUTPUT_ENABLED)
21167    int mem_base;
21168    int ret_val;
21169    xmlBufferPtr buf; /* the XML buffer output */
21170    int n_buf;
21171    xmlDocPtr doc; /* the document */
21172    int n_doc;
21173    xmlNodePtr cur; /* the current node */
21174    int n_cur;
21175    int level; /* the imbrication level for indenting */
21176    int n_level;
21177    int format; /* is formatting allowed */
21178    int n_format;
21179
21180    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21181    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21182    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21183    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21184    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21185        mem_base = xmlMemBlocks();
21186        buf = gen_xmlBufferPtr(n_buf, 0);
21187        doc = gen_xmlDocPtr(n_doc, 1);
21188        cur = gen_xmlNodePtr(n_cur, 2);
21189        level = gen_int(n_level, 3);
21190        format = gen_int(n_format, 4);
21191
21192        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21193        desret_int(ret_val);
21194        call_tests++;
21195        des_xmlBufferPtr(n_buf, buf, 0);
21196        des_xmlDocPtr(n_doc, doc, 1);
21197        des_xmlNodePtr(n_cur, cur, 2);
21198        des_int(n_level, level, 3);
21199        des_int(n_format, format, 4);
21200        xmlResetLastError();
21201        if (mem_base != xmlMemBlocks()) {
21202            printf("Leak of %d blocks found in xmlNodeDump",
21203	           xmlMemBlocks() - mem_base);
21204	    test_ret++;
21205            printf(" %d", n_buf);
21206            printf(" %d", n_doc);
21207            printf(" %d", n_cur);
21208            printf(" %d", n_level);
21209            printf(" %d", n_format);
21210            printf("\n");
21211        }
21212    }
21213    }
21214    }
21215    }
21216    }
21217    function_tests++;
21218#endif
21219
21220    return(test_ret);
21221}
21222
21223
21224static int
21225test_xmlNodeDumpOutput(void) {
21226    int test_ret = 0;
21227
21228#if defined(LIBXML_OUTPUT_ENABLED)
21229    int mem_base;
21230    xmlOutputBufferPtr buf; /* the XML buffer output */
21231    int n_buf;
21232    xmlDocPtr doc; /* the document */
21233    int n_doc;
21234    xmlNodePtr cur; /* the current node */
21235    int n_cur;
21236    int level; /* the imbrication level for indenting */
21237    int n_level;
21238    int format; /* is formatting allowed */
21239    int n_format;
21240    char * encoding; /* an optional encoding string */
21241    int n_encoding;
21242
21243    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21244    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21245    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21246    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21247    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21248    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21249        mem_base = xmlMemBlocks();
21250        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21251        doc = gen_xmlDocPtr(n_doc, 1);
21252        cur = gen_xmlNodePtr(n_cur, 2);
21253        level = gen_int(n_level, 3);
21254        format = gen_int(n_format, 4);
21255        encoding = gen_const_char_ptr(n_encoding, 5);
21256
21257        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
21258        call_tests++;
21259        des_xmlOutputBufferPtr(n_buf, buf, 0);
21260        des_xmlDocPtr(n_doc, doc, 1);
21261        des_xmlNodePtr(n_cur, cur, 2);
21262        des_int(n_level, level, 3);
21263        des_int(n_format, format, 4);
21264        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
21265        xmlResetLastError();
21266        if (mem_base != xmlMemBlocks()) {
21267            printf("Leak of %d blocks found in xmlNodeDumpOutput",
21268	           xmlMemBlocks() - mem_base);
21269	    test_ret++;
21270            printf(" %d", n_buf);
21271            printf(" %d", n_doc);
21272            printf(" %d", n_cur);
21273            printf(" %d", n_level);
21274            printf(" %d", n_format);
21275            printf(" %d", n_encoding);
21276            printf("\n");
21277        }
21278    }
21279    }
21280    }
21281    }
21282    }
21283    }
21284    function_tests++;
21285#endif
21286
21287    return(test_ret);
21288}
21289
21290
21291static int
21292test_xmlNodeGetBase(void) {
21293    int test_ret = 0;
21294
21295    int mem_base;
21296    xmlChar * ret_val;
21297    xmlDocPtr doc; /* the document the node pertains to */
21298    int n_doc;
21299    xmlNodePtr cur; /* the node being checked */
21300    int n_cur;
21301
21302    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21303    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21304        mem_base = xmlMemBlocks();
21305        doc = gen_xmlDocPtr(n_doc, 0);
21306        cur = gen_xmlNodePtr(n_cur, 1);
21307
21308        ret_val = xmlNodeGetBase(doc, cur);
21309        desret_xmlChar_ptr(ret_val);
21310        call_tests++;
21311        des_xmlDocPtr(n_doc, doc, 0);
21312        des_xmlNodePtr(n_cur, cur, 1);
21313        xmlResetLastError();
21314        if (mem_base != xmlMemBlocks()) {
21315            printf("Leak of %d blocks found in xmlNodeGetBase",
21316	           xmlMemBlocks() - mem_base);
21317	    test_ret++;
21318            printf(" %d", n_doc);
21319            printf(" %d", n_cur);
21320            printf("\n");
21321        }
21322    }
21323    }
21324    function_tests++;
21325
21326    return(test_ret);
21327}
21328
21329
21330static int
21331test_xmlNodeGetContent(void) {
21332    int test_ret = 0;
21333
21334    int mem_base;
21335    xmlChar * ret_val;
21336    xmlNodePtr cur; /* the node being read */
21337    int n_cur;
21338
21339    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21340        mem_base = xmlMemBlocks();
21341        cur = gen_xmlNodePtr(n_cur, 0);
21342
21343        ret_val = xmlNodeGetContent(cur);
21344        desret_xmlChar_ptr(ret_val);
21345        call_tests++;
21346        des_xmlNodePtr(n_cur, cur, 0);
21347        xmlResetLastError();
21348        if (mem_base != xmlMemBlocks()) {
21349            printf("Leak of %d blocks found in xmlNodeGetContent",
21350	           xmlMemBlocks() - mem_base);
21351	    test_ret++;
21352            printf(" %d", n_cur);
21353            printf("\n");
21354        }
21355    }
21356    function_tests++;
21357
21358    return(test_ret);
21359}
21360
21361
21362static int
21363test_xmlNodeGetLang(void) {
21364    int test_ret = 0;
21365
21366    int mem_base;
21367    xmlChar * ret_val;
21368    xmlNodePtr cur; /* the node being checked */
21369    int n_cur;
21370
21371    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21372        mem_base = xmlMemBlocks();
21373        cur = gen_xmlNodePtr(n_cur, 0);
21374
21375        ret_val = xmlNodeGetLang(cur);
21376        desret_xmlChar_ptr(ret_val);
21377        call_tests++;
21378        des_xmlNodePtr(n_cur, cur, 0);
21379        xmlResetLastError();
21380        if (mem_base != xmlMemBlocks()) {
21381            printf("Leak of %d blocks found in xmlNodeGetLang",
21382	           xmlMemBlocks() - mem_base);
21383	    test_ret++;
21384            printf(" %d", n_cur);
21385            printf("\n");
21386        }
21387    }
21388    function_tests++;
21389
21390    return(test_ret);
21391}
21392
21393
21394static int
21395test_xmlNodeGetSpacePreserve(void) {
21396    int test_ret = 0;
21397
21398    int mem_base;
21399    int ret_val;
21400    xmlNodePtr cur; /* the node being checked */
21401    int n_cur;
21402
21403    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21404        mem_base = xmlMemBlocks();
21405        cur = gen_xmlNodePtr(n_cur, 0);
21406
21407        ret_val = xmlNodeGetSpacePreserve(cur);
21408        desret_int(ret_val);
21409        call_tests++;
21410        des_xmlNodePtr(n_cur, cur, 0);
21411        xmlResetLastError();
21412        if (mem_base != xmlMemBlocks()) {
21413            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
21414	           xmlMemBlocks() - mem_base);
21415	    test_ret++;
21416            printf(" %d", n_cur);
21417            printf("\n");
21418        }
21419    }
21420    function_tests++;
21421
21422    return(test_ret);
21423}
21424
21425
21426static int
21427test_xmlNodeIsText(void) {
21428    int test_ret = 0;
21429
21430    int mem_base;
21431    int ret_val;
21432    xmlNodePtr node; /* the node */
21433    int n_node;
21434
21435    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21436        mem_base = xmlMemBlocks();
21437        node = gen_xmlNodePtr(n_node, 0);
21438
21439        ret_val = xmlNodeIsText(node);
21440        desret_int(ret_val);
21441        call_tests++;
21442        des_xmlNodePtr(n_node, node, 0);
21443        xmlResetLastError();
21444        if (mem_base != xmlMemBlocks()) {
21445            printf("Leak of %d blocks found in xmlNodeIsText",
21446	           xmlMemBlocks() - mem_base);
21447	    test_ret++;
21448            printf(" %d", n_node);
21449            printf("\n");
21450        }
21451    }
21452    function_tests++;
21453
21454    return(test_ret);
21455}
21456
21457
21458static int
21459test_xmlNodeListGetRawString(void) {
21460    int test_ret = 0;
21461
21462#if defined(LIBXML_TREE_ENABLED)
21463    int mem_base;
21464    xmlChar * ret_val;
21465    xmlDocPtr doc; /* the document */
21466    int n_doc;
21467    xmlNodePtr list; /* a Node list */
21468    int n_list;
21469    int inLine; /* should we replace entity contents or show their external form */
21470    int n_inLine;
21471
21472    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21473    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21474    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21475        mem_base = xmlMemBlocks();
21476        doc = gen_xmlDocPtr(n_doc, 0);
21477        list = gen_xmlNodePtr(n_list, 1);
21478        inLine = gen_int(n_inLine, 2);
21479
21480        ret_val = xmlNodeListGetRawString(doc, list, inLine);
21481        desret_xmlChar_ptr(ret_val);
21482        call_tests++;
21483        des_xmlDocPtr(n_doc, doc, 0);
21484        des_xmlNodePtr(n_list, list, 1);
21485        des_int(n_inLine, inLine, 2);
21486        xmlResetLastError();
21487        if (mem_base != xmlMemBlocks()) {
21488            printf("Leak of %d blocks found in xmlNodeListGetRawString",
21489	           xmlMemBlocks() - mem_base);
21490	    test_ret++;
21491            printf(" %d", n_doc);
21492            printf(" %d", n_list);
21493            printf(" %d", n_inLine);
21494            printf("\n");
21495        }
21496    }
21497    }
21498    }
21499    function_tests++;
21500#endif
21501
21502    return(test_ret);
21503}
21504
21505
21506static int
21507test_xmlNodeListGetString(void) {
21508    int test_ret = 0;
21509
21510    int mem_base;
21511    xmlChar * ret_val;
21512    xmlDocPtr doc; /* the document */
21513    int n_doc;
21514    xmlNodePtr list; /* a Node list */
21515    int n_list;
21516    int inLine; /* should we replace entity contents or show their external form */
21517    int n_inLine;
21518
21519    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21520    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21521    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21522        mem_base = xmlMemBlocks();
21523        doc = gen_xmlDocPtr(n_doc, 0);
21524        list = gen_xmlNodePtr(n_list, 1);
21525        inLine = gen_int(n_inLine, 2);
21526
21527        ret_val = xmlNodeListGetString(doc, list, inLine);
21528        desret_xmlChar_ptr(ret_val);
21529        call_tests++;
21530        des_xmlDocPtr(n_doc, doc, 0);
21531        des_xmlNodePtr(n_list, list, 1);
21532        des_int(n_inLine, inLine, 2);
21533        xmlResetLastError();
21534        if (mem_base != xmlMemBlocks()) {
21535            printf("Leak of %d blocks found in xmlNodeListGetString",
21536	           xmlMemBlocks() - mem_base);
21537	    test_ret++;
21538            printf(" %d", n_doc);
21539            printf(" %d", n_list);
21540            printf(" %d", n_inLine);
21541            printf("\n");
21542        }
21543    }
21544    }
21545    }
21546    function_tests++;
21547
21548    return(test_ret);
21549}
21550
21551
21552static int
21553test_xmlNodeSetBase(void) {
21554    int test_ret = 0;
21555
21556#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
21557    int mem_base;
21558    xmlNodePtr cur; /* the node being changed */
21559    int n_cur;
21560    xmlChar * uri; /* the new base URI */
21561    int n_uri;
21562
21563    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21564    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
21565        mem_base = xmlMemBlocks();
21566        cur = gen_xmlNodePtr(n_cur, 0);
21567        uri = gen_const_xmlChar_ptr(n_uri, 1);
21568
21569        xmlNodeSetBase(cur, (const xmlChar *)uri);
21570        call_tests++;
21571        des_xmlNodePtr(n_cur, cur, 0);
21572        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
21573        xmlResetLastError();
21574        if (mem_base != xmlMemBlocks()) {
21575            printf("Leak of %d blocks found in xmlNodeSetBase",
21576	           xmlMemBlocks() - mem_base);
21577	    test_ret++;
21578            printf(" %d", n_cur);
21579            printf(" %d", n_uri);
21580            printf("\n");
21581        }
21582    }
21583    }
21584    function_tests++;
21585#endif
21586
21587    return(test_ret);
21588}
21589
21590
21591static int
21592test_xmlNodeSetContent(void) {
21593    int test_ret = 0;
21594
21595    int mem_base;
21596    xmlNodePtr cur; /* the node being modified */
21597    int n_cur;
21598    xmlChar * content; /* the new value of the content */
21599    int n_content;
21600
21601    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21602    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21603        mem_base = xmlMemBlocks();
21604        cur = gen_xmlNodePtr(n_cur, 0);
21605        content = gen_const_xmlChar_ptr(n_content, 1);
21606
21607        xmlNodeSetContent(cur, (const xmlChar *)content);
21608        call_tests++;
21609        des_xmlNodePtr(n_cur, cur, 0);
21610        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21611        xmlResetLastError();
21612        if (mem_base != xmlMemBlocks()) {
21613            printf("Leak of %d blocks found in xmlNodeSetContent",
21614	           xmlMemBlocks() - mem_base);
21615	    test_ret++;
21616            printf(" %d", n_cur);
21617            printf(" %d", n_content);
21618            printf("\n");
21619        }
21620    }
21621    }
21622    function_tests++;
21623
21624    return(test_ret);
21625}
21626
21627
21628static int
21629test_xmlNodeSetContentLen(void) {
21630    int test_ret = 0;
21631
21632#if defined(LIBXML_TREE_ENABLED)
21633    int mem_base;
21634    xmlNodePtr cur; /* the node being modified */
21635    int n_cur;
21636    xmlChar * content; /* the new value of the content */
21637    int n_content;
21638    int len; /* the size of @content */
21639    int n_len;
21640
21641    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21642    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21643    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21644        mem_base = xmlMemBlocks();
21645        cur = gen_xmlNodePtr(n_cur, 0);
21646        content = gen_const_xmlChar_ptr(n_content, 1);
21647        len = gen_int(n_len, 2);
21648
21649        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
21650        call_tests++;
21651        des_xmlNodePtr(n_cur, cur, 0);
21652        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21653        des_int(n_len, len, 2);
21654        xmlResetLastError();
21655        if (mem_base != xmlMemBlocks()) {
21656            printf("Leak of %d blocks found in xmlNodeSetContentLen",
21657	           xmlMemBlocks() - mem_base);
21658	    test_ret++;
21659            printf(" %d", n_cur);
21660            printf(" %d", n_content);
21661            printf(" %d", n_len);
21662            printf("\n");
21663        }
21664    }
21665    }
21666    }
21667    function_tests++;
21668#endif
21669
21670    return(test_ret);
21671}
21672
21673
21674static int
21675test_xmlNodeSetLang(void) {
21676    int test_ret = 0;
21677
21678#if defined(LIBXML_TREE_ENABLED)
21679    int mem_base;
21680    xmlNodePtr cur; /* the node being changed */
21681    int n_cur;
21682    xmlChar * lang; /* the language description */
21683    int n_lang;
21684
21685    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21686    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
21687        mem_base = xmlMemBlocks();
21688        cur = gen_xmlNodePtr(n_cur, 0);
21689        lang = gen_const_xmlChar_ptr(n_lang, 1);
21690
21691        xmlNodeSetLang(cur, (const xmlChar *)lang);
21692        call_tests++;
21693        des_xmlNodePtr(n_cur, cur, 0);
21694        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
21695        xmlResetLastError();
21696        if (mem_base != xmlMemBlocks()) {
21697            printf("Leak of %d blocks found in xmlNodeSetLang",
21698	           xmlMemBlocks() - mem_base);
21699	    test_ret++;
21700            printf(" %d", n_cur);
21701            printf(" %d", n_lang);
21702            printf("\n");
21703        }
21704    }
21705    }
21706    function_tests++;
21707#endif
21708
21709    return(test_ret);
21710}
21711
21712
21713static int
21714test_xmlNodeSetName(void) {
21715    int test_ret = 0;
21716
21717#if defined(LIBXML_TREE_ENABLED)
21718    int mem_base;
21719    xmlNodePtr cur; /* the node being changed */
21720    int n_cur;
21721    xmlChar * name; /* the new tag name */
21722    int n_name;
21723
21724    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21725    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21726        mem_base = xmlMemBlocks();
21727        cur = gen_xmlNodePtr(n_cur, 0);
21728        name = gen_const_xmlChar_ptr(n_name, 1);
21729
21730        xmlNodeSetName(cur, (const xmlChar *)name);
21731        call_tests++;
21732        des_xmlNodePtr(n_cur, cur, 0);
21733        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21734        xmlResetLastError();
21735        if (mem_base != xmlMemBlocks()) {
21736            printf("Leak of %d blocks found in xmlNodeSetName",
21737	           xmlMemBlocks() - mem_base);
21738	    test_ret++;
21739            printf(" %d", n_cur);
21740            printf(" %d", n_name);
21741            printf("\n");
21742        }
21743    }
21744    }
21745    function_tests++;
21746#endif
21747
21748    return(test_ret);
21749}
21750
21751
21752static int
21753test_xmlNodeSetSpacePreserve(void) {
21754    int test_ret = 0;
21755
21756#if defined(LIBXML_TREE_ENABLED)
21757    int mem_base;
21758    xmlNodePtr cur; /* the node being changed */
21759    int n_cur;
21760    int val; /* the xml:space value ("0": default, 1: "preserve") */
21761    int n_val;
21762
21763    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21764    for (n_val = 0;n_val < gen_nb_int;n_val++) {
21765        mem_base = xmlMemBlocks();
21766        cur = gen_xmlNodePtr(n_cur, 0);
21767        val = gen_int(n_val, 1);
21768
21769        xmlNodeSetSpacePreserve(cur, val);
21770        call_tests++;
21771        des_xmlNodePtr(n_cur, cur, 0);
21772        des_int(n_val, val, 1);
21773        xmlResetLastError();
21774        if (mem_base != xmlMemBlocks()) {
21775            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
21776	           xmlMemBlocks() - mem_base);
21777	    test_ret++;
21778            printf(" %d", n_cur);
21779            printf(" %d", n_val);
21780            printf("\n");
21781        }
21782    }
21783    }
21784    function_tests++;
21785#endif
21786
21787    return(test_ret);
21788}
21789
21790
21791static int
21792test_xmlReconciliateNs(void) {
21793    int test_ret = 0;
21794
21795#if defined(LIBXML_TREE_ENABLED)
21796#ifdef LIBXML_TREE_ENABLED
21797    int mem_base;
21798    int ret_val;
21799    xmlDocPtr doc; /* the document */
21800    int n_doc;
21801    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
21802    int n_tree;
21803
21804    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21805    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
21806        mem_base = xmlMemBlocks();
21807        doc = gen_xmlDocPtr(n_doc, 0);
21808        tree = gen_xmlNodePtr(n_tree, 1);
21809
21810        ret_val = xmlReconciliateNs(doc, tree);
21811        desret_int(ret_val);
21812        call_tests++;
21813        des_xmlDocPtr(n_doc, doc, 0);
21814        des_xmlNodePtr(n_tree, tree, 1);
21815        xmlResetLastError();
21816        if (mem_base != xmlMemBlocks()) {
21817            printf("Leak of %d blocks found in xmlReconciliateNs",
21818	           xmlMemBlocks() - mem_base);
21819	    test_ret++;
21820            printf(" %d", n_doc);
21821            printf(" %d", n_tree);
21822            printf("\n");
21823        }
21824    }
21825    }
21826    function_tests++;
21827#endif
21828#endif
21829
21830    return(test_ret);
21831}
21832
21833
21834static int
21835test_xmlRemoveProp(void) {
21836    int test_ret = 0;
21837
21838#if defined(LIBXML_TREE_ENABLED)
21839    int mem_base;
21840    int ret_val;
21841    xmlAttrPtr cur; /* an attribute */
21842    int n_cur;
21843
21844    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
21845        mem_base = xmlMemBlocks();
21846        cur = gen_xmlAttrPtr(n_cur, 0);
21847
21848        ret_val = xmlRemoveProp(cur);
21849        cur = NULL;
21850        desret_int(ret_val);
21851        call_tests++;
21852        des_xmlAttrPtr(n_cur, cur, 0);
21853        xmlResetLastError();
21854        if (mem_base != xmlMemBlocks()) {
21855            printf("Leak of %d blocks found in xmlRemoveProp",
21856	           xmlMemBlocks() - mem_base);
21857	    test_ret++;
21858            printf(" %d", n_cur);
21859            printf("\n");
21860        }
21861    }
21862    function_tests++;
21863#endif
21864
21865    return(test_ret);
21866}
21867
21868
21869static int
21870test_xmlReplaceNode(void) {
21871    int test_ret = 0;
21872
21873#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
21874    int mem_base;
21875    xmlNodePtr ret_val;
21876    xmlNodePtr old; /* the old node */
21877    int n_old;
21878    xmlNodePtr cur; /* the node */
21879    int n_cur;
21880
21881    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
21882    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
21883        mem_base = xmlMemBlocks();
21884        old = gen_xmlNodePtr(n_old, 0);
21885        cur = gen_xmlNodePtr_in(n_cur, 1);
21886
21887        ret_val = xmlReplaceNode(old, cur);
21888        if (cur != NULL) {
21889              xmlUnlinkNode(cur);
21890              xmlFreeNode(cur) ; cur = NULL ; }
21891          if (old != NULL) {
21892              xmlUnlinkNode(old);
21893              xmlFreeNode(old) ; old = NULL ; }
21894	  ret_val = NULL;
21895        desret_xmlNodePtr(ret_val);
21896        call_tests++;
21897        des_xmlNodePtr(n_old, old, 0);
21898        des_xmlNodePtr_in(n_cur, cur, 1);
21899        xmlResetLastError();
21900        if (mem_base != xmlMemBlocks()) {
21901            printf("Leak of %d blocks found in xmlReplaceNode",
21902	           xmlMemBlocks() - mem_base);
21903	    test_ret++;
21904            printf(" %d", n_old);
21905            printf(" %d", n_cur);
21906            printf("\n");
21907        }
21908    }
21909    }
21910    function_tests++;
21911#endif
21912
21913    return(test_ret);
21914}
21915
21916
21917static int
21918test_xmlSaveFile(void) {
21919    int test_ret = 0;
21920
21921#if defined(LIBXML_OUTPUT_ENABLED)
21922    int mem_base;
21923    int ret_val;
21924    const char * filename; /* the filename (or URL) */
21925    int n_filename;
21926    xmlDocPtr cur; /* the document */
21927    int n_cur;
21928
21929    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21930    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21931        mem_base = xmlMemBlocks();
21932        filename = gen_fileoutput(n_filename, 0);
21933        cur = gen_xmlDocPtr(n_cur, 1);
21934
21935        ret_val = xmlSaveFile(filename, cur);
21936        desret_int(ret_val);
21937        call_tests++;
21938        des_fileoutput(n_filename, filename, 0);
21939        des_xmlDocPtr(n_cur, cur, 1);
21940        xmlResetLastError();
21941        if (mem_base != xmlMemBlocks()) {
21942            printf("Leak of %d blocks found in xmlSaveFile",
21943	           xmlMemBlocks() - mem_base);
21944	    test_ret++;
21945            printf(" %d", n_filename);
21946            printf(" %d", n_cur);
21947            printf("\n");
21948        }
21949    }
21950    }
21951    function_tests++;
21952#endif
21953
21954    return(test_ret);
21955}
21956
21957
21958static int
21959test_xmlSaveFileEnc(void) {
21960    int test_ret = 0;
21961
21962#if defined(LIBXML_OUTPUT_ENABLED)
21963    int mem_base;
21964    int ret_val;
21965    const char * filename; /* the filename (or URL) */
21966    int n_filename;
21967    xmlDocPtr cur; /* the document */
21968    int n_cur;
21969    char * encoding; /* the name of an encoding (or NULL) */
21970    int n_encoding;
21971
21972    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21973    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21974    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21975        mem_base = xmlMemBlocks();
21976        filename = gen_fileoutput(n_filename, 0);
21977        cur = gen_xmlDocPtr(n_cur, 1);
21978        encoding = gen_const_char_ptr(n_encoding, 2);
21979
21980        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
21981        desret_int(ret_val);
21982        call_tests++;
21983        des_fileoutput(n_filename, filename, 0);
21984        des_xmlDocPtr(n_cur, cur, 1);
21985        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
21986        xmlResetLastError();
21987        if (mem_base != xmlMemBlocks()) {
21988            printf("Leak of %d blocks found in xmlSaveFileEnc",
21989	           xmlMemBlocks() - mem_base);
21990	    test_ret++;
21991            printf(" %d", n_filename);
21992            printf(" %d", n_cur);
21993            printf(" %d", n_encoding);
21994            printf("\n");
21995        }
21996    }
21997    }
21998    }
21999    function_tests++;
22000#endif
22001
22002    return(test_ret);
22003}
22004
22005
22006static int
22007test_xmlSaveFileTo(void) {
22008    int test_ret = 0;
22009
22010#if defined(LIBXML_OUTPUT_ENABLED)
22011    int mem_base;
22012    int ret_val;
22013    xmlOutputBufferPtr buf; /* an output I/O buffer */
22014    int n_buf;
22015    xmlDocPtr cur; /* the document */
22016    int n_cur;
22017    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22018    int n_encoding;
22019
22020    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22021    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22022    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22023        mem_base = xmlMemBlocks();
22024        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22025        cur = gen_xmlDocPtr(n_cur, 1);
22026        encoding = gen_const_char_ptr(n_encoding, 2);
22027
22028        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22029        buf = NULL;
22030        desret_int(ret_val);
22031        call_tests++;
22032        des_xmlOutputBufferPtr(n_buf, buf, 0);
22033        des_xmlDocPtr(n_cur, cur, 1);
22034        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22035        xmlResetLastError();
22036        if (mem_base != xmlMemBlocks()) {
22037            printf("Leak of %d blocks found in xmlSaveFileTo",
22038	           xmlMemBlocks() - mem_base);
22039	    test_ret++;
22040            printf(" %d", n_buf);
22041            printf(" %d", n_cur);
22042            printf(" %d", n_encoding);
22043            printf("\n");
22044        }
22045    }
22046    }
22047    }
22048    function_tests++;
22049#endif
22050
22051    return(test_ret);
22052}
22053
22054
22055static int
22056test_xmlSaveFormatFile(void) {
22057    int test_ret = 0;
22058
22059#if defined(LIBXML_OUTPUT_ENABLED)
22060    int mem_base;
22061    int ret_val;
22062    const char * filename; /* the filename (or URL) */
22063    int n_filename;
22064    xmlDocPtr cur; /* the document */
22065    int n_cur;
22066    int format; /* should formatting spaces been added */
22067    int n_format;
22068
22069    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22070    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22071    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22072        mem_base = xmlMemBlocks();
22073        filename = gen_fileoutput(n_filename, 0);
22074        cur = gen_xmlDocPtr(n_cur, 1);
22075        format = gen_int(n_format, 2);
22076
22077        ret_val = xmlSaveFormatFile(filename, cur, format);
22078        desret_int(ret_val);
22079        call_tests++;
22080        des_fileoutput(n_filename, filename, 0);
22081        des_xmlDocPtr(n_cur, cur, 1);
22082        des_int(n_format, format, 2);
22083        xmlResetLastError();
22084        if (mem_base != xmlMemBlocks()) {
22085            printf("Leak of %d blocks found in xmlSaveFormatFile",
22086	           xmlMemBlocks() - mem_base);
22087	    test_ret++;
22088            printf(" %d", n_filename);
22089            printf(" %d", n_cur);
22090            printf(" %d", n_format);
22091            printf("\n");
22092        }
22093    }
22094    }
22095    }
22096    function_tests++;
22097#endif
22098
22099    return(test_ret);
22100}
22101
22102
22103static int
22104test_xmlSaveFormatFileEnc(void) {
22105    int test_ret = 0;
22106
22107#if defined(LIBXML_OUTPUT_ENABLED)
22108    int mem_base;
22109    int ret_val;
22110    const char * filename; /* the filename or URL to output */
22111    int n_filename;
22112    xmlDocPtr cur; /* the document being saved */
22113    int n_cur;
22114    char * encoding; /* the name of the encoding to use or NULL. */
22115    int n_encoding;
22116    int format; /* should formatting spaces be added. */
22117    int n_format;
22118
22119    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22120    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22121    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22122    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22123        mem_base = xmlMemBlocks();
22124        filename = gen_fileoutput(n_filename, 0);
22125        cur = gen_xmlDocPtr(n_cur, 1);
22126        encoding = gen_const_char_ptr(n_encoding, 2);
22127        format = gen_int(n_format, 3);
22128
22129        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22130        desret_int(ret_val);
22131        call_tests++;
22132        des_fileoutput(n_filename, filename, 0);
22133        des_xmlDocPtr(n_cur, cur, 1);
22134        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22135        des_int(n_format, format, 3);
22136        xmlResetLastError();
22137        if (mem_base != xmlMemBlocks()) {
22138            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22139	           xmlMemBlocks() - mem_base);
22140	    test_ret++;
22141            printf(" %d", n_filename);
22142            printf(" %d", n_cur);
22143            printf(" %d", n_encoding);
22144            printf(" %d", n_format);
22145            printf("\n");
22146        }
22147    }
22148    }
22149    }
22150    }
22151    function_tests++;
22152#endif
22153
22154    return(test_ret);
22155}
22156
22157
22158static int
22159test_xmlSaveFormatFileTo(void) {
22160    int test_ret = 0;
22161
22162#if defined(LIBXML_OUTPUT_ENABLED)
22163    int mem_base;
22164    int ret_val;
22165    xmlOutputBufferPtr buf; /* an output I/O buffer */
22166    int n_buf;
22167    xmlDocPtr cur; /* the document */
22168    int n_cur;
22169    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22170    int n_encoding;
22171    int format; /* should formatting spaces been added */
22172    int n_format;
22173
22174    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22175    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22176    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22177    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22178        mem_base = xmlMemBlocks();
22179        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22180        cur = gen_xmlDocPtr(n_cur, 1);
22181        encoding = gen_const_char_ptr(n_encoding, 2);
22182        format = gen_int(n_format, 3);
22183
22184        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22185        buf = NULL;
22186        desret_int(ret_val);
22187        call_tests++;
22188        des_xmlOutputBufferPtr(n_buf, buf, 0);
22189        des_xmlDocPtr(n_cur, cur, 1);
22190        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22191        des_int(n_format, format, 3);
22192        xmlResetLastError();
22193        if (mem_base != xmlMemBlocks()) {
22194            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22195	           xmlMemBlocks() - mem_base);
22196	    test_ret++;
22197            printf(" %d", n_buf);
22198            printf(" %d", n_cur);
22199            printf(" %d", n_encoding);
22200            printf(" %d", n_format);
22201            printf("\n");
22202        }
22203    }
22204    }
22205    }
22206    }
22207    function_tests++;
22208#endif
22209
22210    return(test_ret);
22211}
22212
22213
22214static int
22215test_xmlSearchNs(void) {
22216    int test_ret = 0;
22217
22218    int mem_base;
22219    xmlNsPtr ret_val;
22220    xmlDocPtr doc; /* the document */
22221    int n_doc;
22222    xmlNodePtr node; /* the current node */
22223    int n_node;
22224    xmlChar * nameSpace; /* the namespace prefix */
22225    int n_nameSpace;
22226
22227    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22228    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22229    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22230        mem_base = xmlMemBlocks();
22231        doc = gen_xmlDocPtr(n_doc, 0);
22232        node = gen_xmlNodePtr(n_node, 1);
22233        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22234
22235        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
22236        desret_xmlNsPtr(ret_val);
22237        call_tests++;
22238        des_xmlDocPtr(n_doc, doc, 0);
22239        des_xmlNodePtr(n_node, node, 1);
22240        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
22241        xmlResetLastError();
22242        if (mem_base != xmlMemBlocks()) {
22243            printf("Leak of %d blocks found in xmlSearchNs",
22244	           xmlMemBlocks() - mem_base);
22245	    test_ret++;
22246            printf(" %d", n_doc);
22247            printf(" %d", n_node);
22248            printf(" %d", n_nameSpace);
22249            printf("\n");
22250        }
22251    }
22252    }
22253    }
22254    function_tests++;
22255
22256    return(test_ret);
22257}
22258
22259
22260static int
22261test_xmlSearchNsByHref(void) {
22262    int test_ret = 0;
22263
22264    int mem_base;
22265    xmlNsPtr ret_val;
22266    xmlDocPtr doc; /* the document */
22267    int n_doc;
22268    xmlNodePtr node; /* the current node */
22269    int n_node;
22270    xmlChar * href; /* the namespace value */
22271    int n_href;
22272
22273    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22274    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22275    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22276        mem_base = xmlMemBlocks();
22277        doc = gen_xmlDocPtr(n_doc, 0);
22278        node = gen_xmlNodePtr(n_node, 1);
22279        href = gen_const_xmlChar_ptr(n_href, 2);
22280
22281        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
22282        desret_xmlNsPtr(ret_val);
22283        call_tests++;
22284        des_xmlDocPtr(n_doc, doc, 0);
22285        des_xmlNodePtr(n_node, node, 1);
22286        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
22287        xmlResetLastError();
22288        if (mem_base != xmlMemBlocks()) {
22289            printf("Leak of %d blocks found in xmlSearchNsByHref",
22290	           xmlMemBlocks() - mem_base);
22291	    test_ret++;
22292            printf(" %d", n_doc);
22293            printf(" %d", n_node);
22294            printf(" %d", n_href);
22295            printf("\n");
22296        }
22297    }
22298    }
22299    }
22300    function_tests++;
22301
22302    return(test_ret);
22303}
22304
22305
22306static int
22307test_xmlSetBufferAllocationScheme(void) {
22308    int test_ret = 0;
22309
22310    int mem_base;
22311    xmlBufferAllocationScheme scheme; /* allocation method to use */
22312    int n_scheme;
22313
22314    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
22315        mem_base = xmlMemBlocks();
22316        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
22317
22318        xmlSetBufferAllocationScheme(scheme);
22319        call_tests++;
22320        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
22321        xmlResetLastError();
22322        if (mem_base != xmlMemBlocks()) {
22323            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
22324	           xmlMemBlocks() - mem_base);
22325	    test_ret++;
22326            printf(" %d", n_scheme);
22327            printf("\n");
22328        }
22329    }
22330    function_tests++;
22331
22332    return(test_ret);
22333}
22334
22335
22336static int
22337test_xmlSetCompressMode(void) {
22338    int test_ret = 0;
22339
22340    int mem_base;
22341    int mode; /* the compression ratio */
22342    int n_mode;
22343
22344    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22345        mem_base = xmlMemBlocks();
22346        mode = gen_int(n_mode, 0);
22347
22348        xmlSetCompressMode(mode);
22349        call_tests++;
22350        des_int(n_mode, mode, 0);
22351        xmlResetLastError();
22352        if (mem_base != xmlMemBlocks()) {
22353            printf("Leak of %d blocks found in xmlSetCompressMode",
22354	           xmlMemBlocks() - mem_base);
22355	    test_ret++;
22356            printf(" %d", n_mode);
22357            printf("\n");
22358        }
22359    }
22360    function_tests++;
22361
22362    return(test_ret);
22363}
22364
22365
22366static int
22367test_xmlSetDocCompressMode(void) {
22368    int test_ret = 0;
22369
22370    int mem_base;
22371    xmlDocPtr doc; /* the document */
22372    int n_doc;
22373    int mode; /* the compression ratio */
22374    int n_mode;
22375
22376    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22377    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22378        mem_base = xmlMemBlocks();
22379        doc = gen_xmlDocPtr(n_doc, 0);
22380        mode = gen_int(n_mode, 1);
22381
22382        xmlSetDocCompressMode(doc, mode);
22383        call_tests++;
22384        des_xmlDocPtr(n_doc, doc, 0);
22385        des_int(n_mode, mode, 1);
22386        xmlResetLastError();
22387        if (mem_base != xmlMemBlocks()) {
22388            printf("Leak of %d blocks found in xmlSetDocCompressMode",
22389	           xmlMemBlocks() - mem_base);
22390	    test_ret++;
22391            printf(" %d", n_doc);
22392            printf(" %d", n_mode);
22393            printf("\n");
22394        }
22395    }
22396    }
22397    function_tests++;
22398
22399    return(test_ret);
22400}
22401
22402
22403static int
22404test_xmlSetNs(void) {
22405    int test_ret = 0;
22406
22407    int mem_base;
22408    xmlNodePtr node; /* a node in the document */
22409    int n_node;
22410    xmlNsPtr ns; /* a namespace pointer */
22411    int n_ns;
22412
22413    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22414    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22415        mem_base = xmlMemBlocks();
22416        node = gen_xmlNodePtr(n_node, 0);
22417        ns = gen_xmlNsPtr(n_ns, 1);
22418
22419        xmlSetNs(node, ns);
22420        call_tests++;
22421        des_xmlNodePtr(n_node, node, 0);
22422        des_xmlNsPtr(n_ns, ns, 1);
22423        xmlResetLastError();
22424        if (mem_base != xmlMemBlocks()) {
22425            printf("Leak of %d blocks found in xmlSetNs",
22426	           xmlMemBlocks() - mem_base);
22427	    test_ret++;
22428            printf(" %d", n_node);
22429            printf(" %d", n_ns);
22430            printf("\n");
22431        }
22432    }
22433    }
22434    function_tests++;
22435
22436    return(test_ret);
22437}
22438
22439
22440static int
22441test_xmlSetNsProp(void) {
22442    int test_ret = 0;
22443
22444#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22445    int mem_base;
22446    xmlAttrPtr ret_val;
22447    xmlNodePtr node; /* the node */
22448    int n_node;
22449    xmlNsPtr ns; /* the namespace definition */
22450    int n_ns;
22451    xmlChar * name; /* the attribute name */
22452    int n_name;
22453    xmlChar * value; /* the attribute value */
22454    int n_value;
22455
22456    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22457    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22458    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22459    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22460        mem_base = xmlMemBlocks();
22461        node = gen_xmlNodePtr(n_node, 0);
22462        ns = gen_xmlNsPtr(n_ns, 1);
22463        name = gen_const_xmlChar_ptr(n_name, 2);
22464        value = gen_const_xmlChar_ptr(n_value, 3);
22465
22466        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
22467        desret_xmlAttrPtr(ret_val);
22468        call_tests++;
22469        des_xmlNodePtr(n_node, node, 0);
22470        des_xmlNsPtr(n_ns, ns, 1);
22471        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22472        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22473        xmlResetLastError();
22474        if (mem_base != xmlMemBlocks()) {
22475            printf("Leak of %d blocks found in xmlSetNsProp",
22476	           xmlMemBlocks() - mem_base);
22477	    test_ret++;
22478            printf(" %d", n_node);
22479            printf(" %d", n_ns);
22480            printf(" %d", n_name);
22481            printf(" %d", n_value);
22482            printf("\n");
22483        }
22484    }
22485    }
22486    }
22487    }
22488    function_tests++;
22489#endif
22490
22491    return(test_ret);
22492}
22493
22494
22495static int
22496test_xmlSetProp(void) {
22497    int test_ret = 0;
22498
22499#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
22500    int mem_base;
22501    xmlAttrPtr ret_val;
22502    xmlNodePtr node; /* the node */
22503    int n_node;
22504    xmlChar * name; /* the attribute name */
22505    int n_name;
22506    xmlChar * value; /* the attribute value */
22507    int n_value;
22508
22509    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22510    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22511    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22512        mem_base = xmlMemBlocks();
22513        node = gen_xmlNodePtr(n_node, 0);
22514        name = gen_const_xmlChar_ptr(n_name, 1);
22515        value = gen_const_xmlChar_ptr(n_value, 2);
22516
22517        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
22518        desret_xmlAttrPtr(ret_val);
22519        call_tests++;
22520        des_xmlNodePtr(n_node, node, 0);
22521        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22522        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22523        xmlResetLastError();
22524        if (mem_base != xmlMemBlocks()) {
22525            printf("Leak of %d blocks found in xmlSetProp",
22526	           xmlMemBlocks() - mem_base);
22527	    test_ret++;
22528            printf(" %d", n_node);
22529            printf(" %d", n_name);
22530            printf(" %d", n_value);
22531            printf("\n");
22532        }
22533    }
22534    }
22535    }
22536    function_tests++;
22537#endif
22538
22539    return(test_ret);
22540}
22541
22542
22543static int
22544test_xmlSplitQName2(void) {
22545    int test_ret = 0;
22546
22547    int mem_base;
22548    xmlChar * ret_val;
22549    xmlChar * name; /* the full QName */
22550    int n_name;
22551    xmlChar ** prefix; /* a xmlChar ** */
22552    int n_prefix;
22553
22554    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22555    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
22556        mem_base = xmlMemBlocks();
22557        name = gen_const_xmlChar_ptr(n_name, 0);
22558        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
22559
22560        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
22561        desret_xmlChar_ptr(ret_val);
22562        call_tests++;
22563        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22564        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
22565        xmlResetLastError();
22566        if (mem_base != xmlMemBlocks()) {
22567            printf("Leak of %d blocks found in xmlSplitQName2",
22568	           xmlMemBlocks() - mem_base);
22569	    test_ret++;
22570            printf(" %d", n_name);
22571            printf(" %d", n_prefix);
22572            printf("\n");
22573        }
22574    }
22575    }
22576    function_tests++;
22577
22578    return(test_ret);
22579}
22580
22581
22582static int
22583test_xmlSplitQName3(void) {
22584    int test_ret = 0;
22585
22586    int mem_base;
22587    const xmlChar * ret_val;
22588    xmlChar * name; /* the full QName */
22589    int n_name;
22590    int * len; /* an int * */
22591    int n_len;
22592
22593    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22594    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
22595        mem_base = xmlMemBlocks();
22596        name = gen_const_xmlChar_ptr(n_name, 0);
22597        len = gen_int_ptr(n_len, 1);
22598
22599        ret_val = xmlSplitQName3((const xmlChar *)name, len);
22600        desret_const_xmlChar_ptr(ret_val);
22601        call_tests++;
22602        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22603        des_int_ptr(n_len, len, 1);
22604        xmlResetLastError();
22605        if (mem_base != xmlMemBlocks()) {
22606            printf("Leak of %d blocks found in xmlSplitQName3",
22607	           xmlMemBlocks() - mem_base);
22608	    test_ret++;
22609            printf(" %d", n_name);
22610            printf(" %d", n_len);
22611            printf("\n");
22612        }
22613    }
22614    }
22615    function_tests++;
22616
22617    return(test_ret);
22618}
22619
22620
22621static int
22622test_xmlStringGetNodeList(void) {
22623    int test_ret = 0;
22624
22625    int mem_base;
22626    xmlNodePtr ret_val;
22627    xmlDocPtr doc; /* the document */
22628    int n_doc;
22629    xmlChar * value; /* the value of the attribute */
22630    int n_value;
22631
22632    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22633    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22634        mem_base = xmlMemBlocks();
22635        doc = gen_xmlDocPtr(n_doc, 0);
22636        value = gen_const_xmlChar_ptr(n_value, 1);
22637
22638        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
22639        desret_xmlNodePtr(ret_val);
22640        call_tests++;
22641        des_xmlDocPtr(n_doc, doc, 0);
22642        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
22643        xmlResetLastError();
22644        if (mem_base != xmlMemBlocks()) {
22645            printf("Leak of %d blocks found in xmlStringGetNodeList",
22646	           xmlMemBlocks() - mem_base);
22647	    test_ret++;
22648            printf(" %d", n_doc);
22649            printf(" %d", n_value);
22650            printf("\n");
22651        }
22652    }
22653    }
22654    function_tests++;
22655
22656    return(test_ret);
22657}
22658
22659
22660static int
22661test_xmlStringLenGetNodeList(void) {
22662    int test_ret = 0;
22663
22664    int mem_base;
22665    xmlNodePtr ret_val;
22666    xmlDocPtr doc; /* the document */
22667    int n_doc;
22668    xmlChar * value; /* the value of the text */
22669    int n_value;
22670    int len; /* the length of the string value */
22671    int n_len;
22672
22673    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22674    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22675    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22676        mem_base = xmlMemBlocks();
22677        doc = gen_xmlDocPtr(n_doc, 0);
22678        value = gen_const_xmlChar_ptr(n_value, 1);
22679        len = gen_int(n_len, 2);
22680
22681        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
22682        desret_xmlNodePtr(ret_val);
22683        call_tests++;
22684        des_xmlDocPtr(n_doc, doc, 0);
22685        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
22686        des_int(n_len, len, 2);
22687        xmlResetLastError();
22688        if (mem_base != xmlMemBlocks()) {
22689            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
22690	           xmlMemBlocks() - mem_base);
22691	    test_ret++;
22692            printf(" %d", n_doc);
22693            printf(" %d", n_value);
22694            printf(" %d", n_len);
22695            printf("\n");
22696        }
22697    }
22698    }
22699    }
22700    function_tests++;
22701
22702    return(test_ret);
22703}
22704
22705
22706static int
22707test_xmlTextConcat(void) {
22708    int test_ret = 0;
22709
22710    int mem_base;
22711    int ret_val;
22712    xmlNodePtr node; /* the node */
22713    int n_node;
22714    xmlChar * content; /* the content */
22715    int n_content;
22716    int len; /* @content length */
22717    int n_len;
22718
22719    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22720    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22721    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22722        mem_base = xmlMemBlocks();
22723        node = gen_xmlNodePtr(n_node, 0);
22724        content = gen_const_xmlChar_ptr(n_content, 1);
22725        len = gen_int(n_len, 2);
22726
22727        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
22728        desret_int(ret_val);
22729        call_tests++;
22730        des_xmlNodePtr(n_node, node, 0);
22731        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22732        des_int(n_len, len, 2);
22733        xmlResetLastError();
22734        if (mem_base != xmlMemBlocks()) {
22735            printf("Leak of %d blocks found in xmlTextConcat",
22736	           xmlMemBlocks() - mem_base);
22737	    test_ret++;
22738            printf(" %d", n_node);
22739            printf(" %d", n_content);
22740            printf(" %d", n_len);
22741            printf("\n");
22742        }
22743    }
22744    }
22745    }
22746    function_tests++;
22747
22748    return(test_ret);
22749}
22750
22751
22752static int
22753test_xmlTextMerge(void) {
22754    int test_ret = 0;
22755
22756    int mem_base;
22757    xmlNodePtr ret_val;
22758    xmlNodePtr first; /* the first text node */
22759    int n_first;
22760    xmlNodePtr second; /* the second text node being merged */
22761    int n_second;
22762
22763    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
22764    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
22765        mem_base = xmlMemBlocks();
22766        first = gen_xmlNodePtr_in(n_first, 0);
22767        second = gen_xmlNodePtr_in(n_second, 1);
22768
22769        ret_val = xmlTextMerge(first, second);
22770        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
22771              xmlUnlinkNode(second);
22772              xmlFreeNode(second) ; second = NULL ; }
22773        desret_xmlNodePtr(ret_val);
22774        call_tests++;
22775        des_xmlNodePtr_in(n_first, first, 0);
22776        des_xmlNodePtr_in(n_second, second, 1);
22777        xmlResetLastError();
22778        if (mem_base != xmlMemBlocks()) {
22779            printf("Leak of %d blocks found in xmlTextMerge",
22780	           xmlMemBlocks() - mem_base);
22781	    test_ret++;
22782            printf(" %d", n_first);
22783            printf(" %d", n_second);
22784            printf("\n");
22785        }
22786    }
22787    }
22788    function_tests++;
22789
22790    return(test_ret);
22791}
22792
22793
22794static int
22795test_xmlUnsetNsProp(void) {
22796    int test_ret = 0;
22797
22798#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22799    int mem_base;
22800    int ret_val;
22801    xmlNodePtr node; /* the node */
22802    int n_node;
22803    xmlNsPtr ns; /* the namespace definition */
22804    int n_ns;
22805    xmlChar * name; /* the attribute name */
22806    int n_name;
22807
22808    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22809    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22810    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22811        mem_base = xmlMemBlocks();
22812        node = gen_xmlNodePtr(n_node, 0);
22813        ns = gen_xmlNsPtr(n_ns, 1);
22814        name = gen_const_xmlChar_ptr(n_name, 2);
22815
22816        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
22817        desret_int(ret_val);
22818        call_tests++;
22819        des_xmlNodePtr(n_node, node, 0);
22820        des_xmlNsPtr(n_ns, ns, 1);
22821        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22822        xmlResetLastError();
22823        if (mem_base != xmlMemBlocks()) {
22824            printf("Leak of %d blocks found in xmlUnsetNsProp",
22825	           xmlMemBlocks() - mem_base);
22826	    test_ret++;
22827            printf(" %d", n_node);
22828            printf(" %d", n_ns);
22829            printf(" %d", n_name);
22830            printf("\n");
22831        }
22832    }
22833    }
22834    }
22835    function_tests++;
22836#endif
22837
22838    return(test_ret);
22839}
22840
22841
22842static int
22843test_xmlUnsetProp(void) {
22844    int test_ret = 0;
22845
22846#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22847    int mem_base;
22848    int ret_val;
22849    xmlNodePtr node; /* the node */
22850    int n_node;
22851    xmlChar * name; /* the attribute name */
22852    int n_name;
22853
22854    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22855    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22856        mem_base = xmlMemBlocks();
22857        node = gen_xmlNodePtr(n_node, 0);
22858        name = gen_const_xmlChar_ptr(n_name, 1);
22859
22860        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
22861        desret_int(ret_val);
22862        call_tests++;
22863        des_xmlNodePtr(n_node, node, 0);
22864        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22865        xmlResetLastError();
22866        if (mem_base != xmlMemBlocks()) {
22867            printf("Leak of %d blocks found in xmlUnsetProp",
22868	           xmlMemBlocks() - mem_base);
22869	    test_ret++;
22870            printf(" %d", n_node);
22871            printf(" %d", n_name);
22872            printf("\n");
22873        }
22874    }
22875    }
22876    function_tests++;
22877#endif
22878
22879    return(test_ret);
22880}
22881
22882
22883static int
22884test_xmlValidateNCName(void) {
22885    int test_ret = 0;
22886
22887#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
22888#ifdef LIBXML_TREE_ENABLED
22889    int mem_base;
22890    int ret_val;
22891    xmlChar * value; /* the value to check */
22892    int n_value;
22893    int space; /* allow spaces in front and end of the string */
22894    int n_space;
22895
22896    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22897    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22898        mem_base = xmlMemBlocks();
22899        value = gen_const_xmlChar_ptr(n_value, 0);
22900        space = gen_int(n_space, 1);
22901
22902        ret_val = xmlValidateNCName((const xmlChar *)value, space);
22903        desret_int(ret_val);
22904        call_tests++;
22905        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22906        des_int(n_space, space, 1);
22907        xmlResetLastError();
22908        if (mem_base != xmlMemBlocks()) {
22909            printf("Leak of %d blocks found in xmlValidateNCName",
22910	           xmlMemBlocks() - mem_base);
22911	    test_ret++;
22912            printf(" %d", n_value);
22913            printf(" %d", n_space);
22914            printf("\n");
22915        }
22916    }
22917    }
22918    function_tests++;
22919#endif
22920#endif
22921
22922    return(test_ret);
22923}
22924
22925
22926static int
22927test_xmlValidateNMToken(void) {
22928    int test_ret = 0;
22929
22930#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22931#ifdef LIBXML_TREE_ENABLED
22932    int mem_base;
22933    int ret_val;
22934    xmlChar * value; /* the value to check */
22935    int n_value;
22936    int space; /* allow spaces in front and end of the string */
22937    int n_space;
22938
22939    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22940    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22941        mem_base = xmlMemBlocks();
22942        value = gen_const_xmlChar_ptr(n_value, 0);
22943        space = gen_int(n_space, 1);
22944
22945        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
22946        desret_int(ret_val);
22947        call_tests++;
22948        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22949        des_int(n_space, space, 1);
22950        xmlResetLastError();
22951        if (mem_base != xmlMemBlocks()) {
22952            printf("Leak of %d blocks found in xmlValidateNMToken",
22953	           xmlMemBlocks() - mem_base);
22954	    test_ret++;
22955            printf(" %d", n_value);
22956            printf(" %d", n_space);
22957            printf("\n");
22958        }
22959    }
22960    }
22961    function_tests++;
22962#endif
22963#endif
22964
22965    return(test_ret);
22966}
22967
22968
22969static int
22970test_xmlValidateName(void) {
22971    int test_ret = 0;
22972
22973#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
22974#ifdef LIBXML_TREE_ENABLED
22975    int mem_base;
22976    int ret_val;
22977    xmlChar * value; /* the value to check */
22978    int n_value;
22979    int space; /* allow spaces in front and end of the string */
22980    int n_space;
22981
22982    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22983    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22984        mem_base = xmlMemBlocks();
22985        value = gen_const_xmlChar_ptr(n_value, 0);
22986        space = gen_int(n_space, 1);
22987
22988        ret_val = xmlValidateName((const xmlChar *)value, space);
22989        desret_int(ret_val);
22990        call_tests++;
22991        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22992        des_int(n_space, space, 1);
22993        xmlResetLastError();
22994        if (mem_base != xmlMemBlocks()) {
22995            printf("Leak of %d blocks found in xmlValidateName",
22996	           xmlMemBlocks() - mem_base);
22997	    test_ret++;
22998            printf(" %d", n_value);
22999            printf(" %d", n_space);
23000            printf("\n");
23001        }
23002    }
23003    }
23004    function_tests++;
23005#endif
23006#endif
23007
23008    return(test_ret);
23009}
23010
23011
23012static int
23013test_xmlValidateQName(void) {
23014    int test_ret = 0;
23015
23016#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23017#ifdef LIBXML_TREE_ENABLED
23018    int mem_base;
23019    int ret_val;
23020    xmlChar * value; /* the value to check */
23021    int n_value;
23022    int space; /* allow spaces in front and end of the string */
23023    int n_space;
23024
23025    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23026    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23027        mem_base = xmlMemBlocks();
23028        value = gen_const_xmlChar_ptr(n_value, 0);
23029        space = gen_int(n_space, 1);
23030
23031        ret_val = xmlValidateQName((const xmlChar *)value, space);
23032        desret_int(ret_val);
23033        call_tests++;
23034        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23035        des_int(n_space, space, 1);
23036        xmlResetLastError();
23037        if (mem_base != xmlMemBlocks()) {
23038            printf("Leak of %d blocks found in xmlValidateQName",
23039	           xmlMemBlocks() - mem_base);
23040	    test_ret++;
23041            printf(" %d", n_value);
23042            printf(" %d", n_space);
23043            printf("\n");
23044        }
23045    }
23046    }
23047    function_tests++;
23048#endif
23049#endif
23050
23051    return(test_ret);
23052}
23053
23054static int
23055test_tree(void) {
23056    int test_ret = 0;
23057
23058    if (quiet == 0) printf("Testing tree : 129 of 146 functions ...\n");
23059    test_ret += test_xmlAddChild();
23060    test_ret += test_xmlAddChildList();
23061    test_ret += test_xmlAddNextSibling();
23062    test_ret += test_xmlAddPrevSibling();
23063    test_ret += test_xmlAddSibling();
23064    test_ret += test_xmlAttrSerializeTxtContent();
23065    test_ret += test_xmlBufferAdd();
23066    test_ret += test_xmlBufferAddHead();
23067    test_ret += test_xmlBufferCCat();
23068    test_ret += test_xmlBufferCat();
23069    test_ret += test_xmlBufferContent();
23070    test_ret += test_xmlBufferCreate();
23071    test_ret += test_xmlBufferCreateSize();
23072    test_ret += test_xmlBufferCreateStatic();
23073    test_ret += test_xmlBufferEmpty();
23074    test_ret += test_xmlBufferGrow();
23075    test_ret += test_xmlBufferLength();
23076    test_ret += test_xmlBufferResize();
23077    test_ret += test_xmlBufferSetAllocationScheme();
23078    test_ret += test_xmlBufferShrink();
23079    test_ret += test_xmlBufferWriteCHAR();
23080    test_ret += test_xmlBufferWriteChar();
23081    test_ret += test_xmlBufferWriteQuotedString();
23082    test_ret += test_xmlBuildQName();
23083    test_ret += test_xmlCopyDoc();
23084    test_ret += test_xmlCopyDtd();
23085    test_ret += test_xmlCopyNamespace();
23086    test_ret += test_xmlCopyNamespaceList();
23087    test_ret += test_xmlCopyNode();
23088    test_ret += test_xmlCopyNodeList();
23089    test_ret += test_xmlCopyProp();
23090    test_ret += test_xmlCopyPropList();
23091    test_ret += test_xmlCreateIntSubset();
23092    test_ret += test_xmlDocCopyNode();
23093    test_ret += test_xmlDocCopyNodeList();
23094    test_ret += test_xmlDocDump();
23095    test_ret += test_xmlDocDumpFormatMemory();
23096    test_ret += test_xmlDocDumpFormatMemoryEnc();
23097    test_ret += test_xmlDocDumpMemory();
23098    test_ret += test_xmlDocDumpMemoryEnc();
23099    test_ret += test_xmlDocFormatDump();
23100    test_ret += test_xmlDocGetRootElement();
23101    test_ret += test_xmlDocSetRootElement();
23102    test_ret += test_xmlElemDump();
23103    test_ret += test_xmlGetBufferAllocationScheme();
23104    test_ret += test_xmlGetCompressMode();
23105    test_ret += test_xmlGetDocCompressMode();
23106    test_ret += test_xmlGetIntSubset();
23107    test_ret += test_xmlGetLastChild();
23108    test_ret += test_xmlGetLineNo();
23109    test_ret += test_xmlGetNoNsProp();
23110    test_ret += test_xmlGetNodePath();
23111    test_ret += test_xmlGetNsList();
23112    test_ret += test_xmlGetNsProp();
23113    test_ret += test_xmlGetProp();
23114    test_ret += test_xmlHasNsProp();
23115    test_ret += test_xmlHasProp();
23116    test_ret += test_xmlIsBlankNode();
23117    test_ret += test_xmlIsXHTML();
23118    test_ret += test_xmlNewCDataBlock();
23119    test_ret += test_xmlNewCharRef();
23120    test_ret += test_xmlNewChild();
23121    test_ret += test_xmlNewComment();
23122    test_ret += test_xmlNewDoc();
23123    test_ret += test_xmlNewDocComment();
23124    test_ret += test_xmlNewDocFragment();
23125    test_ret += test_xmlNewDocNode();
23126    test_ret += test_xmlNewDocNodeEatName();
23127    test_ret += test_xmlNewDocPI();
23128    test_ret += test_xmlNewDocProp();
23129    test_ret += test_xmlNewDocRawNode();
23130    test_ret += test_xmlNewDocText();
23131    test_ret += test_xmlNewDocTextLen();
23132    test_ret += test_xmlNewDtd();
23133    test_ret += test_xmlNewNode();
23134    test_ret += test_xmlNewNodeEatName();
23135    test_ret += test_xmlNewNs();
23136    test_ret += test_xmlNewNsProp();
23137    test_ret += test_xmlNewNsPropEatName();
23138    test_ret += test_xmlNewPI();
23139    test_ret += test_xmlNewProp();
23140    test_ret += test_xmlNewReference();
23141    test_ret += test_xmlNewText();
23142    test_ret += test_xmlNewTextChild();
23143    test_ret += test_xmlNewTextLen();
23144    test_ret += test_xmlNodeAddContent();
23145    test_ret += test_xmlNodeAddContentLen();
23146    test_ret += test_xmlNodeBufGetContent();
23147    test_ret += test_xmlNodeDump();
23148    test_ret += test_xmlNodeDumpOutput();
23149    test_ret += test_xmlNodeGetBase();
23150    test_ret += test_xmlNodeGetContent();
23151    test_ret += test_xmlNodeGetLang();
23152    test_ret += test_xmlNodeGetSpacePreserve();
23153    test_ret += test_xmlNodeIsText();
23154    test_ret += test_xmlNodeListGetRawString();
23155    test_ret += test_xmlNodeListGetString();
23156    test_ret += test_xmlNodeSetBase();
23157    test_ret += test_xmlNodeSetContent();
23158    test_ret += test_xmlNodeSetContentLen();
23159    test_ret += test_xmlNodeSetLang();
23160    test_ret += test_xmlNodeSetName();
23161    test_ret += test_xmlNodeSetSpacePreserve();
23162    test_ret += test_xmlReconciliateNs();
23163    test_ret += test_xmlRemoveProp();
23164    test_ret += test_xmlReplaceNode();
23165    test_ret += test_xmlSaveFile();
23166    test_ret += test_xmlSaveFileEnc();
23167    test_ret += test_xmlSaveFileTo();
23168    test_ret += test_xmlSaveFormatFile();
23169    test_ret += test_xmlSaveFormatFileEnc();
23170    test_ret += test_xmlSaveFormatFileTo();
23171    test_ret += test_xmlSearchNs();
23172    test_ret += test_xmlSearchNsByHref();
23173    test_ret += test_xmlSetBufferAllocationScheme();
23174    test_ret += test_xmlSetCompressMode();
23175    test_ret += test_xmlSetDocCompressMode();
23176    test_ret += test_xmlSetNs();
23177    test_ret += test_xmlSetNsProp();
23178    test_ret += test_xmlSetProp();
23179    test_ret += test_xmlSplitQName2();
23180    test_ret += test_xmlSplitQName3();
23181    test_ret += test_xmlStringGetNodeList();
23182    test_ret += test_xmlStringLenGetNodeList();
23183    test_ret += test_xmlTextConcat();
23184    test_ret += test_xmlTextMerge();
23185    test_ret += test_xmlUnsetNsProp();
23186    test_ret += test_xmlUnsetProp();
23187    test_ret += test_xmlValidateNCName();
23188    test_ret += test_xmlValidateNMToken();
23189    test_ret += test_xmlValidateName();
23190    test_ret += test_xmlValidateQName();
23191
23192    if (test_ret != 0)
23193	printf("Module tree: %d errors\n", test_ret);
23194    return(test_ret);
23195}
23196
23197static int
23198test_xmlBuildRelativeURI(void) {
23199    int test_ret = 0;
23200
23201    int mem_base;
23202    xmlChar * ret_val;
23203    xmlChar * URI; /* the URI reference under consideration */
23204    int n_URI;
23205    xmlChar * base; /* the base value */
23206    int n_base;
23207
23208    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23209    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23210        mem_base = xmlMemBlocks();
23211        URI = gen_const_xmlChar_ptr(n_URI, 0);
23212        base = gen_const_xmlChar_ptr(n_base, 1);
23213
23214        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
23215        desret_xmlChar_ptr(ret_val);
23216        call_tests++;
23217        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23218        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23219        xmlResetLastError();
23220        if (mem_base != xmlMemBlocks()) {
23221            printf("Leak of %d blocks found in xmlBuildRelativeURI",
23222	           xmlMemBlocks() - mem_base);
23223	    test_ret++;
23224            printf(" %d", n_URI);
23225            printf(" %d", n_base);
23226            printf("\n");
23227        }
23228    }
23229    }
23230    function_tests++;
23231
23232    return(test_ret);
23233}
23234
23235
23236static int
23237test_xmlBuildURI(void) {
23238    int test_ret = 0;
23239
23240    int mem_base;
23241    xmlChar * ret_val;
23242    xmlChar * URI; /* the URI instance found in the document */
23243    int n_URI;
23244    xmlChar * base; /* the base value */
23245    int n_base;
23246
23247    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23248    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23249        mem_base = xmlMemBlocks();
23250        URI = gen_const_xmlChar_ptr(n_URI, 0);
23251        base = gen_const_xmlChar_ptr(n_base, 1);
23252
23253        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
23254        desret_xmlChar_ptr(ret_val);
23255        call_tests++;
23256        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23257        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23258        xmlResetLastError();
23259        if (mem_base != xmlMemBlocks()) {
23260            printf("Leak of %d blocks found in xmlBuildURI",
23261	           xmlMemBlocks() - mem_base);
23262	    test_ret++;
23263            printf(" %d", n_URI);
23264            printf(" %d", n_base);
23265            printf("\n");
23266        }
23267    }
23268    }
23269    function_tests++;
23270
23271    return(test_ret);
23272}
23273
23274
23275static int
23276test_xmlCanonicPath(void) {
23277    int test_ret = 0;
23278
23279    int mem_base;
23280    xmlChar * ret_val;
23281    xmlChar * path; /* the resource locator in a filesystem notation */
23282    int n_path;
23283
23284    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
23285        mem_base = xmlMemBlocks();
23286        path = gen_const_xmlChar_ptr(n_path, 0);
23287
23288        ret_val = xmlCanonicPath((const xmlChar *)path);
23289        desret_xmlChar_ptr(ret_val);
23290        call_tests++;
23291        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
23292        xmlResetLastError();
23293        if (mem_base != xmlMemBlocks()) {
23294            printf("Leak of %d blocks found in xmlCanonicPath",
23295	           xmlMemBlocks() - mem_base);
23296	    test_ret++;
23297            printf(" %d", n_path);
23298            printf("\n");
23299        }
23300    }
23301    function_tests++;
23302
23303    return(test_ret);
23304}
23305
23306
23307static int
23308test_xmlCreateURI(void) {
23309    int test_ret = 0;
23310
23311
23312    /* missing type support */
23313    return(test_ret);
23314}
23315
23316
23317static int
23318test_xmlNormalizeURIPath(void) {
23319    int test_ret = 0;
23320
23321    int mem_base;
23322    int ret_val;
23323    char * path; /* pointer to the path string */
23324    int n_path;
23325
23326    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
23327        mem_base = xmlMemBlocks();
23328        path = gen_char_ptr(n_path, 0);
23329
23330        ret_val = xmlNormalizeURIPath(path);
23331        desret_int(ret_val);
23332        call_tests++;
23333        des_char_ptr(n_path, path, 0);
23334        xmlResetLastError();
23335        if (mem_base != xmlMemBlocks()) {
23336            printf("Leak of %d blocks found in xmlNormalizeURIPath",
23337	           xmlMemBlocks() - mem_base);
23338	    test_ret++;
23339            printf(" %d", n_path);
23340            printf("\n");
23341        }
23342    }
23343    function_tests++;
23344
23345    return(test_ret);
23346}
23347
23348
23349static int
23350test_xmlParseURI(void) {
23351    int test_ret = 0;
23352
23353
23354    /* missing type support */
23355    return(test_ret);
23356}
23357
23358
23359#define gen_nb_xmlURIPtr 1
23360static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23361    return(NULL);
23362}
23363static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23364}
23365
23366static int
23367test_xmlParseURIReference(void) {
23368    int test_ret = 0;
23369
23370    int mem_base;
23371    int ret_val;
23372    xmlURIPtr uri; /* pointer to an URI structure */
23373    int n_uri;
23374    char * str; /* the string to analyze */
23375    int n_str;
23376
23377    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23378    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
23379        mem_base = xmlMemBlocks();
23380        uri = gen_xmlURIPtr(n_uri, 0);
23381        str = gen_const_char_ptr(n_str, 1);
23382
23383        ret_val = xmlParseURIReference(uri, (const char *)str);
23384        desret_int(ret_val);
23385        call_tests++;
23386        des_xmlURIPtr(n_uri, uri, 0);
23387        des_const_char_ptr(n_str, (const char *)str, 1);
23388        xmlResetLastError();
23389        if (mem_base != xmlMemBlocks()) {
23390            printf("Leak of %d blocks found in xmlParseURIReference",
23391	           xmlMemBlocks() - mem_base);
23392	    test_ret++;
23393            printf(" %d", n_uri);
23394            printf(" %d", n_str);
23395            printf("\n");
23396        }
23397    }
23398    }
23399    function_tests++;
23400
23401    return(test_ret);
23402}
23403
23404
23405static int
23406test_xmlPrintURI(void) {
23407    int test_ret = 0;
23408
23409    int mem_base;
23410    FILE * stream; /* a FILE* for the output */
23411    int n_stream;
23412    xmlURIPtr uri; /* pointer to an xmlURI */
23413    int n_uri;
23414
23415    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
23416    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23417        mem_base = xmlMemBlocks();
23418        stream = gen_FILE_ptr(n_stream, 0);
23419        uri = gen_xmlURIPtr(n_uri, 1);
23420
23421        xmlPrintURI(stream, uri);
23422        call_tests++;
23423        des_FILE_ptr(n_stream, stream, 0);
23424        des_xmlURIPtr(n_uri, uri, 1);
23425        xmlResetLastError();
23426        if (mem_base != xmlMemBlocks()) {
23427            printf("Leak of %d blocks found in xmlPrintURI",
23428	           xmlMemBlocks() - mem_base);
23429	    test_ret++;
23430            printf(" %d", n_stream);
23431            printf(" %d", n_uri);
23432            printf("\n");
23433        }
23434    }
23435    }
23436    function_tests++;
23437
23438    return(test_ret);
23439}
23440
23441
23442static int
23443test_xmlSaveUri(void) {
23444    int test_ret = 0;
23445
23446    int mem_base;
23447    xmlChar * ret_val;
23448    xmlURIPtr uri; /* pointer to an xmlURI */
23449    int n_uri;
23450
23451    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23452        mem_base = xmlMemBlocks();
23453        uri = gen_xmlURIPtr(n_uri, 0);
23454
23455        ret_val = xmlSaveUri(uri);
23456        desret_xmlChar_ptr(ret_val);
23457        call_tests++;
23458        des_xmlURIPtr(n_uri, uri, 0);
23459        xmlResetLastError();
23460        if (mem_base != xmlMemBlocks()) {
23461            printf("Leak of %d blocks found in xmlSaveUri",
23462	           xmlMemBlocks() - mem_base);
23463	    test_ret++;
23464            printf(" %d", n_uri);
23465            printf("\n");
23466        }
23467    }
23468    function_tests++;
23469
23470    return(test_ret);
23471}
23472
23473
23474static int
23475test_xmlURIEscape(void) {
23476    int test_ret = 0;
23477
23478    int mem_base;
23479    xmlChar * ret_val;
23480    xmlChar * str; /* the string of the URI to escape */
23481    int n_str;
23482
23483    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23484        mem_base = xmlMemBlocks();
23485        str = gen_const_xmlChar_ptr(n_str, 0);
23486
23487        ret_val = xmlURIEscape((const xmlChar *)str);
23488        desret_xmlChar_ptr(ret_val);
23489        call_tests++;
23490        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23491        xmlResetLastError();
23492        if (mem_base != xmlMemBlocks()) {
23493            printf("Leak of %d blocks found in xmlURIEscape",
23494	           xmlMemBlocks() - mem_base);
23495	    test_ret++;
23496            printf(" %d", n_str);
23497            printf("\n");
23498        }
23499    }
23500    function_tests++;
23501
23502    return(test_ret);
23503}
23504
23505
23506static int
23507test_xmlURIEscapeStr(void) {
23508    int test_ret = 0;
23509
23510    int mem_base;
23511    xmlChar * ret_val;
23512    xmlChar * str; /* string to escape */
23513    int n_str;
23514    xmlChar * list; /* exception list string of chars not to escape */
23515    int n_list;
23516
23517    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23518    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
23519        mem_base = xmlMemBlocks();
23520        str = gen_const_xmlChar_ptr(n_str, 0);
23521        list = gen_const_xmlChar_ptr(n_list, 1);
23522
23523        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
23524        desret_xmlChar_ptr(ret_val);
23525        call_tests++;
23526        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23527        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
23528        xmlResetLastError();
23529        if (mem_base != xmlMemBlocks()) {
23530            printf("Leak of %d blocks found in xmlURIEscapeStr",
23531	           xmlMemBlocks() - mem_base);
23532	    test_ret++;
23533            printf(" %d", n_str);
23534            printf(" %d", n_list);
23535            printf("\n");
23536        }
23537    }
23538    }
23539    function_tests++;
23540
23541    return(test_ret);
23542}
23543
23544
23545static int
23546test_xmlURIUnescapeString(void) {
23547    int test_ret = 0;
23548
23549
23550    /* missing type support */
23551    return(test_ret);
23552}
23553
23554static int
23555test_uri(void) {
23556    int test_ret = 0;
23557
23558    if (quiet == 0) printf("Testing uri : 9 of 13 functions ...\n");
23559    test_ret += test_xmlBuildRelativeURI();
23560    test_ret += test_xmlBuildURI();
23561    test_ret += test_xmlCanonicPath();
23562    test_ret += test_xmlCreateURI();
23563    test_ret += test_xmlNormalizeURIPath();
23564    test_ret += test_xmlParseURI();
23565    test_ret += test_xmlParseURIReference();
23566    test_ret += test_xmlPrintURI();
23567    test_ret += test_xmlSaveUri();
23568    test_ret += test_xmlURIEscape();
23569    test_ret += test_xmlURIEscapeStr();
23570    test_ret += test_xmlURIUnescapeString();
23571
23572    if (test_ret != 0)
23573	printf("Module uri: %d errors\n", test_ret);
23574    return(test_ret);
23575}
23576
23577static int
23578test_xmlAddAttributeDecl(void) {
23579    int test_ret = 0;
23580
23581    int mem_base;
23582    xmlAttributePtr ret_val;
23583    xmlValidCtxtPtr ctxt; /* the validation context */
23584    int n_ctxt;
23585    xmlDtdPtr dtd; /* pointer to the DTD */
23586    int n_dtd;
23587    xmlChar * elem; /* the element name */
23588    int n_elem;
23589    xmlChar * name; /* the attribute name */
23590    int n_name;
23591    xmlChar * ns; /* the attribute namespace prefix */
23592    int n_ns;
23593    xmlAttributeType type; /* the attribute type */
23594    int n_type;
23595    xmlAttributeDefault def; /* the attribute default type */
23596    int n_def;
23597    xmlChar * defaultValue; /* the attribute default value */
23598    int n_defaultValue;
23599    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
23600    int n_tree;
23601
23602    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23603    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23604    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23605    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23606    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
23607    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
23608    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
23609    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
23610    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
23611        mem_base = xmlMemBlocks();
23612        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23613        dtd = gen_xmlDtdPtr(n_dtd, 1);
23614        elem = gen_const_xmlChar_ptr(n_elem, 2);
23615        name = gen_const_xmlChar_ptr(n_name, 3);
23616        ns = gen_const_xmlChar_ptr(n_ns, 4);
23617        type = gen_xmlAttributeType(n_type, 5);
23618        def = gen_xmlAttributeDefault(n_def, 6);
23619        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
23620        tree = gen_xmlEnumerationPtr(n_tree, 8);
23621
23622        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
23623        desret_xmlAttributePtr(ret_val);
23624        call_tests++;
23625        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23626        des_xmlDtdPtr(n_dtd, dtd, 1);
23627        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
23628        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
23629        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
23630        des_xmlAttributeType(n_type, type, 5);
23631        des_xmlAttributeDefault(n_def, def, 6);
23632        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
23633        des_xmlEnumerationPtr(n_tree, tree, 8);
23634        xmlResetLastError();
23635        if (mem_base != xmlMemBlocks()) {
23636            printf("Leak of %d blocks found in xmlAddAttributeDecl",
23637	           xmlMemBlocks() - mem_base);
23638	    test_ret++;
23639            printf(" %d", n_ctxt);
23640            printf(" %d", n_dtd);
23641            printf(" %d", n_elem);
23642            printf(" %d", n_name);
23643            printf(" %d", n_ns);
23644            printf(" %d", n_type);
23645            printf(" %d", n_def);
23646            printf(" %d", n_defaultValue);
23647            printf(" %d", n_tree);
23648            printf("\n");
23649        }
23650    }
23651    }
23652    }
23653    }
23654    }
23655    }
23656    }
23657    }
23658    }
23659    function_tests++;
23660
23661    return(test_ret);
23662}
23663
23664
23665static int
23666test_xmlAddElementDecl(void) {
23667    int test_ret = 0;
23668
23669    int mem_base;
23670    xmlElementPtr ret_val;
23671    xmlValidCtxtPtr ctxt; /* the validation context */
23672    int n_ctxt;
23673    xmlDtdPtr dtd; /* pointer to the DTD */
23674    int n_dtd;
23675    xmlChar * name; /* the entity name */
23676    int n_name;
23677    xmlElementTypeVal type; /* the element type */
23678    int n_type;
23679    xmlElementContentPtr content; /* the element content tree or NULL */
23680    int n_content;
23681
23682    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23683    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23684    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23685    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
23686    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
23687        mem_base = xmlMemBlocks();
23688        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23689        dtd = gen_xmlDtdPtr(n_dtd, 1);
23690        name = gen_const_xmlChar_ptr(n_name, 2);
23691        type = gen_xmlElementTypeVal(n_type, 3);
23692        content = gen_xmlElementContentPtr(n_content, 4);
23693
23694        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
23695        desret_xmlElementPtr(ret_val);
23696        call_tests++;
23697        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23698        des_xmlDtdPtr(n_dtd, dtd, 1);
23699        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23700        des_xmlElementTypeVal(n_type, type, 3);
23701        des_xmlElementContentPtr(n_content, content, 4);
23702        xmlResetLastError();
23703        if (mem_base != xmlMemBlocks()) {
23704            printf("Leak of %d blocks found in xmlAddElementDecl",
23705	           xmlMemBlocks() - mem_base);
23706	    test_ret++;
23707            printf(" %d", n_ctxt);
23708            printf(" %d", n_dtd);
23709            printf(" %d", n_name);
23710            printf(" %d", n_type);
23711            printf(" %d", n_content);
23712            printf("\n");
23713        }
23714    }
23715    }
23716    }
23717    }
23718    }
23719    function_tests++;
23720
23721    return(test_ret);
23722}
23723
23724
23725static int
23726test_xmlAddID(void) {
23727    int test_ret = 0;
23728
23729
23730    /* missing type support */
23731    return(test_ret);
23732}
23733
23734
23735static int
23736test_xmlAddNotationDecl(void) {
23737    int test_ret = 0;
23738
23739
23740    /* missing type support */
23741    return(test_ret);
23742}
23743
23744
23745static int
23746test_xmlAddRef(void) {
23747    int test_ret = 0;
23748
23749
23750    /* missing type support */
23751    return(test_ret);
23752}
23753
23754
23755#define gen_nb_xmlAttributeTablePtr 1
23756static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23757    return(NULL);
23758}
23759static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23760}
23761
23762static int
23763test_xmlCopyAttributeTable(void) {
23764    int test_ret = 0;
23765
23766
23767    /* missing type support */
23768    return(test_ret);
23769}
23770
23771
23772static int
23773test_xmlCopyDocElementContent(void) {
23774    int test_ret = 0;
23775
23776    int mem_base;
23777    xmlElementContentPtr ret_val;
23778    xmlDocPtr doc; /* the document owning the element declaration */
23779    int n_doc;
23780    xmlElementContentPtr cur; /* An element content pointer. */
23781    int n_cur;
23782
23783    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23784    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
23785        mem_base = xmlMemBlocks();
23786        doc = gen_xmlDocPtr(n_doc, 0);
23787        cur = gen_xmlElementContentPtr(n_cur, 1);
23788
23789        ret_val = xmlCopyDocElementContent(doc, cur);
23790        desret_xmlElementContentPtr(ret_val);
23791        call_tests++;
23792        des_xmlDocPtr(n_doc, doc, 0);
23793        des_xmlElementContentPtr(n_cur, cur, 1);
23794        xmlResetLastError();
23795        if (mem_base != xmlMemBlocks()) {
23796            printf("Leak of %d blocks found in xmlCopyDocElementContent",
23797	           xmlMemBlocks() - mem_base);
23798	    test_ret++;
23799            printf(" %d", n_doc);
23800            printf(" %d", n_cur);
23801            printf("\n");
23802        }
23803    }
23804    }
23805    function_tests++;
23806
23807    return(test_ret);
23808}
23809
23810
23811static int
23812test_xmlCopyElementContent(void) {
23813    int test_ret = 0;
23814
23815    int mem_base;
23816    xmlElementContentPtr ret_val;
23817    xmlElementContentPtr cur; /* An element content pointer. */
23818    int n_cur;
23819
23820    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
23821        mem_base = xmlMemBlocks();
23822        cur = gen_xmlElementContentPtr(n_cur, 0);
23823
23824        ret_val = xmlCopyElementContent(cur);
23825        desret_xmlElementContentPtr(ret_val);
23826        call_tests++;
23827        des_xmlElementContentPtr(n_cur, cur, 0);
23828        xmlResetLastError();
23829        if (mem_base != xmlMemBlocks()) {
23830            printf("Leak of %d blocks found in xmlCopyElementContent",
23831	           xmlMemBlocks() - mem_base);
23832	    test_ret++;
23833            printf(" %d", n_cur);
23834            printf("\n");
23835        }
23836    }
23837    function_tests++;
23838
23839    return(test_ret);
23840}
23841
23842
23843#define gen_nb_xmlElementTablePtr 1
23844static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23845    return(NULL);
23846}
23847static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23848}
23849
23850static int
23851test_xmlCopyElementTable(void) {
23852    int test_ret = 0;
23853
23854
23855    /* missing type support */
23856    return(test_ret);
23857}
23858
23859
23860static int
23861test_xmlCopyEnumeration(void) {
23862    int test_ret = 0;
23863
23864
23865    /* missing type support */
23866    return(test_ret);
23867}
23868
23869
23870#define gen_nb_xmlNotationTablePtr 1
23871static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23872    return(NULL);
23873}
23874static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23875}
23876
23877static int
23878test_xmlCopyNotationTable(void) {
23879    int test_ret = 0;
23880
23881
23882    /* missing type support */
23883    return(test_ret);
23884}
23885
23886
23887static int
23888test_xmlCreateEnumeration(void) {
23889    int test_ret = 0;
23890
23891
23892    /* missing type support */
23893    return(test_ret);
23894}
23895
23896
23897#define gen_nb_xmlAttributePtr 1
23898static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23899    return(NULL);
23900}
23901static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23902}
23903
23904static int
23905test_xmlDumpAttributeDecl(void) {
23906    int test_ret = 0;
23907
23908#if defined(LIBXML_OUTPUT_ENABLED)
23909    int mem_base;
23910    xmlBufferPtr buf; /* the XML buffer output */
23911    int n_buf;
23912    xmlAttributePtr attr; /* An attribute declaration */
23913    int n_attr;
23914
23915    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23916    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
23917        mem_base = xmlMemBlocks();
23918        buf = gen_xmlBufferPtr(n_buf, 0);
23919        attr = gen_xmlAttributePtr(n_attr, 1);
23920
23921        xmlDumpAttributeDecl(buf, attr);
23922        call_tests++;
23923        des_xmlBufferPtr(n_buf, buf, 0);
23924        des_xmlAttributePtr(n_attr, attr, 1);
23925        xmlResetLastError();
23926        if (mem_base != xmlMemBlocks()) {
23927            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
23928	           xmlMemBlocks() - mem_base);
23929	    test_ret++;
23930            printf(" %d", n_buf);
23931            printf(" %d", n_attr);
23932            printf("\n");
23933        }
23934    }
23935    }
23936    function_tests++;
23937#endif
23938
23939    return(test_ret);
23940}
23941
23942
23943static int
23944test_xmlDumpAttributeTable(void) {
23945    int test_ret = 0;
23946
23947#if defined(LIBXML_OUTPUT_ENABLED)
23948    int mem_base;
23949    xmlBufferPtr buf; /* the XML buffer output */
23950    int n_buf;
23951    xmlAttributeTablePtr table; /* An attribute table */
23952    int n_table;
23953
23954    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23955    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
23956        mem_base = xmlMemBlocks();
23957        buf = gen_xmlBufferPtr(n_buf, 0);
23958        table = gen_xmlAttributeTablePtr(n_table, 1);
23959
23960        xmlDumpAttributeTable(buf, table);
23961        call_tests++;
23962        des_xmlBufferPtr(n_buf, buf, 0);
23963        des_xmlAttributeTablePtr(n_table, table, 1);
23964        xmlResetLastError();
23965        if (mem_base != xmlMemBlocks()) {
23966            printf("Leak of %d blocks found in xmlDumpAttributeTable",
23967	           xmlMemBlocks() - mem_base);
23968	    test_ret++;
23969            printf(" %d", n_buf);
23970            printf(" %d", n_table);
23971            printf("\n");
23972        }
23973    }
23974    }
23975    function_tests++;
23976#endif
23977
23978    return(test_ret);
23979}
23980
23981
23982#define gen_nb_xmlElementPtr 1
23983static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23984    return(NULL);
23985}
23986static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23987}
23988
23989static int
23990test_xmlDumpElementDecl(void) {
23991    int test_ret = 0;
23992
23993#if defined(LIBXML_OUTPUT_ENABLED)
23994    int mem_base;
23995    xmlBufferPtr buf; /* the XML buffer output */
23996    int n_buf;
23997    xmlElementPtr elem; /* An element table */
23998    int n_elem;
23999
24000    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24001    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24002        mem_base = xmlMemBlocks();
24003        buf = gen_xmlBufferPtr(n_buf, 0);
24004        elem = gen_xmlElementPtr(n_elem, 1);
24005
24006        xmlDumpElementDecl(buf, elem);
24007        call_tests++;
24008        des_xmlBufferPtr(n_buf, buf, 0);
24009        des_xmlElementPtr(n_elem, elem, 1);
24010        xmlResetLastError();
24011        if (mem_base != xmlMemBlocks()) {
24012            printf("Leak of %d blocks found in xmlDumpElementDecl",
24013	           xmlMemBlocks() - mem_base);
24014	    test_ret++;
24015            printf(" %d", n_buf);
24016            printf(" %d", n_elem);
24017            printf("\n");
24018        }
24019    }
24020    }
24021    function_tests++;
24022#endif
24023
24024    return(test_ret);
24025}
24026
24027
24028static int
24029test_xmlDumpElementTable(void) {
24030    int test_ret = 0;
24031
24032#if defined(LIBXML_OUTPUT_ENABLED)
24033    int mem_base;
24034    xmlBufferPtr buf; /* the XML buffer output */
24035    int n_buf;
24036    xmlElementTablePtr table; /* An element table */
24037    int n_table;
24038
24039    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24040    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24041        mem_base = xmlMemBlocks();
24042        buf = gen_xmlBufferPtr(n_buf, 0);
24043        table = gen_xmlElementTablePtr(n_table, 1);
24044
24045        xmlDumpElementTable(buf, table);
24046        call_tests++;
24047        des_xmlBufferPtr(n_buf, buf, 0);
24048        des_xmlElementTablePtr(n_table, table, 1);
24049        xmlResetLastError();
24050        if (mem_base != xmlMemBlocks()) {
24051            printf("Leak of %d blocks found in xmlDumpElementTable",
24052	           xmlMemBlocks() - mem_base);
24053	    test_ret++;
24054            printf(" %d", n_buf);
24055            printf(" %d", n_table);
24056            printf("\n");
24057        }
24058    }
24059    }
24060    function_tests++;
24061#endif
24062
24063    return(test_ret);
24064}
24065
24066
24067#define gen_nb_xmlNotationPtr 1
24068static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24069    return(NULL);
24070}
24071static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24072}
24073
24074static int
24075test_xmlDumpNotationDecl(void) {
24076    int test_ret = 0;
24077
24078#if defined(LIBXML_OUTPUT_ENABLED)
24079    int mem_base;
24080    xmlBufferPtr buf; /* the XML buffer output */
24081    int n_buf;
24082    xmlNotationPtr nota; /* A notation declaration */
24083    int n_nota;
24084
24085    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24086    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24087        mem_base = xmlMemBlocks();
24088        buf = gen_xmlBufferPtr(n_buf, 0);
24089        nota = gen_xmlNotationPtr(n_nota, 1);
24090
24091        xmlDumpNotationDecl(buf, nota);
24092        call_tests++;
24093        des_xmlBufferPtr(n_buf, buf, 0);
24094        des_xmlNotationPtr(n_nota, nota, 1);
24095        xmlResetLastError();
24096        if (mem_base != xmlMemBlocks()) {
24097            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24098	           xmlMemBlocks() - mem_base);
24099	    test_ret++;
24100            printf(" %d", n_buf);
24101            printf(" %d", n_nota);
24102            printf("\n");
24103        }
24104    }
24105    }
24106    function_tests++;
24107#endif
24108
24109    return(test_ret);
24110}
24111
24112
24113static int
24114test_xmlDumpNotationTable(void) {
24115    int test_ret = 0;
24116
24117#if defined(LIBXML_OUTPUT_ENABLED)
24118    int mem_base;
24119    xmlBufferPtr buf; /* the XML buffer output */
24120    int n_buf;
24121    xmlNotationTablePtr table; /* A notation table */
24122    int n_table;
24123
24124    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24125    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24126        mem_base = xmlMemBlocks();
24127        buf = gen_xmlBufferPtr(n_buf, 0);
24128        table = gen_xmlNotationTablePtr(n_table, 1);
24129
24130        xmlDumpNotationTable(buf, table);
24131        call_tests++;
24132        des_xmlBufferPtr(n_buf, buf, 0);
24133        des_xmlNotationTablePtr(n_table, table, 1);
24134        xmlResetLastError();
24135        if (mem_base != xmlMemBlocks()) {
24136            printf("Leak of %d blocks found in xmlDumpNotationTable",
24137	           xmlMemBlocks() - mem_base);
24138	    test_ret++;
24139            printf(" %d", n_buf);
24140            printf(" %d", n_table);
24141            printf("\n");
24142        }
24143    }
24144    }
24145    function_tests++;
24146#endif
24147
24148    return(test_ret);
24149}
24150
24151
24152static int
24153test_xmlGetDtdAttrDesc(void) {
24154    int test_ret = 0;
24155
24156    int mem_base;
24157    xmlAttributePtr ret_val;
24158    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24159    int n_dtd;
24160    xmlChar * elem; /* the element name */
24161    int n_elem;
24162    xmlChar * name; /* the attribute name */
24163    int n_name;
24164
24165    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24166    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24167    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24168        mem_base = xmlMemBlocks();
24169        dtd = gen_xmlDtdPtr(n_dtd, 0);
24170        elem = gen_const_xmlChar_ptr(n_elem, 1);
24171        name = gen_const_xmlChar_ptr(n_name, 2);
24172
24173        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
24174        desret_xmlAttributePtr(ret_val);
24175        call_tests++;
24176        des_xmlDtdPtr(n_dtd, dtd, 0);
24177        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24178        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24179        xmlResetLastError();
24180        if (mem_base != xmlMemBlocks()) {
24181            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
24182	           xmlMemBlocks() - mem_base);
24183	    test_ret++;
24184            printf(" %d", n_dtd);
24185            printf(" %d", n_elem);
24186            printf(" %d", n_name);
24187            printf("\n");
24188        }
24189    }
24190    }
24191    }
24192    function_tests++;
24193
24194    return(test_ret);
24195}
24196
24197
24198static int
24199test_xmlGetDtdElementDesc(void) {
24200    int test_ret = 0;
24201
24202    int mem_base;
24203    xmlElementPtr ret_val;
24204    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24205    int n_dtd;
24206    xmlChar * name; /* the element name */
24207    int n_name;
24208
24209    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24210    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24211        mem_base = xmlMemBlocks();
24212        dtd = gen_xmlDtdPtr(n_dtd, 0);
24213        name = gen_const_xmlChar_ptr(n_name, 1);
24214
24215        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
24216        desret_xmlElementPtr(ret_val);
24217        call_tests++;
24218        des_xmlDtdPtr(n_dtd, dtd, 0);
24219        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24220        xmlResetLastError();
24221        if (mem_base != xmlMemBlocks()) {
24222            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
24223	           xmlMemBlocks() - mem_base);
24224	    test_ret++;
24225            printf(" %d", n_dtd);
24226            printf(" %d", n_name);
24227            printf("\n");
24228        }
24229    }
24230    }
24231    function_tests++;
24232
24233    return(test_ret);
24234}
24235
24236
24237static int
24238test_xmlGetDtdNotationDesc(void) {
24239    int test_ret = 0;
24240
24241
24242    /* missing type support */
24243    return(test_ret);
24244}
24245
24246
24247static int
24248test_xmlGetDtdQAttrDesc(void) {
24249    int test_ret = 0;
24250
24251    int mem_base;
24252    xmlAttributePtr ret_val;
24253    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24254    int n_dtd;
24255    xmlChar * elem; /* the element name */
24256    int n_elem;
24257    xmlChar * name; /* the attribute name */
24258    int n_name;
24259    xmlChar * prefix; /* the attribute namespace prefix */
24260    int n_prefix;
24261
24262    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24263    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24264    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24265    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24266        mem_base = xmlMemBlocks();
24267        dtd = gen_xmlDtdPtr(n_dtd, 0);
24268        elem = gen_const_xmlChar_ptr(n_elem, 1);
24269        name = gen_const_xmlChar_ptr(n_name, 2);
24270        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
24271
24272        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
24273        desret_xmlAttributePtr(ret_val);
24274        call_tests++;
24275        des_xmlDtdPtr(n_dtd, dtd, 0);
24276        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24277        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24278        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
24279        xmlResetLastError();
24280        if (mem_base != xmlMemBlocks()) {
24281            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
24282	           xmlMemBlocks() - mem_base);
24283	    test_ret++;
24284            printf(" %d", n_dtd);
24285            printf(" %d", n_elem);
24286            printf(" %d", n_name);
24287            printf(" %d", n_prefix);
24288            printf("\n");
24289        }
24290    }
24291    }
24292    }
24293    }
24294    function_tests++;
24295
24296    return(test_ret);
24297}
24298
24299
24300static int
24301test_xmlGetDtdQElementDesc(void) {
24302    int test_ret = 0;
24303
24304    int mem_base;
24305    xmlElementPtr ret_val;
24306    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24307    int n_dtd;
24308    xmlChar * name; /* the element name */
24309    int n_name;
24310    xmlChar * prefix; /* the element namespace prefix */
24311    int n_prefix;
24312
24313    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24314    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24315    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24316        mem_base = xmlMemBlocks();
24317        dtd = gen_xmlDtdPtr(n_dtd, 0);
24318        name = gen_const_xmlChar_ptr(n_name, 1);
24319        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
24320
24321        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
24322        desret_xmlElementPtr(ret_val);
24323        call_tests++;
24324        des_xmlDtdPtr(n_dtd, dtd, 0);
24325        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24326        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
24327        xmlResetLastError();
24328        if (mem_base != xmlMemBlocks()) {
24329            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
24330	           xmlMemBlocks() - mem_base);
24331	    test_ret++;
24332            printf(" %d", n_dtd);
24333            printf(" %d", n_name);
24334            printf(" %d", n_prefix);
24335            printf("\n");
24336        }
24337    }
24338    }
24339    }
24340    function_tests++;
24341
24342    return(test_ret);
24343}
24344
24345
24346static int
24347test_xmlGetID(void) {
24348    int test_ret = 0;
24349
24350    int mem_base;
24351    xmlAttrPtr ret_val;
24352    xmlDocPtr doc; /* pointer to the document */
24353    int n_doc;
24354    xmlChar * ID; /* the ID value */
24355    int n_ID;
24356
24357    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24358    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
24359        mem_base = xmlMemBlocks();
24360        doc = gen_xmlDocPtr(n_doc, 0);
24361        ID = gen_const_xmlChar_ptr(n_ID, 1);
24362
24363        ret_val = xmlGetID(doc, (const xmlChar *)ID);
24364        desret_xmlAttrPtr(ret_val);
24365        call_tests++;
24366        des_xmlDocPtr(n_doc, doc, 0);
24367        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
24368        xmlResetLastError();
24369        if (mem_base != xmlMemBlocks()) {
24370            printf("Leak of %d blocks found in xmlGetID",
24371	           xmlMemBlocks() - mem_base);
24372	    test_ret++;
24373            printf(" %d", n_doc);
24374            printf(" %d", n_ID);
24375            printf("\n");
24376        }
24377    }
24378    }
24379    function_tests++;
24380
24381    return(test_ret);
24382}
24383
24384
24385static int
24386test_xmlGetRefs(void) {
24387    int test_ret = 0;
24388
24389
24390    /* missing type support */
24391    return(test_ret);
24392}
24393
24394
24395static int
24396test_xmlIsID(void) {
24397    int test_ret = 0;
24398
24399    int mem_base;
24400    int ret_val;
24401    xmlDocPtr doc; /* the document */
24402    int n_doc;
24403    xmlNodePtr elem; /* the element carrying the attribute */
24404    int n_elem;
24405    xmlAttrPtr attr; /* the attribute */
24406    int n_attr;
24407
24408    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24409    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24410    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24411        mem_base = xmlMemBlocks();
24412        doc = gen_xmlDocPtr(n_doc, 0);
24413        elem = gen_xmlNodePtr(n_elem, 1);
24414        attr = gen_xmlAttrPtr(n_attr, 2);
24415
24416        ret_val = xmlIsID(doc, elem, attr);
24417        desret_int(ret_val);
24418        call_tests++;
24419        des_xmlDocPtr(n_doc, doc, 0);
24420        des_xmlNodePtr(n_elem, elem, 1);
24421        des_xmlAttrPtr(n_attr, attr, 2);
24422        xmlResetLastError();
24423        if (mem_base != xmlMemBlocks()) {
24424            printf("Leak of %d blocks found in xmlIsID",
24425	           xmlMemBlocks() - mem_base);
24426	    test_ret++;
24427            printf(" %d", n_doc);
24428            printf(" %d", n_elem);
24429            printf(" %d", n_attr);
24430            printf("\n");
24431        }
24432    }
24433    }
24434    }
24435    function_tests++;
24436
24437    return(test_ret);
24438}
24439
24440
24441static int
24442test_xmlIsMixedElement(void) {
24443    int test_ret = 0;
24444
24445    int mem_base;
24446    int ret_val;
24447    xmlDocPtr doc; /* the document */
24448    int n_doc;
24449    xmlChar * name; /* the element name */
24450    int n_name;
24451
24452    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24453    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24454        mem_base = xmlMemBlocks();
24455        doc = gen_xmlDocPtr(n_doc, 0);
24456        name = gen_const_xmlChar_ptr(n_name, 1);
24457
24458        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
24459        desret_int(ret_val);
24460        call_tests++;
24461        des_xmlDocPtr(n_doc, doc, 0);
24462        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24463        xmlResetLastError();
24464        if (mem_base != xmlMemBlocks()) {
24465            printf("Leak of %d blocks found in xmlIsMixedElement",
24466	           xmlMemBlocks() - mem_base);
24467	    test_ret++;
24468            printf(" %d", n_doc);
24469            printf(" %d", n_name);
24470            printf("\n");
24471        }
24472    }
24473    }
24474    function_tests++;
24475
24476    return(test_ret);
24477}
24478
24479
24480static int
24481test_xmlIsRef(void) {
24482    int test_ret = 0;
24483
24484    int mem_base;
24485    int ret_val;
24486    xmlDocPtr doc; /* the document */
24487    int n_doc;
24488    xmlNodePtr elem; /* the element carrying the attribute */
24489    int n_elem;
24490    xmlAttrPtr attr; /* the attribute */
24491    int n_attr;
24492
24493    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24494    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24495    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24496        mem_base = xmlMemBlocks();
24497        doc = gen_xmlDocPtr(n_doc, 0);
24498        elem = gen_xmlNodePtr(n_elem, 1);
24499        attr = gen_xmlAttrPtr(n_attr, 2);
24500
24501        ret_val = xmlIsRef(doc, elem, attr);
24502        desret_int(ret_val);
24503        call_tests++;
24504        des_xmlDocPtr(n_doc, doc, 0);
24505        des_xmlNodePtr(n_elem, elem, 1);
24506        des_xmlAttrPtr(n_attr, attr, 2);
24507        xmlResetLastError();
24508        if (mem_base != xmlMemBlocks()) {
24509            printf("Leak of %d blocks found in xmlIsRef",
24510	           xmlMemBlocks() - mem_base);
24511	    test_ret++;
24512            printf(" %d", n_doc);
24513            printf(" %d", n_elem);
24514            printf(" %d", n_attr);
24515            printf("\n");
24516        }
24517    }
24518    }
24519    }
24520    function_tests++;
24521
24522    return(test_ret);
24523}
24524
24525
24526static int
24527test_xmlNewDocElementContent(void) {
24528    int test_ret = 0;
24529
24530    int mem_base;
24531    xmlElementContentPtr ret_val;
24532    xmlDocPtr doc; /* the document */
24533    int n_doc;
24534    xmlChar * name; /* the subelement name or NULL */
24535    int n_name;
24536    xmlElementContentType type; /* the type of element content decl */
24537    int n_type;
24538
24539    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24540    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24541    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24542        mem_base = xmlMemBlocks();
24543        doc = gen_xmlDocPtr(n_doc, 0);
24544        name = gen_const_xmlChar_ptr(n_name, 1);
24545        type = gen_xmlElementContentType(n_type, 2);
24546
24547        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
24548        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
24549        desret_xmlElementContentPtr(ret_val);
24550        call_tests++;
24551        des_xmlDocPtr(n_doc, doc, 0);
24552        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24553        des_xmlElementContentType(n_type, type, 2);
24554        xmlResetLastError();
24555        if (mem_base != xmlMemBlocks()) {
24556            printf("Leak of %d blocks found in xmlNewDocElementContent",
24557	           xmlMemBlocks() - mem_base);
24558	    test_ret++;
24559            printf(" %d", n_doc);
24560            printf(" %d", n_name);
24561            printf(" %d", n_type);
24562            printf("\n");
24563        }
24564    }
24565    }
24566    }
24567    function_tests++;
24568
24569    return(test_ret);
24570}
24571
24572
24573static int
24574test_xmlNewElementContent(void) {
24575    int test_ret = 0;
24576
24577    int mem_base;
24578    xmlElementContentPtr ret_val;
24579    xmlChar * name; /* the subelement name or NULL */
24580    int n_name;
24581    xmlElementContentType type; /* the type of element content decl */
24582    int n_type;
24583
24584    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24585    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24586        mem_base = xmlMemBlocks();
24587        name = gen_const_xmlChar_ptr(n_name, 0);
24588        type = gen_xmlElementContentType(n_type, 1);
24589
24590        ret_val = xmlNewElementContent((const xmlChar *)name, type);
24591        desret_xmlElementContentPtr(ret_val);
24592        call_tests++;
24593        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24594        des_xmlElementContentType(n_type, type, 1);
24595        xmlResetLastError();
24596        if (mem_base != xmlMemBlocks()) {
24597            printf("Leak of %d blocks found in xmlNewElementContent",
24598	           xmlMemBlocks() - mem_base);
24599	    test_ret++;
24600            printf(" %d", n_name);
24601            printf(" %d", n_type);
24602            printf("\n");
24603        }
24604    }
24605    }
24606    function_tests++;
24607
24608    return(test_ret);
24609}
24610
24611
24612static int
24613test_xmlNewValidCtxt(void) {
24614    int test_ret = 0;
24615
24616
24617    /* missing type support */
24618    return(test_ret);
24619}
24620
24621
24622static int
24623test_xmlRemoveID(void) {
24624    int test_ret = 0;
24625
24626    int mem_base;
24627    int ret_val;
24628    xmlDocPtr doc; /* the document */
24629    int n_doc;
24630    xmlAttrPtr attr; /* the attribute */
24631    int n_attr;
24632
24633    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24634    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24635        mem_base = xmlMemBlocks();
24636        doc = gen_xmlDocPtr(n_doc, 0);
24637        attr = gen_xmlAttrPtr(n_attr, 1);
24638
24639        ret_val = xmlRemoveID(doc, attr);
24640        desret_int(ret_val);
24641        call_tests++;
24642        des_xmlDocPtr(n_doc, doc, 0);
24643        des_xmlAttrPtr(n_attr, attr, 1);
24644        xmlResetLastError();
24645        if (mem_base != xmlMemBlocks()) {
24646            printf("Leak of %d blocks found in xmlRemoveID",
24647	           xmlMemBlocks() - mem_base);
24648	    test_ret++;
24649            printf(" %d", n_doc);
24650            printf(" %d", n_attr);
24651            printf("\n");
24652        }
24653    }
24654    }
24655    function_tests++;
24656
24657    return(test_ret);
24658}
24659
24660
24661static int
24662test_xmlRemoveRef(void) {
24663    int test_ret = 0;
24664
24665    int mem_base;
24666    int ret_val;
24667    xmlDocPtr doc; /* the document */
24668    int n_doc;
24669    xmlAttrPtr attr; /* the attribute */
24670    int n_attr;
24671
24672    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24673    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24674        mem_base = xmlMemBlocks();
24675        doc = gen_xmlDocPtr(n_doc, 0);
24676        attr = gen_xmlAttrPtr(n_attr, 1);
24677
24678        ret_val = xmlRemoveRef(doc, attr);
24679        desret_int(ret_val);
24680        call_tests++;
24681        des_xmlDocPtr(n_doc, doc, 0);
24682        des_xmlAttrPtr(n_attr, attr, 1);
24683        xmlResetLastError();
24684        if (mem_base != xmlMemBlocks()) {
24685            printf("Leak of %d blocks found in xmlRemoveRef",
24686	           xmlMemBlocks() - mem_base);
24687	    test_ret++;
24688            printf(" %d", n_doc);
24689            printf(" %d", n_attr);
24690            printf("\n");
24691        }
24692    }
24693    }
24694    function_tests++;
24695
24696    return(test_ret);
24697}
24698
24699
24700static int
24701test_xmlSnprintfElementContent(void) {
24702    int test_ret = 0;
24703
24704    int mem_base;
24705    char * buf; /* an output buffer */
24706    int n_buf;
24707    int size; /* the buffer size */
24708    int n_size;
24709    xmlElementContentPtr content; /* An element table */
24710    int n_content;
24711    int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24712    int n_glob;
24713
24714    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24715    for (n_size = 0;n_size < gen_nb_int;n_size++) {
24716    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24717    for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24718        mem_base = xmlMemBlocks();
24719        buf = gen_char_ptr(n_buf, 0);
24720        size = gen_int(n_size, 1);
24721        content = gen_xmlElementContentPtr(n_content, 2);
24722        glob = gen_int(n_glob, 3);
24723
24724        xmlSnprintfElementContent(buf, size, content, glob);
24725        call_tests++;
24726        des_char_ptr(n_buf, buf, 0);
24727        des_int(n_size, size, 1);
24728        des_xmlElementContentPtr(n_content, content, 2);
24729        des_int(n_glob, glob, 3);
24730        xmlResetLastError();
24731        if (mem_base != xmlMemBlocks()) {
24732            printf("Leak of %d blocks found in xmlSnprintfElementContent",
24733	           xmlMemBlocks() - mem_base);
24734	    test_ret++;
24735            printf(" %d", n_buf);
24736            printf(" %d", n_size);
24737            printf(" %d", n_content);
24738            printf(" %d", n_glob);
24739            printf("\n");
24740        }
24741    }
24742    }
24743    }
24744    }
24745    function_tests++;
24746
24747    return(test_ret);
24748}
24749
24750
24751static int
24752test_xmlSprintfElementContent(void) {
24753    int test_ret = 0;
24754
24755#if defined(LIBXML_OUTPUT_ENABLED)
24756#ifdef LIBXML_OUTPUT_ENABLED
24757    int mem_base;
24758    char * buf; /* an output buffer */
24759    int n_buf;
24760    xmlElementContentPtr content; /* An element table */
24761    int n_content;
24762    int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24763    int n_glob;
24764
24765    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24766    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24767    for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24768        mem_base = xmlMemBlocks();
24769        buf = gen_char_ptr(n_buf, 0);
24770        content = gen_xmlElementContentPtr(n_content, 1);
24771        glob = gen_int(n_glob, 2);
24772
24773        xmlSprintfElementContent(buf, content, glob);
24774        call_tests++;
24775        des_char_ptr(n_buf, buf, 0);
24776        des_xmlElementContentPtr(n_content, content, 1);
24777        des_int(n_glob, glob, 2);
24778        xmlResetLastError();
24779        if (mem_base != xmlMemBlocks()) {
24780            printf("Leak of %d blocks found in xmlSprintfElementContent",
24781	           xmlMemBlocks() - mem_base);
24782	    test_ret++;
24783            printf(" %d", n_buf);
24784            printf(" %d", n_content);
24785            printf(" %d", n_glob);
24786            printf("\n");
24787        }
24788    }
24789    }
24790    }
24791    function_tests++;
24792#endif
24793#endif
24794
24795    return(test_ret);
24796}
24797
24798
24799static int
24800test_xmlValidBuildContentModel(void) {
24801    int test_ret = 0;
24802
24803#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
24804    int mem_base;
24805    int ret_val;
24806    xmlValidCtxtPtr ctxt; /* a validation context */
24807    int n_ctxt;
24808    xmlElementPtr elem; /* an element declaration node */
24809    int n_elem;
24810
24811    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24812    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24813        mem_base = xmlMemBlocks();
24814        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24815        elem = gen_xmlElementPtr(n_elem, 1);
24816
24817        ret_val = xmlValidBuildContentModel(ctxt, elem);
24818        desret_int(ret_val);
24819        call_tests++;
24820        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24821        des_xmlElementPtr(n_elem, elem, 1);
24822        xmlResetLastError();
24823        if (mem_base != xmlMemBlocks()) {
24824            printf("Leak of %d blocks found in xmlValidBuildContentModel",
24825	           xmlMemBlocks() - mem_base);
24826	    test_ret++;
24827            printf(" %d", n_ctxt);
24828            printf(" %d", n_elem);
24829            printf("\n");
24830        }
24831    }
24832    }
24833    function_tests++;
24834#endif
24835
24836    return(test_ret);
24837}
24838
24839
24840static int
24841test_xmlValidCtxtNormalizeAttributeValue(void) {
24842    int test_ret = 0;
24843
24844#if defined(LIBXML_VALID_ENABLED)
24845    int mem_base;
24846    xmlChar * ret_val;
24847    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
24848    int n_ctxt;
24849    xmlDocPtr doc; /* the document */
24850    int n_doc;
24851    xmlNodePtr elem; /* the parent */
24852    int n_elem;
24853    xmlChar * name; /* the attribute name */
24854    int n_name;
24855    xmlChar * value; /* the attribute value */
24856    int n_value;
24857
24858    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24859    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24860    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24861    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24862    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24863        mem_base = xmlMemBlocks();
24864        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24865        doc = gen_xmlDocPtr(n_doc, 1);
24866        elem = gen_xmlNodePtr(n_elem, 2);
24867        name = gen_const_xmlChar_ptr(n_name, 3);
24868        value = gen_const_xmlChar_ptr(n_value, 4);
24869
24870        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
24871        desret_xmlChar_ptr(ret_val);
24872        call_tests++;
24873        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24874        des_xmlDocPtr(n_doc, doc, 1);
24875        des_xmlNodePtr(n_elem, elem, 2);
24876        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24877        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
24878        xmlResetLastError();
24879        if (mem_base != xmlMemBlocks()) {
24880            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
24881	           xmlMemBlocks() - mem_base);
24882	    test_ret++;
24883            printf(" %d", n_ctxt);
24884            printf(" %d", n_doc);
24885            printf(" %d", n_elem);
24886            printf(" %d", n_name);
24887            printf(" %d", n_value);
24888            printf("\n");
24889        }
24890    }
24891    }
24892    }
24893    }
24894    }
24895    function_tests++;
24896#endif
24897
24898    return(test_ret);
24899}
24900
24901
24902#define gen_nb_xmlElementContent_ptr 1
24903static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24904    return(NULL);
24905}
24906static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24907}
24908
24909static int
24910test_xmlValidGetPotentialChildren(void) {
24911    int test_ret = 0;
24912
24913#if defined(LIBXML_VALID_ENABLED)
24914#ifdef LIBXML_VALID_ENABLED
24915    int mem_base;
24916    int ret_val;
24917    xmlElementContent * ctree; /* an element content tree */
24918    int n_ctree;
24919    xmlChar ** list; /* an array to store the list of child names */
24920    int n_list;
24921    int * len; /* a pointer to the number of element in the list */
24922    int n_len;
24923    int max; /* the size of the array */
24924    int n_max;
24925
24926    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
24927    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
24928    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
24929    for (n_max = 0;n_max < gen_nb_int;n_max++) {
24930        mem_base = xmlMemBlocks();
24931        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
24932        list = gen_const_xmlChar_ptr_ptr(n_list, 1);
24933        len = gen_int_ptr(n_len, 2);
24934        max = gen_int(n_max, 3);
24935
24936        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)list, len, max);
24937        desret_int(ret_val);
24938        call_tests++;
24939        des_xmlElementContent_ptr(n_ctree, ctree, 0);
24940        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 1);
24941        des_int_ptr(n_len, len, 2);
24942        des_int(n_max, max, 3);
24943        xmlResetLastError();
24944        if (mem_base != xmlMemBlocks()) {
24945            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
24946	           xmlMemBlocks() - mem_base);
24947	    test_ret++;
24948            printf(" %d", n_ctree);
24949            printf(" %d", n_list);
24950            printf(" %d", n_len);
24951            printf(" %d", n_max);
24952            printf("\n");
24953        }
24954    }
24955    }
24956    }
24957    }
24958    function_tests++;
24959#endif
24960#endif
24961
24962    return(test_ret);
24963}
24964
24965
24966static int
24967test_xmlValidGetValidElements(void) {
24968    int test_ret = 0;
24969
24970#if defined(LIBXML_VALID_ENABLED)
24971#ifdef LIBXML_VALID_ENABLED
24972    int mem_base;
24973    int ret_val;
24974    xmlNode * prev; /* an element to insert after */
24975    int n_prev;
24976    xmlNode * next; /* an element to insert next */
24977    int n_next;
24978    xmlChar ** names; /* an array to store the list of child names */
24979    int n_names;
24980    int max; /* the size of the array */
24981    int n_max;
24982
24983    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
24984    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
24985    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
24986    for (n_max = 0;n_max < gen_nb_int;n_max++) {
24987        mem_base = xmlMemBlocks();
24988        prev = gen_xmlNodePtr(n_prev, 0);
24989        next = gen_xmlNodePtr(n_next, 1);
24990        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
24991        max = gen_int(n_max, 3);
24992
24993        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
24994        desret_int(ret_val);
24995        call_tests++;
24996        des_xmlNodePtr(n_prev, prev, 0);
24997        des_xmlNodePtr(n_next, next, 1);
24998        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
24999        des_int(n_max, max, 3);
25000        xmlResetLastError();
25001        if (mem_base != xmlMemBlocks()) {
25002            printf("Leak of %d blocks found in xmlValidGetValidElements",
25003	           xmlMemBlocks() - mem_base);
25004	    test_ret++;
25005            printf(" %d", n_prev);
25006            printf(" %d", n_next);
25007            printf(" %d", n_names);
25008            printf(" %d", n_max);
25009            printf("\n");
25010        }
25011    }
25012    }
25013    }
25014    }
25015    function_tests++;
25016#endif
25017#endif
25018
25019    return(test_ret);
25020}
25021
25022
25023static int
25024test_xmlValidNormalizeAttributeValue(void) {
25025    int test_ret = 0;
25026
25027#if defined(LIBXML_VALID_ENABLED)
25028    int mem_base;
25029    xmlChar * ret_val;
25030    xmlDocPtr doc; /* the document */
25031    int n_doc;
25032    xmlNodePtr elem; /* the parent */
25033    int n_elem;
25034    xmlChar * name; /* the attribute name */
25035    int n_name;
25036    xmlChar * value; /* the attribute value */
25037    int n_value;
25038
25039    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25040    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25041    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25042    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25043        mem_base = xmlMemBlocks();
25044        doc = gen_xmlDocPtr(n_doc, 0);
25045        elem = gen_xmlNodePtr(n_elem, 1);
25046        name = gen_const_xmlChar_ptr(n_name, 2);
25047        value = gen_const_xmlChar_ptr(n_value, 3);
25048
25049        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25050        desret_xmlChar_ptr(ret_val);
25051        call_tests++;
25052        des_xmlDocPtr(n_doc, doc, 0);
25053        des_xmlNodePtr(n_elem, elem, 1);
25054        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25055        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25056        xmlResetLastError();
25057        if (mem_base != xmlMemBlocks()) {
25058            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25059	           xmlMemBlocks() - mem_base);
25060	    test_ret++;
25061            printf(" %d", n_doc);
25062            printf(" %d", n_elem);
25063            printf(" %d", n_name);
25064            printf(" %d", n_value);
25065            printf("\n");
25066        }
25067    }
25068    }
25069    }
25070    }
25071    function_tests++;
25072#endif
25073
25074    return(test_ret);
25075}
25076
25077
25078static int
25079test_xmlValidateAttributeDecl(void) {
25080    int test_ret = 0;
25081
25082#if defined(LIBXML_VALID_ENABLED)
25083    int mem_base;
25084    int ret_val;
25085    xmlValidCtxtPtr ctxt; /* the validation context */
25086    int n_ctxt;
25087    xmlDocPtr doc; /* a document instance */
25088    int n_doc;
25089    xmlAttributePtr attr; /* an attribute definition */
25090    int n_attr;
25091
25092    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25093    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25094    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25095        mem_base = xmlMemBlocks();
25096        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25097        doc = gen_xmlDocPtr(n_doc, 1);
25098        attr = gen_xmlAttributePtr(n_attr, 2);
25099
25100        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25101        desret_int(ret_val);
25102        call_tests++;
25103        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25104        des_xmlDocPtr(n_doc, doc, 1);
25105        des_xmlAttributePtr(n_attr, attr, 2);
25106        xmlResetLastError();
25107        if (mem_base != xmlMemBlocks()) {
25108            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25109	           xmlMemBlocks() - mem_base);
25110	    test_ret++;
25111            printf(" %d", n_ctxt);
25112            printf(" %d", n_doc);
25113            printf(" %d", n_attr);
25114            printf("\n");
25115        }
25116    }
25117    }
25118    }
25119    function_tests++;
25120#endif
25121
25122    return(test_ret);
25123}
25124
25125
25126static int
25127test_xmlValidateAttributeValue(void) {
25128    int test_ret = 0;
25129
25130#if defined(LIBXML_VALID_ENABLED)
25131    int mem_base;
25132    int ret_val;
25133    xmlAttributeType type; /* an attribute type */
25134    int n_type;
25135    xmlChar * value; /* an attribute value */
25136    int n_value;
25137
25138    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25139    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25140        mem_base = xmlMemBlocks();
25141        type = gen_xmlAttributeType(n_type, 0);
25142        value = gen_const_xmlChar_ptr(n_value, 1);
25143
25144        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25145        desret_int(ret_val);
25146        call_tests++;
25147        des_xmlAttributeType(n_type, type, 0);
25148        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25149        xmlResetLastError();
25150        if (mem_base != xmlMemBlocks()) {
25151            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25152	           xmlMemBlocks() - mem_base);
25153	    test_ret++;
25154            printf(" %d", n_type);
25155            printf(" %d", n_value);
25156            printf("\n");
25157        }
25158    }
25159    }
25160    function_tests++;
25161#endif
25162
25163    return(test_ret);
25164}
25165
25166
25167static int
25168test_xmlValidateDocument(void) {
25169    int test_ret = 0;
25170
25171#if defined(LIBXML_VALID_ENABLED)
25172    int mem_base;
25173    int ret_val;
25174    xmlValidCtxtPtr ctxt; /* the validation context */
25175    int n_ctxt;
25176    xmlDocPtr doc; /* a document instance */
25177    int n_doc;
25178
25179    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25180    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25181        mem_base = xmlMemBlocks();
25182        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25183        doc = gen_xmlDocPtr(n_doc, 1);
25184
25185        ret_val = xmlValidateDocument(ctxt, doc);
25186        desret_int(ret_val);
25187        call_tests++;
25188        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25189        des_xmlDocPtr(n_doc, doc, 1);
25190        xmlResetLastError();
25191        if (mem_base != xmlMemBlocks()) {
25192            printf("Leak of %d blocks found in xmlValidateDocument",
25193	           xmlMemBlocks() - mem_base);
25194	    test_ret++;
25195            printf(" %d", n_ctxt);
25196            printf(" %d", n_doc);
25197            printf("\n");
25198        }
25199    }
25200    }
25201    function_tests++;
25202#endif
25203
25204    return(test_ret);
25205}
25206
25207
25208static int
25209test_xmlValidateDocumentFinal(void) {
25210    int test_ret = 0;
25211
25212#if defined(LIBXML_VALID_ENABLED)
25213    int mem_base;
25214    int ret_val;
25215    xmlValidCtxtPtr ctxt; /* the validation context */
25216    int n_ctxt;
25217    xmlDocPtr doc; /* a document instance */
25218    int n_doc;
25219
25220    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25221    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25222        mem_base = xmlMemBlocks();
25223        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25224        doc = gen_xmlDocPtr(n_doc, 1);
25225
25226        ret_val = xmlValidateDocumentFinal(ctxt, doc);
25227        desret_int(ret_val);
25228        call_tests++;
25229        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25230        des_xmlDocPtr(n_doc, doc, 1);
25231        xmlResetLastError();
25232        if (mem_base != xmlMemBlocks()) {
25233            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
25234	           xmlMemBlocks() - mem_base);
25235	    test_ret++;
25236            printf(" %d", n_ctxt);
25237            printf(" %d", n_doc);
25238            printf("\n");
25239        }
25240    }
25241    }
25242    function_tests++;
25243#endif
25244
25245    return(test_ret);
25246}
25247
25248
25249static int
25250test_xmlValidateDtd(void) {
25251    int test_ret = 0;
25252
25253#if defined(LIBXML_VALID_ENABLED)
25254    int mem_base;
25255    int ret_val;
25256    xmlValidCtxtPtr ctxt; /* the validation context */
25257    int n_ctxt;
25258    xmlDocPtr doc; /* a document instance */
25259    int n_doc;
25260    xmlDtdPtr dtd; /* a dtd instance */
25261    int n_dtd;
25262
25263    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25264    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25265    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25266        mem_base = xmlMemBlocks();
25267        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25268        doc = gen_xmlDocPtr(n_doc, 1);
25269        dtd = gen_xmlDtdPtr(n_dtd, 2);
25270
25271        ret_val = xmlValidateDtd(ctxt, doc, dtd);
25272        desret_int(ret_val);
25273        call_tests++;
25274        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25275        des_xmlDocPtr(n_doc, doc, 1);
25276        des_xmlDtdPtr(n_dtd, dtd, 2);
25277        xmlResetLastError();
25278        if (mem_base != xmlMemBlocks()) {
25279            printf("Leak of %d blocks found in xmlValidateDtd",
25280	           xmlMemBlocks() - mem_base);
25281	    test_ret++;
25282            printf(" %d", n_ctxt);
25283            printf(" %d", n_doc);
25284            printf(" %d", n_dtd);
25285            printf("\n");
25286        }
25287    }
25288    }
25289    }
25290    function_tests++;
25291#endif
25292
25293    return(test_ret);
25294}
25295
25296
25297static int
25298test_xmlValidateDtdFinal(void) {
25299    int test_ret = 0;
25300
25301#if defined(LIBXML_VALID_ENABLED)
25302    int mem_base;
25303    int ret_val;
25304    xmlValidCtxtPtr ctxt; /* the validation context */
25305    int n_ctxt;
25306    xmlDocPtr doc; /* a document instance */
25307    int n_doc;
25308
25309    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25310    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25311        mem_base = xmlMemBlocks();
25312        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25313        doc = gen_xmlDocPtr(n_doc, 1);
25314
25315        ret_val = xmlValidateDtdFinal(ctxt, doc);
25316        desret_int(ret_val);
25317        call_tests++;
25318        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25319        des_xmlDocPtr(n_doc, doc, 1);
25320        xmlResetLastError();
25321        if (mem_base != xmlMemBlocks()) {
25322            printf("Leak of %d blocks found in xmlValidateDtdFinal",
25323	           xmlMemBlocks() - mem_base);
25324	    test_ret++;
25325            printf(" %d", n_ctxt);
25326            printf(" %d", n_doc);
25327            printf("\n");
25328        }
25329    }
25330    }
25331    function_tests++;
25332#endif
25333
25334    return(test_ret);
25335}
25336
25337
25338static int
25339test_xmlValidateElement(void) {
25340    int test_ret = 0;
25341
25342#if defined(LIBXML_VALID_ENABLED)
25343    int mem_base;
25344    int ret_val;
25345    xmlValidCtxtPtr ctxt; /* the validation context */
25346    int n_ctxt;
25347    xmlDocPtr doc; /* a document instance */
25348    int n_doc;
25349    xmlNodePtr elem; /* an element instance */
25350    int n_elem;
25351
25352    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25353    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25354    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25355        mem_base = xmlMemBlocks();
25356        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25357        doc = gen_xmlDocPtr(n_doc, 1);
25358        elem = gen_xmlNodePtr(n_elem, 2);
25359
25360        ret_val = xmlValidateElement(ctxt, doc, elem);
25361        desret_int(ret_val);
25362        call_tests++;
25363        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25364        des_xmlDocPtr(n_doc, doc, 1);
25365        des_xmlNodePtr(n_elem, elem, 2);
25366        xmlResetLastError();
25367        if (mem_base != xmlMemBlocks()) {
25368            printf("Leak of %d blocks found in xmlValidateElement",
25369	           xmlMemBlocks() - mem_base);
25370	    test_ret++;
25371            printf(" %d", n_ctxt);
25372            printf(" %d", n_doc);
25373            printf(" %d", n_elem);
25374            printf("\n");
25375        }
25376    }
25377    }
25378    }
25379    function_tests++;
25380#endif
25381
25382    return(test_ret);
25383}
25384
25385
25386static int
25387test_xmlValidateElementDecl(void) {
25388    int test_ret = 0;
25389
25390#if defined(LIBXML_VALID_ENABLED)
25391    int mem_base;
25392    int ret_val;
25393    xmlValidCtxtPtr ctxt; /* the validation context */
25394    int n_ctxt;
25395    xmlDocPtr doc; /* a document instance */
25396    int n_doc;
25397    xmlElementPtr elem; /* an element definition */
25398    int n_elem;
25399
25400    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25401    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25402    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25403        mem_base = xmlMemBlocks();
25404        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25405        doc = gen_xmlDocPtr(n_doc, 1);
25406        elem = gen_xmlElementPtr(n_elem, 2);
25407
25408        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
25409        desret_int(ret_val);
25410        call_tests++;
25411        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25412        des_xmlDocPtr(n_doc, doc, 1);
25413        des_xmlElementPtr(n_elem, elem, 2);
25414        xmlResetLastError();
25415        if (mem_base != xmlMemBlocks()) {
25416            printf("Leak of %d blocks found in xmlValidateElementDecl",
25417	           xmlMemBlocks() - mem_base);
25418	    test_ret++;
25419            printf(" %d", n_ctxt);
25420            printf(" %d", n_doc);
25421            printf(" %d", n_elem);
25422            printf("\n");
25423        }
25424    }
25425    }
25426    }
25427    function_tests++;
25428#endif
25429
25430    return(test_ret);
25431}
25432
25433
25434static int
25435test_xmlValidateNameValue(void) {
25436    int test_ret = 0;
25437
25438#if defined(LIBXML_VALID_ENABLED)
25439    int mem_base;
25440    int ret_val;
25441    xmlChar * value; /* an Name value */
25442    int n_value;
25443
25444    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25445        mem_base = xmlMemBlocks();
25446        value = gen_const_xmlChar_ptr(n_value, 0);
25447
25448        ret_val = xmlValidateNameValue((const xmlChar *)value);
25449        desret_int(ret_val);
25450        call_tests++;
25451        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25452        xmlResetLastError();
25453        if (mem_base != xmlMemBlocks()) {
25454            printf("Leak of %d blocks found in xmlValidateNameValue",
25455	           xmlMemBlocks() - mem_base);
25456	    test_ret++;
25457            printf(" %d", n_value);
25458            printf("\n");
25459        }
25460    }
25461    function_tests++;
25462#endif
25463
25464    return(test_ret);
25465}
25466
25467
25468static int
25469test_xmlValidateNamesValue(void) {
25470    int test_ret = 0;
25471
25472#if defined(LIBXML_VALID_ENABLED)
25473    int mem_base;
25474    int ret_val;
25475    xmlChar * value; /* an Names value */
25476    int n_value;
25477
25478    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25479        mem_base = xmlMemBlocks();
25480        value = gen_const_xmlChar_ptr(n_value, 0);
25481
25482        ret_val = xmlValidateNamesValue((const xmlChar *)value);
25483        desret_int(ret_val);
25484        call_tests++;
25485        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25486        xmlResetLastError();
25487        if (mem_base != xmlMemBlocks()) {
25488            printf("Leak of %d blocks found in xmlValidateNamesValue",
25489	           xmlMemBlocks() - mem_base);
25490	    test_ret++;
25491            printf(" %d", n_value);
25492            printf("\n");
25493        }
25494    }
25495    function_tests++;
25496#endif
25497
25498    return(test_ret);
25499}
25500
25501
25502static int
25503test_xmlValidateNmtokenValue(void) {
25504    int test_ret = 0;
25505
25506#if defined(LIBXML_VALID_ENABLED)
25507    int mem_base;
25508    int ret_val;
25509    xmlChar * value; /* an Nmtoken value */
25510    int n_value;
25511
25512    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25513        mem_base = xmlMemBlocks();
25514        value = gen_const_xmlChar_ptr(n_value, 0);
25515
25516        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
25517        desret_int(ret_val);
25518        call_tests++;
25519        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25520        xmlResetLastError();
25521        if (mem_base != xmlMemBlocks()) {
25522            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
25523	           xmlMemBlocks() - mem_base);
25524	    test_ret++;
25525            printf(" %d", n_value);
25526            printf("\n");
25527        }
25528    }
25529    function_tests++;
25530#endif
25531
25532    return(test_ret);
25533}
25534
25535
25536static int
25537test_xmlValidateNmtokensValue(void) {
25538    int test_ret = 0;
25539
25540#if defined(LIBXML_VALID_ENABLED)
25541    int mem_base;
25542    int ret_val;
25543    xmlChar * value; /* an Nmtokens value */
25544    int n_value;
25545
25546    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25547        mem_base = xmlMemBlocks();
25548        value = gen_const_xmlChar_ptr(n_value, 0);
25549
25550        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
25551        desret_int(ret_val);
25552        call_tests++;
25553        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25554        xmlResetLastError();
25555        if (mem_base != xmlMemBlocks()) {
25556            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
25557	           xmlMemBlocks() - mem_base);
25558	    test_ret++;
25559            printf(" %d", n_value);
25560            printf("\n");
25561        }
25562    }
25563    function_tests++;
25564#endif
25565
25566    return(test_ret);
25567}
25568
25569
25570static int
25571test_xmlValidateNotationDecl(void) {
25572    int test_ret = 0;
25573
25574#if defined(LIBXML_VALID_ENABLED)
25575    int mem_base;
25576    int ret_val;
25577    xmlValidCtxtPtr ctxt; /* the validation context */
25578    int n_ctxt;
25579    xmlDocPtr doc; /* a document instance */
25580    int n_doc;
25581    xmlNotationPtr nota; /* a notation definition */
25582    int n_nota;
25583
25584    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25585    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25586    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25587        mem_base = xmlMemBlocks();
25588        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25589        doc = gen_xmlDocPtr(n_doc, 1);
25590        nota = gen_xmlNotationPtr(n_nota, 2);
25591
25592        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
25593        desret_int(ret_val);
25594        call_tests++;
25595        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25596        des_xmlDocPtr(n_doc, doc, 1);
25597        des_xmlNotationPtr(n_nota, nota, 2);
25598        xmlResetLastError();
25599        if (mem_base != xmlMemBlocks()) {
25600            printf("Leak of %d blocks found in xmlValidateNotationDecl",
25601	           xmlMemBlocks() - mem_base);
25602	    test_ret++;
25603            printf(" %d", n_ctxt);
25604            printf(" %d", n_doc);
25605            printf(" %d", n_nota);
25606            printf("\n");
25607        }
25608    }
25609    }
25610    }
25611    function_tests++;
25612#endif
25613
25614    return(test_ret);
25615}
25616
25617
25618static int
25619test_xmlValidateNotationUse(void) {
25620    int test_ret = 0;
25621
25622#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
25623    int mem_base;
25624    int ret_val;
25625    xmlValidCtxtPtr ctxt; /* the validation context */
25626    int n_ctxt;
25627    xmlDocPtr doc; /* the document */
25628    int n_doc;
25629    xmlChar * notationName; /* the notation name to check */
25630    int n_notationName;
25631
25632    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25633    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25634    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
25635        mem_base = xmlMemBlocks();
25636        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25637        doc = gen_xmlDocPtr(n_doc, 1);
25638        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
25639
25640        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
25641        desret_int(ret_val);
25642        call_tests++;
25643        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25644        des_xmlDocPtr(n_doc, doc, 1);
25645        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
25646        xmlResetLastError();
25647        if (mem_base != xmlMemBlocks()) {
25648            printf("Leak of %d blocks found in xmlValidateNotationUse",
25649	           xmlMemBlocks() - mem_base);
25650	    test_ret++;
25651            printf(" %d", n_ctxt);
25652            printf(" %d", n_doc);
25653            printf(" %d", n_notationName);
25654            printf("\n");
25655        }
25656    }
25657    }
25658    }
25659    function_tests++;
25660#endif
25661
25662    return(test_ret);
25663}
25664
25665
25666static int
25667test_xmlValidateOneAttribute(void) {
25668    int test_ret = 0;
25669
25670#if defined(LIBXML_VALID_ENABLED)
25671    int mem_base;
25672    int ret_val;
25673    xmlValidCtxtPtr ctxt; /* the validation context */
25674    int n_ctxt;
25675    xmlDocPtr doc; /* a document instance */
25676    int n_doc;
25677    xmlNodePtr elem; /* an element instance */
25678    int n_elem;
25679    xmlAttrPtr attr; /* an attribute instance */
25680    int n_attr;
25681    xmlChar * value; /* the attribute value (without entities processing) */
25682    int n_value;
25683
25684    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25685    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25686    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25687    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25688    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25689        mem_base = xmlMemBlocks();
25690        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25691        doc = gen_xmlDocPtr(n_doc, 1);
25692        elem = gen_xmlNodePtr(n_elem, 2);
25693        attr = gen_xmlAttrPtr(n_attr, 3);
25694        value = gen_const_xmlChar_ptr(n_value, 4);
25695
25696        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
25697        desret_int(ret_val);
25698        call_tests++;
25699        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25700        des_xmlDocPtr(n_doc, doc, 1);
25701        des_xmlNodePtr(n_elem, elem, 2);
25702        des_xmlAttrPtr(n_attr, attr, 3);
25703        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25704        xmlResetLastError();
25705        if (mem_base != xmlMemBlocks()) {
25706            printf("Leak of %d blocks found in xmlValidateOneAttribute",
25707	           xmlMemBlocks() - mem_base);
25708	    test_ret++;
25709            printf(" %d", n_ctxt);
25710            printf(" %d", n_doc);
25711            printf(" %d", n_elem);
25712            printf(" %d", n_attr);
25713            printf(" %d", n_value);
25714            printf("\n");
25715        }
25716    }
25717    }
25718    }
25719    }
25720    }
25721    function_tests++;
25722#endif
25723
25724    return(test_ret);
25725}
25726
25727
25728static int
25729test_xmlValidateOneElement(void) {
25730    int test_ret = 0;
25731
25732#if defined(LIBXML_VALID_ENABLED)
25733    int mem_base;
25734    int ret_val;
25735    xmlValidCtxtPtr ctxt; /* the validation context */
25736    int n_ctxt;
25737    xmlDocPtr doc; /* a document instance */
25738    int n_doc;
25739    xmlNodePtr elem; /* an element instance */
25740    int n_elem;
25741
25742    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25743    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25744    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25745        mem_base = xmlMemBlocks();
25746        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25747        doc = gen_xmlDocPtr(n_doc, 1);
25748        elem = gen_xmlNodePtr(n_elem, 2);
25749
25750        ret_val = xmlValidateOneElement(ctxt, doc, elem);
25751        desret_int(ret_val);
25752        call_tests++;
25753        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25754        des_xmlDocPtr(n_doc, doc, 1);
25755        des_xmlNodePtr(n_elem, elem, 2);
25756        xmlResetLastError();
25757        if (mem_base != xmlMemBlocks()) {
25758            printf("Leak of %d blocks found in xmlValidateOneElement",
25759	           xmlMemBlocks() - mem_base);
25760	    test_ret++;
25761            printf(" %d", n_ctxt);
25762            printf(" %d", n_doc);
25763            printf(" %d", n_elem);
25764            printf("\n");
25765        }
25766    }
25767    }
25768    }
25769    function_tests++;
25770#endif
25771
25772    return(test_ret);
25773}
25774
25775
25776static int
25777test_xmlValidateOneNamespace(void) {
25778    int test_ret = 0;
25779
25780#if defined(LIBXML_VALID_ENABLED)
25781    int mem_base;
25782    int ret_val;
25783    xmlValidCtxtPtr ctxt; /* the validation context */
25784    int n_ctxt;
25785    xmlDocPtr doc; /* a document instance */
25786    int n_doc;
25787    xmlNodePtr elem; /* an element instance */
25788    int n_elem;
25789    xmlChar * prefix; /* the namespace prefix */
25790    int n_prefix;
25791    xmlNsPtr ns; /* an namespace declaration instance */
25792    int n_ns;
25793    xmlChar * value; /* the attribute value (without entities processing) */
25794    int n_value;
25795
25796    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25797    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25798    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25799    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25800    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
25801    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25802        mem_base = xmlMemBlocks();
25803        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25804        doc = gen_xmlDocPtr(n_doc, 1);
25805        elem = gen_xmlNodePtr(n_elem, 2);
25806        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25807        ns = gen_xmlNsPtr(n_ns, 4);
25808        value = gen_const_xmlChar_ptr(n_value, 5);
25809
25810        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
25811        desret_int(ret_val);
25812        call_tests++;
25813        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25814        des_xmlDocPtr(n_doc, doc, 1);
25815        des_xmlNodePtr(n_elem, elem, 2);
25816        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25817        des_xmlNsPtr(n_ns, ns, 4);
25818        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
25819        xmlResetLastError();
25820        if (mem_base != xmlMemBlocks()) {
25821            printf("Leak of %d blocks found in xmlValidateOneNamespace",
25822	           xmlMemBlocks() - mem_base);
25823	    test_ret++;
25824            printf(" %d", n_ctxt);
25825            printf(" %d", n_doc);
25826            printf(" %d", n_elem);
25827            printf(" %d", n_prefix);
25828            printf(" %d", n_ns);
25829            printf(" %d", n_value);
25830            printf("\n");
25831        }
25832    }
25833    }
25834    }
25835    }
25836    }
25837    }
25838    function_tests++;
25839#endif
25840
25841    return(test_ret);
25842}
25843
25844
25845static int
25846test_xmlValidatePopElement(void) {
25847    int test_ret = 0;
25848
25849#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25850    int mem_base;
25851    int ret_val;
25852    xmlValidCtxtPtr ctxt; /* the validation context */
25853    int n_ctxt;
25854    xmlDocPtr doc; /* a document instance */
25855    int n_doc;
25856    xmlNodePtr elem; /* an element instance */
25857    int n_elem;
25858    xmlChar * qname; /* the qualified name as appearing in the serialization */
25859    int n_qname;
25860
25861    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25862    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25863    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25864    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25865        mem_base = xmlMemBlocks();
25866        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25867        doc = gen_xmlDocPtr(n_doc, 1);
25868        elem = gen_xmlNodePtr(n_elem, 2);
25869        qname = gen_const_xmlChar_ptr(n_qname, 3);
25870
25871        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
25872        desret_int(ret_val);
25873        call_tests++;
25874        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25875        des_xmlDocPtr(n_doc, doc, 1);
25876        des_xmlNodePtr(n_elem, elem, 2);
25877        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
25878        xmlResetLastError();
25879        if (mem_base != xmlMemBlocks()) {
25880            printf("Leak of %d blocks found in xmlValidatePopElement",
25881	           xmlMemBlocks() - mem_base);
25882	    test_ret++;
25883            printf(" %d", n_ctxt);
25884            printf(" %d", n_doc);
25885            printf(" %d", n_elem);
25886            printf(" %d", n_qname);
25887            printf("\n");
25888        }
25889    }
25890    }
25891    }
25892    }
25893    function_tests++;
25894#endif
25895
25896    return(test_ret);
25897}
25898
25899
25900static int
25901test_xmlValidatePushCData(void) {
25902    int test_ret = 0;
25903
25904#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25905    int mem_base;
25906    int ret_val;
25907    xmlValidCtxtPtr ctxt; /* the validation context */
25908    int n_ctxt;
25909    xmlChar * data; /* some character data read */
25910    int n_data;
25911    int len; /* the lenght of the data */
25912    int n_len;
25913
25914    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25915    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
25916    for (n_len = 0;n_len < gen_nb_int;n_len++) {
25917        mem_base = xmlMemBlocks();
25918        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25919        data = gen_const_xmlChar_ptr(n_data, 1);
25920        len = gen_int(n_len, 2);
25921
25922        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
25923        desret_int(ret_val);
25924        call_tests++;
25925        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25926        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
25927        des_int(n_len, len, 2);
25928        xmlResetLastError();
25929        if (mem_base != xmlMemBlocks()) {
25930            printf("Leak of %d blocks found in xmlValidatePushCData",
25931	           xmlMemBlocks() - mem_base);
25932	    test_ret++;
25933            printf(" %d", n_ctxt);
25934            printf(" %d", n_data);
25935            printf(" %d", n_len);
25936            printf("\n");
25937        }
25938    }
25939    }
25940    }
25941    function_tests++;
25942#endif
25943
25944    return(test_ret);
25945}
25946
25947
25948static int
25949test_xmlValidatePushElement(void) {
25950    int test_ret = 0;
25951
25952#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25953    int mem_base;
25954    int ret_val;
25955    xmlValidCtxtPtr ctxt; /* the validation context */
25956    int n_ctxt;
25957    xmlDocPtr doc; /* a document instance */
25958    int n_doc;
25959    xmlNodePtr elem; /* an element instance */
25960    int n_elem;
25961    xmlChar * qname; /* the qualified name as appearing in the serialization */
25962    int n_qname;
25963
25964    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25965    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25966    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25967    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25968        mem_base = xmlMemBlocks();
25969        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25970        doc = gen_xmlDocPtr(n_doc, 1);
25971        elem = gen_xmlNodePtr(n_elem, 2);
25972        qname = gen_const_xmlChar_ptr(n_qname, 3);
25973
25974        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
25975        desret_int(ret_val);
25976        call_tests++;
25977        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25978        des_xmlDocPtr(n_doc, doc, 1);
25979        des_xmlNodePtr(n_elem, elem, 2);
25980        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
25981        xmlResetLastError();
25982        if (mem_base != xmlMemBlocks()) {
25983            printf("Leak of %d blocks found in xmlValidatePushElement",
25984	           xmlMemBlocks() - mem_base);
25985	    test_ret++;
25986            printf(" %d", n_ctxt);
25987            printf(" %d", n_doc);
25988            printf(" %d", n_elem);
25989            printf(" %d", n_qname);
25990            printf("\n");
25991        }
25992    }
25993    }
25994    }
25995    }
25996    function_tests++;
25997#endif
25998
25999    return(test_ret);
26000}
26001
26002
26003static int
26004test_xmlValidateRoot(void) {
26005    int test_ret = 0;
26006
26007#if defined(LIBXML_VALID_ENABLED)
26008    int mem_base;
26009    int ret_val;
26010    xmlValidCtxtPtr ctxt; /* the validation context */
26011    int n_ctxt;
26012    xmlDocPtr doc; /* a document instance */
26013    int n_doc;
26014
26015    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26016    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26017        mem_base = xmlMemBlocks();
26018        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26019        doc = gen_xmlDocPtr(n_doc, 1);
26020
26021        ret_val = xmlValidateRoot(ctxt, doc);
26022        desret_int(ret_val);
26023        call_tests++;
26024        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26025        des_xmlDocPtr(n_doc, doc, 1);
26026        xmlResetLastError();
26027        if (mem_base != xmlMemBlocks()) {
26028            printf("Leak of %d blocks found in xmlValidateRoot",
26029	           xmlMemBlocks() - mem_base);
26030	    test_ret++;
26031            printf(" %d", n_ctxt);
26032            printf(" %d", n_doc);
26033            printf("\n");
26034        }
26035    }
26036    }
26037    function_tests++;
26038#endif
26039
26040    return(test_ret);
26041}
26042
26043static int
26044test_valid(void) {
26045    int test_ret = 0;
26046
26047    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26048    test_ret += test_xmlAddAttributeDecl();
26049    test_ret += test_xmlAddElementDecl();
26050    test_ret += test_xmlAddID();
26051    test_ret += test_xmlAddNotationDecl();
26052    test_ret += test_xmlAddRef();
26053    test_ret += test_xmlCopyAttributeTable();
26054    test_ret += test_xmlCopyDocElementContent();
26055    test_ret += test_xmlCopyElementContent();
26056    test_ret += test_xmlCopyElementTable();
26057    test_ret += test_xmlCopyEnumeration();
26058    test_ret += test_xmlCopyNotationTable();
26059    test_ret += test_xmlCreateEnumeration();
26060    test_ret += test_xmlDumpAttributeDecl();
26061    test_ret += test_xmlDumpAttributeTable();
26062    test_ret += test_xmlDumpElementDecl();
26063    test_ret += test_xmlDumpElementTable();
26064    test_ret += test_xmlDumpNotationDecl();
26065    test_ret += test_xmlDumpNotationTable();
26066    test_ret += test_xmlGetDtdAttrDesc();
26067    test_ret += test_xmlGetDtdElementDesc();
26068    test_ret += test_xmlGetDtdNotationDesc();
26069    test_ret += test_xmlGetDtdQAttrDesc();
26070    test_ret += test_xmlGetDtdQElementDesc();
26071    test_ret += test_xmlGetID();
26072    test_ret += test_xmlGetRefs();
26073    test_ret += test_xmlIsID();
26074    test_ret += test_xmlIsMixedElement();
26075    test_ret += test_xmlIsRef();
26076    test_ret += test_xmlNewDocElementContent();
26077    test_ret += test_xmlNewElementContent();
26078    test_ret += test_xmlNewValidCtxt();
26079    test_ret += test_xmlRemoveID();
26080    test_ret += test_xmlRemoveRef();
26081    test_ret += test_xmlSnprintfElementContent();
26082    test_ret += test_xmlSprintfElementContent();
26083    test_ret += test_xmlValidBuildContentModel();
26084    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26085    test_ret += test_xmlValidGetPotentialChildren();
26086    test_ret += test_xmlValidGetValidElements();
26087    test_ret += test_xmlValidNormalizeAttributeValue();
26088    test_ret += test_xmlValidateAttributeDecl();
26089    test_ret += test_xmlValidateAttributeValue();
26090    test_ret += test_xmlValidateDocument();
26091    test_ret += test_xmlValidateDocumentFinal();
26092    test_ret += test_xmlValidateDtd();
26093    test_ret += test_xmlValidateDtdFinal();
26094    test_ret += test_xmlValidateElement();
26095    test_ret += test_xmlValidateElementDecl();
26096    test_ret += test_xmlValidateNameValue();
26097    test_ret += test_xmlValidateNamesValue();
26098    test_ret += test_xmlValidateNmtokenValue();
26099    test_ret += test_xmlValidateNmtokensValue();
26100    test_ret += test_xmlValidateNotationDecl();
26101    test_ret += test_xmlValidateNotationUse();
26102    test_ret += test_xmlValidateOneAttribute();
26103    test_ret += test_xmlValidateOneElement();
26104    test_ret += test_xmlValidateOneNamespace();
26105    test_ret += test_xmlValidatePopElement();
26106    test_ret += test_xmlValidatePushCData();
26107    test_ret += test_xmlValidatePushElement();
26108    test_ret += test_xmlValidateRoot();
26109
26110    if (test_ret != 0)
26111	printf("Module valid: %d errors\n", test_ret);
26112    return(test_ret);
26113}
26114
26115static int
26116test_xmlXIncludeNewContext(void) {
26117    int test_ret = 0;
26118
26119
26120    /* missing type support */
26121    return(test_ret);
26122}
26123
26124
26125static int
26126test_xmlXIncludeProcess(void) {
26127    int test_ret = 0;
26128
26129#if defined(LIBXML_XINCLUDE_ENABLED)
26130    int mem_base;
26131    int ret_val;
26132    xmlDocPtr doc; /* an XML document */
26133    int n_doc;
26134
26135    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26136        mem_base = xmlMemBlocks();
26137        doc = gen_xmlDocPtr(n_doc, 0);
26138
26139        ret_val = xmlXIncludeProcess(doc);
26140        desret_int(ret_val);
26141        call_tests++;
26142        des_xmlDocPtr(n_doc, doc, 0);
26143        xmlResetLastError();
26144        if (mem_base != xmlMemBlocks()) {
26145            printf("Leak of %d blocks found in xmlXIncludeProcess",
26146	           xmlMemBlocks() - mem_base);
26147	    test_ret++;
26148            printf(" %d", n_doc);
26149            printf("\n");
26150        }
26151    }
26152    function_tests++;
26153#endif
26154
26155    return(test_ret);
26156}
26157
26158
26159static int
26160test_xmlXIncludeProcessFlags(void) {
26161    int test_ret = 0;
26162
26163#if defined(LIBXML_XINCLUDE_ENABLED)
26164    int mem_base;
26165    int ret_val;
26166    xmlDocPtr doc; /* an XML document */
26167    int n_doc;
26168    int flags; /* a set of xmlParserOption used for parsing XML includes */
26169    int n_flags;
26170
26171    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26172    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26173        mem_base = xmlMemBlocks();
26174        doc = gen_xmlDocPtr(n_doc, 0);
26175        flags = gen_int(n_flags, 1);
26176
26177        ret_val = xmlXIncludeProcessFlags(doc, flags);
26178        desret_int(ret_val);
26179        call_tests++;
26180        des_xmlDocPtr(n_doc, doc, 0);
26181        des_int(n_flags, flags, 1);
26182        xmlResetLastError();
26183        if (mem_base != xmlMemBlocks()) {
26184            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
26185	           xmlMemBlocks() - mem_base);
26186	    test_ret++;
26187            printf(" %d", n_doc);
26188            printf(" %d", n_flags);
26189            printf("\n");
26190        }
26191    }
26192    }
26193    function_tests++;
26194#endif
26195
26196    return(test_ret);
26197}
26198
26199#ifdef LIBXML_XINCLUDE_ENABLED
26200
26201#define gen_nb_xmlXIncludeCtxtPtr 1
26202static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26203    return(NULL);
26204}
26205static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
26206}
26207#endif
26208
26209
26210static int
26211test_xmlXIncludeProcessNode(void) {
26212    int test_ret = 0;
26213
26214#if defined(LIBXML_XINCLUDE_ENABLED)
26215    int mem_base;
26216    int ret_val;
26217    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
26218    int n_ctxt;
26219    xmlNodePtr node; /* a node in an XML document */
26220    int n_node;
26221
26222    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26223    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
26224        mem_base = xmlMemBlocks();
26225        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26226        node = gen_xmlNodePtr(n_node, 1);
26227
26228        ret_val = xmlXIncludeProcessNode(ctxt, node);
26229        desret_int(ret_val);
26230        call_tests++;
26231        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26232        des_xmlNodePtr(n_node, node, 1);
26233        xmlResetLastError();
26234        if (mem_base != xmlMemBlocks()) {
26235            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
26236	           xmlMemBlocks() - mem_base);
26237	    test_ret++;
26238            printf(" %d", n_ctxt);
26239            printf(" %d", n_node);
26240            printf("\n");
26241        }
26242    }
26243    }
26244    function_tests++;
26245#endif
26246
26247    return(test_ret);
26248}
26249
26250
26251static int
26252test_xmlXIncludeProcessTree(void) {
26253    int test_ret = 0;
26254
26255#if defined(LIBXML_XINCLUDE_ENABLED)
26256    int mem_base;
26257    int ret_val;
26258    xmlNodePtr tree; /* a node in an XML document */
26259    int n_tree;
26260
26261    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26262        mem_base = xmlMemBlocks();
26263        tree = gen_xmlNodePtr(n_tree, 0);
26264
26265        ret_val = xmlXIncludeProcessTree(tree);
26266        desret_int(ret_val);
26267        call_tests++;
26268        des_xmlNodePtr(n_tree, tree, 0);
26269        xmlResetLastError();
26270        if (mem_base != xmlMemBlocks()) {
26271            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
26272	           xmlMemBlocks() - mem_base);
26273	    test_ret++;
26274            printf(" %d", n_tree);
26275            printf("\n");
26276        }
26277    }
26278    function_tests++;
26279#endif
26280
26281    return(test_ret);
26282}
26283
26284
26285static int
26286test_xmlXIncludeProcessTreeFlags(void) {
26287    int test_ret = 0;
26288
26289#if defined(LIBXML_XINCLUDE_ENABLED)
26290    int mem_base;
26291    int ret_val;
26292    xmlNodePtr tree; /* a node in an XML document */
26293    int n_tree;
26294    int flags; /* a set of xmlParserOption used for parsing XML includes */
26295    int n_flags;
26296
26297    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26298    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26299        mem_base = xmlMemBlocks();
26300        tree = gen_xmlNodePtr(n_tree, 0);
26301        flags = gen_int(n_flags, 1);
26302
26303        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
26304        desret_int(ret_val);
26305        call_tests++;
26306        des_xmlNodePtr(n_tree, tree, 0);
26307        des_int(n_flags, flags, 1);
26308        xmlResetLastError();
26309        if (mem_base != xmlMemBlocks()) {
26310            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
26311	           xmlMemBlocks() - mem_base);
26312	    test_ret++;
26313            printf(" %d", n_tree);
26314            printf(" %d", n_flags);
26315            printf("\n");
26316        }
26317    }
26318    }
26319    function_tests++;
26320#endif
26321
26322    return(test_ret);
26323}
26324
26325
26326static int
26327test_xmlXIncludeSetFlags(void) {
26328    int test_ret = 0;
26329
26330#if defined(LIBXML_XINCLUDE_ENABLED)
26331    int mem_base;
26332    int ret_val;
26333    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
26334    int n_ctxt;
26335    int flags; /* a set of xmlParserOption used for parsing XML includes */
26336    int n_flags;
26337
26338    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26339    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26340        mem_base = xmlMemBlocks();
26341        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26342        flags = gen_int(n_flags, 1);
26343
26344        ret_val = xmlXIncludeSetFlags(ctxt, flags);
26345        desret_int(ret_val);
26346        call_tests++;
26347        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26348        des_int(n_flags, flags, 1);
26349        xmlResetLastError();
26350        if (mem_base != xmlMemBlocks()) {
26351            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
26352	           xmlMemBlocks() - mem_base);
26353	    test_ret++;
26354            printf(" %d", n_ctxt);
26355            printf(" %d", n_flags);
26356            printf("\n");
26357        }
26358    }
26359    }
26360    function_tests++;
26361#endif
26362
26363    return(test_ret);
26364}
26365
26366static int
26367test_xinclude(void) {
26368    int test_ret = 0;
26369
26370    if (quiet == 0) printf("Testing xinclude : 6 of 8 functions ...\n");
26371    test_ret += test_xmlXIncludeNewContext();
26372    test_ret += test_xmlXIncludeProcess();
26373    test_ret += test_xmlXIncludeProcessFlags();
26374    test_ret += test_xmlXIncludeProcessNode();
26375    test_ret += test_xmlXIncludeProcessTree();
26376    test_ret += test_xmlXIncludeProcessTreeFlags();
26377    test_ret += test_xmlXIncludeSetFlags();
26378
26379    if (test_ret != 0)
26380	printf("Module xinclude: %d errors\n", test_ret);
26381    return(test_ret);
26382}
26383
26384static int
26385test_xmlAllocOutputBuffer(void) {
26386    int test_ret = 0;
26387
26388#if defined(LIBXML_OUTPUT_ENABLED)
26389    int mem_base;
26390    xmlOutputBufferPtr ret_val;
26391    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26392    int n_encoder;
26393
26394    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26395        mem_base = xmlMemBlocks();
26396        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
26397
26398        ret_val = xmlAllocOutputBuffer(encoder);
26399        desret_xmlOutputBufferPtr(ret_val);
26400        call_tests++;
26401        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
26402        xmlResetLastError();
26403        if (mem_base != xmlMemBlocks()) {
26404            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
26405	           xmlMemBlocks() - mem_base);
26406	    test_ret++;
26407            printf(" %d", n_encoder);
26408            printf("\n");
26409        }
26410    }
26411    function_tests++;
26412#endif
26413
26414    return(test_ret);
26415}
26416
26417
26418static int
26419test_xmlAllocParserInputBuffer(void) {
26420    int test_ret = 0;
26421
26422    int mem_base;
26423    xmlParserInputBufferPtr ret_val;
26424    xmlCharEncoding enc; /* the charset encoding if known */
26425    int n_enc;
26426
26427    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26428        mem_base = xmlMemBlocks();
26429        enc = gen_xmlCharEncoding(n_enc, 0);
26430
26431        ret_val = xmlAllocParserInputBuffer(enc);
26432        desret_xmlParserInputBufferPtr(ret_val);
26433        call_tests++;
26434        des_xmlCharEncoding(n_enc, enc, 0);
26435        xmlResetLastError();
26436        if (mem_base != xmlMemBlocks()) {
26437            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
26438	           xmlMemBlocks() - mem_base);
26439	    test_ret++;
26440            printf(" %d", n_enc);
26441            printf("\n");
26442        }
26443    }
26444    function_tests++;
26445
26446    return(test_ret);
26447}
26448
26449
26450static int
26451test_xmlCheckFilename(void) {
26452    int test_ret = 0;
26453
26454    int mem_base;
26455    int ret_val;
26456    char * path; /* the path to check */
26457    int n_path;
26458
26459    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
26460        mem_base = xmlMemBlocks();
26461        path = gen_const_char_ptr(n_path, 0);
26462
26463        ret_val = xmlCheckFilename((const char *)path);
26464        desret_int(ret_val);
26465        call_tests++;
26466        des_const_char_ptr(n_path, (const char *)path, 0);
26467        xmlResetLastError();
26468        if (mem_base != xmlMemBlocks()) {
26469            printf("Leak of %d blocks found in xmlCheckFilename",
26470	           xmlMemBlocks() - mem_base);
26471	    test_ret++;
26472            printf(" %d", n_path);
26473            printf("\n");
26474        }
26475    }
26476    function_tests++;
26477
26478    return(test_ret);
26479}
26480
26481
26482static int
26483test_xmlCheckHTTPInput(void) {
26484    int test_ret = 0;
26485
26486    int mem_base;
26487    xmlParserInputPtr ret_val;
26488    xmlParserCtxtPtr ctxt; /* an XML parser context */
26489    int n_ctxt;
26490    xmlParserInputPtr ret; /* an XML parser input */
26491    int n_ret;
26492
26493    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
26494    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
26495        mem_base = xmlMemBlocks();
26496        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
26497        ret = gen_xmlParserInputPtr(n_ret, 1);
26498
26499        ret_val = xmlCheckHTTPInput(ctxt, ret);
26500        desret_xmlParserInputPtr(ret_val);
26501        call_tests++;
26502        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
26503        des_xmlParserInputPtr(n_ret, ret, 1);
26504        xmlResetLastError();
26505        if (mem_base != xmlMemBlocks()) {
26506            printf("Leak of %d blocks found in xmlCheckHTTPInput",
26507	           xmlMemBlocks() - mem_base);
26508	    test_ret++;
26509            printf(" %d", n_ctxt);
26510            printf(" %d", n_ret);
26511            printf("\n");
26512        }
26513    }
26514    }
26515    function_tests++;
26516
26517    return(test_ret);
26518}
26519
26520
26521static int
26522test_xmlCleanupInputCallbacks(void) {
26523    int test_ret = 0;
26524
26525    int mem_base;
26526
26527        mem_base = xmlMemBlocks();
26528
26529        xmlCleanupInputCallbacks();
26530        call_tests++;
26531        xmlResetLastError();
26532        if (mem_base != xmlMemBlocks()) {
26533            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
26534	           xmlMemBlocks() - mem_base);
26535	    test_ret++;
26536            printf("\n");
26537        }
26538    function_tests++;
26539
26540    return(test_ret);
26541}
26542
26543
26544static int
26545test_xmlCleanupOutputCallbacks(void) {
26546    int test_ret = 0;
26547
26548#if defined(LIBXML_OUTPUT_ENABLED)
26549    int mem_base;
26550
26551        mem_base = xmlMemBlocks();
26552
26553        xmlCleanupOutputCallbacks();
26554        call_tests++;
26555        xmlResetLastError();
26556        if (mem_base != xmlMemBlocks()) {
26557            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
26558	           xmlMemBlocks() - mem_base);
26559	    test_ret++;
26560            printf("\n");
26561        }
26562    function_tests++;
26563#endif
26564
26565    return(test_ret);
26566}
26567
26568
26569static int
26570test_xmlFileClose(void) {
26571    int test_ret = 0;
26572
26573    int mem_base;
26574    int ret_val;
26575    void * context; /* the I/O context */
26576    int n_context;
26577
26578    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26579        mem_base = xmlMemBlocks();
26580        context = gen_void_ptr(n_context, 0);
26581
26582        ret_val = xmlFileClose(context);
26583        desret_int(ret_val);
26584        call_tests++;
26585        des_void_ptr(n_context, context, 0);
26586        xmlResetLastError();
26587        if (mem_base != xmlMemBlocks()) {
26588            printf("Leak of %d blocks found in xmlFileClose",
26589	           xmlMemBlocks() - mem_base);
26590	    test_ret++;
26591            printf(" %d", n_context);
26592            printf("\n");
26593        }
26594    }
26595    function_tests++;
26596
26597    return(test_ret);
26598}
26599
26600
26601static int
26602test_xmlFileMatch(void) {
26603    int test_ret = 0;
26604
26605    int mem_base;
26606    int ret_val;
26607    const char * filename; /* the URI for matching */
26608    int n_filename;
26609
26610    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26611        mem_base = xmlMemBlocks();
26612        filename = gen_filepath(n_filename, 0);
26613
26614        ret_val = xmlFileMatch(filename);
26615        desret_int(ret_val);
26616        call_tests++;
26617        des_filepath(n_filename, filename, 0);
26618        xmlResetLastError();
26619        if (mem_base != xmlMemBlocks()) {
26620            printf("Leak of %d blocks found in xmlFileMatch",
26621	           xmlMemBlocks() - mem_base);
26622	    test_ret++;
26623            printf(" %d", n_filename);
26624            printf("\n");
26625        }
26626    }
26627    function_tests++;
26628
26629    return(test_ret);
26630}
26631
26632
26633static int
26634test_xmlFileOpen(void) {
26635    int test_ret = 0;
26636
26637    int mem_base;
26638    void * ret_val;
26639    const char * filename; /* the URI for matching */
26640    int n_filename;
26641
26642    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26643        mem_base = xmlMemBlocks();
26644        filename = gen_filepath(n_filename, 0);
26645
26646        ret_val = xmlFileOpen(filename);
26647        desret_void_ptr(ret_val);
26648        call_tests++;
26649        des_filepath(n_filename, filename, 0);
26650        xmlResetLastError();
26651        if (mem_base != xmlMemBlocks()) {
26652            printf("Leak of %d blocks found in xmlFileOpen",
26653	           xmlMemBlocks() - mem_base);
26654	    test_ret++;
26655            printf(" %d", n_filename);
26656            printf("\n");
26657        }
26658    }
26659    function_tests++;
26660
26661    return(test_ret);
26662}
26663
26664
26665static int
26666test_xmlFileRead(void) {
26667    int test_ret = 0;
26668
26669    int mem_base;
26670    int ret_val;
26671    void * context; /* the I/O context */
26672    int n_context;
26673    char * buffer; /* where to drop data */
26674    int n_buffer;
26675    int len; /* number of bytes to write */
26676    int n_len;
26677
26678    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26679    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26680    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26681        mem_base = xmlMemBlocks();
26682        context = gen_void_ptr(n_context, 0);
26683        buffer = gen_char_ptr(n_buffer, 1);
26684        len = gen_int(n_len, 2);
26685
26686        ret_val = xmlFileRead(context, buffer, len);
26687        desret_int(ret_val);
26688        call_tests++;
26689        des_void_ptr(n_context, context, 0);
26690        des_char_ptr(n_buffer, buffer, 1);
26691        des_int(n_len, len, 2);
26692        xmlResetLastError();
26693        if (mem_base != xmlMemBlocks()) {
26694            printf("Leak of %d blocks found in xmlFileRead",
26695	           xmlMemBlocks() - mem_base);
26696	    test_ret++;
26697            printf(" %d", n_context);
26698            printf(" %d", n_buffer);
26699            printf(" %d", n_len);
26700            printf("\n");
26701        }
26702    }
26703    }
26704    }
26705    function_tests++;
26706
26707    return(test_ret);
26708}
26709
26710
26711static int
26712test_xmlIOFTPClose(void) {
26713    int test_ret = 0;
26714
26715#if defined(LIBXML_FTP_ENABLED)
26716    int mem_base;
26717    int ret_val;
26718    void * context; /* the I/O context */
26719    int n_context;
26720
26721    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26722        mem_base = xmlMemBlocks();
26723        context = gen_void_ptr(n_context, 0);
26724
26725        ret_val = xmlIOFTPClose(context);
26726        desret_int(ret_val);
26727        call_tests++;
26728        des_void_ptr(n_context, context, 0);
26729        xmlResetLastError();
26730        if (mem_base != xmlMemBlocks()) {
26731            printf("Leak of %d blocks found in xmlIOFTPClose",
26732	           xmlMemBlocks() - mem_base);
26733	    test_ret++;
26734            printf(" %d", n_context);
26735            printf("\n");
26736        }
26737    }
26738    function_tests++;
26739#endif
26740
26741    return(test_ret);
26742}
26743
26744
26745static int
26746test_xmlIOFTPMatch(void) {
26747    int test_ret = 0;
26748
26749#if defined(LIBXML_FTP_ENABLED)
26750    int mem_base;
26751    int ret_val;
26752    const char * filename; /* the URI for matching */
26753    int n_filename;
26754
26755    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26756        mem_base = xmlMemBlocks();
26757        filename = gen_filepath(n_filename, 0);
26758
26759        ret_val = xmlIOFTPMatch(filename);
26760        desret_int(ret_val);
26761        call_tests++;
26762        des_filepath(n_filename, filename, 0);
26763        xmlResetLastError();
26764        if (mem_base != xmlMemBlocks()) {
26765            printf("Leak of %d blocks found in xmlIOFTPMatch",
26766	           xmlMemBlocks() - mem_base);
26767	    test_ret++;
26768            printf(" %d", n_filename);
26769            printf("\n");
26770        }
26771    }
26772    function_tests++;
26773#endif
26774
26775    return(test_ret);
26776}
26777
26778
26779static int
26780test_xmlIOFTPOpen(void) {
26781    int test_ret = 0;
26782
26783#if defined(LIBXML_FTP_ENABLED)
26784    int mem_base;
26785    void * ret_val;
26786    const char * filename; /* the URI for matching */
26787    int n_filename;
26788
26789    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26790        mem_base = xmlMemBlocks();
26791        filename = gen_filepath(n_filename, 0);
26792
26793        ret_val = xmlIOFTPOpen(filename);
26794        desret_void_ptr(ret_val);
26795        call_tests++;
26796        des_filepath(n_filename, filename, 0);
26797        xmlResetLastError();
26798        if (mem_base != xmlMemBlocks()) {
26799            printf("Leak of %d blocks found in xmlIOFTPOpen",
26800	           xmlMemBlocks() - mem_base);
26801	    test_ret++;
26802            printf(" %d", n_filename);
26803            printf("\n");
26804        }
26805    }
26806    function_tests++;
26807#endif
26808
26809    return(test_ret);
26810}
26811
26812
26813static int
26814test_xmlIOFTPRead(void) {
26815    int test_ret = 0;
26816
26817#if defined(LIBXML_FTP_ENABLED)
26818    int mem_base;
26819    int ret_val;
26820    void * context; /* the I/O context */
26821    int n_context;
26822    char * buffer; /* where to drop data */
26823    int n_buffer;
26824    int len; /* number of bytes to write */
26825    int n_len;
26826
26827    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26828    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26829    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26830        mem_base = xmlMemBlocks();
26831        context = gen_void_ptr(n_context, 0);
26832        buffer = gen_char_ptr(n_buffer, 1);
26833        len = gen_int(n_len, 2);
26834
26835        ret_val = xmlIOFTPRead(context, buffer, len);
26836        desret_int(ret_val);
26837        call_tests++;
26838        des_void_ptr(n_context, context, 0);
26839        des_char_ptr(n_buffer, buffer, 1);
26840        des_int(n_len, len, 2);
26841        xmlResetLastError();
26842        if (mem_base != xmlMemBlocks()) {
26843            printf("Leak of %d blocks found in xmlIOFTPRead",
26844	           xmlMemBlocks() - mem_base);
26845	    test_ret++;
26846            printf(" %d", n_context);
26847            printf(" %d", n_buffer);
26848            printf(" %d", n_len);
26849            printf("\n");
26850        }
26851    }
26852    }
26853    }
26854    function_tests++;
26855#endif
26856
26857    return(test_ret);
26858}
26859
26860
26861static int
26862test_xmlIOHTTPClose(void) {
26863    int test_ret = 0;
26864
26865#if defined(LIBXML_HTTP_ENABLED)
26866    int mem_base;
26867    int ret_val;
26868    void * context; /* the I/O context */
26869    int n_context;
26870
26871    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26872        mem_base = xmlMemBlocks();
26873        context = gen_void_ptr(n_context, 0);
26874
26875        ret_val = xmlIOHTTPClose(context);
26876        desret_int(ret_val);
26877        call_tests++;
26878        des_void_ptr(n_context, context, 0);
26879        xmlResetLastError();
26880        if (mem_base != xmlMemBlocks()) {
26881            printf("Leak of %d blocks found in xmlIOHTTPClose",
26882	           xmlMemBlocks() - mem_base);
26883	    test_ret++;
26884            printf(" %d", n_context);
26885            printf("\n");
26886        }
26887    }
26888    function_tests++;
26889#endif
26890
26891    return(test_ret);
26892}
26893
26894
26895static int
26896test_xmlIOHTTPMatch(void) {
26897    int test_ret = 0;
26898
26899#if defined(LIBXML_HTTP_ENABLED)
26900    int mem_base;
26901    int ret_val;
26902    const char * filename; /* the URI for matching */
26903    int n_filename;
26904
26905    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26906        mem_base = xmlMemBlocks();
26907        filename = gen_filepath(n_filename, 0);
26908
26909        ret_val = xmlIOHTTPMatch(filename);
26910        desret_int(ret_val);
26911        call_tests++;
26912        des_filepath(n_filename, filename, 0);
26913        xmlResetLastError();
26914        if (mem_base != xmlMemBlocks()) {
26915            printf("Leak of %d blocks found in xmlIOHTTPMatch",
26916	           xmlMemBlocks() - mem_base);
26917	    test_ret++;
26918            printf(" %d", n_filename);
26919            printf("\n");
26920        }
26921    }
26922    function_tests++;
26923#endif
26924
26925    return(test_ret);
26926}
26927
26928
26929static int
26930test_xmlIOHTTPOpen(void) {
26931    int test_ret = 0;
26932
26933#if defined(LIBXML_HTTP_ENABLED)
26934    int mem_base;
26935    void * ret_val;
26936    const char * filename; /* the URI for matching */
26937    int n_filename;
26938
26939    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26940        mem_base = xmlMemBlocks();
26941        filename = gen_filepath(n_filename, 0);
26942
26943        ret_val = xmlIOHTTPOpen(filename);
26944        desret_xmlNanoHTTPCtxtPtr(ret_val);
26945        call_tests++;
26946        des_filepath(n_filename, filename, 0);
26947        xmlResetLastError();
26948        if (mem_base != xmlMemBlocks()) {
26949            printf("Leak of %d blocks found in xmlIOHTTPOpen",
26950	           xmlMemBlocks() - mem_base);
26951	    test_ret++;
26952            printf(" %d", n_filename);
26953            printf("\n");
26954        }
26955    }
26956    function_tests++;
26957#endif
26958
26959    return(test_ret);
26960}
26961
26962
26963static int
26964test_xmlIOHTTPRead(void) {
26965    int test_ret = 0;
26966
26967#if defined(LIBXML_HTTP_ENABLED)
26968    int mem_base;
26969    int ret_val;
26970    void * context; /* the I/O context */
26971    int n_context;
26972    char * buffer; /* where to drop data */
26973    int n_buffer;
26974    int len; /* number of bytes to write */
26975    int n_len;
26976
26977    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26978    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26979    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26980        mem_base = xmlMemBlocks();
26981        context = gen_void_ptr(n_context, 0);
26982        buffer = gen_char_ptr(n_buffer, 1);
26983        len = gen_int(n_len, 2);
26984
26985        ret_val = xmlIOHTTPRead(context, buffer, len);
26986        desret_int(ret_val);
26987        call_tests++;
26988        des_void_ptr(n_context, context, 0);
26989        des_char_ptr(n_buffer, buffer, 1);
26990        des_int(n_len, len, 2);
26991        xmlResetLastError();
26992        if (mem_base != xmlMemBlocks()) {
26993            printf("Leak of %d blocks found in xmlIOHTTPRead",
26994	           xmlMemBlocks() - mem_base);
26995	    test_ret++;
26996            printf(" %d", n_context);
26997            printf(" %d", n_buffer);
26998            printf(" %d", n_len);
26999            printf("\n");
27000        }
27001    }
27002    }
27003    }
27004    function_tests++;
27005#endif
27006
27007    return(test_ret);
27008}
27009
27010
27011static int
27012test_xmlNoNetExternalEntityLoader(void) {
27013    int test_ret = 0;
27014
27015    int mem_base;
27016    xmlParserInputPtr ret_val;
27017    const char * URL; /* the URL for the entity to load */
27018    int n_URL;
27019    char * ID; /* the System ID for the entity to load */
27020    int n_ID;
27021    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27022    int n_ctxt;
27023
27024    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27025    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27026    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27027        mem_base = xmlMemBlocks();
27028        URL = gen_filepath(n_URL, 0);
27029        ID = gen_const_char_ptr(n_ID, 1);
27030        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27031
27032        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27033        desret_xmlParserInputPtr(ret_val);
27034        call_tests++;
27035        des_filepath(n_URL, URL, 0);
27036        des_const_char_ptr(n_ID, (const char *)ID, 1);
27037        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27038        xmlResetLastError();
27039        if (mem_base != xmlMemBlocks()) {
27040            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27041	           xmlMemBlocks() - mem_base);
27042	    test_ret++;
27043            printf(" %d", n_URL);
27044            printf(" %d", n_ID);
27045            printf(" %d", n_ctxt);
27046            printf("\n");
27047        }
27048    }
27049    }
27050    }
27051    function_tests++;
27052
27053    return(test_ret);
27054}
27055
27056
27057static int
27058test_xmlNormalizeWindowsPath(void) {
27059    int test_ret = 0;
27060
27061    int mem_base;
27062    xmlChar * ret_val;
27063    xmlChar * path; /* the input file path */
27064    int n_path;
27065
27066    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27067        mem_base = xmlMemBlocks();
27068        path = gen_const_xmlChar_ptr(n_path, 0);
27069
27070        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27071        desret_xmlChar_ptr(ret_val);
27072        call_tests++;
27073        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27074        xmlResetLastError();
27075        if (mem_base != xmlMemBlocks()) {
27076            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27077	           xmlMemBlocks() - mem_base);
27078	    test_ret++;
27079            printf(" %d", n_path);
27080            printf("\n");
27081        }
27082    }
27083    function_tests++;
27084
27085    return(test_ret);
27086}
27087
27088
27089static int
27090test_xmlOutputBufferCreateFd(void) {
27091    int test_ret = 0;
27092
27093#if defined(LIBXML_OUTPUT_ENABLED)
27094    int mem_base;
27095    xmlOutputBufferPtr ret_val;
27096    int fd; /* a file descriptor number */
27097    int n_fd;
27098    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27099    int n_encoder;
27100
27101    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27102    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27103        mem_base = xmlMemBlocks();
27104        fd = gen_int(n_fd, 0);
27105        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27106
27107        ret_val = xmlOutputBufferCreateFd(fd, encoder);
27108        desret_xmlOutputBufferPtr(ret_val);
27109        call_tests++;
27110        des_int(n_fd, fd, 0);
27111        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27112        xmlResetLastError();
27113        if (mem_base != xmlMemBlocks()) {
27114            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
27115	           xmlMemBlocks() - mem_base);
27116	    test_ret++;
27117            printf(" %d", n_fd);
27118            printf(" %d", n_encoder);
27119            printf("\n");
27120        }
27121    }
27122    }
27123    function_tests++;
27124#endif
27125
27126    return(test_ret);
27127}
27128
27129
27130static int
27131test_xmlOutputBufferCreateFile(void) {
27132    int test_ret = 0;
27133
27134#if defined(LIBXML_OUTPUT_ENABLED)
27135    int mem_base;
27136    xmlOutputBufferPtr ret_val;
27137    FILE * file; /* a FILE* */
27138    int n_file;
27139    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27140    int n_encoder;
27141
27142    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27143    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27144        mem_base = xmlMemBlocks();
27145        file = gen_FILE_ptr(n_file, 0);
27146        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27147
27148        ret_val = xmlOutputBufferCreateFile(file, encoder);
27149        desret_xmlOutputBufferPtr(ret_val);
27150        call_tests++;
27151        des_FILE_ptr(n_file, file, 0);
27152        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27153        xmlResetLastError();
27154        if (mem_base != xmlMemBlocks()) {
27155            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
27156	           xmlMemBlocks() - mem_base);
27157	    test_ret++;
27158            printf(" %d", n_file);
27159            printf(" %d", n_encoder);
27160            printf("\n");
27161        }
27162    }
27163    }
27164    function_tests++;
27165#endif
27166
27167    return(test_ret);
27168}
27169
27170
27171static int
27172test_xmlOutputBufferCreateFilename(void) {
27173    int test_ret = 0;
27174
27175#if defined(LIBXML_OUTPUT_ENABLED)
27176    int mem_base;
27177    xmlOutputBufferPtr ret_val;
27178    const char * URI; /* a C string containing the URI or filename */
27179    int n_URI;
27180    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27181    int n_encoder;
27182    int compression; /* the compression ration (0 none, 9 max). */
27183    int n_compression;
27184
27185    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27186    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27187    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
27188        mem_base = xmlMemBlocks();
27189        URI = gen_fileoutput(n_URI, 0);
27190        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27191        compression = gen_int(n_compression, 2);
27192
27193        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
27194        desret_xmlOutputBufferPtr(ret_val);
27195        call_tests++;
27196        des_fileoutput(n_URI, URI, 0);
27197        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27198        des_int(n_compression, compression, 2);
27199        xmlResetLastError();
27200        if (mem_base != xmlMemBlocks()) {
27201            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
27202	           xmlMemBlocks() - mem_base);
27203	    test_ret++;
27204            printf(" %d", n_URI);
27205            printf(" %d", n_encoder);
27206            printf(" %d", n_compression);
27207            printf("\n");
27208        }
27209    }
27210    }
27211    }
27212    function_tests++;
27213#endif
27214
27215    return(test_ret);
27216}
27217
27218
27219static int
27220test_xmlOutputBufferFlush(void) {
27221    int test_ret = 0;
27222
27223#if defined(LIBXML_OUTPUT_ENABLED)
27224    int mem_base;
27225    int ret_val;
27226    xmlOutputBufferPtr out; /* a buffered output */
27227    int n_out;
27228
27229    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27230        mem_base = xmlMemBlocks();
27231        out = gen_xmlOutputBufferPtr(n_out, 0);
27232
27233        ret_val = xmlOutputBufferFlush(out);
27234        desret_int(ret_val);
27235        call_tests++;
27236        des_xmlOutputBufferPtr(n_out, out, 0);
27237        xmlResetLastError();
27238        if (mem_base != xmlMemBlocks()) {
27239            printf("Leak of %d blocks found in xmlOutputBufferFlush",
27240	           xmlMemBlocks() - mem_base);
27241	    test_ret++;
27242            printf(" %d", n_out);
27243            printf("\n");
27244        }
27245    }
27246    function_tests++;
27247#endif
27248
27249    return(test_ret);
27250}
27251
27252
27253static int
27254test_xmlOutputBufferWrite(void) {
27255    int test_ret = 0;
27256
27257#if defined(LIBXML_OUTPUT_ENABLED)
27258    int mem_base;
27259    int ret_val;
27260    xmlOutputBufferPtr out; /* a buffered parser output */
27261    int n_out;
27262    int len; /* the size in bytes of the array. */
27263    int n_len;
27264    char * buf; /* an char array */
27265    int n_buf;
27266
27267    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27268    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27269    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27270        mem_base = xmlMemBlocks();
27271        out = gen_xmlOutputBufferPtr(n_out, 0);
27272        len = gen_int(n_len, 1);
27273        buf = gen_const_char_ptr(n_buf, 2);
27274
27275        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
27276        desret_int(ret_val);
27277        call_tests++;
27278        des_xmlOutputBufferPtr(n_out, out, 0);
27279        des_int(n_len, len, 1);
27280        des_const_char_ptr(n_buf, (const char *)buf, 2);
27281        xmlResetLastError();
27282        if (mem_base != xmlMemBlocks()) {
27283            printf("Leak of %d blocks found in xmlOutputBufferWrite",
27284	           xmlMemBlocks() - mem_base);
27285	    test_ret++;
27286            printf(" %d", n_out);
27287            printf(" %d", n_len);
27288            printf(" %d", n_buf);
27289            printf("\n");
27290        }
27291    }
27292    }
27293    }
27294    function_tests++;
27295#endif
27296
27297    return(test_ret);
27298}
27299
27300
27301static int
27302test_xmlOutputBufferWriteEscape(void) {
27303    int test_ret = 0;
27304
27305
27306    /* missing type support */
27307    return(test_ret);
27308}
27309
27310
27311static int
27312test_xmlOutputBufferWriteString(void) {
27313    int test_ret = 0;
27314
27315#if defined(LIBXML_OUTPUT_ENABLED)
27316    int mem_base;
27317    int ret_val;
27318    xmlOutputBufferPtr out; /* a buffered parser output */
27319    int n_out;
27320    char * str; /* a zero terminated C string */
27321    int n_str;
27322
27323    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27324    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
27325        mem_base = xmlMemBlocks();
27326        out = gen_xmlOutputBufferPtr(n_out, 0);
27327        str = gen_const_char_ptr(n_str, 1);
27328
27329        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
27330        desret_int(ret_val);
27331        call_tests++;
27332        des_xmlOutputBufferPtr(n_out, out, 0);
27333        des_const_char_ptr(n_str, (const char *)str, 1);
27334        xmlResetLastError();
27335        if (mem_base != xmlMemBlocks()) {
27336            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
27337	           xmlMemBlocks() - mem_base);
27338	    test_ret++;
27339            printf(" %d", n_out);
27340            printf(" %d", n_str);
27341            printf("\n");
27342        }
27343    }
27344    }
27345    function_tests++;
27346#endif
27347
27348    return(test_ret);
27349}
27350
27351
27352static int
27353test_xmlParserGetDirectory(void) {
27354    int test_ret = 0;
27355
27356
27357    /* missing type support */
27358    return(test_ret);
27359}
27360
27361
27362static int
27363test_xmlParserInputBufferCreateFd(void) {
27364    int test_ret = 0;
27365
27366    int mem_base;
27367    xmlParserInputBufferPtr ret_val;
27368    int fd; /* a file descriptor number */
27369    int n_fd;
27370    xmlCharEncoding enc; /* the charset encoding if known */
27371    int n_enc;
27372
27373    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27374    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27375        mem_base = xmlMemBlocks();
27376        fd = gen_int(n_fd, 0);
27377        enc = gen_xmlCharEncoding(n_enc, 1);
27378        if (fd >= 0) fd = -1;
27379
27380        ret_val = xmlParserInputBufferCreateFd(fd, enc);
27381        desret_xmlParserInputBufferPtr(ret_val);
27382        call_tests++;
27383        des_int(n_fd, fd, 0);
27384        des_xmlCharEncoding(n_enc, enc, 1);
27385        xmlResetLastError();
27386        if (mem_base != xmlMemBlocks()) {
27387            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
27388	           xmlMemBlocks() - mem_base);
27389	    test_ret++;
27390            printf(" %d", n_fd);
27391            printf(" %d", n_enc);
27392            printf("\n");
27393        }
27394    }
27395    }
27396    function_tests++;
27397
27398    return(test_ret);
27399}
27400
27401
27402static int
27403test_xmlParserInputBufferCreateFile(void) {
27404    int test_ret = 0;
27405
27406    int mem_base;
27407    xmlParserInputBufferPtr ret_val;
27408    FILE * file; /* a FILE* */
27409    int n_file;
27410    xmlCharEncoding enc; /* the charset encoding if known */
27411    int n_enc;
27412
27413    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27414    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27415        mem_base = xmlMemBlocks();
27416        file = gen_FILE_ptr(n_file, 0);
27417        enc = gen_xmlCharEncoding(n_enc, 1);
27418
27419        ret_val = xmlParserInputBufferCreateFile(file, enc);
27420        desret_xmlParserInputBufferPtr(ret_val);
27421        call_tests++;
27422        des_FILE_ptr(n_file, file, 0);
27423        des_xmlCharEncoding(n_enc, enc, 1);
27424        xmlResetLastError();
27425        if (mem_base != xmlMemBlocks()) {
27426            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
27427	           xmlMemBlocks() - mem_base);
27428	    test_ret++;
27429            printf(" %d", n_file);
27430            printf(" %d", n_enc);
27431            printf("\n");
27432        }
27433    }
27434    }
27435    function_tests++;
27436
27437    return(test_ret);
27438}
27439
27440
27441static int
27442test_xmlParserInputBufferCreateFilename(void) {
27443    int test_ret = 0;
27444
27445    int mem_base;
27446    xmlParserInputBufferPtr ret_val;
27447    const char * URI; /* a C string containing the URI or filename */
27448    int n_URI;
27449    xmlCharEncoding enc; /* the charset encoding if known */
27450    int n_enc;
27451
27452    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27453    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27454        mem_base = xmlMemBlocks();
27455        URI = gen_fileoutput(n_URI, 0);
27456        enc = gen_xmlCharEncoding(n_enc, 1);
27457
27458        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
27459        desret_xmlParserInputBufferPtr(ret_val);
27460        call_tests++;
27461        des_fileoutput(n_URI, URI, 0);
27462        des_xmlCharEncoding(n_enc, enc, 1);
27463        xmlResetLastError();
27464        if (mem_base != xmlMemBlocks()) {
27465            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
27466	           xmlMemBlocks() - mem_base);
27467	    test_ret++;
27468            printf(" %d", n_URI);
27469            printf(" %d", n_enc);
27470            printf("\n");
27471        }
27472    }
27473    }
27474    function_tests++;
27475
27476    return(test_ret);
27477}
27478
27479
27480static int
27481test_xmlParserInputBufferCreateMem(void) {
27482    int test_ret = 0;
27483
27484    int mem_base;
27485    xmlParserInputBufferPtr ret_val;
27486    char * mem; /* the memory input */
27487    int n_mem;
27488    int size; /* the length of the memory block */
27489    int n_size;
27490    xmlCharEncoding enc; /* the charset encoding if known */
27491    int n_enc;
27492
27493    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27494    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27495    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27496        mem_base = xmlMemBlocks();
27497        mem = gen_const_char_ptr(n_mem, 0);
27498        size = gen_int(n_size, 1);
27499        enc = gen_xmlCharEncoding(n_enc, 2);
27500
27501        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
27502        desret_xmlParserInputBufferPtr(ret_val);
27503        call_tests++;
27504        des_const_char_ptr(n_mem, (const char *)mem, 0);
27505        des_int(n_size, size, 1);
27506        des_xmlCharEncoding(n_enc, enc, 2);
27507        xmlResetLastError();
27508        if (mem_base != xmlMemBlocks()) {
27509            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
27510	           xmlMemBlocks() - mem_base);
27511	    test_ret++;
27512            printf(" %d", n_mem);
27513            printf(" %d", n_size);
27514            printf(" %d", n_enc);
27515            printf("\n");
27516        }
27517    }
27518    }
27519    }
27520    function_tests++;
27521
27522    return(test_ret);
27523}
27524
27525
27526static int
27527test_xmlParserInputBufferCreateStatic(void) {
27528    int test_ret = 0;
27529
27530    int mem_base;
27531    xmlParserInputBufferPtr ret_val;
27532    char * mem; /* the memory input */
27533    int n_mem;
27534    int size; /* the length of the memory block */
27535    int n_size;
27536    xmlCharEncoding enc; /* the charset encoding if known */
27537    int n_enc;
27538
27539    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27540    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27541    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27542        mem_base = xmlMemBlocks();
27543        mem = gen_const_char_ptr(n_mem, 0);
27544        size = gen_int(n_size, 1);
27545        enc = gen_xmlCharEncoding(n_enc, 2);
27546
27547        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
27548        desret_xmlParserInputBufferPtr(ret_val);
27549        call_tests++;
27550        des_const_char_ptr(n_mem, (const char *)mem, 0);
27551        des_int(n_size, size, 1);
27552        des_xmlCharEncoding(n_enc, enc, 2);
27553        xmlResetLastError();
27554        if (mem_base != xmlMemBlocks()) {
27555            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
27556	           xmlMemBlocks() - mem_base);
27557	    test_ret++;
27558            printf(" %d", n_mem);
27559            printf(" %d", n_size);
27560            printf(" %d", n_enc);
27561            printf("\n");
27562        }
27563    }
27564    }
27565    }
27566    function_tests++;
27567
27568    return(test_ret);
27569}
27570
27571
27572static int
27573test_xmlParserInputBufferGrow(void) {
27574    int test_ret = 0;
27575
27576    int mem_base;
27577    int ret_val;
27578    xmlParserInputBufferPtr in; /* a buffered parser input */
27579    int n_in;
27580    int len; /* indicative value of the amount of chars to read */
27581    int n_len;
27582
27583    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27584    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27585        mem_base = xmlMemBlocks();
27586        in = gen_xmlParserInputBufferPtr(n_in, 0);
27587        len = gen_int(n_len, 1);
27588
27589        ret_val = xmlParserInputBufferGrow(in, len);
27590        desret_int(ret_val);
27591        call_tests++;
27592        des_xmlParserInputBufferPtr(n_in, in, 0);
27593        des_int(n_len, len, 1);
27594        xmlResetLastError();
27595        if (mem_base != xmlMemBlocks()) {
27596            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
27597	           xmlMemBlocks() - mem_base);
27598	    test_ret++;
27599            printf(" %d", n_in);
27600            printf(" %d", n_len);
27601            printf("\n");
27602        }
27603    }
27604    }
27605    function_tests++;
27606
27607    return(test_ret);
27608}
27609
27610
27611static int
27612test_xmlParserInputBufferPush(void) {
27613    int test_ret = 0;
27614
27615    int mem_base;
27616    int ret_val;
27617    xmlParserInputBufferPtr in; /* a buffered parser input */
27618    int n_in;
27619    int len; /* the size in bytes of the array. */
27620    int n_len;
27621    char * buf; /* an char array */
27622    int n_buf;
27623
27624    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27625    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27626    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27627        mem_base = xmlMemBlocks();
27628        in = gen_xmlParserInputBufferPtr(n_in, 0);
27629        len = gen_int(n_len, 1);
27630        buf = gen_const_char_ptr(n_buf, 2);
27631
27632        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
27633        desret_int(ret_val);
27634        call_tests++;
27635        des_xmlParserInputBufferPtr(n_in, in, 0);
27636        des_int(n_len, len, 1);
27637        des_const_char_ptr(n_buf, (const char *)buf, 2);
27638        xmlResetLastError();
27639        if (mem_base != xmlMemBlocks()) {
27640            printf("Leak of %d blocks found in xmlParserInputBufferPush",
27641	           xmlMemBlocks() - mem_base);
27642	    test_ret++;
27643            printf(" %d", n_in);
27644            printf(" %d", n_len);
27645            printf(" %d", n_buf);
27646            printf("\n");
27647        }
27648    }
27649    }
27650    }
27651    function_tests++;
27652
27653    return(test_ret);
27654}
27655
27656
27657static int
27658test_xmlParserInputBufferRead(void) {
27659    int test_ret = 0;
27660
27661    int mem_base;
27662    int ret_val;
27663    xmlParserInputBufferPtr in; /* a buffered parser input */
27664    int n_in;
27665    int len; /* indicative value of the amount of chars to read */
27666    int n_len;
27667
27668    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27669    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27670        mem_base = xmlMemBlocks();
27671        in = gen_xmlParserInputBufferPtr(n_in, 0);
27672        len = gen_int(n_len, 1);
27673
27674        ret_val = xmlParserInputBufferRead(in, len);
27675        desret_int(ret_val);
27676        call_tests++;
27677        des_xmlParserInputBufferPtr(n_in, in, 0);
27678        des_int(n_len, len, 1);
27679        xmlResetLastError();
27680        if (mem_base != xmlMemBlocks()) {
27681            printf("Leak of %d blocks found in xmlParserInputBufferRead",
27682	           xmlMemBlocks() - mem_base);
27683	    test_ret++;
27684            printf(" %d", n_in);
27685            printf(" %d", n_len);
27686            printf("\n");
27687        }
27688    }
27689    }
27690    function_tests++;
27691
27692    return(test_ret);
27693}
27694
27695
27696static int
27697test_xmlPopInputCallbacks(void) {
27698    int test_ret = 0;
27699
27700    int mem_base;
27701    int ret_val;
27702
27703        mem_base = xmlMemBlocks();
27704
27705        ret_val = xmlPopInputCallbacks();
27706        desret_int(ret_val);
27707        call_tests++;
27708        xmlResetLastError();
27709        if (mem_base != xmlMemBlocks()) {
27710            printf("Leak of %d blocks found in xmlPopInputCallbacks",
27711	           xmlMemBlocks() - mem_base);
27712	    test_ret++;
27713            printf("\n");
27714        }
27715    function_tests++;
27716
27717    return(test_ret);
27718}
27719
27720
27721static int
27722test_xmlRegisterDefaultInputCallbacks(void) {
27723    int test_ret = 0;
27724
27725    int mem_base;
27726
27727        mem_base = xmlMemBlocks();
27728
27729        xmlRegisterDefaultInputCallbacks();
27730        call_tests++;
27731        xmlResetLastError();
27732        if (mem_base != xmlMemBlocks()) {
27733            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
27734	           xmlMemBlocks() - mem_base);
27735	    test_ret++;
27736            printf("\n");
27737        }
27738    function_tests++;
27739
27740    return(test_ret);
27741}
27742
27743
27744static int
27745test_xmlRegisterDefaultOutputCallbacks(void) {
27746    int test_ret = 0;
27747
27748#if defined(LIBXML_OUTPUT_ENABLED)
27749    int mem_base;
27750
27751        mem_base = xmlMemBlocks();
27752
27753        xmlRegisterDefaultOutputCallbacks();
27754        call_tests++;
27755        xmlResetLastError();
27756        if (mem_base != xmlMemBlocks()) {
27757            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
27758	           xmlMemBlocks() - mem_base);
27759	    test_ret++;
27760            printf("\n");
27761        }
27762    function_tests++;
27763#endif
27764
27765    return(test_ret);
27766}
27767
27768
27769static int
27770test_xmlRegisterHTTPPostCallbacks(void) {
27771    int test_ret = 0;
27772
27773#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
27774    int mem_base;
27775
27776        mem_base = xmlMemBlocks();
27777
27778        xmlRegisterHTTPPostCallbacks();
27779        call_tests++;
27780        xmlResetLastError();
27781        if (mem_base != xmlMemBlocks()) {
27782            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
27783	           xmlMemBlocks() - mem_base);
27784	    test_ret++;
27785            printf("\n");
27786        }
27787    function_tests++;
27788#endif
27789
27790    return(test_ret);
27791}
27792
27793static int
27794test_xmlIO(void) {
27795    int test_ret = 0;
27796
27797    if (quiet == 0) printf("Testing xmlIO : 38 of 47 functions ...\n");
27798    test_ret += test_xmlAllocOutputBuffer();
27799    test_ret += test_xmlAllocParserInputBuffer();
27800    test_ret += test_xmlCheckFilename();
27801    test_ret += test_xmlCheckHTTPInput();
27802    test_ret += test_xmlCleanupInputCallbacks();
27803    test_ret += test_xmlCleanupOutputCallbacks();
27804    test_ret += test_xmlFileClose();
27805    test_ret += test_xmlFileMatch();
27806    test_ret += test_xmlFileOpen();
27807    test_ret += test_xmlFileRead();
27808    test_ret += test_xmlIOFTPClose();
27809    test_ret += test_xmlIOFTPMatch();
27810    test_ret += test_xmlIOFTPOpen();
27811    test_ret += test_xmlIOFTPRead();
27812    test_ret += test_xmlIOHTTPClose();
27813    test_ret += test_xmlIOHTTPMatch();
27814    test_ret += test_xmlIOHTTPOpen();
27815    test_ret += test_xmlIOHTTPRead();
27816    test_ret += test_xmlNoNetExternalEntityLoader();
27817    test_ret += test_xmlNormalizeWindowsPath();
27818    test_ret += test_xmlOutputBufferCreateFd();
27819    test_ret += test_xmlOutputBufferCreateFile();
27820    test_ret += test_xmlOutputBufferCreateFilename();
27821    test_ret += test_xmlOutputBufferFlush();
27822    test_ret += test_xmlOutputBufferWrite();
27823    test_ret += test_xmlOutputBufferWriteEscape();
27824    test_ret += test_xmlOutputBufferWriteString();
27825    test_ret += test_xmlParserGetDirectory();
27826    test_ret += test_xmlParserInputBufferCreateFd();
27827    test_ret += test_xmlParserInputBufferCreateFile();
27828    test_ret += test_xmlParserInputBufferCreateFilename();
27829    test_ret += test_xmlParserInputBufferCreateMem();
27830    test_ret += test_xmlParserInputBufferCreateStatic();
27831    test_ret += test_xmlParserInputBufferGrow();
27832    test_ret += test_xmlParserInputBufferPush();
27833    test_ret += test_xmlParserInputBufferRead();
27834    test_ret += test_xmlPopInputCallbacks();
27835    test_ret += test_xmlRegisterDefaultInputCallbacks();
27836    test_ret += test_xmlRegisterDefaultOutputCallbacks();
27837    test_ret += test_xmlRegisterHTTPPostCallbacks();
27838
27839    if (test_ret != 0)
27840	printf("Module xmlIO: %d errors\n", test_ret);
27841    return(test_ret);
27842}
27843#ifdef LIBXML_AUTOMATA_ENABLED
27844
27845#define gen_nb_xmlAutomataPtr 1
27846static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27847    return(NULL);
27848}
27849static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27850}
27851#endif
27852
27853
27854static int
27855test_xmlAutomataCompile(void) {
27856    int test_ret = 0;
27857
27858
27859    /* missing type support */
27860    return(test_ret);
27861}
27862
27863
27864static int
27865test_xmlAutomataGetInitState(void) {
27866    int test_ret = 0;
27867
27868
27869    /* missing type support */
27870    return(test_ret);
27871}
27872
27873
27874static int
27875test_xmlAutomataIsDeterminist(void) {
27876    int test_ret = 0;
27877
27878#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
27879    int mem_base;
27880    int ret_val;
27881    xmlAutomataPtr am; /* an automata */
27882    int n_am;
27883
27884    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27885        mem_base = xmlMemBlocks();
27886        am = gen_xmlAutomataPtr(n_am, 0);
27887
27888        ret_val = xmlAutomataIsDeterminist(am);
27889        desret_int(ret_val);
27890        call_tests++;
27891        des_xmlAutomataPtr(n_am, am, 0);
27892        xmlResetLastError();
27893        if (mem_base != xmlMemBlocks()) {
27894            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
27895	           xmlMemBlocks() - mem_base);
27896	    test_ret++;
27897            printf(" %d", n_am);
27898            printf("\n");
27899        }
27900    }
27901    function_tests++;
27902#endif
27903
27904    return(test_ret);
27905}
27906
27907#ifdef LIBXML_AUTOMATA_ENABLED
27908
27909#define gen_nb_xmlAutomataStatePtr 1
27910static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27911    return(NULL);
27912}
27913static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27914}
27915#endif
27916
27917
27918static int
27919test_xmlAutomataNewAllTrans(void) {
27920    int test_ret = 0;
27921
27922
27923    /* missing type support */
27924    return(test_ret);
27925}
27926
27927
27928static int
27929test_xmlAutomataNewCountTrans(void) {
27930    int test_ret = 0;
27931
27932
27933    /* missing type support */
27934    return(test_ret);
27935}
27936
27937
27938static int
27939test_xmlAutomataNewCountTrans2(void) {
27940    int test_ret = 0;
27941
27942
27943    /* missing type support */
27944    return(test_ret);
27945}
27946
27947
27948static int
27949test_xmlAutomataNewCountedTrans(void) {
27950    int test_ret = 0;
27951
27952
27953    /* missing type support */
27954    return(test_ret);
27955}
27956
27957
27958static int
27959test_xmlAutomataNewCounter(void) {
27960    int test_ret = 0;
27961
27962#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
27963    int mem_base;
27964    int ret_val;
27965    xmlAutomataPtr am; /* an automata */
27966    int n_am;
27967    int min; /* the minimal value on the counter */
27968    int n_min;
27969    int max; /* the maximal value on the counter */
27970    int n_max;
27971
27972    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27973    for (n_min = 0;n_min < gen_nb_int;n_min++) {
27974    for (n_max = 0;n_max < gen_nb_int;n_max++) {
27975        mem_base = xmlMemBlocks();
27976        am = gen_xmlAutomataPtr(n_am, 0);
27977        min = gen_int(n_min, 1);
27978        max = gen_int(n_max, 2);
27979
27980        ret_val = xmlAutomataNewCounter(am, min, max);
27981        desret_int(ret_val);
27982        call_tests++;
27983        des_xmlAutomataPtr(n_am, am, 0);
27984        des_int(n_min, min, 1);
27985        des_int(n_max, max, 2);
27986        xmlResetLastError();
27987        if (mem_base != xmlMemBlocks()) {
27988            printf("Leak of %d blocks found in xmlAutomataNewCounter",
27989	           xmlMemBlocks() - mem_base);
27990	    test_ret++;
27991            printf(" %d", n_am);
27992            printf(" %d", n_min);
27993            printf(" %d", n_max);
27994            printf("\n");
27995        }
27996    }
27997    }
27998    }
27999    function_tests++;
28000#endif
28001
28002    return(test_ret);
28003}
28004
28005
28006static int
28007test_xmlAutomataNewCounterTrans(void) {
28008    int test_ret = 0;
28009
28010
28011    /* missing type support */
28012    return(test_ret);
28013}
28014
28015
28016static int
28017test_xmlAutomataNewEpsilon(void) {
28018    int test_ret = 0;
28019
28020
28021    /* missing type support */
28022    return(test_ret);
28023}
28024
28025
28026static int
28027test_xmlAutomataNewOnceTrans(void) {
28028    int test_ret = 0;
28029
28030
28031    /* missing type support */
28032    return(test_ret);
28033}
28034
28035
28036static int
28037test_xmlAutomataNewOnceTrans2(void) {
28038    int test_ret = 0;
28039
28040
28041    /* missing type support */
28042    return(test_ret);
28043}
28044
28045
28046static int
28047test_xmlAutomataNewState(void) {
28048    int test_ret = 0;
28049
28050
28051    /* missing type support */
28052    return(test_ret);
28053}
28054
28055
28056static int
28057test_xmlAutomataNewTransition(void) {
28058    int test_ret = 0;
28059
28060
28061    /* missing type support */
28062    return(test_ret);
28063}
28064
28065
28066static int
28067test_xmlAutomataNewTransition2(void) {
28068    int test_ret = 0;
28069
28070
28071    /* missing type support */
28072    return(test_ret);
28073}
28074
28075
28076static int
28077test_xmlAutomataSetFinalState(void) {
28078    int test_ret = 0;
28079
28080#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28081    int mem_base;
28082    int ret_val;
28083    xmlAutomataPtr am; /* an automata */
28084    int n_am;
28085    xmlAutomataStatePtr state; /* a state in this automata */
28086    int n_state;
28087
28088    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28089    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
28090        mem_base = xmlMemBlocks();
28091        am = gen_xmlAutomataPtr(n_am, 0);
28092        state = gen_xmlAutomataStatePtr(n_state, 1);
28093
28094        ret_val = xmlAutomataSetFinalState(am, state);
28095        desret_int(ret_val);
28096        call_tests++;
28097        des_xmlAutomataPtr(n_am, am, 0);
28098        des_xmlAutomataStatePtr(n_state, state, 1);
28099        xmlResetLastError();
28100        if (mem_base != xmlMemBlocks()) {
28101            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
28102	           xmlMemBlocks() - mem_base);
28103	    test_ret++;
28104            printf(" %d", n_am);
28105            printf(" %d", n_state);
28106            printf("\n");
28107        }
28108    }
28109    }
28110    function_tests++;
28111#endif
28112
28113    return(test_ret);
28114}
28115
28116
28117static int
28118test_xmlNewAutomata(void) {
28119    int test_ret = 0;
28120
28121
28122    /* missing type support */
28123    return(test_ret);
28124}
28125
28126static int
28127test_xmlautomata(void) {
28128    int test_ret = 0;
28129
28130    if (quiet == 0) printf("Testing xmlautomata : 3 of 18 functions ...\n");
28131    test_ret += test_xmlAutomataCompile();
28132    test_ret += test_xmlAutomataGetInitState();
28133    test_ret += test_xmlAutomataIsDeterminist();
28134    test_ret += test_xmlAutomataNewAllTrans();
28135    test_ret += test_xmlAutomataNewCountTrans();
28136    test_ret += test_xmlAutomataNewCountTrans2();
28137    test_ret += test_xmlAutomataNewCountedTrans();
28138    test_ret += test_xmlAutomataNewCounter();
28139    test_ret += test_xmlAutomataNewCounterTrans();
28140    test_ret += test_xmlAutomataNewEpsilon();
28141    test_ret += test_xmlAutomataNewOnceTrans();
28142    test_ret += test_xmlAutomataNewOnceTrans2();
28143    test_ret += test_xmlAutomataNewState();
28144    test_ret += test_xmlAutomataNewTransition();
28145    test_ret += test_xmlAutomataNewTransition2();
28146    test_ret += test_xmlAutomataSetFinalState();
28147    test_ret += test_xmlNewAutomata();
28148
28149    if (test_ret != 0)
28150	printf("Module xmlautomata: %d errors\n", test_ret);
28151    return(test_ret);
28152}
28153
28154#define gen_nb_xmlGenericErrorFunc_ptr 1
28155static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28156    return(NULL);
28157}
28158static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28159}
28160
28161static int
28162test_initGenericErrorDefaultFunc(void) {
28163    int test_ret = 0;
28164
28165    int mem_base;
28166    xmlGenericErrorFunc * handler; /* the handler */
28167    int n_handler;
28168
28169    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
28170        mem_base = xmlMemBlocks();
28171        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
28172
28173        initGenericErrorDefaultFunc(handler);
28174        call_tests++;
28175        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
28176        xmlResetLastError();
28177        if (mem_base != xmlMemBlocks()) {
28178            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
28179	           xmlMemBlocks() - mem_base);
28180	    test_ret++;
28181            printf(" %d", n_handler);
28182            printf("\n");
28183        }
28184    }
28185    function_tests++;
28186
28187    return(test_ret);
28188}
28189
28190
28191#define gen_nb_xmlErrorPtr 1
28192static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28193    return(NULL);
28194}
28195static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28196}
28197
28198static int
28199test_xmlCopyError(void) {
28200    int test_ret = 0;
28201
28202    int mem_base;
28203    int ret_val;
28204    xmlErrorPtr from; /* a source error */
28205    int n_from;
28206    xmlErrorPtr to; /* a target error */
28207    int n_to;
28208
28209    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
28210    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
28211        mem_base = xmlMemBlocks();
28212        from = gen_xmlErrorPtr(n_from, 0);
28213        to = gen_xmlErrorPtr(n_to, 1);
28214
28215        ret_val = xmlCopyError(from, to);
28216        desret_int(ret_val);
28217        call_tests++;
28218        des_xmlErrorPtr(n_from, from, 0);
28219        des_xmlErrorPtr(n_to, to, 1);
28220        xmlResetLastError();
28221        if (mem_base != xmlMemBlocks()) {
28222            printf("Leak of %d blocks found in xmlCopyError",
28223	           xmlMemBlocks() - mem_base);
28224	    test_ret++;
28225            printf(" %d", n_from);
28226            printf(" %d", n_to);
28227            printf("\n");
28228        }
28229    }
28230    }
28231    function_tests++;
28232
28233    return(test_ret);
28234}
28235
28236
28237static int
28238test_xmlCtxtGetLastError(void) {
28239    int test_ret = 0;
28240
28241
28242    /* missing type support */
28243    return(test_ret);
28244}
28245
28246
28247static int
28248test_xmlCtxtResetLastError(void) {
28249    int test_ret = 0;
28250
28251    int mem_base;
28252    void * ctx; /* an XML parser context */
28253    int n_ctx;
28254
28255    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
28256        mem_base = xmlMemBlocks();
28257        ctx = gen_void_ptr(n_ctx, 0);
28258
28259        xmlCtxtResetLastError(ctx);
28260        call_tests++;
28261        des_void_ptr(n_ctx, ctx, 0);
28262        xmlResetLastError();
28263        if (mem_base != xmlMemBlocks()) {
28264            printf("Leak of %d blocks found in xmlCtxtResetLastError",
28265	           xmlMemBlocks() - mem_base);
28266	    test_ret++;
28267            printf(" %d", n_ctx);
28268            printf("\n");
28269        }
28270    }
28271    function_tests++;
28272
28273    return(test_ret);
28274}
28275
28276
28277static int
28278test_xmlGetLastError(void) {
28279    int test_ret = 0;
28280
28281
28282    /* missing type support */
28283    return(test_ret);
28284}
28285
28286
28287static int
28288test_xmlParserError(void) {
28289    int test_ret = 0;
28290
28291
28292    /* missing type support */
28293    return(test_ret);
28294}
28295
28296
28297static int
28298test_xmlParserPrintFileContext(void) {
28299    int test_ret = 0;
28300
28301    int mem_base;
28302    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28303    int n_input;
28304
28305    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28306        mem_base = xmlMemBlocks();
28307        input = gen_xmlParserInputPtr(n_input, 0);
28308
28309        xmlParserPrintFileContext(input);
28310        call_tests++;
28311        des_xmlParserInputPtr(n_input, input, 0);
28312        xmlResetLastError();
28313        if (mem_base != xmlMemBlocks()) {
28314            printf("Leak of %d blocks found in xmlParserPrintFileContext",
28315	           xmlMemBlocks() - mem_base);
28316	    test_ret++;
28317            printf(" %d", n_input);
28318            printf("\n");
28319        }
28320    }
28321    function_tests++;
28322
28323    return(test_ret);
28324}
28325
28326
28327static int
28328test_xmlParserPrintFileInfo(void) {
28329    int test_ret = 0;
28330
28331    int mem_base;
28332    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28333    int n_input;
28334
28335    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28336        mem_base = xmlMemBlocks();
28337        input = gen_xmlParserInputPtr(n_input, 0);
28338
28339        xmlParserPrintFileInfo(input);
28340        call_tests++;
28341        des_xmlParserInputPtr(n_input, input, 0);
28342        xmlResetLastError();
28343        if (mem_base != xmlMemBlocks()) {
28344            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
28345	           xmlMemBlocks() - mem_base);
28346	    test_ret++;
28347            printf(" %d", n_input);
28348            printf("\n");
28349        }
28350    }
28351    function_tests++;
28352
28353    return(test_ret);
28354}
28355
28356
28357static int
28358test_xmlParserValidityError(void) {
28359    int test_ret = 0;
28360
28361
28362    /* missing type support */
28363    return(test_ret);
28364}
28365
28366
28367static int
28368test_xmlParserValidityWarning(void) {
28369    int test_ret = 0;
28370
28371
28372    /* missing type support */
28373    return(test_ret);
28374}
28375
28376
28377static int
28378test_xmlParserWarning(void) {
28379    int test_ret = 0;
28380
28381
28382    /* missing type support */
28383    return(test_ret);
28384}
28385
28386
28387static int
28388test_xmlResetError(void) {
28389    int test_ret = 0;
28390
28391    int mem_base;
28392    xmlErrorPtr err; /* pointer to the error. */
28393    int n_err;
28394
28395    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
28396        mem_base = xmlMemBlocks();
28397        err = gen_xmlErrorPtr(n_err, 0);
28398
28399        xmlResetError(err);
28400        call_tests++;
28401        des_xmlErrorPtr(n_err, err, 0);
28402        xmlResetLastError();
28403        if (mem_base != xmlMemBlocks()) {
28404            printf("Leak of %d blocks found in xmlResetError",
28405	           xmlMemBlocks() - mem_base);
28406	    test_ret++;
28407            printf(" %d", n_err);
28408            printf("\n");
28409        }
28410    }
28411    function_tests++;
28412
28413    return(test_ret);
28414}
28415
28416
28417static int
28418test_xmlResetLastError(void) {
28419    int test_ret = 0;
28420
28421
28422
28423        xmlResetLastError();
28424        call_tests++;
28425        xmlResetLastError();
28426    function_tests++;
28427
28428    return(test_ret);
28429}
28430
28431
28432static int
28433test_xmlSetGenericErrorFunc(void) {
28434    int test_ret = 0;
28435
28436
28437    /* missing type support */
28438    return(test_ret);
28439}
28440
28441
28442static int
28443test_xmlSetStructuredErrorFunc(void) {
28444    int test_ret = 0;
28445
28446
28447    /* missing type support */
28448    return(test_ret);
28449}
28450
28451static int
28452test_xmlerror(void) {
28453    int test_ret = 0;
28454
28455    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
28456    test_ret += test_initGenericErrorDefaultFunc();
28457    test_ret += test_xmlCopyError();
28458    test_ret += test_xmlCtxtGetLastError();
28459    test_ret += test_xmlCtxtResetLastError();
28460    test_ret += test_xmlGetLastError();
28461    test_ret += test_xmlParserError();
28462    test_ret += test_xmlParserPrintFileContext();
28463    test_ret += test_xmlParserPrintFileInfo();
28464    test_ret += test_xmlParserValidityError();
28465    test_ret += test_xmlParserValidityWarning();
28466    test_ret += test_xmlParserWarning();
28467    test_ret += test_xmlResetError();
28468    test_ret += test_xmlResetLastError();
28469    test_ret += test_xmlSetGenericErrorFunc();
28470    test_ret += test_xmlSetStructuredErrorFunc();
28471
28472    if (test_ret != 0)
28473	printf("Module xmlerror: %d errors\n", test_ret);
28474    return(test_ret);
28475}
28476#ifdef LIBXML_MODULES_ENABLED
28477
28478#define gen_nb_xmlModulePtr 1
28479static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28480    return(NULL);
28481}
28482static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28483}
28484#endif
28485
28486
28487static int
28488test_xmlModuleClose(void) {
28489    int test_ret = 0;
28490
28491#if defined(LIBXML_MODULES_ENABLED)
28492    int mem_base;
28493    int ret_val;
28494    xmlModulePtr module; /* the module handle */
28495    int n_module;
28496
28497    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
28498        mem_base = xmlMemBlocks();
28499        module = gen_xmlModulePtr(n_module, 0);
28500
28501        ret_val = xmlModuleClose(module);
28502        desret_int(ret_val);
28503        call_tests++;
28504        des_xmlModulePtr(n_module, module, 0);
28505        xmlResetLastError();
28506        if (mem_base != xmlMemBlocks()) {
28507            printf("Leak of %d blocks found in xmlModuleClose",
28508	           xmlMemBlocks() - mem_base);
28509	    test_ret++;
28510            printf(" %d", n_module);
28511            printf("\n");
28512        }
28513    }
28514    function_tests++;
28515#endif
28516
28517    return(test_ret);
28518}
28519
28520
28521static int
28522test_xmlModuleOpen(void) {
28523    int test_ret = 0;
28524
28525
28526    /* missing type support */
28527    return(test_ret);
28528}
28529
28530
28531static int
28532test_xmlModuleSymbol(void) {
28533    int test_ret = 0;
28534
28535#if defined(LIBXML_MODULES_ENABLED)
28536    int mem_base;
28537    int ret_val;
28538    xmlModulePtr module; /* the module */
28539    int n_module;
28540    char * name; /* the name of the symbol */
28541    int n_name;
28542    void ** symbol; /* the resulting symbol address */
28543    int n_symbol;
28544
28545    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
28546    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
28547    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
28548        mem_base = xmlMemBlocks();
28549        module = gen_xmlModulePtr(n_module, 0);
28550        name = gen_const_char_ptr(n_name, 1);
28551        symbol = gen_void_ptr_ptr(n_symbol, 2);
28552
28553        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
28554        desret_int(ret_val);
28555        call_tests++;
28556        des_xmlModulePtr(n_module, module, 0);
28557        des_const_char_ptr(n_name, (const char *)name, 1);
28558        des_void_ptr_ptr(n_symbol, symbol, 2);
28559        xmlResetLastError();
28560        if (mem_base != xmlMemBlocks()) {
28561            printf("Leak of %d blocks found in xmlModuleSymbol",
28562	           xmlMemBlocks() - mem_base);
28563	    test_ret++;
28564            printf(" %d", n_module);
28565            printf(" %d", n_name);
28566            printf(" %d", n_symbol);
28567            printf("\n");
28568        }
28569    }
28570    }
28571    }
28572    function_tests++;
28573#endif
28574
28575    return(test_ret);
28576}
28577
28578static int
28579test_xmlmodule(void) {
28580    int test_ret = 0;
28581
28582    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
28583    test_ret += test_xmlModuleClose();
28584    test_ret += test_xmlModuleOpen();
28585    test_ret += test_xmlModuleSymbol();
28586
28587    if (test_ret != 0)
28588	printf("Module xmlmodule: %d errors\n", test_ret);
28589    return(test_ret);
28590}
28591
28592static int
28593test_xmlNewTextReader(void) {
28594    int test_ret = 0;
28595
28596#if defined(LIBXML_READER_ENABLED)
28597    int mem_base;
28598    xmlTextReaderPtr ret_val;
28599    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
28600    int n_input;
28601    const char * URI; /* the URI information for the source if available */
28602    int n_URI;
28603
28604    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
28605    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
28606        mem_base = xmlMemBlocks();
28607        input = gen_xmlParserInputBufferPtr(n_input, 0);
28608        URI = gen_filepath(n_URI, 1);
28609
28610        ret_val = xmlNewTextReader(input, URI);
28611        desret_xmlTextReaderPtr(ret_val);
28612        call_tests++;
28613        des_xmlParserInputBufferPtr(n_input, input, 0);
28614        des_filepath(n_URI, URI, 1);
28615        xmlResetLastError();
28616        if (mem_base != xmlMemBlocks()) {
28617            printf("Leak of %d blocks found in xmlNewTextReader",
28618	           xmlMemBlocks() - mem_base);
28619	    test_ret++;
28620            printf(" %d", n_input);
28621            printf(" %d", n_URI);
28622            printf("\n");
28623        }
28624    }
28625    }
28626    function_tests++;
28627#endif
28628
28629    return(test_ret);
28630}
28631
28632
28633static int
28634test_xmlNewTextReaderFilename(void) {
28635    int test_ret = 0;
28636
28637#if defined(LIBXML_READER_ENABLED)
28638    int mem_base;
28639    xmlTextReaderPtr ret_val;
28640    const char * URI; /* the URI of the resource to process */
28641    int n_URI;
28642
28643    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
28644        mem_base = xmlMemBlocks();
28645        URI = gen_filepath(n_URI, 0);
28646
28647        ret_val = xmlNewTextReaderFilename(URI);
28648        desret_xmlTextReaderPtr(ret_val);
28649        call_tests++;
28650        des_filepath(n_URI, URI, 0);
28651        xmlResetLastError();
28652        if (mem_base != xmlMemBlocks()) {
28653            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
28654	           xmlMemBlocks() - mem_base);
28655	    test_ret++;
28656            printf(" %d", n_URI);
28657            printf("\n");
28658        }
28659    }
28660    function_tests++;
28661#endif
28662
28663    return(test_ret);
28664}
28665
28666
28667static int
28668test_xmlReaderForDoc(void) {
28669    int test_ret = 0;
28670
28671#if defined(LIBXML_READER_ENABLED)
28672    int mem_base;
28673    xmlTextReaderPtr ret_val;
28674    xmlChar * cur; /* a pointer to a zero terminated string */
28675    int n_cur;
28676    const char * URL; /* the base URL to use for the document */
28677    int n_URL;
28678    char * encoding; /* the document encoding, or NULL */
28679    int n_encoding;
28680    int options; /* a combination of xmlParserOption */
28681    int n_options;
28682
28683    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28684    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28685    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28686    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28687        mem_base = xmlMemBlocks();
28688        cur = gen_const_xmlChar_ptr(n_cur, 0);
28689        URL = gen_filepath(n_URL, 1);
28690        encoding = gen_const_char_ptr(n_encoding, 2);
28691        options = gen_parseroptions(n_options, 3);
28692
28693        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
28694        desret_xmlTextReaderPtr(ret_val);
28695        call_tests++;
28696        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
28697        des_filepath(n_URL, URL, 1);
28698        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
28699        des_parseroptions(n_options, options, 3);
28700        xmlResetLastError();
28701        if (mem_base != xmlMemBlocks()) {
28702            printf("Leak of %d blocks found in xmlReaderForDoc",
28703	           xmlMemBlocks() - mem_base);
28704	    test_ret++;
28705            printf(" %d", n_cur);
28706            printf(" %d", n_URL);
28707            printf(" %d", n_encoding);
28708            printf(" %d", n_options);
28709            printf("\n");
28710        }
28711    }
28712    }
28713    }
28714    }
28715    function_tests++;
28716#endif
28717
28718    return(test_ret);
28719}
28720
28721
28722static int
28723test_xmlReaderForFile(void) {
28724    int test_ret = 0;
28725
28726#if defined(LIBXML_READER_ENABLED)
28727    int mem_base;
28728    xmlTextReaderPtr ret_val;
28729    const char * filename; /* a file or URL */
28730    int n_filename;
28731    char * encoding; /* the document encoding, or NULL */
28732    int n_encoding;
28733    int options; /* a combination of xmlParserOption */
28734    int n_options;
28735
28736    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28737    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28738    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28739        mem_base = xmlMemBlocks();
28740        filename = gen_filepath(n_filename, 0);
28741        encoding = gen_const_char_ptr(n_encoding, 1);
28742        options = gen_parseroptions(n_options, 2);
28743
28744        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
28745        desret_xmlTextReaderPtr(ret_val);
28746        call_tests++;
28747        des_filepath(n_filename, filename, 0);
28748        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
28749        des_parseroptions(n_options, options, 2);
28750        xmlResetLastError();
28751        if (mem_base != xmlMemBlocks()) {
28752            printf("Leak of %d blocks found in xmlReaderForFile",
28753	           xmlMemBlocks() - mem_base);
28754	    test_ret++;
28755            printf(" %d", n_filename);
28756            printf(" %d", n_encoding);
28757            printf(" %d", n_options);
28758            printf("\n");
28759        }
28760    }
28761    }
28762    }
28763    function_tests++;
28764#endif
28765
28766    return(test_ret);
28767}
28768
28769
28770static int
28771test_xmlReaderForMemory(void) {
28772    int test_ret = 0;
28773
28774#if defined(LIBXML_READER_ENABLED)
28775    int mem_base;
28776    xmlTextReaderPtr ret_val;
28777    char * buffer; /* a pointer to a char array */
28778    int n_buffer;
28779    int size; /* the size of the array */
28780    int n_size;
28781    const char * URL; /* the base URL to use for the document */
28782    int n_URL;
28783    char * encoding; /* the document encoding, or NULL */
28784    int n_encoding;
28785    int options; /* a combination of xmlParserOption */
28786    int n_options;
28787
28788    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28789    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28790    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28791    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28792    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28793        mem_base = xmlMemBlocks();
28794        buffer = gen_const_char_ptr(n_buffer, 0);
28795        size = gen_int(n_size, 1);
28796        URL = gen_filepath(n_URL, 2);
28797        encoding = gen_const_char_ptr(n_encoding, 3);
28798        options = gen_parseroptions(n_options, 4);
28799
28800        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
28801        desret_xmlTextReaderPtr(ret_val);
28802        call_tests++;
28803        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
28804        des_int(n_size, size, 1);
28805        des_filepath(n_URL, URL, 2);
28806        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
28807        des_parseroptions(n_options, options, 4);
28808        xmlResetLastError();
28809        if (mem_base != xmlMemBlocks()) {
28810            printf("Leak of %d blocks found in xmlReaderForMemory",
28811	           xmlMemBlocks() - mem_base);
28812	    test_ret++;
28813            printf(" %d", n_buffer);
28814            printf(" %d", n_size);
28815            printf(" %d", n_URL);
28816            printf(" %d", n_encoding);
28817            printf(" %d", n_options);
28818            printf("\n");
28819        }
28820    }
28821    }
28822    }
28823    }
28824    }
28825    function_tests++;
28826#endif
28827
28828    return(test_ret);
28829}
28830
28831
28832static int
28833test_xmlReaderNewDoc(void) {
28834    int test_ret = 0;
28835
28836#if defined(LIBXML_READER_ENABLED)
28837    int mem_base;
28838    int ret_val;
28839    xmlTextReaderPtr reader; /* an XML reader */
28840    int n_reader;
28841    xmlChar * cur; /* a pointer to a zero terminated string */
28842    int n_cur;
28843    const char * URL; /* the base URL to use for the document */
28844    int n_URL;
28845    char * encoding; /* the document encoding, or NULL */
28846    int n_encoding;
28847    int options; /* a combination of xmlParserOption */
28848    int n_options;
28849
28850    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28851    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28852    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28853    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28854    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28855        mem_base = xmlMemBlocks();
28856        reader = gen_xmlTextReaderPtr(n_reader, 0);
28857        cur = gen_const_xmlChar_ptr(n_cur, 1);
28858        URL = gen_filepath(n_URL, 2);
28859        encoding = gen_const_char_ptr(n_encoding, 3);
28860        options = gen_parseroptions(n_options, 4);
28861
28862        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
28863        desret_int(ret_val);
28864        call_tests++;
28865        des_xmlTextReaderPtr(n_reader, reader, 0);
28866        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
28867        des_filepath(n_URL, URL, 2);
28868        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
28869        des_parseroptions(n_options, options, 4);
28870        xmlResetLastError();
28871        if (mem_base != xmlMemBlocks()) {
28872            printf("Leak of %d blocks found in xmlReaderNewDoc",
28873	           xmlMemBlocks() - mem_base);
28874	    test_ret++;
28875            printf(" %d", n_reader);
28876            printf(" %d", n_cur);
28877            printf(" %d", n_URL);
28878            printf(" %d", n_encoding);
28879            printf(" %d", n_options);
28880            printf("\n");
28881        }
28882    }
28883    }
28884    }
28885    }
28886    }
28887    function_tests++;
28888#endif
28889
28890    return(test_ret);
28891}
28892
28893
28894static int
28895test_xmlReaderNewFile(void) {
28896    int test_ret = 0;
28897
28898#if defined(LIBXML_READER_ENABLED)
28899    int mem_base;
28900    int ret_val;
28901    xmlTextReaderPtr reader; /* an XML reader */
28902    int n_reader;
28903    const char * filename; /* a file or URL */
28904    int n_filename;
28905    char * encoding; /* the document encoding, or NULL */
28906    int n_encoding;
28907    int options; /* a combination of xmlParserOption */
28908    int n_options;
28909
28910    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28911    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28912    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28913    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28914        mem_base = xmlMemBlocks();
28915        reader = gen_xmlTextReaderPtr(n_reader, 0);
28916        filename = gen_filepath(n_filename, 1);
28917        encoding = gen_const_char_ptr(n_encoding, 2);
28918        options = gen_parseroptions(n_options, 3);
28919
28920        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
28921        desret_int(ret_val);
28922        call_tests++;
28923        des_xmlTextReaderPtr(n_reader, reader, 0);
28924        des_filepath(n_filename, filename, 1);
28925        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
28926        des_parseroptions(n_options, options, 3);
28927        xmlResetLastError();
28928        if (mem_base != xmlMemBlocks()) {
28929            printf("Leak of %d blocks found in xmlReaderNewFile",
28930	           xmlMemBlocks() - mem_base);
28931	    test_ret++;
28932            printf(" %d", n_reader);
28933            printf(" %d", n_filename);
28934            printf(" %d", n_encoding);
28935            printf(" %d", n_options);
28936            printf("\n");
28937        }
28938    }
28939    }
28940    }
28941    }
28942    function_tests++;
28943#endif
28944
28945    return(test_ret);
28946}
28947
28948
28949static int
28950test_xmlReaderNewMemory(void) {
28951    int test_ret = 0;
28952
28953#if defined(LIBXML_READER_ENABLED)
28954    int mem_base;
28955    int ret_val;
28956    xmlTextReaderPtr reader; /* an XML reader */
28957    int n_reader;
28958    char * buffer; /* a pointer to a char array */
28959    int n_buffer;
28960    int size; /* the size of the array */
28961    int n_size;
28962    const char * URL; /* the base URL to use for the document */
28963    int n_URL;
28964    char * encoding; /* the document encoding, or NULL */
28965    int n_encoding;
28966    int options; /* a combination of xmlParserOption */
28967    int n_options;
28968
28969    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28970    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28971    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28972    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28973    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28974    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28975        mem_base = xmlMemBlocks();
28976        reader = gen_xmlTextReaderPtr(n_reader, 0);
28977        buffer = gen_const_char_ptr(n_buffer, 1);
28978        size = gen_int(n_size, 2);
28979        URL = gen_filepath(n_URL, 3);
28980        encoding = gen_const_char_ptr(n_encoding, 4);
28981        options = gen_parseroptions(n_options, 5);
28982
28983        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
28984        desret_int(ret_val);
28985        call_tests++;
28986        des_xmlTextReaderPtr(n_reader, reader, 0);
28987        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
28988        des_int(n_size, size, 2);
28989        des_filepath(n_URL, URL, 3);
28990        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
28991        des_parseroptions(n_options, options, 5);
28992        xmlResetLastError();
28993        if (mem_base != xmlMemBlocks()) {
28994            printf("Leak of %d blocks found in xmlReaderNewMemory",
28995	           xmlMemBlocks() - mem_base);
28996	    test_ret++;
28997            printf(" %d", n_reader);
28998            printf(" %d", n_buffer);
28999            printf(" %d", n_size);
29000            printf(" %d", n_URL);
29001            printf(" %d", n_encoding);
29002            printf(" %d", n_options);
29003            printf("\n");
29004        }
29005    }
29006    }
29007    }
29008    }
29009    }
29010    }
29011    function_tests++;
29012#endif
29013
29014    return(test_ret);
29015}
29016
29017
29018static int
29019test_xmlReaderNewWalker(void) {
29020    int test_ret = 0;
29021
29022#if defined(LIBXML_READER_ENABLED)
29023    int mem_base;
29024    int ret_val;
29025    xmlTextReaderPtr reader; /* an XML reader */
29026    int n_reader;
29027    xmlDocPtr doc; /* a preparsed document */
29028    int n_doc;
29029
29030    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29031    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29032        mem_base = xmlMemBlocks();
29033        reader = gen_xmlTextReaderPtr(n_reader, 0);
29034        doc = gen_xmlDocPtr(n_doc, 1);
29035
29036        ret_val = xmlReaderNewWalker(reader, doc);
29037        desret_int(ret_val);
29038        call_tests++;
29039        des_xmlTextReaderPtr(n_reader, reader, 0);
29040        des_xmlDocPtr(n_doc, doc, 1);
29041        xmlResetLastError();
29042        if (mem_base != xmlMemBlocks()) {
29043            printf("Leak of %d blocks found in xmlReaderNewWalker",
29044	           xmlMemBlocks() - mem_base);
29045	    test_ret++;
29046            printf(" %d", n_reader);
29047            printf(" %d", n_doc);
29048            printf("\n");
29049        }
29050    }
29051    }
29052    function_tests++;
29053#endif
29054
29055    return(test_ret);
29056}
29057
29058
29059static int
29060test_xmlReaderWalker(void) {
29061    int test_ret = 0;
29062
29063#if defined(LIBXML_READER_ENABLED)
29064    int mem_base;
29065    xmlTextReaderPtr ret_val;
29066    xmlDocPtr doc; /* a preparsed document */
29067    int n_doc;
29068
29069    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29070        mem_base = xmlMemBlocks();
29071        doc = gen_xmlDocPtr(n_doc, 0);
29072
29073        ret_val = xmlReaderWalker(doc);
29074        desret_xmlTextReaderPtr(ret_val);
29075        call_tests++;
29076        des_xmlDocPtr(n_doc, doc, 0);
29077        xmlResetLastError();
29078        if (mem_base != xmlMemBlocks()) {
29079            printf("Leak of %d blocks found in xmlReaderWalker",
29080	           xmlMemBlocks() - mem_base);
29081	    test_ret++;
29082            printf(" %d", n_doc);
29083            printf("\n");
29084        }
29085    }
29086    function_tests++;
29087#endif
29088
29089    return(test_ret);
29090}
29091
29092
29093static int
29094test_xmlTextReaderAttributeCount(void) {
29095    int test_ret = 0;
29096
29097#if defined(LIBXML_READER_ENABLED)
29098    int mem_base;
29099    int ret_val;
29100    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29101    int n_reader;
29102
29103    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29104        mem_base = xmlMemBlocks();
29105        reader = gen_xmlTextReaderPtr(n_reader, 0);
29106
29107        ret_val = xmlTextReaderAttributeCount(reader);
29108        desret_int(ret_val);
29109        call_tests++;
29110        des_xmlTextReaderPtr(n_reader, reader, 0);
29111        xmlResetLastError();
29112        if (mem_base != xmlMemBlocks()) {
29113            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
29114	           xmlMemBlocks() - mem_base);
29115	    test_ret++;
29116            printf(" %d", n_reader);
29117            printf("\n");
29118        }
29119    }
29120    function_tests++;
29121#endif
29122
29123    return(test_ret);
29124}
29125
29126
29127static int
29128test_xmlTextReaderBaseUri(void) {
29129    int test_ret = 0;
29130
29131#if defined(LIBXML_READER_ENABLED)
29132    int mem_base;
29133    xmlChar * ret_val;
29134    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29135    int n_reader;
29136
29137    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29138        mem_base = xmlMemBlocks();
29139        reader = gen_xmlTextReaderPtr(n_reader, 0);
29140
29141        ret_val = xmlTextReaderBaseUri(reader);
29142        desret_xmlChar_ptr(ret_val);
29143        call_tests++;
29144        des_xmlTextReaderPtr(n_reader, reader, 0);
29145        xmlResetLastError();
29146        if (mem_base != xmlMemBlocks()) {
29147            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
29148	           xmlMemBlocks() - mem_base);
29149	    test_ret++;
29150            printf(" %d", n_reader);
29151            printf("\n");
29152        }
29153    }
29154    function_tests++;
29155#endif
29156
29157    return(test_ret);
29158}
29159
29160
29161static int
29162test_xmlTextReaderByteConsumed(void) {
29163    int test_ret = 0;
29164
29165#if defined(LIBXML_READER_ENABLED)
29166    int mem_base;
29167    long ret_val;
29168    xmlTextReaderPtr reader; /* an XML reader */
29169    int n_reader;
29170
29171    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29172        mem_base = xmlMemBlocks();
29173        reader = gen_xmlTextReaderPtr(n_reader, 0);
29174
29175        ret_val = xmlTextReaderByteConsumed(reader);
29176        desret_long(ret_val);
29177        call_tests++;
29178        des_xmlTextReaderPtr(n_reader, reader, 0);
29179        xmlResetLastError();
29180        if (mem_base != xmlMemBlocks()) {
29181            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
29182	           xmlMemBlocks() - mem_base);
29183	    test_ret++;
29184            printf(" %d", n_reader);
29185            printf("\n");
29186        }
29187    }
29188    function_tests++;
29189#endif
29190
29191    return(test_ret);
29192}
29193
29194
29195static int
29196test_xmlTextReaderClose(void) {
29197    int test_ret = 0;
29198
29199#if defined(LIBXML_READER_ENABLED)
29200    int mem_base;
29201    int ret_val;
29202    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29203    int n_reader;
29204
29205    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29206        mem_base = xmlMemBlocks();
29207        reader = gen_xmlTextReaderPtr(n_reader, 0);
29208
29209        ret_val = xmlTextReaderClose(reader);
29210        desret_int(ret_val);
29211        call_tests++;
29212        des_xmlTextReaderPtr(n_reader, reader, 0);
29213        xmlResetLastError();
29214        if (mem_base != xmlMemBlocks()) {
29215            printf("Leak of %d blocks found in xmlTextReaderClose",
29216	           xmlMemBlocks() - mem_base);
29217	    test_ret++;
29218            printf(" %d", n_reader);
29219            printf("\n");
29220        }
29221    }
29222    function_tests++;
29223#endif
29224
29225    return(test_ret);
29226}
29227
29228
29229static int
29230test_xmlTextReaderConstBaseUri(void) {
29231    int test_ret = 0;
29232
29233#if defined(LIBXML_READER_ENABLED)
29234    int mem_base;
29235    const xmlChar * ret_val;
29236    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29237    int n_reader;
29238
29239    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29240        mem_base = xmlMemBlocks();
29241        reader = gen_xmlTextReaderPtr(n_reader, 0);
29242
29243        ret_val = xmlTextReaderConstBaseUri(reader);
29244        desret_const_xmlChar_ptr(ret_val);
29245        call_tests++;
29246        des_xmlTextReaderPtr(n_reader, reader, 0);
29247        xmlResetLastError();
29248        if (mem_base != xmlMemBlocks()) {
29249            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
29250	           xmlMemBlocks() - mem_base);
29251	    test_ret++;
29252            printf(" %d", n_reader);
29253            printf("\n");
29254        }
29255    }
29256    function_tests++;
29257#endif
29258
29259    return(test_ret);
29260}
29261
29262
29263static int
29264test_xmlTextReaderConstEncoding(void) {
29265    int test_ret = 0;
29266
29267#if defined(LIBXML_READER_ENABLED)
29268    int mem_base;
29269    const xmlChar * ret_val;
29270    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29271    int n_reader;
29272
29273    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29274        mem_base = xmlMemBlocks();
29275        reader = gen_xmlTextReaderPtr(n_reader, 0);
29276
29277        ret_val = xmlTextReaderConstEncoding(reader);
29278        desret_const_xmlChar_ptr(ret_val);
29279        call_tests++;
29280        des_xmlTextReaderPtr(n_reader, reader, 0);
29281        xmlResetLastError();
29282        if (mem_base != xmlMemBlocks()) {
29283            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
29284	           xmlMemBlocks() - mem_base);
29285	    test_ret++;
29286            printf(" %d", n_reader);
29287            printf("\n");
29288        }
29289    }
29290    function_tests++;
29291#endif
29292
29293    return(test_ret);
29294}
29295
29296
29297static int
29298test_xmlTextReaderConstLocalName(void) {
29299    int test_ret = 0;
29300
29301#if defined(LIBXML_READER_ENABLED)
29302    int mem_base;
29303    const xmlChar * ret_val;
29304    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29305    int n_reader;
29306
29307    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29308        mem_base = xmlMemBlocks();
29309        reader = gen_xmlTextReaderPtr(n_reader, 0);
29310
29311        ret_val = xmlTextReaderConstLocalName(reader);
29312        desret_const_xmlChar_ptr(ret_val);
29313        call_tests++;
29314        des_xmlTextReaderPtr(n_reader, reader, 0);
29315        xmlResetLastError();
29316        if (mem_base != xmlMemBlocks()) {
29317            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
29318	           xmlMemBlocks() - mem_base);
29319	    test_ret++;
29320            printf(" %d", n_reader);
29321            printf("\n");
29322        }
29323    }
29324    function_tests++;
29325#endif
29326
29327    return(test_ret);
29328}
29329
29330
29331static int
29332test_xmlTextReaderConstName(void) {
29333    int test_ret = 0;
29334
29335#if defined(LIBXML_READER_ENABLED)
29336    int mem_base;
29337    const xmlChar * ret_val;
29338    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29339    int n_reader;
29340
29341    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29342        mem_base = xmlMemBlocks();
29343        reader = gen_xmlTextReaderPtr(n_reader, 0);
29344
29345        ret_val = xmlTextReaderConstName(reader);
29346        desret_const_xmlChar_ptr(ret_val);
29347        call_tests++;
29348        des_xmlTextReaderPtr(n_reader, reader, 0);
29349        xmlResetLastError();
29350        if (mem_base != xmlMemBlocks()) {
29351            printf("Leak of %d blocks found in xmlTextReaderConstName",
29352	           xmlMemBlocks() - mem_base);
29353	    test_ret++;
29354            printf(" %d", n_reader);
29355            printf("\n");
29356        }
29357    }
29358    function_tests++;
29359#endif
29360
29361    return(test_ret);
29362}
29363
29364
29365static int
29366test_xmlTextReaderConstNamespaceUri(void) {
29367    int test_ret = 0;
29368
29369#if defined(LIBXML_READER_ENABLED)
29370    int mem_base;
29371    const xmlChar * ret_val;
29372    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29373    int n_reader;
29374
29375    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29376        mem_base = xmlMemBlocks();
29377        reader = gen_xmlTextReaderPtr(n_reader, 0);
29378
29379        ret_val = xmlTextReaderConstNamespaceUri(reader);
29380        desret_const_xmlChar_ptr(ret_val);
29381        call_tests++;
29382        des_xmlTextReaderPtr(n_reader, reader, 0);
29383        xmlResetLastError();
29384        if (mem_base != xmlMemBlocks()) {
29385            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
29386	           xmlMemBlocks() - mem_base);
29387	    test_ret++;
29388            printf(" %d", n_reader);
29389            printf("\n");
29390        }
29391    }
29392    function_tests++;
29393#endif
29394
29395    return(test_ret);
29396}
29397
29398
29399static int
29400test_xmlTextReaderConstPrefix(void) {
29401    int test_ret = 0;
29402
29403#if defined(LIBXML_READER_ENABLED)
29404    int mem_base;
29405    const xmlChar * ret_val;
29406    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29407    int n_reader;
29408
29409    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29410        mem_base = xmlMemBlocks();
29411        reader = gen_xmlTextReaderPtr(n_reader, 0);
29412
29413        ret_val = xmlTextReaderConstPrefix(reader);
29414        desret_const_xmlChar_ptr(ret_val);
29415        call_tests++;
29416        des_xmlTextReaderPtr(n_reader, reader, 0);
29417        xmlResetLastError();
29418        if (mem_base != xmlMemBlocks()) {
29419            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
29420	           xmlMemBlocks() - mem_base);
29421	    test_ret++;
29422            printf(" %d", n_reader);
29423            printf("\n");
29424        }
29425    }
29426    function_tests++;
29427#endif
29428
29429    return(test_ret);
29430}
29431
29432
29433static int
29434test_xmlTextReaderConstString(void) {
29435    int test_ret = 0;
29436
29437#if defined(LIBXML_READER_ENABLED)
29438    int mem_base;
29439    const xmlChar * ret_val;
29440    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29441    int n_reader;
29442    xmlChar * str; /* the string to intern. */
29443    int n_str;
29444
29445    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29446    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
29447        mem_base = xmlMemBlocks();
29448        reader = gen_xmlTextReaderPtr(n_reader, 0);
29449        str = gen_const_xmlChar_ptr(n_str, 1);
29450
29451        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
29452        desret_const_xmlChar_ptr(ret_val);
29453        call_tests++;
29454        des_xmlTextReaderPtr(n_reader, reader, 0);
29455        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
29456        xmlResetLastError();
29457        if (mem_base != xmlMemBlocks()) {
29458            printf("Leak of %d blocks found in xmlTextReaderConstString",
29459	           xmlMemBlocks() - mem_base);
29460	    test_ret++;
29461            printf(" %d", n_reader);
29462            printf(" %d", n_str);
29463            printf("\n");
29464        }
29465    }
29466    }
29467    function_tests++;
29468#endif
29469
29470    return(test_ret);
29471}
29472
29473
29474static int
29475test_xmlTextReaderConstValue(void) {
29476    int test_ret = 0;
29477
29478#if defined(LIBXML_READER_ENABLED)
29479    int mem_base;
29480    const xmlChar * ret_val;
29481    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29482    int n_reader;
29483
29484    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29485        mem_base = xmlMemBlocks();
29486        reader = gen_xmlTextReaderPtr(n_reader, 0);
29487
29488        ret_val = xmlTextReaderConstValue(reader);
29489        desret_const_xmlChar_ptr(ret_val);
29490        call_tests++;
29491        des_xmlTextReaderPtr(n_reader, reader, 0);
29492        xmlResetLastError();
29493        if (mem_base != xmlMemBlocks()) {
29494            printf("Leak of %d blocks found in xmlTextReaderConstValue",
29495	           xmlMemBlocks() - mem_base);
29496	    test_ret++;
29497            printf(" %d", n_reader);
29498            printf("\n");
29499        }
29500    }
29501    function_tests++;
29502#endif
29503
29504    return(test_ret);
29505}
29506
29507
29508static int
29509test_xmlTextReaderConstXmlLang(void) {
29510    int test_ret = 0;
29511
29512#if defined(LIBXML_READER_ENABLED)
29513    int mem_base;
29514    const xmlChar * ret_val;
29515    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29516    int n_reader;
29517
29518    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29519        mem_base = xmlMemBlocks();
29520        reader = gen_xmlTextReaderPtr(n_reader, 0);
29521
29522        ret_val = xmlTextReaderConstXmlLang(reader);
29523        desret_const_xmlChar_ptr(ret_val);
29524        call_tests++;
29525        des_xmlTextReaderPtr(n_reader, reader, 0);
29526        xmlResetLastError();
29527        if (mem_base != xmlMemBlocks()) {
29528            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
29529	           xmlMemBlocks() - mem_base);
29530	    test_ret++;
29531            printf(" %d", n_reader);
29532            printf("\n");
29533        }
29534    }
29535    function_tests++;
29536#endif
29537
29538    return(test_ret);
29539}
29540
29541
29542static int
29543test_xmlTextReaderConstXmlVersion(void) {
29544    int test_ret = 0;
29545
29546#if defined(LIBXML_READER_ENABLED)
29547    int mem_base;
29548    const xmlChar * ret_val;
29549    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29550    int n_reader;
29551
29552    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29553        mem_base = xmlMemBlocks();
29554        reader = gen_xmlTextReaderPtr(n_reader, 0);
29555
29556        ret_val = xmlTextReaderConstXmlVersion(reader);
29557        desret_const_xmlChar_ptr(ret_val);
29558        call_tests++;
29559        des_xmlTextReaderPtr(n_reader, reader, 0);
29560        xmlResetLastError();
29561        if (mem_base != xmlMemBlocks()) {
29562            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
29563	           xmlMemBlocks() - mem_base);
29564	    test_ret++;
29565            printf(" %d", n_reader);
29566            printf("\n");
29567        }
29568    }
29569    function_tests++;
29570#endif
29571
29572    return(test_ret);
29573}
29574
29575
29576static int
29577test_xmlTextReaderCurrentDoc(void) {
29578    int test_ret = 0;
29579
29580#if defined(LIBXML_READER_ENABLED)
29581    int mem_base;
29582    xmlDocPtr ret_val;
29583    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29584    int n_reader;
29585
29586    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29587        mem_base = xmlMemBlocks();
29588        reader = gen_xmlTextReaderPtr(n_reader, 0);
29589
29590        ret_val = xmlTextReaderCurrentDoc(reader);
29591        desret_xmlDocPtr(ret_val);
29592        call_tests++;
29593        des_xmlTextReaderPtr(n_reader, reader, 0);
29594        xmlResetLastError();
29595        if (mem_base != xmlMemBlocks()) {
29596            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
29597	           xmlMemBlocks() - mem_base);
29598	    test_ret++;
29599            printf(" %d", n_reader);
29600            printf("\n");
29601        }
29602    }
29603    function_tests++;
29604#endif
29605
29606    return(test_ret);
29607}
29608
29609
29610static int
29611test_xmlTextReaderCurrentNode(void) {
29612    int test_ret = 0;
29613
29614#if defined(LIBXML_READER_ENABLED)
29615    int mem_base;
29616    xmlNodePtr ret_val;
29617    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29618    int n_reader;
29619
29620    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29621        mem_base = xmlMemBlocks();
29622        reader = gen_xmlTextReaderPtr(n_reader, 0);
29623
29624        ret_val = xmlTextReaderCurrentNode(reader);
29625        desret_xmlNodePtr(ret_val);
29626        call_tests++;
29627        des_xmlTextReaderPtr(n_reader, reader, 0);
29628        xmlResetLastError();
29629        if (mem_base != xmlMemBlocks()) {
29630            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
29631	           xmlMemBlocks() - mem_base);
29632	    test_ret++;
29633            printf(" %d", n_reader);
29634            printf("\n");
29635        }
29636    }
29637    function_tests++;
29638#endif
29639
29640    return(test_ret);
29641}
29642
29643
29644static int
29645test_xmlTextReaderDepth(void) {
29646    int test_ret = 0;
29647
29648#if defined(LIBXML_READER_ENABLED)
29649    int mem_base;
29650    int ret_val;
29651    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29652    int n_reader;
29653
29654    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29655        mem_base = xmlMemBlocks();
29656        reader = gen_xmlTextReaderPtr(n_reader, 0);
29657
29658        ret_val = xmlTextReaderDepth(reader);
29659        desret_int(ret_val);
29660        call_tests++;
29661        des_xmlTextReaderPtr(n_reader, reader, 0);
29662        xmlResetLastError();
29663        if (mem_base != xmlMemBlocks()) {
29664            printf("Leak of %d blocks found in xmlTextReaderDepth",
29665	           xmlMemBlocks() - mem_base);
29666	    test_ret++;
29667            printf(" %d", n_reader);
29668            printf("\n");
29669        }
29670    }
29671    function_tests++;
29672#endif
29673
29674    return(test_ret);
29675}
29676
29677
29678static int
29679test_xmlTextReaderExpand(void) {
29680    int test_ret = 0;
29681
29682#if defined(LIBXML_READER_ENABLED)
29683    int mem_base;
29684    xmlNodePtr ret_val;
29685    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29686    int n_reader;
29687
29688    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29689        mem_base = xmlMemBlocks();
29690        reader = gen_xmlTextReaderPtr(n_reader, 0);
29691
29692        ret_val = xmlTextReaderExpand(reader);
29693        desret_xmlNodePtr(ret_val);
29694        call_tests++;
29695        des_xmlTextReaderPtr(n_reader, reader, 0);
29696        xmlResetLastError();
29697        if (mem_base != xmlMemBlocks()) {
29698            printf("Leak of %d blocks found in xmlTextReaderExpand",
29699	           xmlMemBlocks() - mem_base);
29700	    test_ret++;
29701            printf(" %d", n_reader);
29702            printf("\n");
29703        }
29704    }
29705    function_tests++;
29706#endif
29707
29708    return(test_ret);
29709}
29710
29711
29712static int
29713test_xmlTextReaderGetAttribute(void) {
29714    int test_ret = 0;
29715
29716#if defined(LIBXML_READER_ENABLED)
29717    int mem_base;
29718    xmlChar * ret_val;
29719    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29720    int n_reader;
29721    xmlChar * name; /* the qualified name of the attribute. */
29722    int n_name;
29723
29724    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29725    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
29726        mem_base = xmlMemBlocks();
29727        reader = gen_xmlTextReaderPtr(n_reader, 0);
29728        name = gen_const_xmlChar_ptr(n_name, 1);
29729
29730        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
29731        desret_xmlChar_ptr(ret_val);
29732        call_tests++;
29733        des_xmlTextReaderPtr(n_reader, reader, 0);
29734        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
29735        xmlResetLastError();
29736        if (mem_base != xmlMemBlocks()) {
29737            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
29738	           xmlMemBlocks() - mem_base);
29739	    test_ret++;
29740            printf(" %d", n_reader);
29741            printf(" %d", n_name);
29742            printf("\n");
29743        }
29744    }
29745    }
29746    function_tests++;
29747#endif
29748
29749    return(test_ret);
29750}
29751
29752
29753static int
29754test_xmlTextReaderGetAttributeNo(void) {
29755    int test_ret = 0;
29756
29757#if defined(LIBXML_READER_ENABLED)
29758    int mem_base;
29759    xmlChar * ret_val;
29760    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29761    int n_reader;
29762    int no; /* the zero-based index of the attribute relative to the containing element */
29763    int n_no;
29764
29765    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29766    for (n_no = 0;n_no < gen_nb_int;n_no++) {
29767        mem_base = xmlMemBlocks();
29768        reader = gen_xmlTextReaderPtr(n_reader, 0);
29769        no = gen_int(n_no, 1);
29770
29771        ret_val = xmlTextReaderGetAttributeNo(reader, no);
29772        desret_xmlChar_ptr(ret_val);
29773        call_tests++;
29774        des_xmlTextReaderPtr(n_reader, reader, 0);
29775        des_int(n_no, no, 1);
29776        xmlResetLastError();
29777        if (mem_base != xmlMemBlocks()) {
29778            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
29779	           xmlMemBlocks() - mem_base);
29780	    test_ret++;
29781            printf(" %d", n_reader);
29782            printf(" %d", n_no);
29783            printf("\n");
29784        }
29785    }
29786    }
29787    function_tests++;
29788#endif
29789
29790    return(test_ret);
29791}
29792
29793
29794static int
29795test_xmlTextReaderGetAttributeNs(void) {
29796    int test_ret = 0;
29797
29798#if defined(LIBXML_READER_ENABLED)
29799    int mem_base;
29800    xmlChar * ret_val;
29801    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29802    int n_reader;
29803    xmlChar * localName; /* the local name of the attribute. */
29804    int n_localName;
29805    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
29806    int n_namespaceURI;
29807
29808    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29809    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
29810    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
29811        mem_base = xmlMemBlocks();
29812        reader = gen_xmlTextReaderPtr(n_reader, 0);
29813        localName = gen_const_xmlChar_ptr(n_localName, 1);
29814        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
29815
29816        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
29817        desret_xmlChar_ptr(ret_val);
29818        call_tests++;
29819        des_xmlTextReaderPtr(n_reader, reader, 0);
29820        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
29821        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
29822        xmlResetLastError();
29823        if (mem_base != xmlMemBlocks()) {
29824            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
29825	           xmlMemBlocks() - mem_base);
29826	    test_ret++;
29827            printf(" %d", n_reader);
29828            printf(" %d", n_localName);
29829            printf(" %d", n_namespaceURI);
29830            printf("\n");
29831        }
29832    }
29833    }
29834    }
29835    function_tests++;
29836#endif
29837
29838    return(test_ret);
29839}
29840
29841#ifdef LIBXML_READER_ENABLED
29842
29843#define gen_nb_xmlTextReaderErrorFunc_ptr 1
29844static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29845    return(NULL);
29846}
29847static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29848}
29849#endif
29850
29851
29852static int
29853test_xmlTextReaderGetErrorHandler(void) {
29854    int test_ret = 0;
29855
29856#if defined(LIBXML_READER_ENABLED)
29857    int mem_base;
29858    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29859    int n_reader;
29860    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
29861    int n_f;
29862    void ** arg; /* a user argument */
29863    int n_arg;
29864
29865    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29866    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
29867    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
29868        mem_base = xmlMemBlocks();
29869        reader = gen_xmlTextReaderPtr(n_reader, 0);
29870        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
29871        arg = gen_void_ptr_ptr(n_arg, 2);
29872
29873        xmlTextReaderGetErrorHandler(reader, f, arg);
29874        call_tests++;
29875        des_xmlTextReaderPtr(n_reader, reader, 0);
29876        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
29877        des_void_ptr_ptr(n_arg, arg, 2);
29878        xmlResetLastError();
29879        if (mem_base != xmlMemBlocks()) {
29880            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
29881	           xmlMemBlocks() - mem_base);
29882	    test_ret++;
29883            printf(" %d", n_reader);
29884            printf(" %d", n_f);
29885            printf(" %d", n_arg);
29886            printf("\n");
29887        }
29888    }
29889    }
29890    }
29891    function_tests++;
29892#endif
29893
29894    return(test_ret);
29895}
29896
29897
29898static int
29899test_xmlTextReaderGetParserColumnNumber(void) {
29900    int test_ret = 0;
29901
29902#if defined(LIBXML_READER_ENABLED)
29903    int mem_base;
29904    int ret_val;
29905    xmlTextReaderPtr reader; /* the user data (XML reader context) */
29906    int n_reader;
29907
29908    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29909        mem_base = xmlMemBlocks();
29910        reader = gen_xmlTextReaderPtr(n_reader, 0);
29911
29912        ret_val = xmlTextReaderGetParserColumnNumber(reader);
29913        desret_int(ret_val);
29914        call_tests++;
29915        des_xmlTextReaderPtr(n_reader, reader, 0);
29916        xmlResetLastError();
29917        if (mem_base != xmlMemBlocks()) {
29918            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
29919	           xmlMemBlocks() - mem_base);
29920	    test_ret++;
29921            printf(" %d", n_reader);
29922            printf("\n");
29923        }
29924    }
29925    function_tests++;
29926#endif
29927
29928    return(test_ret);
29929}
29930
29931
29932static int
29933test_xmlTextReaderGetParserLineNumber(void) {
29934    int test_ret = 0;
29935
29936#if defined(LIBXML_READER_ENABLED)
29937    int mem_base;
29938    int ret_val;
29939    xmlTextReaderPtr reader; /* the user data (XML reader context) */
29940    int n_reader;
29941
29942    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29943        mem_base = xmlMemBlocks();
29944        reader = gen_xmlTextReaderPtr(n_reader, 0);
29945
29946        ret_val = xmlTextReaderGetParserLineNumber(reader);
29947        desret_int(ret_val);
29948        call_tests++;
29949        des_xmlTextReaderPtr(n_reader, reader, 0);
29950        xmlResetLastError();
29951        if (mem_base != xmlMemBlocks()) {
29952            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
29953	           xmlMemBlocks() - mem_base);
29954	    test_ret++;
29955            printf(" %d", n_reader);
29956            printf("\n");
29957        }
29958    }
29959    function_tests++;
29960#endif
29961
29962    return(test_ret);
29963}
29964
29965
29966static int
29967test_xmlTextReaderGetParserProp(void) {
29968    int test_ret = 0;
29969
29970#if defined(LIBXML_READER_ENABLED)
29971    int mem_base;
29972    int ret_val;
29973    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29974    int n_reader;
29975    int prop; /* the xmlParserProperties to get */
29976    int n_prop;
29977
29978    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29979    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
29980        mem_base = xmlMemBlocks();
29981        reader = gen_xmlTextReaderPtr(n_reader, 0);
29982        prop = gen_int(n_prop, 1);
29983
29984        ret_val = xmlTextReaderGetParserProp(reader, prop);
29985        desret_int(ret_val);
29986        call_tests++;
29987        des_xmlTextReaderPtr(n_reader, reader, 0);
29988        des_int(n_prop, prop, 1);
29989        xmlResetLastError();
29990        if (mem_base != xmlMemBlocks()) {
29991            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
29992	           xmlMemBlocks() - mem_base);
29993	    test_ret++;
29994            printf(" %d", n_reader);
29995            printf(" %d", n_prop);
29996            printf("\n");
29997        }
29998    }
29999    }
30000    function_tests++;
30001#endif
30002
30003    return(test_ret);
30004}
30005
30006
30007static int
30008test_xmlTextReaderGetRemainder(void) {
30009    int test_ret = 0;
30010
30011#if defined(LIBXML_READER_ENABLED)
30012    int mem_base;
30013    xmlParserInputBufferPtr ret_val;
30014    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30015    int n_reader;
30016
30017    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30018        mem_base = xmlMemBlocks();
30019        reader = gen_xmlTextReaderPtr(n_reader, 0);
30020
30021        ret_val = xmlTextReaderGetRemainder(reader);
30022        desret_xmlParserInputBufferPtr(ret_val);
30023        call_tests++;
30024        des_xmlTextReaderPtr(n_reader, reader, 0);
30025        xmlResetLastError();
30026        if (mem_base != xmlMemBlocks()) {
30027            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30028	           xmlMemBlocks() - mem_base);
30029	    test_ret++;
30030            printf(" %d", n_reader);
30031            printf("\n");
30032        }
30033    }
30034    function_tests++;
30035#endif
30036
30037    return(test_ret);
30038}
30039
30040
30041static int
30042test_xmlTextReaderHasAttributes(void) {
30043    int test_ret = 0;
30044
30045#if defined(LIBXML_READER_ENABLED)
30046    int mem_base;
30047    int ret_val;
30048    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30049    int n_reader;
30050
30051    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30052        mem_base = xmlMemBlocks();
30053        reader = gen_xmlTextReaderPtr(n_reader, 0);
30054
30055        ret_val = xmlTextReaderHasAttributes(reader);
30056        desret_int(ret_val);
30057        call_tests++;
30058        des_xmlTextReaderPtr(n_reader, reader, 0);
30059        xmlResetLastError();
30060        if (mem_base != xmlMemBlocks()) {
30061            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
30062	           xmlMemBlocks() - mem_base);
30063	    test_ret++;
30064            printf(" %d", n_reader);
30065            printf("\n");
30066        }
30067    }
30068    function_tests++;
30069#endif
30070
30071    return(test_ret);
30072}
30073
30074
30075static int
30076test_xmlTextReaderHasValue(void) {
30077    int test_ret = 0;
30078
30079#if defined(LIBXML_READER_ENABLED)
30080    int mem_base;
30081    int ret_val;
30082    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30083    int n_reader;
30084
30085    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30086        mem_base = xmlMemBlocks();
30087        reader = gen_xmlTextReaderPtr(n_reader, 0);
30088
30089        ret_val = xmlTextReaderHasValue(reader);
30090        desret_int(ret_val);
30091        call_tests++;
30092        des_xmlTextReaderPtr(n_reader, reader, 0);
30093        xmlResetLastError();
30094        if (mem_base != xmlMemBlocks()) {
30095            printf("Leak of %d blocks found in xmlTextReaderHasValue",
30096	           xmlMemBlocks() - mem_base);
30097	    test_ret++;
30098            printf(" %d", n_reader);
30099            printf("\n");
30100        }
30101    }
30102    function_tests++;
30103#endif
30104
30105    return(test_ret);
30106}
30107
30108
30109static int
30110test_xmlTextReaderIsDefault(void) {
30111    int test_ret = 0;
30112
30113#if defined(LIBXML_READER_ENABLED)
30114    int mem_base;
30115    int ret_val;
30116    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30117    int n_reader;
30118
30119    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30120        mem_base = xmlMemBlocks();
30121        reader = gen_xmlTextReaderPtr(n_reader, 0);
30122
30123        ret_val = xmlTextReaderIsDefault(reader);
30124        desret_int(ret_val);
30125        call_tests++;
30126        des_xmlTextReaderPtr(n_reader, reader, 0);
30127        xmlResetLastError();
30128        if (mem_base != xmlMemBlocks()) {
30129            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
30130	           xmlMemBlocks() - mem_base);
30131	    test_ret++;
30132            printf(" %d", n_reader);
30133            printf("\n");
30134        }
30135    }
30136    function_tests++;
30137#endif
30138
30139    return(test_ret);
30140}
30141
30142
30143static int
30144test_xmlTextReaderIsEmptyElement(void) {
30145    int test_ret = 0;
30146
30147#if defined(LIBXML_READER_ENABLED)
30148    int mem_base;
30149    int ret_val;
30150    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30151    int n_reader;
30152
30153    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30154        mem_base = xmlMemBlocks();
30155        reader = gen_xmlTextReaderPtr(n_reader, 0);
30156
30157        ret_val = xmlTextReaderIsEmptyElement(reader);
30158        desret_int(ret_val);
30159        call_tests++;
30160        des_xmlTextReaderPtr(n_reader, reader, 0);
30161        xmlResetLastError();
30162        if (mem_base != xmlMemBlocks()) {
30163            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
30164	           xmlMemBlocks() - mem_base);
30165	    test_ret++;
30166            printf(" %d", n_reader);
30167            printf("\n");
30168        }
30169    }
30170    function_tests++;
30171#endif
30172
30173    return(test_ret);
30174}
30175
30176
30177static int
30178test_xmlTextReaderIsNamespaceDecl(void) {
30179    int test_ret = 0;
30180
30181#if defined(LIBXML_READER_ENABLED)
30182    int mem_base;
30183    int ret_val;
30184    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30185    int n_reader;
30186
30187    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30188        mem_base = xmlMemBlocks();
30189        reader = gen_xmlTextReaderPtr(n_reader, 0);
30190
30191        ret_val = xmlTextReaderIsNamespaceDecl(reader);
30192        desret_int(ret_val);
30193        call_tests++;
30194        des_xmlTextReaderPtr(n_reader, reader, 0);
30195        xmlResetLastError();
30196        if (mem_base != xmlMemBlocks()) {
30197            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
30198	           xmlMemBlocks() - mem_base);
30199	    test_ret++;
30200            printf(" %d", n_reader);
30201            printf("\n");
30202        }
30203    }
30204    function_tests++;
30205#endif
30206
30207    return(test_ret);
30208}
30209
30210
30211static int
30212test_xmlTextReaderIsValid(void) {
30213    int test_ret = 0;
30214
30215#if defined(LIBXML_READER_ENABLED)
30216    int mem_base;
30217    int ret_val;
30218    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30219    int n_reader;
30220
30221    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30222        mem_base = xmlMemBlocks();
30223        reader = gen_xmlTextReaderPtr(n_reader, 0);
30224
30225        ret_val = xmlTextReaderIsValid(reader);
30226        desret_int(ret_val);
30227        call_tests++;
30228        des_xmlTextReaderPtr(n_reader, reader, 0);
30229        xmlResetLastError();
30230        if (mem_base != xmlMemBlocks()) {
30231            printf("Leak of %d blocks found in xmlTextReaderIsValid",
30232	           xmlMemBlocks() - mem_base);
30233	    test_ret++;
30234            printf(" %d", n_reader);
30235            printf("\n");
30236        }
30237    }
30238    function_tests++;
30239#endif
30240
30241    return(test_ret);
30242}
30243
30244
30245static int
30246test_xmlTextReaderLocalName(void) {
30247    int test_ret = 0;
30248
30249#if defined(LIBXML_READER_ENABLED)
30250    int mem_base;
30251    xmlChar * ret_val;
30252    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30253    int n_reader;
30254
30255    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30256        mem_base = xmlMemBlocks();
30257        reader = gen_xmlTextReaderPtr(n_reader, 0);
30258
30259        ret_val = xmlTextReaderLocalName(reader);
30260        desret_xmlChar_ptr(ret_val);
30261        call_tests++;
30262        des_xmlTextReaderPtr(n_reader, reader, 0);
30263        xmlResetLastError();
30264        if (mem_base != xmlMemBlocks()) {
30265            printf("Leak of %d blocks found in xmlTextReaderLocalName",
30266	           xmlMemBlocks() - mem_base);
30267	    test_ret++;
30268            printf(" %d", n_reader);
30269            printf("\n");
30270        }
30271    }
30272    function_tests++;
30273#endif
30274
30275    return(test_ret);
30276}
30277
30278#ifdef LIBXML_READER_ENABLED
30279
30280#define gen_nb_xmlTextReaderLocatorPtr 1
30281static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30282    return(NULL);
30283}
30284static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30285}
30286#endif
30287
30288
30289static int
30290test_xmlTextReaderLocatorBaseURI(void) {
30291    int test_ret = 0;
30292
30293#if defined(LIBXML_READER_ENABLED)
30294    int mem_base;
30295    xmlChar * ret_val;
30296    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30297    int n_locator;
30298
30299    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30300        mem_base = xmlMemBlocks();
30301        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30302
30303        ret_val = xmlTextReaderLocatorBaseURI(locator);
30304        desret_xmlChar_ptr(ret_val);
30305        call_tests++;
30306        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30307        xmlResetLastError();
30308        if (mem_base != xmlMemBlocks()) {
30309            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
30310	           xmlMemBlocks() - mem_base);
30311	    test_ret++;
30312            printf(" %d", n_locator);
30313            printf("\n");
30314        }
30315    }
30316    function_tests++;
30317#endif
30318
30319    return(test_ret);
30320}
30321
30322
30323static int
30324test_xmlTextReaderLocatorLineNumber(void) {
30325    int test_ret = 0;
30326
30327#if defined(LIBXML_READER_ENABLED)
30328    int mem_base;
30329    int ret_val;
30330    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
30331    int n_locator;
30332
30333    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
30334        mem_base = xmlMemBlocks();
30335        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
30336
30337        ret_val = xmlTextReaderLocatorLineNumber(locator);
30338        desret_int(ret_val);
30339        call_tests++;
30340        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
30341        xmlResetLastError();
30342        if (mem_base != xmlMemBlocks()) {
30343            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
30344	           xmlMemBlocks() - mem_base);
30345	    test_ret++;
30346            printf(" %d", n_locator);
30347            printf("\n");
30348        }
30349    }
30350    function_tests++;
30351#endif
30352
30353    return(test_ret);
30354}
30355
30356
30357static int
30358test_xmlTextReaderLookupNamespace(void) {
30359    int test_ret = 0;
30360
30361#if defined(LIBXML_READER_ENABLED)
30362    int mem_base;
30363    xmlChar * ret_val;
30364    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30365    int n_reader;
30366    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
30367    int n_prefix;
30368
30369    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30370    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
30371        mem_base = xmlMemBlocks();
30372        reader = gen_xmlTextReaderPtr(n_reader, 0);
30373        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
30374
30375        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
30376        desret_xmlChar_ptr(ret_val);
30377        call_tests++;
30378        des_xmlTextReaderPtr(n_reader, reader, 0);
30379        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
30380        xmlResetLastError();
30381        if (mem_base != xmlMemBlocks()) {
30382            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
30383	           xmlMemBlocks() - mem_base);
30384	    test_ret++;
30385            printf(" %d", n_reader);
30386            printf(" %d", n_prefix);
30387            printf("\n");
30388        }
30389    }
30390    }
30391    function_tests++;
30392#endif
30393
30394    return(test_ret);
30395}
30396
30397
30398static int
30399test_xmlTextReaderMoveToAttribute(void) {
30400    int test_ret = 0;
30401
30402#if defined(LIBXML_READER_ENABLED)
30403    int mem_base;
30404    int ret_val;
30405    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30406    int n_reader;
30407    xmlChar * name; /* the qualified name of the attribute. */
30408    int n_name;
30409
30410    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30411    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30412        mem_base = xmlMemBlocks();
30413        reader = gen_xmlTextReaderPtr(n_reader, 0);
30414        name = gen_const_xmlChar_ptr(n_name, 1);
30415
30416        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
30417        desret_int(ret_val);
30418        call_tests++;
30419        des_xmlTextReaderPtr(n_reader, reader, 0);
30420        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30421        xmlResetLastError();
30422        if (mem_base != xmlMemBlocks()) {
30423            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
30424	           xmlMemBlocks() - mem_base);
30425	    test_ret++;
30426            printf(" %d", n_reader);
30427            printf(" %d", n_name);
30428            printf("\n");
30429        }
30430    }
30431    }
30432    function_tests++;
30433#endif
30434
30435    return(test_ret);
30436}
30437
30438
30439static int
30440test_xmlTextReaderMoveToAttributeNo(void) {
30441    int test_ret = 0;
30442
30443#if defined(LIBXML_READER_ENABLED)
30444    int mem_base;
30445    int ret_val;
30446    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30447    int n_reader;
30448    int no; /* the zero-based index of the attribute relative to the containing element. */
30449    int n_no;
30450
30451    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30452    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30453        mem_base = xmlMemBlocks();
30454        reader = gen_xmlTextReaderPtr(n_reader, 0);
30455        no = gen_int(n_no, 1);
30456
30457        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
30458        desret_int(ret_val);
30459        call_tests++;
30460        des_xmlTextReaderPtr(n_reader, reader, 0);
30461        des_int(n_no, no, 1);
30462        xmlResetLastError();
30463        if (mem_base != xmlMemBlocks()) {
30464            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
30465	           xmlMemBlocks() - mem_base);
30466	    test_ret++;
30467            printf(" %d", n_reader);
30468            printf(" %d", n_no);
30469            printf("\n");
30470        }
30471    }
30472    }
30473    function_tests++;
30474#endif
30475
30476    return(test_ret);
30477}
30478
30479
30480static int
30481test_xmlTextReaderMoveToAttributeNs(void) {
30482    int test_ret = 0;
30483
30484#if defined(LIBXML_READER_ENABLED)
30485    int mem_base;
30486    int ret_val;
30487    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30488    int n_reader;
30489    xmlChar * localName; /* the local name of the attribute. */
30490    int n_localName;
30491    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30492    int n_namespaceURI;
30493
30494    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30495    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30496    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30497        mem_base = xmlMemBlocks();
30498        reader = gen_xmlTextReaderPtr(n_reader, 0);
30499        localName = gen_const_xmlChar_ptr(n_localName, 1);
30500        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30501
30502        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30503        desret_int(ret_val);
30504        call_tests++;
30505        des_xmlTextReaderPtr(n_reader, reader, 0);
30506        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30507        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30508        xmlResetLastError();
30509        if (mem_base != xmlMemBlocks()) {
30510            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
30511	           xmlMemBlocks() - mem_base);
30512	    test_ret++;
30513            printf(" %d", n_reader);
30514            printf(" %d", n_localName);
30515            printf(" %d", n_namespaceURI);
30516            printf("\n");
30517        }
30518    }
30519    }
30520    }
30521    function_tests++;
30522#endif
30523
30524    return(test_ret);
30525}
30526
30527
30528static int
30529test_xmlTextReaderMoveToElement(void) {
30530    int test_ret = 0;
30531
30532#if defined(LIBXML_READER_ENABLED)
30533    int mem_base;
30534    int ret_val;
30535    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30536    int n_reader;
30537
30538    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30539        mem_base = xmlMemBlocks();
30540        reader = gen_xmlTextReaderPtr(n_reader, 0);
30541
30542        ret_val = xmlTextReaderMoveToElement(reader);
30543        desret_int(ret_val);
30544        call_tests++;
30545        des_xmlTextReaderPtr(n_reader, reader, 0);
30546        xmlResetLastError();
30547        if (mem_base != xmlMemBlocks()) {
30548            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
30549	           xmlMemBlocks() - mem_base);
30550	    test_ret++;
30551            printf(" %d", n_reader);
30552            printf("\n");
30553        }
30554    }
30555    function_tests++;
30556#endif
30557
30558    return(test_ret);
30559}
30560
30561
30562static int
30563test_xmlTextReaderMoveToFirstAttribute(void) {
30564    int test_ret = 0;
30565
30566#if defined(LIBXML_READER_ENABLED)
30567    int mem_base;
30568    int ret_val;
30569    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30570    int n_reader;
30571
30572    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30573        mem_base = xmlMemBlocks();
30574        reader = gen_xmlTextReaderPtr(n_reader, 0);
30575
30576        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
30577        desret_int(ret_val);
30578        call_tests++;
30579        des_xmlTextReaderPtr(n_reader, reader, 0);
30580        xmlResetLastError();
30581        if (mem_base != xmlMemBlocks()) {
30582            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
30583	           xmlMemBlocks() - mem_base);
30584	    test_ret++;
30585            printf(" %d", n_reader);
30586            printf("\n");
30587        }
30588    }
30589    function_tests++;
30590#endif
30591
30592    return(test_ret);
30593}
30594
30595
30596static int
30597test_xmlTextReaderMoveToNextAttribute(void) {
30598    int test_ret = 0;
30599
30600#if defined(LIBXML_READER_ENABLED)
30601    int mem_base;
30602    int ret_val;
30603    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30604    int n_reader;
30605
30606    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30607        mem_base = xmlMemBlocks();
30608        reader = gen_xmlTextReaderPtr(n_reader, 0);
30609
30610        ret_val = xmlTextReaderMoveToNextAttribute(reader);
30611        desret_int(ret_val);
30612        call_tests++;
30613        des_xmlTextReaderPtr(n_reader, reader, 0);
30614        xmlResetLastError();
30615        if (mem_base != xmlMemBlocks()) {
30616            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
30617	           xmlMemBlocks() - mem_base);
30618	    test_ret++;
30619            printf(" %d", n_reader);
30620            printf("\n");
30621        }
30622    }
30623    function_tests++;
30624#endif
30625
30626    return(test_ret);
30627}
30628
30629
30630static int
30631test_xmlTextReaderName(void) {
30632    int test_ret = 0;
30633
30634#if defined(LIBXML_READER_ENABLED)
30635    int mem_base;
30636    xmlChar * ret_val;
30637    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30638    int n_reader;
30639
30640    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30641        mem_base = xmlMemBlocks();
30642        reader = gen_xmlTextReaderPtr(n_reader, 0);
30643
30644        ret_val = xmlTextReaderName(reader);
30645        desret_xmlChar_ptr(ret_val);
30646        call_tests++;
30647        des_xmlTextReaderPtr(n_reader, reader, 0);
30648        xmlResetLastError();
30649        if (mem_base != xmlMemBlocks()) {
30650            printf("Leak of %d blocks found in xmlTextReaderName",
30651	           xmlMemBlocks() - mem_base);
30652	    test_ret++;
30653            printf(" %d", n_reader);
30654            printf("\n");
30655        }
30656    }
30657    function_tests++;
30658#endif
30659
30660    return(test_ret);
30661}
30662
30663
30664static int
30665test_xmlTextReaderNamespaceUri(void) {
30666    int test_ret = 0;
30667
30668#if defined(LIBXML_READER_ENABLED)
30669    int mem_base;
30670    xmlChar * ret_val;
30671    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30672    int n_reader;
30673
30674    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30675        mem_base = xmlMemBlocks();
30676        reader = gen_xmlTextReaderPtr(n_reader, 0);
30677
30678        ret_val = xmlTextReaderNamespaceUri(reader);
30679        desret_xmlChar_ptr(ret_val);
30680        call_tests++;
30681        des_xmlTextReaderPtr(n_reader, reader, 0);
30682        xmlResetLastError();
30683        if (mem_base != xmlMemBlocks()) {
30684            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
30685	           xmlMemBlocks() - mem_base);
30686	    test_ret++;
30687            printf(" %d", n_reader);
30688            printf("\n");
30689        }
30690    }
30691    function_tests++;
30692#endif
30693
30694    return(test_ret);
30695}
30696
30697
30698static int
30699test_xmlTextReaderNext(void) {
30700    int test_ret = 0;
30701
30702#if defined(LIBXML_READER_ENABLED)
30703    int mem_base;
30704    int ret_val;
30705    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30706    int n_reader;
30707
30708    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30709        mem_base = xmlMemBlocks();
30710        reader = gen_xmlTextReaderPtr(n_reader, 0);
30711
30712        ret_val = xmlTextReaderNext(reader);
30713        desret_int(ret_val);
30714        call_tests++;
30715        des_xmlTextReaderPtr(n_reader, reader, 0);
30716        xmlResetLastError();
30717        if (mem_base != xmlMemBlocks()) {
30718            printf("Leak of %d blocks found in xmlTextReaderNext",
30719	           xmlMemBlocks() - mem_base);
30720	    test_ret++;
30721            printf(" %d", n_reader);
30722            printf("\n");
30723        }
30724    }
30725    function_tests++;
30726#endif
30727
30728    return(test_ret);
30729}
30730
30731
30732static int
30733test_xmlTextReaderNextSibling(void) {
30734    int test_ret = 0;
30735
30736#if defined(LIBXML_READER_ENABLED)
30737    int mem_base;
30738    int ret_val;
30739    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30740    int n_reader;
30741
30742    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30743        mem_base = xmlMemBlocks();
30744        reader = gen_xmlTextReaderPtr(n_reader, 0);
30745
30746        ret_val = xmlTextReaderNextSibling(reader);
30747        desret_int(ret_val);
30748        call_tests++;
30749        des_xmlTextReaderPtr(n_reader, reader, 0);
30750        xmlResetLastError();
30751        if (mem_base != xmlMemBlocks()) {
30752            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
30753	           xmlMemBlocks() - mem_base);
30754	    test_ret++;
30755            printf(" %d", n_reader);
30756            printf("\n");
30757        }
30758    }
30759    function_tests++;
30760#endif
30761
30762    return(test_ret);
30763}
30764
30765
30766static int
30767test_xmlTextReaderNodeType(void) {
30768    int test_ret = 0;
30769
30770#if defined(LIBXML_READER_ENABLED)
30771    int mem_base;
30772    int ret_val;
30773    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30774    int n_reader;
30775
30776    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30777        mem_base = xmlMemBlocks();
30778        reader = gen_xmlTextReaderPtr(n_reader, 0);
30779
30780        ret_val = xmlTextReaderNodeType(reader);
30781        desret_int(ret_val);
30782        call_tests++;
30783        des_xmlTextReaderPtr(n_reader, reader, 0);
30784        xmlResetLastError();
30785        if (mem_base != xmlMemBlocks()) {
30786            printf("Leak of %d blocks found in xmlTextReaderNodeType",
30787	           xmlMemBlocks() - mem_base);
30788	    test_ret++;
30789            printf(" %d", n_reader);
30790            printf("\n");
30791        }
30792    }
30793    function_tests++;
30794#endif
30795
30796    return(test_ret);
30797}
30798
30799
30800static int
30801test_xmlTextReaderNormalization(void) {
30802    int test_ret = 0;
30803
30804#if defined(LIBXML_READER_ENABLED)
30805    int mem_base;
30806    int ret_val;
30807    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30808    int n_reader;
30809
30810    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30811        mem_base = xmlMemBlocks();
30812        reader = gen_xmlTextReaderPtr(n_reader, 0);
30813
30814        ret_val = xmlTextReaderNormalization(reader);
30815        desret_int(ret_val);
30816        call_tests++;
30817        des_xmlTextReaderPtr(n_reader, reader, 0);
30818        xmlResetLastError();
30819        if (mem_base != xmlMemBlocks()) {
30820            printf("Leak of %d blocks found in xmlTextReaderNormalization",
30821	           xmlMemBlocks() - mem_base);
30822	    test_ret++;
30823            printf(" %d", n_reader);
30824            printf("\n");
30825        }
30826    }
30827    function_tests++;
30828#endif
30829
30830    return(test_ret);
30831}
30832
30833
30834static int
30835test_xmlTextReaderPrefix(void) {
30836    int test_ret = 0;
30837
30838#if defined(LIBXML_READER_ENABLED)
30839    int mem_base;
30840    xmlChar * ret_val;
30841    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30842    int n_reader;
30843
30844    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30845        mem_base = xmlMemBlocks();
30846        reader = gen_xmlTextReaderPtr(n_reader, 0);
30847
30848        ret_val = xmlTextReaderPrefix(reader);
30849        desret_xmlChar_ptr(ret_val);
30850        call_tests++;
30851        des_xmlTextReaderPtr(n_reader, reader, 0);
30852        xmlResetLastError();
30853        if (mem_base != xmlMemBlocks()) {
30854            printf("Leak of %d blocks found in xmlTextReaderPrefix",
30855	           xmlMemBlocks() - mem_base);
30856	    test_ret++;
30857            printf(" %d", n_reader);
30858            printf("\n");
30859        }
30860    }
30861    function_tests++;
30862#endif
30863
30864    return(test_ret);
30865}
30866
30867
30868static int
30869test_xmlTextReaderPreserve(void) {
30870    int test_ret = 0;
30871
30872#if defined(LIBXML_READER_ENABLED)
30873    int mem_base;
30874    xmlNodePtr ret_val;
30875    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30876    int n_reader;
30877
30878    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30879        mem_base = xmlMemBlocks();
30880        reader = gen_xmlTextReaderPtr(n_reader, 0);
30881
30882        ret_val = xmlTextReaderPreserve(reader);
30883        desret_xmlNodePtr(ret_val);
30884        call_tests++;
30885        des_xmlTextReaderPtr(n_reader, reader, 0);
30886        xmlResetLastError();
30887        if (mem_base != xmlMemBlocks()) {
30888            printf("Leak of %d blocks found in xmlTextReaderPreserve",
30889	           xmlMemBlocks() - mem_base);
30890	    test_ret++;
30891            printf(" %d", n_reader);
30892            printf("\n");
30893        }
30894    }
30895    function_tests++;
30896#endif
30897
30898    return(test_ret);
30899}
30900
30901
30902static int
30903test_xmlTextReaderPreservePattern(void) {
30904    int test_ret = 0;
30905
30906#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
30907#ifdef LIBXML_PATTERN_ENABLED
30908    int mem_base;
30909    int ret_val;
30910    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30911    int n_reader;
30912    xmlChar * pattern; /* an XPath subset pattern */
30913    int n_pattern;
30914    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
30915    int n_namespaces;
30916
30917    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30918    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
30919    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
30920        mem_base = xmlMemBlocks();
30921        reader = gen_xmlTextReaderPtr(n_reader, 0);
30922        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
30923        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
30924
30925        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
30926        desret_int(ret_val);
30927        call_tests++;
30928        des_xmlTextReaderPtr(n_reader, reader, 0);
30929        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
30930        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
30931        xmlResetLastError();
30932        if (mem_base != xmlMemBlocks()) {
30933            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
30934	           xmlMemBlocks() - mem_base);
30935	    test_ret++;
30936            printf(" %d", n_reader);
30937            printf(" %d", n_pattern);
30938            printf(" %d", n_namespaces);
30939            printf("\n");
30940        }
30941    }
30942    }
30943    }
30944    function_tests++;
30945#endif
30946#endif
30947
30948    return(test_ret);
30949}
30950
30951
30952static int
30953test_xmlTextReaderQuoteChar(void) {
30954    int test_ret = 0;
30955
30956#if defined(LIBXML_READER_ENABLED)
30957    int mem_base;
30958    int ret_val;
30959    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30960    int n_reader;
30961
30962    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30963        mem_base = xmlMemBlocks();
30964        reader = gen_xmlTextReaderPtr(n_reader, 0);
30965
30966        ret_val = xmlTextReaderQuoteChar(reader);
30967        desret_int(ret_val);
30968        call_tests++;
30969        des_xmlTextReaderPtr(n_reader, reader, 0);
30970        xmlResetLastError();
30971        if (mem_base != xmlMemBlocks()) {
30972            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
30973	           xmlMemBlocks() - mem_base);
30974	    test_ret++;
30975            printf(" %d", n_reader);
30976            printf("\n");
30977        }
30978    }
30979    function_tests++;
30980#endif
30981
30982    return(test_ret);
30983}
30984
30985
30986static int
30987test_xmlTextReaderRead(void) {
30988    int test_ret = 0;
30989
30990#if defined(LIBXML_READER_ENABLED)
30991    int mem_base;
30992    int ret_val;
30993    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30994    int n_reader;
30995
30996    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30997        mem_base = xmlMemBlocks();
30998        reader = gen_xmlTextReaderPtr(n_reader, 0);
30999
31000        ret_val = xmlTextReaderRead(reader);
31001        desret_int(ret_val);
31002        call_tests++;
31003        des_xmlTextReaderPtr(n_reader, reader, 0);
31004        xmlResetLastError();
31005        if (mem_base != xmlMemBlocks()) {
31006            printf("Leak of %d blocks found in xmlTextReaderRead",
31007	           xmlMemBlocks() - mem_base);
31008	    test_ret++;
31009            printf(" %d", n_reader);
31010            printf("\n");
31011        }
31012    }
31013    function_tests++;
31014#endif
31015
31016    return(test_ret);
31017}
31018
31019
31020static int
31021test_xmlTextReaderReadAttributeValue(void) {
31022    int test_ret = 0;
31023
31024#if defined(LIBXML_READER_ENABLED)
31025    int mem_base;
31026    int ret_val;
31027    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31028    int n_reader;
31029
31030    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31031        mem_base = xmlMemBlocks();
31032        reader = gen_xmlTextReaderPtr(n_reader, 0);
31033
31034        ret_val = xmlTextReaderReadAttributeValue(reader);
31035        desret_int(ret_val);
31036        call_tests++;
31037        des_xmlTextReaderPtr(n_reader, reader, 0);
31038        xmlResetLastError();
31039        if (mem_base != xmlMemBlocks()) {
31040            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31041	           xmlMemBlocks() - mem_base);
31042	    test_ret++;
31043            printf(" %d", n_reader);
31044            printf("\n");
31045        }
31046    }
31047    function_tests++;
31048#endif
31049
31050    return(test_ret);
31051}
31052
31053
31054static int
31055test_xmlTextReaderReadState(void) {
31056    int test_ret = 0;
31057
31058#if defined(LIBXML_READER_ENABLED)
31059    int mem_base;
31060    int ret_val;
31061    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31062    int n_reader;
31063
31064    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31065        mem_base = xmlMemBlocks();
31066        reader = gen_xmlTextReaderPtr(n_reader, 0);
31067
31068        ret_val = xmlTextReaderReadState(reader);
31069        desret_int(ret_val);
31070        call_tests++;
31071        des_xmlTextReaderPtr(n_reader, reader, 0);
31072        xmlResetLastError();
31073        if (mem_base != xmlMemBlocks()) {
31074            printf("Leak of %d blocks found in xmlTextReaderReadState",
31075	           xmlMemBlocks() - mem_base);
31076	    test_ret++;
31077            printf(" %d", n_reader);
31078            printf("\n");
31079        }
31080    }
31081    function_tests++;
31082#endif
31083
31084    return(test_ret);
31085}
31086
31087
31088static int
31089test_xmlTextReaderRelaxNGSetSchema(void) {
31090    int test_ret = 0;
31091
31092#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31093    int mem_base;
31094    int ret_val;
31095    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31096    int n_reader;
31097    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
31098    int n_schema;
31099
31100    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31101    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
31102        mem_base = xmlMemBlocks();
31103        reader = gen_xmlTextReaderPtr(n_reader, 0);
31104        schema = gen_xmlRelaxNGPtr(n_schema, 1);
31105
31106        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
31107        desret_int(ret_val);
31108        call_tests++;
31109        des_xmlTextReaderPtr(n_reader, reader, 0);
31110        des_xmlRelaxNGPtr(n_schema, schema, 1);
31111        xmlResetLastError();
31112        if (mem_base != xmlMemBlocks()) {
31113            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
31114	           xmlMemBlocks() - mem_base);
31115	    test_ret++;
31116            printf(" %d", n_reader);
31117            printf(" %d", n_schema);
31118            printf("\n");
31119        }
31120    }
31121    }
31122    function_tests++;
31123#endif
31124
31125    return(test_ret);
31126}
31127
31128
31129static int
31130test_xmlTextReaderRelaxNGValidate(void) {
31131    int test_ret = 0;
31132
31133#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31134    int mem_base;
31135    int ret_val;
31136    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31137    int n_reader;
31138    char * rng; /* the path to a RelaxNG schema or NULL */
31139    int n_rng;
31140
31141    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31142    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
31143        mem_base = xmlMemBlocks();
31144        reader = gen_xmlTextReaderPtr(n_reader, 0);
31145        rng = gen_const_char_ptr(n_rng, 1);
31146
31147        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
31148        desret_int(ret_val);
31149        call_tests++;
31150        des_xmlTextReaderPtr(n_reader, reader, 0);
31151        des_const_char_ptr(n_rng, (const char *)rng, 1);
31152        xmlResetLastError();
31153        if (mem_base != xmlMemBlocks()) {
31154            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
31155	           xmlMemBlocks() - mem_base);
31156	    test_ret++;
31157            printf(" %d", n_reader);
31158            printf(" %d", n_rng);
31159            printf("\n");
31160        }
31161    }
31162    }
31163    function_tests++;
31164#endif
31165
31166    return(test_ret);
31167}
31168
31169
31170static int
31171test_xmlTextReaderSetErrorHandler(void) {
31172    int test_ret = 0;
31173
31174
31175    /* missing type support */
31176    return(test_ret);
31177}
31178
31179
31180static int
31181test_xmlTextReaderSetParserProp(void) {
31182    int test_ret = 0;
31183
31184#if defined(LIBXML_READER_ENABLED)
31185    int mem_base;
31186    int ret_val;
31187    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31188    int n_reader;
31189    int prop; /* the xmlParserProperties to set */
31190    int n_prop;
31191    int value; /* usually 0 or 1 to (de)activate it */
31192    int n_value;
31193
31194    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31195    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31196    for (n_value = 0;n_value < gen_nb_int;n_value++) {
31197        mem_base = xmlMemBlocks();
31198        reader = gen_xmlTextReaderPtr(n_reader, 0);
31199        prop = gen_int(n_prop, 1);
31200        value = gen_int(n_value, 2);
31201
31202        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
31203        desret_int(ret_val);
31204        call_tests++;
31205        des_xmlTextReaderPtr(n_reader, reader, 0);
31206        des_int(n_prop, prop, 1);
31207        des_int(n_value, value, 2);
31208        xmlResetLastError();
31209        if (mem_base != xmlMemBlocks()) {
31210            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
31211	           xmlMemBlocks() - mem_base);
31212	    test_ret++;
31213            printf(" %d", n_reader);
31214            printf(" %d", n_prop);
31215            printf(" %d", n_value);
31216            printf("\n");
31217        }
31218    }
31219    }
31220    }
31221    function_tests++;
31222#endif
31223
31224    return(test_ret);
31225}
31226
31227
31228static int
31229test_xmlTextReaderSetStructuredErrorHandler(void) {
31230    int test_ret = 0;
31231
31232
31233    /* missing type support */
31234    return(test_ret);
31235}
31236
31237
31238static int
31239test_xmlTextReaderStandalone(void) {
31240    int test_ret = 0;
31241
31242#if defined(LIBXML_READER_ENABLED)
31243    int mem_base;
31244    int ret_val;
31245    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31246    int n_reader;
31247
31248    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31249        mem_base = xmlMemBlocks();
31250        reader = gen_xmlTextReaderPtr(n_reader, 0);
31251
31252        ret_val = xmlTextReaderStandalone(reader);
31253        desret_int(ret_val);
31254        call_tests++;
31255        des_xmlTextReaderPtr(n_reader, reader, 0);
31256        xmlResetLastError();
31257        if (mem_base != xmlMemBlocks()) {
31258            printf("Leak of %d blocks found in xmlTextReaderStandalone",
31259	           xmlMemBlocks() - mem_base);
31260	    test_ret++;
31261            printf(" %d", n_reader);
31262            printf("\n");
31263        }
31264    }
31265    function_tests++;
31266#endif
31267
31268    return(test_ret);
31269}
31270
31271
31272static int
31273test_xmlTextReaderValue(void) {
31274    int test_ret = 0;
31275
31276#if defined(LIBXML_READER_ENABLED)
31277    int mem_base;
31278    xmlChar * ret_val;
31279    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31280    int n_reader;
31281
31282    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31283        mem_base = xmlMemBlocks();
31284        reader = gen_xmlTextReaderPtr(n_reader, 0);
31285
31286        ret_val = xmlTextReaderValue(reader);
31287        desret_xmlChar_ptr(ret_val);
31288        call_tests++;
31289        des_xmlTextReaderPtr(n_reader, reader, 0);
31290        xmlResetLastError();
31291        if (mem_base != xmlMemBlocks()) {
31292            printf("Leak of %d blocks found in xmlTextReaderValue",
31293	           xmlMemBlocks() - mem_base);
31294	    test_ret++;
31295            printf(" %d", n_reader);
31296            printf("\n");
31297        }
31298    }
31299    function_tests++;
31300#endif
31301
31302    return(test_ret);
31303}
31304
31305
31306static int
31307test_xmlTextReaderXmlLang(void) {
31308    int test_ret = 0;
31309
31310#if defined(LIBXML_READER_ENABLED)
31311    int mem_base;
31312    xmlChar * ret_val;
31313    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31314    int n_reader;
31315
31316    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31317        mem_base = xmlMemBlocks();
31318        reader = gen_xmlTextReaderPtr(n_reader, 0);
31319
31320        ret_val = xmlTextReaderXmlLang(reader);
31321        desret_xmlChar_ptr(ret_val);
31322        call_tests++;
31323        des_xmlTextReaderPtr(n_reader, reader, 0);
31324        xmlResetLastError();
31325        if (mem_base != xmlMemBlocks()) {
31326            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
31327	           xmlMemBlocks() - mem_base);
31328	    test_ret++;
31329            printf(" %d", n_reader);
31330            printf("\n");
31331        }
31332    }
31333    function_tests++;
31334#endif
31335
31336    return(test_ret);
31337}
31338
31339static int
31340test_xmlreader(void) {
31341    int test_ret = 0;
31342
31343    if (quiet == 0) printf("Testing xmlreader : 71 of 81 functions ...\n");
31344    test_ret += test_xmlNewTextReader();
31345    test_ret += test_xmlNewTextReaderFilename();
31346    test_ret += test_xmlReaderForDoc();
31347    test_ret += test_xmlReaderForFile();
31348    test_ret += test_xmlReaderForMemory();
31349    test_ret += test_xmlReaderNewDoc();
31350    test_ret += test_xmlReaderNewFile();
31351    test_ret += test_xmlReaderNewMemory();
31352    test_ret += test_xmlReaderNewWalker();
31353    test_ret += test_xmlReaderWalker();
31354    test_ret += test_xmlTextReaderAttributeCount();
31355    test_ret += test_xmlTextReaderBaseUri();
31356    test_ret += test_xmlTextReaderByteConsumed();
31357    test_ret += test_xmlTextReaderClose();
31358    test_ret += test_xmlTextReaderConstBaseUri();
31359    test_ret += test_xmlTextReaderConstEncoding();
31360    test_ret += test_xmlTextReaderConstLocalName();
31361    test_ret += test_xmlTextReaderConstName();
31362    test_ret += test_xmlTextReaderConstNamespaceUri();
31363    test_ret += test_xmlTextReaderConstPrefix();
31364    test_ret += test_xmlTextReaderConstString();
31365    test_ret += test_xmlTextReaderConstValue();
31366    test_ret += test_xmlTextReaderConstXmlLang();
31367    test_ret += test_xmlTextReaderConstXmlVersion();
31368    test_ret += test_xmlTextReaderCurrentDoc();
31369    test_ret += test_xmlTextReaderCurrentNode();
31370    test_ret += test_xmlTextReaderDepth();
31371    test_ret += test_xmlTextReaderExpand();
31372    test_ret += test_xmlTextReaderGetAttribute();
31373    test_ret += test_xmlTextReaderGetAttributeNo();
31374    test_ret += test_xmlTextReaderGetAttributeNs();
31375    test_ret += test_xmlTextReaderGetErrorHandler();
31376    test_ret += test_xmlTextReaderGetParserColumnNumber();
31377    test_ret += test_xmlTextReaderGetParserLineNumber();
31378    test_ret += test_xmlTextReaderGetParserProp();
31379    test_ret += test_xmlTextReaderGetRemainder();
31380    test_ret += test_xmlTextReaderHasAttributes();
31381    test_ret += test_xmlTextReaderHasValue();
31382    test_ret += test_xmlTextReaderIsDefault();
31383    test_ret += test_xmlTextReaderIsEmptyElement();
31384    test_ret += test_xmlTextReaderIsNamespaceDecl();
31385    test_ret += test_xmlTextReaderIsValid();
31386    test_ret += test_xmlTextReaderLocalName();
31387    test_ret += test_xmlTextReaderLocatorBaseURI();
31388    test_ret += test_xmlTextReaderLocatorLineNumber();
31389    test_ret += test_xmlTextReaderLookupNamespace();
31390    test_ret += test_xmlTextReaderMoveToAttribute();
31391    test_ret += test_xmlTextReaderMoveToAttributeNo();
31392    test_ret += test_xmlTextReaderMoveToAttributeNs();
31393    test_ret += test_xmlTextReaderMoveToElement();
31394    test_ret += test_xmlTextReaderMoveToFirstAttribute();
31395    test_ret += test_xmlTextReaderMoveToNextAttribute();
31396    test_ret += test_xmlTextReaderName();
31397    test_ret += test_xmlTextReaderNamespaceUri();
31398    test_ret += test_xmlTextReaderNext();
31399    test_ret += test_xmlTextReaderNextSibling();
31400    test_ret += test_xmlTextReaderNodeType();
31401    test_ret += test_xmlTextReaderNormalization();
31402    test_ret += test_xmlTextReaderPrefix();
31403    test_ret += test_xmlTextReaderPreserve();
31404    test_ret += test_xmlTextReaderPreservePattern();
31405    test_ret += test_xmlTextReaderQuoteChar();
31406    test_ret += test_xmlTextReaderRead();
31407    test_ret += test_xmlTextReaderReadAttributeValue();
31408    test_ret += test_xmlTextReaderReadState();
31409    test_ret += test_xmlTextReaderRelaxNGSetSchema();
31410    test_ret += test_xmlTextReaderRelaxNGValidate();
31411    test_ret += test_xmlTextReaderSetErrorHandler();
31412    test_ret += test_xmlTextReaderSetParserProp();
31413    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
31414    test_ret += test_xmlTextReaderStandalone();
31415    test_ret += test_xmlTextReaderValue();
31416    test_ret += test_xmlTextReaderXmlLang();
31417
31418    if (test_ret != 0)
31419	printf("Module xmlreader: %d errors\n", test_ret);
31420    return(test_ret);
31421}
31422#ifdef LIBXML_REGEXP_ENABLED
31423
31424#define gen_nb_xmlRegExecCtxtPtr 1
31425static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31426    return(NULL);
31427}
31428static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31429}
31430#endif
31431
31432
31433static int
31434test_xmlRegExecErrInfo(void) {
31435    int test_ret = 0;
31436
31437#if defined(LIBXML_REGEXP_ENABLED)
31438    int mem_base;
31439    int ret_val;
31440    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
31441    int n_exec;
31442    xmlChar ** string; /* return value for the error string */
31443    int n_string;
31444    int * nbval; /* pointer to the number of accepted values IN/OUT */
31445    int n_nbval;
31446    int * nbneg; /* return number of negative transitions */
31447    int n_nbneg;
31448    xmlChar ** values; /* pointer to the array of acceptable values */
31449    int n_values;
31450    int * terminal; /* return value if this was a terminal state */
31451    int n_terminal;
31452
31453    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31454    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
31455    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
31456    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
31457    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
31458    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
31459        mem_base = xmlMemBlocks();
31460        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31461        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
31462        nbval = gen_int_ptr(n_nbval, 2);
31463        nbneg = gen_int_ptr(n_nbneg, 3);
31464        values = gen_xmlChar_ptr_ptr(n_values, 4);
31465        terminal = gen_int_ptr(n_terminal, 5);
31466
31467        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
31468        desret_int(ret_val);
31469        call_tests++;
31470        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31471        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
31472        des_int_ptr(n_nbval, nbval, 2);
31473        des_int_ptr(n_nbneg, nbneg, 3);
31474        des_xmlChar_ptr_ptr(n_values, values, 4);
31475        des_int_ptr(n_terminal, terminal, 5);
31476        xmlResetLastError();
31477        if (mem_base != xmlMemBlocks()) {
31478            printf("Leak of %d blocks found in xmlRegExecErrInfo",
31479	           xmlMemBlocks() - mem_base);
31480	    test_ret++;
31481            printf(" %d", n_exec);
31482            printf(" %d", n_string);
31483            printf(" %d", n_nbval);
31484            printf(" %d", n_nbneg);
31485            printf(" %d", n_values);
31486            printf(" %d", n_terminal);
31487            printf("\n");
31488        }
31489    }
31490    }
31491    }
31492    }
31493    }
31494    }
31495    function_tests++;
31496#endif
31497
31498    return(test_ret);
31499}
31500
31501
31502static int
31503test_xmlRegExecNextValues(void) {
31504    int test_ret = 0;
31505
31506#if defined(LIBXML_REGEXP_ENABLED)
31507    int mem_base;
31508    int ret_val;
31509    xmlRegExecCtxtPtr exec; /* a regexp execution context */
31510    int n_exec;
31511    int * nbval; /* pointer to the number of accepted values IN/OUT */
31512    int n_nbval;
31513    int * nbneg; /* return number of negative transitions */
31514    int n_nbneg;
31515    xmlChar ** values; /* pointer to the array of acceptable values */
31516    int n_values;
31517    int * terminal; /* return value if this was a terminal state */
31518    int n_terminal;
31519
31520    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31521    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
31522    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
31523    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
31524    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
31525        mem_base = xmlMemBlocks();
31526        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31527        nbval = gen_int_ptr(n_nbval, 1);
31528        nbneg = gen_int_ptr(n_nbneg, 2);
31529        values = gen_xmlChar_ptr_ptr(n_values, 3);
31530        terminal = gen_int_ptr(n_terminal, 4);
31531
31532        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
31533        desret_int(ret_val);
31534        call_tests++;
31535        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31536        des_int_ptr(n_nbval, nbval, 1);
31537        des_int_ptr(n_nbneg, nbneg, 2);
31538        des_xmlChar_ptr_ptr(n_values, values, 3);
31539        des_int_ptr(n_terminal, terminal, 4);
31540        xmlResetLastError();
31541        if (mem_base != xmlMemBlocks()) {
31542            printf("Leak of %d blocks found in xmlRegExecNextValues",
31543	           xmlMemBlocks() - mem_base);
31544	    test_ret++;
31545            printf(" %d", n_exec);
31546            printf(" %d", n_nbval);
31547            printf(" %d", n_nbneg);
31548            printf(" %d", n_values);
31549            printf(" %d", n_terminal);
31550            printf("\n");
31551        }
31552    }
31553    }
31554    }
31555    }
31556    }
31557    function_tests++;
31558#endif
31559
31560    return(test_ret);
31561}
31562
31563
31564static int
31565test_xmlRegExecPushString(void) {
31566    int test_ret = 0;
31567
31568#if defined(LIBXML_REGEXP_ENABLED)
31569    int mem_base;
31570    int ret_val;
31571    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
31572    int n_exec;
31573    xmlChar * value; /* a string token input */
31574    int n_value;
31575    void * data; /* data associated to the token to reuse in callbacks */
31576    int n_data;
31577
31578    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31579    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
31580    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
31581        mem_base = xmlMemBlocks();
31582        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31583        value = gen_const_xmlChar_ptr(n_value, 1);
31584        data = gen_userdata(n_data, 2);
31585
31586        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
31587        desret_int(ret_val);
31588        call_tests++;
31589        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31590        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
31591        des_userdata(n_data, data, 2);
31592        xmlResetLastError();
31593        if (mem_base != xmlMemBlocks()) {
31594            printf("Leak of %d blocks found in xmlRegExecPushString",
31595	           xmlMemBlocks() - mem_base);
31596	    test_ret++;
31597            printf(" %d", n_exec);
31598            printf(" %d", n_value);
31599            printf(" %d", n_data);
31600            printf("\n");
31601        }
31602    }
31603    }
31604    }
31605    function_tests++;
31606#endif
31607
31608    return(test_ret);
31609}
31610
31611
31612static int
31613test_xmlRegExecPushString2(void) {
31614    int test_ret = 0;
31615
31616#if defined(LIBXML_REGEXP_ENABLED)
31617    int mem_base;
31618    int ret_val;
31619    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
31620    int n_exec;
31621    xmlChar * value; /* the first string token input */
31622    int n_value;
31623    xmlChar * value2; /* the second string token input */
31624    int n_value2;
31625    void * data; /* data associated to the token to reuse in callbacks */
31626    int n_data;
31627
31628    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
31629    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
31630    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
31631    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
31632        mem_base = xmlMemBlocks();
31633        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31634        value = gen_const_xmlChar_ptr(n_value, 1);
31635        value2 = gen_const_xmlChar_ptr(n_value2, 2);
31636        data = gen_userdata(n_data, 3);
31637
31638        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
31639        desret_int(ret_val);
31640        call_tests++;
31641        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31642        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
31643        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
31644        des_userdata(n_data, data, 3);
31645        xmlResetLastError();
31646        if (mem_base != xmlMemBlocks()) {
31647            printf("Leak of %d blocks found in xmlRegExecPushString2",
31648	           xmlMemBlocks() - mem_base);
31649	    test_ret++;
31650            printf(" %d", n_exec);
31651            printf(" %d", n_value);
31652            printf(" %d", n_value2);
31653            printf(" %d", n_data);
31654            printf("\n");
31655        }
31656    }
31657    }
31658    }
31659    }
31660    function_tests++;
31661#endif
31662
31663    return(test_ret);
31664}
31665
31666#ifdef LIBXML_REGEXP_ENABLED
31667
31668#define gen_nb_xmlRegexpPtr 1
31669static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31670    return(NULL);
31671}
31672static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31673}
31674#endif
31675
31676
31677static int
31678test_xmlRegNewExecCtxt(void) {
31679    int test_ret = 0;
31680
31681
31682    /* missing type support */
31683    return(test_ret);
31684}
31685
31686
31687static int
31688test_xmlRegexpCompile(void) {
31689    int test_ret = 0;
31690
31691
31692    /* missing type support */
31693    return(test_ret);
31694}
31695
31696
31697static int
31698test_xmlRegexpExec(void) {
31699    int test_ret = 0;
31700
31701#if defined(LIBXML_REGEXP_ENABLED)
31702    int mem_base;
31703    int ret_val;
31704    xmlRegexpPtr comp; /* the compiled regular expression */
31705    int n_comp;
31706    xmlChar * content; /* the value to check against the regular expression */
31707    int n_content;
31708
31709    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
31710    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
31711        mem_base = xmlMemBlocks();
31712        comp = gen_xmlRegexpPtr(n_comp, 0);
31713        content = gen_const_xmlChar_ptr(n_content, 1);
31714
31715        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
31716        desret_int(ret_val);
31717        call_tests++;
31718        des_xmlRegexpPtr(n_comp, comp, 0);
31719        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
31720        xmlResetLastError();
31721        if (mem_base != xmlMemBlocks()) {
31722            printf("Leak of %d blocks found in xmlRegexpExec",
31723	           xmlMemBlocks() - mem_base);
31724	    test_ret++;
31725            printf(" %d", n_comp);
31726            printf(" %d", n_content);
31727            printf("\n");
31728        }
31729    }
31730    }
31731    function_tests++;
31732#endif
31733
31734    return(test_ret);
31735}
31736
31737
31738static int
31739test_xmlRegexpIsDeterminist(void) {
31740    int test_ret = 0;
31741
31742#if defined(LIBXML_REGEXP_ENABLED)
31743    int mem_base;
31744    int ret_val;
31745    xmlRegexpPtr comp; /* the compiled regular expression */
31746    int n_comp;
31747
31748    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
31749        mem_base = xmlMemBlocks();
31750        comp = gen_xmlRegexpPtr(n_comp, 0);
31751
31752        ret_val = xmlRegexpIsDeterminist(comp);
31753        desret_int(ret_val);
31754        call_tests++;
31755        des_xmlRegexpPtr(n_comp, comp, 0);
31756        xmlResetLastError();
31757        if (mem_base != xmlMemBlocks()) {
31758            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
31759	           xmlMemBlocks() - mem_base);
31760	    test_ret++;
31761            printf(" %d", n_comp);
31762            printf("\n");
31763        }
31764    }
31765    function_tests++;
31766#endif
31767
31768    return(test_ret);
31769}
31770
31771
31772static int
31773test_xmlRegexpPrint(void) {
31774    int test_ret = 0;
31775
31776#if defined(LIBXML_REGEXP_ENABLED)
31777    int mem_base;
31778    FILE * output; /* the file for the output debug */
31779    int n_output;
31780    xmlRegexpPtr regexp; /* the compiled regexp */
31781    int n_regexp;
31782
31783    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
31784    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
31785        mem_base = xmlMemBlocks();
31786        output = gen_FILE_ptr(n_output, 0);
31787        regexp = gen_xmlRegexpPtr(n_regexp, 1);
31788
31789        xmlRegexpPrint(output, regexp);
31790        call_tests++;
31791        des_FILE_ptr(n_output, output, 0);
31792        des_xmlRegexpPtr(n_regexp, regexp, 1);
31793        xmlResetLastError();
31794        if (mem_base != xmlMemBlocks()) {
31795            printf("Leak of %d blocks found in xmlRegexpPrint",
31796	           xmlMemBlocks() - mem_base);
31797	    test_ret++;
31798            printf(" %d", n_output);
31799            printf(" %d", n_regexp);
31800            printf("\n");
31801        }
31802    }
31803    }
31804    function_tests++;
31805#endif
31806
31807    return(test_ret);
31808}
31809
31810static int
31811test_xmlregexp(void) {
31812    int test_ret = 0;
31813
31814    if (quiet == 0) printf("Testing xmlregexp : 7 of 11 functions ...\n");
31815    test_ret += test_xmlRegExecErrInfo();
31816    test_ret += test_xmlRegExecNextValues();
31817    test_ret += test_xmlRegExecPushString();
31818    test_ret += test_xmlRegExecPushString2();
31819    test_ret += test_xmlRegNewExecCtxt();
31820    test_ret += test_xmlRegexpCompile();
31821    test_ret += test_xmlRegexpExec();
31822    test_ret += test_xmlRegexpIsDeterminist();
31823    test_ret += test_xmlRegexpPrint();
31824
31825    if (test_ret != 0)
31826	printf("Module xmlregexp: %d errors\n", test_ret);
31827    return(test_ret);
31828}
31829#ifdef LIBXML_OUTPUT_ENABLED
31830
31831#define gen_nb_xmlSaveCtxtPtr 1
31832static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31833    return(NULL);
31834}
31835static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31836}
31837#endif
31838
31839
31840static int
31841test_xmlSaveClose(void) {
31842    int test_ret = 0;
31843
31844#if defined(LIBXML_OUTPUT_ENABLED)
31845    int mem_base;
31846    int ret_val;
31847    xmlSaveCtxtPtr ctxt; /* a document saving context */
31848    int n_ctxt;
31849
31850    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31851        mem_base = xmlMemBlocks();
31852        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31853
31854        ret_val = xmlSaveClose(ctxt);
31855        desret_int(ret_val);
31856        call_tests++;
31857        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31858        xmlResetLastError();
31859        if (mem_base != xmlMemBlocks()) {
31860            printf("Leak of %d blocks found in xmlSaveClose",
31861	           xmlMemBlocks() - mem_base);
31862	    test_ret++;
31863            printf(" %d", n_ctxt);
31864            printf("\n");
31865        }
31866    }
31867    function_tests++;
31868#endif
31869
31870    return(test_ret);
31871}
31872
31873
31874static int
31875test_xmlSaveDoc(void) {
31876    int test_ret = 0;
31877
31878#if defined(LIBXML_OUTPUT_ENABLED)
31879    int mem_base;
31880    long ret_val;
31881    xmlSaveCtxtPtr ctxt; /* a document saving context */
31882    int n_ctxt;
31883    xmlDocPtr doc; /* a document */
31884    int n_doc;
31885
31886    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31887    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31888        mem_base = xmlMemBlocks();
31889        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31890        doc = gen_xmlDocPtr(n_doc, 1);
31891
31892        ret_val = xmlSaveDoc(ctxt, doc);
31893        desret_long(ret_val);
31894        call_tests++;
31895        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31896        des_xmlDocPtr(n_doc, doc, 1);
31897        xmlResetLastError();
31898        if (mem_base != xmlMemBlocks()) {
31899            printf("Leak of %d blocks found in xmlSaveDoc",
31900	           xmlMemBlocks() - mem_base);
31901	    test_ret++;
31902            printf(" %d", n_ctxt);
31903            printf(" %d", n_doc);
31904            printf("\n");
31905        }
31906    }
31907    }
31908    function_tests++;
31909#endif
31910
31911    return(test_ret);
31912}
31913
31914
31915static int
31916test_xmlSaveFlush(void) {
31917    int test_ret = 0;
31918
31919#if defined(LIBXML_OUTPUT_ENABLED)
31920    int mem_base;
31921    int ret_val;
31922    xmlSaveCtxtPtr ctxt; /* a document saving context */
31923    int n_ctxt;
31924
31925    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31926        mem_base = xmlMemBlocks();
31927        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31928
31929        ret_val = xmlSaveFlush(ctxt);
31930        desret_int(ret_val);
31931        call_tests++;
31932        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31933        xmlResetLastError();
31934        if (mem_base != xmlMemBlocks()) {
31935            printf("Leak of %d blocks found in xmlSaveFlush",
31936	           xmlMemBlocks() - mem_base);
31937	    test_ret++;
31938            printf(" %d", n_ctxt);
31939            printf("\n");
31940        }
31941    }
31942    function_tests++;
31943#endif
31944
31945    return(test_ret);
31946}
31947
31948
31949static int
31950test_xmlSaveSetAttrEscape(void) {
31951    int test_ret = 0;
31952
31953
31954    /* missing type support */
31955    return(test_ret);
31956}
31957
31958
31959static int
31960test_xmlSaveSetEscape(void) {
31961    int test_ret = 0;
31962
31963
31964    /* missing type support */
31965    return(test_ret);
31966}
31967
31968
31969static int
31970test_xmlSaveToFd(void) {
31971    int test_ret = 0;
31972
31973
31974    /* missing type support */
31975    return(test_ret);
31976}
31977
31978
31979static int
31980test_xmlSaveToFilename(void) {
31981    int test_ret = 0;
31982
31983
31984    /* missing type support */
31985    return(test_ret);
31986}
31987
31988
31989static int
31990test_xmlSaveTree(void) {
31991    int test_ret = 0;
31992
31993#if defined(LIBXML_OUTPUT_ENABLED)
31994    int mem_base;
31995    long ret_val;
31996    xmlSaveCtxtPtr ctxt; /* a document saving context */
31997    int n_ctxt;
31998    xmlNodePtr node; /* a document */
31999    int n_node;
32000
32001    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
32002    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
32003        mem_base = xmlMemBlocks();
32004        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
32005        node = gen_xmlNodePtr(n_node, 1);
32006
32007        ret_val = xmlSaveTree(ctxt, node);
32008        desret_long(ret_val);
32009        call_tests++;
32010        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
32011        des_xmlNodePtr(n_node, node, 1);
32012        xmlResetLastError();
32013        if (mem_base != xmlMemBlocks()) {
32014            printf("Leak of %d blocks found in xmlSaveTree",
32015	           xmlMemBlocks() - mem_base);
32016	    test_ret++;
32017            printf(" %d", n_ctxt);
32018            printf(" %d", n_node);
32019            printf("\n");
32020        }
32021    }
32022    }
32023    function_tests++;
32024#endif
32025
32026    return(test_ret);
32027}
32028
32029static int
32030test_xmlsave(void) {
32031    int test_ret = 0;
32032
32033    if (quiet == 0) printf("Testing xmlsave : 4 of 9 functions ...\n");
32034    test_ret += test_xmlSaveClose();
32035    test_ret += test_xmlSaveDoc();
32036    test_ret += test_xmlSaveFlush();
32037    test_ret += test_xmlSaveSetAttrEscape();
32038    test_ret += test_xmlSaveSetEscape();
32039    test_ret += test_xmlSaveToFd();
32040    test_ret += test_xmlSaveToFilename();
32041    test_ret += test_xmlSaveTree();
32042
32043    if (test_ret != 0)
32044	printf("Module xmlsave: %d errors\n", test_ret);
32045    return(test_ret);
32046}
32047#ifdef LIBXML_SCHEMAS_ENABLED
32048
32049#define gen_nb_xmlSchemaPtr 1
32050static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32051    return(NULL);
32052}
32053static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32054}
32055#endif
32056
32057
32058static int
32059test_xmlSchemaDump(void) {
32060    int test_ret = 0;
32061
32062#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
32063    int mem_base;
32064    FILE * output; /* the file output */
32065    int n_output;
32066    xmlSchemaPtr schema; /* a schema structure */
32067    int n_schema;
32068
32069    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
32070    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32071        mem_base = xmlMemBlocks();
32072        output = gen_FILE_ptr(n_output, 0);
32073        schema = gen_xmlSchemaPtr(n_schema, 1);
32074
32075        xmlSchemaDump(output, schema);
32076        call_tests++;
32077        des_FILE_ptr(n_output, output, 0);
32078        des_xmlSchemaPtr(n_schema, schema, 1);
32079        xmlResetLastError();
32080        if (mem_base != xmlMemBlocks()) {
32081            printf("Leak of %d blocks found in xmlSchemaDump",
32082	           xmlMemBlocks() - mem_base);
32083	    test_ret++;
32084            printf(" %d", n_output);
32085            printf(" %d", n_schema);
32086            printf("\n");
32087        }
32088    }
32089    }
32090    function_tests++;
32091#endif
32092
32093    return(test_ret);
32094}
32095
32096#ifdef LIBXML_SCHEMAS_ENABLED
32097
32098#define gen_nb_xmlSchemaParserCtxtPtr 1
32099static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32100    return(NULL);
32101}
32102static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32103}
32104#endif
32105
32106#ifdef LIBXML_SCHEMAS_ENABLED
32107
32108#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
32109static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32110    return(NULL);
32111}
32112static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32113}
32114#endif
32115
32116#ifdef LIBXML_SCHEMAS_ENABLED
32117
32118#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
32119static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32120    return(NULL);
32121}
32122static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32123}
32124#endif
32125
32126
32127static int
32128test_xmlSchemaGetParserErrors(void) {
32129    int test_ret = 0;
32130
32131#if defined(LIBXML_SCHEMAS_ENABLED)
32132    int mem_base;
32133    int ret_val;
32134    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
32135    int n_ctxt;
32136    xmlSchemaValidityErrorFunc * err; /* the error callback result */
32137    int n_err;
32138    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
32139    int n_warn;
32140    void ** ctx; /* contextual data for the callbacks result */
32141    int n_ctx;
32142
32143    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
32144    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
32145    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
32146    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
32147        mem_base = xmlMemBlocks();
32148        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
32149        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
32150        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
32151        ctx = gen_void_ptr_ptr(n_ctx, 3);
32152
32153        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
32154        desret_int(ret_val);
32155        call_tests++;
32156        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
32157        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
32158        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
32159        des_void_ptr_ptr(n_ctx, ctx, 3);
32160        xmlResetLastError();
32161        if (mem_base != xmlMemBlocks()) {
32162            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
32163	           xmlMemBlocks() - mem_base);
32164	    test_ret++;
32165            printf(" %d", n_ctxt);
32166            printf(" %d", n_err);
32167            printf(" %d", n_warn);
32168            printf(" %d", n_ctx);
32169            printf("\n");
32170        }
32171    }
32172    }
32173    }
32174    }
32175    function_tests++;
32176#endif
32177
32178    return(test_ret);
32179}
32180
32181#ifdef LIBXML_SCHEMAS_ENABLED
32182
32183#define gen_nb_xmlSchemaValidCtxtPtr 1
32184static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32185    return(NULL);
32186}
32187static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32188}
32189#endif
32190
32191
32192static int
32193test_xmlSchemaGetValidErrors(void) {
32194    int test_ret = 0;
32195
32196#if defined(LIBXML_SCHEMAS_ENABLED)
32197    int mem_base;
32198    int ret_val;
32199    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
32200    int n_ctxt;
32201    xmlSchemaValidityErrorFunc * err; /* the error function result */
32202    int n_err;
32203    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
32204    int n_warn;
32205    void ** ctx; /* the functions context result */
32206    int n_ctx;
32207
32208    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32209    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
32210    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
32211    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
32212        mem_base = xmlMemBlocks();
32213        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32214        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
32215        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
32216        ctx = gen_void_ptr_ptr(n_ctx, 3);
32217
32218        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
32219        desret_int(ret_val);
32220        call_tests++;
32221        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32222        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
32223        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
32224        des_void_ptr_ptr(n_ctx, ctx, 3);
32225        xmlResetLastError();
32226        if (mem_base != xmlMemBlocks()) {
32227            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
32228	           xmlMemBlocks() - mem_base);
32229	    test_ret++;
32230            printf(" %d", n_ctxt);
32231            printf(" %d", n_err);
32232            printf(" %d", n_warn);
32233            printf(" %d", n_ctx);
32234            printf("\n");
32235        }
32236    }
32237    }
32238    }
32239    }
32240    function_tests++;
32241#endif
32242
32243    return(test_ret);
32244}
32245
32246
32247static int
32248test_xmlSchemaNewDocParserCtxt(void) {
32249    int test_ret = 0;
32250
32251#if defined(LIBXML_SCHEMAS_ENABLED)
32252    int mem_base;
32253    xmlSchemaParserCtxtPtr ret_val;
32254    xmlDocPtr doc; /* a preparsed document tree */
32255    int n_doc;
32256
32257    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
32258        mem_base = xmlMemBlocks();
32259        doc = gen_xmlDocPtr(n_doc, 0);
32260
32261        ret_val = xmlSchemaNewDocParserCtxt(doc);
32262        desret_xmlSchemaParserCtxtPtr(ret_val);
32263        call_tests++;
32264        des_xmlDocPtr(n_doc, doc, 0);
32265        xmlResetLastError();
32266        if (mem_base != xmlMemBlocks()) {
32267            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
32268	           xmlMemBlocks() - mem_base);
32269	    test_ret++;
32270            printf(" %d", n_doc);
32271            printf("\n");
32272        }
32273    }
32274    function_tests++;
32275#endif
32276
32277    return(test_ret);
32278}
32279
32280
32281static int
32282test_xmlSchemaNewMemParserCtxt(void) {
32283    int test_ret = 0;
32284
32285#if defined(LIBXML_SCHEMAS_ENABLED)
32286    int mem_base;
32287    xmlSchemaParserCtxtPtr ret_val;
32288    char * buffer; /* a pointer to a char array containing the schemas */
32289    int n_buffer;
32290    int size; /* the size of the array */
32291    int n_size;
32292
32293    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
32294    for (n_size = 0;n_size < gen_nb_int;n_size++) {
32295        mem_base = xmlMemBlocks();
32296        buffer = gen_const_char_ptr(n_buffer, 0);
32297        size = gen_int(n_size, 1);
32298
32299        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
32300        desret_xmlSchemaParserCtxtPtr(ret_val);
32301        call_tests++;
32302        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
32303        des_int(n_size, size, 1);
32304        xmlResetLastError();
32305        if (mem_base != xmlMemBlocks()) {
32306            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
32307	           xmlMemBlocks() - mem_base);
32308	    test_ret++;
32309            printf(" %d", n_buffer);
32310            printf(" %d", n_size);
32311            printf("\n");
32312        }
32313    }
32314    }
32315    function_tests++;
32316#endif
32317
32318    return(test_ret);
32319}
32320
32321
32322static int
32323test_xmlSchemaNewParserCtxt(void) {
32324    int test_ret = 0;
32325
32326#if defined(LIBXML_SCHEMAS_ENABLED)
32327    int mem_base;
32328    xmlSchemaParserCtxtPtr ret_val;
32329    char * URL; /* the location of the schema */
32330    int n_URL;
32331
32332    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
32333        mem_base = xmlMemBlocks();
32334        URL = gen_const_char_ptr(n_URL, 0);
32335
32336        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
32337        desret_xmlSchemaParserCtxtPtr(ret_val);
32338        call_tests++;
32339        des_const_char_ptr(n_URL, (const char *)URL, 0);
32340        xmlResetLastError();
32341        if (mem_base != xmlMemBlocks()) {
32342            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
32343	           xmlMemBlocks() - mem_base);
32344	    test_ret++;
32345            printf(" %d", n_URL);
32346            printf("\n");
32347        }
32348    }
32349    function_tests++;
32350#endif
32351
32352    return(test_ret);
32353}
32354
32355
32356static int
32357test_xmlSchemaNewValidCtxt(void) {
32358    int test_ret = 0;
32359
32360
32361    /* missing type support */
32362    return(test_ret);
32363}
32364
32365
32366static int
32367test_xmlSchemaParse(void) {
32368    int test_ret = 0;
32369
32370
32371    /* missing type support */
32372    return(test_ret);
32373}
32374
32375
32376static int
32377test_xmlSchemaSetParserErrors(void) {
32378    int test_ret = 0;
32379
32380
32381    /* missing type support */
32382    return(test_ret);
32383}
32384
32385
32386static int
32387test_xmlSchemaSetValidErrors(void) {
32388    int test_ret = 0;
32389
32390
32391    /* missing type support */
32392    return(test_ret);
32393}
32394
32395
32396static int
32397test_xmlSchemaSetValidOptions(void) {
32398    int test_ret = 0;
32399
32400#if defined(LIBXML_SCHEMAS_ENABLED)
32401    int mem_base;
32402    int ret_val;
32403    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32404    int n_ctxt;
32405    int options; /* a combination of xmlSchemaValidOption */
32406    int n_options;
32407
32408    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32409    for (n_options = 0;n_options < gen_nb_int;n_options++) {
32410        mem_base = xmlMemBlocks();
32411        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32412        options = gen_int(n_options, 1);
32413
32414        ret_val = xmlSchemaSetValidOptions(ctxt, options);
32415        desret_int(ret_val);
32416        call_tests++;
32417        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32418        des_int(n_options, options, 1);
32419        xmlResetLastError();
32420        if (mem_base != xmlMemBlocks()) {
32421            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
32422	           xmlMemBlocks() - mem_base);
32423	    test_ret++;
32424            printf(" %d", n_ctxt);
32425            printf(" %d", n_options);
32426            printf("\n");
32427        }
32428    }
32429    }
32430    function_tests++;
32431#endif
32432
32433    return(test_ret);
32434}
32435
32436
32437static int
32438test_xmlSchemaValidCtxtGetOptions(void) {
32439    int test_ret = 0;
32440
32441#if defined(LIBXML_SCHEMAS_ENABLED)
32442    int mem_base;
32443    int ret_val;
32444    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32445    int n_ctxt;
32446
32447    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32448        mem_base = xmlMemBlocks();
32449        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32450
32451        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
32452        desret_int(ret_val);
32453        call_tests++;
32454        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32455        xmlResetLastError();
32456        if (mem_base != xmlMemBlocks()) {
32457            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
32458	           xmlMemBlocks() - mem_base);
32459	    test_ret++;
32460            printf(" %d", n_ctxt);
32461            printf("\n");
32462        }
32463    }
32464    function_tests++;
32465#endif
32466
32467    return(test_ret);
32468}
32469
32470
32471static int
32472test_xmlSchemaValidateDoc(void) {
32473    int test_ret = 0;
32474
32475#if defined(LIBXML_SCHEMAS_ENABLED)
32476    int mem_base;
32477    int ret_val;
32478    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32479    int n_ctxt;
32480    xmlDocPtr doc; /* a parsed document tree */
32481    int n_doc;
32482
32483    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32484    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
32485        mem_base = xmlMemBlocks();
32486        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32487        doc = gen_xmlDocPtr(n_doc, 1);
32488
32489        ret_val = xmlSchemaValidateDoc(ctxt, doc);
32490        desret_int(ret_val);
32491        call_tests++;
32492        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32493        des_xmlDocPtr(n_doc, doc, 1);
32494        xmlResetLastError();
32495        if (mem_base != xmlMemBlocks()) {
32496            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
32497	           xmlMemBlocks() - mem_base);
32498	    test_ret++;
32499            printf(" %d", n_ctxt);
32500            printf(" %d", n_doc);
32501            printf("\n");
32502        }
32503    }
32504    }
32505    function_tests++;
32506#endif
32507
32508    return(test_ret);
32509}
32510
32511
32512static int
32513test_xmlSchemaValidateOneElement(void) {
32514    int test_ret = 0;
32515
32516#if defined(LIBXML_SCHEMAS_ENABLED)
32517    int mem_base;
32518    int ret_val;
32519    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32520    int n_ctxt;
32521    xmlNodePtr elem; /* an element node */
32522    int n_elem;
32523
32524    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32525    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
32526        mem_base = xmlMemBlocks();
32527        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32528        elem = gen_xmlNodePtr(n_elem, 1);
32529
32530        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
32531        desret_int(ret_val);
32532        call_tests++;
32533        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32534        des_xmlNodePtr(n_elem, elem, 1);
32535        xmlResetLastError();
32536        if (mem_base != xmlMemBlocks()) {
32537            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
32538	           xmlMemBlocks() - mem_base);
32539	    test_ret++;
32540            printf(" %d", n_ctxt);
32541            printf(" %d", n_elem);
32542            printf("\n");
32543        }
32544    }
32545    }
32546    function_tests++;
32547#endif
32548
32549    return(test_ret);
32550}
32551
32552
32553static int
32554test_xmlSchemaValidateStream(void) {
32555    int test_ret = 0;
32556
32557#if defined(LIBXML_SCHEMAS_ENABLED)
32558    int mem_base;
32559    int ret_val;
32560    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
32561    int n_ctxt;
32562    xmlParserInputBufferPtr input; /* the input to use for reading the data */
32563    int n_input;
32564    xmlCharEncoding enc; /* an optional encoding information */
32565    int n_enc;
32566    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
32567    int n_sax;
32568    void * user_data; /* the context to provide to the SAX handler. */
32569    int n_user_data;
32570
32571    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32572    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32573    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
32574    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
32575    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
32576        mem_base = xmlMemBlocks();
32577        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
32578        input = gen_xmlParserInputBufferPtr(n_input, 1);
32579        enc = gen_xmlCharEncoding(n_enc, 2);
32580        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
32581        user_data = gen_userdata(n_user_data, 4);
32582
32583        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
32584        desret_int(ret_val);
32585        call_tests++;
32586        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
32587        des_xmlParserInputBufferPtr(n_input, input, 1);
32588        des_xmlCharEncoding(n_enc, enc, 2);
32589        des_xmlSAXHandlerPtr(n_sax, sax, 3);
32590        des_userdata(n_user_data, user_data, 4);
32591        xmlResetLastError();
32592        if (mem_base != xmlMemBlocks()) {
32593            printf("Leak of %d blocks found in xmlSchemaValidateStream",
32594	           xmlMemBlocks() - mem_base);
32595	    test_ret++;
32596            printf(" %d", n_ctxt);
32597            printf(" %d", n_input);
32598            printf(" %d", n_enc);
32599            printf(" %d", n_sax);
32600            printf(" %d", n_user_data);
32601            printf("\n");
32602        }
32603    }
32604    }
32605    }
32606    }
32607    }
32608    function_tests++;
32609#endif
32610
32611    return(test_ret);
32612}
32613
32614static int
32615test_xmlschemas(void) {
32616    int test_ret = 0;
32617
32618    if (quiet == 0) printf("Testing xmlschemas : 11 of 18 functions ...\n");
32619    test_ret += test_xmlSchemaDump();
32620    test_ret += test_xmlSchemaGetParserErrors();
32621    test_ret += test_xmlSchemaGetValidErrors();
32622    test_ret += test_xmlSchemaNewDocParserCtxt();
32623    test_ret += test_xmlSchemaNewMemParserCtxt();
32624    test_ret += test_xmlSchemaNewParserCtxt();
32625    test_ret += test_xmlSchemaNewValidCtxt();
32626    test_ret += test_xmlSchemaParse();
32627    test_ret += test_xmlSchemaSetParserErrors();
32628    test_ret += test_xmlSchemaSetValidErrors();
32629    test_ret += test_xmlSchemaSetValidOptions();
32630    test_ret += test_xmlSchemaValidCtxtGetOptions();
32631    test_ret += test_xmlSchemaValidateDoc();
32632    test_ret += test_xmlSchemaValidateOneElement();
32633    test_ret += test_xmlSchemaValidateStream();
32634
32635    if (test_ret != 0)
32636	printf("Module xmlschemas: %d errors\n", test_ret);
32637    return(test_ret);
32638}
32639#ifdef LIBXML_SCHEMAS_ENABLED
32640
32641#define gen_nb_xmlSchemaFacetPtr 1
32642static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32643    return(NULL);
32644}
32645static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32646}
32647#endif
32648
32649#ifdef LIBXML_SCHEMAS_ENABLED
32650
32651#define gen_nb_xmlSchemaTypePtr 1
32652static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32653    return(NULL);
32654}
32655static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32656}
32657#endif
32658
32659
32660static int
32661test_xmlSchemaCheckFacet(void) {
32662    int test_ret = 0;
32663
32664#if defined(LIBXML_SCHEMAS_ENABLED)
32665    int mem_base;
32666    int ret_val;
32667    xmlSchemaFacetPtr facet; /* the facet */
32668    int n_facet;
32669    xmlSchemaTypePtr typeDecl; /* the schema type definition */
32670    int n_typeDecl;
32671    xmlSchemaParserCtxtPtr ctxt; /* the schema parser context or NULL */
32672    int n_ctxt;
32673    xmlChar * name; /* name of the type */
32674    int n_name;
32675
32676    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32677    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
32678    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
32679    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32680        mem_base = xmlMemBlocks();
32681        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
32682        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
32683        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 2);
32684        name = gen_const_xmlChar_ptr(n_name, 3);
32685
32686        ret_val = xmlSchemaCheckFacet(facet, typeDecl, ctxt, (const xmlChar *)name);
32687        desret_int(ret_val);
32688        call_tests++;
32689        des_xmlSchemaFacetPtr(n_facet, facet, 0);
32690        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
32691        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 2);
32692        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
32693        xmlResetLastError();
32694        if (mem_base != xmlMemBlocks()) {
32695            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
32696	           xmlMemBlocks() - mem_base);
32697	    test_ret++;
32698            printf(" %d", n_facet);
32699            printf(" %d", n_typeDecl);
32700            printf(" %d", n_ctxt);
32701            printf(" %d", n_name);
32702            printf("\n");
32703        }
32704    }
32705    }
32706    }
32707    }
32708    function_tests++;
32709#endif
32710
32711    return(test_ret);
32712}
32713
32714
32715static int
32716test_xmlSchemaCleanupTypes(void) {
32717    int test_ret = 0;
32718
32719#if defined(LIBXML_SCHEMAS_ENABLED)
32720    int mem_base;
32721
32722        mem_base = xmlMemBlocks();
32723
32724        xmlSchemaCleanupTypes();
32725        call_tests++;
32726        xmlResetLastError();
32727        if (mem_base != xmlMemBlocks()) {
32728            printf("Leak of %d blocks found in xmlSchemaCleanupTypes",
32729	           xmlMemBlocks() - mem_base);
32730	    test_ret++;
32731            printf("\n");
32732        }
32733    function_tests++;
32734#endif
32735
32736    return(test_ret);
32737}
32738
32739
32740static int
32741test_xmlSchemaCollapseString(void) {
32742    int test_ret = 0;
32743
32744#if defined(LIBXML_SCHEMAS_ENABLED)
32745    int mem_base;
32746    xmlChar * ret_val;
32747    xmlChar * value; /* a value */
32748    int n_value;
32749
32750    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32751        mem_base = xmlMemBlocks();
32752        value = gen_const_xmlChar_ptr(n_value, 0);
32753
32754        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
32755        desret_xmlChar_ptr(ret_val);
32756        call_tests++;
32757        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
32758        xmlResetLastError();
32759        if (mem_base != xmlMemBlocks()) {
32760            printf("Leak of %d blocks found in xmlSchemaCollapseString",
32761	           xmlMemBlocks() - mem_base);
32762	    test_ret++;
32763            printf(" %d", n_value);
32764            printf("\n");
32765        }
32766    }
32767    function_tests++;
32768#endif
32769
32770    return(test_ret);
32771}
32772
32773#ifdef LIBXML_SCHEMAS_ENABLED
32774
32775#define gen_nb_xmlSchemaValPtr 1
32776static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32777    return(NULL);
32778}
32779static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32780}
32781#endif
32782
32783
32784static int
32785test_xmlSchemaCompareValues(void) {
32786    int test_ret = 0;
32787
32788#if defined(LIBXML_SCHEMAS_ENABLED)
32789    int mem_base;
32790    int ret_val;
32791    xmlSchemaValPtr x; /* a first value */
32792    int n_x;
32793    xmlSchemaValPtr y; /* a second value */
32794    int n_y;
32795
32796    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
32797    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
32798        mem_base = xmlMemBlocks();
32799        x = gen_xmlSchemaValPtr(n_x, 0);
32800        y = gen_xmlSchemaValPtr(n_y, 1);
32801
32802        ret_val = xmlSchemaCompareValues(x, y);
32803        desret_int(ret_val);
32804        call_tests++;
32805        des_xmlSchemaValPtr(n_x, x, 0);
32806        des_xmlSchemaValPtr(n_y, y, 1);
32807        xmlResetLastError();
32808        if (mem_base != xmlMemBlocks()) {
32809            printf("Leak of %d blocks found in xmlSchemaCompareValues",
32810	           xmlMemBlocks() - mem_base);
32811	    test_ret++;
32812            printf(" %d", n_x);
32813            printf(" %d", n_y);
32814            printf("\n");
32815        }
32816    }
32817    }
32818    function_tests++;
32819#endif
32820
32821    return(test_ret);
32822}
32823
32824
32825static int
32826test_xmlSchemaCompareValuesWhtsp(void) {
32827    int test_ret = 0;
32828
32829#if defined(LIBXML_SCHEMAS_ENABLED)
32830    int mem_base;
32831    int ret_val;
32832    xmlSchemaValPtr x; /* a first value */
32833    int n_x;
32834    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
32835    int n_xws;
32836    xmlSchemaValPtr y; /* a second value */
32837    int n_y;
32838    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
32839    int n_yws;
32840
32841    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
32842    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
32843    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
32844    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
32845        mem_base = xmlMemBlocks();
32846        x = gen_xmlSchemaValPtr(n_x, 0);
32847        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
32848        y = gen_xmlSchemaValPtr(n_y, 2);
32849        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
32850
32851        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
32852        desret_int(ret_val);
32853        call_tests++;
32854        des_xmlSchemaValPtr(n_x, x, 0);
32855        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
32856        des_xmlSchemaValPtr(n_y, y, 2);
32857        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
32858        xmlResetLastError();
32859        if (mem_base != xmlMemBlocks()) {
32860            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
32861	           xmlMemBlocks() - mem_base);
32862	    test_ret++;
32863            printf(" %d", n_x);
32864            printf(" %d", n_xws);
32865            printf(" %d", n_y);
32866            printf(" %d", n_yws);
32867            printf("\n");
32868        }
32869    }
32870    }
32871    }
32872    }
32873    function_tests++;
32874#endif
32875
32876    return(test_ret);
32877}
32878
32879
32880static int
32881test_xmlSchemaCopyValue(void) {
32882    int test_ret = 0;
32883
32884
32885    /* missing type support */
32886    return(test_ret);
32887}
32888
32889
32890static int
32891test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
32892    int test_ret = 0;
32893
32894#if defined(LIBXML_SCHEMAS_ENABLED)
32895    int mem_base;
32896    xmlSchemaTypePtr ret_val;
32897    xmlSchemaTypePtr type; /* the built-in simple type. */
32898    int n_type;
32899
32900    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32901        mem_base = xmlMemBlocks();
32902        type = gen_xmlSchemaTypePtr(n_type, 0);
32903
32904        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
32905        desret_xmlSchemaTypePtr(ret_val);
32906        call_tests++;
32907        des_xmlSchemaTypePtr(n_type, type, 0);
32908        xmlResetLastError();
32909        if (mem_base != xmlMemBlocks()) {
32910            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
32911	           xmlMemBlocks() - mem_base);
32912	    test_ret++;
32913            printf(" %d", n_type);
32914            printf("\n");
32915        }
32916    }
32917    function_tests++;
32918#endif
32919
32920    return(test_ret);
32921}
32922
32923
32924static int
32925test_xmlSchemaGetBuiltInType(void) {
32926    int test_ret = 0;
32927
32928#if defined(LIBXML_SCHEMAS_ENABLED)
32929    xmlSchemaTypePtr ret_val;
32930    xmlSchemaValType type; /* the type of the built in type */
32931    int n_type;
32932
32933    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
32934        type = gen_xmlSchemaValType(n_type, 0);
32935
32936        ret_val = xmlSchemaGetBuiltInType(type);
32937        desret_xmlSchemaTypePtr(ret_val);
32938        call_tests++;
32939        des_xmlSchemaValType(n_type, type, 0);
32940        xmlResetLastError();
32941    }
32942    function_tests++;
32943#endif
32944
32945    return(test_ret);
32946}
32947
32948
32949static int
32950test_xmlSchemaGetCanonValue(void) {
32951    int test_ret = 0;
32952
32953#if defined(LIBXML_SCHEMAS_ENABLED)
32954    int mem_base;
32955    int ret_val;
32956    xmlSchemaValPtr val; /* the precomputed value */
32957    int n_val;
32958    xmlChar ** retValue; /* the returned value */
32959    int n_retValue;
32960
32961    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
32962    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
32963        mem_base = xmlMemBlocks();
32964        val = gen_xmlSchemaValPtr(n_val, 0);
32965        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
32966
32967        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
32968        desret_int(ret_val);
32969        call_tests++;
32970        des_xmlSchemaValPtr(n_val, val, 0);
32971        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
32972        xmlResetLastError();
32973        if (mem_base != xmlMemBlocks()) {
32974            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
32975	           xmlMemBlocks() - mem_base);
32976	    test_ret++;
32977            printf(" %d", n_val);
32978            printf(" %d", n_retValue);
32979            printf("\n");
32980        }
32981    }
32982    }
32983    function_tests++;
32984#endif
32985
32986    return(test_ret);
32987}
32988
32989
32990static int
32991test_xmlSchemaGetCanonValueWhtsp(void) {
32992    int test_ret = 0;
32993
32994#if defined(LIBXML_SCHEMAS_ENABLED)
32995    int mem_base;
32996    int ret_val;
32997    xmlSchemaValPtr val; /* the precomputed value */
32998    int n_val;
32999    xmlChar ** retValue; /* the returned value */
33000    int n_retValue;
33001    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
33002    int n_ws;
33003
33004    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33005    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
33006    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
33007        mem_base = xmlMemBlocks();
33008        val = gen_xmlSchemaValPtr(n_val, 0);
33009        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
33010        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
33011
33012        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
33013        desret_int(ret_val);
33014        call_tests++;
33015        des_xmlSchemaValPtr(n_val, val, 0);
33016        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
33017        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
33018        xmlResetLastError();
33019        if (mem_base != xmlMemBlocks()) {
33020            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
33021	           xmlMemBlocks() - mem_base);
33022	    test_ret++;
33023            printf(" %d", n_val);
33024            printf(" %d", n_retValue);
33025            printf(" %d", n_ws);
33026            printf("\n");
33027        }
33028    }
33029    }
33030    }
33031    function_tests++;
33032#endif
33033
33034    return(test_ret);
33035}
33036
33037
33038static int
33039test_xmlSchemaGetFacetValueAsULong(void) {
33040    int test_ret = 0;
33041
33042#if defined(LIBXML_SCHEMAS_ENABLED)
33043    int mem_base;
33044    unsigned long ret_val;
33045    xmlSchemaFacetPtr facet; /* an schemas type facet */
33046    int n_facet;
33047
33048    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33049        mem_base = xmlMemBlocks();
33050        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33051
33052        ret_val = xmlSchemaGetFacetValueAsULong(facet);
33053        desret_unsigned_long(ret_val);
33054        call_tests++;
33055        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33056        xmlResetLastError();
33057        if (mem_base != xmlMemBlocks()) {
33058            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
33059	           xmlMemBlocks() - mem_base);
33060	    test_ret++;
33061            printf(" %d", n_facet);
33062            printf("\n");
33063        }
33064    }
33065    function_tests++;
33066#endif
33067
33068    return(test_ret);
33069}
33070
33071
33072static int
33073test_xmlSchemaGetPredefinedType(void) {
33074    int test_ret = 0;
33075
33076#if defined(LIBXML_SCHEMAS_ENABLED)
33077    int mem_base;
33078    xmlSchemaTypePtr ret_val;
33079    xmlChar * name; /* the type name */
33080    int n_name;
33081    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
33082    int n_ns;
33083
33084    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
33085    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
33086        mem_base = xmlMemBlocks();
33087        name = gen_const_xmlChar_ptr(n_name, 0);
33088        ns = gen_const_xmlChar_ptr(n_ns, 1);
33089
33090        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
33091        desret_xmlSchemaTypePtr(ret_val);
33092        call_tests++;
33093        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
33094        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
33095        xmlResetLastError();
33096        if (mem_base != xmlMemBlocks()) {
33097            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
33098	           xmlMemBlocks() - mem_base);
33099	    test_ret++;
33100            printf(" %d", n_name);
33101            printf(" %d", n_ns);
33102            printf("\n");
33103        }
33104    }
33105    }
33106    function_tests++;
33107#endif
33108
33109    return(test_ret);
33110}
33111
33112
33113static int
33114test_xmlSchemaGetValType(void) {
33115    int test_ret = 0;
33116
33117#if defined(LIBXML_SCHEMAS_ENABLED)
33118    int mem_base;
33119    xmlSchemaValType ret_val;
33120    xmlSchemaValPtr val; /* a schemas value */
33121    int n_val;
33122
33123    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33124        mem_base = xmlMemBlocks();
33125        val = gen_xmlSchemaValPtr(n_val, 0);
33126
33127        ret_val = xmlSchemaGetValType(val);
33128        desret_xmlSchemaValType(ret_val);
33129        call_tests++;
33130        des_xmlSchemaValPtr(n_val, val, 0);
33131        xmlResetLastError();
33132        if (mem_base != xmlMemBlocks()) {
33133            printf("Leak of %d blocks found in xmlSchemaGetValType",
33134	           xmlMemBlocks() - mem_base);
33135	    test_ret++;
33136            printf(" %d", n_val);
33137            printf("\n");
33138        }
33139    }
33140    function_tests++;
33141#endif
33142
33143    return(test_ret);
33144}
33145
33146
33147static int
33148test_xmlSchemaInitTypes(void) {
33149    int test_ret = 0;
33150
33151#if defined(LIBXML_SCHEMAS_ENABLED)
33152
33153
33154        xmlSchemaInitTypes();
33155        call_tests++;
33156        xmlResetLastError();
33157    function_tests++;
33158#endif
33159
33160    return(test_ret);
33161}
33162
33163
33164static int
33165test_xmlSchemaIsBuiltInTypeFacet(void) {
33166    int test_ret = 0;
33167
33168#if defined(LIBXML_SCHEMAS_ENABLED)
33169    int mem_base;
33170    int ret_val;
33171    xmlSchemaTypePtr type; /* the built-in type */
33172    int n_type;
33173    int facetType; /* the facet type */
33174    int n_facetType;
33175
33176    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33177    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
33178        mem_base = xmlMemBlocks();
33179        type = gen_xmlSchemaTypePtr(n_type, 0);
33180        facetType = gen_int(n_facetType, 1);
33181
33182        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
33183        desret_int(ret_val);
33184        call_tests++;
33185        des_xmlSchemaTypePtr(n_type, type, 0);
33186        des_int(n_facetType, facetType, 1);
33187        xmlResetLastError();
33188        if (mem_base != xmlMemBlocks()) {
33189            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
33190	           xmlMemBlocks() - mem_base);
33191	    test_ret++;
33192            printf(" %d", n_type);
33193            printf(" %d", n_facetType);
33194            printf("\n");
33195        }
33196    }
33197    }
33198    function_tests++;
33199#endif
33200
33201    return(test_ret);
33202}
33203
33204
33205static int
33206test_xmlSchemaNewFacet(void) {
33207    int test_ret = 0;
33208
33209
33210    /* missing type support */
33211    return(test_ret);
33212}
33213
33214
33215static int
33216test_xmlSchemaNewNOTATIONValue(void) {
33217    int test_ret = 0;
33218
33219
33220    /* missing type support */
33221    return(test_ret);
33222}
33223
33224
33225static int
33226test_xmlSchemaNewStringValue(void) {
33227    int test_ret = 0;
33228
33229
33230    /* missing type support */
33231    return(test_ret);
33232}
33233
33234#ifdef LIBXML_SCHEMAS_ENABLED
33235
33236#define gen_nb_xmlSchemaValPtr_ptr 1
33237static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33238    return(NULL);
33239}
33240static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33241}
33242#endif
33243
33244
33245static int
33246test_xmlSchemaValPredefTypeNode(void) {
33247    int test_ret = 0;
33248
33249#if defined(LIBXML_SCHEMAS_ENABLED)
33250    int mem_base;
33251    int ret_val;
33252    xmlSchemaTypePtr type; /* the predefined type */
33253    int n_type;
33254    xmlChar * value; /* the value to check */
33255    int n_value;
33256    xmlSchemaValPtr * val; /* the return computed value */
33257    int n_val;
33258    xmlNodePtr node; /* the node containing the value */
33259    int n_node;
33260
33261    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33262    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33263    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
33264    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33265        mem_base = xmlMemBlocks();
33266        type = gen_xmlSchemaTypePtr(n_type, 0);
33267        value = gen_const_xmlChar_ptr(n_value, 1);
33268        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
33269        node = gen_xmlNodePtr(n_node, 3);
33270
33271        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
33272        desret_int(ret_val);
33273        call_tests++;
33274        des_xmlSchemaTypePtr(n_type, type, 0);
33275        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33276        des_xmlSchemaValPtr_ptr(n_val, val, 2);
33277        des_xmlNodePtr(n_node, node, 3);
33278        xmlResetLastError();
33279        if (mem_base != xmlMemBlocks()) {
33280            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
33281	           xmlMemBlocks() - mem_base);
33282	    test_ret++;
33283            printf(" %d", n_type);
33284            printf(" %d", n_value);
33285            printf(" %d", n_val);
33286            printf(" %d", n_node);
33287            printf("\n");
33288        }
33289    }
33290    }
33291    }
33292    }
33293    function_tests++;
33294#endif
33295
33296    return(test_ret);
33297}
33298
33299
33300static int
33301test_xmlSchemaValPredefTypeNodeNoNorm(void) {
33302    int test_ret = 0;
33303
33304#if defined(LIBXML_SCHEMAS_ENABLED)
33305    int mem_base;
33306    int ret_val;
33307    xmlSchemaTypePtr type; /* the predefined type */
33308    int n_type;
33309    xmlChar * value; /* the value to check */
33310    int n_value;
33311    xmlSchemaValPtr * val; /* the return computed value */
33312    int n_val;
33313    xmlNodePtr node; /* the node containing the value */
33314    int n_node;
33315
33316    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33317    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33318    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
33319    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33320        mem_base = xmlMemBlocks();
33321        type = gen_xmlSchemaTypePtr(n_type, 0);
33322        value = gen_const_xmlChar_ptr(n_value, 1);
33323        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
33324        node = gen_xmlNodePtr(n_node, 3);
33325
33326        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
33327        desret_int(ret_val);
33328        call_tests++;
33329        des_xmlSchemaTypePtr(n_type, type, 0);
33330        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33331        des_xmlSchemaValPtr_ptr(n_val, val, 2);
33332        des_xmlNodePtr(n_node, node, 3);
33333        xmlResetLastError();
33334        if (mem_base != xmlMemBlocks()) {
33335            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
33336	           xmlMemBlocks() - mem_base);
33337	    test_ret++;
33338            printf(" %d", n_type);
33339            printf(" %d", n_value);
33340            printf(" %d", n_val);
33341            printf(" %d", n_node);
33342            printf("\n");
33343        }
33344    }
33345    }
33346    }
33347    }
33348    function_tests++;
33349#endif
33350
33351    return(test_ret);
33352}
33353
33354
33355static int
33356test_xmlSchemaValidateFacet(void) {
33357    int test_ret = 0;
33358
33359#if defined(LIBXML_SCHEMAS_ENABLED)
33360    int mem_base;
33361    int ret_val;
33362    xmlSchemaTypePtr base; /* the base type */
33363    int n_base;
33364    xmlSchemaFacetPtr facet; /* the facet to check */
33365    int n_facet;
33366    xmlChar * value; /* the lexical repr of the value to validate */
33367    int n_value;
33368    xmlSchemaValPtr val; /* the precomputed value */
33369    int n_val;
33370
33371    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
33372    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33373    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33374    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33375        mem_base = xmlMemBlocks();
33376        base = gen_xmlSchemaTypePtr(n_base, 0);
33377        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
33378        value = gen_const_xmlChar_ptr(n_value, 2);
33379        val = gen_xmlSchemaValPtr(n_val, 3);
33380
33381        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
33382        desret_int(ret_val);
33383        call_tests++;
33384        des_xmlSchemaTypePtr(n_base, base, 0);
33385        des_xmlSchemaFacetPtr(n_facet, facet, 1);
33386        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
33387        des_xmlSchemaValPtr(n_val, val, 3);
33388        xmlResetLastError();
33389        if (mem_base != xmlMemBlocks()) {
33390            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
33391	           xmlMemBlocks() - mem_base);
33392	    test_ret++;
33393            printf(" %d", n_base);
33394            printf(" %d", n_facet);
33395            printf(" %d", n_value);
33396            printf(" %d", n_val);
33397            printf("\n");
33398        }
33399    }
33400    }
33401    }
33402    }
33403    function_tests++;
33404#endif
33405
33406    return(test_ret);
33407}
33408
33409
33410static int
33411test_xmlSchemaValidateFacetWhtsp(void) {
33412    int test_ret = 0;
33413
33414#if defined(LIBXML_SCHEMAS_ENABLED)
33415    int mem_base;
33416    int ret_val;
33417    xmlSchemaFacetPtr facet; /* the facet to check */
33418    int n_facet;
33419    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
33420    int n_fws;
33421    xmlSchemaValType valType; /* the built-in type of the value */
33422    int n_valType;
33423    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
33424    int n_value;
33425    xmlSchemaValPtr val; /* the precomputed value */
33426    int n_val;
33427    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
33428    int n_ws;
33429
33430    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33431    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
33432    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
33433    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33434    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33435    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
33436        mem_base = xmlMemBlocks();
33437        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33438        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
33439        valType = gen_xmlSchemaValType(n_valType, 2);
33440        value = gen_const_xmlChar_ptr(n_value, 3);
33441        val = gen_xmlSchemaValPtr(n_val, 4);
33442        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
33443
33444        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
33445        desret_int(ret_val);
33446        call_tests++;
33447        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33448        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
33449        des_xmlSchemaValType(n_valType, valType, 2);
33450        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
33451        des_xmlSchemaValPtr(n_val, val, 4);
33452        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
33453        xmlResetLastError();
33454        if (mem_base != xmlMemBlocks()) {
33455            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
33456	           xmlMemBlocks() - mem_base);
33457	    test_ret++;
33458            printf(" %d", n_facet);
33459            printf(" %d", n_fws);
33460            printf(" %d", n_valType);
33461            printf(" %d", n_value);
33462            printf(" %d", n_val);
33463            printf(" %d", n_ws);
33464            printf("\n");
33465        }
33466    }
33467    }
33468    }
33469    }
33470    }
33471    }
33472    function_tests++;
33473#endif
33474
33475    return(test_ret);
33476}
33477
33478
33479static int
33480test_xmlSchemaValidateLengthFacet(void) {
33481    int test_ret = 0;
33482
33483#if defined(LIBXML_SCHEMAS_ENABLED)
33484    int mem_base;
33485    int ret_val;
33486    xmlSchemaTypePtr type; /* the built-in type */
33487    int n_type;
33488    xmlSchemaFacetPtr facet; /* the facet to check */
33489    int n_facet;
33490    xmlChar * value; /* the lexical repr. of the value to be validated */
33491    int n_value;
33492    xmlSchemaValPtr val; /* the precomputed value */
33493    int n_val;
33494    unsigned long * length; /* the actual length of the value */
33495    int n_length;
33496
33497    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33498    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33499    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33500    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33501    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
33502        mem_base = xmlMemBlocks();
33503        type = gen_xmlSchemaTypePtr(n_type, 0);
33504        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
33505        value = gen_const_xmlChar_ptr(n_value, 2);
33506        val = gen_xmlSchemaValPtr(n_val, 3);
33507        length = gen_unsigned_long_ptr(n_length, 4);
33508
33509        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
33510        desret_int(ret_val);
33511        call_tests++;
33512        des_xmlSchemaTypePtr(n_type, type, 0);
33513        des_xmlSchemaFacetPtr(n_facet, facet, 1);
33514        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
33515        des_xmlSchemaValPtr(n_val, val, 3);
33516        des_unsigned_long_ptr(n_length, length, 4);
33517        xmlResetLastError();
33518        if (mem_base != xmlMemBlocks()) {
33519            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
33520	           xmlMemBlocks() - mem_base);
33521	    test_ret++;
33522            printf(" %d", n_type);
33523            printf(" %d", n_facet);
33524            printf(" %d", n_value);
33525            printf(" %d", n_val);
33526            printf(" %d", n_length);
33527            printf("\n");
33528        }
33529    }
33530    }
33531    }
33532    }
33533    }
33534    function_tests++;
33535#endif
33536
33537    return(test_ret);
33538}
33539
33540
33541static int
33542test_xmlSchemaValidateLengthFacetWhtsp(void) {
33543    int test_ret = 0;
33544
33545#if defined(LIBXML_SCHEMAS_ENABLED)
33546    int mem_base;
33547    int ret_val;
33548    xmlSchemaFacetPtr facet; /* the facet to check */
33549    int n_facet;
33550    xmlSchemaValType valType; /* the built-in type */
33551    int n_valType;
33552    xmlChar * value; /* the lexical repr. of the value to be validated */
33553    int n_value;
33554    xmlSchemaValPtr val; /* the precomputed value */
33555    int n_val;
33556    unsigned long * length; /* the actual length of the value */
33557    int n_length;
33558    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
33559    int n_ws;
33560
33561    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33562    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
33563    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33564    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
33565    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
33566    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
33567        mem_base = xmlMemBlocks();
33568        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33569        valType = gen_xmlSchemaValType(n_valType, 1);
33570        value = gen_const_xmlChar_ptr(n_value, 2);
33571        val = gen_xmlSchemaValPtr(n_val, 3);
33572        length = gen_unsigned_long_ptr(n_length, 4);
33573        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
33574
33575        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
33576        desret_int(ret_val);
33577        call_tests++;
33578        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33579        des_xmlSchemaValType(n_valType, valType, 1);
33580        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
33581        des_xmlSchemaValPtr(n_val, val, 3);
33582        des_unsigned_long_ptr(n_length, length, 4);
33583        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
33584        xmlResetLastError();
33585        if (mem_base != xmlMemBlocks()) {
33586            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
33587	           xmlMemBlocks() - mem_base);
33588	    test_ret++;
33589            printf(" %d", n_facet);
33590            printf(" %d", n_valType);
33591            printf(" %d", n_value);
33592            printf(" %d", n_val);
33593            printf(" %d", n_length);
33594            printf(" %d", n_ws);
33595            printf("\n");
33596        }
33597    }
33598    }
33599    }
33600    }
33601    }
33602    }
33603    function_tests++;
33604#endif
33605
33606    return(test_ret);
33607}
33608
33609
33610static int
33611test_xmlSchemaValidateListSimpleTypeFacet(void) {
33612    int test_ret = 0;
33613
33614#if defined(LIBXML_SCHEMAS_ENABLED)
33615    int mem_base;
33616    int ret_val;
33617    xmlSchemaFacetPtr facet; /* the facet to check */
33618    int n_facet;
33619    xmlChar * value; /* the lexical repr of the value to validate */
33620    int n_value;
33621    unsigned long actualLen; /* the number of list items */
33622    int n_actualLen;
33623    unsigned long * expectedLen; /* the resulting expected number of list items */
33624    int n_expectedLen;
33625
33626    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
33627    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33628    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
33629    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
33630        mem_base = xmlMemBlocks();
33631        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
33632        value = gen_const_xmlChar_ptr(n_value, 1);
33633        actualLen = gen_unsigned_long(n_actualLen, 2);
33634        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
33635
33636        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
33637        desret_int(ret_val);
33638        call_tests++;
33639        des_xmlSchemaFacetPtr(n_facet, facet, 0);
33640        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33641        des_unsigned_long(n_actualLen, actualLen, 2);
33642        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
33643        xmlResetLastError();
33644        if (mem_base != xmlMemBlocks()) {
33645            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
33646	           xmlMemBlocks() - mem_base);
33647	    test_ret++;
33648            printf(" %d", n_facet);
33649            printf(" %d", n_value);
33650            printf(" %d", n_actualLen);
33651            printf(" %d", n_expectedLen);
33652            printf("\n");
33653        }
33654    }
33655    }
33656    }
33657    }
33658    function_tests++;
33659#endif
33660
33661    return(test_ret);
33662}
33663
33664
33665static int
33666test_xmlSchemaValidatePredefinedType(void) {
33667    int test_ret = 0;
33668
33669#if defined(LIBXML_SCHEMAS_ENABLED)
33670    int mem_base;
33671    int ret_val;
33672    xmlSchemaTypePtr type; /* the predefined type */
33673    int n_type;
33674    xmlChar * value; /* the value to check */
33675    int n_value;
33676    xmlSchemaValPtr * val; /* the return computed value */
33677    int n_val;
33678
33679    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
33680    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33681    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
33682        mem_base = xmlMemBlocks();
33683        type = gen_xmlSchemaTypePtr(n_type, 0);
33684        value = gen_const_xmlChar_ptr(n_value, 1);
33685        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
33686
33687        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
33688        desret_int(ret_val);
33689        call_tests++;
33690        des_xmlSchemaTypePtr(n_type, type, 0);
33691        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33692        des_xmlSchemaValPtr_ptr(n_val, val, 2);
33693        xmlResetLastError();
33694        if (mem_base != xmlMemBlocks()) {
33695            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
33696	           xmlMemBlocks() - mem_base);
33697	    test_ret++;
33698            printf(" %d", n_type);
33699            printf(" %d", n_value);
33700            printf(" %d", n_val);
33701            printf("\n");
33702        }
33703    }
33704    }
33705    }
33706    function_tests++;
33707#endif
33708
33709    return(test_ret);
33710}
33711
33712
33713static int
33714test_xmlSchemaWhiteSpaceReplace(void) {
33715    int test_ret = 0;
33716
33717#if defined(LIBXML_SCHEMAS_ENABLED)
33718    int mem_base;
33719    xmlChar * ret_val;
33720    xmlChar * value; /* a value */
33721    int n_value;
33722
33723    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33724        mem_base = xmlMemBlocks();
33725        value = gen_const_xmlChar_ptr(n_value, 0);
33726
33727        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
33728        desret_xmlChar_ptr(ret_val);
33729        call_tests++;
33730        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
33731        xmlResetLastError();
33732        if (mem_base != xmlMemBlocks()) {
33733            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
33734	           xmlMemBlocks() - mem_base);
33735	    test_ret++;
33736            printf(" %d", n_value);
33737            printf("\n");
33738        }
33739    }
33740    function_tests++;
33741#endif
33742
33743    return(test_ret);
33744}
33745
33746static int
33747test_xmlschemastypes(void) {
33748    int test_ret = 0;
33749
33750    if (quiet == 0) printf("Testing xmlschemastypes : 23 of 29 functions ...\n");
33751    test_ret += test_xmlSchemaCheckFacet();
33752    test_ret += test_xmlSchemaCleanupTypes();
33753    test_ret += test_xmlSchemaCollapseString();
33754    test_ret += test_xmlSchemaCompareValues();
33755    test_ret += test_xmlSchemaCompareValuesWhtsp();
33756    test_ret += test_xmlSchemaCopyValue();
33757    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
33758    test_ret += test_xmlSchemaGetBuiltInType();
33759    test_ret += test_xmlSchemaGetCanonValue();
33760    test_ret += test_xmlSchemaGetCanonValueWhtsp();
33761    test_ret += test_xmlSchemaGetFacetValueAsULong();
33762    test_ret += test_xmlSchemaGetPredefinedType();
33763    test_ret += test_xmlSchemaGetValType();
33764    test_ret += test_xmlSchemaInitTypes();
33765    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
33766    test_ret += test_xmlSchemaNewFacet();
33767    test_ret += test_xmlSchemaNewNOTATIONValue();
33768    test_ret += test_xmlSchemaNewStringValue();
33769    test_ret += test_xmlSchemaValPredefTypeNode();
33770    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
33771    test_ret += test_xmlSchemaValidateFacet();
33772    test_ret += test_xmlSchemaValidateFacetWhtsp();
33773    test_ret += test_xmlSchemaValidateLengthFacet();
33774    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
33775    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
33776    test_ret += test_xmlSchemaValidatePredefinedType();
33777    test_ret += test_xmlSchemaWhiteSpaceReplace();
33778
33779    if (test_ret != 0)
33780	printf("Module xmlschemastypes: %d errors\n", test_ret);
33781    return(test_ret);
33782}
33783
33784static int
33785test_xmlCharStrdup(void) {
33786    int test_ret = 0;
33787
33788    int mem_base;
33789    xmlChar * ret_val;
33790    char * cur; /* the input char * */
33791    int n_cur;
33792
33793    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
33794        mem_base = xmlMemBlocks();
33795        cur = gen_const_char_ptr(n_cur, 0);
33796
33797        ret_val = xmlCharStrdup((const char *)cur);
33798        desret_xmlChar_ptr(ret_val);
33799        call_tests++;
33800        des_const_char_ptr(n_cur, (const char *)cur, 0);
33801        xmlResetLastError();
33802        if (mem_base != xmlMemBlocks()) {
33803            printf("Leak of %d blocks found in xmlCharStrdup",
33804	           xmlMemBlocks() - mem_base);
33805	    test_ret++;
33806            printf(" %d", n_cur);
33807            printf("\n");
33808        }
33809    }
33810    function_tests++;
33811
33812    return(test_ret);
33813}
33814
33815
33816static int
33817test_xmlCharStrndup(void) {
33818    int test_ret = 0;
33819
33820    int mem_base;
33821    xmlChar * ret_val;
33822    char * cur; /* the input char * */
33823    int n_cur;
33824    int len; /* the len of @cur */
33825    int n_len;
33826
33827    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
33828    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33829        mem_base = xmlMemBlocks();
33830        cur = gen_const_char_ptr(n_cur, 0);
33831        len = gen_int(n_len, 1);
33832
33833        ret_val = xmlCharStrndup((const char *)cur, len);
33834        desret_xmlChar_ptr(ret_val);
33835        call_tests++;
33836        des_const_char_ptr(n_cur, (const char *)cur, 0);
33837        des_int(n_len, len, 1);
33838        xmlResetLastError();
33839        if (mem_base != xmlMemBlocks()) {
33840            printf("Leak of %d blocks found in xmlCharStrndup",
33841	           xmlMemBlocks() - mem_base);
33842	    test_ret++;
33843            printf(" %d", n_cur);
33844            printf(" %d", n_len);
33845            printf("\n");
33846        }
33847    }
33848    }
33849    function_tests++;
33850
33851    return(test_ret);
33852}
33853
33854
33855static int
33856test_xmlCheckUTF8(void) {
33857    int test_ret = 0;
33858
33859    int mem_base;
33860    int ret_val;
33861    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
33862    int n_utf;
33863
33864    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
33865        mem_base = xmlMemBlocks();
33866        utf = gen_const_unsigned_char_ptr(n_utf, 0);
33867
33868        ret_val = xmlCheckUTF8((const unsigned char *)utf);
33869        desret_int(ret_val);
33870        call_tests++;
33871        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
33872        xmlResetLastError();
33873        if (mem_base != xmlMemBlocks()) {
33874            printf("Leak of %d blocks found in xmlCheckUTF8",
33875	           xmlMemBlocks() - mem_base);
33876	    test_ret++;
33877            printf(" %d", n_utf);
33878            printf("\n");
33879        }
33880    }
33881    function_tests++;
33882
33883    return(test_ret);
33884}
33885
33886
33887static int
33888test_xmlGetUTF8Char(void) {
33889    int test_ret = 0;
33890
33891    int mem_base;
33892    int ret_val;
33893    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
33894    int n_utf;
33895    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. */
33896    int n_len;
33897
33898    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
33899    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
33900        mem_base = xmlMemBlocks();
33901        utf = gen_const_unsigned_char_ptr(n_utf, 0);
33902        len = gen_int_ptr(n_len, 1);
33903
33904        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
33905        desret_int(ret_val);
33906        call_tests++;
33907        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
33908        des_int_ptr(n_len, len, 1);
33909        xmlResetLastError();
33910        if (mem_base != xmlMemBlocks()) {
33911            printf("Leak of %d blocks found in xmlGetUTF8Char",
33912	           xmlMemBlocks() - mem_base);
33913	    test_ret++;
33914            printf(" %d", n_utf);
33915            printf(" %d", n_len);
33916            printf("\n");
33917        }
33918    }
33919    }
33920    function_tests++;
33921
33922    return(test_ret);
33923}
33924
33925
33926static int
33927test_xmlStrEqual(void) {
33928    int test_ret = 0;
33929
33930    int mem_base;
33931    int ret_val;
33932    xmlChar * str1; /* the first xmlChar * */
33933    int n_str1;
33934    xmlChar * str2; /* the second xmlChar * */
33935    int n_str2;
33936
33937    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
33938    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
33939        mem_base = xmlMemBlocks();
33940        str1 = gen_const_xmlChar_ptr(n_str1, 0);
33941        str2 = gen_const_xmlChar_ptr(n_str2, 1);
33942
33943        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
33944        desret_int(ret_val);
33945        call_tests++;
33946        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
33947        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
33948        xmlResetLastError();
33949        if (mem_base != xmlMemBlocks()) {
33950            printf("Leak of %d blocks found in xmlStrEqual",
33951	           xmlMemBlocks() - mem_base);
33952	    test_ret++;
33953            printf(" %d", n_str1);
33954            printf(" %d", n_str2);
33955            printf("\n");
33956        }
33957    }
33958    }
33959    function_tests++;
33960
33961    return(test_ret);
33962}
33963
33964
33965static int
33966test_xmlStrPrintf(void) {
33967    int test_ret = 0;
33968
33969
33970    /* missing type support */
33971    return(test_ret);
33972}
33973
33974
33975static int
33976test_xmlStrQEqual(void) {
33977    int test_ret = 0;
33978
33979    int mem_base;
33980    int ret_val;
33981    xmlChar * pref; /* the prefix of the QName */
33982    int n_pref;
33983    xmlChar * name; /* the localname of the QName */
33984    int n_name;
33985    xmlChar * str; /* the second xmlChar * */
33986    int n_str;
33987
33988    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
33989    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
33990    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33991        mem_base = xmlMemBlocks();
33992        pref = gen_const_xmlChar_ptr(n_pref, 0);
33993        name = gen_const_xmlChar_ptr(n_name, 1);
33994        str = gen_const_xmlChar_ptr(n_str, 2);
33995
33996        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
33997        desret_int(ret_val);
33998        call_tests++;
33999        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
34000        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
34001        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
34002        xmlResetLastError();
34003        if (mem_base != xmlMemBlocks()) {
34004            printf("Leak of %d blocks found in xmlStrQEqual",
34005	           xmlMemBlocks() - mem_base);
34006	    test_ret++;
34007            printf(" %d", n_pref);
34008            printf(" %d", n_name);
34009            printf(" %d", n_str);
34010            printf("\n");
34011        }
34012    }
34013    }
34014    }
34015    function_tests++;
34016
34017    return(test_ret);
34018}
34019
34020
34021static int
34022test_xmlStrVPrintf(void) {
34023    int test_ret = 0;
34024
34025
34026    /* missing type support */
34027    return(test_ret);
34028}
34029
34030
34031static int
34032test_xmlStrcasecmp(void) {
34033    int test_ret = 0;
34034
34035    int mem_base;
34036    int ret_val;
34037    xmlChar * str1; /* the first xmlChar * */
34038    int n_str1;
34039    xmlChar * str2; /* the second xmlChar * */
34040    int n_str2;
34041
34042    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34043    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34044        mem_base = xmlMemBlocks();
34045        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34046        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34047
34048        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
34049        desret_int(ret_val);
34050        call_tests++;
34051        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34052        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34053        xmlResetLastError();
34054        if (mem_base != xmlMemBlocks()) {
34055            printf("Leak of %d blocks found in xmlStrcasecmp",
34056	           xmlMemBlocks() - mem_base);
34057	    test_ret++;
34058            printf(" %d", n_str1);
34059            printf(" %d", n_str2);
34060            printf("\n");
34061        }
34062    }
34063    }
34064    function_tests++;
34065
34066    return(test_ret);
34067}
34068
34069
34070static int
34071test_xmlStrcasestr(void) {
34072    int test_ret = 0;
34073
34074    int mem_base;
34075    const xmlChar * ret_val;
34076    xmlChar * str; /* the xmlChar * array (haystack) */
34077    int n_str;
34078    xmlChar * val; /* the xmlChar to search (needle) */
34079    int n_val;
34080
34081    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34082    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
34083        mem_base = xmlMemBlocks();
34084        str = gen_const_xmlChar_ptr(n_str, 0);
34085        val = gen_xmlChar_ptr(n_val, 1);
34086
34087        ret_val = xmlStrcasestr((const xmlChar *)str, val);
34088        desret_const_xmlChar_ptr(ret_val);
34089        call_tests++;
34090        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34091        des_xmlChar_ptr(n_val, val, 1);
34092        xmlResetLastError();
34093        if (mem_base != xmlMemBlocks()) {
34094            printf("Leak of %d blocks found in xmlStrcasestr",
34095	           xmlMemBlocks() - mem_base);
34096	    test_ret++;
34097            printf(" %d", n_str);
34098            printf(" %d", n_val);
34099            printf("\n");
34100        }
34101    }
34102    }
34103    function_tests++;
34104
34105    return(test_ret);
34106}
34107
34108
34109static int
34110test_xmlStrchr(void) {
34111    int test_ret = 0;
34112
34113    int mem_base;
34114    const xmlChar * ret_val;
34115    xmlChar * str; /* the xmlChar * array */
34116    int n_str;
34117    xmlChar val; /* the xmlChar to search */
34118    int n_val;
34119
34120    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34121    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
34122        mem_base = xmlMemBlocks();
34123        str = gen_const_xmlChar_ptr(n_str, 0);
34124        val = gen_xmlChar(n_val, 1);
34125
34126        ret_val = xmlStrchr((const xmlChar *)str, val);
34127        desret_const_xmlChar_ptr(ret_val);
34128        call_tests++;
34129        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34130        des_xmlChar(n_val, val, 1);
34131        xmlResetLastError();
34132        if (mem_base != xmlMemBlocks()) {
34133            printf("Leak of %d blocks found in xmlStrchr",
34134	           xmlMemBlocks() - mem_base);
34135	    test_ret++;
34136            printf(" %d", n_str);
34137            printf(" %d", n_val);
34138            printf("\n");
34139        }
34140    }
34141    }
34142    function_tests++;
34143
34144    return(test_ret);
34145}
34146
34147
34148static int
34149test_xmlStrcmp(void) {
34150    int test_ret = 0;
34151
34152    int mem_base;
34153    int ret_val;
34154    xmlChar * str1; /* the first xmlChar * */
34155    int n_str1;
34156    xmlChar * str2; /* the second xmlChar * */
34157    int n_str2;
34158
34159    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34160    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34161        mem_base = xmlMemBlocks();
34162        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34163        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34164
34165        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
34166        desret_int(ret_val);
34167        call_tests++;
34168        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34169        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34170        xmlResetLastError();
34171        if (mem_base != xmlMemBlocks()) {
34172            printf("Leak of %d blocks found in xmlStrcmp",
34173	           xmlMemBlocks() - mem_base);
34174	    test_ret++;
34175            printf(" %d", n_str1);
34176            printf(" %d", n_str2);
34177            printf("\n");
34178        }
34179    }
34180    }
34181    function_tests++;
34182
34183    return(test_ret);
34184}
34185
34186
34187static int
34188test_xmlStrdup(void) {
34189    int test_ret = 0;
34190
34191    int mem_base;
34192    xmlChar * ret_val;
34193    xmlChar * cur; /* the input xmlChar * */
34194    int n_cur;
34195
34196    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
34197        mem_base = xmlMemBlocks();
34198        cur = gen_const_xmlChar_ptr(n_cur, 0);
34199
34200        ret_val = xmlStrdup((const xmlChar *)cur);
34201        desret_xmlChar_ptr(ret_val);
34202        call_tests++;
34203        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
34204        xmlResetLastError();
34205        if (mem_base != xmlMemBlocks()) {
34206            printf("Leak of %d blocks found in xmlStrdup",
34207	           xmlMemBlocks() - mem_base);
34208	    test_ret++;
34209            printf(" %d", n_cur);
34210            printf("\n");
34211        }
34212    }
34213    function_tests++;
34214
34215    return(test_ret);
34216}
34217
34218
34219static int
34220test_xmlStrlen(void) {
34221    int test_ret = 0;
34222
34223    int mem_base;
34224    int ret_val;
34225    xmlChar * str; /* the xmlChar * array */
34226    int n_str;
34227
34228    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34229        mem_base = xmlMemBlocks();
34230        str = gen_const_xmlChar_ptr(n_str, 0);
34231
34232        ret_val = xmlStrlen((const xmlChar *)str);
34233        desret_int(ret_val);
34234        call_tests++;
34235        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34236        xmlResetLastError();
34237        if (mem_base != xmlMemBlocks()) {
34238            printf("Leak of %d blocks found in xmlStrlen",
34239	           xmlMemBlocks() - mem_base);
34240	    test_ret++;
34241            printf(" %d", n_str);
34242            printf("\n");
34243        }
34244    }
34245    function_tests++;
34246
34247    return(test_ret);
34248}
34249
34250
34251static int
34252test_xmlStrncasecmp(void) {
34253    int test_ret = 0;
34254
34255    int mem_base;
34256    int ret_val;
34257    xmlChar * str1; /* the first xmlChar * */
34258    int n_str1;
34259    xmlChar * str2; /* the second xmlChar * */
34260    int n_str2;
34261    int len; /* the max comparison length */
34262    int n_len;
34263
34264    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34265    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34266    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34267        mem_base = xmlMemBlocks();
34268        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34269        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34270        len = gen_int(n_len, 2);
34271
34272        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
34273        desret_int(ret_val);
34274        call_tests++;
34275        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34276        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34277        des_int(n_len, len, 2);
34278        xmlResetLastError();
34279        if (mem_base != xmlMemBlocks()) {
34280            printf("Leak of %d blocks found in xmlStrncasecmp",
34281	           xmlMemBlocks() - mem_base);
34282	    test_ret++;
34283            printf(" %d", n_str1);
34284            printf(" %d", n_str2);
34285            printf(" %d", n_len);
34286            printf("\n");
34287        }
34288    }
34289    }
34290    }
34291    function_tests++;
34292
34293    return(test_ret);
34294}
34295
34296
34297static int
34298test_xmlStrncatNew(void) {
34299    int test_ret = 0;
34300
34301    int mem_base;
34302    xmlChar * ret_val;
34303    xmlChar * str1; /* first xmlChar string */
34304    int n_str1;
34305    xmlChar * str2; /* second xmlChar string */
34306    int n_str2;
34307    int len; /* the len of @str2 */
34308    int n_len;
34309
34310    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34311    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34312    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34313        mem_base = xmlMemBlocks();
34314        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34315        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34316        len = gen_int(n_len, 2);
34317
34318        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
34319        desret_xmlChar_ptr(ret_val);
34320        call_tests++;
34321        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34322        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34323        des_int(n_len, len, 2);
34324        xmlResetLastError();
34325        if (mem_base != xmlMemBlocks()) {
34326            printf("Leak of %d blocks found in xmlStrncatNew",
34327	           xmlMemBlocks() - mem_base);
34328	    test_ret++;
34329            printf(" %d", n_str1);
34330            printf(" %d", n_str2);
34331            printf(" %d", n_len);
34332            printf("\n");
34333        }
34334    }
34335    }
34336    }
34337    function_tests++;
34338
34339    return(test_ret);
34340}
34341
34342
34343static int
34344test_xmlStrncmp(void) {
34345    int test_ret = 0;
34346
34347    int mem_base;
34348    int ret_val;
34349    xmlChar * str1; /* the first xmlChar * */
34350    int n_str1;
34351    xmlChar * str2; /* the second xmlChar * */
34352    int n_str2;
34353    int len; /* the max comparison length */
34354    int n_len;
34355
34356    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
34357    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
34358    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34359        mem_base = xmlMemBlocks();
34360        str1 = gen_const_xmlChar_ptr(n_str1, 0);
34361        str2 = gen_const_xmlChar_ptr(n_str2, 1);
34362        len = gen_int(n_len, 2);
34363
34364        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
34365        desret_int(ret_val);
34366        call_tests++;
34367        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
34368        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
34369        des_int(n_len, len, 2);
34370        xmlResetLastError();
34371        if (mem_base != xmlMemBlocks()) {
34372            printf("Leak of %d blocks found in xmlStrncmp",
34373	           xmlMemBlocks() - mem_base);
34374	    test_ret++;
34375            printf(" %d", n_str1);
34376            printf(" %d", n_str2);
34377            printf(" %d", n_len);
34378            printf("\n");
34379        }
34380    }
34381    }
34382    }
34383    function_tests++;
34384
34385    return(test_ret);
34386}
34387
34388
34389static int
34390test_xmlStrndup(void) {
34391    int test_ret = 0;
34392
34393    int mem_base;
34394    xmlChar * ret_val;
34395    xmlChar * cur; /* the input xmlChar * */
34396    int n_cur;
34397    int len; /* the len of @cur */
34398    int n_len;
34399
34400    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
34401    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34402        mem_base = xmlMemBlocks();
34403        cur = gen_const_xmlChar_ptr(n_cur, 0);
34404        len = gen_int(n_len, 1);
34405
34406        ret_val = xmlStrndup((const xmlChar *)cur, len);
34407        desret_xmlChar_ptr(ret_val);
34408        call_tests++;
34409        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
34410        des_int(n_len, len, 1);
34411        xmlResetLastError();
34412        if (mem_base != xmlMemBlocks()) {
34413            printf("Leak of %d blocks found in xmlStrndup",
34414	           xmlMemBlocks() - mem_base);
34415	    test_ret++;
34416            printf(" %d", n_cur);
34417            printf(" %d", n_len);
34418            printf("\n");
34419        }
34420    }
34421    }
34422    function_tests++;
34423
34424    return(test_ret);
34425}
34426
34427
34428static int
34429test_xmlStrstr(void) {
34430    int test_ret = 0;
34431
34432    int mem_base;
34433    const xmlChar * ret_val;
34434    xmlChar * str; /* the xmlChar * array (haystack) */
34435    int n_str;
34436    xmlChar * val; /* the xmlChar to search (needle) */
34437    int n_val;
34438
34439    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34440    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
34441        mem_base = xmlMemBlocks();
34442        str = gen_const_xmlChar_ptr(n_str, 0);
34443        val = gen_const_xmlChar_ptr(n_val, 1);
34444
34445        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
34446        desret_const_xmlChar_ptr(ret_val);
34447        call_tests++;
34448        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34449        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
34450        xmlResetLastError();
34451        if (mem_base != xmlMemBlocks()) {
34452            printf("Leak of %d blocks found in xmlStrstr",
34453	           xmlMemBlocks() - mem_base);
34454	    test_ret++;
34455            printf(" %d", n_str);
34456            printf(" %d", n_val);
34457            printf("\n");
34458        }
34459    }
34460    }
34461    function_tests++;
34462
34463    return(test_ret);
34464}
34465
34466
34467static int
34468test_xmlStrsub(void) {
34469    int test_ret = 0;
34470
34471    int mem_base;
34472    xmlChar * ret_val;
34473    xmlChar * str; /* the xmlChar * array (haystack) */
34474    int n_str;
34475    int start; /* the index of the first char (zero based) */
34476    int n_start;
34477    int len; /* the length of the substring */
34478    int n_len;
34479
34480    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
34481    for (n_start = 0;n_start < gen_nb_int;n_start++) {
34482    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34483        mem_base = xmlMemBlocks();
34484        str = gen_const_xmlChar_ptr(n_str, 0);
34485        start = gen_int(n_start, 1);
34486        len = gen_int(n_len, 2);
34487
34488        ret_val = xmlStrsub((const xmlChar *)str, start, len);
34489        desret_xmlChar_ptr(ret_val);
34490        call_tests++;
34491        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
34492        des_int(n_start, start, 1);
34493        des_int(n_len, len, 2);
34494        xmlResetLastError();
34495        if (mem_base != xmlMemBlocks()) {
34496            printf("Leak of %d blocks found in xmlStrsub",
34497	           xmlMemBlocks() - mem_base);
34498	    test_ret++;
34499            printf(" %d", n_str);
34500            printf(" %d", n_start);
34501            printf(" %d", n_len);
34502            printf("\n");
34503        }
34504    }
34505    }
34506    }
34507    function_tests++;
34508
34509    return(test_ret);
34510}
34511
34512
34513static int
34514test_xmlUTF8Charcmp(void) {
34515    int test_ret = 0;
34516
34517    int mem_base;
34518    int ret_val;
34519    xmlChar * utf1; /* pointer to first UTF8 char */
34520    int n_utf1;
34521    xmlChar * utf2; /* pointer to second UTF8 char */
34522    int n_utf2;
34523
34524    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
34525    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
34526        mem_base = xmlMemBlocks();
34527        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
34528        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
34529
34530        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
34531        desret_int(ret_val);
34532        call_tests++;
34533        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
34534        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
34535        xmlResetLastError();
34536        if (mem_base != xmlMemBlocks()) {
34537            printf("Leak of %d blocks found in xmlUTF8Charcmp",
34538	           xmlMemBlocks() - mem_base);
34539	    test_ret++;
34540            printf(" %d", n_utf1);
34541            printf(" %d", n_utf2);
34542            printf("\n");
34543        }
34544    }
34545    }
34546    function_tests++;
34547
34548    return(test_ret);
34549}
34550
34551
34552static int
34553test_xmlUTF8Size(void) {
34554    int test_ret = 0;
34555
34556    int mem_base;
34557    int ret_val;
34558    xmlChar * utf; /* pointer to the UTF8 character */
34559    int n_utf;
34560
34561    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34562        mem_base = xmlMemBlocks();
34563        utf = gen_const_xmlChar_ptr(n_utf, 0);
34564
34565        ret_val = xmlUTF8Size((const xmlChar *)utf);
34566        desret_int(ret_val);
34567        call_tests++;
34568        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34569        xmlResetLastError();
34570        if (mem_base != xmlMemBlocks()) {
34571            printf("Leak of %d blocks found in xmlUTF8Size",
34572	           xmlMemBlocks() - mem_base);
34573	    test_ret++;
34574            printf(" %d", n_utf);
34575            printf("\n");
34576        }
34577    }
34578    function_tests++;
34579
34580    return(test_ret);
34581}
34582
34583
34584static int
34585test_xmlUTF8Strlen(void) {
34586    int test_ret = 0;
34587
34588    int mem_base;
34589    int ret_val;
34590    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
34591    int n_utf;
34592
34593    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34594        mem_base = xmlMemBlocks();
34595        utf = gen_const_xmlChar_ptr(n_utf, 0);
34596
34597        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
34598        desret_int(ret_val);
34599        call_tests++;
34600        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34601        xmlResetLastError();
34602        if (mem_base != xmlMemBlocks()) {
34603            printf("Leak of %d blocks found in xmlUTF8Strlen",
34604	           xmlMemBlocks() - mem_base);
34605	    test_ret++;
34606            printf(" %d", n_utf);
34607            printf("\n");
34608        }
34609    }
34610    function_tests++;
34611
34612    return(test_ret);
34613}
34614
34615
34616static int
34617test_xmlUTF8Strloc(void) {
34618    int test_ret = 0;
34619
34620    int mem_base;
34621    int ret_val;
34622    xmlChar * utf; /* the input UTF8 * */
34623    int n_utf;
34624    xmlChar * utfchar; /* the UTF8 character to be found */
34625    int n_utfchar;
34626
34627    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34628    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
34629        mem_base = xmlMemBlocks();
34630        utf = gen_const_xmlChar_ptr(n_utf, 0);
34631        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
34632
34633        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
34634        desret_int(ret_val);
34635        call_tests++;
34636        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34637        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
34638        xmlResetLastError();
34639        if (mem_base != xmlMemBlocks()) {
34640            printf("Leak of %d blocks found in xmlUTF8Strloc",
34641	           xmlMemBlocks() - mem_base);
34642	    test_ret++;
34643            printf(" %d", n_utf);
34644            printf(" %d", n_utfchar);
34645            printf("\n");
34646        }
34647    }
34648    }
34649    function_tests++;
34650
34651    return(test_ret);
34652}
34653
34654
34655static int
34656test_xmlUTF8Strndup(void) {
34657    int test_ret = 0;
34658
34659    int mem_base;
34660    xmlChar * ret_val;
34661    xmlChar * utf; /* the input UTF8 * */
34662    int n_utf;
34663    int len; /* the len of @utf (in chars) */
34664    int n_len;
34665
34666    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34667    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34668        mem_base = xmlMemBlocks();
34669        utf = gen_const_xmlChar_ptr(n_utf, 0);
34670        len = gen_int(n_len, 1);
34671
34672        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
34673        desret_xmlChar_ptr(ret_val);
34674        call_tests++;
34675        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34676        des_int(n_len, len, 1);
34677        xmlResetLastError();
34678        if (mem_base != xmlMemBlocks()) {
34679            printf("Leak of %d blocks found in xmlUTF8Strndup",
34680	           xmlMemBlocks() - mem_base);
34681	    test_ret++;
34682            printf(" %d", n_utf);
34683            printf(" %d", n_len);
34684            printf("\n");
34685        }
34686    }
34687    }
34688    function_tests++;
34689
34690    return(test_ret);
34691}
34692
34693
34694static int
34695test_xmlUTF8Strpos(void) {
34696    int test_ret = 0;
34697
34698    int mem_base;
34699    const xmlChar * ret_val;
34700    xmlChar * utf; /* the input UTF8 * */
34701    int n_utf;
34702    int pos; /* the position of the desired UTF8 char (in chars) */
34703    int n_pos;
34704
34705    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34706    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
34707        mem_base = xmlMemBlocks();
34708        utf = gen_const_xmlChar_ptr(n_utf, 0);
34709        pos = gen_int(n_pos, 1);
34710
34711        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
34712        desret_const_xmlChar_ptr(ret_val);
34713        call_tests++;
34714        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34715        des_int(n_pos, pos, 1);
34716        xmlResetLastError();
34717        if (mem_base != xmlMemBlocks()) {
34718            printf("Leak of %d blocks found in xmlUTF8Strpos",
34719	           xmlMemBlocks() - mem_base);
34720	    test_ret++;
34721            printf(" %d", n_utf);
34722            printf(" %d", n_pos);
34723            printf("\n");
34724        }
34725    }
34726    }
34727    function_tests++;
34728
34729    return(test_ret);
34730}
34731
34732
34733static int
34734test_xmlUTF8Strsize(void) {
34735    int test_ret = 0;
34736
34737    int mem_base;
34738    int ret_val;
34739    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
34740    int n_utf;
34741    int len; /* the number of characters in the array */
34742    int n_len;
34743
34744    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34745    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34746        mem_base = xmlMemBlocks();
34747        utf = gen_const_xmlChar_ptr(n_utf, 0);
34748        len = gen_int(n_len, 1);
34749
34750        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
34751        desret_int(ret_val);
34752        call_tests++;
34753        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34754        des_int(n_len, len, 1);
34755        xmlResetLastError();
34756        if (mem_base != xmlMemBlocks()) {
34757            printf("Leak of %d blocks found in xmlUTF8Strsize",
34758	           xmlMemBlocks() - mem_base);
34759	    test_ret++;
34760            printf(" %d", n_utf);
34761            printf(" %d", n_len);
34762            printf("\n");
34763        }
34764    }
34765    }
34766    function_tests++;
34767
34768    return(test_ret);
34769}
34770
34771
34772static int
34773test_xmlUTF8Strsub(void) {
34774    int test_ret = 0;
34775
34776    int mem_base;
34777    xmlChar * ret_val;
34778    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
34779    int n_utf;
34780    int start; /* relative pos of first char */
34781    int n_start;
34782    int len; /* total number to copy */
34783    int n_len;
34784
34785    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
34786    for (n_start = 0;n_start < gen_nb_int;n_start++) {
34787    for (n_len = 0;n_len < gen_nb_int;n_len++) {
34788        mem_base = xmlMemBlocks();
34789        utf = gen_const_xmlChar_ptr(n_utf, 0);
34790        start = gen_int(n_start, 1);
34791        len = gen_int(n_len, 2);
34792
34793        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
34794        desret_xmlChar_ptr(ret_val);
34795        call_tests++;
34796        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
34797        des_int(n_start, start, 1);
34798        des_int(n_len, len, 2);
34799        xmlResetLastError();
34800        if (mem_base != xmlMemBlocks()) {
34801            printf("Leak of %d blocks found in xmlUTF8Strsub",
34802	           xmlMemBlocks() - mem_base);
34803	    test_ret++;
34804            printf(" %d", n_utf);
34805            printf(" %d", n_start);
34806            printf(" %d", n_len);
34807            printf("\n");
34808        }
34809    }
34810    }
34811    }
34812    function_tests++;
34813
34814    return(test_ret);
34815}
34816
34817static int
34818test_xmlstring(void) {
34819    int test_ret = 0;
34820
34821    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
34822    test_ret += test_xmlCharStrdup();
34823    test_ret += test_xmlCharStrndup();
34824    test_ret += test_xmlCheckUTF8();
34825    test_ret += test_xmlGetUTF8Char();
34826    test_ret += test_xmlStrEqual();
34827    test_ret += test_xmlStrPrintf();
34828    test_ret += test_xmlStrQEqual();
34829    test_ret += test_xmlStrVPrintf();
34830    test_ret += test_xmlStrcasecmp();
34831    test_ret += test_xmlStrcasestr();
34832    test_ret += test_xmlStrchr();
34833    test_ret += test_xmlStrcmp();
34834    test_ret += test_xmlStrdup();
34835    test_ret += test_xmlStrlen();
34836    test_ret += test_xmlStrncasecmp();
34837    test_ret += test_xmlStrncatNew();
34838    test_ret += test_xmlStrncmp();
34839    test_ret += test_xmlStrndup();
34840    test_ret += test_xmlStrstr();
34841    test_ret += test_xmlStrsub();
34842    test_ret += test_xmlUTF8Charcmp();
34843    test_ret += test_xmlUTF8Size();
34844    test_ret += test_xmlUTF8Strlen();
34845    test_ret += test_xmlUTF8Strloc();
34846    test_ret += test_xmlUTF8Strndup();
34847    test_ret += test_xmlUTF8Strpos();
34848    test_ret += test_xmlUTF8Strsize();
34849    test_ret += test_xmlUTF8Strsub();
34850
34851    if (test_ret != 0)
34852	printf("Module xmlstring: %d errors\n", test_ret);
34853    return(test_ret);
34854}
34855
34856static int
34857test_xmlUCSIsAegeanNumbers(void) {
34858    int test_ret = 0;
34859
34860#if defined(LIBXML_UNICODE_ENABLED)
34861    int mem_base;
34862    int ret_val;
34863    int code; /* UCS code point */
34864    int n_code;
34865
34866    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34867        mem_base = xmlMemBlocks();
34868        code = gen_int(n_code, 0);
34869
34870        ret_val = xmlUCSIsAegeanNumbers(code);
34871        desret_int(ret_val);
34872        call_tests++;
34873        des_int(n_code, code, 0);
34874        xmlResetLastError();
34875        if (mem_base != xmlMemBlocks()) {
34876            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
34877	           xmlMemBlocks() - mem_base);
34878	    test_ret++;
34879            printf(" %d", n_code);
34880            printf("\n");
34881        }
34882    }
34883    function_tests++;
34884#endif
34885
34886    return(test_ret);
34887}
34888
34889
34890static int
34891test_xmlUCSIsAlphabeticPresentationForms(void) {
34892    int test_ret = 0;
34893
34894#if defined(LIBXML_UNICODE_ENABLED)
34895    int mem_base;
34896    int ret_val;
34897    int code; /* UCS code point */
34898    int n_code;
34899
34900    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34901        mem_base = xmlMemBlocks();
34902        code = gen_int(n_code, 0);
34903
34904        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
34905        desret_int(ret_val);
34906        call_tests++;
34907        des_int(n_code, code, 0);
34908        xmlResetLastError();
34909        if (mem_base != xmlMemBlocks()) {
34910            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
34911	           xmlMemBlocks() - mem_base);
34912	    test_ret++;
34913            printf(" %d", n_code);
34914            printf("\n");
34915        }
34916    }
34917    function_tests++;
34918#endif
34919
34920    return(test_ret);
34921}
34922
34923
34924static int
34925test_xmlUCSIsArabic(void) {
34926    int test_ret = 0;
34927
34928#if defined(LIBXML_UNICODE_ENABLED)
34929    int mem_base;
34930    int ret_val;
34931    int code; /* UCS code point */
34932    int n_code;
34933
34934    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34935        mem_base = xmlMemBlocks();
34936        code = gen_int(n_code, 0);
34937
34938        ret_val = xmlUCSIsArabic(code);
34939        desret_int(ret_val);
34940        call_tests++;
34941        des_int(n_code, code, 0);
34942        xmlResetLastError();
34943        if (mem_base != xmlMemBlocks()) {
34944            printf("Leak of %d blocks found in xmlUCSIsArabic",
34945	           xmlMemBlocks() - mem_base);
34946	    test_ret++;
34947            printf(" %d", n_code);
34948            printf("\n");
34949        }
34950    }
34951    function_tests++;
34952#endif
34953
34954    return(test_ret);
34955}
34956
34957
34958static int
34959test_xmlUCSIsArabicPresentationFormsA(void) {
34960    int test_ret = 0;
34961
34962#if defined(LIBXML_UNICODE_ENABLED)
34963    int mem_base;
34964    int ret_val;
34965    int code; /* UCS code point */
34966    int n_code;
34967
34968    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34969        mem_base = xmlMemBlocks();
34970        code = gen_int(n_code, 0);
34971
34972        ret_val = xmlUCSIsArabicPresentationFormsA(code);
34973        desret_int(ret_val);
34974        call_tests++;
34975        des_int(n_code, code, 0);
34976        xmlResetLastError();
34977        if (mem_base != xmlMemBlocks()) {
34978            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
34979	           xmlMemBlocks() - mem_base);
34980	    test_ret++;
34981            printf(" %d", n_code);
34982            printf("\n");
34983        }
34984    }
34985    function_tests++;
34986#endif
34987
34988    return(test_ret);
34989}
34990
34991
34992static int
34993test_xmlUCSIsArabicPresentationFormsB(void) {
34994    int test_ret = 0;
34995
34996#if defined(LIBXML_UNICODE_ENABLED)
34997    int mem_base;
34998    int ret_val;
34999    int code; /* UCS code point */
35000    int n_code;
35001
35002    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35003        mem_base = xmlMemBlocks();
35004        code = gen_int(n_code, 0);
35005
35006        ret_val = xmlUCSIsArabicPresentationFormsB(code);
35007        desret_int(ret_val);
35008        call_tests++;
35009        des_int(n_code, code, 0);
35010        xmlResetLastError();
35011        if (mem_base != xmlMemBlocks()) {
35012            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
35013	           xmlMemBlocks() - mem_base);
35014	    test_ret++;
35015            printf(" %d", n_code);
35016            printf("\n");
35017        }
35018    }
35019    function_tests++;
35020#endif
35021
35022    return(test_ret);
35023}
35024
35025
35026static int
35027test_xmlUCSIsArmenian(void) {
35028    int test_ret = 0;
35029
35030#if defined(LIBXML_UNICODE_ENABLED)
35031    int mem_base;
35032    int ret_val;
35033    int code; /* UCS code point */
35034    int n_code;
35035
35036    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35037        mem_base = xmlMemBlocks();
35038        code = gen_int(n_code, 0);
35039
35040        ret_val = xmlUCSIsArmenian(code);
35041        desret_int(ret_val);
35042        call_tests++;
35043        des_int(n_code, code, 0);
35044        xmlResetLastError();
35045        if (mem_base != xmlMemBlocks()) {
35046            printf("Leak of %d blocks found in xmlUCSIsArmenian",
35047	           xmlMemBlocks() - mem_base);
35048	    test_ret++;
35049            printf(" %d", n_code);
35050            printf("\n");
35051        }
35052    }
35053    function_tests++;
35054#endif
35055
35056    return(test_ret);
35057}
35058
35059
35060static int
35061test_xmlUCSIsArrows(void) {
35062    int test_ret = 0;
35063
35064#if defined(LIBXML_UNICODE_ENABLED)
35065    int mem_base;
35066    int ret_val;
35067    int code; /* UCS code point */
35068    int n_code;
35069
35070    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35071        mem_base = xmlMemBlocks();
35072        code = gen_int(n_code, 0);
35073
35074        ret_val = xmlUCSIsArrows(code);
35075        desret_int(ret_val);
35076        call_tests++;
35077        des_int(n_code, code, 0);
35078        xmlResetLastError();
35079        if (mem_base != xmlMemBlocks()) {
35080            printf("Leak of %d blocks found in xmlUCSIsArrows",
35081	           xmlMemBlocks() - mem_base);
35082	    test_ret++;
35083            printf(" %d", n_code);
35084            printf("\n");
35085        }
35086    }
35087    function_tests++;
35088#endif
35089
35090    return(test_ret);
35091}
35092
35093
35094static int
35095test_xmlUCSIsBasicLatin(void) {
35096    int test_ret = 0;
35097
35098#if defined(LIBXML_UNICODE_ENABLED)
35099    int mem_base;
35100    int ret_val;
35101    int code; /* UCS code point */
35102    int n_code;
35103
35104    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35105        mem_base = xmlMemBlocks();
35106        code = gen_int(n_code, 0);
35107
35108        ret_val = xmlUCSIsBasicLatin(code);
35109        desret_int(ret_val);
35110        call_tests++;
35111        des_int(n_code, code, 0);
35112        xmlResetLastError();
35113        if (mem_base != xmlMemBlocks()) {
35114            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
35115	           xmlMemBlocks() - mem_base);
35116	    test_ret++;
35117            printf(" %d", n_code);
35118            printf("\n");
35119        }
35120    }
35121    function_tests++;
35122#endif
35123
35124    return(test_ret);
35125}
35126
35127
35128static int
35129test_xmlUCSIsBengali(void) {
35130    int test_ret = 0;
35131
35132#if defined(LIBXML_UNICODE_ENABLED)
35133    int mem_base;
35134    int ret_val;
35135    int code; /* UCS code point */
35136    int n_code;
35137
35138    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35139        mem_base = xmlMemBlocks();
35140        code = gen_int(n_code, 0);
35141
35142        ret_val = xmlUCSIsBengali(code);
35143        desret_int(ret_val);
35144        call_tests++;
35145        des_int(n_code, code, 0);
35146        xmlResetLastError();
35147        if (mem_base != xmlMemBlocks()) {
35148            printf("Leak of %d blocks found in xmlUCSIsBengali",
35149	           xmlMemBlocks() - mem_base);
35150	    test_ret++;
35151            printf(" %d", n_code);
35152            printf("\n");
35153        }
35154    }
35155    function_tests++;
35156#endif
35157
35158    return(test_ret);
35159}
35160
35161
35162static int
35163test_xmlUCSIsBlock(void) {
35164    int test_ret = 0;
35165
35166#if defined(LIBXML_UNICODE_ENABLED)
35167    int mem_base;
35168    int ret_val;
35169    int code; /* UCS code point */
35170    int n_code;
35171    char * block; /* UCS block name */
35172    int n_block;
35173
35174    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35175    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
35176        mem_base = xmlMemBlocks();
35177        code = gen_int(n_code, 0);
35178        block = gen_const_char_ptr(n_block, 1);
35179
35180        ret_val = xmlUCSIsBlock(code, (const char *)block);
35181        desret_int(ret_val);
35182        call_tests++;
35183        des_int(n_code, code, 0);
35184        des_const_char_ptr(n_block, (const char *)block, 1);
35185        xmlResetLastError();
35186        if (mem_base != xmlMemBlocks()) {
35187            printf("Leak of %d blocks found in xmlUCSIsBlock",
35188	           xmlMemBlocks() - mem_base);
35189	    test_ret++;
35190            printf(" %d", n_code);
35191            printf(" %d", n_block);
35192            printf("\n");
35193        }
35194    }
35195    }
35196    function_tests++;
35197#endif
35198
35199    return(test_ret);
35200}
35201
35202
35203static int
35204test_xmlUCSIsBlockElements(void) {
35205    int test_ret = 0;
35206
35207#if defined(LIBXML_UNICODE_ENABLED)
35208    int mem_base;
35209    int ret_val;
35210    int code; /* UCS code point */
35211    int n_code;
35212
35213    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35214        mem_base = xmlMemBlocks();
35215        code = gen_int(n_code, 0);
35216
35217        ret_val = xmlUCSIsBlockElements(code);
35218        desret_int(ret_val);
35219        call_tests++;
35220        des_int(n_code, code, 0);
35221        xmlResetLastError();
35222        if (mem_base != xmlMemBlocks()) {
35223            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
35224	           xmlMemBlocks() - mem_base);
35225	    test_ret++;
35226            printf(" %d", n_code);
35227            printf("\n");
35228        }
35229    }
35230    function_tests++;
35231#endif
35232
35233    return(test_ret);
35234}
35235
35236
35237static int
35238test_xmlUCSIsBopomofo(void) {
35239    int test_ret = 0;
35240
35241#if defined(LIBXML_UNICODE_ENABLED)
35242    int mem_base;
35243    int ret_val;
35244    int code; /* UCS code point */
35245    int n_code;
35246
35247    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35248        mem_base = xmlMemBlocks();
35249        code = gen_int(n_code, 0);
35250
35251        ret_val = xmlUCSIsBopomofo(code);
35252        desret_int(ret_val);
35253        call_tests++;
35254        des_int(n_code, code, 0);
35255        xmlResetLastError();
35256        if (mem_base != xmlMemBlocks()) {
35257            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
35258	           xmlMemBlocks() - mem_base);
35259	    test_ret++;
35260            printf(" %d", n_code);
35261            printf("\n");
35262        }
35263    }
35264    function_tests++;
35265#endif
35266
35267    return(test_ret);
35268}
35269
35270
35271static int
35272test_xmlUCSIsBopomofoExtended(void) {
35273    int test_ret = 0;
35274
35275#if defined(LIBXML_UNICODE_ENABLED)
35276    int mem_base;
35277    int ret_val;
35278    int code; /* UCS code point */
35279    int n_code;
35280
35281    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35282        mem_base = xmlMemBlocks();
35283        code = gen_int(n_code, 0);
35284
35285        ret_val = xmlUCSIsBopomofoExtended(code);
35286        desret_int(ret_val);
35287        call_tests++;
35288        des_int(n_code, code, 0);
35289        xmlResetLastError();
35290        if (mem_base != xmlMemBlocks()) {
35291            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
35292	           xmlMemBlocks() - mem_base);
35293	    test_ret++;
35294            printf(" %d", n_code);
35295            printf("\n");
35296        }
35297    }
35298    function_tests++;
35299#endif
35300
35301    return(test_ret);
35302}
35303
35304
35305static int
35306test_xmlUCSIsBoxDrawing(void) {
35307    int test_ret = 0;
35308
35309#if defined(LIBXML_UNICODE_ENABLED)
35310    int mem_base;
35311    int ret_val;
35312    int code; /* UCS code point */
35313    int n_code;
35314
35315    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35316        mem_base = xmlMemBlocks();
35317        code = gen_int(n_code, 0);
35318
35319        ret_val = xmlUCSIsBoxDrawing(code);
35320        desret_int(ret_val);
35321        call_tests++;
35322        des_int(n_code, code, 0);
35323        xmlResetLastError();
35324        if (mem_base != xmlMemBlocks()) {
35325            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
35326	           xmlMemBlocks() - mem_base);
35327	    test_ret++;
35328            printf(" %d", n_code);
35329            printf("\n");
35330        }
35331    }
35332    function_tests++;
35333#endif
35334
35335    return(test_ret);
35336}
35337
35338
35339static int
35340test_xmlUCSIsBraillePatterns(void) {
35341    int test_ret = 0;
35342
35343#if defined(LIBXML_UNICODE_ENABLED)
35344    int mem_base;
35345    int ret_val;
35346    int code; /* UCS code point */
35347    int n_code;
35348
35349    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35350        mem_base = xmlMemBlocks();
35351        code = gen_int(n_code, 0);
35352
35353        ret_val = xmlUCSIsBraillePatterns(code);
35354        desret_int(ret_val);
35355        call_tests++;
35356        des_int(n_code, code, 0);
35357        xmlResetLastError();
35358        if (mem_base != xmlMemBlocks()) {
35359            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
35360	           xmlMemBlocks() - mem_base);
35361	    test_ret++;
35362            printf(" %d", n_code);
35363            printf("\n");
35364        }
35365    }
35366    function_tests++;
35367#endif
35368
35369    return(test_ret);
35370}
35371
35372
35373static int
35374test_xmlUCSIsBuhid(void) {
35375    int test_ret = 0;
35376
35377#if defined(LIBXML_UNICODE_ENABLED)
35378    int mem_base;
35379    int ret_val;
35380    int code; /* UCS code point */
35381    int n_code;
35382
35383    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35384        mem_base = xmlMemBlocks();
35385        code = gen_int(n_code, 0);
35386
35387        ret_val = xmlUCSIsBuhid(code);
35388        desret_int(ret_val);
35389        call_tests++;
35390        des_int(n_code, code, 0);
35391        xmlResetLastError();
35392        if (mem_base != xmlMemBlocks()) {
35393            printf("Leak of %d blocks found in xmlUCSIsBuhid",
35394	           xmlMemBlocks() - mem_base);
35395	    test_ret++;
35396            printf(" %d", n_code);
35397            printf("\n");
35398        }
35399    }
35400    function_tests++;
35401#endif
35402
35403    return(test_ret);
35404}
35405
35406
35407static int
35408test_xmlUCSIsByzantineMusicalSymbols(void) {
35409    int test_ret = 0;
35410
35411#if defined(LIBXML_UNICODE_ENABLED)
35412    int mem_base;
35413    int ret_val;
35414    int code; /* UCS code point */
35415    int n_code;
35416
35417    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35418        mem_base = xmlMemBlocks();
35419        code = gen_int(n_code, 0);
35420
35421        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
35422        desret_int(ret_val);
35423        call_tests++;
35424        des_int(n_code, code, 0);
35425        xmlResetLastError();
35426        if (mem_base != xmlMemBlocks()) {
35427            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
35428	           xmlMemBlocks() - mem_base);
35429	    test_ret++;
35430            printf(" %d", n_code);
35431            printf("\n");
35432        }
35433    }
35434    function_tests++;
35435#endif
35436
35437    return(test_ret);
35438}
35439
35440
35441static int
35442test_xmlUCSIsCJKCompatibility(void) {
35443    int test_ret = 0;
35444
35445#if defined(LIBXML_UNICODE_ENABLED)
35446    int mem_base;
35447    int ret_val;
35448    int code; /* UCS code point */
35449    int n_code;
35450
35451    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35452        mem_base = xmlMemBlocks();
35453        code = gen_int(n_code, 0);
35454
35455        ret_val = xmlUCSIsCJKCompatibility(code);
35456        desret_int(ret_val);
35457        call_tests++;
35458        des_int(n_code, code, 0);
35459        xmlResetLastError();
35460        if (mem_base != xmlMemBlocks()) {
35461            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
35462	           xmlMemBlocks() - mem_base);
35463	    test_ret++;
35464            printf(" %d", n_code);
35465            printf("\n");
35466        }
35467    }
35468    function_tests++;
35469#endif
35470
35471    return(test_ret);
35472}
35473
35474
35475static int
35476test_xmlUCSIsCJKCompatibilityForms(void) {
35477    int test_ret = 0;
35478
35479#if defined(LIBXML_UNICODE_ENABLED)
35480    int mem_base;
35481    int ret_val;
35482    int code; /* UCS code point */
35483    int n_code;
35484
35485    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35486        mem_base = xmlMemBlocks();
35487        code = gen_int(n_code, 0);
35488
35489        ret_val = xmlUCSIsCJKCompatibilityForms(code);
35490        desret_int(ret_val);
35491        call_tests++;
35492        des_int(n_code, code, 0);
35493        xmlResetLastError();
35494        if (mem_base != xmlMemBlocks()) {
35495            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
35496	           xmlMemBlocks() - mem_base);
35497	    test_ret++;
35498            printf(" %d", n_code);
35499            printf("\n");
35500        }
35501    }
35502    function_tests++;
35503#endif
35504
35505    return(test_ret);
35506}
35507
35508
35509static int
35510test_xmlUCSIsCJKCompatibilityIdeographs(void) {
35511    int test_ret = 0;
35512
35513#if defined(LIBXML_UNICODE_ENABLED)
35514    int mem_base;
35515    int ret_val;
35516    int code; /* UCS code point */
35517    int n_code;
35518
35519    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35520        mem_base = xmlMemBlocks();
35521        code = gen_int(n_code, 0);
35522
35523        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
35524        desret_int(ret_val);
35525        call_tests++;
35526        des_int(n_code, code, 0);
35527        xmlResetLastError();
35528        if (mem_base != xmlMemBlocks()) {
35529            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
35530	           xmlMemBlocks() - mem_base);
35531	    test_ret++;
35532            printf(" %d", n_code);
35533            printf("\n");
35534        }
35535    }
35536    function_tests++;
35537#endif
35538
35539    return(test_ret);
35540}
35541
35542
35543static int
35544test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
35545    int test_ret = 0;
35546
35547#if defined(LIBXML_UNICODE_ENABLED)
35548    int mem_base;
35549    int ret_val;
35550    int code; /* UCS code point */
35551    int n_code;
35552
35553    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35554        mem_base = xmlMemBlocks();
35555        code = gen_int(n_code, 0);
35556
35557        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
35558        desret_int(ret_val);
35559        call_tests++;
35560        des_int(n_code, code, 0);
35561        xmlResetLastError();
35562        if (mem_base != xmlMemBlocks()) {
35563            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
35564	           xmlMemBlocks() - mem_base);
35565	    test_ret++;
35566            printf(" %d", n_code);
35567            printf("\n");
35568        }
35569    }
35570    function_tests++;
35571#endif
35572
35573    return(test_ret);
35574}
35575
35576
35577static int
35578test_xmlUCSIsCJKRadicalsSupplement(void) {
35579    int test_ret = 0;
35580
35581#if defined(LIBXML_UNICODE_ENABLED)
35582    int mem_base;
35583    int ret_val;
35584    int code; /* UCS code point */
35585    int n_code;
35586
35587    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35588        mem_base = xmlMemBlocks();
35589        code = gen_int(n_code, 0);
35590
35591        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
35592        desret_int(ret_val);
35593        call_tests++;
35594        des_int(n_code, code, 0);
35595        xmlResetLastError();
35596        if (mem_base != xmlMemBlocks()) {
35597            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
35598	           xmlMemBlocks() - mem_base);
35599	    test_ret++;
35600            printf(" %d", n_code);
35601            printf("\n");
35602        }
35603    }
35604    function_tests++;
35605#endif
35606
35607    return(test_ret);
35608}
35609
35610
35611static int
35612test_xmlUCSIsCJKSymbolsandPunctuation(void) {
35613    int test_ret = 0;
35614
35615#if defined(LIBXML_UNICODE_ENABLED)
35616    int mem_base;
35617    int ret_val;
35618    int code; /* UCS code point */
35619    int n_code;
35620
35621    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35622        mem_base = xmlMemBlocks();
35623        code = gen_int(n_code, 0);
35624
35625        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
35626        desret_int(ret_val);
35627        call_tests++;
35628        des_int(n_code, code, 0);
35629        xmlResetLastError();
35630        if (mem_base != xmlMemBlocks()) {
35631            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
35632	           xmlMemBlocks() - mem_base);
35633	    test_ret++;
35634            printf(" %d", n_code);
35635            printf("\n");
35636        }
35637    }
35638    function_tests++;
35639#endif
35640
35641    return(test_ret);
35642}
35643
35644
35645static int
35646test_xmlUCSIsCJKUnifiedIdeographs(void) {
35647    int test_ret = 0;
35648
35649#if defined(LIBXML_UNICODE_ENABLED)
35650    int mem_base;
35651    int ret_val;
35652    int code; /* UCS code point */
35653    int n_code;
35654
35655    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35656        mem_base = xmlMemBlocks();
35657        code = gen_int(n_code, 0);
35658
35659        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
35660        desret_int(ret_val);
35661        call_tests++;
35662        des_int(n_code, code, 0);
35663        xmlResetLastError();
35664        if (mem_base != xmlMemBlocks()) {
35665            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
35666	           xmlMemBlocks() - mem_base);
35667	    test_ret++;
35668            printf(" %d", n_code);
35669            printf("\n");
35670        }
35671    }
35672    function_tests++;
35673#endif
35674
35675    return(test_ret);
35676}
35677
35678
35679static int
35680test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
35681    int test_ret = 0;
35682
35683#if defined(LIBXML_UNICODE_ENABLED)
35684    int mem_base;
35685    int ret_val;
35686    int code; /* UCS code point */
35687    int n_code;
35688
35689    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35690        mem_base = xmlMemBlocks();
35691        code = gen_int(n_code, 0);
35692
35693        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
35694        desret_int(ret_val);
35695        call_tests++;
35696        des_int(n_code, code, 0);
35697        xmlResetLastError();
35698        if (mem_base != xmlMemBlocks()) {
35699            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
35700	           xmlMemBlocks() - mem_base);
35701	    test_ret++;
35702            printf(" %d", n_code);
35703            printf("\n");
35704        }
35705    }
35706    function_tests++;
35707#endif
35708
35709    return(test_ret);
35710}
35711
35712
35713static int
35714test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
35715    int test_ret = 0;
35716
35717#if defined(LIBXML_UNICODE_ENABLED)
35718    int mem_base;
35719    int ret_val;
35720    int code; /* UCS code point */
35721    int n_code;
35722
35723    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35724        mem_base = xmlMemBlocks();
35725        code = gen_int(n_code, 0);
35726
35727        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
35728        desret_int(ret_val);
35729        call_tests++;
35730        des_int(n_code, code, 0);
35731        xmlResetLastError();
35732        if (mem_base != xmlMemBlocks()) {
35733            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
35734	           xmlMemBlocks() - mem_base);
35735	    test_ret++;
35736            printf(" %d", n_code);
35737            printf("\n");
35738        }
35739    }
35740    function_tests++;
35741#endif
35742
35743    return(test_ret);
35744}
35745
35746
35747static int
35748test_xmlUCSIsCat(void) {
35749    int test_ret = 0;
35750
35751#if defined(LIBXML_UNICODE_ENABLED)
35752    int mem_base;
35753    int ret_val;
35754    int code; /* UCS code point */
35755    int n_code;
35756    char * cat; /* UCS Category name */
35757    int n_cat;
35758
35759    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35760    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
35761        mem_base = xmlMemBlocks();
35762        code = gen_int(n_code, 0);
35763        cat = gen_const_char_ptr(n_cat, 1);
35764
35765        ret_val = xmlUCSIsCat(code, (const char *)cat);
35766        desret_int(ret_val);
35767        call_tests++;
35768        des_int(n_code, code, 0);
35769        des_const_char_ptr(n_cat, (const char *)cat, 1);
35770        xmlResetLastError();
35771        if (mem_base != xmlMemBlocks()) {
35772            printf("Leak of %d blocks found in xmlUCSIsCat",
35773	           xmlMemBlocks() - mem_base);
35774	    test_ret++;
35775            printf(" %d", n_code);
35776            printf(" %d", n_cat);
35777            printf("\n");
35778        }
35779    }
35780    }
35781    function_tests++;
35782#endif
35783
35784    return(test_ret);
35785}
35786
35787
35788static int
35789test_xmlUCSIsCatC(void) {
35790    int test_ret = 0;
35791
35792#if defined(LIBXML_UNICODE_ENABLED)
35793    int mem_base;
35794    int ret_val;
35795    int code; /* UCS code point */
35796    int n_code;
35797
35798    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35799        mem_base = xmlMemBlocks();
35800        code = gen_int(n_code, 0);
35801
35802        ret_val = xmlUCSIsCatC(code);
35803        desret_int(ret_val);
35804        call_tests++;
35805        des_int(n_code, code, 0);
35806        xmlResetLastError();
35807        if (mem_base != xmlMemBlocks()) {
35808            printf("Leak of %d blocks found in xmlUCSIsCatC",
35809	           xmlMemBlocks() - mem_base);
35810	    test_ret++;
35811            printf(" %d", n_code);
35812            printf("\n");
35813        }
35814    }
35815    function_tests++;
35816#endif
35817
35818    return(test_ret);
35819}
35820
35821
35822static int
35823test_xmlUCSIsCatCc(void) {
35824    int test_ret = 0;
35825
35826#if defined(LIBXML_UNICODE_ENABLED)
35827    int mem_base;
35828    int ret_val;
35829    int code; /* UCS code point */
35830    int n_code;
35831
35832    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35833        mem_base = xmlMemBlocks();
35834        code = gen_int(n_code, 0);
35835
35836        ret_val = xmlUCSIsCatCc(code);
35837        desret_int(ret_val);
35838        call_tests++;
35839        des_int(n_code, code, 0);
35840        xmlResetLastError();
35841        if (mem_base != xmlMemBlocks()) {
35842            printf("Leak of %d blocks found in xmlUCSIsCatCc",
35843	           xmlMemBlocks() - mem_base);
35844	    test_ret++;
35845            printf(" %d", n_code);
35846            printf("\n");
35847        }
35848    }
35849    function_tests++;
35850#endif
35851
35852    return(test_ret);
35853}
35854
35855
35856static int
35857test_xmlUCSIsCatCf(void) {
35858    int test_ret = 0;
35859
35860#if defined(LIBXML_UNICODE_ENABLED)
35861    int mem_base;
35862    int ret_val;
35863    int code; /* UCS code point */
35864    int n_code;
35865
35866    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35867        mem_base = xmlMemBlocks();
35868        code = gen_int(n_code, 0);
35869
35870        ret_val = xmlUCSIsCatCf(code);
35871        desret_int(ret_val);
35872        call_tests++;
35873        des_int(n_code, code, 0);
35874        xmlResetLastError();
35875        if (mem_base != xmlMemBlocks()) {
35876            printf("Leak of %d blocks found in xmlUCSIsCatCf",
35877	           xmlMemBlocks() - mem_base);
35878	    test_ret++;
35879            printf(" %d", n_code);
35880            printf("\n");
35881        }
35882    }
35883    function_tests++;
35884#endif
35885
35886    return(test_ret);
35887}
35888
35889
35890static int
35891test_xmlUCSIsCatCo(void) {
35892    int test_ret = 0;
35893
35894#if defined(LIBXML_UNICODE_ENABLED)
35895    int mem_base;
35896    int ret_val;
35897    int code; /* UCS code point */
35898    int n_code;
35899
35900    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35901        mem_base = xmlMemBlocks();
35902        code = gen_int(n_code, 0);
35903
35904        ret_val = xmlUCSIsCatCo(code);
35905        desret_int(ret_val);
35906        call_tests++;
35907        des_int(n_code, code, 0);
35908        xmlResetLastError();
35909        if (mem_base != xmlMemBlocks()) {
35910            printf("Leak of %d blocks found in xmlUCSIsCatCo",
35911	           xmlMemBlocks() - mem_base);
35912	    test_ret++;
35913            printf(" %d", n_code);
35914            printf("\n");
35915        }
35916    }
35917    function_tests++;
35918#endif
35919
35920    return(test_ret);
35921}
35922
35923
35924static int
35925test_xmlUCSIsCatCs(void) {
35926    int test_ret = 0;
35927
35928#if defined(LIBXML_UNICODE_ENABLED)
35929    int mem_base;
35930    int ret_val;
35931    int code; /* UCS code point */
35932    int n_code;
35933
35934    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35935        mem_base = xmlMemBlocks();
35936        code = gen_int(n_code, 0);
35937
35938        ret_val = xmlUCSIsCatCs(code);
35939        desret_int(ret_val);
35940        call_tests++;
35941        des_int(n_code, code, 0);
35942        xmlResetLastError();
35943        if (mem_base != xmlMemBlocks()) {
35944            printf("Leak of %d blocks found in xmlUCSIsCatCs",
35945	           xmlMemBlocks() - mem_base);
35946	    test_ret++;
35947            printf(" %d", n_code);
35948            printf("\n");
35949        }
35950    }
35951    function_tests++;
35952#endif
35953
35954    return(test_ret);
35955}
35956
35957
35958static int
35959test_xmlUCSIsCatL(void) {
35960    int test_ret = 0;
35961
35962#if defined(LIBXML_UNICODE_ENABLED)
35963    int mem_base;
35964    int ret_val;
35965    int code; /* UCS code point */
35966    int n_code;
35967
35968    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35969        mem_base = xmlMemBlocks();
35970        code = gen_int(n_code, 0);
35971
35972        ret_val = xmlUCSIsCatL(code);
35973        desret_int(ret_val);
35974        call_tests++;
35975        des_int(n_code, code, 0);
35976        xmlResetLastError();
35977        if (mem_base != xmlMemBlocks()) {
35978            printf("Leak of %d blocks found in xmlUCSIsCatL",
35979	           xmlMemBlocks() - mem_base);
35980	    test_ret++;
35981            printf(" %d", n_code);
35982            printf("\n");
35983        }
35984    }
35985    function_tests++;
35986#endif
35987
35988    return(test_ret);
35989}
35990
35991
35992static int
35993test_xmlUCSIsCatLl(void) {
35994    int test_ret = 0;
35995
35996#if defined(LIBXML_UNICODE_ENABLED)
35997    int mem_base;
35998    int ret_val;
35999    int code; /* UCS code point */
36000    int n_code;
36001
36002    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36003        mem_base = xmlMemBlocks();
36004        code = gen_int(n_code, 0);
36005
36006        ret_val = xmlUCSIsCatLl(code);
36007        desret_int(ret_val);
36008        call_tests++;
36009        des_int(n_code, code, 0);
36010        xmlResetLastError();
36011        if (mem_base != xmlMemBlocks()) {
36012            printf("Leak of %d blocks found in xmlUCSIsCatLl",
36013	           xmlMemBlocks() - mem_base);
36014	    test_ret++;
36015            printf(" %d", n_code);
36016            printf("\n");
36017        }
36018    }
36019    function_tests++;
36020#endif
36021
36022    return(test_ret);
36023}
36024
36025
36026static int
36027test_xmlUCSIsCatLm(void) {
36028    int test_ret = 0;
36029
36030#if defined(LIBXML_UNICODE_ENABLED)
36031    int mem_base;
36032    int ret_val;
36033    int code; /* UCS code point */
36034    int n_code;
36035
36036    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36037        mem_base = xmlMemBlocks();
36038        code = gen_int(n_code, 0);
36039
36040        ret_val = xmlUCSIsCatLm(code);
36041        desret_int(ret_val);
36042        call_tests++;
36043        des_int(n_code, code, 0);
36044        xmlResetLastError();
36045        if (mem_base != xmlMemBlocks()) {
36046            printf("Leak of %d blocks found in xmlUCSIsCatLm",
36047	           xmlMemBlocks() - mem_base);
36048	    test_ret++;
36049            printf(" %d", n_code);
36050            printf("\n");
36051        }
36052    }
36053    function_tests++;
36054#endif
36055
36056    return(test_ret);
36057}
36058
36059
36060static int
36061test_xmlUCSIsCatLo(void) {
36062    int test_ret = 0;
36063
36064#if defined(LIBXML_UNICODE_ENABLED)
36065    int mem_base;
36066    int ret_val;
36067    int code; /* UCS code point */
36068    int n_code;
36069
36070    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36071        mem_base = xmlMemBlocks();
36072        code = gen_int(n_code, 0);
36073
36074        ret_val = xmlUCSIsCatLo(code);
36075        desret_int(ret_val);
36076        call_tests++;
36077        des_int(n_code, code, 0);
36078        xmlResetLastError();
36079        if (mem_base != xmlMemBlocks()) {
36080            printf("Leak of %d blocks found in xmlUCSIsCatLo",
36081	           xmlMemBlocks() - mem_base);
36082	    test_ret++;
36083            printf(" %d", n_code);
36084            printf("\n");
36085        }
36086    }
36087    function_tests++;
36088#endif
36089
36090    return(test_ret);
36091}
36092
36093
36094static int
36095test_xmlUCSIsCatLt(void) {
36096    int test_ret = 0;
36097
36098#if defined(LIBXML_UNICODE_ENABLED)
36099    int mem_base;
36100    int ret_val;
36101    int code; /* UCS code point */
36102    int n_code;
36103
36104    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36105        mem_base = xmlMemBlocks();
36106        code = gen_int(n_code, 0);
36107
36108        ret_val = xmlUCSIsCatLt(code);
36109        desret_int(ret_val);
36110        call_tests++;
36111        des_int(n_code, code, 0);
36112        xmlResetLastError();
36113        if (mem_base != xmlMemBlocks()) {
36114            printf("Leak of %d blocks found in xmlUCSIsCatLt",
36115	           xmlMemBlocks() - mem_base);
36116	    test_ret++;
36117            printf(" %d", n_code);
36118            printf("\n");
36119        }
36120    }
36121    function_tests++;
36122#endif
36123
36124    return(test_ret);
36125}
36126
36127
36128static int
36129test_xmlUCSIsCatLu(void) {
36130    int test_ret = 0;
36131
36132#if defined(LIBXML_UNICODE_ENABLED)
36133    int mem_base;
36134    int ret_val;
36135    int code; /* UCS code point */
36136    int n_code;
36137
36138    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36139        mem_base = xmlMemBlocks();
36140        code = gen_int(n_code, 0);
36141
36142        ret_val = xmlUCSIsCatLu(code);
36143        desret_int(ret_val);
36144        call_tests++;
36145        des_int(n_code, code, 0);
36146        xmlResetLastError();
36147        if (mem_base != xmlMemBlocks()) {
36148            printf("Leak of %d blocks found in xmlUCSIsCatLu",
36149	           xmlMemBlocks() - mem_base);
36150	    test_ret++;
36151            printf(" %d", n_code);
36152            printf("\n");
36153        }
36154    }
36155    function_tests++;
36156#endif
36157
36158    return(test_ret);
36159}
36160
36161
36162static int
36163test_xmlUCSIsCatM(void) {
36164    int test_ret = 0;
36165
36166#if defined(LIBXML_UNICODE_ENABLED)
36167    int mem_base;
36168    int ret_val;
36169    int code; /* UCS code point */
36170    int n_code;
36171
36172    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36173        mem_base = xmlMemBlocks();
36174        code = gen_int(n_code, 0);
36175
36176        ret_val = xmlUCSIsCatM(code);
36177        desret_int(ret_val);
36178        call_tests++;
36179        des_int(n_code, code, 0);
36180        xmlResetLastError();
36181        if (mem_base != xmlMemBlocks()) {
36182            printf("Leak of %d blocks found in xmlUCSIsCatM",
36183	           xmlMemBlocks() - mem_base);
36184	    test_ret++;
36185            printf(" %d", n_code);
36186            printf("\n");
36187        }
36188    }
36189    function_tests++;
36190#endif
36191
36192    return(test_ret);
36193}
36194
36195
36196static int
36197test_xmlUCSIsCatMc(void) {
36198    int test_ret = 0;
36199
36200#if defined(LIBXML_UNICODE_ENABLED)
36201    int mem_base;
36202    int ret_val;
36203    int code; /* UCS code point */
36204    int n_code;
36205
36206    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36207        mem_base = xmlMemBlocks();
36208        code = gen_int(n_code, 0);
36209
36210        ret_val = xmlUCSIsCatMc(code);
36211        desret_int(ret_val);
36212        call_tests++;
36213        des_int(n_code, code, 0);
36214        xmlResetLastError();
36215        if (mem_base != xmlMemBlocks()) {
36216            printf("Leak of %d blocks found in xmlUCSIsCatMc",
36217	           xmlMemBlocks() - mem_base);
36218	    test_ret++;
36219            printf(" %d", n_code);
36220            printf("\n");
36221        }
36222    }
36223    function_tests++;
36224#endif
36225
36226    return(test_ret);
36227}
36228
36229
36230static int
36231test_xmlUCSIsCatMe(void) {
36232    int test_ret = 0;
36233
36234#if defined(LIBXML_UNICODE_ENABLED)
36235    int mem_base;
36236    int ret_val;
36237    int code; /* UCS code point */
36238    int n_code;
36239
36240    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36241        mem_base = xmlMemBlocks();
36242        code = gen_int(n_code, 0);
36243
36244        ret_val = xmlUCSIsCatMe(code);
36245        desret_int(ret_val);
36246        call_tests++;
36247        des_int(n_code, code, 0);
36248        xmlResetLastError();
36249        if (mem_base != xmlMemBlocks()) {
36250            printf("Leak of %d blocks found in xmlUCSIsCatMe",
36251	           xmlMemBlocks() - mem_base);
36252	    test_ret++;
36253            printf(" %d", n_code);
36254            printf("\n");
36255        }
36256    }
36257    function_tests++;
36258#endif
36259
36260    return(test_ret);
36261}
36262
36263
36264static int
36265test_xmlUCSIsCatMn(void) {
36266    int test_ret = 0;
36267
36268#if defined(LIBXML_UNICODE_ENABLED)
36269    int mem_base;
36270    int ret_val;
36271    int code; /* UCS code point */
36272    int n_code;
36273
36274    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36275        mem_base = xmlMemBlocks();
36276        code = gen_int(n_code, 0);
36277
36278        ret_val = xmlUCSIsCatMn(code);
36279        desret_int(ret_val);
36280        call_tests++;
36281        des_int(n_code, code, 0);
36282        xmlResetLastError();
36283        if (mem_base != xmlMemBlocks()) {
36284            printf("Leak of %d blocks found in xmlUCSIsCatMn",
36285	           xmlMemBlocks() - mem_base);
36286	    test_ret++;
36287            printf(" %d", n_code);
36288            printf("\n");
36289        }
36290    }
36291    function_tests++;
36292#endif
36293
36294    return(test_ret);
36295}
36296
36297
36298static int
36299test_xmlUCSIsCatN(void) {
36300    int test_ret = 0;
36301
36302#if defined(LIBXML_UNICODE_ENABLED)
36303    int mem_base;
36304    int ret_val;
36305    int code; /* UCS code point */
36306    int n_code;
36307
36308    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36309        mem_base = xmlMemBlocks();
36310        code = gen_int(n_code, 0);
36311
36312        ret_val = xmlUCSIsCatN(code);
36313        desret_int(ret_val);
36314        call_tests++;
36315        des_int(n_code, code, 0);
36316        xmlResetLastError();
36317        if (mem_base != xmlMemBlocks()) {
36318            printf("Leak of %d blocks found in xmlUCSIsCatN",
36319	           xmlMemBlocks() - mem_base);
36320	    test_ret++;
36321            printf(" %d", n_code);
36322            printf("\n");
36323        }
36324    }
36325    function_tests++;
36326#endif
36327
36328    return(test_ret);
36329}
36330
36331
36332static int
36333test_xmlUCSIsCatNd(void) {
36334    int test_ret = 0;
36335
36336#if defined(LIBXML_UNICODE_ENABLED)
36337    int mem_base;
36338    int ret_val;
36339    int code; /* UCS code point */
36340    int n_code;
36341
36342    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36343        mem_base = xmlMemBlocks();
36344        code = gen_int(n_code, 0);
36345
36346        ret_val = xmlUCSIsCatNd(code);
36347        desret_int(ret_val);
36348        call_tests++;
36349        des_int(n_code, code, 0);
36350        xmlResetLastError();
36351        if (mem_base != xmlMemBlocks()) {
36352            printf("Leak of %d blocks found in xmlUCSIsCatNd",
36353	           xmlMemBlocks() - mem_base);
36354	    test_ret++;
36355            printf(" %d", n_code);
36356            printf("\n");
36357        }
36358    }
36359    function_tests++;
36360#endif
36361
36362    return(test_ret);
36363}
36364
36365
36366static int
36367test_xmlUCSIsCatNl(void) {
36368    int test_ret = 0;
36369
36370#if defined(LIBXML_UNICODE_ENABLED)
36371    int mem_base;
36372    int ret_val;
36373    int code; /* UCS code point */
36374    int n_code;
36375
36376    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36377        mem_base = xmlMemBlocks();
36378        code = gen_int(n_code, 0);
36379
36380        ret_val = xmlUCSIsCatNl(code);
36381        desret_int(ret_val);
36382        call_tests++;
36383        des_int(n_code, code, 0);
36384        xmlResetLastError();
36385        if (mem_base != xmlMemBlocks()) {
36386            printf("Leak of %d blocks found in xmlUCSIsCatNl",
36387	           xmlMemBlocks() - mem_base);
36388	    test_ret++;
36389            printf(" %d", n_code);
36390            printf("\n");
36391        }
36392    }
36393    function_tests++;
36394#endif
36395
36396    return(test_ret);
36397}
36398
36399
36400static int
36401test_xmlUCSIsCatNo(void) {
36402    int test_ret = 0;
36403
36404#if defined(LIBXML_UNICODE_ENABLED)
36405    int mem_base;
36406    int ret_val;
36407    int code; /* UCS code point */
36408    int n_code;
36409
36410    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36411        mem_base = xmlMemBlocks();
36412        code = gen_int(n_code, 0);
36413
36414        ret_val = xmlUCSIsCatNo(code);
36415        desret_int(ret_val);
36416        call_tests++;
36417        des_int(n_code, code, 0);
36418        xmlResetLastError();
36419        if (mem_base != xmlMemBlocks()) {
36420            printf("Leak of %d blocks found in xmlUCSIsCatNo",
36421	           xmlMemBlocks() - mem_base);
36422	    test_ret++;
36423            printf(" %d", n_code);
36424            printf("\n");
36425        }
36426    }
36427    function_tests++;
36428#endif
36429
36430    return(test_ret);
36431}
36432
36433
36434static int
36435test_xmlUCSIsCatP(void) {
36436    int test_ret = 0;
36437
36438#if defined(LIBXML_UNICODE_ENABLED)
36439    int mem_base;
36440    int ret_val;
36441    int code; /* UCS code point */
36442    int n_code;
36443
36444    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36445        mem_base = xmlMemBlocks();
36446        code = gen_int(n_code, 0);
36447
36448        ret_val = xmlUCSIsCatP(code);
36449        desret_int(ret_val);
36450        call_tests++;
36451        des_int(n_code, code, 0);
36452        xmlResetLastError();
36453        if (mem_base != xmlMemBlocks()) {
36454            printf("Leak of %d blocks found in xmlUCSIsCatP",
36455	           xmlMemBlocks() - mem_base);
36456	    test_ret++;
36457            printf(" %d", n_code);
36458            printf("\n");
36459        }
36460    }
36461    function_tests++;
36462#endif
36463
36464    return(test_ret);
36465}
36466
36467
36468static int
36469test_xmlUCSIsCatPc(void) {
36470    int test_ret = 0;
36471
36472#if defined(LIBXML_UNICODE_ENABLED)
36473    int mem_base;
36474    int ret_val;
36475    int code; /* UCS code point */
36476    int n_code;
36477
36478    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36479        mem_base = xmlMemBlocks();
36480        code = gen_int(n_code, 0);
36481
36482        ret_val = xmlUCSIsCatPc(code);
36483        desret_int(ret_val);
36484        call_tests++;
36485        des_int(n_code, code, 0);
36486        xmlResetLastError();
36487        if (mem_base != xmlMemBlocks()) {
36488            printf("Leak of %d blocks found in xmlUCSIsCatPc",
36489	           xmlMemBlocks() - mem_base);
36490	    test_ret++;
36491            printf(" %d", n_code);
36492            printf("\n");
36493        }
36494    }
36495    function_tests++;
36496#endif
36497
36498    return(test_ret);
36499}
36500
36501
36502static int
36503test_xmlUCSIsCatPd(void) {
36504    int test_ret = 0;
36505
36506#if defined(LIBXML_UNICODE_ENABLED)
36507    int mem_base;
36508    int ret_val;
36509    int code; /* UCS code point */
36510    int n_code;
36511
36512    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36513        mem_base = xmlMemBlocks();
36514        code = gen_int(n_code, 0);
36515
36516        ret_val = xmlUCSIsCatPd(code);
36517        desret_int(ret_val);
36518        call_tests++;
36519        des_int(n_code, code, 0);
36520        xmlResetLastError();
36521        if (mem_base != xmlMemBlocks()) {
36522            printf("Leak of %d blocks found in xmlUCSIsCatPd",
36523	           xmlMemBlocks() - mem_base);
36524	    test_ret++;
36525            printf(" %d", n_code);
36526            printf("\n");
36527        }
36528    }
36529    function_tests++;
36530#endif
36531
36532    return(test_ret);
36533}
36534
36535
36536static int
36537test_xmlUCSIsCatPe(void) {
36538    int test_ret = 0;
36539
36540#if defined(LIBXML_UNICODE_ENABLED)
36541    int mem_base;
36542    int ret_val;
36543    int code; /* UCS code point */
36544    int n_code;
36545
36546    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36547        mem_base = xmlMemBlocks();
36548        code = gen_int(n_code, 0);
36549
36550        ret_val = xmlUCSIsCatPe(code);
36551        desret_int(ret_val);
36552        call_tests++;
36553        des_int(n_code, code, 0);
36554        xmlResetLastError();
36555        if (mem_base != xmlMemBlocks()) {
36556            printf("Leak of %d blocks found in xmlUCSIsCatPe",
36557	           xmlMemBlocks() - mem_base);
36558	    test_ret++;
36559            printf(" %d", n_code);
36560            printf("\n");
36561        }
36562    }
36563    function_tests++;
36564#endif
36565
36566    return(test_ret);
36567}
36568
36569
36570static int
36571test_xmlUCSIsCatPf(void) {
36572    int test_ret = 0;
36573
36574#if defined(LIBXML_UNICODE_ENABLED)
36575    int mem_base;
36576    int ret_val;
36577    int code; /* UCS code point */
36578    int n_code;
36579
36580    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36581        mem_base = xmlMemBlocks();
36582        code = gen_int(n_code, 0);
36583
36584        ret_val = xmlUCSIsCatPf(code);
36585        desret_int(ret_val);
36586        call_tests++;
36587        des_int(n_code, code, 0);
36588        xmlResetLastError();
36589        if (mem_base != xmlMemBlocks()) {
36590            printf("Leak of %d blocks found in xmlUCSIsCatPf",
36591	           xmlMemBlocks() - mem_base);
36592	    test_ret++;
36593            printf(" %d", n_code);
36594            printf("\n");
36595        }
36596    }
36597    function_tests++;
36598#endif
36599
36600    return(test_ret);
36601}
36602
36603
36604static int
36605test_xmlUCSIsCatPi(void) {
36606    int test_ret = 0;
36607
36608#if defined(LIBXML_UNICODE_ENABLED)
36609    int mem_base;
36610    int ret_val;
36611    int code; /* UCS code point */
36612    int n_code;
36613
36614    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36615        mem_base = xmlMemBlocks();
36616        code = gen_int(n_code, 0);
36617
36618        ret_val = xmlUCSIsCatPi(code);
36619        desret_int(ret_val);
36620        call_tests++;
36621        des_int(n_code, code, 0);
36622        xmlResetLastError();
36623        if (mem_base != xmlMemBlocks()) {
36624            printf("Leak of %d blocks found in xmlUCSIsCatPi",
36625	           xmlMemBlocks() - mem_base);
36626	    test_ret++;
36627            printf(" %d", n_code);
36628            printf("\n");
36629        }
36630    }
36631    function_tests++;
36632#endif
36633
36634    return(test_ret);
36635}
36636
36637
36638static int
36639test_xmlUCSIsCatPo(void) {
36640    int test_ret = 0;
36641
36642#if defined(LIBXML_UNICODE_ENABLED)
36643    int mem_base;
36644    int ret_val;
36645    int code; /* UCS code point */
36646    int n_code;
36647
36648    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36649        mem_base = xmlMemBlocks();
36650        code = gen_int(n_code, 0);
36651
36652        ret_val = xmlUCSIsCatPo(code);
36653        desret_int(ret_val);
36654        call_tests++;
36655        des_int(n_code, code, 0);
36656        xmlResetLastError();
36657        if (mem_base != xmlMemBlocks()) {
36658            printf("Leak of %d blocks found in xmlUCSIsCatPo",
36659	           xmlMemBlocks() - mem_base);
36660	    test_ret++;
36661            printf(" %d", n_code);
36662            printf("\n");
36663        }
36664    }
36665    function_tests++;
36666#endif
36667
36668    return(test_ret);
36669}
36670
36671
36672static int
36673test_xmlUCSIsCatPs(void) {
36674    int test_ret = 0;
36675
36676#if defined(LIBXML_UNICODE_ENABLED)
36677    int mem_base;
36678    int ret_val;
36679    int code; /* UCS code point */
36680    int n_code;
36681
36682    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36683        mem_base = xmlMemBlocks();
36684        code = gen_int(n_code, 0);
36685
36686        ret_val = xmlUCSIsCatPs(code);
36687        desret_int(ret_val);
36688        call_tests++;
36689        des_int(n_code, code, 0);
36690        xmlResetLastError();
36691        if (mem_base != xmlMemBlocks()) {
36692            printf("Leak of %d blocks found in xmlUCSIsCatPs",
36693	           xmlMemBlocks() - mem_base);
36694	    test_ret++;
36695            printf(" %d", n_code);
36696            printf("\n");
36697        }
36698    }
36699    function_tests++;
36700#endif
36701
36702    return(test_ret);
36703}
36704
36705
36706static int
36707test_xmlUCSIsCatS(void) {
36708    int test_ret = 0;
36709
36710#if defined(LIBXML_UNICODE_ENABLED)
36711    int mem_base;
36712    int ret_val;
36713    int code; /* UCS code point */
36714    int n_code;
36715
36716    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36717        mem_base = xmlMemBlocks();
36718        code = gen_int(n_code, 0);
36719
36720        ret_val = xmlUCSIsCatS(code);
36721        desret_int(ret_val);
36722        call_tests++;
36723        des_int(n_code, code, 0);
36724        xmlResetLastError();
36725        if (mem_base != xmlMemBlocks()) {
36726            printf("Leak of %d blocks found in xmlUCSIsCatS",
36727	           xmlMemBlocks() - mem_base);
36728	    test_ret++;
36729            printf(" %d", n_code);
36730            printf("\n");
36731        }
36732    }
36733    function_tests++;
36734#endif
36735
36736    return(test_ret);
36737}
36738
36739
36740static int
36741test_xmlUCSIsCatSc(void) {
36742    int test_ret = 0;
36743
36744#if defined(LIBXML_UNICODE_ENABLED)
36745    int mem_base;
36746    int ret_val;
36747    int code; /* UCS code point */
36748    int n_code;
36749
36750    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36751        mem_base = xmlMemBlocks();
36752        code = gen_int(n_code, 0);
36753
36754        ret_val = xmlUCSIsCatSc(code);
36755        desret_int(ret_val);
36756        call_tests++;
36757        des_int(n_code, code, 0);
36758        xmlResetLastError();
36759        if (mem_base != xmlMemBlocks()) {
36760            printf("Leak of %d blocks found in xmlUCSIsCatSc",
36761	           xmlMemBlocks() - mem_base);
36762	    test_ret++;
36763            printf(" %d", n_code);
36764            printf("\n");
36765        }
36766    }
36767    function_tests++;
36768#endif
36769
36770    return(test_ret);
36771}
36772
36773
36774static int
36775test_xmlUCSIsCatSk(void) {
36776    int test_ret = 0;
36777
36778#if defined(LIBXML_UNICODE_ENABLED)
36779    int mem_base;
36780    int ret_val;
36781    int code; /* UCS code point */
36782    int n_code;
36783
36784    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36785        mem_base = xmlMemBlocks();
36786        code = gen_int(n_code, 0);
36787
36788        ret_val = xmlUCSIsCatSk(code);
36789        desret_int(ret_val);
36790        call_tests++;
36791        des_int(n_code, code, 0);
36792        xmlResetLastError();
36793        if (mem_base != xmlMemBlocks()) {
36794            printf("Leak of %d blocks found in xmlUCSIsCatSk",
36795	           xmlMemBlocks() - mem_base);
36796	    test_ret++;
36797            printf(" %d", n_code);
36798            printf("\n");
36799        }
36800    }
36801    function_tests++;
36802#endif
36803
36804    return(test_ret);
36805}
36806
36807
36808static int
36809test_xmlUCSIsCatSm(void) {
36810    int test_ret = 0;
36811
36812#if defined(LIBXML_UNICODE_ENABLED)
36813    int mem_base;
36814    int ret_val;
36815    int code; /* UCS code point */
36816    int n_code;
36817
36818    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36819        mem_base = xmlMemBlocks();
36820        code = gen_int(n_code, 0);
36821
36822        ret_val = xmlUCSIsCatSm(code);
36823        desret_int(ret_val);
36824        call_tests++;
36825        des_int(n_code, code, 0);
36826        xmlResetLastError();
36827        if (mem_base != xmlMemBlocks()) {
36828            printf("Leak of %d blocks found in xmlUCSIsCatSm",
36829	           xmlMemBlocks() - mem_base);
36830	    test_ret++;
36831            printf(" %d", n_code);
36832            printf("\n");
36833        }
36834    }
36835    function_tests++;
36836#endif
36837
36838    return(test_ret);
36839}
36840
36841
36842static int
36843test_xmlUCSIsCatSo(void) {
36844    int test_ret = 0;
36845
36846#if defined(LIBXML_UNICODE_ENABLED)
36847    int mem_base;
36848    int ret_val;
36849    int code; /* UCS code point */
36850    int n_code;
36851
36852    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36853        mem_base = xmlMemBlocks();
36854        code = gen_int(n_code, 0);
36855
36856        ret_val = xmlUCSIsCatSo(code);
36857        desret_int(ret_val);
36858        call_tests++;
36859        des_int(n_code, code, 0);
36860        xmlResetLastError();
36861        if (mem_base != xmlMemBlocks()) {
36862            printf("Leak of %d blocks found in xmlUCSIsCatSo",
36863	           xmlMemBlocks() - mem_base);
36864	    test_ret++;
36865            printf(" %d", n_code);
36866            printf("\n");
36867        }
36868    }
36869    function_tests++;
36870#endif
36871
36872    return(test_ret);
36873}
36874
36875
36876static int
36877test_xmlUCSIsCatZ(void) {
36878    int test_ret = 0;
36879
36880#if defined(LIBXML_UNICODE_ENABLED)
36881    int mem_base;
36882    int ret_val;
36883    int code; /* UCS code point */
36884    int n_code;
36885
36886    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36887        mem_base = xmlMemBlocks();
36888        code = gen_int(n_code, 0);
36889
36890        ret_val = xmlUCSIsCatZ(code);
36891        desret_int(ret_val);
36892        call_tests++;
36893        des_int(n_code, code, 0);
36894        xmlResetLastError();
36895        if (mem_base != xmlMemBlocks()) {
36896            printf("Leak of %d blocks found in xmlUCSIsCatZ",
36897	           xmlMemBlocks() - mem_base);
36898	    test_ret++;
36899            printf(" %d", n_code);
36900            printf("\n");
36901        }
36902    }
36903    function_tests++;
36904#endif
36905
36906    return(test_ret);
36907}
36908
36909
36910static int
36911test_xmlUCSIsCatZl(void) {
36912    int test_ret = 0;
36913
36914#if defined(LIBXML_UNICODE_ENABLED)
36915    int mem_base;
36916    int ret_val;
36917    int code; /* UCS code point */
36918    int n_code;
36919
36920    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36921        mem_base = xmlMemBlocks();
36922        code = gen_int(n_code, 0);
36923
36924        ret_val = xmlUCSIsCatZl(code);
36925        desret_int(ret_val);
36926        call_tests++;
36927        des_int(n_code, code, 0);
36928        xmlResetLastError();
36929        if (mem_base != xmlMemBlocks()) {
36930            printf("Leak of %d blocks found in xmlUCSIsCatZl",
36931	           xmlMemBlocks() - mem_base);
36932	    test_ret++;
36933            printf(" %d", n_code);
36934            printf("\n");
36935        }
36936    }
36937    function_tests++;
36938#endif
36939
36940    return(test_ret);
36941}
36942
36943
36944static int
36945test_xmlUCSIsCatZp(void) {
36946    int test_ret = 0;
36947
36948#if defined(LIBXML_UNICODE_ENABLED)
36949    int mem_base;
36950    int ret_val;
36951    int code; /* UCS code point */
36952    int n_code;
36953
36954    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36955        mem_base = xmlMemBlocks();
36956        code = gen_int(n_code, 0);
36957
36958        ret_val = xmlUCSIsCatZp(code);
36959        desret_int(ret_val);
36960        call_tests++;
36961        des_int(n_code, code, 0);
36962        xmlResetLastError();
36963        if (mem_base != xmlMemBlocks()) {
36964            printf("Leak of %d blocks found in xmlUCSIsCatZp",
36965	           xmlMemBlocks() - mem_base);
36966	    test_ret++;
36967            printf(" %d", n_code);
36968            printf("\n");
36969        }
36970    }
36971    function_tests++;
36972#endif
36973
36974    return(test_ret);
36975}
36976
36977
36978static int
36979test_xmlUCSIsCatZs(void) {
36980    int test_ret = 0;
36981
36982#if defined(LIBXML_UNICODE_ENABLED)
36983    int mem_base;
36984    int ret_val;
36985    int code; /* UCS code point */
36986    int n_code;
36987
36988    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36989        mem_base = xmlMemBlocks();
36990        code = gen_int(n_code, 0);
36991
36992        ret_val = xmlUCSIsCatZs(code);
36993        desret_int(ret_val);
36994        call_tests++;
36995        des_int(n_code, code, 0);
36996        xmlResetLastError();
36997        if (mem_base != xmlMemBlocks()) {
36998            printf("Leak of %d blocks found in xmlUCSIsCatZs",
36999	           xmlMemBlocks() - mem_base);
37000	    test_ret++;
37001            printf(" %d", n_code);
37002            printf("\n");
37003        }
37004    }
37005    function_tests++;
37006#endif
37007
37008    return(test_ret);
37009}
37010
37011
37012static int
37013test_xmlUCSIsCherokee(void) {
37014    int test_ret = 0;
37015
37016#if defined(LIBXML_UNICODE_ENABLED)
37017    int mem_base;
37018    int ret_val;
37019    int code; /* UCS code point */
37020    int n_code;
37021
37022    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37023        mem_base = xmlMemBlocks();
37024        code = gen_int(n_code, 0);
37025
37026        ret_val = xmlUCSIsCherokee(code);
37027        desret_int(ret_val);
37028        call_tests++;
37029        des_int(n_code, code, 0);
37030        xmlResetLastError();
37031        if (mem_base != xmlMemBlocks()) {
37032            printf("Leak of %d blocks found in xmlUCSIsCherokee",
37033	           xmlMemBlocks() - mem_base);
37034	    test_ret++;
37035            printf(" %d", n_code);
37036            printf("\n");
37037        }
37038    }
37039    function_tests++;
37040#endif
37041
37042    return(test_ret);
37043}
37044
37045
37046static int
37047test_xmlUCSIsCombiningDiacriticalMarks(void) {
37048    int test_ret = 0;
37049
37050#if defined(LIBXML_UNICODE_ENABLED)
37051    int mem_base;
37052    int ret_val;
37053    int code; /* UCS code point */
37054    int n_code;
37055
37056    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37057        mem_base = xmlMemBlocks();
37058        code = gen_int(n_code, 0);
37059
37060        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
37061        desret_int(ret_val);
37062        call_tests++;
37063        des_int(n_code, code, 0);
37064        xmlResetLastError();
37065        if (mem_base != xmlMemBlocks()) {
37066            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
37067	           xmlMemBlocks() - mem_base);
37068	    test_ret++;
37069            printf(" %d", n_code);
37070            printf("\n");
37071        }
37072    }
37073    function_tests++;
37074#endif
37075
37076    return(test_ret);
37077}
37078
37079
37080static int
37081test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
37082    int test_ret = 0;
37083
37084#if defined(LIBXML_UNICODE_ENABLED)
37085    int mem_base;
37086    int ret_val;
37087    int code; /* UCS code point */
37088    int n_code;
37089
37090    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37091        mem_base = xmlMemBlocks();
37092        code = gen_int(n_code, 0);
37093
37094        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
37095        desret_int(ret_val);
37096        call_tests++;
37097        des_int(n_code, code, 0);
37098        xmlResetLastError();
37099        if (mem_base != xmlMemBlocks()) {
37100            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
37101	           xmlMemBlocks() - mem_base);
37102	    test_ret++;
37103            printf(" %d", n_code);
37104            printf("\n");
37105        }
37106    }
37107    function_tests++;
37108#endif
37109
37110    return(test_ret);
37111}
37112
37113
37114static int
37115test_xmlUCSIsCombiningHalfMarks(void) {
37116    int test_ret = 0;
37117
37118#if defined(LIBXML_UNICODE_ENABLED)
37119    int mem_base;
37120    int ret_val;
37121    int code; /* UCS code point */
37122    int n_code;
37123
37124    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37125        mem_base = xmlMemBlocks();
37126        code = gen_int(n_code, 0);
37127
37128        ret_val = xmlUCSIsCombiningHalfMarks(code);
37129        desret_int(ret_val);
37130        call_tests++;
37131        des_int(n_code, code, 0);
37132        xmlResetLastError();
37133        if (mem_base != xmlMemBlocks()) {
37134            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
37135	           xmlMemBlocks() - mem_base);
37136	    test_ret++;
37137            printf(" %d", n_code);
37138            printf("\n");
37139        }
37140    }
37141    function_tests++;
37142#endif
37143
37144    return(test_ret);
37145}
37146
37147
37148static int
37149test_xmlUCSIsCombiningMarksforSymbols(void) {
37150    int test_ret = 0;
37151
37152#if defined(LIBXML_UNICODE_ENABLED)
37153    int mem_base;
37154    int ret_val;
37155    int code; /* UCS code point */
37156    int n_code;
37157
37158    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37159        mem_base = xmlMemBlocks();
37160        code = gen_int(n_code, 0);
37161
37162        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
37163        desret_int(ret_val);
37164        call_tests++;
37165        des_int(n_code, code, 0);
37166        xmlResetLastError();
37167        if (mem_base != xmlMemBlocks()) {
37168            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
37169	           xmlMemBlocks() - mem_base);
37170	    test_ret++;
37171            printf(" %d", n_code);
37172            printf("\n");
37173        }
37174    }
37175    function_tests++;
37176#endif
37177
37178    return(test_ret);
37179}
37180
37181
37182static int
37183test_xmlUCSIsControlPictures(void) {
37184    int test_ret = 0;
37185
37186#if defined(LIBXML_UNICODE_ENABLED)
37187    int mem_base;
37188    int ret_val;
37189    int code; /* UCS code point */
37190    int n_code;
37191
37192    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37193        mem_base = xmlMemBlocks();
37194        code = gen_int(n_code, 0);
37195
37196        ret_val = xmlUCSIsControlPictures(code);
37197        desret_int(ret_val);
37198        call_tests++;
37199        des_int(n_code, code, 0);
37200        xmlResetLastError();
37201        if (mem_base != xmlMemBlocks()) {
37202            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
37203	           xmlMemBlocks() - mem_base);
37204	    test_ret++;
37205            printf(" %d", n_code);
37206            printf("\n");
37207        }
37208    }
37209    function_tests++;
37210#endif
37211
37212    return(test_ret);
37213}
37214
37215
37216static int
37217test_xmlUCSIsCurrencySymbols(void) {
37218    int test_ret = 0;
37219
37220#if defined(LIBXML_UNICODE_ENABLED)
37221    int mem_base;
37222    int ret_val;
37223    int code; /* UCS code point */
37224    int n_code;
37225
37226    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37227        mem_base = xmlMemBlocks();
37228        code = gen_int(n_code, 0);
37229
37230        ret_val = xmlUCSIsCurrencySymbols(code);
37231        desret_int(ret_val);
37232        call_tests++;
37233        des_int(n_code, code, 0);
37234        xmlResetLastError();
37235        if (mem_base != xmlMemBlocks()) {
37236            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
37237	           xmlMemBlocks() - mem_base);
37238	    test_ret++;
37239            printf(" %d", n_code);
37240            printf("\n");
37241        }
37242    }
37243    function_tests++;
37244#endif
37245
37246    return(test_ret);
37247}
37248
37249
37250static int
37251test_xmlUCSIsCypriotSyllabary(void) {
37252    int test_ret = 0;
37253
37254#if defined(LIBXML_UNICODE_ENABLED)
37255    int mem_base;
37256    int ret_val;
37257    int code; /* UCS code point */
37258    int n_code;
37259
37260    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37261        mem_base = xmlMemBlocks();
37262        code = gen_int(n_code, 0);
37263
37264        ret_val = xmlUCSIsCypriotSyllabary(code);
37265        desret_int(ret_val);
37266        call_tests++;
37267        des_int(n_code, code, 0);
37268        xmlResetLastError();
37269        if (mem_base != xmlMemBlocks()) {
37270            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
37271	           xmlMemBlocks() - mem_base);
37272	    test_ret++;
37273            printf(" %d", n_code);
37274            printf("\n");
37275        }
37276    }
37277    function_tests++;
37278#endif
37279
37280    return(test_ret);
37281}
37282
37283
37284static int
37285test_xmlUCSIsCyrillic(void) {
37286    int test_ret = 0;
37287
37288#if defined(LIBXML_UNICODE_ENABLED)
37289    int mem_base;
37290    int ret_val;
37291    int code; /* UCS code point */
37292    int n_code;
37293
37294    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37295        mem_base = xmlMemBlocks();
37296        code = gen_int(n_code, 0);
37297
37298        ret_val = xmlUCSIsCyrillic(code);
37299        desret_int(ret_val);
37300        call_tests++;
37301        des_int(n_code, code, 0);
37302        xmlResetLastError();
37303        if (mem_base != xmlMemBlocks()) {
37304            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
37305	           xmlMemBlocks() - mem_base);
37306	    test_ret++;
37307            printf(" %d", n_code);
37308            printf("\n");
37309        }
37310    }
37311    function_tests++;
37312#endif
37313
37314    return(test_ret);
37315}
37316
37317
37318static int
37319test_xmlUCSIsCyrillicSupplement(void) {
37320    int test_ret = 0;
37321
37322#if defined(LIBXML_UNICODE_ENABLED)
37323    int mem_base;
37324    int ret_val;
37325    int code; /* UCS code point */
37326    int n_code;
37327
37328    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37329        mem_base = xmlMemBlocks();
37330        code = gen_int(n_code, 0);
37331
37332        ret_val = xmlUCSIsCyrillicSupplement(code);
37333        desret_int(ret_val);
37334        call_tests++;
37335        des_int(n_code, code, 0);
37336        xmlResetLastError();
37337        if (mem_base != xmlMemBlocks()) {
37338            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
37339	           xmlMemBlocks() - mem_base);
37340	    test_ret++;
37341            printf(" %d", n_code);
37342            printf("\n");
37343        }
37344    }
37345    function_tests++;
37346#endif
37347
37348    return(test_ret);
37349}
37350
37351
37352static int
37353test_xmlUCSIsDeseret(void) {
37354    int test_ret = 0;
37355
37356#if defined(LIBXML_UNICODE_ENABLED)
37357    int mem_base;
37358    int ret_val;
37359    int code; /* UCS code point */
37360    int n_code;
37361
37362    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37363        mem_base = xmlMemBlocks();
37364        code = gen_int(n_code, 0);
37365
37366        ret_val = xmlUCSIsDeseret(code);
37367        desret_int(ret_val);
37368        call_tests++;
37369        des_int(n_code, code, 0);
37370        xmlResetLastError();
37371        if (mem_base != xmlMemBlocks()) {
37372            printf("Leak of %d blocks found in xmlUCSIsDeseret",
37373	           xmlMemBlocks() - mem_base);
37374	    test_ret++;
37375            printf(" %d", n_code);
37376            printf("\n");
37377        }
37378    }
37379    function_tests++;
37380#endif
37381
37382    return(test_ret);
37383}
37384
37385
37386static int
37387test_xmlUCSIsDevanagari(void) {
37388    int test_ret = 0;
37389
37390#if defined(LIBXML_UNICODE_ENABLED)
37391    int mem_base;
37392    int ret_val;
37393    int code; /* UCS code point */
37394    int n_code;
37395
37396    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37397        mem_base = xmlMemBlocks();
37398        code = gen_int(n_code, 0);
37399
37400        ret_val = xmlUCSIsDevanagari(code);
37401        desret_int(ret_val);
37402        call_tests++;
37403        des_int(n_code, code, 0);
37404        xmlResetLastError();
37405        if (mem_base != xmlMemBlocks()) {
37406            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
37407	           xmlMemBlocks() - mem_base);
37408	    test_ret++;
37409            printf(" %d", n_code);
37410            printf("\n");
37411        }
37412    }
37413    function_tests++;
37414#endif
37415
37416    return(test_ret);
37417}
37418
37419
37420static int
37421test_xmlUCSIsDingbats(void) {
37422    int test_ret = 0;
37423
37424#if defined(LIBXML_UNICODE_ENABLED)
37425    int mem_base;
37426    int ret_val;
37427    int code; /* UCS code point */
37428    int n_code;
37429
37430    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37431        mem_base = xmlMemBlocks();
37432        code = gen_int(n_code, 0);
37433
37434        ret_val = xmlUCSIsDingbats(code);
37435        desret_int(ret_val);
37436        call_tests++;
37437        des_int(n_code, code, 0);
37438        xmlResetLastError();
37439        if (mem_base != xmlMemBlocks()) {
37440            printf("Leak of %d blocks found in xmlUCSIsDingbats",
37441	           xmlMemBlocks() - mem_base);
37442	    test_ret++;
37443            printf(" %d", n_code);
37444            printf("\n");
37445        }
37446    }
37447    function_tests++;
37448#endif
37449
37450    return(test_ret);
37451}
37452
37453
37454static int
37455test_xmlUCSIsEnclosedAlphanumerics(void) {
37456    int test_ret = 0;
37457
37458#if defined(LIBXML_UNICODE_ENABLED)
37459    int mem_base;
37460    int ret_val;
37461    int code; /* UCS code point */
37462    int n_code;
37463
37464    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37465        mem_base = xmlMemBlocks();
37466        code = gen_int(n_code, 0);
37467
37468        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
37469        desret_int(ret_val);
37470        call_tests++;
37471        des_int(n_code, code, 0);
37472        xmlResetLastError();
37473        if (mem_base != xmlMemBlocks()) {
37474            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
37475	           xmlMemBlocks() - mem_base);
37476	    test_ret++;
37477            printf(" %d", n_code);
37478            printf("\n");
37479        }
37480    }
37481    function_tests++;
37482#endif
37483
37484    return(test_ret);
37485}
37486
37487
37488static int
37489test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
37490    int test_ret = 0;
37491
37492#if defined(LIBXML_UNICODE_ENABLED)
37493    int mem_base;
37494    int ret_val;
37495    int code; /* UCS code point */
37496    int n_code;
37497
37498    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37499        mem_base = xmlMemBlocks();
37500        code = gen_int(n_code, 0);
37501
37502        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
37503        desret_int(ret_val);
37504        call_tests++;
37505        des_int(n_code, code, 0);
37506        xmlResetLastError();
37507        if (mem_base != xmlMemBlocks()) {
37508            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
37509	           xmlMemBlocks() - mem_base);
37510	    test_ret++;
37511            printf(" %d", n_code);
37512            printf("\n");
37513        }
37514    }
37515    function_tests++;
37516#endif
37517
37518    return(test_ret);
37519}
37520
37521
37522static int
37523test_xmlUCSIsEthiopic(void) {
37524    int test_ret = 0;
37525
37526#if defined(LIBXML_UNICODE_ENABLED)
37527    int mem_base;
37528    int ret_val;
37529    int code; /* UCS code point */
37530    int n_code;
37531
37532    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37533        mem_base = xmlMemBlocks();
37534        code = gen_int(n_code, 0);
37535
37536        ret_val = xmlUCSIsEthiopic(code);
37537        desret_int(ret_val);
37538        call_tests++;
37539        des_int(n_code, code, 0);
37540        xmlResetLastError();
37541        if (mem_base != xmlMemBlocks()) {
37542            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
37543	           xmlMemBlocks() - mem_base);
37544	    test_ret++;
37545            printf(" %d", n_code);
37546            printf("\n");
37547        }
37548    }
37549    function_tests++;
37550#endif
37551
37552    return(test_ret);
37553}
37554
37555
37556static int
37557test_xmlUCSIsGeneralPunctuation(void) {
37558    int test_ret = 0;
37559
37560#if defined(LIBXML_UNICODE_ENABLED)
37561    int mem_base;
37562    int ret_val;
37563    int code; /* UCS code point */
37564    int n_code;
37565
37566    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37567        mem_base = xmlMemBlocks();
37568        code = gen_int(n_code, 0);
37569
37570        ret_val = xmlUCSIsGeneralPunctuation(code);
37571        desret_int(ret_val);
37572        call_tests++;
37573        des_int(n_code, code, 0);
37574        xmlResetLastError();
37575        if (mem_base != xmlMemBlocks()) {
37576            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
37577	           xmlMemBlocks() - mem_base);
37578	    test_ret++;
37579            printf(" %d", n_code);
37580            printf("\n");
37581        }
37582    }
37583    function_tests++;
37584#endif
37585
37586    return(test_ret);
37587}
37588
37589
37590static int
37591test_xmlUCSIsGeometricShapes(void) {
37592    int test_ret = 0;
37593
37594#if defined(LIBXML_UNICODE_ENABLED)
37595    int mem_base;
37596    int ret_val;
37597    int code; /* UCS code point */
37598    int n_code;
37599
37600    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37601        mem_base = xmlMemBlocks();
37602        code = gen_int(n_code, 0);
37603
37604        ret_val = xmlUCSIsGeometricShapes(code);
37605        desret_int(ret_val);
37606        call_tests++;
37607        des_int(n_code, code, 0);
37608        xmlResetLastError();
37609        if (mem_base != xmlMemBlocks()) {
37610            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
37611	           xmlMemBlocks() - mem_base);
37612	    test_ret++;
37613            printf(" %d", n_code);
37614            printf("\n");
37615        }
37616    }
37617    function_tests++;
37618#endif
37619
37620    return(test_ret);
37621}
37622
37623
37624static int
37625test_xmlUCSIsGeorgian(void) {
37626    int test_ret = 0;
37627
37628#if defined(LIBXML_UNICODE_ENABLED)
37629    int mem_base;
37630    int ret_val;
37631    int code; /* UCS code point */
37632    int n_code;
37633
37634    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37635        mem_base = xmlMemBlocks();
37636        code = gen_int(n_code, 0);
37637
37638        ret_val = xmlUCSIsGeorgian(code);
37639        desret_int(ret_val);
37640        call_tests++;
37641        des_int(n_code, code, 0);
37642        xmlResetLastError();
37643        if (mem_base != xmlMemBlocks()) {
37644            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
37645	           xmlMemBlocks() - mem_base);
37646	    test_ret++;
37647            printf(" %d", n_code);
37648            printf("\n");
37649        }
37650    }
37651    function_tests++;
37652#endif
37653
37654    return(test_ret);
37655}
37656
37657
37658static int
37659test_xmlUCSIsGothic(void) {
37660    int test_ret = 0;
37661
37662#if defined(LIBXML_UNICODE_ENABLED)
37663    int mem_base;
37664    int ret_val;
37665    int code; /* UCS code point */
37666    int n_code;
37667
37668    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37669        mem_base = xmlMemBlocks();
37670        code = gen_int(n_code, 0);
37671
37672        ret_val = xmlUCSIsGothic(code);
37673        desret_int(ret_val);
37674        call_tests++;
37675        des_int(n_code, code, 0);
37676        xmlResetLastError();
37677        if (mem_base != xmlMemBlocks()) {
37678            printf("Leak of %d blocks found in xmlUCSIsGothic",
37679	           xmlMemBlocks() - mem_base);
37680	    test_ret++;
37681            printf(" %d", n_code);
37682            printf("\n");
37683        }
37684    }
37685    function_tests++;
37686#endif
37687
37688    return(test_ret);
37689}
37690
37691
37692static int
37693test_xmlUCSIsGreek(void) {
37694    int test_ret = 0;
37695
37696#if defined(LIBXML_UNICODE_ENABLED)
37697    int mem_base;
37698    int ret_val;
37699    int code; /* UCS code point */
37700    int n_code;
37701
37702    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37703        mem_base = xmlMemBlocks();
37704        code = gen_int(n_code, 0);
37705
37706        ret_val = xmlUCSIsGreek(code);
37707        desret_int(ret_val);
37708        call_tests++;
37709        des_int(n_code, code, 0);
37710        xmlResetLastError();
37711        if (mem_base != xmlMemBlocks()) {
37712            printf("Leak of %d blocks found in xmlUCSIsGreek",
37713	           xmlMemBlocks() - mem_base);
37714	    test_ret++;
37715            printf(" %d", n_code);
37716            printf("\n");
37717        }
37718    }
37719    function_tests++;
37720#endif
37721
37722    return(test_ret);
37723}
37724
37725
37726static int
37727test_xmlUCSIsGreekExtended(void) {
37728    int test_ret = 0;
37729
37730#if defined(LIBXML_UNICODE_ENABLED)
37731    int mem_base;
37732    int ret_val;
37733    int code; /* UCS code point */
37734    int n_code;
37735
37736    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37737        mem_base = xmlMemBlocks();
37738        code = gen_int(n_code, 0);
37739
37740        ret_val = xmlUCSIsGreekExtended(code);
37741        desret_int(ret_val);
37742        call_tests++;
37743        des_int(n_code, code, 0);
37744        xmlResetLastError();
37745        if (mem_base != xmlMemBlocks()) {
37746            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
37747	           xmlMemBlocks() - mem_base);
37748	    test_ret++;
37749            printf(" %d", n_code);
37750            printf("\n");
37751        }
37752    }
37753    function_tests++;
37754#endif
37755
37756    return(test_ret);
37757}
37758
37759
37760static int
37761test_xmlUCSIsGreekandCoptic(void) {
37762    int test_ret = 0;
37763
37764#if defined(LIBXML_UNICODE_ENABLED)
37765    int mem_base;
37766    int ret_val;
37767    int code; /* UCS code point */
37768    int n_code;
37769
37770    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37771        mem_base = xmlMemBlocks();
37772        code = gen_int(n_code, 0);
37773
37774        ret_val = xmlUCSIsGreekandCoptic(code);
37775        desret_int(ret_val);
37776        call_tests++;
37777        des_int(n_code, code, 0);
37778        xmlResetLastError();
37779        if (mem_base != xmlMemBlocks()) {
37780            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
37781	           xmlMemBlocks() - mem_base);
37782	    test_ret++;
37783            printf(" %d", n_code);
37784            printf("\n");
37785        }
37786    }
37787    function_tests++;
37788#endif
37789
37790    return(test_ret);
37791}
37792
37793
37794static int
37795test_xmlUCSIsGujarati(void) {
37796    int test_ret = 0;
37797
37798#if defined(LIBXML_UNICODE_ENABLED)
37799    int mem_base;
37800    int ret_val;
37801    int code; /* UCS code point */
37802    int n_code;
37803
37804    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37805        mem_base = xmlMemBlocks();
37806        code = gen_int(n_code, 0);
37807
37808        ret_val = xmlUCSIsGujarati(code);
37809        desret_int(ret_val);
37810        call_tests++;
37811        des_int(n_code, code, 0);
37812        xmlResetLastError();
37813        if (mem_base != xmlMemBlocks()) {
37814            printf("Leak of %d blocks found in xmlUCSIsGujarati",
37815	           xmlMemBlocks() - mem_base);
37816	    test_ret++;
37817            printf(" %d", n_code);
37818            printf("\n");
37819        }
37820    }
37821    function_tests++;
37822#endif
37823
37824    return(test_ret);
37825}
37826
37827
37828static int
37829test_xmlUCSIsGurmukhi(void) {
37830    int test_ret = 0;
37831
37832#if defined(LIBXML_UNICODE_ENABLED)
37833    int mem_base;
37834    int ret_val;
37835    int code; /* UCS code point */
37836    int n_code;
37837
37838    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37839        mem_base = xmlMemBlocks();
37840        code = gen_int(n_code, 0);
37841
37842        ret_val = xmlUCSIsGurmukhi(code);
37843        desret_int(ret_val);
37844        call_tests++;
37845        des_int(n_code, code, 0);
37846        xmlResetLastError();
37847        if (mem_base != xmlMemBlocks()) {
37848            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
37849	           xmlMemBlocks() - mem_base);
37850	    test_ret++;
37851            printf(" %d", n_code);
37852            printf("\n");
37853        }
37854    }
37855    function_tests++;
37856#endif
37857
37858    return(test_ret);
37859}
37860
37861
37862static int
37863test_xmlUCSIsHalfwidthandFullwidthForms(void) {
37864    int test_ret = 0;
37865
37866#if defined(LIBXML_UNICODE_ENABLED)
37867    int mem_base;
37868    int ret_val;
37869    int code; /* UCS code point */
37870    int n_code;
37871
37872    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37873        mem_base = xmlMemBlocks();
37874        code = gen_int(n_code, 0);
37875
37876        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
37877        desret_int(ret_val);
37878        call_tests++;
37879        des_int(n_code, code, 0);
37880        xmlResetLastError();
37881        if (mem_base != xmlMemBlocks()) {
37882            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
37883	           xmlMemBlocks() - mem_base);
37884	    test_ret++;
37885            printf(" %d", n_code);
37886            printf("\n");
37887        }
37888    }
37889    function_tests++;
37890#endif
37891
37892    return(test_ret);
37893}
37894
37895
37896static int
37897test_xmlUCSIsHangulCompatibilityJamo(void) {
37898    int test_ret = 0;
37899
37900#if defined(LIBXML_UNICODE_ENABLED)
37901    int mem_base;
37902    int ret_val;
37903    int code; /* UCS code point */
37904    int n_code;
37905
37906    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37907        mem_base = xmlMemBlocks();
37908        code = gen_int(n_code, 0);
37909
37910        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
37911        desret_int(ret_val);
37912        call_tests++;
37913        des_int(n_code, code, 0);
37914        xmlResetLastError();
37915        if (mem_base != xmlMemBlocks()) {
37916            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
37917	           xmlMemBlocks() - mem_base);
37918	    test_ret++;
37919            printf(" %d", n_code);
37920            printf("\n");
37921        }
37922    }
37923    function_tests++;
37924#endif
37925
37926    return(test_ret);
37927}
37928
37929
37930static int
37931test_xmlUCSIsHangulJamo(void) {
37932    int test_ret = 0;
37933
37934#if defined(LIBXML_UNICODE_ENABLED)
37935    int mem_base;
37936    int ret_val;
37937    int code; /* UCS code point */
37938    int n_code;
37939
37940    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37941        mem_base = xmlMemBlocks();
37942        code = gen_int(n_code, 0);
37943
37944        ret_val = xmlUCSIsHangulJamo(code);
37945        desret_int(ret_val);
37946        call_tests++;
37947        des_int(n_code, code, 0);
37948        xmlResetLastError();
37949        if (mem_base != xmlMemBlocks()) {
37950            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
37951	           xmlMemBlocks() - mem_base);
37952	    test_ret++;
37953            printf(" %d", n_code);
37954            printf("\n");
37955        }
37956    }
37957    function_tests++;
37958#endif
37959
37960    return(test_ret);
37961}
37962
37963
37964static int
37965test_xmlUCSIsHangulSyllables(void) {
37966    int test_ret = 0;
37967
37968#if defined(LIBXML_UNICODE_ENABLED)
37969    int mem_base;
37970    int ret_val;
37971    int code; /* UCS code point */
37972    int n_code;
37973
37974    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37975        mem_base = xmlMemBlocks();
37976        code = gen_int(n_code, 0);
37977
37978        ret_val = xmlUCSIsHangulSyllables(code);
37979        desret_int(ret_val);
37980        call_tests++;
37981        des_int(n_code, code, 0);
37982        xmlResetLastError();
37983        if (mem_base != xmlMemBlocks()) {
37984            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
37985	           xmlMemBlocks() - mem_base);
37986	    test_ret++;
37987            printf(" %d", n_code);
37988            printf("\n");
37989        }
37990    }
37991    function_tests++;
37992#endif
37993
37994    return(test_ret);
37995}
37996
37997
37998static int
37999test_xmlUCSIsHanunoo(void) {
38000    int test_ret = 0;
38001
38002#if defined(LIBXML_UNICODE_ENABLED)
38003    int mem_base;
38004    int ret_val;
38005    int code; /* UCS code point */
38006    int n_code;
38007
38008    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38009        mem_base = xmlMemBlocks();
38010        code = gen_int(n_code, 0);
38011
38012        ret_val = xmlUCSIsHanunoo(code);
38013        desret_int(ret_val);
38014        call_tests++;
38015        des_int(n_code, code, 0);
38016        xmlResetLastError();
38017        if (mem_base != xmlMemBlocks()) {
38018            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
38019	           xmlMemBlocks() - mem_base);
38020	    test_ret++;
38021            printf(" %d", n_code);
38022            printf("\n");
38023        }
38024    }
38025    function_tests++;
38026#endif
38027
38028    return(test_ret);
38029}
38030
38031
38032static int
38033test_xmlUCSIsHebrew(void) {
38034    int test_ret = 0;
38035
38036#if defined(LIBXML_UNICODE_ENABLED)
38037    int mem_base;
38038    int ret_val;
38039    int code; /* UCS code point */
38040    int n_code;
38041
38042    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38043        mem_base = xmlMemBlocks();
38044        code = gen_int(n_code, 0);
38045
38046        ret_val = xmlUCSIsHebrew(code);
38047        desret_int(ret_val);
38048        call_tests++;
38049        des_int(n_code, code, 0);
38050        xmlResetLastError();
38051        if (mem_base != xmlMemBlocks()) {
38052            printf("Leak of %d blocks found in xmlUCSIsHebrew",
38053	           xmlMemBlocks() - mem_base);
38054	    test_ret++;
38055            printf(" %d", n_code);
38056            printf("\n");
38057        }
38058    }
38059    function_tests++;
38060#endif
38061
38062    return(test_ret);
38063}
38064
38065
38066static int
38067test_xmlUCSIsHighPrivateUseSurrogates(void) {
38068    int test_ret = 0;
38069
38070#if defined(LIBXML_UNICODE_ENABLED)
38071    int mem_base;
38072    int ret_val;
38073    int code; /* UCS code point */
38074    int n_code;
38075
38076    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38077        mem_base = xmlMemBlocks();
38078        code = gen_int(n_code, 0);
38079
38080        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
38081        desret_int(ret_val);
38082        call_tests++;
38083        des_int(n_code, code, 0);
38084        xmlResetLastError();
38085        if (mem_base != xmlMemBlocks()) {
38086            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
38087	           xmlMemBlocks() - mem_base);
38088	    test_ret++;
38089            printf(" %d", n_code);
38090            printf("\n");
38091        }
38092    }
38093    function_tests++;
38094#endif
38095
38096    return(test_ret);
38097}
38098
38099
38100static int
38101test_xmlUCSIsHighSurrogates(void) {
38102    int test_ret = 0;
38103
38104#if defined(LIBXML_UNICODE_ENABLED)
38105    int mem_base;
38106    int ret_val;
38107    int code; /* UCS code point */
38108    int n_code;
38109
38110    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38111        mem_base = xmlMemBlocks();
38112        code = gen_int(n_code, 0);
38113
38114        ret_val = xmlUCSIsHighSurrogates(code);
38115        desret_int(ret_val);
38116        call_tests++;
38117        des_int(n_code, code, 0);
38118        xmlResetLastError();
38119        if (mem_base != xmlMemBlocks()) {
38120            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
38121	           xmlMemBlocks() - mem_base);
38122	    test_ret++;
38123            printf(" %d", n_code);
38124            printf("\n");
38125        }
38126    }
38127    function_tests++;
38128#endif
38129
38130    return(test_ret);
38131}
38132
38133
38134static int
38135test_xmlUCSIsHiragana(void) {
38136    int test_ret = 0;
38137
38138#if defined(LIBXML_UNICODE_ENABLED)
38139    int mem_base;
38140    int ret_val;
38141    int code; /* UCS code point */
38142    int n_code;
38143
38144    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38145        mem_base = xmlMemBlocks();
38146        code = gen_int(n_code, 0);
38147
38148        ret_val = xmlUCSIsHiragana(code);
38149        desret_int(ret_val);
38150        call_tests++;
38151        des_int(n_code, code, 0);
38152        xmlResetLastError();
38153        if (mem_base != xmlMemBlocks()) {
38154            printf("Leak of %d blocks found in xmlUCSIsHiragana",
38155	           xmlMemBlocks() - mem_base);
38156	    test_ret++;
38157            printf(" %d", n_code);
38158            printf("\n");
38159        }
38160    }
38161    function_tests++;
38162#endif
38163
38164    return(test_ret);
38165}
38166
38167
38168static int
38169test_xmlUCSIsIPAExtensions(void) {
38170    int test_ret = 0;
38171
38172#if defined(LIBXML_UNICODE_ENABLED)
38173    int mem_base;
38174    int ret_val;
38175    int code; /* UCS code point */
38176    int n_code;
38177
38178    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38179        mem_base = xmlMemBlocks();
38180        code = gen_int(n_code, 0);
38181
38182        ret_val = xmlUCSIsIPAExtensions(code);
38183        desret_int(ret_val);
38184        call_tests++;
38185        des_int(n_code, code, 0);
38186        xmlResetLastError();
38187        if (mem_base != xmlMemBlocks()) {
38188            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
38189	           xmlMemBlocks() - mem_base);
38190	    test_ret++;
38191            printf(" %d", n_code);
38192            printf("\n");
38193        }
38194    }
38195    function_tests++;
38196#endif
38197
38198    return(test_ret);
38199}
38200
38201
38202static int
38203test_xmlUCSIsIdeographicDescriptionCharacters(void) {
38204    int test_ret = 0;
38205
38206#if defined(LIBXML_UNICODE_ENABLED)
38207    int mem_base;
38208    int ret_val;
38209    int code; /* UCS code point */
38210    int n_code;
38211
38212    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38213        mem_base = xmlMemBlocks();
38214        code = gen_int(n_code, 0);
38215
38216        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
38217        desret_int(ret_val);
38218        call_tests++;
38219        des_int(n_code, code, 0);
38220        xmlResetLastError();
38221        if (mem_base != xmlMemBlocks()) {
38222            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
38223	           xmlMemBlocks() - mem_base);
38224	    test_ret++;
38225            printf(" %d", n_code);
38226            printf("\n");
38227        }
38228    }
38229    function_tests++;
38230#endif
38231
38232    return(test_ret);
38233}
38234
38235
38236static int
38237test_xmlUCSIsKanbun(void) {
38238    int test_ret = 0;
38239
38240#if defined(LIBXML_UNICODE_ENABLED)
38241    int mem_base;
38242    int ret_val;
38243    int code; /* UCS code point */
38244    int n_code;
38245
38246    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38247        mem_base = xmlMemBlocks();
38248        code = gen_int(n_code, 0);
38249
38250        ret_val = xmlUCSIsKanbun(code);
38251        desret_int(ret_val);
38252        call_tests++;
38253        des_int(n_code, code, 0);
38254        xmlResetLastError();
38255        if (mem_base != xmlMemBlocks()) {
38256            printf("Leak of %d blocks found in xmlUCSIsKanbun",
38257	           xmlMemBlocks() - mem_base);
38258	    test_ret++;
38259            printf(" %d", n_code);
38260            printf("\n");
38261        }
38262    }
38263    function_tests++;
38264#endif
38265
38266    return(test_ret);
38267}
38268
38269
38270static int
38271test_xmlUCSIsKangxiRadicals(void) {
38272    int test_ret = 0;
38273
38274#if defined(LIBXML_UNICODE_ENABLED)
38275    int mem_base;
38276    int ret_val;
38277    int code; /* UCS code point */
38278    int n_code;
38279
38280    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38281        mem_base = xmlMemBlocks();
38282        code = gen_int(n_code, 0);
38283
38284        ret_val = xmlUCSIsKangxiRadicals(code);
38285        desret_int(ret_val);
38286        call_tests++;
38287        des_int(n_code, code, 0);
38288        xmlResetLastError();
38289        if (mem_base != xmlMemBlocks()) {
38290            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
38291	           xmlMemBlocks() - mem_base);
38292	    test_ret++;
38293            printf(" %d", n_code);
38294            printf("\n");
38295        }
38296    }
38297    function_tests++;
38298#endif
38299
38300    return(test_ret);
38301}
38302
38303
38304static int
38305test_xmlUCSIsKannada(void) {
38306    int test_ret = 0;
38307
38308#if defined(LIBXML_UNICODE_ENABLED)
38309    int mem_base;
38310    int ret_val;
38311    int code; /* UCS code point */
38312    int n_code;
38313
38314    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38315        mem_base = xmlMemBlocks();
38316        code = gen_int(n_code, 0);
38317
38318        ret_val = xmlUCSIsKannada(code);
38319        desret_int(ret_val);
38320        call_tests++;
38321        des_int(n_code, code, 0);
38322        xmlResetLastError();
38323        if (mem_base != xmlMemBlocks()) {
38324            printf("Leak of %d blocks found in xmlUCSIsKannada",
38325	           xmlMemBlocks() - mem_base);
38326	    test_ret++;
38327            printf(" %d", n_code);
38328            printf("\n");
38329        }
38330    }
38331    function_tests++;
38332#endif
38333
38334    return(test_ret);
38335}
38336
38337
38338static int
38339test_xmlUCSIsKatakana(void) {
38340    int test_ret = 0;
38341
38342#if defined(LIBXML_UNICODE_ENABLED)
38343    int mem_base;
38344    int ret_val;
38345    int code; /* UCS code point */
38346    int n_code;
38347
38348    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38349        mem_base = xmlMemBlocks();
38350        code = gen_int(n_code, 0);
38351
38352        ret_val = xmlUCSIsKatakana(code);
38353        desret_int(ret_val);
38354        call_tests++;
38355        des_int(n_code, code, 0);
38356        xmlResetLastError();
38357        if (mem_base != xmlMemBlocks()) {
38358            printf("Leak of %d blocks found in xmlUCSIsKatakana",
38359	           xmlMemBlocks() - mem_base);
38360	    test_ret++;
38361            printf(" %d", n_code);
38362            printf("\n");
38363        }
38364    }
38365    function_tests++;
38366#endif
38367
38368    return(test_ret);
38369}
38370
38371
38372static int
38373test_xmlUCSIsKatakanaPhoneticExtensions(void) {
38374    int test_ret = 0;
38375
38376#if defined(LIBXML_UNICODE_ENABLED)
38377    int mem_base;
38378    int ret_val;
38379    int code; /* UCS code point */
38380    int n_code;
38381
38382    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38383        mem_base = xmlMemBlocks();
38384        code = gen_int(n_code, 0);
38385
38386        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
38387        desret_int(ret_val);
38388        call_tests++;
38389        des_int(n_code, code, 0);
38390        xmlResetLastError();
38391        if (mem_base != xmlMemBlocks()) {
38392            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
38393	           xmlMemBlocks() - mem_base);
38394	    test_ret++;
38395            printf(" %d", n_code);
38396            printf("\n");
38397        }
38398    }
38399    function_tests++;
38400#endif
38401
38402    return(test_ret);
38403}
38404
38405
38406static int
38407test_xmlUCSIsKhmer(void) {
38408    int test_ret = 0;
38409
38410#if defined(LIBXML_UNICODE_ENABLED)
38411    int mem_base;
38412    int ret_val;
38413    int code; /* UCS code point */
38414    int n_code;
38415
38416    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38417        mem_base = xmlMemBlocks();
38418        code = gen_int(n_code, 0);
38419
38420        ret_val = xmlUCSIsKhmer(code);
38421        desret_int(ret_val);
38422        call_tests++;
38423        des_int(n_code, code, 0);
38424        xmlResetLastError();
38425        if (mem_base != xmlMemBlocks()) {
38426            printf("Leak of %d blocks found in xmlUCSIsKhmer",
38427	           xmlMemBlocks() - mem_base);
38428	    test_ret++;
38429            printf(" %d", n_code);
38430            printf("\n");
38431        }
38432    }
38433    function_tests++;
38434#endif
38435
38436    return(test_ret);
38437}
38438
38439
38440static int
38441test_xmlUCSIsKhmerSymbols(void) {
38442    int test_ret = 0;
38443
38444#if defined(LIBXML_UNICODE_ENABLED)
38445    int mem_base;
38446    int ret_val;
38447    int code; /* UCS code point */
38448    int n_code;
38449
38450    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38451        mem_base = xmlMemBlocks();
38452        code = gen_int(n_code, 0);
38453
38454        ret_val = xmlUCSIsKhmerSymbols(code);
38455        desret_int(ret_val);
38456        call_tests++;
38457        des_int(n_code, code, 0);
38458        xmlResetLastError();
38459        if (mem_base != xmlMemBlocks()) {
38460            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
38461	           xmlMemBlocks() - mem_base);
38462	    test_ret++;
38463            printf(" %d", n_code);
38464            printf("\n");
38465        }
38466    }
38467    function_tests++;
38468#endif
38469
38470    return(test_ret);
38471}
38472
38473
38474static int
38475test_xmlUCSIsLao(void) {
38476    int test_ret = 0;
38477
38478#if defined(LIBXML_UNICODE_ENABLED)
38479    int mem_base;
38480    int ret_val;
38481    int code; /* UCS code point */
38482    int n_code;
38483
38484    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38485        mem_base = xmlMemBlocks();
38486        code = gen_int(n_code, 0);
38487
38488        ret_val = xmlUCSIsLao(code);
38489        desret_int(ret_val);
38490        call_tests++;
38491        des_int(n_code, code, 0);
38492        xmlResetLastError();
38493        if (mem_base != xmlMemBlocks()) {
38494            printf("Leak of %d blocks found in xmlUCSIsLao",
38495	           xmlMemBlocks() - mem_base);
38496	    test_ret++;
38497            printf(" %d", n_code);
38498            printf("\n");
38499        }
38500    }
38501    function_tests++;
38502#endif
38503
38504    return(test_ret);
38505}
38506
38507
38508static int
38509test_xmlUCSIsLatin1Supplement(void) {
38510    int test_ret = 0;
38511
38512#if defined(LIBXML_UNICODE_ENABLED)
38513    int mem_base;
38514    int ret_val;
38515    int code; /* UCS code point */
38516    int n_code;
38517
38518    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38519        mem_base = xmlMemBlocks();
38520        code = gen_int(n_code, 0);
38521
38522        ret_val = xmlUCSIsLatin1Supplement(code);
38523        desret_int(ret_val);
38524        call_tests++;
38525        des_int(n_code, code, 0);
38526        xmlResetLastError();
38527        if (mem_base != xmlMemBlocks()) {
38528            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
38529	           xmlMemBlocks() - mem_base);
38530	    test_ret++;
38531            printf(" %d", n_code);
38532            printf("\n");
38533        }
38534    }
38535    function_tests++;
38536#endif
38537
38538    return(test_ret);
38539}
38540
38541
38542static int
38543test_xmlUCSIsLatinExtendedA(void) {
38544    int test_ret = 0;
38545
38546#if defined(LIBXML_UNICODE_ENABLED)
38547    int mem_base;
38548    int ret_val;
38549    int code; /* UCS code point */
38550    int n_code;
38551
38552    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38553        mem_base = xmlMemBlocks();
38554        code = gen_int(n_code, 0);
38555
38556        ret_val = xmlUCSIsLatinExtendedA(code);
38557        desret_int(ret_val);
38558        call_tests++;
38559        des_int(n_code, code, 0);
38560        xmlResetLastError();
38561        if (mem_base != xmlMemBlocks()) {
38562            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
38563	           xmlMemBlocks() - mem_base);
38564	    test_ret++;
38565            printf(" %d", n_code);
38566            printf("\n");
38567        }
38568    }
38569    function_tests++;
38570#endif
38571
38572    return(test_ret);
38573}
38574
38575
38576static int
38577test_xmlUCSIsLatinExtendedAdditional(void) {
38578    int test_ret = 0;
38579
38580#if defined(LIBXML_UNICODE_ENABLED)
38581    int mem_base;
38582    int ret_val;
38583    int code; /* UCS code point */
38584    int n_code;
38585
38586    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38587        mem_base = xmlMemBlocks();
38588        code = gen_int(n_code, 0);
38589
38590        ret_val = xmlUCSIsLatinExtendedAdditional(code);
38591        desret_int(ret_val);
38592        call_tests++;
38593        des_int(n_code, code, 0);
38594        xmlResetLastError();
38595        if (mem_base != xmlMemBlocks()) {
38596            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
38597	           xmlMemBlocks() - mem_base);
38598	    test_ret++;
38599            printf(" %d", n_code);
38600            printf("\n");
38601        }
38602    }
38603    function_tests++;
38604#endif
38605
38606    return(test_ret);
38607}
38608
38609
38610static int
38611test_xmlUCSIsLatinExtendedB(void) {
38612    int test_ret = 0;
38613
38614#if defined(LIBXML_UNICODE_ENABLED)
38615    int mem_base;
38616    int ret_val;
38617    int code; /* UCS code point */
38618    int n_code;
38619
38620    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38621        mem_base = xmlMemBlocks();
38622        code = gen_int(n_code, 0);
38623
38624        ret_val = xmlUCSIsLatinExtendedB(code);
38625        desret_int(ret_val);
38626        call_tests++;
38627        des_int(n_code, code, 0);
38628        xmlResetLastError();
38629        if (mem_base != xmlMemBlocks()) {
38630            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
38631	           xmlMemBlocks() - mem_base);
38632	    test_ret++;
38633            printf(" %d", n_code);
38634            printf("\n");
38635        }
38636    }
38637    function_tests++;
38638#endif
38639
38640    return(test_ret);
38641}
38642
38643
38644static int
38645test_xmlUCSIsLetterlikeSymbols(void) {
38646    int test_ret = 0;
38647
38648#if defined(LIBXML_UNICODE_ENABLED)
38649    int mem_base;
38650    int ret_val;
38651    int code; /* UCS code point */
38652    int n_code;
38653
38654    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38655        mem_base = xmlMemBlocks();
38656        code = gen_int(n_code, 0);
38657
38658        ret_val = xmlUCSIsLetterlikeSymbols(code);
38659        desret_int(ret_val);
38660        call_tests++;
38661        des_int(n_code, code, 0);
38662        xmlResetLastError();
38663        if (mem_base != xmlMemBlocks()) {
38664            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
38665	           xmlMemBlocks() - mem_base);
38666	    test_ret++;
38667            printf(" %d", n_code);
38668            printf("\n");
38669        }
38670    }
38671    function_tests++;
38672#endif
38673
38674    return(test_ret);
38675}
38676
38677
38678static int
38679test_xmlUCSIsLimbu(void) {
38680    int test_ret = 0;
38681
38682#if defined(LIBXML_UNICODE_ENABLED)
38683    int mem_base;
38684    int ret_val;
38685    int code; /* UCS code point */
38686    int n_code;
38687
38688    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38689        mem_base = xmlMemBlocks();
38690        code = gen_int(n_code, 0);
38691
38692        ret_val = xmlUCSIsLimbu(code);
38693        desret_int(ret_val);
38694        call_tests++;
38695        des_int(n_code, code, 0);
38696        xmlResetLastError();
38697        if (mem_base != xmlMemBlocks()) {
38698            printf("Leak of %d blocks found in xmlUCSIsLimbu",
38699	           xmlMemBlocks() - mem_base);
38700	    test_ret++;
38701            printf(" %d", n_code);
38702            printf("\n");
38703        }
38704    }
38705    function_tests++;
38706#endif
38707
38708    return(test_ret);
38709}
38710
38711
38712static int
38713test_xmlUCSIsLinearBIdeograms(void) {
38714    int test_ret = 0;
38715
38716#if defined(LIBXML_UNICODE_ENABLED)
38717    int mem_base;
38718    int ret_val;
38719    int code; /* UCS code point */
38720    int n_code;
38721
38722    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38723        mem_base = xmlMemBlocks();
38724        code = gen_int(n_code, 0);
38725
38726        ret_val = xmlUCSIsLinearBIdeograms(code);
38727        desret_int(ret_val);
38728        call_tests++;
38729        des_int(n_code, code, 0);
38730        xmlResetLastError();
38731        if (mem_base != xmlMemBlocks()) {
38732            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
38733	           xmlMemBlocks() - mem_base);
38734	    test_ret++;
38735            printf(" %d", n_code);
38736            printf("\n");
38737        }
38738    }
38739    function_tests++;
38740#endif
38741
38742    return(test_ret);
38743}
38744
38745
38746static int
38747test_xmlUCSIsLinearBSyllabary(void) {
38748    int test_ret = 0;
38749
38750#if defined(LIBXML_UNICODE_ENABLED)
38751    int mem_base;
38752    int ret_val;
38753    int code; /* UCS code point */
38754    int n_code;
38755
38756    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38757        mem_base = xmlMemBlocks();
38758        code = gen_int(n_code, 0);
38759
38760        ret_val = xmlUCSIsLinearBSyllabary(code);
38761        desret_int(ret_val);
38762        call_tests++;
38763        des_int(n_code, code, 0);
38764        xmlResetLastError();
38765        if (mem_base != xmlMemBlocks()) {
38766            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
38767	           xmlMemBlocks() - mem_base);
38768	    test_ret++;
38769            printf(" %d", n_code);
38770            printf("\n");
38771        }
38772    }
38773    function_tests++;
38774#endif
38775
38776    return(test_ret);
38777}
38778
38779
38780static int
38781test_xmlUCSIsLowSurrogates(void) {
38782    int test_ret = 0;
38783
38784#if defined(LIBXML_UNICODE_ENABLED)
38785    int mem_base;
38786    int ret_val;
38787    int code; /* UCS code point */
38788    int n_code;
38789
38790    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38791        mem_base = xmlMemBlocks();
38792        code = gen_int(n_code, 0);
38793
38794        ret_val = xmlUCSIsLowSurrogates(code);
38795        desret_int(ret_val);
38796        call_tests++;
38797        des_int(n_code, code, 0);
38798        xmlResetLastError();
38799        if (mem_base != xmlMemBlocks()) {
38800            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
38801	           xmlMemBlocks() - mem_base);
38802	    test_ret++;
38803            printf(" %d", n_code);
38804            printf("\n");
38805        }
38806    }
38807    function_tests++;
38808#endif
38809
38810    return(test_ret);
38811}
38812
38813
38814static int
38815test_xmlUCSIsMalayalam(void) {
38816    int test_ret = 0;
38817
38818#if defined(LIBXML_UNICODE_ENABLED)
38819    int mem_base;
38820    int ret_val;
38821    int code; /* UCS code point */
38822    int n_code;
38823
38824    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38825        mem_base = xmlMemBlocks();
38826        code = gen_int(n_code, 0);
38827
38828        ret_val = xmlUCSIsMalayalam(code);
38829        desret_int(ret_val);
38830        call_tests++;
38831        des_int(n_code, code, 0);
38832        xmlResetLastError();
38833        if (mem_base != xmlMemBlocks()) {
38834            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
38835	           xmlMemBlocks() - mem_base);
38836	    test_ret++;
38837            printf(" %d", n_code);
38838            printf("\n");
38839        }
38840    }
38841    function_tests++;
38842#endif
38843
38844    return(test_ret);
38845}
38846
38847
38848static int
38849test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
38850    int test_ret = 0;
38851
38852#if defined(LIBXML_UNICODE_ENABLED)
38853    int mem_base;
38854    int ret_val;
38855    int code; /* UCS code point */
38856    int n_code;
38857
38858    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38859        mem_base = xmlMemBlocks();
38860        code = gen_int(n_code, 0);
38861
38862        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
38863        desret_int(ret_val);
38864        call_tests++;
38865        des_int(n_code, code, 0);
38866        xmlResetLastError();
38867        if (mem_base != xmlMemBlocks()) {
38868            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
38869	           xmlMemBlocks() - mem_base);
38870	    test_ret++;
38871            printf(" %d", n_code);
38872            printf("\n");
38873        }
38874    }
38875    function_tests++;
38876#endif
38877
38878    return(test_ret);
38879}
38880
38881
38882static int
38883test_xmlUCSIsMathematicalOperators(void) {
38884    int test_ret = 0;
38885
38886#if defined(LIBXML_UNICODE_ENABLED)
38887    int mem_base;
38888    int ret_val;
38889    int code; /* UCS code point */
38890    int n_code;
38891
38892    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38893        mem_base = xmlMemBlocks();
38894        code = gen_int(n_code, 0);
38895
38896        ret_val = xmlUCSIsMathematicalOperators(code);
38897        desret_int(ret_val);
38898        call_tests++;
38899        des_int(n_code, code, 0);
38900        xmlResetLastError();
38901        if (mem_base != xmlMemBlocks()) {
38902            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
38903	           xmlMemBlocks() - mem_base);
38904	    test_ret++;
38905            printf(" %d", n_code);
38906            printf("\n");
38907        }
38908    }
38909    function_tests++;
38910#endif
38911
38912    return(test_ret);
38913}
38914
38915
38916static int
38917test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
38918    int test_ret = 0;
38919
38920#if defined(LIBXML_UNICODE_ENABLED)
38921    int mem_base;
38922    int ret_val;
38923    int code; /* UCS code point */
38924    int n_code;
38925
38926    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38927        mem_base = xmlMemBlocks();
38928        code = gen_int(n_code, 0);
38929
38930        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
38931        desret_int(ret_val);
38932        call_tests++;
38933        des_int(n_code, code, 0);
38934        xmlResetLastError();
38935        if (mem_base != xmlMemBlocks()) {
38936            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
38937	           xmlMemBlocks() - mem_base);
38938	    test_ret++;
38939            printf(" %d", n_code);
38940            printf("\n");
38941        }
38942    }
38943    function_tests++;
38944#endif
38945
38946    return(test_ret);
38947}
38948
38949
38950static int
38951test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
38952    int test_ret = 0;
38953
38954#if defined(LIBXML_UNICODE_ENABLED)
38955    int mem_base;
38956    int ret_val;
38957    int code; /* UCS code point */
38958    int n_code;
38959
38960    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38961        mem_base = xmlMemBlocks();
38962        code = gen_int(n_code, 0);
38963
38964        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
38965        desret_int(ret_val);
38966        call_tests++;
38967        des_int(n_code, code, 0);
38968        xmlResetLastError();
38969        if (mem_base != xmlMemBlocks()) {
38970            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
38971	           xmlMemBlocks() - mem_base);
38972	    test_ret++;
38973            printf(" %d", n_code);
38974            printf("\n");
38975        }
38976    }
38977    function_tests++;
38978#endif
38979
38980    return(test_ret);
38981}
38982
38983
38984static int
38985test_xmlUCSIsMiscellaneousSymbols(void) {
38986    int test_ret = 0;
38987
38988#if defined(LIBXML_UNICODE_ENABLED)
38989    int mem_base;
38990    int ret_val;
38991    int code; /* UCS code point */
38992    int n_code;
38993
38994    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38995        mem_base = xmlMemBlocks();
38996        code = gen_int(n_code, 0);
38997
38998        ret_val = xmlUCSIsMiscellaneousSymbols(code);
38999        desret_int(ret_val);
39000        call_tests++;
39001        des_int(n_code, code, 0);
39002        xmlResetLastError();
39003        if (mem_base != xmlMemBlocks()) {
39004            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
39005	           xmlMemBlocks() - mem_base);
39006	    test_ret++;
39007            printf(" %d", n_code);
39008            printf("\n");
39009        }
39010    }
39011    function_tests++;
39012#endif
39013
39014    return(test_ret);
39015}
39016
39017
39018static int
39019test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
39020    int test_ret = 0;
39021
39022#if defined(LIBXML_UNICODE_ENABLED)
39023    int mem_base;
39024    int ret_val;
39025    int code; /* UCS code point */
39026    int n_code;
39027
39028    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39029        mem_base = xmlMemBlocks();
39030        code = gen_int(n_code, 0);
39031
39032        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
39033        desret_int(ret_val);
39034        call_tests++;
39035        des_int(n_code, code, 0);
39036        xmlResetLastError();
39037        if (mem_base != xmlMemBlocks()) {
39038            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
39039	           xmlMemBlocks() - mem_base);
39040	    test_ret++;
39041            printf(" %d", n_code);
39042            printf("\n");
39043        }
39044    }
39045    function_tests++;
39046#endif
39047
39048    return(test_ret);
39049}
39050
39051
39052static int
39053test_xmlUCSIsMiscellaneousTechnical(void) {
39054    int test_ret = 0;
39055
39056#if defined(LIBXML_UNICODE_ENABLED)
39057    int mem_base;
39058    int ret_val;
39059    int code; /* UCS code point */
39060    int n_code;
39061
39062    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39063        mem_base = xmlMemBlocks();
39064        code = gen_int(n_code, 0);
39065
39066        ret_val = xmlUCSIsMiscellaneousTechnical(code);
39067        desret_int(ret_val);
39068        call_tests++;
39069        des_int(n_code, code, 0);
39070        xmlResetLastError();
39071        if (mem_base != xmlMemBlocks()) {
39072            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
39073	           xmlMemBlocks() - mem_base);
39074	    test_ret++;
39075            printf(" %d", n_code);
39076            printf("\n");
39077        }
39078    }
39079    function_tests++;
39080#endif
39081
39082    return(test_ret);
39083}
39084
39085
39086static int
39087test_xmlUCSIsMongolian(void) {
39088    int test_ret = 0;
39089
39090#if defined(LIBXML_UNICODE_ENABLED)
39091    int mem_base;
39092    int ret_val;
39093    int code; /* UCS code point */
39094    int n_code;
39095
39096    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39097        mem_base = xmlMemBlocks();
39098        code = gen_int(n_code, 0);
39099
39100        ret_val = xmlUCSIsMongolian(code);
39101        desret_int(ret_val);
39102        call_tests++;
39103        des_int(n_code, code, 0);
39104        xmlResetLastError();
39105        if (mem_base != xmlMemBlocks()) {
39106            printf("Leak of %d blocks found in xmlUCSIsMongolian",
39107	           xmlMemBlocks() - mem_base);
39108	    test_ret++;
39109            printf(" %d", n_code);
39110            printf("\n");
39111        }
39112    }
39113    function_tests++;
39114#endif
39115
39116    return(test_ret);
39117}
39118
39119
39120static int
39121test_xmlUCSIsMusicalSymbols(void) {
39122    int test_ret = 0;
39123
39124#if defined(LIBXML_UNICODE_ENABLED)
39125    int mem_base;
39126    int ret_val;
39127    int code; /* UCS code point */
39128    int n_code;
39129
39130    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39131        mem_base = xmlMemBlocks();
39132        code = gen_int(n_code, 0);
39133
39134        ret_val = xmlUCSIsMusicalSymbols(code);
39135        desret_int(ret_val);
39136        call_tests++;
39137        des_int(n_code, code, 0);
39138        xmlResetLastError();
39139        if (mem_base != xmlMemBlocks()) {
39140            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
39141	           xmlMemBlocks() - mem_base);
39142	    test_ret++;
39143            printf(" %d", n_code);
39144            printf("\n");
39145        }
39146    }
39147    function_tests++;
39148#endif
39149
39150    return(test_ret);
39151}
39152
39153
39154static int
39155test_xmlUCSIsMyanmar(void) {
39156    int test_ret = 0;
39157
39158#if defined(LIBXML_UNICODE_ENABLED)
39159    int mem_base;
39160    int ret_val;
39161    int code; /* UCS code point */
39162    int n_code;
39163
39164    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39165        mem_base = xmlMemBlocks();
39166        code = gen_int(n_code, 0);
39167
39168        ret_val = xmlUCSIsMyanmar(code);
39169        desret_int(ret_val);
39170        call_tests++;
39171        des_int(n_code, code, 0);
39172        xmlResetLastError();
39173        if (mem_base != xmlMemBlocks()) {
39174            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
39175	           xmlMemBlocks() - mem_base);
39176	    test_ret++;
39177            printf(" %d", n_code);
39178            printf("\n");
39179        }
39180    }
39181    function_tests++;
39182#endif
39183
39184    return(test_ret);
39185}
39186
39187
39188static int
39189test_xmlUCSIsNumberForms(void) {
39190    int test_ret = 0;
39191
39192#if defined(LIBXML_UNICODE_ENABLED)
39193    int mem_base;
39194    int ret_val;
39195    int code; /* UCS code point */
39196    int n_code;
39197
39198    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39199        mem_base = xmlMemBlocks();
39200        code = gen_int(n_code, 0);
39201
39202        ret_val = xmlUCSIsNumberForms(code);
39203        desret_int(ret_val);
39204        call_tests++;
39205        des_int(n_code, code, 0);
39206        xmlResetLastError();
39207        if (mem_base != xmlMemBlocks()) {
39208            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
39209	           xmlMemBlocks() - mem_base);
39210	    test_ret++;
39211            printf(" %d", n_code);
39212            printf("\n");
39213        }
39214    }
39215    function_tests++;
39216#endif
39217
39218    return(test_ret);
39219}
39220
39221
39222static int
39223test_xmlUCSIsOgham(void) {
39224    int test_ret = 0;
39225
39226#if defined(LIBXML_UNICODE_ENABLED)
39227    int mem_base;
39228    int ret_val;
39229    int code; /* UCS code point */
39230    int n_code;
39231
39232    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39233        mem_base = xmlMemBlocks();
39234        code = gen_int(n_code, 0);
39235
39236        ret_val = xmlUCSIsOgham(code);
39237        desret_int(ret_val);
39238        call_tests++;
39239        des_int(n_code, code, 0);
39240        xmlResetLastError();
39241        if (mem_base != xmlMemBlocks()) {
39242            printf("Leak of %d blocks found in xmlUCSIsOgham",
39243	           xmlMemBlocks() - mem_base);
39244	    test_ret++;
39245            printf(" %d", n_code);
39246            printf("\n");
39247        }
39248    }
39249    function_tests++;
39250#endif
39251
39252    return(test_ret);
39253}
39254
39255
39256static int
39257test_xmlUCSIsOldItalic(void) {
39258    int test_ret = 0;
39259
39260#if defined(LIBXML_UNICODE_ENABLED)
39261    int mem_base;
39262    int ret_val;
39263    int code; /* UCS code point */
39264    int n_code;
39265
39266    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39267        mem_base = xmlMemBlocks();
39268        code = gen_int(n_code, 0);
39269
39270        ret_val = xmlUCSIsOldItalic(code);
39271        desret_int(ret_val);
39272        call_tests++;
39273        des_int(n_code, code, 0);
39274        xmlResetLastError();
39275        if (mem_base != xmlMemBlocks()) {
39276            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
39277	           xmlMemBlocks() - mem_base);
39278	    test_ret++;
39279            printf(" %d", n_code);
39280            printf("\n");
39281        }
39282    }
39283    function_tests++;
39284#endif
39285
39286    return(test_ret);
39287}
39288
39289
39290static int
39291test_xmlUCSIsOpticalCharacterRecognition(void) {
39292    int test_ret = 0;
39293
39294#if defined(LIBXML_UNICODE_ENABLED)
39295    int mem_base;
39296    int ret_val;
39297    int code; /* UCS code point */
39298    int n_code;
39299
39300    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39301        mem_base = xmlMemBlocks();
39302        code = gen_int(n_code, 0);
39303
39304        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
39305        desret_int(ret_val);
39306        call_tests++;
39307        des_int(n_code, code, 0);
39308        xmlResetLastError();
39309        if (mem_base != xmlMemBlocks()) {
39310            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
39311	           xmlMemBlocks() - mem_base);
39312	    test_ret++;
39313            printf(" %d", n_code);
39314            printf("\n");
39315        }
39316    }
39317    function_tests++;
39318#endif
39319
39320    return(test_ret);
39321}
39322
39323
39324static int
39325test_xmlUCSIsOriya(void) {
39326    int test_ret = 0;
39327
39328#if defined(LIBXML_UNICODE_ENABLED)
39329    int mem_base;
39330    int ret_val;
39331    int code; /* UCS code point */
39332    int n_code;
39333
39334    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39335        mem_base = xmlMemBlocks();
39336        code = gen_int(n_code, 0);
39337
39338        ret_val = xmlUCSIsOriya(code);
39339        desret_int(ret_val);
39340        call_tests++;
39341        des_int(n_code, code, 0);
39342        xmlResetLastError();
39343        if (mem_base != xmlMemBlocks()) {
39344            printf("Leak of %d blocks found in xmlUCSIsOriya",
39345	           xmlMemBlocks() - mem_base);
39346	    test_ret++;
39347            printf(" %d", n_code);
39348            printf("\n");
39349        }
39350    }
39351    function_tests++;
39352#endif
39353
39354    return(test_ret);
39355}
39356
39357
39358static int
39359test_xmlUCSIsOsmanya(void) {
39360    int test_ret = 0;
39361
39362#if defined(LIBXML_UNICODE_ENABLED)
39363    int mem_base;
39364    int ret_val;
39365    int code; /* UCS code point */
39366    int n_code;
39367
39368    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39369        mem_base = xmlMemBlocks();
39370        code = gen_int(n_code, 0);
39371
39372        ret_val = xmlUCSIsOsmanya(code);
39373        desret_int(ret_val);
39374        call_tests++;
39375        des_int(n_code, code, 0);
39376        xmlResetLastError();
39377        if (mem_base != xmlMemBlocks()) {
39378            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
39379	           xmlMemBlocks() - mem_base);
39380	    test_ret++;
39381            printf(" %d", n_code);
39382            printf("\n");
39383        }
39384    }
39385    function_tests++;
39386#endif
39387
39388    return(test_ret);
39389}
39390
39391
39392static int
39393test_xmlUCSIsPhoneticExtensions(void) {
39394    int test_ret = 0;
39395
39396#if defined(LIBXML_UNICODE_ENABLED)
39397    int mem_base;
39398    int ret_val;
39399    int code; /* UCS code point */
39400    int n_code;
39401
39402    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39403        mem_base = xmlMemBlocks();
39404        code = gen_int(n_code, 0);
39405
39406        ret_val = xmlUCSIsPhoneticExtensions(code);
39407        desret_int(ret_val);
39408        call_tests++;
39409        des_int(n_code, code, 0);
39410        xmlResetLastError();
39411        if (mem_base != xmlMemBlocks()) {
39412            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
39413	           xmlMemBlocks() - mem_base);
39414	    test_ret++;
39415            printf(" %d", n_code);
39416            printf("\n");
39417        }
39418    }
39419    function_tests++;
39420#endif
39421
39422    return(test_ret);
39423}
39424
39425
39426static int
39427test_xmlUCSIsPrivateUse(void) {
39428    int test_ret = 0;
39429
39430#if defined(LIBXML_UNICODE_ENABLED)
39431    int mem_base;
39432    int ret_val;
39433    int code; /* UCS code point */
39434    int n_code;
39435
39436    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39437        mem_base = xmlMemBlocks();
39438        code = gen_int(n_code, 0);
39439
39440        ret_val = xmlUCSIsPrivateUse(code);
39441        desret_int(ret_val);
39442        call_tests++;
39443        des_int(n_code, code, 0);
39444        xmlResetLastError();
39445        if (mem_base != xmlMemBlocks()) {
39446            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
39447	           xmlMemBlocks() - mem_base);
39448	    test_ret++;
39449            printf(" %d", n_code);
39450            printf("\n");
39451        }
39452    }
39453    function_tests++;
39454#endif
39455
39456    return(test_ret);
39457}
39458
39459
39460static int
39461test_xmlUCSIsPrivateUseArea(void) {
39462    int test_ret = 0;
39463
39464#if defined(LIBXML_UNICODE_ENABLED)
39465    int mem_base;
39466    int ret_val;
39467    int code; /* UCS code point */
39468    int n_code;
39469
39470    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39471        mem_base = xmlMemBlocks();
39472        code = gen_int(n_code, 0);
39473
39474        ret_val = xmlUCSIsPrivateUseArea(code);
39475        desret_int(ret_val);
39476        call_tests++;
39477        des_int(n_code, code, 0);
39478        xmlResetLastError();
39479        if (mem_base != xmlMemBlocks()) {
39480            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
39481	           xmlMemBlocks() - mem_base);
39482	    test_ret++;
39483            printf(" %d", n_code);
39484            printf("\n");
39485        }
39486    }
39487    function_tests++;
39488#endif
39489
39490    return(test_ret);
39491}
39492
39493
39494static int
39495test_xmlUCSIsRunic(void) {
39496    int test_ret = 0;
39497
39498#if defined(LIBXML_UNICODE_ENABLED)
39499    int mem_base;
39500    int ret_val;
39501    int code; /* UCS code point */
39502    int n_code;
39503
39504    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39505        mem_base = xmlMemBlocks();
39506        code = gen_int(n_code, 0);
39507
39508        ret_val = xmlUCSIsRunic(code);
39509        desret_int(ret_val);
39510        call_tests++;
39511        des_int(n_code, code, 0);
39512        xmlResetLastError();
39513        if (mem_base != xmlMemBlocks()) {
39514            printf("Leak of %d blocks found in xmlUCSIsRunic",
39515	           xmlMemBlocks() - mem_base);
39516	    test_ret++;
39517            printf(" %d", n_code);
39518            printf("\n");
39519        }
39520    }
39521    function_tests++;
39522#endif
39523
39524    return(test_ret);
39525}
39526
39527
39528static int
39529test_xmlUCSIsShavian(void) {
39530    int test_ret = 0;
39531
39532#if defined(LIBXML_UNICODE_ENABLED)
39533    int mem_base;
39534    int ret_val;
39535    int code; /* UCS code point */
39536    int n_code;
39537
39538    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39539        mem_base = xmlMemBlocks();
39540        code = gen_int(n_code, 0);
39541
39542        ret_val = xmlUCSIsShavian(code);
39543        desret_int(ret_val);
39544        call_tests++;
39545        des_int(n_code, code, 0);
39546        xmlResetLastError();
39547        if (mem_base != xmlMemBlocks()) {
39548            printf("Leak of %d blocks found in xmlUCSIsShavian",
39549	           xmlMemBlocks() - mem_base);
39550	    test_ret++;
39551            printf(" %d", n_code);
39552            printf("\n");
39553        }
39554    }
39555    function_tests++;
39556#endif
39557
39558    return(test_ret);
39559}
39560
39561
39562static int
39563test_xmlUCSIsSinhala(void) {
39564    int test_ret = 0;
39565
39566#if defined(LIBXML_UNICODE_ENABLED)
39567    int mem_base;
39568    int ret_val;
39569    int code; /* UCS code point */
39570    int n_code;
39571
39572    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39573        mem_base = xmlMemBlocks();
39574        code = gen_int(n_code, 0);
39575
39576        ret_val = xmlUCSIsSinhala(code);
39577        desret_int(ret_val);
39578        call_tests++;
39579        des_int(n_code, code, 0);
39580        xmlResetLastError();
39581        if (mem_base != xmlMemBlocks()) {
39582            printf("Leak of %d blocks found in xmlUCSIsSinhala",
39583	           xmlMemBlocks() - mem_base);
39584	    test_ret++;
39585            printf(" %d", n_code);
39586            printf("\n");
39587        }
39588    }
39589    function_tests++;
39590#endif
39591
39592    return(test_ret);
39593}
39594
39595
39596static int
39597test_xmlUCSIsSmallFormVariants(void) {
39598    int test_ret = 0;
39599
39600#if defined(LIBXML_UNICODE_ENABLED)
39601    int mem_base;
39602    int ret_val;
39603    int code; /* UCS code point */
39604    int n_code;
39605
39606    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39607        mem_base = xmlMemBlocks();
39608        code = gen_int(n_code, 0);
39609
39610        ret_val = xmlUCSIsSmallFormVariants(code);
39611        desret_int(ret_val);
39612        call_tests++;
39613        des_int(n_code, code, 0);
39614        xmlResetLastError();
39615        if (mem_base != xmlMemBlocks()) {
39616            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
39617	           xmlMemBlocks() - mem_base);
39618	    test_ret++;
39619            printf(" %d", n_code);
39620            printf("\n");
39621        }
39622    }
39623    function_tests++;
39624#endif
39625
39626    return(test_ret);
39627}
39628
39629
39630static int
39631test_xmlUCSIsSpacingModifierLetters(void) {
39632    int test_ret = 0;
39633
39634#if defined(LIBXML_UNICODE_ENABLED)
39635    int mem_base;
39636    int ret_val;
39637    int code; /* UCS code point */
39638    int n_code;
39639
39640    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39641        mem_base = xmlMemBlocks();
39642        code = gen_int(n_code, 0);
39643
39644        ret_val = xmlUCSIsSpacingModifierLetters(code);
39645        desret_int(ret_val);
39646        call_tests++;
39647        des_int(n_code, code, 0);
39648        xmlResetLastError();
39649        if (mem_base != xmlMemBlocks()) {
39650            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
39651	           xmlMemBlocks() - mem_base);
39652	    test_ret++;
39653            printf(" %d", n_code);
39654            printf("\n");
39655        }
39656    }
39657    function_tests++;
39658#endif
39659
39660    return(test_ret);
39661}
39662
39663
39664static int
39665test_xmlUCSIsSpecials(void) {
39666    int test_ret = 0;
39667
39668#if defined(LIBXML_UNICODE_ENABLED)
39669    int mem_base;
39670    int ret_val;
39671    int code; /* UCS code point */
39672    int n_code;
39673
39674    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39675        mem_base = xmlMemBlocks();
39676        code = gen_int(n_code, 0);
39677
39678        ret_val = xmlUCSIsSpecials(code);
39679        desret_int(ret_val);
39680        call_tests++;
39681        des_int(n_code, code, 0);
39682        xmlResetLastError();
39683        if (mem_base != xmlMemBlocks()) {
39684            printf("Leak of %d blocks found in xmlUCSIsSpecials",
39685	           xmlMemBlocks() - mem_base);
39686	    test_ret++;
39687            printf(" %d", n_code);
39688            printf("\n");
39689        }
39690    }
39691    function_tests++;
39692#endif
39693
39694    return(test_ret);
39695}
39696
39697
39698static int
39699test_xmlUCSIsSuperscriptsandSubscripts(void) {
39700    int test_ret = 0;
39701
39702#if defined(LIBXML_UNICODE_ENABLED)
39703    int mem_base;
39704    int ret_val;
39705    int code; /* UCS code point */
39706    int n_code;
39707
39708    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39709        mem_base = xmlMemBlocks();
39710        code = gen_int(n_code, 0);
39711
39712        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
39713        desret_int(ret_val);
39714        call_tests++;
39715        des_int(n_code, code, 0);
39716        xmlResetLastError();
39717        if (mem_base != xmlMemBlocks()) {
39718            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
39719	           xmlMemBlocks() - mem_base);
39720	    test_ret++;
39721            printf(" %d", n_code);
39722            printf("\n");
39723        }
39724    }
39725    function_tests++;
39726#endif
39727
39728    return(test_ret);
39729}
39730
39731
39732static int
39733test_xmlUCSIsSupplementalArrowsA(void) {
39734    int test_ret = 0;
39735
39736#if defined(LIBXML_UNICODE_ENABLED)
39737    int mem_base;
39738    int ret_val;
39739    int code; /* UCS code point */
39740    int n_code;
39741
39742    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39743        mem_base = xmlMemBlocks();
39744        code = gen_int(n_code, 0);
39745
39746        ret_val = xmlUCSIsSupplementalArrowsA(code);
39747        desret_int(ret_val);
39748        call_tests++;
39749        des_int(n_code, code, 0);
39750        xmlResetLastError();
39751        if (mem_base != xmlMemBlocks()) {
39752            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
39753	           xmlMemBlocks() - mem_base);
39754	    test_ret++;
39755            printf(" %d", n_code);
39756            printf("\n");
39757        }
39758    }
39759    function_tests++;
39760#endif
39761
39762    return(test_ret);
39763}
39764
39765
39766static int
39767test_xmlUCSIsSupplementalArrowsB(void) {
39768    int test_ret = 0;
39769
39770#if defined(LIBXML_UNICODE_ENABLED)
39771    int mem_base;
39772    int ret_val;
39773    int code; /* UCS code point */
39774    int n_code;
39775
39776    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39777        mem_base = xmlMemBlocks();
39778        code = gen_int(n_code, 0);
39779
39780        ret_val = xmlUCSIsSupplementalArrowsB(code);
39781        desret_int(ret_val);
39782        call_tests++;
39783        des_int(n_code, code, 0);
39784        xmlResetLastError();
39785        if (mem_base != xmlMemBlocks()) {
39786            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
39787	           xmlMemBlocks() - mem_base);
39788	    test_ret++;
39789            printf(" %d", n_code);
39790            printf("\n");
39791        }
39792    }
39793    function_tests++;
39794#endif
39795
39796    return(test_ret);
39797}
39798
39799
39800static int
39801test_xmlUCSIsSupplementalMathematicalOperators(void) {
39802    int test_ret = 0;
39803
39804#if defined(LIBXML_UNICODE_ENABLED)
39805    int mem_base;
39806    int ret_val;
39807    int code; /* UCS code point */
39808    int n_code;
39809
39810    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39811        mem_base = xmlMemBlocks();
39812        code = gen_int(n_code, 0);
39813
39814        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
39815        desret_int(ret_val);
39816        call_tests++;
39817        des_int(n_code, code, 0);
39818        xmlResetLastError();
39819        if (mem_base != xmlMemBlocks()) {
39820            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
39821	           xmlMemBlocks() - mem_base);
39822	    test_ret++;
39823            printf(" %d", n_code);
39824            printf("\n");
39825        }
39826    }
39827    function_tests++;
39828#endif
39829
39830    return(test_ret);
39831}
39832
39833
39834static int
39835test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
39836    int test_ret = 0;
39837
39838#if defined(LIBXML_UNICODE_ENABLED)
39839    int mem_base;
39840    int ret_val;
39841    int code; /* UCS code point */
39842    int n_code;
39843
39844    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39845        mem_base = xmlMemBlocks();
39846        code = gen_int(n_code, 0);
39847
39848        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
39849        desret_int(ret_val);
39850        call_tests++;
39851        des_int(n_code, code, 0);
39852        xmlResetLastError();
39853        if (mem_base != xmlMemBlocks()) {
39854            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
39855	           xmlMemBlocks() - mem_base);
39856	    test_ret++;
39857            printf(" %d", n_code);
39858            printf("\n");
39859        }
39860    }
39861    function_tests++;
39862#endif
39863
39864    return(test_ret);
39865}
39866
39867
39868static int
39869test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
39870    int test_ret = 0;
39871
39872#if defined(LIBXML_UNICODE_ENABLED)
39873    int mem_base;
39874    int ret_val;
39875    int code; /* UCS code point */
39876    int n_code;
39877
39878    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39879        mem_base = xmlMemBlocks();
39880        code = gen_int(n_code, 0);
39881
39882        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
39883        desret_int(ret_val);
39884        call_tests++;
39885        des_int(n_code, code, 0);
39886        xmlResetLastError();
39887        if (mem_base != xmlMemBlocks()) {
39888            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
39889	           xmlMemBlocks() - mem_base);
39890	    test_ret++;
39891            printf(" %d", n_code);
39892            printf("\n");
39893        }
39894    }
39895    function_tests++;
39896#endif
39897
39898    return(test_ret);
39899}
39900
39901
39902static int
39903test_xmlUCSIsSyriac(void) {
39904    int test_ret = 0;
39905
39906#if defined(LIBXML_UNICODE_ENABLED)
39907    int mem_base;
39908    int ret_val;
39909    int code; /* UCS code point */
39910    int n_code;
39911
39912    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39913        mem_base = xmlMemBlocks();
39914        code = gen_int(n_code, 0);
39915
39916        ret_val = xmlUCSIsSyriac(code);
39917        desret_int(ret_val);
39918        call_tests++;
39919        des_int(n_code, code, 0);
39920        xmlResetLastError();
39921        if (mem_base != xmlMemBlocks()) {
39922            printf("Leak of %d blocks found in xmlUCSIsSyriac",
39923	           xmlMemBlocks() - mem_base);
39924	    test_ret++;
39925            printf(" %d", n_code);
39926            printf("\n");
39927        }
39928    }
39929    function_tests++;
39930#endif
39931
39932    return(test_ret);
39933}
39934
39935
39936static int
39937test_xmlUCSIsTagalog(void) {
39938    int test_ret = 0;
39939
39940#if defined(LIBXML_UNICODE_ENABLED)
39941    int mem_base;
39942    int ret_val;
39943    int code; /* UCS code point */
39944    int n_code;
39945
39946    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39947        mem_base = xmlMemBlocks();
39948        code = gen_int(n_code, 0);
39949
39950        ret_val = xmlUCSIsTagalog(code);
39951        desret_int(ret_val);
39952        call_tests++;
39953        des_int(n_code, code, 0);
39954        xmlResetLastError();
39955        if (mem_base != xmlMemBlocks()) {
39956            printf("Leak of %d blocks found in xmlUCSIsTagalog",
39957	           xmlMemBlocks() - mem_base);
39958	    test_ret++;
39959            printf(" %d", n_code);
39960            printf("\n");
39961        }
39962    }
39963    function_tests++;
39964#endif
39965
39966    return(test_ret);
39967}
39968
39969
39970static int
39971test_xmlUCSIsTagbanwa(void) {
39972    int test_ret = 0;
39973
39974#if defined(LIBXML_UNICODE_ENABLED)
39975    int mem_base;
39976    int ret_val;
39977    int code; /* UCS code point */
39978    int n_code;
39979
39980    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39981        mem_base = xmlMemBlocks();
39982        code = gen_int(n_code, 0);
39983
39984        ret_val = xmlUCSIsTagbanwa(code);
39985        desret_int(ret_val);
39986        call_tests++;
39987        des_int(n_code, code, 0);
39988        xmlResetLastError();
39989        if (mem_base != xmlMemBlocks()) {
39990            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
39991	           xmlMemBlocks() - mem_base);
39992	    test_ret++;
39993            printf(" %d", n_code);
39994            printf("\n");
39995        }
39996    }
39997    function_tests++;
39998#endif
39999
40000    return(test_ret);
40001}
40002
40003
40004static int
40005test_xmlUCSIsTags(void) {
40006    int test_ret = 0;
40007
40008#if defined(LIBXML_UNICODE_ENABLED)
40009    int mem_base;
40010    int ret_val;
40011    int code; /* UCS code point */
40012    int n_code;
40013
40014    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40015        mem_base = xmlMemBlocks();
40016        code = gen_int(n_code, 0);
40017
40018        ret_val = xmlUCSIsTags(code);
40019        desret_int(ret_val);
40020        call_tests++;
40021        des_int(n_code, code, 0);
40022        xmlResetLastError();
40023        if (mem_base != xmlMemBlocks()) {
40024            printf("Leak of %d blocks found in xmlUCSIsTags",
40025	           xmlMemBlocks() - mem_base);
40026	    test_ret++;
40027            printf(" %d", n_code);
40028            printf("\n");
40029        }
40030    }
40031    function_tests++;
40032#endif
40033
40034    return(test_ret);
40035}
40036
40037
40038static int
40039test_xmlUCSIsTaiLe(void) {
40040    int test_ret = 0;
40041
40042#if defined(LIBXML_UNICODE_ENABLED)
40043    int mem_base;
40044    int ret_val;
40045    int code; /* UCS code point */
40046    int n_code;
40047
40048    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40049        mem_base = xmlMemBlocks();
40050        code = gen_int(n_code, 0);
40051
40052        ret_val = xmlUCSIsTaiLe(code);
40053        desret_int(ret_val);
40054        call_tests++;
40055        des_int(n_code, code, 0);
40056        xmlResetLastError();
40057        if (mem_base != xmlMemBlocks()) {
40058            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
40059	           xmlMemBlocks() - mem_base);
40060	    test_ret++;
40061            printf(" %d", n_code);
40062            printf("\n");
40063        }
40064    }
40065    function_tests++;
40066#endif
40067
40068    return(test_ret);
40069}
40070
40071
40072static int
40073test_xmlUCSIsTaiXuanJingSymbols(void) {
40074    int test_ret = 0;
40075
40076#if defined(LIBXML_UNICODE_ENABLED)
40077    int mem_base;
40078    int ret_val;
40079    int code; /* UCS code point */
40080    int n_code;
40081
40082    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40083        mem_base = xmlMemBlocks();
40084        code = gen_int(n_code, 0);
40085
40086        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
40087        desret_int(ret_val);
40088        call_tests++;
40089        des_int(n_code, code, 0);
40090        xmlResetLastError();
40091        if (mem_base != xmlMemBlocks()) {
40092            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
40093	           xmlMemBlocks() - mem_base);
40094	    test_ret++;
40095            printf(" %d", n_code);
40096            printf("\n");
40097        }
40098    }
40099    function_tests++;
40100#endif
40101
40102    return(test_ret);
40103}
40104
40105
40106static int
40107test_xmlUCSIsTamil(void) {
40108    int test_ret = 0;
40109
40110#if defined(LIBXML_UNICODE_ENABLED)
40111    int mem_base;
40112    int ret_val;
40113    int code; /* UCS code point */
40114    int n_code;
40115
40116    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40117        mem_base = xmlMemBlocks();
40118        code = gen_int(n_code, 0);
40119
40120        ret_val = xmlUCSIsTamil(code);
40121        desret_int(ret_val);
40122        call_tests++;
40123        des_int(n_code, code, 0);
40124        xmlResetLastError();
40125        if (mem_base != xmlMemBlocks()) {
40126            printf("Leak of %d blocks found in xmlUCSIsTamil",
40127	           xmlMemBlocks() - mem_base);
40128	    test_ret++;
40129            printf(" %d", n_code);
40130            printf("\n");
40131        }
40132    }
40133    function_tests++;
40134#endif
40135
40136    return(test_ret);
40137}
40138
40139
40140static int
40141test_xmlUCSIsTelugu(void) {
40142    int test_ret = 0;
40143
40144#if defined(LIBXML_UNICODE_ENABLED)
40145    int mem_base;
40146    int ret_val;
40147    int code; /* UCS code point */
40148    int n_code;
40149
40150    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40151        mem_base = xmlMemBlocks();
40152        code = gen_int(n_code, 0);
40153
40154        ret_val = xmlUCSIsTelugu(code);
40155        desret_int(ret_val);
40156        call_tests++;
40157        des_int(n_code, code, 0);
40158        xmlResetLastError();
40159        if (mem_base != xmlMemBlocks()) {
40160            printf("Leak of %d blocks found in xmlUCSIsTelugu",
40161	           xmlMemBlocks() - mem_base);
40162	    test_ret++;
40163            printf(" %d", n_code);
40164            printf("\n");
40165        }
40166    }
40167    function_tests++;
40168#endif
40169
40170    return(test_ret);
40171}
40172
40173
40174static int
40175test_xmlUCSIsThaana(void) {
40176    int test_ret = 0;
40177
40178#if defined(LIBXML_UNICODE_ENABLED)
40179    int mem_base;
40180    int ret_val;
40181    int code; /* UCS code point */
40182    int n_code;
40183
40184    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40185        mem_base = xmlMemBlocks();
40186        code = gen_int(n_code, 0);
40187
40188        ret_val = xmlUCSIsThaana(code);
40189        desret_int(ret_val);
40190        call_tests++;
40191        des_int(n_code, code, 0);
40192        xmlResetLastError();
40193        if (mem_base != xmlMemBlocks()) {
40194            printf("Leak of %d blocks found in xmlUCSIsThaana",
40195	           xmlMemBlocks() - mem_base);
40196	    test_ret++;
40197            printf(" %d", n_code);
40198            printf("\n");
40199        }
40200    }
40201    function_tests++;
40202#endif
40203
40204    return(test_ret);
40205}
40206
40207
40208static int
40209test_xmlUCSIsThai(void) {
40210    int test_ret = 0;
40211
40212#if defined(LIBXML_UNICODE_ENABLED)
40213    int mem_base;
40214    int ret_val;
40215    int code; /* UCS code point */
40216    int n_code;
40217
40218    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40219        mem_base = xmlMemBlocks();
40220        code = gen_int(n_code, 0);
40221
40222        ret_val = xmlUCSIsThai(code);
40223        desret_int(ret_val);
40224        call_tests++;
40225        des_int(n_code, code, 0);
40226        xmlResetLastError();
40227        if (mem_base != xmlMemBlocks()) {
40228            printf("Leak of %d blocks found in xmlUCSIsThai",
40229	           xmlMemBlocks() - mem_base);
40230	    test_ret++;
40231            printf(" %d", n_code);
40232            printf("\n");
40233        }
40234    }
40235    function_tests++;
40236#endif
40237
40238    return(test_ret);
40239}
40240
40241
40242static int
40243test_xmlUCSIsTibetan(void) {
40244    int test_ret = 0;
40245
40246#if defined(LIBXML_UNICODE_ENABLED)
40247    int mem_base;
40248    int ret_val;
40249    int code; /* UCS code point */
40250    int n_code;
40251
40252    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40253        mem_base = xmlMemBlocks();
40254        code = gen_int(n_code, 0);
40255
40256        ret_val = xmlUCSIsTibetan(code);
40257        desret_int(ret_val);
40258        call_tests++;
40259        des_int(n_code, code, 0);
40260        xmlResetLastError();
40261        if (mem_base != xmlMemBlocks()) {
40262            printf("Leak of %d blocks found in xmlUCSIsTibetan",
40263	           xmlMemBlocks() - mem_base);
40264	    test_ret++;
40265            printf(" %d", n_code);
40266            printf("\n");
40267        }
40268    }
40269    function_tests++;
40270#endif
40271
40272    return(test_ret);
40273}
40274
40275
40276static int
40277test_xmlUCSIsUgaritic(void) {
40278    int test_ret = 0;
40279
40280#if defined(LIBXML_UNICODE_ENABLED)
40281    int mem_base;
40282    int ret_val;
40283    int code; /* UCS code point */
40284    int n_code;
40285
40286    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40287        mem_base = xmlMemBlocks();
40288        code = gen_int(n_code, 0);
40289
40290        ret_val = xmlUCSIsUgaritic(code);
40291        desret_int(ret_val);
40292        call_tests++;
40293        des_int(n_code, code, 0);
40294        xmlResetLastError();
40295        if (mem_base != xmlMemBlocks()) {
40296            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
40297	           xmlMemBlocks() - mem_base);
40298	    test_ret++;
40299            printf(" %d", n_code);
40300            printf("\n");
40301        }
40302    }
40303    function_tests++;
40304#endif
40305
40306    return(test_ret);
40307}
40308
40309
40310static int
40311test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
40312    int test_ret = 0;
40313
40314#if defined(LIBXML_UNICODE_ENABLED)
40315    int mem_base;
40316    int ret_val;
40317    int code; /* UCS code point */
40318    int n_code;
40319
40320    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40321        mem_base = xmlMemBlocks();
40322        code = gen_int(n_code, 0);
40323
40324        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
40325        desret_int(ret_val);
40326        call_tests++;
40327        des_int(n_code, code, 0);
40328        xmlResetLastError();
40329        if (mem_base != xmlMemBlocks()) {
40330            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
40331	           xmlMemBlocks() - mem_base);
40332	    test_ret++;
40333            printf(" %d", n_code);
40334            printf("\n");
40335        }
40336    }
40337    function_tests++;
40338#endif
40339
40340    return(test_ret);
40341}
40342
40343
40344static int
40345test_xmlUCSIsVariationSelectors(void) {
40346    int test_ret = 0;
40347
40348#if defined(LIBXML_UNICODE_ENABLED)
40349    int mem_base;
40350    int ret_val;
40351    int code; /* UCS code point */
40352    int n_code;
40353
40354    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40355        mem_base = xmlMemBlocks();
40356        code = gen_int(n_code, 0);
40357
40358        ret_val = xmlUCSIsVariationSelectors(code);
40359        desret_int(ret_val);
40360        call_tests++;
40361        des_int(n_code, code, 0);
40362        xmlResetLastError();
40363        if (mem_base != xmlMemBlocks()) {
40364            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
40365	           xmlMemBlocks() - mem_base);
40366	    test_ret++;
40367            printf(" %d", n_code);
40368            printf("\n");
40369        }
40370    }
40371    function_tests++;
40372#endif
40373
40374    return(test_ret);
40375}
40376
40377
40378static int
40379test_xmlUCSIsVariationSelectorsSupplement(void) {
40380    int test_ret = 0;
40381
40382#if defined(LIBXML_UNICODE_ENABLED)
40383    int mem_base;
40384    int ret_val;
40385    int code; /* UCS code point */
40386    int n_code;
40387
40388    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40389        mem_base = xmlMemBlocks();
40390        code = gen_int(n_code, 0);
40391
40392        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
40393        desret_int(ret_val);
40394        call_tests++;
40395        des_int(n_code, code, 0);
40396        xmlResetLastError();
40397        if (mem_base != xmlMemBlocks()) {
40398            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
40399	           xmlMemBlocks() - mem_base);
40400	    test_ret++;
40401            printf(" %d", n_code);
40402            printf("\n");
40403        }
40404    }
40405    function_tests++;
40406#endif
40407
40408    return(test_ret);
40409}
40410
40411
40412static int
40413test_xmlUCSIsYiRadicals(void) {
40414    int test_ret = 0;
40415
40416#if defined(LIBXML_UNICODE_ENABLED)
40417    int mem_base;
40418    int ret_val;
40419    int code; /* UCS code point */
40420    int n_code;
40421
40422    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40423        mem_base = xmlMemBlocks();
40424        code = gen_int(n_code, 0);
40425
40426        ret_val = xmlUCSIsYiRadicals(code);
40427        desret_int(ret_val);
40428        call_tests++;
40429        des_int(n_code, code, 0);
40430        xmlResetLastError();
40431        if (mem_base != xmlMemBlocks()) {
40432            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
40433	           xmlMemBlocks() - mem_base);
40434	    test_ret++;
40435            printf(" %d", n_code);
40436            printf("\n");
40437        }
40438    }
40439    function_tests++;
40440#endif
40441
40442    return(test_ret);
40443}
40444
40445
40446static int
40447test_xmlUCSIsYiSyllables(void) {
40448    int test_ret = 0;
40449
40450#if defined(LIBXML_UNICODE_ENABLED)
40451    int mem_base;
40452    int ret_val;
40453    int code; /* UCS code point */
40454    int n_code;
40455
40456    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40457        mem_base = xmlMemBlocks();
40458        code = gen_int(n_code, 0);
40459
40460        ret_val = xmlUCSIsYiSyllables(code);
40461        desret_int(ret_val);
40462        call_tests++;
40463        des_int(n_code, code, 0);
40464        xmlResetLastError();
40465        if (mem_base != xmlMemBlocks()) {
40466            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
40467	           xmlMemBlocks() - mem_base);
40468	    test_ret++;
40469            printf(" %d", n_code);
40470            printf("\n");
40471        }
40472    }
40473    function_tests++;
40474#endif
40475
40476    return(test_ret);
40477}
40478
40479
40480static int
40481test_xmlUCSIsYijingHexagramSymbols(void) {
40482    int test_ret = 0;
40483
40484#if defined(LIBXML_UNICODE_ENABLED)
40485    int mem_base;
40486    int ret_val;
40487    int code; /* UCS code point */
40488    int n_code;
40489
40490    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40491        mem_base = xmlMemBlocks();
40492        code = gen_int(n_code, 0);
40493
40494        ret_val = xmlUCSIsYijingHexagramSymbols(code);
40495        desret_int(ret_val);
40496        call_tests++;
40497        des_int(n_code, code, 0);
40498        xmlResetLastError();
40499        if (mem_base != xmlMemBlocks()) {
40500            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
40501	           xmlMemBlocks() - mem_base);
40502	    test_ret++;
40503            printf(" %d", n_code);
40504            printf("\n");
40505        }
40506    }
40507    function_tests++;
40508#endif
40509
40510    return(test_ret);
40511}
40512
40513static int
40514test_xmlunicode(void) {
40515    int test_ret = 0;
40516
40517    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
40518    test_ret += test_xmlUCSIsAegeanNumbers();
40519    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
40520    test_ret += test_xmlUCSIsArabic();
40521    test_ret += test_xmlUCSIsArabicPresentationFormsA();
40522    test_ret += test_xmlUCSIsArabicPresentationFormsB();
40523    test_ret += test_xmlUCSIsArmenian();
40524    test_ret += test_xmlUCSIsArrows();
40525    test_ret += test_xmlUCSIsBasicLatin();
40526    test_ret += test_xmlUCSIsBengali();
40527    test_ret += test_xmlUCSIsBlock();
40528    test_ret += test_xmlUCSIsBlockElements();
40529    test_ret += test_xmlUCSIsBopomofo();
40530    test_ret += test_xmlUCSIsBopomofoExtended();
40531    test_ret += test_xmlUCSIsBoxDrawing();
40532    test_ret += test_xmlUCSIsBraillePatterns();
40533    test_ret += test_xmlUCSIsBuhid();
40534    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
40535    test_ret += test_xmlUCSIsCJKCompatibility();
40536    test_ret += test_xmlUCSIsCJKCompatibilityForms();
40537    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
40538    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
40539    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
40540    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
40541    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
40542    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
40543    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
40544    test_ret += test_xmlUCSIsCat();
40545    test_ret += test_xmlUCSIsCatC();
40546    test_ret += test_xmlUCSIsCatCc();
40547    test_ret += test_xmlUCSIsCatCf();
40548    test_ret += test_xmlUCSIsCatCo();
40549    test_ret += test_xmlUCSIsCatCs();
40550    test_ret += test_xmlUCSIsCatL();
40551    test_ret += test_xmlUCSIsCatLl();
40552    test_ret += test_xmlUCSIsCatLm();
40553    test_ret += test_xmlUCSIsCatLo();
40554    test_ret += test_xmlUCSIsCatLt();
40555    test_ret += test_xmlUCSIsCatLu();
40556    test_ret += test_xmlUCSIsCatM();
40557    test_ret += test_xmlUCSIsCatMc();
40558    test_ret += test_xmlUCSIsCatMe();
40559    test_ret += test_xmlUCSIsCatMn();
40560    test_ret += test_xmlUCSIsCatN();
40561    test_ret += test_xmlUCSIsCatNd();
40562    test_ret += test_xmlUCSIsCatNl();
40563    test_ret += test_xmlUCSIsCatNo();
40564    test_ret += test_xmlUCSIsCatP();
40565    test_ret += test_xmlUCSIsCatPc();
40566    test_ret += test_xmlUCSIsCatPd();
40567    test_ret += test_xmlUCSIsCatPe();
40568    test_ret += test_xmlUCSIsCatPf();
40569    test_ret += test_xmlUCSIsCatPi();
40570    test_ret += test_xmlUCSIsCatPo();
40571    test_ret += test_xmlUCSIsCatPs();
40572    test_ret += test_xmlUCSIsCatS();
40573    test_ret += test_xmlUCSIsCatSc();
40574    test_ret += test_xmlUCSIsCatSk();
40575    test_ret += test_xmlUCSIsCatSm();
40576    test_ret += test_xmlUCSIsCatSo();
40577    test_ret += test_xmlUCSIsCatZ();
40578    test_ret += test_xmlUCSIsCatZl();
40579    test_ret += test_xmlUCSIsCatZp();
40580    test_ret += test_xmlUCSIsCatZs();
40581    test_ret += test_xmlUCSIsCherokee();
40582    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
40583    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
40584    test_ret += test_xmlUCSIsCombiningHalfMarks();
40585    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
40586    test_ret += test_xmlUCSIsControlPictures();
40587    test_ret += test_xmlUCSIsCurrencySymbols();
40588    test_ret += test_xmlUCSIsCypriotSyllabary();
40589    test_ret += test_xmlUCSIsCyrillic();
40590    test_ret += test_xmlUCSIsCyrillicSupplement();
40591    test_ret += test_xmlUCSIsDeseret();
40592    test_ret += test_xmlUCSIsDevanagari();
40593    test_ret += test_xmlUCSIsDingbats();
40594    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
40595    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
40596    test_ret += test_xmlUCSIsEthiopic();
40597    test_ret += test_xmlUCSIsGeneralPunctuation();
40598    test_ret += test_xmlUCSIsGeometricShapes();
40599    test_ret += test_xmlUCSIsGeorgian();
40600    test_ret += test_xmlUCSIsGothic();
40601    test_ret += test_xmlUCSIsGreek();
40602    test_ret += test_xmlUCSIsGreekExtended();
40603    test_ret += test_xmlUCSIsGreekandCoptic();
40604    test_ret += test_xmlUCSIsGujarati();
40605    test_ret += test_xmlUCSIsGurmukhi();
40606    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
40607    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
40608    test_ret += test_xmlUCSIsHangulJamo();
40609    test_ret += test_xmlUCSIsHangulSyllables();
40610    test_ret += test_xmlUCSIsHanunoo();
40611    test_ret += test_xmlUCSIsHebrew();
40612    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
40613    test_ret += test_xmlUCSIsHighSurrogates();
40614    test_ret += test_xmlUCSIsHiragana();
40615    test_ret += test_xmlUCSIsIPAExtensions();
40616    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
40617    test_ret += test_xmlUCSIsKanbun();
40618    test_ret += test_xmlUCSIsKangxiRadicals();
40619    test_ret += test_xmlUCSIsKannada();
40620    test_ret += test_xmlUCSIsKatakana();
40621    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
40622    test_ret += test_xmlUCSIsKhmer();
40623    test_ret += test_xmlUCSIsKhmerSymbols();
40624    test_ret += test_xmlUCSIsLao();
40625    test_ret += test_xmlUCSIsLatin1Supplement();
40626    test_ret += test_xmlUCSIsLatinExtendedA();
40627    test_ret += test_xmlUCSIsLatinExtendedAdditional();
40628    test_ret += test_xmlUCSIsLatinExtendedB();
40629    test_ret += test_xmlUCSIsLetterlikeSymbols();
40630    test_ret += test_xmlUCSIsLimbu();
40631    test_ret += test_xmlUCSIsLinearBIdeograms();
40632    test_ret += test_xmlUCSIsLinearBSyllabary();
40633    test_ret += test_xmlUCSIsLowSurrogates();
40634    test_ret += test_xmlUCSIsMalayalam();
40635    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
40636    test_ret += test_xmlUCSIsMathematicalOperators();
40637    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
40638    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
40639    test_ret += test_xmlUCSIsMiscellaneousSymbols();
40640    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
40641    test_ret += test_xmlUCSIsMiscellaneousTechnical();
40642    test_ret += test_xmlUCSIsMongolian();
40643    test_ret += test_xmlUCSIsMusicalSymbols();
40644    test_ret += test_xmlUCSIsMyanmar();
40645    test_ret += test_xmlUCSIsNumberForms();
40646    test_ret += test_xmlUCSIsOgham();
40647    test_ret += test_xmlUCSIsOldItalic();
40648    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
40649    test_ret += test_xmlUCSIsOriya();
40650    test_ret += test_xmlUCSIsOsmanya();
40651    test_ret += test_xmlUCSIsPhoneticExtensions();
40652    test_ret += test_xmlUCSIsPrivateUse();
40653    test_ret += test_xmlUCSIsPrivateUseArea();
40654    test_ret += test_xmlUCSIsRunic();
40655    test_ret += test_xmlUCSIsShavian();
40656    test_ret += test_xmlUCSIsSinhala();
40657    test_ret += test_xmlUCSIsSmallFormVariants();
40658    test_ret += test_xmlUCSIsSpacingModifierLetters();
40659    test_ret += test_xmlUCSIsSpecials();
40660    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
40661    test_ret += test_xmlUCSIsSupplementalArrowsA();
40662    test_ret += test_xmlUCSIsSupplementalArrowsB();
40663    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
40664    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
40665    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
40666    test_ret += test_xmlUCSIsSyriac();
40667    test_ret += test_xmlUCSIsTagalog();
40668    test_ret += test_xmlUCSIsTagbanwa();
40669    test_ret += test_xmlUCSIsTags();
40670    test_ret += test_xmlUCSIsTaiLe();
40671    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
40672    test_ret += test_xmlUCSIsTamil();
40673    test_ret += test_xmlUCSIsTelugu();
40674    test_ret += test_xmlUCSIsThaana();
40675    test_ret += test_xmlUCSIsThai();
40676    test_ret += test_xmlUCSIsTibetan();
40677    test_ret += test_xmlUCSIsUgaritic();
40678    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
40679    test_ret += test_xmlUCSIsVariationSelectors();
40680    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
40681    test_ret += test_xmlUCSIsYiRadicals();
40682    test_ret += test_xmlUCSIsYiSyllables();
40683    test_ret += test_xmlUCSIsYijingHexagramSymbols();
40684
40685    if (test_ret != 0)
40686	printf("Module xmlunicode: %d errors\n", test_ret);
40687    return(test_ret);
40688}
40689
40690static int
40691test_xmlNewTextWriter(void) {
40692    int test_ret = 0;
40693
40694#if defined(LIBXML_WRITER_ENABLED)
40695    int mem_base;
40696    xmlTextWriterPtr ret_val;
40697    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
40698    int n_out;
40699
40700    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
40701        mem_base = xmlMemBlocks();
40702        out = gen_xmlOutputBufferPtr(n_out, 0);
40703
40704        ret_val = xmlNewTextWriter(out);
40705        if (ret_val != NULL) out = NULL;
40706        desret_xmlTextWriterPtr(ret_val);
40707        call_tests++;
40708        des_xmlOutputBufferPtr(n_out, out, 0);
40709        xmlResetLastError();
40710        if (mem_base != xmlMemBlocks()) {
40711            printf("Leak of %d blocks found in xmlNewTextWriter",
40712	           xmlMemBlocks() - mem_base);
40713	    test_ret++;
40714            printf(" %d", n_out);
40715            printf("\n");
40716        }
40717    }
40718    function_tests++;
40719#endif
40720
40721    return(test_ret);
40722}
40723
40724
40725static int
40726test_xmlNewTextWriterFilename(void) {
40727    int test_ret = 0;
40728
40729#if defined(LIBXML_WRITER_ENABLED)
40730    int mem_base;
40731    xmlTextWriterPtr ret_val;
40732    const char * uri; /* the URI of the resource for the output */
40733    int n_uri;
40734    int compression; /* compress the output? */
40735    int n_compression;
40736
40737    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
40738    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40739        mem_base = xmlMemBlocks();
40740        uri = gen_fileoutput(n_uri, 0);
40741        compression = gen_int(n_compression, 1);
40742
40743        ret_val = xmlNewTextWriterFilename(uri, compression);
40744        desret_xmlTextWriterPtr(ret_val);
40745        call_tests++;
40746        des_fileoutput(n_uri, uri, 0);
40747        des_int(n_compression, compression, 1);
40748        xmlResetLastError();
40749        if (mem_base != xmlMemBlocks()) {
40750            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
40751	           xmlMemBlocks() - mem_base);
40752	    test_ret++;
40753            printf(" %d", n_uri);
40754            printf(" %d", n_compression);
40755            printf("\n");
40756        }
40757    }
40758    }
40759    function_tests++;
40760#endif
40761
40762    return(test_ret);
40763}
40764
40765
40766static int
40767test_xmlNewTextWriterMemory(void) {
40768    int test_ret = 0;
40769
40770#if defined(LIBXML_WRITER_ENABLED)
40771    int mem_base;
40772    xmlTextWriterPtr ret_val;
40773    xmlBufferPtr buf; /* xmlBufferPtr */
40774    int n_buf;
40775    int compression; /* compress the output? */
40776    int n_compression;
40777
40778    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
40779    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40780        mem_base = xmlMemBlocks();
40781        buf = gen_xmlBufferPtr(n_buf, 0);
40782        compression = gen_int(n_compression, 1);
40783
40784        ret_val = xmlNewTextWriterMemory(buf, compression);
40785        desret_xmlTextWriterPtr(ret_val);
40786        call_tests++;
40787        des_xmlBufferPtr(n_buf, buf, 0);
40788        des_int(n_compression, compression, 1);
40789        xmlResetLastError();
40790        if (mem_base != xmlMemBlocks()) {
40791            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
40792	           xmlMemBlocks() - mem_base);
40793	    test_ret++;
40794            printf(" %d", n_buf);
40795            printf(" %d", n_compression);
40796            printf("\n");
40797        }
40798    }
40799    }
40800    function_tests++;
40801#endif
40802
40803    return(test_ret);
40804}
40805
40806
40807static int
40808test_xmlNewTextWriterPushParser(void) {
40809    int test_ret = 0;
40810
40811#if defined(LIBXML_WRITER_ENABLED)
40812    int mem_base;
40813    xmlTextWriterPtr ret_val;
40814    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
40815    int n_ctxt;
40816    int compression; /* compress the output? */
40817    int n_compression;
40818
40819    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
40820    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40821        mem_base = xmlMemBlocks();
40822        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
40823        compression = gen_int(n_compression, 1);
40824
40825        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
40826        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
40827        desret_xmlTextWriterPtr(ret_val);
40828        call_tests++;
40829        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
40830        des_int(n_compression, compression, 1);
40831        xmlResetLastError();
40832        if (mem_base != xmlMemBlocks()) {
40833            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
40834	           xmlMemBlocks() - mem_base);
40835	    test_ret++;
40836            printf(" %d", n_ctxt);
40837            printf(" %d", n_compression);
40838            printf("\n");
40839        }
40840    }
40841    }
40842    function_tests++;
40843#endif
40844
40845    return(test_ret);
40846}
40847
40848
40849static int
40850test_xmlNewTextWriterTree(void) {
40851    int test_ret = 0;
40852
40853#if defined(LIBXML_WRITER_ENABLED)
40854    int mem_base;
40855    xmlTextWriterPtr ret_val;
40856    xmlDocPtr doc; /* xmlDocPtr */
40857    int n_doc;
40858    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
40859    int n_node;
40860    int compression; /* compress the output? */
40861    int n_compression;
40862
40863    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
40864    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
40865    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
40866        mem_base = xmlMemBlocks();
40867        doc = gen_xmlDocPtr(n_doc, 0);
40868        node = gen_xmlNodePtr(n_node, 1);
40869        compression = gen_int(n_compression, 2);
40870
40871        ret_val = xmlNewTextWriterTree(doc, node, compression);
40872        desret_xmlTextWriterPtr(ret_val);
40873        call_tests++;
40874        des_xmlDocPtr(n_doc, doc, 0);
40875        des_xmlNodePtr(n_node, node, 1);
40876        des_int(n_compression, compression, 2);
40877        xmlResetLastError();
40878        if (mem_base != xmlMemBlocks()) {
40879            printf("Leak of %d blocks found in xmlNewTextWriterTree",
40880	           xmlMemBlocks() - mem_base);
40881	    test_ret++;
40882            printf(" %d", n_doc);
40883            printf(" %d", n_node);
40884            printf(" %d", n_compression);
40885            printf("\n");
40886        }
40887    }
40888    }
40889    }
40890    function_tests++;
40891#endif
40892
40893    return(test_ret);
40894}
40895
40896
40897static int
40898test_xmlTextWriterEndAttribute(void) {
40899    int test_ret = 0;
40900
40901#if defined(LIBXML_WRITER_ENABLED)
40902    int mem_base;
40903    int ret_val;
40904    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40905    int n_writer;
40906
40907    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40908        mem_base = xmlMemBlocks();
40909        writer = gen_xmlTextWriterPtr(n_writer, 0);
40910
40911        ret_val = xmlTextWriterEndAttribute(writer);
40912        desret_int(ret_val);
40913        call_tests++;
40914        des_xmlTextWriterPtr(n_writer, writer, 0);
40915        xmlResetLastError();
40916        if (mem_base != xmlMemBlocks()) {
40917            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
40918	           xmlMemBlocks() - mem_base);
40919	    test_ret++;
40920            printf(" %d", n_writer);
40921            printf("\n");
40922        }
40923    }
40924    function_tests++;
40925#endif
40926
40927    return(test_ret);
40928}
40929
40930
40931static int
40932test_xmlTextWriterEndCDATA(void) {
40933    int test_ret = 0;
40934
40935#if defined(LIBXML_WRITER_ENABLED)
40936    int mem_base;
40937    int ret_val;
40938    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40939    int n_writer;
40940
40941    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40942        mem_base = xmlMemBlocks();
40943        writer = gen_xmlTextWriterPtr(n_writer, 0);
40944
40945        ret_val = xmlTextWriterEndCDATA(writer);
40946        desret_int(ret_val);
40947        call_tests++;
40948        des_xmlTextWriterPtr(n_writer, writer, 0);
40949        xmlResetLastError();
40950        if (mem_base != xmlMemBlocks()) {
40951            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
40952	           xmlMemBlocks() - mem_base);
40953	    test_ret++;
40954            printf(" %d", n_writer);
40955            printf("\n");
40956        }
40957    }
40958    function_tests++;
40959#endif
40960
40961    return(test_ret);
40962}
40963
40964
40965static int
40966test_xmlTextWriterEndComment(void) {
40967    int test_ret = 0;
40968
40969#if defined(LIBXML_WRITER_ENABLED)
40970    int mem_base;
40971    int ret_val;
40972    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40973    int n_writer;
40974
40975    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40976        mem_base = xmlMemBlocks();
40977        writer = gen_xmlTextWriterPtr(n_writer, 0);
40978
40979        ret_val = xmlTextWriterEndComment(writer);
40980        desret_int(ret_val);
40981        call_tests++;
40982        des_xmlTextWriterPtr(n_writer, writer, 0);
40983        xmlResetLastError();
40984        if (mem_base != xmlMemBlocks()) {
40985            printf("Leak of %d blocks found in xmlTextWriterEndComment",
40986	           xmlMemBlocks() - mem_base);
40987	    test_ret++;
40988            printf(" %d", n_writer);
40989            printf("\n");
40990        }
40991    }
40992    function_tests++;
40993#endif
40994
40995    return(test_ret);
40996}
40997
40998
40999static int
41000test_xmlTextWriterEndDTD(void) {
41001    int test_ret = 0;
41002
41003#if defined(LIBXML_WRITER_ENABLED)
41004    int mem_base;
41005    int ret_val;
41006    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41007    int n_writer;
41008
41009    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41010        mem_base = xmlMemBlocks();
41011        writer = gen_xmlTextWriterPtr(n_writer, 0);
41012
41013        ret_val = xmlTextWriterEndDTD(writer);
41014        desret_int(ret_val);
41015        call_tests++;
41016        des_xmlTextWriterPtr(n_writer, writer, 0);
41017        xmlResetLastError();
41018        if (mem_base != xmlMemBlocks()) {
41019            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
41020	           xmlMemBlocks() - mem_base);
41021	    test_ret++;
41022            printf(" %d", n_writer);
41023            printf("\n");
41024        }
41025    }
41026    function_tests++;
41027#endif
41028
41029    return(test_ret);
41030}
41031
41032
41033static int
41034test_xmlTextWriterEndDTDAttlist(void) {
41035    int test_ret = 0;
41036
41037#if defined(LIBXML_WRITER_ENABLED)
41038    int mem_base;
41039    int ret_val;
41040    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41041    int n_writer;
41042
41043    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41044        mem_base = xmlMemBlocks();
41045        writer = gen_xmlTextWriterPtr(n_writer, 0);
41046
41047        ret_val = xmlTextWriterEndDTDAttlist(writer);
41048        desret_int(ret_val);
41049        call_tests++;
41050        des_xmlTextWriterPtr(n_writer, writer, 0);
41051        xmlResetLastError();
41052        if (mem_base != xmlMemBlocks()) {
41053            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
41054	           xmlMemBlocks() - mem_base);
41055	    test_ret++;
41056            printf(" %d", n_writer);
41057            printf("\n");
41058        }
41059    }
41060    function_tests++;
41061#endif
41062
41063    return(test_ret);
41064}
41065
41066
41067static int
41068test_xmlTextWriterEndDTDElement(void) {
41069    int test_ret = 0;
41070
41071#if defined(LIBXML_WRITER_ENABLED)
41072    int mem_base;
41073    int ret_val;
41074    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41075    int n_writer;
41076
41077    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41078        mem_base = xmlMemBlocks();
41079        writer = gen_xmlTextWriterPtr(n_writer, 0);
41080
41081        ret_val = xmlTextWriterEndDTDElement(writer);
41082        desret_int(ret_val);
41083        call_tests++;
41084        des_xmlTextWriterPtr(n_writer, writer, 0);
41085        xmlResetLastError();
41086        if (mem_base != xmlMemBlocks()) {
41087            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
41088	           xmlMemBlocks() - mem_base);
41089	    test_ret++;
41090            printf(" %d", n_writer);
41091            printf("\n");
41092        }
41093    }
41094    function_tests++;
41095#endif
41096
41097    return(test_ret);
41098}
41099
41100
41101static int
41102test_xmlTextWriterEndDTDEntity(void) {
41103    int test_ret = 0;
41104
41105#if defined(LIBXML_WRITER_ENABLED)
41106    int mem_base;
41107    int ret_val;
41108    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41109    int n_writer;
41110
41111    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41112        mem_base = xmlMemBlocks();
41113        writer = gen_xmlTextWriterPtr(n_writer, 0);
41114
41115        ret_val = xmlTextWriterEndDTDEntity(writer);
41116        desret_int(ret_val);
41117        call_tests++;
41118        des_xmlTextWriterPtr(n_writer, writer, 0);
41119        xmlResetLastError();
41120        if (mem_base != xmlMemBlocks()) {
41121            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
41122	           xmlMemBlocks() - mem_base);
41123	    test_ret++;
41124            printf(" %d", n_writer);
41125            printf("\n");
41126        }
41127    }
41128    function_tests++;
41129#endif
41130
41131    return(test_ret);
41132}
41133
41134
41135static int
41136test_xmlTextWriterEndDocument(void) {
41137    int test_ret = 0;
41138
41139#if defined(LIBXML_WRITER_ENABLED)
41140    int mem_base;
41141    int ret_val;
41142    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41143    int n_writer;
41144
41145    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41146        mem_base = xmlMemBlocks();
41147        writer = gen_xmlTextWriterPtr(n_writer, 0);
41148
41149        ret_val = xmlTextWriterEndDocument(writer);
41150        desret_int(ret_val);
41151        call_tests++;
41152        des_xmlTextWriterPtr(n_writer, writer, 0);
41153        xmlResetLastError();
41154        if (mem_base != xmlMemBlocks()) {
41155            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
41156	           xmlMemBlocks() - mem_base);
41157	    test_ret++;
41158            printf(" %d", n_writer);
41159            printf("\n");
41160        }
41161    }
41162    function_tests++;
41163#endif
41164
41165    return(test_ret);
41166}
41167
41168
41169static int
41170test_xmlTextWriterEndElement(void) {
41171    int test_ret = 0;
41172
41173#if defined(LIBXML_WRITER_ENABLED)
41174    int mem_base;
41175    int ret_val;
41176    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41177    int n_writer;
41178
41179    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41180        mem_base = xmlMemBlocks();
41181        writer = gen_xmlTextWriterPtr(n_writer, 0);
41182
41183        ret_val = xmlTextWriterEndElement(writer);
41184        desret_int(ret_val);
41185        call_tests++;
41186        des_xmlTextWriterPtr(n_writer, writer, 0);
41187        xmlResetLastError();
41188        if (mem_base != xmlMemBlocks()) {
41189            printf("Leak of %d blocks found in xmlTextWriterEndElement",
41190	           xmlMemBlocks() - mem_base);
41191	    test_ret++;
41192            printf(" %d", n_writer);
41193            printf("\n");
41194        }
41195    }
41196    function_tests++;
41197#endif
41198
41199    return(test_ret);
41200}
41201
41202
41203static int
41204test_xmlTextWriterEndPI(void) {
41205    int test_ret = 0;
41206
41207#if defined(LIBXML_WRITER_ENABLED)
41208    int mem_base;
41209    int ret_val;
41210    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41211    int n_writer;
41212
41213    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41214        mem_base = xmlMemBlocks();
41215        writer = gen_xmlTextWriterPtr(n_writer, 0);
41216
41217        ret_val = xmlTextWriterEndPI(writer);
41218        desret_int(ret_val);
41219        call_tests++;
41220        des_xmlTextWriterPtr(n_writer, writer, 0);
41221        xmlResetLastError();
41222        if (mem_base != xmlMemBlocks()) {
41223            printf("Leak of %d blocks found in xmlTextWriterEndPI",
41224	           xmlMemBlocks() - mem_base);
41225	    test_ret++;
41226            printf(" %d", n_writer);
41227            printf("\n");
41228        }
41229    }
41230    function_tests++;
41231#endif
41232
41233    return(test_ret);
41234}
41235
41236
41237static int
41238test_xmlTextWriterFlush(void) {
41239    int test_ret = 0;
41240
41241#if defined(LIBXML_WRITER_ENABLED)
41242    int mem_base;
41243    int ret_val;
41244    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41245    int n_writer;
41246
41247    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41248        mem_base = xmlMemBlocks();
41249        writer = gen_xmlTextWriterPtr(n_writer, 0);
41250
41251        ret_val = xmlTextWriterFlush(writer);
41252        desret_int(ret_val);
41253        call_tests++;
41254        des_xmlTextWriterPtr(n_writer, writer, 0);
41255        xmlResetLastError();
41256        if (mem_base != xmlMemBlocks()) {
41257            printf("Leak of %d blocks found in xmlTextWriterFlush",
41258	           xmlMemBlocks() - mem_base);
41259	    test_ret++;
41260            printf(" %d", n_writer);
41261            printf("\n");
41262        }
41263    }
41264    function_tests++;
41265#endif
41266
41267    return(test_ret);
41268}
41269
41270
41271static int
41272test_xmlTextWriterFullEndElement(void) {
41273    int test_ret = 0;
41274
41275#if defined(LIBXML_WRITER_ENABLED)
41276    int mem_base;
41277    int ret_val;
41278    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41279    int n_writer;
41280
41281    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41282        mem_base = xmlMemBlocks();
41283        writer = gen_xmlTextWriterPtr(n_writer, 0);
41284
41285        ret_val = xmlTextWriterFullEndElement(writer);
41286        desret_int(ret_val);
41287        call_tests++;
41288        des_xmlTextWriterPtr(n_writer, writer, 0);
41289        xmlResetLastError();
41290        if (mem_base != xmlMemBlocks()) {
41291            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
41292	           xmlMemBlocks() - mem_base);
41293	    test_ret++;
41294            printf(" %d", n_writer);
41295            printf("\n");
41296        }
41297    }
41298    function_tests++;
41299#endif
41300
41301    return(test_ret);
41302}
41303
41304
41305static int
41306test_xmlTextWriterSetIndent(void) {
41307    int test_ret = 0;
41308
41309#if defined(LIBXML_WRITER_ENABLED)
41310    int mem_base;
41311    int ret_val;
41312    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41313    int n_writer;
41314    int indent; /* do indentation? */
41315    int n_indent;
41316
41317    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41318    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
41319        mem_base = xmlMemBlocks();
41320        writer = gen_xmlTextWriterPtr(n_writer, 0);
41321        indent = gen_int(n_indent, 1);
41322
41323        ret_val = xmlTextWriterSetIndent(writer, indent);
41324        desret_int(ret_val);
41325        call_tests++;
41326        des_xmlTextWriterPtr(n_writer, writer, 0);
41327        des_int(n_indent, indent, 1);
41328        xmlResetLastError();
41329        if (mem_base != xmlMemBlocks()) {
41330            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
41331	           xmlMemBlocks() - mem_base);
41332	    test_ret++;
41333            printf(" %d", n_writer);
41334            printf(" %d", n_indent);
41335            printf("\n");
41336        }
41337    }
41338    }
41339    function_tests++;
41340#endif
41341
41342    return(test_ret);
41343}
41344
41345
41346static int
41347test_xmlTextWriterSetIndentString(void) {
41348    int test_ret = 0;
41349
41350#if defined(LIBXML_WRITER_ENABLED)
41351    int mem_base;
41352    int ret_val;
41353    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41354    int n_writer;
41355    xmlChar * str; /* the xmlChar string */
41356    int n_str;
41357
41358    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41359    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
41360        mem_base = xmlMemBlocks();
41361        writer = gen_xmlTextWriterPtr(n_writer, 0);
41362        str = gen_const_xmlChar_ptr(n_str, 1);
41363
41364        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
41365        desret_int(ret_val);
41366        call_tests++;
41367        des_xmlTextWriterPtr(n_writer, writer, 0);
41368        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
41369        xmlResetLastError();
41370        if (mem_base != xmlMemBlocks()) {
41371            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
41372	           xmlMemBlocks() - mem_base);
41373	    test_ret++;
41374            printf(" %d", n_writer);
41375            printf(" %d", n_str);
41376            printf("\n");
41377        }
41378    }
41379    }
41380    function_tests++;
41381#endif
41382
41383    return(test_ret);
41384}
41385
41386
41387static int
41388test_xmlTextWriterStartAttribute(void) {
41389    int test_ret = 0;
41390
41391#if defined(LIBXML_WRITER_ENABLED)
41392    int mem_base;
41393    int ret_val;
41394    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41395    int n_writer;
41396    xmlChar * name; /* element name */
41397    int n_name;
41398
41399    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41400    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41401        mem_base = xmlMemBlocks();
41402        writer = gen_xmlTextWriterPtr(n_writer, 0);
41403        name = gen_const_xmlChar_ptr(n_name, 1);
41404
41405        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
41406        desret_int(ret_val);
41407        call_tests++;
41408        des_xmlTextWriterPtr(n_writer, writer, 0);
41409        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41410        xmlResetLastError();
41411        if (mem_base != xmlMemBlocks()) {
41412            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
41413	           xmlMemBlocks() - mem_base);
41414	    test_ret++;
41415            printf(" %d", n_writer);
41416            printf(" %d", n_name);
41417            printf("\n");
41418        }
41419    }
41420    }
41421    function_tests++;
41422#endif
41423
41424    return(test_ret);
41425}
41426
41427
41428static int
41429test_xmlTextWriterStartAttributeNS(void) {
41430    int test_ret = 0;
41431
41432#if defined(LIBXML_WRITER_ENABLED)
41433    int mem_base;
41434    int ret_val;
41435    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41436    int n_writer;
41437    xmlChar * prefix; /* namespace prefix or NULL */
41438    int n_prefix;
41439    xmlChar * name; /* element local name */
41440    int n_name;
41441    xmlChar * namespaceURI; /* namespace URI or NULL */
41442    int n_namespaceURI;
41443
41444    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41445    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41446    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41447    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41448        mem_base = xmlMemBlocks();
41449        writer = gen_xmlTextWriterPtr(n_writer, 0);
41450        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
41451        name = gen_const_xmlChar_ptr(n_name, 2);
41452        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
41453
41454        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
41455        desret_int(ret_val);
41456        call_tests++;
41457        des_xmlTextWriterPtr(n_writer, writer, 0);
41458        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
41459        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41460        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
41461        xmlResetLastError();
41462        if (mem_base != xmlMemBlocks()) {
41463            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
41464	           xmlMemBlocks() - mem_base);
41465	    test_ret++;
41466            printf(" %d", n_writer);
41467            printf(" %d", n_prefix);
41468            printf(" %d", n_name);
41469            printf(" %d", n_namespaceURI);
41470            printf("\n");
41471        }
41472    }
41473    }
41474    }
41475    }
41476    function_tests++;
41477#endif
41478
41479    return(test_ret);
41480}
41481
41482
41483static int
41484test_xmlTextWriterStartCDATA(void) {
41485    int test_ret = 0;
41486
41487#if defined(LIBXML_WRITER_ENABLED)
41488    int mem_base;
41489    int ret_val;
41490    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41491    int n_writer;
41492
41493    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41494        mem_base = xmlMemBlocks();
41495        writer = gen_xmlTextWriterPtr(n_writer, 0);
41496
41497        ret_val = xmlTextWriterStartCDATA(writer);
41498        desret_int(ret_val);
41499        call_tests++;
41500        des_xmlTextWriterPtr(n_writer, writer, 0);
41501        xmlResetLastError();
41502        if (mem_base != xmlMemBlocks()) {
41503            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
41504	           xmlMemBlocks() - mem_base);
41505	    test_ret++;
41506            printf(" %d", n_writer);
41507            printf("\n");
41508        }
41509    }
41510    function_tests++;
41511#endif
41512
41513    return(test_ret);
41514}
41515
41516
41517static int
41518test_xmlTextWriterStartComment(void) {
41519    int test_ret = 0;
41520
41521#if defined(LIBXML_WRITER_ENABLED)
41522    int mem_base;
41523    int ret_val;
41524    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41525    int n_writer;
41526
41527    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41528        mem_base = xmlMemBlocks();
41529        writer = gen_xmlTextWriterPtr(n_writer, 0);
41530
41531        ret_val = xmlTextWriterStartComment(writer);
41532        desret_int(ret_val);
41533        call_tests++;
41534        des_xmlTextWriterPtr(n_writer, writer, 0);
41535        xmlResetLastError();
41536        if (mem_base != xmlMemBlocks()) {
41537            printf("Leak of %d blocks found in xmlTextWriterStartComment",
41538	           xmlMemBlocks() - mem_base);
41539	    test_ret++;
41540            printf(" %d", n_writer);
41541            printf("\n");
41542        }
41543    }
41544    function_tests++;
41545#endif
41546
41547    return(test_ret);
41548}
41549
41550
41551static int
41552test_xmlTextWriterStartDTD(void) {
41553    int test_ret = 0;
41554
41555#if defined(LIBXML_WRITER_ENABLED)
41556    int mem_base;
41557    int ret_val;
41558    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41559    int n_writer;
41560    xmlChar * name; /* the name of the DTD */
41561    int n_name;
41562    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
41563    int n_pubid;
41564    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
41565    int n_sysid;
41566
41567    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41568    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41569    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41570    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41571        mem_base = xmlMemBlocks();
41572        writer = gen_xmlTextWriterPtr(n_writer, 0);
41573        name = gen_const_xmlChar_ptr(n_name, 1);
41574        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
41575        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
41576
41577        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
41578        desret_int(ret_val);
41579        call_tests++;
41580        des_xmlTextWriterPtr(n_writer, writer, 0);
41581        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41582        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
41583        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
41584        xmlResetLastError();
41585        if (mem_base != xmlMemBlocks()) {
41586            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
41587	           xmlMemBlocks() - mem_base);
41588	    test_ret++;
41589            printf(" %d", n_writer);
41590            printf(" %d", n_name);
41591            printf(" %d", n_pubid);
41592            printf(" %d", n_sysid);
41593            printf("\n");
41594        }
41595    }
41596    }
41597    }
41598    }
41599    function_tests++;
41600#endif
41601
41602    return(test_ret);
41603}
41604
41605
41606static int
41607test_xmlTextWriterStartDTDAttlist(void) {
41608    int test_ret = 0;
41609
41610#if defined(LIBXML_WRITER_ENABLED)
41611    int mem_base;
41612    int ret_val;
41613    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41614    int n_writer;
41615    xmlChar * name; /* the name of the DTD ATTLIST */
41616    int n_name;
41617
41618    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41619    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41620        mem_base = xmlMemBlocks();
41621        writer = gen_xmlTextWriterPtr(n_writer, 0);
41622        name = gen_const_xmlChar_ptr(n_name, 1);
41623
41624        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
41625        desret_int(ret_val);
41626        call_tests++;
41627        des_xmlTextWriterPtr(n_writer, writer, 0);
41628        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41629        xmlResetLastError();
41630        if (mem_base != xmlMemBlocks()) {
41631            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
41632	           xmlMemBlocks() - mem_base);
41633	    test_ret++;
41634            printf(" %d", n_writer);
41635            printf(" %d", n_name);
41636            printf("\n");
41637        }
41638    }
41639    }
41640    function_tests++;
41641#endif
41642
41643    return(test_ret);
41644}
41645
41646
41647static int
41648test_xmlTextWriterStartDTDElement(void) {
41649    int test_ret = 0;
41650
41651#if defined(LIBXML_WRITER_ENABLED)
41652    int mem_base;
41653    int ret_val;
41654    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41655    int n_writer;
41656    xmlChar * name; /* the name of the DTD element */
41657    int n_name;
41658
41659    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41660    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41661        mem_base = xmlMemBlocks();
41662        writer = gen_xmlTextWriterPtr(n_writer, 0);
41663        name = gen_const_xmlChar_ptr(n_name, 1);
41664
41665        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
41666        desret_int(ret_val);
41667        call_tests++;
41668        des_xmlTextWriterPtr(n_writer, writer, 0);
41669        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41670        xmlResetLastError();
41671        if (mem_base != xmlMemBlocks()) {
41672            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
41673	           xmlMemBlocks() - mem_base);
41674	    test_ret++;
41675            printf(" %d", n_writer);
41676            printf(" %d", n_name);
41677            printf("\n");
41678        }
41679    }
41680    }
41681    function_tests++;
41682#endif
41683
41684    return(test_ret);
41685}
41686
41687
41688static int
41689test_xmlTextWriterStartDTDEntity(void) {
41690    int test_ret = 0;
41691
41692#if defined(LIBXML_WRITER_ENABLED)
41693    int mem_base;
41694    int ret_val;
41695    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41696    int n_writer;
41697    int pe; /* TRUE if this is a parameter entity, FALSE if not */
41698    int n_pe;
41699    xmlChar * name; /* the name of the DTD ATTLIST */
41700    int n_name;
41701
41702    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41703    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41704    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41705        mem_base = xmlMemBlocks();
41706        writer = gen_xmlTextWriterPtr(n_writer, 0);
41707        pe = gen_int(n_pe, 1);
41708        name = gen_const_xmlChar_ptr(n_name, 2);
41709
41710        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
41711        desret_int(ret_val);
41712        call_tests++;
41713        des_xmlTextWriterPtr(n_writer, writer, 0);
41714        des_int(n_pe, pe, 1);
41715        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41716        xmlResetLastError();
41717        if (mem_base != xmlMemBlocks()) {
41718            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
41719	           xmlMemBlocks() - mem_base);
41720	    test_ret++;
41721            printf(" %d", n_writer);
41722            printf(" %d", n_pe);
41723            printf(" %d", n_name);
41724            printf("\n");
41725        }
41726    }
41727    }
41728    }
41729    function_tests++;
41730#endif
41731
41732    return(test_ret);
41733}
41734
41735
41736static int
41737test_xmlTextWriterStartDocument(void) {
41738    int test_ret = 0;
41739
41740#if defined(LIBXML_WRITER_ENABLED)
41741    int mem_base;
41742    int ret_val;
41743    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41744    int n_writer;
41745    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
41746    int n_version;
41747    char * encoding; /* the encoding or NULL for default */
41748    int n_encoding;
41749    char * standalone; /* "yes" or "no" or NULL for default */
41750    int n_standalone;
41751
41752    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41753    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
41754    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
41755    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
41756        mem_base = xmlMemBlocks();
41757        writer = gen_xmlTextWriterPtr(n_writer, 0);
41758        version = gen_const_char_ptr(n_version, 1);
41759        encoding = gen_const_char_ptr(n_encoding, 2);
41760        standalone = gen_const_char_ptr(n_standalone, 3);
41761
41762        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
41763        desret_int(ret_val);
41764        call_tests++;
41765        des_xmlTextWriterPtr(n_writer, writer, 0);
41766        des_const_char_ptr(n_version, (const char *)version, 1);
41767        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
41768        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
41769        xmlResetLastError();
41770        if (mem_base != xmlMemBlocks()) {
41771            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
41772	           xmlMemBlocks() - mem_base);
41773	    test_ret++;
41774            printf(" %d", n_writer);
41775            printf(" %d", n_version);
41776            printf(" %d", n_encoding);
41777            printf(" %d", n_standalone);
41778            printf("\n");
41779        }
41780    }
41781    }
41782    }
41783    }
41784    function_tests++;
41785#endif
41786
41787    return(test_ret);
41788}
41789
41790
41791static int
41792test_xmlTextWriterStartElement(void) {
41793    int test_ret = 0;
41794
41795#if defined(LIBXML_WRITER_ENABLED)
41796    int mem_base;
41797    int ret_val;
41798    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41799    int n_writer;
41800    xmlChar * name; /* element name */
41801    int n_name;
41802
41803    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41804    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41805        mem_base = xmlMemBlocks();
41806        writer = gen_xmlTextWriterPtr(n_writer, 0);
41807        name = gen_const_xmlChar_ptr(n_name, 1);
41808
41809        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
41810        desret_int(ret_val);
41811        call_tests++;
41812        des_xmlTextWriterPtr(n_writer, writer, 0);
41813        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41814        xmlResetLastError();
41815        if (mem_base != xmlMemBlocks()) {
41816            printf("Leak of %d blocks found in xmlTextWriterStartElement",
41817	           xmlMemBlocks() - mem_base);
41818	    test_ret++;
41819            printf(" %d", n_writer);
41820            printf(" %d", n_name);
41821            printf("\n");
41822        }
41823    }
41824    }
41825    function_tests++;
41826#endif
41827
41828    return(test_ret);
41829}
41830
41831
41832static int
41833test_xmlTextWriterStartElementNS(void) {
41834    int test_ret = 0;
41835
41836#if defined(LIBXML_WRITER_ENABLED)
41837    int mem_base;
41838    int ret_val;
41839    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41840    int n_writer;
41841    xmlChar * prefix; /* namespace prefix or NULL */
41842    int n_prefix;
41843    xmlChar * name; /* element local name */
41844    int n_name;
41845    xmlChar * namespaceURI; /* namespace URI or NULL */
41846    int n_namespaceURI;
41847
41848    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41849    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41850    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41851    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41852        mem_base = xmlMemBlocks();
41853        writer = gen_xmlTextWriterPtr(n_writer, 0);
41854        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
41855        name = gen_const_xmlChar_ptr(n_name, 2);
41856        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
41857
41858        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
41859        desret_int(ret_val);
41860        call_tests++;
41861        des_xmlTextWriterPtr(n_writer, writer, 0);
41862        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
41863        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41864        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
41865        xmlResetLastError();
41866        if (mem_base != xmlMemBlocks()) {
41867            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
41868	           xmlMemBlocks() - mem_base);
41869	    test_ret++;
41870            printf(" %d", n_writer);
41871            printf(" %d", n_prefix);
41872            printf(" %d", n_name);
41873            printf(" %d", n_namespaceURI);
41874            printf("\n");
41875        }
41876    }
41877    }
41878    }
41879    }
41880    function_tests++;
41881#endif
41882
41883    return(test_ret);
41884}
41885
41886
41887static int
41888test_xmlTextWriterStartPI(void) {
41889    int test_ret = 0;
41890
41891#if defined(LIBXML_WRITER_ENABLED)
41892    int mem_base;
41893    int ret_val;
41894    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41895    int n_writer;
41896    xmlChar * target; /* PI target */
41897    int n_target;
41898
41899    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41900    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
41901        mem_base = xmlMemBlocks();
41902        writer = gen_xmlTextWriterPtr(n_writer, 0);
41903        target = gen_const_xmlChar_ptr(n_target, 1);
41904
41905        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
41906        desret_int(ret_val);
41907        call_tests++;
41908        des_xmlTextWriterPtr(n_writer, writer, 0);
41909        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
41910        xmlResetLastError();
41911        if (mem_base != xmlMemBlocks()) {
41912            printf("Leak of %d blocks found in xmlTextWriterStartPI",
41913	           xmlMemBlocks() - mem_base);
41914	    test_ret++;
41915            printf(" %d", n_writer);
41916            printf(" %d", n_target);
41917            printf("\n");
41918        }
41919    }
41920    }
41921    function_tests++;
41922#endif
41923
41924    return(test_ret);
41925}
41926
41927
41928static int
41929test_xmlTextWriterWriteAttribute(void) {
41930    int test_ret = 0;
41931
41932#if defined(LIBXML_WRITER_ENABLED)
41933    int mem_base;
41934    int ret_val;
41935    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41936    int n_writer;
41937    xmlChar * name; /* attribute name */
41938    int n_name;
41939    xmlChar * content; /* attribute content */
41940    int n_content;
41941
41942    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41943    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41944    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41945        mem_base = xmlMemBlocks();
41946        writer = gen_xmlTextWriterPtr(n_writer, 0);
41947        name = gen_const_xmlChar_ptr(n_name, 1);
41948        content = gen_const_xmlChar_ptr(n_content, 2);
41949
41950        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
41951        desret_int(ret_val);
41952        call_tests++;
41953        des_xmlTextWriterPtr(n_writer, writer, 0);
41954        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41955        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
41956        xmlResetLastError();
41957        if (mem_base != xmlMemBlocks()) {
41958            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
41959	           xmlMemBlocks() - mem_base);
41960	    test_ret++;
41961            printf(" %d", n_writer);
41962            printf(" %d", n_name);
41963            printf(" %d", n_content);
41964            printf("\n");
41965        }
41966    }
41967    }
41968    }
41969    function_tests++;
41970#endif
41971
41972    return(test_ret);
41973}
41974
41975
41976static int
41977test_xmlTextWriterWriteAttributeNS(void) {
41978    int test_ret = 0;
41979
41980#if defined(LIBXML_WRITER_ENABLED)
41981    int mem_base;
41982    int ret_val;
41983    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41984    int n_writer;
41985    xmlChar * prefix; /* namespace prefix */
41986    int n_prefix;
41987    xmlChar * name; /* attribute local name */
41988    int n_name;
41989    xmlChar * namespaceURI; /* namespace URI */
41990    int n_namespaceURI;
41991    xmlChar * content; /* attribute content */
41992    int n_content;
41993
41994    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41995    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41996    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41997    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41998    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41999        mem_base = xmlMemBlocks();
42000        writer = gen_xmlTextWriterPtr(n_writer, 0);
42001        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
42002        name = gen_const_xmlChar_ptr(n_name, 2);
42003        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
42004        content = gen_const_xmlChar_ptr(n_content, 4);
42005
42006        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
42007        desret_int(ret_val);
42008        call_tests++;
42009        des_xmlTextWriterPtr(n_writer, writer, 0);
42010        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
42011        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42012        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
42013        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
42014        xmlResetLastError();
42015        if (mem_base != xmlMemBlocks()) {
42016            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
42017	           xmlMemBlocks() - mem_base);
42018	    test_ret++;
42019            printf(" %d", n_writer);
42020            printf(" %d", n_prefix);
42021            printf(" %d", n_name);
42022            printf(" %d", n_namespaceURI);
42023            printf(" %d", n_content);
42024            printf("\n");
42025        }
42026    }
42027    }
42028    }
42029    }
42030    }
42031    function_tests++;
42032#endif
42033
42034    return(test_ret);
42035}
42036
42037
42038static int
42039test_xmlTextWriterWriteBase64(void) {
42040    int test_ret = 0;
42041
42042#if defined(LIBXML_WRITER_ENABLED)
42043    int mem_base;
42044    int ret_val;
42045    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42046    int n_writer;
42047    char * data; /* binary data */
42048    int n_data;
42049    int start; /* the position within the data of the first byte to encode */
42050    int n_start;
42051    int len; /* the number of bytes to encode */
42052    int n_len;
42053
42054    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42055    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
42056    for (n_start = 0;n_start < gen_nb_int;n_start++) {
42057    for (n_len = 0;n_len < gen_nb_int;n_len++) {
42058        mem_base = xmlMemBlocks();
42059        writer = gen_xmlTextWriterPtr(n_writer, 0);
42060        data = gen_const_char_ptr(n_data, 1);
42061        start = gen_int(n_start, 2);
42062        len = gen_int(n_len, 3);
42063
42064        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
42065        desret_int(ret_val);
42066        call_tests++;
42067        des_xmlTextWriterPtr(n_writer, writer, 0);
42068        des_const_char_ptr(n_data, (const char *)data, 1);
42069        des_int(n_start, start, 2);
42070        des_int(n_len, len, 3);
42071        xmlResetLastError();
42072        if (mem_base != xmlMemBlocks()) {
42073            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
42074	           xmlMemBlocks() - mem_base);
42075	    test_ret++;
42076            printf(" %d", n_writer);
42077            printf(" %d", n_data);
42078            printf(" %d", n_start);
42079            printf(" %d", n_len);
42080            printf("\n");
42081        }
42082    }
42083    }
42084    }
42085    }
42086    function_tests++;
42087#endif
42088
42089    return(test_ret);
42090}
42091
42092
42093static int
42094test_xmlTextWriterWriteBinHex(void) {
42095    int test_ret = 0;
42096
42097#if defined(LIBXML_WRITER_ENABLED)
42098    int mem_base;
42099    int ret_val;
42100    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42101    int n_writer;
42102    char * data; /* binary data */
42103    int n_data;
42104    int start; /* the position within the data of the first byte to encode */
42105    int n_start;
42106    int len; /* the number of bytes to encode */
42107    int n_len;
42108
42109    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42110    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
42111    for (n_start = 0;n_start < gen_nb_int;n_start++) {
42112    for (n_len = 0;n_len < gen_nb_int;n_len++) {
42113        mem_base = xmlMemBlocks();
42114        writer = gen_xmlTextWriterPtr(n_writer, 0);
42115        data = gen_const_char_ptr(n_data, 1);
42116        start = gen_int(n_start, 2);
42117        len = gen_int(n_len, 3);
42118
42119        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
42120        desret_int(ret_val);
42121        call_tests++;
42122        des_xmlTextWriterPtr(n_writer, writer, 0);
42123        des_const_char_ptr(n_data, (const char *)data, 1);
42124        des_int(n_start, start, 2);
42125        des_int(n_len, len, 3);
42126        xmlResetLastError();
42127        if (mem_base != xmlMemBlocks()) {
42128            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
42129	           xmlMemBlocks() - mem_base);
42130	    test_ret++;
42131            printf(" %d", n_writer);
42132            printf(" %d", n_data);
42133            printf(" %d", n_start);
42134            printf(" %d", n_len);
42135            printf("\n");
42136        }
42137    }
42138    }
42139    }
42140    }
42141    function_tests++;
42142#endif
42143
42144    return(test_ret);
42145}
42146
42147
42148static int
42149test_xmlTextWriterWriteCDATA(void) {
42150    int test_ret = 0;
42151
42152#if defined(LIBXML_WRITER_ENABLED)
42153    int mem_base;
42154    int ret_val;
42155    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42156    int n_writer;
42157    xmlChar * content; /* CDATA content */
42158    int n_content;
42159
42160    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42161    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42162        mem_base = xmlMemBlocks();
42163        writer = gen_xmlTextWriterPtr(n_writer, 0);
42164        content = gen_const_xmlChar_ptr(n_content, 1);
42165
42166        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
42167        desret_int(ret_val);
42168        call_tests++;
42169        des_xmlTextWriterPtr(n_writer, writer, 0);
42170        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
42171        xmlResetLastError();
42172        if (mem_base != xmlMemBlocks()) {
42173            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
42174	           xmlMemBlocks() - mem_base);
42175	    test_ret++;
42176            printf(" %d", n_writer);
42177            printf(" %d", n_content);
42178            printf("\n");
42179        }
42180    }
42181    }
42182    function_tests++;
42183#endif
42184
42185    return(test_ret);
42186}
42187
42188
42189static int
42190test_xmlTextWriterWriteComment(void) {
42191    int test_ret = 0;
42192
42193#if defined(LIBXML_WRITER_ENABLED)
42194    int mem_base;
42195    int ret_val;
42196    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42197    int n_writer;
42198    xmlChar * content; /* comment string */
42199    int n_content;
42200
42201    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42202    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42203        mem_base = xmlMemBlocks();
42204        writer = gen_xmlTextWriterPtr(n_writer, 0);
42205        content = gen_const_xmlChar_ptr(n_content, 1);
42206
42207        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
42208        desret_int(ret_val);
42209        call_tests++;
42210        des_xmlTextWriterPtr(n_writer, writer, 0);
42211        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
42212        xmlResetLastError();
42213        if (mem_base != xmlMemBlocks()) {
42214            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
42215	           xmlMemBlocks() - mem_base);
42216	    test_ret++;
42217            printf(" %d", n_writer);
42218            printf(" %d", n_content);
42219            printf("\n");
42220        }
42221    }
42222    }
42223    function_tests++;
42224#endif
42225
42226    return(test_ret);
42227}
42228
42229
42230static int
42231test_xmlTextWriterWriteDTD(void) {
42232    int test_ret = 0;
42233
42234#if defined(LIBXML_WRITER_ENABLED)
42235    int mem_base;
42236    int ret_val;
42237    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42238    int n_writer;
42239    xmlChar * name; /* the name of the DTD */
42240    int n_name;
42241    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42242    int n_pubid;
42243    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42244    int n_sysid;
42245    xmlChar * subset; /* string content of the DTD */
42246    int n_subset;
42247
42248    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42249    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42250    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42251    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42252    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
42253        mem_base = xmlMemBlocks();
42254        writer = gen_xmlTextWriterPtr(n_writer, 0);
42255        name = gen_const_xmlChar_ptr(n_name, 1);
42256        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
42257        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
42258        subset = gen_const_xmlChar_ptr(n_subset, 4);
42259
42260        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
42261        desret_int(ret_val);
42262        call_tests++;
42263        des_xmlTextWriterPtr(n_writer, writer, 0);
42264        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42265        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
42266        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
42267        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
42268        xmlResetLastError();
42269        if (mem_base != xmlMemBlocks()) {
42270            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
42271	           xmlMemBlocks() - mem_base);
42272	    test_ret++;
42273            printf(" %d", n_writer);
42274            printf(" %d", n_name);
42275            printf(" %d", n_pubid);
42276            printf(" %d", n_sysid);
42277            printf(" %d", n_subset);
42278            printf("\n");
42279        }
42280    }
42281    }
42282    }
42283    }
42284    }
42285    function_tests++;
42286#endif
42287
42288    return(test_ret);
42289}
42290
42291
42292static int
42293test_xmlTextWriterWriteDTDAttlist(void) {
42294    int test_ret = 0;
42295
42296#if defined(LIBXML_WRITER_ENABLED)
42297    int mem_base;
42298    int ret_val;
42299    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42300    int n_writer;
42301    xmlChar * name; /* the name of the DTD ATTLIST */
42302    int n_name;
42303    xmlChar * content; /* content of the ATTLIST */
42304    int n_content;
42305
42306    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42307    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42308    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42309        mem_base = xmlMemBlocks();
42310        writer = gen_xmlTextWriterPtr(n_writer, 0);
42311        name = gen_const_xmlChar_ptr(n_name, 1);
42312        content = gen_const_xmlChar_ptr(n_content, 2);
42313
42314        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
42315        desret_int(ret_val);
42316        call_tests++;
42317        des_xmlTextWriterPtr(n_writer, writer, 0);
42318        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42319        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42320        xmlResetLastError();
42321        if (mem_base != xmlMemBlocks()) {
42322            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
42323	           xmlMemBlocks() - mem_base);
42324	    test_ret++;
42325            printf(" %d", n_writer);
42326            printf(" %d", n_name);
42327            printf(" %d", n_content);
42328            printf("\n");
42329        }
42330    }
42331    }
42332    }
42333    function_tests++;
42334#endif
42335
42336    return(test_ret);
42337}
42338
42339
42340static int
42341test_xmlTextWriterWriteDTDElement(void) {
42342    int test_ret = 0;
42343
42344#if defined(LIBXML_WRITER_ENABLED)
42345    int mem_base;
42346    int ret_val;
42347    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42348    int n_writer;
42349    xmlChar * name; /* the name of the DTD element */
42350    int n_name;
42351    xmlChar * content; /* content of the element */
42352    int n_content;
42353
42354    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42355    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42356    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42357        mem_base = xmlMemBlocks();
42358        writer = gen_xmlTextWriterPtr(n_writer, 0);
42359        name = gen_const_xmlChar_ptr(n_name, 1);
42360        content = gen_const_xmlChar_ptr(n_content, 2);
42361
42362        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
42363        desret_int(ret_val);
42364        call_tests++;
42365        des_xmlTextWriterPtr(n_writer, writer, 0);
42366        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42367        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42368        xmlResetLastError();
42369        if (mem_base != xmlMemBlocks()) {
42370            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
42371	           xmlMemBlocks() - mem_base);
42372	    test_ret++;
42373            printf(" %d", n_writer);
42374            printf(" %d", n_name);
42375            printf(" %d", n_content);
42376            printf("\n");
42377        }
42378    }
42379    }
42380    }
42381    function_tests++;
42382#endif
42383
42384    return(test_ret);
42385}
42386
42387
42388static int
42389test_xmlTextWriterWriteDTDEntity(void) {
42390    int test_ret = 0;
42391
42392#if defined(LIBXML_WRITER_ENABLED)
42393    int mem_base;
42394    int ret_val;
42395    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42396    int n_writer;
42397    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42398    int n_pe;
42399    xmlChar * name; /* the name of the DTD entity */
42400    int n_name;
42401    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42402    int n_pubid;
42403    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42404    int n_sysid;
42405    xmlChar * ndataid; /* the xml notation name. */
42406    int n_ndataid;
42407    xmlChar * content; /* content of the entity */
42408    int n_content;
42409
42410    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42411    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42412    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42413    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42414    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42415    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
42416    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42417        mem_base = xmlMemBlocks();
42418        writer = gen_xmlTextWriterPtr(n_writer, 0);
42419        pe = gen_int(n_pe, 1);
42420        name = gen_const_xmlChar_ptr(n_name, 2);
42421        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
42422        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
42423        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
42424        content = gen_const_xmlChar_ptr(n_content, 6);
42425
42426        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
42427        desret_int(ret_val);
42428        call_tests++;
42429        des_xmlTextWriterPtr(n_writer, writer, 0);
42430        des_int(n_pe, pe, 1);
42431        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42432        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
42433        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
42434        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
42435        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
42436        xmlResetLastError();
42437        if (mem_base != xmlMemBlocks()) {
42438            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
42439	           xmlMemBlocks() - mem_base);
42440	    test_ret++;
42441            printf(" %d", n_writer);
42442            printf(" %d", n_pe);
42443            printf(" %d", n_name);
42444            printf(" %d", n_pubid);
42445            printf(" %d", n_sysid);
42446            printf(" %d", n_ndataid);
42447            printf(" %d", n_content);
42448            printf("\n");
42449        }
42450    }
42451    }
42452    }
42453    }
42454    }
42455    }
42456    }
42457    function_tests++;
42458#endif
42459
42460    return(test_ret);
42461}
42462
42463
42464static int
42465test_xmlTextWriterWriteDTDExternalEntity(void) {
42466    int test_ret = 0;
42467
42468#if defined(LIBXML_WRITER_ENABLED)
42469    int mem_base;
42470    int ret_val;
42471    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42472    int n_writer;
42473    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42474    int n_pe;
42475    xmlChar * name; /* the name of the DTD entity */
42476    int n_name;
42477    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42478    int n_pubid;
42479    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42480    int n_sysid;
42481    xmlChar * ndataid; /* the xml notation name. */
42482    int n_ndataid;
42483
42484    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42485    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42486    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42487    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42488    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42489    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
42490        mem_base = xmlMemBlocks();
42491        writer = gen_xmlTextWriterPtr(n_writer, 0);
42492        pe = gen_int(n_pe, 1);
42493        name = gen_const_xmlChar_ptr(n_name, 2);
42494        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
42495        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
42496        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
42497
42498        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
42499        desret_int(ret_val);
42500        call_tests++;
42501        des_xmlTextWriterPtr(n_writer, writer, 0);
42502        des_int(n_pe, pe, 1);
42503        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42504        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
42505        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
42506        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
42507        xmlResetLastError();
42508        if (mem_base != xmlMemBlocks()) {
42509            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
42510	           xmlMemBlocks() - mem_base);
42511	    test_ret++;
42512            printf(" %d", n_writer);
42513            printf(" %d", n_pe);
42514            printf(" %d", n_name);
42515            printf(" %d", n_pubid);
42516            printf(" %d", n_sysid);
42517            printf(" %d", n_ndataid);
42518            printf("\n");
42519        }
42520    }
42521    }
42522    }
42523    }
42524    }
42525    }
42526    function_tests++;
42527#endif
42528
42529    return(test_ret);
42530}
42531
42532
42533static int
42534test_xmlTextWriterWriteDTDExternalEntityContents(void) {
42535    int test_ret = 0;
42536
42537#if defined(LIBXML_WRITER_ENABLED)
42538    int mem_base;
42539    int ret_val;
42540    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42541    int n_writer;
42542    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42543    int n_pubid;
42544    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42545    int n_sysid;
42546    xmlChar * ndataid; /* the xml notation name. */
42547    int n_ndataid;
42548
42549    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42550    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42551    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42552    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
42553        mem_base = xmlMemBlocks();
42554        writer = gen_xmlTextWriterPtr(n_writer, 0);
42555        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
42556        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
42557        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
42558
42559        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
42560        desret_int(ret_val);
42561        call_tests++;
42562        des_xmlTextWriterPtr(n_writer, writer, 0);
42563        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
42564        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
42565        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
42566        xmlResetLastError();
42567        if (mem_base != xmlMemBlocks()) {
42568            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
42569	           xmlMemBlocks() - mem_base);
42570	    test_ret++;
42571            printf(" %d", n_writer);
42572            printf(" %d", n_pubid);
42573            printf(" %d", n_sysid);
42574            printf(" %d", n_ndataid);
42575            printf("\n");
42576        }
42577    }
42578    }
42579    }
42580    }
42581    function_tests++;
42582#endif
42583
42584    return(test_ret);
42585}
42586
42587
42588static int
42589test_xmlTextWriterWriteDTDInternalEntity(void) {
42590    int test_ret = 0;
42591
42592#if defined(LIBXML_WRITER_ENABLED)
42593    int mem_base;
42594    int ret_val;
42595    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42596    int n_writer;
42597    int pe; /* TRUE if this is a parameter entity, FALSE if not */
42598    int n_pe;
42599    xmlChar * name; /* the name of the DTD entity */
42600    int n_name;
42601    xmlChar * content; /* content of the entity */
42602    int n_content;
42603
42604    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42605    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
42606    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42607    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42608        mem_base = xmlMemBlocks();
42609        writer = gen_xmlTextWriterPtr(n_writer, 0);
42610        pe = gen_int(n_pe, 1);
42611        name = gen_const_xmlChar_ptr(n_name, 2);
42612        content = gen_const_xmlChar_ptr(n_content, 3);
42613
42614        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
42615        desret_int(ret_val);
42616        call_tests++;
42617        des_xmlTextWriterPtr(n_writer, writer, 0);
42618        des_int(n_pe, pe, 1);
42619        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42620        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
42621        xmlResetLastError();
42622        if (mem_base != xmlMemBlocks()) {
42623            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
42624	           xmlMemBlocks() - mem_base);
42625	    test_ret++;
42626            printf(" %d", n_writer);
42627            printf(" %d", n_pe);
42628            printf(" %d", n_name);
42629            printf(" %d", n_content);
42630            printf("\n");
42631        }
42632    }
42633    }
42634    }
42635    }
42636    function_tests++;
42637#endif
42638
42639    return(test_ret);
42640}
42641
42642
42643static int
42644test_xmlTextWriterWriteDTDNotation(void) {
42645    int test_ret = 0;
42646
42647#if defined(LIBXML_WRITER_ENABLED)
42648    int mem_base;
42649    int ret_val;
42650    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42651    int n_writer;
42652    xmlChar * name; /* the name of the xml notation */
42653    int n_name;
42654    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
42655    int n_pubid;
42656    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
42657    int n_sysid;
42658
42659    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42660    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42661    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
42662    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
42663        mem_base = xmlMemBlocks();
42664        writer = gen_xmlTextWriterPtr(n_writer, 0);
42665        name = gen_const_xmlChar_ptr(n_name, 1);
42666        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
42667        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
42668
42669        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
42670        desret_int(ret_val);
42671        call_tests++;
42672        des_xmlTextWriterPtr(n_writer, writer, 0);
42673        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42674        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
42675        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
42676        xmlResetLastError();
42677        if (mem_base != xmlMemBlocks()) {
42678            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
42679	           xmlMemBlocks() - mem_base);
42680	    test_ret++;
42681            printf(" %d", n_writer);
42682            printf(" %d", n_name);
42683            printf(" %d", n_pubid);
42684            printf(" %d", n_sysid);
42685            printf("\n");
42686        }
42687    }
42688    }
42689    }
42690    }
42691    function_tests++;
42692#endif
42693
42694    return(test_ret);
42695}
42696
42697
42698static int
42699test_xmlTextWriterWriteElement(void) {
42700    int test_ret = 0;
42701
42702#if defined(LIBXML_WRITER_ENABLED)
42703    int mem_base;
42704    int ret_val;
42705    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42706    int n_writer;
42707    xmlChar * name; /* element name */
42708    int n_name;
42709    xmlChar * content; /* element content */
42710    int n_content;
42711
42712    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42713    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42714    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42715        mem_base = xmlMemBlocks();
42716        writer = gen_xmlTextWriterPtr(n_writer, 0);
42717        name = gen_const_xmlChar_ptr(n_name, 1);
42718        content = gen_const_xmlChar_ptr(n_content, 2);
42719
42720        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
42721        desret_int(ret_val);
42722        call_tests++;
42723        des_xmlTextWriterPtr(n_writer, writer, 0);
42724        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
42725        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42726        xmlResetLastError();
42727        if (mem_base != xmlMemBlocks()) {
42728            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
42729	           xmlMemBlocks() - mem_base);
42730	    test_ret++;
42731            printf(" %d", n_writer);
42732            printf(" %d", n_name);
42733            printf(" %d", n_content);
42734            printf("\n");
42735        }
42736    }
42737    }
42738    }
42739    function_tests++;
42740#endif
42741
42742    return(test_ret);
42743}
42744
42745
42746static int
42747test_xmlTextWriterWriteElementNS(void) {
42748    int test_ret = 0;
42749
42750#if defined(LIBXML_WRITER_ENABLED)
42751    int mem_base;
42752    int ret_val;
42753    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42754    int n_writer;
42755    xmlChar * prefix; /* namespace prefix */
42756    int n_prefix;
42757    xmlChar * name; /* element local name */
42758    int n_name;
42759    xmlChar * namespaceURI; /* namespace URI */
42760    int n_namespaceURI;
42761    xmlChar * content; /* element content */
42762    int n_content;
42763
42764    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42765    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
42766    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
42767    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
42768    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42769        mem_base = xmlMemBlocks();
42770        writer = gen_xmlTextWriterPtr(n_writer, 0);
42771        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
42772        name = gen_const_xmlChar_ptr(n_name, 2);
42773        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
42774        content = gen_const_xmlChar_ptr(n_content, 4);
42775
42776        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
42777        desret_int(ret_val);
42778        call_tests++;
42779        des_xmlTextWriterPtr(n_writer, writer, 0);
42780        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
42781        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
42782        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
42783        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
42784        xmlResetLastError();
42785        if (mem_base != xmlMemBlocks()) {
42786            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
42787	           xmlMemBlocks() - mem_base);
42788	    test_ret++;
42789            printf(" %d", n_writer);
42790            printf(" %d", n_prefix);
42791            printf(" %d", n_name);
42792            printf(" %d", n_namespaceURI);
42793            printf(" %d", n_content);
42794            printf("\n");
42795        }
42796    }
42797    }
42798    }
42799    }
42800    }
42801    function_tests++;
42802#endif
42803
42804    return(test_ret);
42805}
42806
42807
42808static int
42809test_xmlTextWriterWriteFormatAttribute(void) {
42810    int test_ret = 0;
42811
42812
42813    /* missing type support */
42814    return(test_ret);
42815}
42816
42817
42818static int
42819test_xmlTextWriterWriteFormatAttributeNS(void) {
42820    int test_ret = 0;
42821
42822
42823    /* missing type support */
42824    return(test_ret);
42825}
42826
42827
42828static int
42829test_xmlTextWriterWriteFormatCDATA(void) {
42830    int test_ret = 0;
42831
42832
42833    /* missing type support */
42834    return(test_ret);
42835}
42836
42837
42838static int
42839test_xmlTextWriterWriteFormatComment(void) {
42840    int test_ret = 0;
42841
42842
42843    /* missing type support */
42844    return(test_ret);
42845}
42846
42847
42848static int
42849test_xmlTextWriterWriteFormatDTD(void) {
42850    int test_ret = 0;
42851
42852
42853    /* missing type support */
42854    return(test_ret);
42855}
42856
42857
42858static int
42859test_xmlTextWriterWriteFormatDTDAttlist(void) {
42860    int test_ret = 0;
42861
42862
42863    /* missing type support */
42864    return(test_ret);
42865}
42866
42867
42868static int
42869test_xmlTextWriterWriteFormatDTDElement(void) {
42870    int test_ret = 0;
42871
42872
42873    /* missing type support */
42874    return(test_ret);
42875}
42876
42877
42878static int
42879test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
42880    int test_ret = 0;
42881
42882
42883    /* missing type support */
42884    return(test_ret);
42885}
42886
42887
42888static int
42889test_xmlTextWriterWriteFormatElement(void) {
42890    int test_ret = 0;
42891
42892
42893    /* missing type support */
42894    return(test_ret);
42895}
42896
42897
42898static int
42899test_xmlTextWriterWriteFormatElementNS(void) {
42900    int test_ret = 0;
42901
42902
42903    /* missing type support */
42904    return(test_ret);
42905}
42906
42907
42908static int
42909test_xmlTextWriterWriteFormatPI(void) {
42910    int test_ret = 0;
42911
42912
42913    /* missing type support */
42914    return(test_ret);
42915}
42916
42917
42918static int
42919test_xmlTextWriterWriteFormatRaw(void) {
42920    int test_ret = 0;
42921
42922
42923    /* missing type support */
42924    return(test_ret);
42925}
42926
42927
42928static int
42929test_xmlTextWriterWriteFormatString(void) {
42930    int test_ret = 0;
42931
42932
42933    /* missing type support */
42934    return(test_ret);
42935}
42936
42937
42938static int
42939test_xmlTextWriterWritePI(void) {
42940    int test_ret = 0;
42941
42942#if defined(LIBXML_WRITER_ENABLED)
42943    int mem_base;
42944    int ret_val;
42945    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42946    int n_writer;
42947    xmlChar * target; /* PI target */
42948    int n_target;
42949    xmlChar * content; /* PI content */
42950    int n_content;
42951
42952    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42953    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
42954    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42955        mem_base = xmlMemBlocks();
42956        writer = gen_xmlTextWriterPtr(n_writer, 0);
42957        target = gen_const_xmlChar_ptr(n_target, 1);
42958        content = gen_const_xmlChar_ptr(n_content, 2);
42959
42960        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
42961        desret_int(ret_val);
42962        call_tests++;
42963        des_xmlTextWriterPtr(n_writer, writer, 0);
42964        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
42965        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
42966        xmlResetLastError();
42967        if (mem_base != xmlMemBlocks()) {
42968            printf("Leak of %d blocks found in xmlTextWriterWritePI",
42969	           xmlMemBlocks() - mem_base);
42970	    test_ret++;
42971            printf(" %d", n_writer);
42972            printf(" %d", n_target);
42973            printf(" %d", n_content);
42974            printf("\n");
42975        }
42976    }
42977    }
42978    }
42979    function_tests++;
42980#endif
42981
42982    return(test_ret);
42983}
42984
42985
42986static int
42987test_xmlTextWriterWriteRaw(void) {
42988    int test_ret = 0;
42989
42990#if defined(LIBXML_WRITER_ENABLED)
42991    int mem_base;
42992    int ret_val;
42993    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42994    int n_writer;
42995    xmlChar * content; /* text string */
42996    int n_content;
42997
42998    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42999    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43000        mem_base = xmlMemBlocks();
43001        writer = gen_xmlTextWriterPtr(n_writer, 0);
43002        content = gen_const_xmlChar_ptr(n_content, 1);
43003
43004        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
43005        desret_int(ret_val);
43006        call_tests++;
43007        des_xmlTextWriterPtr(n_writer, writer, 0);
43008        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43009        xmlResetLastError();
43010        if (mem_base != xmlMemBlocks()) {
43011            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
43012	           xmlMemBlocks() - mem_base);
43013	    test_ret++;
43014            printf(" %d", n_writer);
43015            printf(" %d", n_content);
43016            printf("\n");
43017        }
43018    }
43019    }
43020    function_tests++;
43021#endif
43022
43023    return(test_ret);
43024}
43025
43026
43027static int
43028test_xmlTextWriterWriteRawLen(void) {
43029    int test_ret = 0;
43030
43031#if defined(LIBXML_WRITER_ENABLED)
43032    int mem_base;
43033    int ret_val;
43034    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43035    int n_writer;
43036    xmlChar * content; /* text string */
43037    int n_content;
43038    int len; /* length of the text string */
43039    int n_len;
43040
43041    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43042    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43043    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43044        mem_base = xmlMemBlocks();
43045        writer = gen_xmlTextWriterPtr(n_writer, 0);
43046        content = gen_const_xmlChar_ptr(n_content, 1);
43047        len = gen_int(n_len, 2);
43048
43049        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
43050        desret_int(ret_val);
43051        call_tests++;
43052        des_xmlTextWriterPtr(n_writer, writer, 0);
43053        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43054        des_int(n_len, len, 2);
43055        xmlResetLastError();
43056        if (mem_base != xmlMemBlocks()) {
43057            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
43058	           xmlMemBlocks() - mem_base);
43059	    test_ret++;
43060            printf(" %d", n_writer);
43061            printf(" %d", n_content);
43062            printf(" %d", n_len);
43063            printf("\n");
43064        }
43065    }
43066    }
43067    }
43068    function_tests++;
43069#endif
43070
43071    return(test_ret);
43072}
43073
43074
43075static int
43076test_xmlTextWriterWriteString(void) {
43077    int test_ret = 0;
43078
43079#if defined(LIBXML_WRITER_ENABLED)
43080    int mem_base;
43081    int ret_val;
43082    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43083    int n_writer;
43084    xmlChar * content; /* text string */
43085    int n_content;
43086
43087    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43088    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43089        mem_base = xmlMemBlocks();
43090        writer = gen_xmlTextWriterPtr(n_writer, 0);
43091        content = gen_const_xmlChar_ptr(n_content, 1);
43092
43093        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
43094        desret_int(ret_val);
43095        call_tests++;
43096        des_xmlTextWriterPtr(n_writer, writer, 0);
43097        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43098        xmlResetLastError();
43099        if (mem_base != xmlMemBlocks()) {
43100            printf("Leak of %d blocks found in xmlTextWriterWriteString",
43101	           xmlMemBlocks() - mem_base);
43102	    test_ret++;
43103            printf(" %d", n_writer);
43104            printf(" %d", n_content);
43105            printf("\n");
43106        }
43107    }
43108    }
43109    function_tests++;
43110#endif
43111
43112    return(test_ret);
43113}
43114
43115
43116static int
43117test_xmlTextWriterWriteVFormatAttribute(void) {
43118    int test_ret = 0;
43119
43120
43121    /* missing type support */
43122    return(test_ret);
43123}
43124
43125
43126static int
43127test_xmlTextWriterWriteVFormatAttributeNS(void) {
43128    int test_ret = 0;
43129
43130
43131    /* missing type support */
43132    return(test_ret);
43133}
43134
43135
43136static int
43137test_xmlTextWriterWriteVFormatCDATA(void) {
43138    int test_ret = 0;
43139
43140
43141    /* missing type support */
43142    return(test_ret);
43143}
43144
43145
43146static int
43147test_xmlTextWriterWriteVFormatComment(void) {
43148    int test_ret = 0;
43149
43150
43151    /* missing type support */
43152    return(test_ret);
43153}
43154
43155
43156static int
43157test_xmlTextWriterWriteVFormatDTD(void) {
43158    int test_ret = 0;
43159
43160
43161    /* missing type support */
43162    return(test_ret);
43163}
43164
43165
43166static int
43167test_xmlTextWriterWriteVFormatDTDAttlist(void) {
43168    int test_ret = 0;
43169
43170
43171    /* missing type support */
43172    return(test_ret);
43173}
43174
43175
43176static int
43177test_xmlTextWriterWriteVFormatDTDElement(void) {
43178    int test_ret = 0;
43179
43180
43181    /* missing type support */
43182    return(test_ret);
43183}
43184
43185
43186static int
43187test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
43188    int test_ret = 0;
43189
43190
43191    /* missing type support */
43192    return(test_ret);
43193}
43194
43195
43196static int
43197test_xmlTextWriterWriteVFormatElement(void) {
43198    int test_ret = 0;
43199
43200
43201    /* missing type support */
43202    return(test_ret);
43203}
43204
43205
43206static int
43207test_xmlTextWriterWriteVFormatElementNS(void) {
43208    int test_ret = 0;
43209
43210
43211    /* missing type support */
43212    return(test_ret);
43213}
43214
43215
43216static int
43217test_xmlTextWriterWriteVFormatPI(void) {
43218    int test_ret = 0;
43219
43220
43221    /* missing type support */
43222    return(test_ret);
43223}
43224
43225
43226static int
43227test_xmlTextWriterWriteVFormatRaw(void) {
43228    int test_ret = 0;
43229
43230
43231    /* missing type support */
43232    return(test_ret);
43233}
43234
43235
43236static int
43237test_xmlTextWriterWriteVFormatString(void) {
43238    int test_ret = 0;
43239
43240
43241    /* missing type support */
43242    return(test_ret);
43243}
43244
43245static int
43246test_xmlwriter(void) {
43247    int test_ret = 0;
43248
43249    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
43250    test_ret += test_xmlNewTextWriter();
43251    test_ret += test_xmlNewTextWriterFilename();
43252    test_ret += test_xmlNewTextWriterMemory();
43253    test_ret += test_xmlNewTextWriterPushParser();
43254    test_ret += test_xmlNewTextWriterTree();
43255    test_ret += test_xmlTextWriterEndAttribute();
43256    test_ret += test_xmlTextWriterEndCDATA();
43257    test_ret += test_xmlTextWriterEndComment();
43258    test_ret += test_xmlTextWriterEndDTD();
43259    test_ret += test_xmlTextWriterEndDTDAttlist();
43260    test_ret += test_xmlTextWriterEndDTDElement();
43261    test_ret += test_xmlTextWriterEndDTDEntity();
43262    test_ret += test_xmlTextWriterEndDocument();
43263    test_ret += test_xmlTextWriterEndElement();
43264    test_ret += test_xmlTextWriterEndPI();
43265    test_ret += test_xmlTextWriterFlush();
43266    test_ret += test_xmlTextWriterFullEndElement();
43267    test_ret += test_xmlTextWriterSetIndent();
43268    test_ret += test_xmlTextWriterSetIndentString();
43269    test_ret += test_xmlTextWriterStartAttribute();
43270    test_ret += test_xmlTextWriterStartAttributeNS();
43271    test_ret += test_xmlTextWriterStartCDATA();
43272    test_ret += test_xmlTextWriterStartComment();
43273    test_ret += test_xmlTextWriterStartDTD();
43274    test_ret += test_xmlTextWriterStartDTDAttlist();
43275    test_ret += test_xmlTextWriterStartDTDElement();
43276    test_ret += test_xmlTextWriterStartDTDEntity();
43277    test_ret += test_xmlTextWriterStartDocument();
43278    test_ret += test_xmlTextWriterStartElement();
43279    test_ret += test_xmlTextWriterStartElementNS();
43280    test_ret += test_xmlTextWriterStartPI();
43281    test_ret += test_xmlTextWriterWriteAttribute();
43282    test_ret += test_xmlTextWriterWriteAttributeNS();
43283    test_ret += test_xmlTextWriterWriteBase64();
43284    test_ret += test_xmlTextWriterWriteBinHex();
43285    test_ret += test_xmlTextWriterWriteCDATA();
43286    test_ret += test_xmlTextWriterWriteComment();
43287    test_ret += test_xmlTextWriterWriteDTD();
43288    test_ret += test_xmlTextWriterWriteDTDAttlist();
43289    test_ret += test_xmlTextWriterWriteDTDElement();
43290    test_ret += test_xmlTextWriterWriteDTDEntity();
43291    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
43292    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
43293    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
43294    test_ret += test_xmlTextWriterWriteDTDNotation();
43295    test_ret += test_xmlTextWriterWriteElement();
43296    test_ret += test_xmlTextWriterWriteElementNS();
43297    test_ret += test_xmlTextWriterWriteFormatAttribute();
43298    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
43299    test_ret += test_xmlTextWriterWriteFormatCDATA();
43300    test_ret += test_xmlTextWriterWriteFormatComment();
43301    test_ret += test_xmlTextWriterWriteFormatDTD();
43302    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
43303    test_ret += test_xmlTextWriterWriteFormatDTDElement();
43304    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
43305    test_ret += test_xmlTextWriterWriteFormatElement();
43306    test_ret += test_xmlTextWriterWriteFormatElementNS();
43307    test_ret += test_xmlTextWriterWriteFormatPI();
43308    test_ret += test_xmlTextWriterWriteFormatRaw();
43309    test_ret += test_xmlTextWriterWriteFormatString();
43310    test_ret += test_xmlTextWriterWritePI();
43311    test_ret += test_xmlTextWriterWriteRaw();
43312    test_ret += test_xmlTextWriterWriteRawLen();
43313    test_ret += test_xmlTextWriterWriteString();
43314    test_ret += test_xmlTextWriterWriteVFormatAttribute();
43315    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
43316    test_ret += test_xmlTextWriterWriteVFormatCDATA();
43317    test_ret += test_xmlTextWriterWriteVFormatComment();
43318    test_ret += test_xmlTextWriterWriteVFormatDTD();
43319    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
43320    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
43321    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
43322    test_ret += test_xmlTextWriterWriteVFormatElement();
43323    test_ret += test_xmlTextWriterWriteVFormatElementNS();
43324    test_ret += test_xmlTextWriterWriteVFormatPI();
43325    test_ret += test_xmlTextWriterWriteVFormatRaw();
43326    test_ret += test_xmlTextWriterWriteVFormatString();
43327
43328    if (test_ret != 0)
43329	printf("Module xmlwriter: %d errors\n", test_ret);
43330    return(test_ret);
43331}
43332
43333static int
43334test_xmlXPathCastBooleanToNumber(void) {
43335    int test_ret = 0;
43336
43337#if defined(LIBXML_XPATH_ENABLED)
43338    int mem_base;
43339    double ret_val;
43340    int val; /* a boolean */
43341    int n_val;
43342
43343    for (n_val = 0;n_val < gen_nb_int;n_val++) {
43344        mem_base = xmlMemBlocks();
43345        val = gen_int(n_val, 0);
43346
43347        ret_val = xmlXPathCastBooleanToNumber(val);
43348        desret_double(ret_val);
43349        call_tests++;
43350        des_int(n_val, val, 0);
43351        xmlResetLastError();
43352        if (mem_base != xmlMemBlocks()) {
43353            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
43354	           xmlMemBlocks() - mem_base);
43355	    test_ret++;
43356            printf(" %d", n_val);
43357            printf("\n");
43358        }
43359    }
43360    function_tests++;
43361#endif
43362
43363    return(test_ret);
43364}
43365
43366
43367static int
43368test_xmlXPathCastBooleanToString(void) {
43369    int test_ret = 0;
43370
43371#if defined(LIBXML_XPATH_ENABLED)
43372    int mem_base;
43373    xmlChar * ret_val;
43374    int val; /* a boolean */
43375    int n_val;
43376
43377    for (n_val = 0;n_val < gen_nb_int;n_val++) {
43378        mem_base = xmlMemBlocks();
43379        val = gen_int(n_val, 0);
43380
43381        ret_val = xmlXPathCastBooleanToString(val);
43382        desret_xmlChar_ptr(ret_val);
43383        call_tests++;
43384        des_int(n_val, val, 0);
43385        xmlResetLastError();
43386        if (mem_base != xmlMemBlocks()) {
43387            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
43388	           xmlMemBlocks() - mem_base);
43389	    test_ret++;
43390            printf(" %d", n_val);
43391            printf("\n");
43392        }
43393    }
43394    function_tests++;
43395#endif
43396
43397    return(test_ret);
43398}
43399
43400
43401static int
43402test_xmlXPathCastNodeSetToBoolean(void) {
43403    int test_ret = 0;
43404
43405#if defined(LIBXML_XPATH_ENABLED)
43406    int mem_base;
43407    int ret_val;
43408    xmlNodeSetPtr ns; /* a node-set */
43409    int n_ns;
43410
43411    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
43412        mem_base = xmlMemBlocks();
43413        ns = gen_xmlNodeSetPtr(n_ns, 0);
43414
43415        ret_val = xmlXPathCastNodeSetToBoolean(ns);
43416        desret_int(ret_val);
43417        call_tests++;
43418        des_xmlNodeSetPtr(n_ns, ns, 0);
43419        xmlResetLastError();
43420        if (mem_base != xmlMemBlocks()) {
43421            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
43422	           xmlMemBlocks() - mem_base);
43423	    test_ret++;
43424            printf(" %d", n_ns);
43425            printf("\n");
43426        }
43427    }
43428    function_tests++;
43429#endif
43430
43431    return(test_ret);
43432}
43433
43434
43435static int
43436test_xmlXPathCastNodeSetToNumber(void) {
43437    int test_ret = 0;
43438
43439#if defined(LIBXML_XPATH_ENABLED)
43440    int mem_base;
43441    double ret_val;
43442    xmlNodeSetPtr ns; /* a node-set */
43443    int n_ns;
43444
43445    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
43446        mem_base = xmlMemBlocks();
43447        ns = gen_xmlNodeSetPtr(n_ns, 0);
43448
43449        ret_val = xmlXPathCastNodeSetToNumber(ns);
43450        desret_double(ret_val);
43451        call_tests++;
43452        des_xmlNodeSetPtr(n_ns, ns, 0);
43453        xmlResetLastError();
43454        if (mem_base != xmlMemBlocks()) {
43455            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
43456	           xmlMemBlocks() - mem_base);
43457	    test_ret++;
43458            printf(" %d", n_ns);
43459            printf("\n");
43460        }
43461    }
43462    function_tests++;
43463#endif
43464
43465    return(test_ret);
43466}
43467
43468
43469static int
43470test_xmlXPathCastNodeSetToString(void) {
43471    int test_ret = 0;
43472
43473#if defined(LIBXML_XPATH_ENABLED)
43474    int mem_base;
43475    xmlChar * ret_val;
43476    xmlNodeSetPtr ns; /* a node-set */
43477    int n_ns;
43478
43479    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
43480        mem_base = xmlMemBlocks();
43481        ns = gen_xmlNodeSetPtr(n_ns, 0);
43482
43483        ret_val = xmlXPathCastNodeSetToString(ns);
43484        desret_xmlChar_ptr(ret_val);
43485        call_tests++;
43486        des_xmlNodeSetPtr(n_ns, ns, 0);
43487        xmlResetLastError();
43488        if (mem_base != xmlMemBlocks()) {
43489            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
43490	           xmlMemBlocks() - mem_base);
43491	    test_ret++;
43492            printf(" %d", n_ns);
43493            printf("\n");
43494        }
43495    }
43496    function_tests++;
43497#endif
43498
43499    return(test_ret);
43500}
43501
43502
43503static int
43504test_xmlXPathCastNodeToNumber(void) {
43505    int test_ret = 0;
43506
43507#if defined(LIBXML_XPATH_ENABLED)
43508    int mem_base;
43509    double ret_val;
43510    xmlNodePtr node; /* a node */
43511    int n_node;
43512
43513    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43514        mem_base = xmlMemBlocks();
43515        node = gen_xmlNodePtr(n_node, 0);
43516
43517        ret_val = xmlXPathCastNodeToNumber(node);
43518        desret_double(ret_val);
43519        call_tests++;
43520        des_xmlNodePtr(n_node, node, 0);
43521        xmlResetLastError();
43522        if (mem_base != xmlMemBlocks()) {
43523            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
43524	           xmlMemBlocks() - mem_base);
43525	    test_ret++;
43526            printf(" %d", n_node);
43527            printf("\n");
43528        }
43529    }
43530    function_tests++;
43531#endif
43532
43533    return(test_ret);
43534}
43535
43536
43537static int
43538test_xmlXPathCastNodeToString(void) {
43539    int test_ret = 0;
43540
43541#if defined(LIBXML_XPATH_ENABLED)
43542    int mem_base;
43543    xmlChar * ret_val;
43544    xmlNodePtr node; /* a node */
43545    int n_node;
43546
43547    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43548        mem_base = xmlMemBlocks();
43549        node = gen_xmlNodePtr(n_node, 0);
43550
43551        ret_val = xmlXPathCastNodeToString(node);
43552        desret_xmlChar_ptr(ret_val);
43553        call_tests++;
43554        des_xmlNodePtr(n_node, node, 0);
43555        xmlResetLastError();
43556        if (mem_base != xmlMemBlocks()) {
43557            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
43558	           xmlMemBlocks() - mem_base);
43559	    test_ret++;
43560            printf(" %d", n_node);
43561            printf("\n");
43562        }
43563    }
43564    function_tests++;
43565#endif
43566
43567    return(test_ret);
43568}
43569
43570
43571static int
43572test_xmlXPathCastNumberToBoolean(void) {
43573    int test_ret = 0;
43574
43575#if defined(LIBXML_XPATH_ENABLED)
43576    int mem_base;
43577    int ret_val;
43578    double val; /* a number */
43579    int n_val;
43580
43581    for (n_val = 0;n_val < gen_nb_double;n_val++) {
43582        mem_base = xmlMemBlocks();
43583        val = gen_double(n_val, 0);
43584
43585        ret_val = xmlXPathCastNumberToBoolean(val);
43586        desret_int(ret_val);
43587        call_tests++;
43588        des_double(n_val, val, 0);
43589        xmlResetLastError();
43590        if (mem_base != xmlMemBlocks()) {
43591            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
43592	           xmlMemBlocks() - mem_base);
43593	    test_ret++;
43594            printf(" %d", n_val);
43595            printf("\n");
43596        }
43597    }
43598    function_tests++;
43599#endif
43600
43601    return(test_ret);
43602}
43603
43604
43605static int
43606test_xmlXPathCastNumberToString(void) {
43607    int test_ret = 0;
43608
43609#if defined(LIBXML_XPATH_ENABLED)
43610    int mem_base;
43611    xmlChar * ret_val;
43612    double val; /* a number */
43613    int n_val;
43614
43615    for (n_val = 0;n_val < gen_nb_double;n_val++) {
43616        mem_base = xmlMemBlocks();
43617        val = gen_double(n_val, 0);
43618
43619        ret_val = xmlXPathCastNumberToString(val);
43620        desret_xmlChar_ptr(ret_val);
43621        call_tests++;
43622        des_double(n_val, val, 0);
43623        xmlResetLastError();
43624        if (mem_base != xmlMemBlocks()) {
43625            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
43626	           xmlMemBlocks() - mem_base);
43627	    test_ret++;
43628            printf(" %d", n_val);
43629            printf("\n");
43630        }
43631    }
43632    function_tests++;
43633#endif
43634
43635    return(test_ret);
43636}
43637
43638
43639static int
43640test_xmlXPathCastStringToBoolean(void) {
43641    int test_ret = 0;
43642
43643#if defined(LIBXML_XPATH_ENABLED)
43644    int mem_base;
43645    int ret_val;
43646    xmlChar * val; /* a string */
43647    int n_val;
43648
43649    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
43650        mem_base = xmlMemBlocks();
43651        val = gen_const_xmlChar_ptr(n_val, 0);
43652
43653        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
43654        desret_int(ret_val);
43655        call_tests++;
43656        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
43657        xmlResetLastError();
43658        if (mem_base != xmlMemBlocks()) {
43659            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
43660	           xmlMemBlocks() - mem_base);
43661	    test_ret++;
43662            printf(" %d", n_val);
43663            printf("\n");
43664        }
43665    }
43666    function_tests++;
43667#endif
43668
43669    return(test_ret);
43670}
43671
43672
43673static int
43674test_xmlXPathCastStringToNumber(void) {
43675    int test_ret = 0;
43676
43677#if defined(LIBXML_XPATH_ENABLED)
43678    int mem_base;
43679    double ret_val;
43680    xmlChar * val; /* a string */
43681    int n_val;
43682
43683    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
43684        mem_base = xmlMemBlocks();
43685        val = gen_const_xmlChar_ptr(n_val, 0);
43686
43687        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
43688        desret_double(ret_val);
43689        call_tests++;
43690        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
43691        xmlResetLastError();
43692        if (mem_base != xmlMemBlocks()) {
43693            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
43694	           xmlMemBlocks() - mem_base);
43695	    test_ret++;
43696            printf(" %d", n_val);
43697            printf("\n");
43698        }
43699    }
43700    function_tests++;
43701#endif
43702
43703    return(test_ret);
43704}
43705
43706
43707static int
43708test_xmlXPathCastToBoolean(void) {
43709    int test_ret = 0;
43710
43711#if defined(LIBXML_XPATH_ENABLED)
43712    int mem_base;
43713    int ret_val;
43714    xmlXPathObjectPtr val; /* an XPath object */
43715    int n_val;
43716
43717    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43718        mem_base = xmlMemBlocks();
43719        val = gen_xmlXPathObjectPtr(n_val, 0);
43720
43721        ret_val = xmlXPathCastToBoolean(val);
43722        desret_int(ret_val);
43723        call_tests++;
43724        des_xmlXPathObjectPtr(n_val, val, 0);
43725        xmlResetLastError();
43726        if (mem_base != xmlMemBlocks()) {
43727            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
43728	           xmlMemBlocks() - mem_base);
43729	    test_ret++;
43730            printf(" %d", n_val);
43731            printf("\n");
43732        }
43733    }
43734    function_tests++;
43735#endif
43736
43737    return(test_ret);
43738}
43739
43740
43741static int
43742test_xmlXPathCastToNumber(void) {
43743    int test_ret = 0;
43744
43745#if defined(LIBXML_XPATH_ENABLED)
43746    int mem_base;
43747    double ret_val;
43748    xmlXPathObjectPtr val; /* an XPath object */
43749    int n_val;
43750
43751    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43752        mem_base = xmlMemBlocks();
43753        val = gen_xmlXPathObjectPtr(n_val, 0);
43754
43755        ret_val = xmlXPathCastToNumber(val);
43756        desret_double(ret_val);
43757        call_tests++;
43758        des_xmlXPathObjectPtr(n_val, val, 0);
43759        xmlResetLastError();
43760        if (mem_base != xmlMemBlocks()) {
43761            printf("Leak of %d blocks found in xmlXPathCastToNumber",
43762	           xmlMemBlocks() - mem_base);
43763	    test_ret++;
43764            printf(" %d", n_val);
43765            printf("\n");
43766        }
43767    }
43768    function_tests++;
43769#endif
43770
43771    return(test_ret);
43772}
43773
43774
43775static int
43776test_xmlXPathCastToString(void) {
43777    int test_ret = 0;
43778
43779#if defined(LIBXML_XPATH_ENABLED)
43780    int mem_base;
43781    xmlChar * ret_val;
43782    xmlXPathObjectPtr val; /* an XPath object */
43783    int n_val;
43784
43785    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43786        mem_base = xmlMemBlocks();
43787        val = gen_xmlXPathObjectPtr(n_val, 0);
43788
43789        ret_val = xmlXPathCastToString(val);
43790        desret_xmlChar_ptr(ret_val);
43791        call_tests++;
43792        des_xmlXPathObjectPtr(n_val, val, 0);
43793        xmlResetLastError();
43794        if (mem_base != xmlMemBlocks()) {
43795            printf("Leak of %d blocks found in xmlXPathCastToString",
43796	           xmlMemBlocks() - mem_base);
43797	    test_ret++;
43798            printf(" %d", n_val);
43799            printf("\n");
43800        }
43801    }
43802    function_tests++;
43803#endif
43804
43805    return(test_ret);
43806}
43807
43808
43809static int
43810test_xmlXPathCmpNodes(void) {
43811    int test_ret = 0;
43812
43813#if defined(LIBXML_XPATH_ENABLED)
43814    int mem_base;
43815    int ret_val;
43816    xmlNodePtr node1; /* the first node */
43817    int n_node1;
43818    xmlNodePtr node2; /* the second node */
43819    int n_node2;
43820
43821    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
43822    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
43823        mem_base = xmlMemBlocks();
43824        node1 = gen_xmlNodePtr(n_node1, 0);
43825        node2 = gen_xmlNodePtr(n_node2, 1);
43826
43827        ret_val = xmlXPathCmpNodes(node1, node2);
43828        desret_int(ret_val);
43829        call_tests++;
43830        des_xmlNodePtr(n_node1, node1, 0);
43831        des_xmlNodePtr(n_node2, node2, 1);
43832        xmlResetLastError();
43833        if (mem_base != xmlMemBlocks()) {
43834            printf("Leak of %d blocks found in xmlXPathCmpNodes",
43835	           xmlMemBlocks() - mem_base);
43836	    test_ret++;
43837            printf(" %d", n_node1);
43838            printf(" %d", n_node2);
43839            printf("\n");
43840        }
43841    }
43842    }
43843    function_tests++;
43844#endif
43845
43846    return(test_ret);
43847}
43848
43849
43850static int
43851test_xmlXPathCompile(void) {
43852    int test_ret = 0;
43853
43854
43855    /* missing type support */
43856    return(test_ret);
43857}
43858
43859#ifdef LIBXML_XPATH_ENABLED
43860
43861#define gen_nb_xmlXPathCompExprPtr 1
43862static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43863    return(NULL);
43864}
43865static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43866}
43867#endif
43868
43869#ifdef LIBXML_XPATH_ENABLED
43870
43871#define gen_nb_xmlXPathContextPtr 1
43872static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43873    return(NULL);
43874}
43875static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43876}
43877#endif
43878
43879
43880static int
43881test_xmlXPathCompiledEval(void) {
43882    int test_ret = 0;
43883
43884#if defined(LIBXML_XPATH_ENABLED)
43885    int mem_base;
43886    xmlXPathObjectPtr ret_val;
43887    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
43888    int n_comp;
43889    xmlXPathContextPtr ctx; /* the XPath context */
43890    int n_ctx;
43891
43892    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
43893    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
43894        mem_base = xmlMemBlocks();
43895        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
43896        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
43897
43898        ret_val = xmlXPathCompiledEval(comp, ctx);
43899        desret_xmlXPathObjectPtr(ret_val);
43900        call_tests++;
43901        des_xmlXPathCompExprPtr(n_comp, comp, 0);
43902        des_xmlXPathContextPtr(n_ctx, ctx, 1);
43903        xmlResetLastError();
43904        if (mem_base != xmlMemBlocks()) {
43905            printf("Leak of %d blocks found in xmlXPathCompiledEval",
43906	           xmlMemBlocks() - mem_base);
43907	    test_ret++;
43908            printf(" %d", n_comp);
43909            printf(" %d", n_ctx);
43910            printf("\n");
43911        }
43912    }
43913    }
43914    function_tests++;
43915#endif
43916
43917    return(test_ret);
43918}
43919
43920
43921static int
43922test_xmlXPathConvertBoolean(void) {
43923    int test_ret = 0;
43924
43925#if defined(LIBXML_XPATH_ENABLED)
43926    int mem_base;
43927    xmlXPathObjectPtr ret_val;
43928    xmlXPathObjectPtr val; /* an XPath object */
43929    int n_val;
43930
43931    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43932        mem_base = xmlMemBlocks();
43933        val = gen_xmlXPathObjectPtr(n_val, 0);
43934
43935        ret_val = xmlXPathConvertBoolean(val);
43936        val = NULL;
43937        desret_xmlXPathObjectPtr(ret_val);
43938        call_tests++;
43939        des_xmlXPathObjectPtr(n_val, val, 0);
43940        xmlResetLastError();
43941        if (mem_base != xmlMemBlocks()) {
43942            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
43943	           xmlMemBlocks() - mem_base);
43944	    test_ret++;
43945            printf(" %d", n_val);
43946            printf("\n");
43947        }
43948    }
43949    function_tests++;
43950#endif
43951
43952    return(test_ret);
43953}
43954
43955
43956static int
43957test_xmlXPathConvertNumber(void) {
43958    int test_ret = 0;
43959
43960#if defined(LIBXML_XPATH_ENABLED)
43961    int mem_base;
43962    xmlXPathObjectPtr ret_val;
43963    xmlXPathObjectPtr val; /* an XPath object */
43964    int n_val;
43965
43966    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43967        mem_base = xmlMemBlocks();
43968        val = gen_xmlXPathObjectPtr(n_val, 0);
43969
43970        ret_val = xmlXPathConvertNumber(val);
43971        val = NULL;
43972        desret_xmlXPathObjectPtr(ret_val);
43973        call_tests++;
43974        des_xmlXPathObjectPtr(n_val, val, 0);
43975        xmlResetLastError();
43976        if (mem_base != xmlMemBlocks()) {
43977            printf("Leak of %d blocks found in xmlXPathConvertNumber",
43978	           xmlMemBlocks() - mem_base);
43979	    test_ret++;
43980            printf(" %d", n_val);
43981            printf("\n");
43982        }
43983    }
43984    function_tests++;
43985#endif
43986
43987    return(test_ret);
43988}
43989
43990
43991static int
43992test_xmlXPathConvertString(void) {
43993    int test_ret = 0;
43994
43995#if defined(LIBXML_XPATH_ENABLED)
43996    int mem_base;
43997    xmlXPathObjectPtr ret_val;
43998    xmlXPathObjectPtr val; /* an XPath object */
43999    int n_val;
44000
44001    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
44002        mem_base = xmlMemBlocks();
44003        val = gen_xmlXPathObjectPtr(n_val, 0);
44004
44005        ret_val = xmlXPathConvertString(val);
44006        val = NULL;
44007        desret_xmlXPathObjectPtr(ret_val);
44008        call_tests++;
44009        des_xmlXPathObjectPtr(n_val, val, 0);
44010        xmlResetLastError();
44011        if (mem_base != xmlMemBlocks()) {
44012            printf("Leak of %d blocks found in xmlXPathConvertString",
44013	           xmlMemBlocks() - mem_base);
44014	    test_ret++;
44015            printf(" %d", n_val);
44016            printf("\n");
44017        }
44018    }
44019    function_tests++;
44020#endif
44021
44022    return(test_ret);
44023}
44024
44025
44026static int
44027test_xmlXPathCtxtCompile(void) {
44028    int test_ret = 0;
44029
44030
44031    /* missing type support */
44032    return(test_ret);
44033}
44034
44035
44036static int
44037test_xmlXPathEval(void) {
44038    int test_ret = 0;
44039
44040#if defined(LIBXML_XPATH_ENABLED)
44041    int mem_base;
44042    xmlXPathObjectPtr ret_val;
44043    xmlChar * str; /* the XPath expression */
44044    int n_str;
44045    xmlXPathContextPtr ctx; /* the XPath context */
44046    int n_ctx;
44047
44048    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
44049    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
44050        mem_base = xmlMemBlocks();
44051        str = gen_const_xmlChar_ptr(n_str, 0);
44052        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
44053
44054        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
44055        desret_xmlXPathObjectPtr(ret_val);
44056        call_tests++;
44057        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
44058        des_xmlXPathContextPtr(n_ctx, ctx, 1);
44059        xmlResetLastError();
44060        if (mem_base != xmlMemBlocks()) {
44061            printf("Leak of %d blocks found in xmlXPathEval",
44062	           xmlMemBlocks() - mem_base);
44063	    test_ret++;
44064            printf(" %d", n_str);
44065            printf(" %d", n_ctx);
44066            printf("\n");
44067        }
44068    }
44069    }
44070    function_tests++;
44071#endif
44072
44073    return(test_ret);
44074}
44075
44076
44077static int
44078test_xmlXPathEvalExpression(void) {
44079    int test_ret = 0;
44080
44081#if defined(LIBXML_XPATH_ENABLED)
44082    int mem_base;
44083    xmlXPathObjectPtr ret_val;
44084    xmlChar * str; /* the XPath expression */
44085    int n_str;
44086    xmlXPathContextPtr ctxt; /* the XPath context */
44087    int n_ctxt;
44088
44089    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
44090    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
44091        mem_base = xmlMemBlocks();
44092        str = gen_const_xmlChar_ptr(n_str, 0);
44093        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
44094
44095        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
44096        desret_xmlXPathObjectPtr(ret_val);
44097        call_tests++;
44098        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
44099        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
44100        xmlResetLastError();
44101        if (mem_base != xmlMemBlocks()) {
44102            printf("Leak of %d blocks found in xmlXPathEvalExpression",
44103	           xmlMemBlocks() - mem_base);
44104	    test_ret++;
44105            printf(" %d", n_str);
44106            printf(" %d", n_ctxt);
44107            printf("\n");
44108        }
44109    }
44110    }
44111    function_tests++;
44112#endif
44113
44114    return(test_ret);
44115}
44116
44117
44118static int
44119test_xmlXPathEvalPredicate(void) {
44120    int test_ret = 0;
44121
44122#if defined(LIBXML_XPATH_ENABLED)
44123    int mem_base;
44124    int ret_val;
44125    xmlXPathContextPtr ctxt; /* the XPath context */
44126    int n_ctxt;
44127    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
44128    int n_res;
44129
44130    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
44131    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
44132        mem_base = xmlMemBlocks();
44133        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
44134        res = gen_xmlXPathObjectPtr(n_res, 1);
44135
44136        ret_val = xmlXPathEvalPredicate(ctxt, res);
44137        desret_int(ret_val);
44138        call_tests++;
44139        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
44140        des_xmlXPathObjectPtr(n_res, res, 1);
44141        xmlResetLastError();
44142        if (mem_base != xmlMemBlocks()) {
44143            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
44144	           xmlMemBlocks() - mem_base);
44145	    test_ret++;
44146            printf(" %d", n_ctxt);
44147            printf(" %d", n_res);
44148            printf("\n");
44149        }
44150    }
44151    }
44152    function_tests++;
44153#endif
44154
44155    return(test_ret);
44156}
44157
44158
44159static int
44160test_xmlXPathInit(void) {
44161    int test_ret = 0;
44162
44163#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
44164    int mem_base;
44165
44166        mem_base = xmlMemBlocks();
44167
44168        xmlXPathInit();
44169        call_tests++;
44170        xmlResetLastError();
44171        if (mem_base != xmlMemBlocks()) {
44172            printf("Leak of %d blocks found in xmlXPathInit",
44173	           xmlMemBlocks() - mem_base);
44174	    test_ret++;
44175            printf("\n");
44176        }
44177    function_tests++;
44178#endif
44179
44180    return(test_ret);
44181}
44182
44183
44184static int
44185test_xmlXPathIsInf(void) {
44186    int test_ret = 0;
44187
44188#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
44189    int mem_base;
44190    int ret_val;
44191    double val; /* a double value */
44192    int n_val;
44193
44194    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44195        mem_base = xmlMemBlocks();
44196        val = gen_double(n_val, 0);
44197
44198        ret_val = xmlXPathIsInf(val);
44199        desret_int(ret_val);
44200        call_tests++;
44201        des_double(n_val, val, 0);
44202        xmlResetLastError();
44203        if (mem_base != xmlMemBlocks()) {
44204            printf("Leak of %d blocks found in xmlXPathIsInf",
44205	           xmlMemBlocks() - mem_base);
44206	    test_ret++;
44207            printf(" %d", n_val);
44208            printf("\n");
44209        }
44210    }
44211    function_tests++;
44212#endif
44213
44214    return(test_ret);
44215}
44216
44217
44218static int
44219test_xmlXPathIsNaN(void) {
44220    int test_ret = 0;
44221
44222#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
44223    int mem_base;
44224    int ret_val;
44225    double val; /* a double value */
44226    int n_val;
44227
44228    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44229        mem_base = xmlMemBlocks();
44230        val = gen_double(n_val, 0);
44231
44232        ret_val = xmlXPathIsNaN(val);
44233        desret_int(ret_val);
44234        call_tests++;
44235        des_double(n_val, val, 0);
44236        xmlResetLastError();
44237        if (mem_base != xmlMemBlocks()) {
44238            printf("Leak of %d blocks found in xmlXPathIsNaN",
44239	           xmlMemBlocks() - mem_base);
44240	    test_ret++;
44241            printf(" %d", n_val);
44242            printf("\n");
44243        }
44244    }
44245    function_tests++;
44246#endif
44247
44248    return(test_ret);
44249}
44250
44251
44252static int
44253test_xmlXPathNewContext(void) {
44254    int test_ret = 0;
44255
44256
44257    /* missing type support */
44258    return(test_ret);
44259}
44260
44261
44262static int
44263test_xmlXPathNodeSetCreate(void) {
44264    int test_ret = 0;
44265
44266#if defined(LIBXML_XPATH_ENABLED)
44267    int mem_base;
44268    xmlNodeSetPtr ret_val;
44269    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
44270    int n_val;
44271
44272    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
44273        mem_base = xmlMemBlocks();
44274        val = gen_xmlNodePtr(n_val, 0);
44275
44276        ret_val = xmlXPathNodeSetCreate(val);
44277        desret_xmlNodeSetPtr(ret_val);
44278        call_tests++;
44279        des_xmlNodePtr(n_val, val, 0);
44280        xmlResetLastError();
44281        if (mem_base != xmlMemBlocks()) {
44282            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
44283	           xmlMemBlocks() - mem_base);
44284	    test_ret++;
44285            printf(" %d", n_val);
44286            printf("\n");
44287        }
44288    }
44289    function_tests++;
44290#endif
44291
44292    return(test_ret);
44293}
44294
44295
44296static int
44297test_xmlXPathObjectCopy(void) {
44298    int test_ret = 0;
44299
44300#if defined(LIBXML_XPATH_ENABLED)
44301    int mem_base;
44302    xmlXPathObjectPtr ret_val;
44303    xmlXPathObjectPtr val; /* the original object */
44304    int n_val;
44305
44306    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
44307        mem_base = xmlMemBlocks();
44308        val = gen_xmlXPathObjectPtr(n_val, 0);
44309
44310        ret_val = xmlXPathObjectCopy(val);
44311        desret_xmlXPathObjectPtr(ret_val);
44312        call_tests++;
44313        des_xmlXPathObjectPtr(n_val, val, 0);
44314        xmlResetLastError();
44315        if (mem_base != xmlMemBlocks()) {
44316            printf("Leak of %d blocks found in xmlXPathObjectCopy",
44317	           xmlMemBlocks() - mem_base);
44318	    test_ret++;
44319            printf(" %d", n_val);
44320            printf("\n");
44321        }
44322    }
44323    function_tests++;
44324#endif
44325
44326    return(test_ret);
44327}
44328
44329
44330static int
44331test_xmlXPathOrderDocElems(void) {
44332    int test_ret = 0;
44333
44334#if defined(LIBXML_XPATH_ENABLED)
44335    int mem_base;
44336    long ret_val;
44337    xmlDocPtr doc; /* an input document */
44338    int n_doc;
44339
44340    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
44341        mem_base = xmlMemBlocks();
44342        doc = gen_xmlDocPtr(n_doc, 0);
44343
44344        ret_val = xmlXPathOrderDocElems(doc);
44345        desret_long(ret_val);
44346        call_tests++;
44347        des_xmlDocPtr(n_doc, doc, 0);
44348        xmlResetLastError();
44349        if (mem_base != xmlMemBlocks()) {
44350            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
44351	           xmlMemBlocks() - mem_base);
44352	    test_ret++;
44353            printf(" %d", n_doc);
44354            printf("\n");
44355        }
44356    }
44357    function_tests++;
44358#endif
44359
44360    return(test_ret);
44361}
44362
44363static int
44364test_xpath(void) {
44365    int test_ret = 0;
44366
44367    if (quiet == 0) printf("Testing xpath : 28 of 36 functions ...\n");
44368    test_ret += test_xmlXPathCastBooleanToNumber();
44369    test_ret += test_xmlXPathCastBooleanToString();
44370    test_ret += test_xmlXPathCastNodeSetToBoolean();
44371    test_ret += test_xmlXPathCastNodeSetToNumber();
44372    test_ret += test_xmlXPathCastNodeSetToString();
44373    test_ret += test_xmlXPathCastNodeToNumber();
44374    test_ret += test_xmlXPathCastNodeToString();
44375    test_ret += test_xmlXPathCastNumberToBoolean();
44376    test_ret += test_xmlXPathCastNumberToString();
44377    test_ret += test_xmlXPathCastStringToBoolean();
44378    test_ret += test_xmlXPathCastStringToNumber();
44379    test_ret += test_xmlXPathCastToBoolean();
44380    test_ret += test_xmlXPathCastToNumber();
44381    test_ret += test_xmlXPathCastToString();
44382    test_ret += test_xmlXPathCmpNodes();
44383    test_ret += test_xmlXPathCompile();
44384    test_ret += test_xmlXPathCompiledEval();
44385    test_ret += test_xmlXPathConvertBoolean();
44386    test_ret += test_xmlXPathConvertNumber();
44387    test_ret += test_xmlXPathConvertString();
44388    test_ret += test_xmlXPathCtxtCompile();
44389    test_ret += test_xmlXPathEval();
44390    test_ret += test_xmlXPathEvalExpression();
44391    test_ret += test_xmlXPathEvalPredicate();
44392    test_ret += test_xmlXPathInit();
44393    test_ret += test_xmlXPathIsInf();
44394    test_ret += test_xmlXPathIsNaN();
44395    test_ret += test_xmlXPathNewContext();
44396    test_ret += test_xmlXPathNodeSetCreate();
44397    test_ret += test_xmlXPathObjectCopy();
44398    test_ret += test_xmlXPathOrderDocElems();
44399
44400    if (test_ret != 0)
44401	printf("Module xpath: %d errors\n", test_ret);
44402    return(test_ret);
44403}
44404#ifdef LIBXML_XPATH_ENABLED
44405
44406#define gen_nb_xmlXPathParserContextPtr 1
44407static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
44408    return(NULL);
44409}
44410static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
44411}
44412#endif
44413
44414
44415static int
44416test_valuePop(void) {
44417    int test_ret = 0;
44418
44419#if defined(LIBXML_XPATH_ENABLED)
44420    int mem_base;
44421    xmlXPathObjectPtr ret_val;
44422    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
44423    int n_ctxt;
44424
44425    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44426        mem_base = xmlMemBlocks();
44427        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44428
44429        ret_val = valuePop(ctxt);
44430        desret_xmlXPathObjectPtr(ret_val);
44431        call_tests++;
44432        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44433        xmlResetLastError();
44434        if (mem_base != xmlMemBlocks()) {
44435            printf("Leak of %d blocks found in valuePop",
44436	           xmlMemBlocks() - mem_base);
44437	    test_ret++;
44438            printf(" %d", n_ctxt);
44439            printf("\n");
44440        }
44441    }
44442    function_tests++;
44443#endif
44444
44445    return(test_ret);
44446}
44447
44448
44449static int
44450test_valuePush(void) {
44451    int test_ret = 0;
44452
44453#if defined(LIBXML_XPATH_ENABLED)
44454    int mem_base;
44455    int ret_val;
44456    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
44457    int n_ctxt;
44458    xmlXPathObjectPtr value; /* the XPath object */
44459    int n_value;
44460
44461    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44462    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
44463        mem_base = xmlMemBlocks();
44464        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44465        value = gen_xmlXPathObjectPtr(n_value, 1);
44466
44467        ret_val = valuePush(ctxt, value);
44468        desret_int(ret_val);
44469        call_tests++;
44470        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44471        des_xmlXPathObjectPtr(n_value, value, 1);
44472        xmlResetLastError();
44473        if (mem_base != xmlMemBlocks()) {
44474            printf("Leak of %d blocks found in valuePush",
44475	           xmlMemBlocks() - mem_base);
44476	    test_ret++;
44477            printf(" %d", n_ctxt);
44478            printf(" %d", n_value);
44479            printf("\n");
44480        }
44481    }
44482    }
44483    function_tests++;
44484#endif
44485
44486    return(test_ret);
44487}
44488
44489
44490static int
44491test_xmlXPathAddValues(void) {
44492    int test_ret = 0;
44493
44494#if defined(LIBXML_XPATH_ENABLED)
44495    int mem_base;
44496    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44497    int n_ctxt;
44498
44499    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44500        mem_base = xmlMemBlocks();
44501        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44502
44503        xmlXPathAddValues(ctxt);
44504        call_tests++;
44505        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44506        xmlResetLastError();
44507        if (mem_base != xmlMemBlocks()) {
44508            printf("Leak of %d blocks found in xmlXPathAddValues",
44509	           xmlMemBlocks() - mem_base);
44510	    test_ret++;
44511            printf(" %d", n_ctxt);
44512            printf("\n");
44513        }
44514    }
44515    function_tests++;
44516#endif
44517
44518    return(test_ret);
44519}
44520
44521
44522static int
44523test_xmlXPathBooleanFunction(void) {
44524    int test_ret = 0;
44525
44526#if defined(LIBXML_XPATH_ENABLED)
44527    int mem_base;
44528    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44529    int n_ctxt;
44530    int nargs; /* the number of arguments */
44531    int n_nargs;
44532
44533    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44534    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44535        mem_base = xmlMemBlocks();
44536        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44537        nargs = gen_int(n_nargs, 1);
44538
44539        xmlXPathBooleanFunction(ctxt, nargs);
44540        call_tests++;
44541        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44542        des_int(n_nargs, nargs, 1);
44543        xmlResetLastError();
44544        if (mem_base != xmlMemBlocks()) {
44545            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
44546	           xmlMemBlocks() - mem_base);
44547	    test_ret++;
44548            printf(" %d", n_ctxt);
44549            printf(" %d", n_nargs);
44550            printf("\n");
44551        }
44552    }
44553    }
44554    function_tests++;
44555#endif
44556
44557    return(test_ret);
44558}
44559
44560
44561static int
44562test_xmlXPathCeilingFunction(void) {
44563    int test_ret = 0;
44564
44565#if defined(LIBXML_XPATH_ENABLED)
44566    int mem_base;
44567    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44568    int n_ctxt;
44569    int nargs; /* the number of arguments */
44570    int n_nargs;
44571
44572    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44573    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44574        mem_base = xmlMemBlocks();
44575        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44576        nargs = gen_int(n_nargs, 1);
44577
44578        xmlXPathCeilingFunction(ctxt, nargs);
44579        call_tests++;
44580        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44581        des_int(n_nargs, nargs, 1);
44582        xmlResetLastError();
44583        if (mem_base != xmlMemBlocks()) {
44584            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
44585	           xmlMemBlocks() - mem_base);
44586	    test_ret++;
44587            printf(" %d", n_ctxt);
44588            printf(" %d", n_nargs);
44589            printf("\n");
44590        }
44591    }
44592    }
44593    function_tests++;
44594#endif
44595
44596    return(test_ret);
44597}
44598
44599
44600static int
44601test_xmlXPathCompareValues(void) {
44602    int test_ret = 0;
44603
44604#if defined(LIBXML_XPATH_ENABLED)
44605    int mem_base;
44606    int ret_val;
44607    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44608    int n_ctxt;
44609    int inf; /* less than (1) or greater than (0) */
44610    int n_inf;
44611    int strict; /* is the comparison strict */
44612    int n_strict;
44613
44614    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44615    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
44616    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
44617        mem_base = xmlMemBlocks();
44618        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44619        inf = gen_int(n_inf, 1);
44620        strict = gen_int(n_strict, 2);
44621
44622        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
44623        desret_int(ret_val);
44624        call_tests++;
44625        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44626        des_int(n_inf, inf, 1);
44627        des_int(n_strict, strict, 2);
44628        xmlResetLastError();
44629        if (mem_base != xmlMemBlocks()) {
44630            printf("Leak of %d blocks found in xmlXPathCompareValues",
44631	           xmlMemBlocks() - mem_base);
44632	    test_ret++;
44633            printf(" %d", n_ctxt);
44634            printf(" %d", n_inf);
44635            printf(" %d", n_strict);
44636            printf("\n");
44637        }
44638    }
44639    }
44640    }
44641    function_tests++;
44642#endif
44643
44644    return(test_ret);
44645}
44646
44647
44648static int
44649test_xmlXPathConcatFunction(void) {
44650    int test_ret = 0;
44651
44652#if defined(LIBXML_XPATH_ENABLED)
44653    int mem_base;
44654    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44655    int n_ctxt;
44656    int nargs; /* the number of arguments */
44657    int n_nargs;
44658
44659    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44660    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44661        mem_base = xmlMemBlocks();
44662        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44663        nargs = gen_int(n_nargs, 1);
44664
44665        xmlXPathConcatFunction(ctxt, nargs);
44666        call_tests++;
44667        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44668        des_int(n_nargs, nargs, 1);
44669        xmlResetLastError();
44670        if (mem_base != xmlMemBlocks()) {
44671            printf("Leak of %d blocks found in xmlXPathConcatFunction",
44672	           xmlMemBlocks() - mem_base);
44673	    test_ret++;
44674            printf(" %d", n_ctxt);
44675            printf(" %d", n_nargs);
44676            printf("\n");
44677        }
44678    }
44679    }
44680    function_tests++;
44681#endif
44682
44683    return(test_ret);
44684}
44685
44686
44687static int
44688test_xmlXPathContainsFunction(void) {
44689    int test_ret = 0;
44690
44691#if defined(LIBXML_XPATH_ENABLED)
44692    int mem_base;
44693    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44694    int n_ctxt;
44695    int nargs; /* the number of arguments */
44696    int n_nargs;
44697
44698    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44699    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44700        mem_base = xmlMemBlocks();
44701        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44702        nargs = gen_int(n_nargs, 1);
44703
44704        xmlXPathContainsFunction(ctxt, nargs);
44705        call_tests++;
44706        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44707        des_int(n_nargs, nargs, 1);
44708        xmlResetLastError();
44709        if (mem_base != xmlMemBlocks()) {
44710            printf("Leak of %d blocks found in xmlXPathContainsFunction",
44711	           xmlMemBlocks() - mem_base);
44712	    test_ret++;
44713            printf(" %d", n_ctxt);
44714            printf(" %d", n_nargs);
44715            printf("\n");
44716        }
44717    }
44718    }
44719    function_tests++;
44720#endif
44721
44722    return(test_ret);
44723}
44724
44725
44726static int
44727test_xmlXPathCountFunction(void) {
44728    int test_ret = 0;
44729
44730#if defined(LIBXML_XPATH_ENABLED)
44731    int mem_base;
44732    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44733    int n_ctxt;
44734    int nargs; /* the number of arguments */
44735    int n_nargs;
44736
44737    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44738    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44739        mem_base = xmlMemBlocks();
44740        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44741        nargs = gen_int(n_nargs, 1);
44742
44743        xmlXPathCountFunction(ctxt, nargs);
44744        call_tests++;
44745        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44746        des_int(n_nargs, nargs, 1);
44747        xmlResetLastError();
44748        if (mem_base != xmlMemBlocks()) {
44749            printf("Leak of %d blocks found in xmlXPathCountFunction",
44750	           xmlMemBlocks() - mem_base);
44751	    test_ret++;
44752            printf(" %d", n_ctxt);
44753            printf(" %d", n_nargs);
44754            printf("\n");
44755        }
44756    }
44757    }
44758    function_tests++;
44759#endif
44760
44761    return(test_ret);
44762}
44763
44764
44765static int
44766test_xmlXPathDebugDumpCompExpr(void) {
44767    int test_ret = 0;
44768
44769#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
44770    int mem_base;
44771    FILE * output; /* the FILE * for the output */
44772    int n_output;
44773    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
44774    int n_comp;
44775    int depth; /* the indentation level. */
44776    int n_depth;
44777
44778    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
44779    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
44780    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
44781        mem_base = xmlMemBlocks();
44782        output = gen_FILE_ptr(n_output, 0);
44783        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
44784        depth = gen_int(n_depth, 2);
44785
44786        xmlXPathDebugDumpCompExpr(output, comp, depth);
44787        call_tests++;
44788        des_FILE_ptr(n_output, output, 0);
44789        des_xmlXPathCompExprPtr(n_comp, comp, 1);
44790        des_int(n_depth, depth, 2);
44791        xmlResetLastError();
44792        if (mem_base != xmlMemBlocks()) {
44793            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
44794	           xmlMemBlocks() - mem_base);
44795	    test_ret++;
44796            printf(" %d", n_output);
44797            printf(" %d", n_comp);
44798            printf(" %d", n_depth);
44799            printf("\n");
44800        }
44801    }
44802    }
44803    }
44804    function_tests++;
44805#endif
44806
44807    return(test_ret);
44808}
44809
44810
44811static int
44812test_xmlXPathDebugDumpObject(void) {
44813    int test_ret = 0;
44814
44815#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
44816    int mem_base;
44817    FILE * output; /* the FILE * to dump the output */
44818    int n_output;
44819    xmlXPathObjectPtr cur; /* the object to inspect */
44820    int n_cur;
44821    int depth; /* indentation level */
44822    int n_depth;
44823
44824    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
44825    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
44826    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
44827        mem_base = xmlMemBlocks();
44828        output = gen_FILE_ptr(n_output, 0);
44829        cur = gen_xmlXPathObjectPtr(n_cur, 1);
44830        depth = gen_int(n_depth, 2);
44831
44832        xmlXPathDebugDumpObject(output, cur, depth);
44833        call_tests++;
44834        des_FILE_ptr(n_output, output, 0);
44835        des_xmlXPathObjectPtr(n_cur, cur, 1);
44836        des_int(n_depth, depth, 2);
44837        xmlResetLastError();
44838        if (mem_base != xmlMemBlocks()) {
44839            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
44840	           xmlMemBlocks() - mem_base);
44841	    test_ret++;
44842            printf(" %d", n_output);
44843            printf(" %d", n_cur);
44844            printf(" %d", n_depth);
44845            printf("\n");
44846        }
44847    }
44848    }
44849    }
44850    function_tests++;
44851#endif
44852
44853    return(test_ret);
44854}
44855
44856
44857static int
44858test_xmlXPathDifference(void) {
44859    int test_ret = 0;
44860
44861#if defined(LIBXML_XPATH_ENABLED)
44862    int mem_base;
44863    xmlNodeSetPtr ret_val;
44864    xmlNodeSetPtr nodes1; /* a node-set */
44865    int n_nodes1;
44866    xmlNodeSetPtr nodes2; /* a node-set */
44867    int n_nodes2;
44868
44869    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
44870    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
44871        mem_base = xmlMemBlocks();
44872        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
44873        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
44874
44875        ret_val = xmlXPathDifference(nodes1, nodes2);
44876        desret_xmlNodeSetPtr(ret_val);
44877        call_tests++;
44878        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
44879        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
44880        xmlResetLastError();
44881        if (mem_base != xmlMemBlocks()) {
44882            printf("Leak of %d blocks found in xmlXPathDifference",
44883	           xmlMemBlocks() - mem_base);
44884	    test_ret++;
44885            printf(" %d", n_nodes1);
44886            printf(" %d", n_nodes2);
44887            printf("\n");
44888        }
44889    }
44890    }
44891    function_tests++;
44892#endif
44893
44894    return(test_ret);
44895}
44896
44897
44898static int
44899test_xmlXPathDistinct(void) {
44900    int test_ret = 0;
44901
44902#if defined(LIBXML_XPATH_ENABLED)
44903    int mem_base;
44904    xmlNodeSetPtr ret_val;
44905    xmlNodeSetPtr nodes; /* a node-set */
44906    int n_nodes;
44907
44908    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
44909        mem_base = xmlMemBlocks();
44910        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
44911
44912        ret_val = xmlXPathDistinct(nodes);
44913        desret_xmlNodeSetPtr(ret_val);
44914        call_tests++;
44915        des_xmlNodeSetPtr(n_nodes, nodes, 0);
44916        xmlResetLastError();
44917        if (mem_base != xmlMemBlocks()) {
44918            printf("Leak of %d blocks found in xmlXPathDistinct",
44919	           xmlMemBlocks() - mem_base);
44920	    test_ret++;
44921            printf(" %d", n_nodes);
44922            printf("\n");
44923        }
44924    }
44925    function_tests++;
44926#endif
44927
44928    return(test_ret);
44929}
44930
44931
44932static int
44933test_xmlXPathDistinctSorted(void) {
44934    int test_ret = 0;
44935
44936#if defined(LIBXML_XPATH_ENABLED)
44937    int mem_base;
44938    xmlNodeSetPtr ret_val;
44939    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
44940    int n_nodes;
44941
44942    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
44943        mem_base = xmlMemBlocks();
44944        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
44945
44946        ret_val = xmlXPathDistinctSorted(nodes);
44947        desret_xmlNodeSetPtr(ret_val);
44948        call_tests++;
44949        des_xmlNodeSetPtr(n_nodes, nodes, 0);
44950        xmlResetLastError();
44951        if (mem_base != xmlMemBlocks()) {
44952            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
44953	           xmlMemBlocks() - mem_base);
44954	    test_ret++;
44955            printf(" %d", n_nodes);
44956            printf("\n");
44957        }
44958    }
44959    function_tests++;
44960#endif
44961
44962    return(test_ret);
44963}
44964
44965
44966static int
44967test_xmlXPathDivValues(void) {
44968    int test_ret = 0;
44969
44970#if defined(LIBXML_XPATH_ENABLED)
44971    int mem_base;
44972    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44973    int n_ctxt;
44974
44975    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44976        mem_base = xmlMemBlocks();
44977        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44978
44979        xmlXPathDivValues(ctxt);
44980        call_tests++;
44981        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44982        xmlResetLastError();
44983        if (mem_base != xmlMemBlocks()) {
44984            printf("Leak of %d blocks found in xmlXPathDivValues",
44985	           xmlMemBlocks() - mem_base);
44986	    test_ret++;
44987            printf(" %d", n_ctxt);
44988            printf("\n");
44989        }
44990    }
44991    function_tests++;
44992#endif
44993
44994    return(test_ret);
44995}
44996
44997
44998static int
44999test_xmlXPathEqualValues(void) {
45000    int test_ret = 0;
45001
45002#if defined(LIBXML_XPATH_ENABLED)
45003    int mem_base;
45004    int ret_val;
45005    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45006    int n_ctxt;
45007
45008    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45009        mem_base = xmlMemBlocks();
45010        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45011
45012        ret_val = xmlXPathEqualValues(ctxt);
45013        desret_int(ret_val);
45014        call_tests++;
45015        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45016        xmlResetLastError();
45017        if (mem_base != xmlMemBlocks()) {
45018            printf("Leak of %d blocks found in xmlXPathEqualValues",
45019	           xmlMemBlocks() - mem_base);
45020	    test_ret++;
45021            printf(" %d", n_ctxt);
45022            printf("\n");
45023        }
45024    }
45025    function_tests++;
45026#endif
45027
45028    return(test_ret);
45029}
45030
45031
45032static int
45033test_xmlXPathErr(void) {
45034    int test_ret = 0;
45035
45036#if defined(LIBXML_XPATH_ENABLED)
45037    int mem_base;
45038    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
45039    int n_ctxt;
45040    int error; /* the error code */
45041    int n_error;
45042
45043    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45044    for (n_error = 0;n_error < gen_nb_int;n_error++) {
45045        mem_base = xmlMemBlocks();
45046        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45047        error = gen_int(n_error, 1);
45048
45049        xmlXPathErr(ctxt, error);
45050        call_tests++;
45051        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45052        des_int(n_error, error, 1);
45053        xmlResetLastError();
45054        if (mem_base != xmlMemBlocks()) {
45055            printf("Leak of %d blocks found in xmlXPathErr",
45056	           xmlMemBlocks() - mem_base);
45057	    test_ret++;
45058            printf(" %d", n_ctxt);
45059            printf(" %d", n_error);
45060            printf("\n");
45061        }
45062    }
45063    }
45064    function_tests++;
45065#endif
45066
45067    return(test_ret);
45068}
45069
45070
45071static int
45072test_xmlXPathEvalExpr(void) {
45073    int test_ret = 0;
45074
45075#if defined(LIBXML_XPATH_ENABLED)
45076    int mem_base;
45077    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45078    int n_ctxt;
45079
45080    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45081        mem_base = xmlMemBlocks();
45082        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45083
45084        xmlXPathEvalExpr(ctxt);
45085        call_tests++;
45086        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45087        xmlResetLastError();
45088        if (mem_base != xmlMemBlocks()) {
45089            printf("Leak of %d blocks found in xmlXPathEvalExpr",
45090	           xmlMemBlocks() - mem_base);
45091	    test_ret++;
45092            printf(" %d", n_ctxt);
45093            printf("\n");
45094        }
45095    }
45096    function_tests++;
45097#endif
45098
45099    return(test_ret);
45100}
45101
45102
45103static int
45104test_xmlXPathEvaluatePredicateResult(void) {
45105    int test_ret = 0;
45106
45107#if defined(LIBXML_XPATH_ENABLED)
45108    int mem_base;
45109    int ret_val;
45110    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45111    int n_ctxt;
45112    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
45113    int n_res;
45114
45115    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45116    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
45117        mem_base = xmlMemBlocks();
45118        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45119        res = gen_xmlXPathObjectPtr(n_res, 1);
45120
45121        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
45122        desret_int(ret_val);
45123        call_tests++;
45124        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45125        des_xmlXPathObjectPtr(n_res, res, 1);
45126        xmlResetLastError();
45127        if (mem_base != xmlMemBlocks()) {
45128            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
45129	           xmlMemBlocks() - mem_base);
45130	    test_ret++;
45131            printf(" %d", n_ctxt);
45132            printf(" %d", n_res);
45133            printf("\n");
45134        }
45135    }
45136    }
45137    function_tests++;
45138#endif
45139
45140    return(test_ret);
45141}
45142
45143
45144static int
45145test_xmlXPathFalseFunction(void) {
45146    int test_ret = 0;
45147
45148#if defined(LIBXML_XPATH_ENABLED)
45149    int mem_base;
45150    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45151    int n_ctxt;
45152    int nargs; /* the number of arguments */
45153    int n_nargs;
45154
45155    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45156    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45157        mem_base = xmlMemBlocks();
45158        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45159        nargs = gen_int(n_nargs, 1);
45160
45161        xmlXPathFalseFunction(ctxt, nargs);
45162        call_tests++;
45163        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45164        des_int(n_nargs, nargs, 1);
45165        xmlResetLastError();
45166        if (mem_base != xmlMemBlocks()) {
45167            printf("Leak of %d blocks found in xmlXPathFalseFunction",
45168	           xmlMemBlocks() - mem_base);
45169	    test_ret++;
45170            printf(" %d", n_ctxt);
45171            printf(" %d", n_nargs);
45172            printf("\n");
45173        }
45174    }
45175    }
45176    function_tests++;
45177#endif
45178
45179    return(test_ret);
45180}
45181
45182
45183static int
45184test_xmlXPathFloorFunction(void) {
45185    int test_ret = 0;
45186
45187#if defined(LIBXML_XPATH_ENABLED)
45188    int mem_base;
45189    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45190    int n_ctxt;
45191    int nargs; /* the number of arguments */
45192    int n_nargs;
45193
45194    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45195    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45196        mem_base = xmlMemBlocks();
45197        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45198        nargs = gen_int(n_nargs, 1);
45199
45200        xmlXPathFloorFunction(ctxt, nargs);
45201        call_tests++;
45202        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45203        des_int(n_nargs, nargs, 1);
45204        xmlResetLastError();
45205        if (mem_base != xmlMemBlocks()) {
45206            printf("Leak of %d blocks found in xmlXPathFloorFunction",
45207	           xmlMemBlocks() - mem_base);
45208	    test_ret++;
45209            printf(" %d", n_ctxt);
45210            printf(" %d", n_nargs);
45211            printf("\n");
45212        }
45213    }
45214    }
45215    function_tests++;
45216#endif
45217
45218    return(test_ret);
45219}
45220
45221
45222static int
45223test_xmlXPathFunctionLookup(void) {
45224    int test_ret = 0;
45225
45226
45227    /* missing type support */
45228    return(test_ret);
45229}
45230
45231
45232static int
45233test_xmlXPathFunctionLookupNS(void) {
45234    int test_ret = 0;
45235
45236
45237    /* missing type support */
45238    return(test_ret);
45239}
45240
45241
45242static int
45243test_xmlXPathHasSameNodes(void) {
45244    int test_ret = 0;
45245
45246#if defined(LIBXML_XPATH_ENABLED)
45247    int mem_base;
45248    int ret_val;
45249    xmlNodeSetPtr nodes1; /* a node-set */
45250    int n_nodes1;
45251    xmlNodeSetPtr nodes2; /* a node-set */
45252    int n_nodes2;
45253
45254    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45255    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45256        mem_base = xmlMemBlocks();
45257        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45258        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45259
45260        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
45261        desret_int(ret_val);
45262        call_tests++;
45263        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45264        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45265        xmlResetLastError();
45266        if (mem_base != xmlMemBlocks()) {
45267            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
45268	           xmlMemBlocks() - mem_base);
45269	    test_ret++;
45270            printf(" %d", n_nodes1);
45271            printf(" %d", n_nodes2);
45272            printf("\n");
45273        }
45274    }
45275    }
45276    function_tests++;
45277#endif
45278
45279    return(test_ret);
45280}
45281
45282
45283static int
45284test_xmlXPathIdFunction(void) {
45285    int test_ret = 0;
45286
45287#if defined(LIBXML_XPATH_ENABLED)
45288    int mem_base;
45289    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45290    int n_ctxt;
45291    int nargs; /* the number of arguments */
45292    int n_nargs;
45293
45294    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45295    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45296        mem_base = xmlMemBlocks();
45297        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45298        nargs = gen_int(n_nargs, 1);
45299
45300        xmlXPathIdFunction(ctxt, nargs);
45301        call_tests++;
45302        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45303        des_int(n_nargs, nargs, 1);
45304        xmlResetLastError();
45305        if (mem_base != xmlMemBlocks()) {
45306            printf("Leak of %d blocks found in xmlXPathIdFunction",
45307	           xmlMemBlocks() - mem_base);
45308	    test_ret++;
45309            printf(" %d", n_ctxt);
45310            printf(" %d", n_nargs);
45311            printf("\n");
45312        }
45313    }
45314    }
45315    function_tests++;
45316#endif
45317
45318    return(test_ret);
45319}
45320
45321
45322static int
45323test_xmlXPathIntersection(void) {
45324    int test_ret = 0;
45325
45326#if defined(LIBXML_XPATH_ENABLED)
45327    int mem_base;
45328    xmlNodeSetPtr ret_val;
45329    xmlNodeSetPtr nodes1; /* a node-set */
45330    int n_nodes1;
45331    xmlNodeSetPtr nodes2; /* a node-set */
45332    int n_nodes2;
45333
45334    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45335    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45336        mem_base = xmlMemBlocks();
45337        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45338        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45339
45340        ret_val = xmlXPathIntersection(nodes1, nodes2);
45341        desret_xmlNodeSetPtr(ret_val);
45342        call_tests++;
45343        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45344        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45345        xmlResetLastError();
45346        if (mem_base != xmlMemBlocks()) {
45347            printf("Leak of %d blocks found in xmlXPathIntersection",
45348	           xmlMemBlocks() - mem_base);
45349	    test_ret++;
45350            printf(" %d", n_nodes1);
45351            printf(" %d", n_nodes2);
45352            printf("\n");
45353        }
45354    }
45355    }
45356    function_tests++;
45357#endif
45358
45359    return(test_ret);
45360}
45361
45362
45363static int
45364test_xmlXPathIsNodeType(void) {
45365    int test_ret = 0;
45366
45367#if defined(LIBXML_XPATH_ENABLED)
45368    int mem_base;
45369    int ret_val;
45370    xmlChar * name; /* a name string */
45371    int n_name;
45372
45373    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
45374        mem_base = xmlMemBlocks();
45375        name = gen_const_xmlChar_ptr(n_name, 0);
45376
45377        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
45378        desret_int(ret_val);
45379        call_tests++;
45380        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
45381        xmlResetLastError();
45382        if (mem_base != xmlMemBlocks()) {
45383            printf("Leak of %d blocks found in xmlXPathIsNodeType",
45384	           xmlMemBlocks() - mem_base);
45385	    test_ret++;
45386            printf(" %d", n_name);
45387            printf("\n");
45388        }
45389    }
45390    function_tests++;
45391#endif
45392
45393    return(test_ret);
45394}
45395
45396
45397static int
45398test_xmlXPathLangFunction(void) {
45399    int test_ret = 0;
45400
45401#if defined(LIBXML_XPATH_ENABLED)
45402    int mem_base;
45403    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45404    int n_ctxt;
45405    int nargs; /* the number of arguments */
45406    int n_nargs;
45407
45408    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45409    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45410        mem_base = xmlMemBlocks();
45411        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45412        nargs = gen_int(n_nargs, 1);
45413
45414        xmlXPathLangFunction(ctxt, nargs);
45415        call_tests++;
45416        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45417        des_int(n_nargs, nargs, 1);
45418        xmlResetLastError();
45419        if (mem_base != xmlMemBlocks()) {
45420            printf("Leak of %d blocks found in xmlXPathLangFunction",
45421	           xmlMemBlocks() - mem_base);
45422	    test_ret++;
45423            printf(" %d", n_ctxt);
45424            printf(" %d", n_nargs);
45425            printf("\n");
45426        }
45427    }
45428    }
45429    function_tests++;
45430#endif
45431
45432    return(test_ret);
45433}
45434
45435
45436static int
45437test_xmlXPathLastFunction(void) {
45438    int test_ret = 0;
45439
45440#if defined(LIBXML_XPATH_ENABLED)
45441    int mem_base;
45442    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45443    int n_ctxt;
45444    int nargs; /* the number of arguments */
45445    int n_nargs;
45446
45447    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45448    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45449        mem_base = xmlMemBlocks();
45450        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45451        nargs = gen_int(n_nargs, 1);
45452
45453        xmlXPathLastFunction(ctxt, nargs);
45454        call_tests++;
45455        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45456        des_int(n_nargs, nargs, 1);
45457        xmlResetLastError();
45458        if (mem_base != xmlMemBlocks()) {
45459            printf("Leak of %d blocks found in xmlXPathLastFunction",
45460	           xmlMemBlocks() - mem_base);
45461	    test_ret++;
45462            printf(" %d", n_ctxt);
45463            printf(" %d", n_nargs);
45464            printf("\n");
45465        }
45466    }
45467    }
45468    function_tests++;
45469#endif
45470
45471    return(test_ret);
45472}
45473
45474
45475static int
45476test_xmlXPathLeading(void) {
45477    int test_ret = 0;
45478
45479#if defined(LIBXML_XPATH_ENABLED)
45480    int mem_base;
45481    xmlNodeSetPtr ret_val;
45482    xmlNodeSetPtr nodes1; /* a node-set */
45483    int n_nodes1;
45484    xmlNodeSetPtr nodes2; /* a node-set */
45485    int n_nodes2;
45486
45487    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45488    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45489        mem_base = xmlMemBlocks();
45490        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45491        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45492
45493        ret_val = xmlXPathLeading(nodes1, nodes2);
45494        desret_xmlNodeSetPtr(ret_val);
45495        call_tests++;
45496        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45497        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45498        xmlResetLastError();
45499        if (mem_base != xmlMemBlocks()) {
45500            printf("Leak of %d blocks found in xmlXPathLeading",
45501	           xmlMemBlocks() - mem_base);
45502	    test_ret++;
45503            printf(" %d", n_nodes1);
45504            printf(" %d", n_nodes2);
45505            printf("\n");
45506        }
45507    }
45508    }
45509    function_tests++;
45510#endif
45511
45512    return(test_ret);
45513}
45514
45515
45516static int
45517test_xmlXPathLeadingSorted(void) {
45518    int test_ret = 0;
45519
45520#if defined(LIBXML_XPATH_ENABLED)
45521    int mem_base;
45522    xmlNodeSetPtr ret_val;
45523    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
45524    int n_nodes1;
45525    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
45526    int n_nodes2;
45527
45528    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
45529    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
45530        mem_base = xmlMemBlocks();
45531        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
45532        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
45533
45534        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
45535        desret_xmlNodeSetPtr(ret_val);
45536        call_tests++;
45537        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
45538        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
45539        xmlResetLastError();
45540        if (mem_base != xmlMemBlocks()) {
45541            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
45542	           xmlMemBlocks() - mem_base);
45543	    test_ret++;
45544            printf(" %d", n_nodes1);
45545            printf(" %d", n_nodes2);
45546            printf("\n");
45547        }
45548    }
45549    }
45550    function_tests++;
45551#endif
45552
45553    return(test_ret);
45554}
45555
45556
45557static int
45558test_xmlXPathLocalNameFunction(void) {
45559    int test_ret = 0;
45560
45561#if defined(LIBXML_XPATH_ENABLED)
45562    int mem_base;
45563    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45564    int n_ctxt;
45565    int nargs; /* the number of arguments */
45566    int n_nargs;
45567
45568    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45569    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45570        mem_base = xmlMemBlocks();
45571        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45572        nargs = gen_int(n_nargs, 1);
45573
45574        xmlXPathLocalNameFunction(ctxt, nargs);
45575        call_tests++;
45576        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45577        des_int(n_nargs, nargs, 1);
45578        xmlResetLastError();
45579        if (mem_base != xmlMemBlocks()) {
45580            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
45581	           xmlMemBlocks() - mem_base);
45582	    test_ret++;
45583            printf(" %d", n_ctxt);
45584            printf(" %d", n_nargs);
45585            printf("\n");
45586        }
45587    }
45588    }
45589    function_tests++;
45590#endif
45591
45592    return(test_ret);
45593}
45594
45595
45596static int
45597test_xmlXPathModValues(void) {
45598    int test_ret = 0;
45599
45600#if defined(LIBXML_XPATH_ENABLED)
45601    int mem_base;
45602    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45603    int n_ctxt;
45604
45605    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45606        mem_base = xmlMemBlocks();
45607        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45608
45609        xmlXPathModValues(ctxt);
45610        call_tests++;
45611        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45612        xmlResetLastError();
45613        if (mem_base != xmlMemBlocks()) {
45614            printf("Leak of %d blocks found in xmlXPathModValues",
45615	           xmlMemBlocks() - mem_base);
45616	    test_ret++;
45617            printf(" %d", n_ctxt);
45618            printf("\n");
45619        }
45620    }
45621    function_tests++;
45622#endif
45623
45624    return(test_ret);
45625}
45626
45627
45628static int
45629test_xmlXPathMultValues(void) {
45630    int test_ret = 0;
45631
45632#if defined(LIBXML_XPATH_ENABLED)
45633    int mem_base;
45634    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45635    int n_ctxt;
45636
45637    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45638        mem_base = xmlMemBlocks();
45639        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45640
45641        xmlXPathMultValues(ctxt);
45642        call_tests++;
45643        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45644        xmlResetLastError();
45645        if (mem_base != xmlMemBlocks()) {
45646            printf("Leak of %d blocks found in xmlXPathMultValues",
45647	           xmlMemBlocks() - mem_base);
45648	    test_ret++;
45649            printf(" %d", n_ctxt);
45650            printf("\n");
45651        }
45652    }
45653    function_tests++;
45654#endif
45655
45656    return(test_ret);
45657}
45658
45659
45660static int
45661test_xmlXPathNamespaceURIFunction(void) {
45662    int test_ret = 0;
45663
45664#if defined(LIBXML_XPATH_ENABLED)
45665    int mem_base;
45666    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45667    int n_ctxt;
45668    int nargs; /* the number of arguments */
45669    int n_nargs;
45670
45671    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45672    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45673        mem_base = xmlMemBlocks();
45674        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45675        nargs = gen_int(n_nargs, 1);
45676
45677        xmlXPathNamespaceURIFunction(ctxt, nargs);
45678        call_tests++;
45679        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45680        des_int(n_nargs, nargs, 1);
45681        xmlResetLastError();
45682        if (mem_base != xmlMemBlocks()) {
45683            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
45684	           xmlMemBlocks() - mem_base);
45685	    test_ret++;
45686            printf(" %d", n_ctxt);
45687            printf(" %d", n_nargs);
45688            printf("\n");
45689        }
45690    }
45691    }
45692    function_tests++;
45693#endif
45694
45695    return(test_ret);
45696}
45697
45698
45699static int
45700test_xmlXPathNewBoolean(void) {
45701    int test_ret = 0;
45702
45703#if defined(LIBXML_XPATH_ENABLED)
45704    int mem_base;
45705    xmlXPathObjectPtr ret_val;
45706    int val; /* the boolean value */
45707    int n_val;
45708
45709    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45710        mem_base = xmlMemBlocks();
45711        val = gen_int(n_val, 0);
45712
45713        ret_val = xmlXPathNewBoolean(val);
45714        desret_xmlXPathObjectPtr(ret_val);
45715        call_tests++;
45716        des_int(n_val, val, 0);
45717        xmlResetLastError();
45718        if (mem_base != xmlMemBlocks()) {
45719            printf("Leak of %d blocks found in xmlXPathNewBoolean",
45720	           xmlMemBlocks() - mem_base);
45721	    test_ret++;
45722            printf(" %d", n_val);
45723            printf("\n");
45724        }
45725    }
45726    function_tests++;
45727#endif
45728
45729    return(test_ret);
45730}
45731
45732
45733static int
45734test_xmlXPathNewCString(void) {
45735    int test_ret = 0;
45736
45737#if defined(LIBXML_XPATH_ENABLED)
45738    int mem_base;
45739    xmlXPathObjectPtr ret_val;
45740    char * val; /* the char * value */
45741    int n_val;
45742
45743    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
45744        mem_base = xmlMemBlocks();
45745        val = gen_const_char_ptr(n_val, 0);
45746
45747        ret_val = xmlXPathNewCString((const char *)val);
45748        desret_xmlXPathObjectPtr(ret_val);
45749        call_tests++;
45750        des_const_char_ptr(n_val, (const char *)val, 0);
45751        xmlResetLastError();
45752        if (mem_base != xmlMemBlocks()) {
45753            printf("Leak of %d blocks found in xmlXPathNewCString",
45754	           xmlMemBlocks() - mem_base);
45755	    test_ret++;
45756            printf(" %d", n_val);
45757            printf("\n");
45758        }
45759    }
45760    function_tests++;
45761#endif
45762
45763    return(test_ret);
45764}
45765
45766
45767static int
45768test_xmlXPathNewFloat(void) {
45769    int test_ret = 0;
45770
45771#if defined(LIBXML_XPATH_ENABLED)
45772    int mem_base;
45773    xmlXPathObjectPtr ret_val;
45774    double val; /* the double value */
45775    int n_val;
45776
45777    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45778        mem_base = xmlMemBlocks();
45779        val = gen_double(n_val, 0);
45780
45781        ret_val = xmlXPathNewFloat(val);
45782        desret_xmlXPathObjectPtr(ret_val);
45783        call_tests++;
45784        des_double(n_val, val, 0);
45785        xmlResetLastError();
45786        if (mem_base != xmlMemBlocks()) {
45787            printf("Leak of %d blocks found in xmlXPathNewFloat",
45788	           xmlMemBlocks() - mem_base);
45789	    test_ret++;
45790            printf(" %d", n_val);
45791            printf("\n");
45792        }
45793    }
45794    function_tests++;
45795#endif
45796
45797    return(test_ret);
45798}
45799
45800
45801static int
45802test_xmlXPathNewNodeSet(void) {
45803    int test_ret = 0;
45804
45805#if defined(LIBXML_XPATH_ENABLED)
45806    int mem_base;
45807    xmlXPathObjectPtr ret_val;
45808    xmlNodePtr val; /* the NodePtr value */
45809    int n_val;
45810
45811    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45812        mem_base = xmlMemBlocks();
45813        val = gen_xmlNodePtr(n_val, 0);
45814
45815        ret_val = xmlXPathNewNodeSet(val);
45816        desret_xmlXPathObjectPtr(ret_val);
45817        call_tests++;
45818        des_xmlNodePtr(n_val, val, 0);
45819        xmlResetLastError();
45820        if (mem_base != xmlMemBlocks()) {
45821            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
45822	           xmlMemBlocks() - mem_base);
45823	    test_ret++;
45824            printf(" %d", n_val);
45825            printf("\n");
45826        }
45827    }
45828    function_tests++;
45829#endif
45830
45831    return(test_ret);
45832}
45833
45834
45835static int
45836test_xmlXPathNewNodeSetList(void) {
45837    int test_ret = 0;
45838
45839#if defined(LIBXML_XPATH_ENABLED)
45840    int mem_base;
45841    xmlXPathObjectPtr ret_val;
45842    xmlNodeSetPtr val; /* an existing NodeSet */
45843    int n_val;
45844
45845    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
45846        mem_base = xmlMemBlocks();
45847        val = gen_xmlNodeSetPtr(n_val, 0);
45848
45849        ret_val = xmlXPathNewNodeSetList(val);
45850        desret_xmlXPathObjectPtr(ret_val);
45851        call_tests++;
45852        des_xmlNodeSetPtr(n_val, val, 0);
45853        xmlResetLastError();
45854        if (mem_base != xmlMemBlocks()) {
45855            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
45856	           xmlMemBlocks() - mem_base);
45857	    test_ret++;
45858            printf(" %d", n_val);
45859            printf("\n");
45860        }
45861    }
45862    function_tests++;
45863#endif
45864
45865    return(test_ret);
45866}
45867
45868
45869static int
45870test_xmlXPathNewParserContext(void) {
45871    int test_ret = 0;
45872
45873
45874    /* missing type support */
45875    return(test_ret);
45876}
45877
45878
45879static int
45880test_xmlXPathNewString(void) {
45881    int test_ret = 0;
45882
45883#if defined(LIBXML_XPATH_ENABLED)
45884    int mem_base;
45885    xmlXPathObjectPtr ret_val;
45886    xmlChar * val; /* the xmlChar * value */
45887    int n_val;
45888
45889    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45890        mem_base = xmlMemBlocks();
45891        val = gen_const_xmlChar_ptr(n_val, 0);
45892
45893        ret_val = xmlXPathNewString((const xmlChar *)val);
45894        desret_xmlXPathObjectPtr(ret_val);
45895        call_tests++;
45896        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45897        xmlResetLastError();
45898        if (mem_base != xmlMemBlocks()) {
45899            printf("Leak of %d blocks found in xmlXPathNewString",
45900	           xmlMemBlocks() - mem_base);
45901	    test_ret++;
45902            printf(" %d", n_val);
45903            printf("\n");
45904        }
45905    }
45906    function_tests++;
45907#endif
45908
45909    return(test_ret);
45910}
45911
45912
45913static int
45914test_xmlXPathNextAncestor(void) {
45915    int test_ret = 0;
45916
45917#if defined(LIBXML_XPATH_ENABLED)
45918    int mem_base;
45919    xmlNodePtr ret_val;
45920    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45921    int n_ctxt;
45922    xmlNodePtr cur; /* the current node in the traversal */
45923    int n_cur;
45924
45925    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45926    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45927        mem_base = xmlMemBlocks();
45928        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45929        cur = gen_xmlNodePtr(n_cur, 1);
45930
45931        ret_val = xmlXPathNextAncestor(ctxt, cur);
45932        desret_xmlNodePtr(ret_val);
45933        call_tests++;
45934        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45935        des_xmlNodePtr(n_cur, cur, 1);
45936        xmlResetLastError();
45937        if (mem_base != xmlMemBlocks()) {
45938            printf("Leak of %d blocks found in xmlXPathNextAncestor",
45939	           xmlMemBlocks() - mem_base);
45940	    test_ret++;
45941            printf(" %d", n_ctxt);
45942            printf(" %d", n_cur);
45943            printf("\n");
45944        }
45945    }
45946    }
45947    function_tests++;
45948#endif
45949
45950    return(test_ret);
45951}
45952
45953
45954static int
45955test_xmlXPathNextAncestorOrSelf(void) {
45956    int test_ret = 0;
45957
45958#if defined(LIBXML_XPATH_ENABLED)
45959    int mem_base;
45960    xmlNodePtr ret_val;
45961    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45962    int n_ctxt;
45963    xmlNodePtr cur; /* the current node in the traversal */
45964    int n_cur;
45965
45966    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45967    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45968        mem_base = xmlMemBlocks();
45969        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45970        cur = gen_xmlNodePtr(n_cur, 1);
45971
45972        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
45973        desret_xmlNodePtr(ret_val);
45974        call_tests++;
45975        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45976        des_xmlNodePtr(n_cur, cur, 1);
45977        xmlResetLastError();
45978        if (mem_base != xmlMemBlocks()) {
45979            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
45980	           xmlMemBlocks() - mem_base);
45981	    test_ret++;
45982            printf(" %d", n_ctxt);
45983            printf(" %d", n_cur);
45984            printf("\n");
45985        }
45986    }
45987    }
45988    function_tests++;
45989#endif
45990
45991    return(test_ret);
45992}
45993
45994
45995static int
45996test_xmlXPathNextAttribute(void) {
45997    int test_ret = 0;
45998
45999#if defined(LIBXML_XPATH_ENABLED)
46000    int mem_base;
46001    xmlNodePtr ret_val;
46002    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46003    int n_ctxt;
46004    xmlNodePtr cur; /* the current attribute in the traversal */
46005    int n_cur;
46006
46007    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46008    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46009        mem_base = xmlMemBlocks();
46010        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46011        cur = gen_xmlNodePtr(n_cur, 1);
46012
46013        ret_val = xmlXPathNextAttribute(ctxt, cur);
46014        desret_xmlNodePtr(ret_val);
46015        call_tests++;
46016        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46017        des_xmlNodePtr(n_cur, cur, 1);
46018        xmlResetLastError();
46019        if (mem_base != xmlMemBlocks()) {
46020            printf("Leak of %d blocks found in xmlXPathNextAttribute",
46021	           xmlMemBlocks() - mem_base);
46022	    test_ret++;
46023            printf(" %d", n_ctxt);
46024            printf(" %d", n_cur);
46025            printf("\n");
46026        }
46027    }
46028    }
46029    function_tests++;
46030#endif
46031
46032    return(test_ret);
46033}
46034
46035
46036static int
46037test_xmlXPathNextChild(void) {
46038    int test_ret = 0;
46039
46040#if defined(LIBXML_XPATH_ENABLED)
46041    int mem_base;
46042    xmlNodePtr ret_val;
46043    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46044    int n_ctxt;
46045    xmlNodePtr cur; /* the current node in the traversal */
46046    int n_cur;
46047
46048    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46049    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46050        mem_base = xmlMemBlocks();
46051        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46052        cur = gen_xmlNodePtr(n_cur, 1);
46053
46054        ret_val = xmlXPathNextChild(ctxt, cur);
46055        desret_xmlNodePtr(ret_val);
46056        call_tests++;
46057        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46058        des_xmlNodePtr(n_cur, cur, 1);
46059        xmlResetLastError();
46060        if (mem_base != xmlMemBlocks()) {
46061            printf("Leak of %d blocks found in xmlXPathNextChild",
46062	           xmlMemBlocks() - mem_base);
46063	    test_ret++;
46064            printf(" %d", n_ctxt);
46065            printf(" %d", n_cur);
46066            printf("\n");
46067        }
46068    }
46069    }
46070    function_tests++;
46071#endif
46072
46073    return(test_ret);
46074}
46075
46076
46077static int
46078test_xmlXPathNextDescendant(void) {
46079    int test_ret = 0;
46080
46081#if defined(LIBXML_XPATH_ENABLED)
46082    int mem_base;
46083    xmlNodePtr ret_val;
46084    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46085    int n_ctxt;
46086    xmlNodePtr cur; /* the current node in the traversal */
46087    int n_cur;
46088
46089    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46090    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46091        mem_base = xmlMemBlocks();
46092        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46093        cur = gen_xmlNodePtr(n_cur, 1);
46094
46095        ret_val = xmlXPathNextDescendant(ctxt, cur);
46096        desret_xmlNodePtr(ret_val);
46097        call_tests++;
46098        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46099        des_xmlNodePtr(n_cur, cur, 1);
46100        xmlResetLastError();
46101        if (mem_base != xmlMemBlocks()) {
46102            printf("Leak of %d blocks found in xmlXPathNextDescendant",
46103	           xmlMemBlocks() - mem_base);
46104	    test_ret++;
46105            printf(" %d", n_ctxt);
46106            printf(" %d", n_cur);
46107            printf("\n");
46108        }
46109    }
46110    }
46111    function_tests++;
46112#endif
46113
46114    return(test_ret);
46115}
46116
46117
46118static int
46119test_xmlXPathNextDescendantOrSelf(void) {
46120    int test_ret = 0;
46121
46122#if defined(LIBXML_XPATH_ENABLED)
46123    int mem_base;
46124    xmlNodePtr ret_val;
46125    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46126    int n_ctxt;
46127    xmlNodePtr cur; /* the current node in the traversal */
46128    int n_cur;
46129
46130    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46131    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46132        mem_base = xmlMemBlocks();
46133        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46134        cur = gen_xmlNodePtr(n_cur, 1);
46135
46136        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
46137        desret_xmlNodePtr(ret_val);
46138        call_tests++;
46139        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46140        des_xmlNodePtr(n_cur, cur, 1);
46141        xmlResetLastError();
46142        if (mem_base != xmlMemBlocks()) {
46143            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
46144	           xmlMemBlocks() - mem_base);
46145	    test_ret++;
46146            printf(" %d", n_ctxt);
46147            printf(" %d", n_cur);
46148            printf("\n");
46149        }
46150    }
46151    }
46152    function_tests++;
46153#endif
46154
46155    return(test_ret);
46156}
46157
46158
46159static int
46160test_xmlXPathNextFollowing(void) {
46161    int test_ret = 0;
46162
46163#if defined(LIBXML_XPATH_ENABLED)
46164    int mem_base;
46165    xmlNodePtr ret_val;
46166    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46167    int n_ctxt;
46168    xmlNodePtr cur; /* the current node in the traversal */
46169    int n_cur;
46170
46171    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46172    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46173        mem_base = xmlMemBlocks();
46174        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46175        cur = gen_xmlNodePtr(n_cur, 1);
46176
46177        ret_val = xmlXPathNextFollowing(ctxt, cur);
46178        desret_xmlNodePtr(ret_val);
46179        call_tests++;
46180        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46181        des_xmlNodePtr(n_cur, cur, 1);
46182        xmlResetLastError();
46183        if (mem_base != xmlMemBlocks()) {
46184            printf("Leak of %d blocks found in xmlXPathNextFollowing",
46185	           xmlMemBlocks() - mem_base);
46186	    test_ret++;
46187            printf(" %d", n_ctxt);
46188            printf(" %d", n_cur);
46189            printf("\n");
46190        }
46191    }
46192    }
46193    function_tests++;
46194#endif
46195
46196    return(test_ret);
46197}
46198
46199
46200static int
46201test_xmlXPathNextFollowingSibling(void) {
46202    int test_ret = 0;
46203
46204#if defined(LIBXML_XPATH_ENABLED)
46205    int mem_base;
46206    xmlNodePtr ret_val;
46207    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46208    int n_ctxt;
46209    xmlNodePtr cur; /* the current node in the traversal */
46210    int n_cur;
46211
46212    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46213    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46214        mem_base = xmlMemBlocks();
46215        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46216        cur = gen_xmlNodePtr(n_cur, 1);
46217
46218        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
46219        desret_xmlNodePtr(ret_val);
46220        call_tests++;
46221        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46222        des_xmlNodePtr(n_cur, cur, 1);
46223        xmlResetLastError();
46224        if (mem_base != xmlMemBlocks()) {
46225            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
46226	           xmlMemBlocks() - mem_base);
46227	    test_ret++;
46228            printf(" %d", n_ctxt);
46229            printf(" %d", n_cur);
46230            printf("\n");
46231        }
46232    }
46233    }
46234    function_tests++;
46235#endif
46236
46237    return(test_ret);
46238}
46239
46240
46241static int
46242test_xmlXPathNextNamespace(void) {
46243    int test_ret = 0;
46244
46245#if defined(LIBXML_XPATH_ENABLED)
46246    int mem_base;
46247    xmlNodePtr ret_val;
46248    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46249    int n_ctxt;
46250    xmlNodePtr cur; /* the current attribute in the traversal */
46251    int n_cur;
46252
46253    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46254    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46255        mem_base = xmlMemBlocks();
46256        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46257        cur = gen_xmlNodePtr(n_cur, 1);
46258
46259        ret_val = xmlXPathNextNamespace(ctxt, cur);
46260        desret_xmlNodePtr(ret_val);
46261        call_tests++;
46262        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46263        des_xmlNodePtr(n_cur, cur, 1);
46264        xmlResetLastError();
46265        if (mem_base != xmlMemBlocks()) {
46266            printf("Leak of %d blocks found in xmlXPathNextNamespace",
46267	           xmlMemBlocks() - mem_base);
46268	    test_ret++;
46269            printf(" %d", n_ctxt);
46270            printf(" %d", n_cur);
46271            printf("\n");
46272        }
46273    }
46274    }
46275    function_tests++;
46276#endif
46277
46278    return(test_ret);
46279}
46280
46281
46282static int
46283test_xmlXPathNextParent(void) {
46284    int test_ret = 0;
46285
46286#if defined(LIBXML_XPATH_ENABLED)
46287    int mem_base;
46288    xmlNodePtr ret_val;
46289    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46290    int n_ctxt;
46291    xmlNodePtr cur; /* the current node in the traversal */
46292    int n_cur;
46293
46294    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46295    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46296        mem_base = xmlMemBlocks();
46297        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46298        cur = gen_xmlNodePtr(n_cur, 1);
46299
46300        ret_val = xmlXPathNextParent(ctxt, cur);
46301        desret_xmlNodePtr(ret_val);
46302        call_tests++;
46303        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46304        des_xmlNodePtr(n_cur, cur, 1);
46305        xmlResetLastError();
46306        if (mem_base != xmlMemBlocks()) {
46307            printf("Leak of %d blocks found in xmlXPathNextParent",
46308	           xmlMemBlocks() - mem_base);
46309	    test_ret++;
46310            printf(" %d", n_ctxt);
46311            printf(" %d", n_cur);
46312            printf("\n");
46313        }
46314    }
46315    }
46316    function_tests++;
46317#endif
46318
46319    return(test_ret);
46320}
46321
46322
46323static int
46324test_xmlXPathNextPreceding(void) {
46325    int test_ret = 0;
46326
46327#if defined(LIBXML_XPATH_ENABLED)
46328    int mem_base;
46329    xmlNodePtr ret_val;
46330    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46331    int n_ctxt;
46332    xmlNodePtr cur; /* the current node in the traversal */
46333    int n_cur;
46334
46335    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46336    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46337        mem_base = xmlMemBlocks();
46338        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46339        cur = gen_xmlNodePtr(n_cur, 1);
46340
46341        ret_val = xmlXPathNextPreceding(ctxt, cur);
46342        desret_xmlNodePtr(ret_val);
46343        call_tests++;
46344        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46345        des_xmlNodePtr(n_cur, cur, 1);
46346        xmlResetLastError();
46347        if (mem_base != xmlMemBlocks()) {
46348            printf("Leak of %d blocks found in xmlXPathNextPreceding",
46349	           xmlMemBlocks() - mem_base);
46350	    test_ret++;
46351            printf(" %d", n_ctxt);
46352            printf(" %d", n_cur);
46353            printf("\n");
46354        }
46355    }
46356    }
46357    function_tests++;
46358#endif
46359
46360    return(test_ret);
46361}
46362
46363
46364static int
46365test_xmlXPathNextPrecedingSibling(void) {
46366    int test_ret = 0;
46367
46368#if defined(LIBXML_XPATH_ENABLED)
46369    int mem_base;
46370    xmlNodePtr ret_val;
46371    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46372    int n_ctxt;
46373    xmlNodePtr cur; /* the current node in the traversal */
46374    int n_cur;
46375
46376    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46377    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46378        mem_base = xmlMemBlocks();
46379        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46380        cur = gen_xmlNodePtr(n_cur, 1);
46381
46382        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
46383        desret_xmlNodePtr(ret_val);
46384        call_tests++;
46385        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46386        des_xmlNodePtr(n_cur, cur, 1);
46387        xmlResetLastError();
46388        if (mem_base != xmlMemBlocks()) {
46389            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
46390	           xmlMemBlocks() - mem_base);
46391	    test_ret++;
46392            printf(" %d", n_ctxt);
46393            printf(" %d", n_cur);
46394            printf("\n");
46395        }
46396    }
46397    }
46398    function_tests++;
46399#endif
46400
46401    return(test_ret);
46402}
46403
46404
46405static int
46406test_xmlXPathNextSelf(void) {
46407    int test_ret = 0;
46408
46409#if defined(LIBXML_XPATH_ENABLED)
46410    int mem_base;
46411    xmlNodePtr ret_val;
46412    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46413    int n_ctxt;
46414    xmlNodePtr cur; /* the current node in the traversal */
46415    int n_cur;
46416
46417    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46418    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
46419        mem_base = xmlMemBlocks();
46420        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46421        cur = gen_xmlNodePtr(n_cur, 1);
46422
46423        ret_val = xmlXPathNextSelf(ctxt, cur);
46424        desret_xmlNodePtr(ret_val);
46425        call_tests++;
46426        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46427        des_xmlNodePtr(n_cur, cur, 1);
46428        xmlResetLastError();
46429        if (mem_base != xmlMemBlocks()) {
46430            printf("Leak of %d blocks found in xmlXPathNextSelf",
46431	           xmlMemBlocks() - mem_base);
46432	    test_ret++;
46433            printf(" %d", n_ctxt);
46434            printf(" %d", n_cur);
46435            printf("\n");
46436        }
46437    }
46438    }
46439    function_tests++;
46440#endif
46441
46442    return(test_ret);
46443}
46444
46445
46446static int
46447test_xmlXPathNodeLeading(void) {
46448    int test_ret = 0;
46449
46450#if defined(LIBXML_XPATH_ENABLED)
46451    int mem_base;
46452    xmlNodeSetPtr ret_val;
46453    xmlNodeSetPtr nodes; /* a node-set */
46454    int n_nodes;
46455    xmlNodePtr node; /* a node */
46456    int n_node;
46457
46458    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46459    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46460        mem_base = xmlMemBlocks();
46461        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46462        node = gen_xmlNodePtr(n_node, 1);
46463
46464        ret_val = xmlXPathNodeLeading(nodes, node);
46465        desret_xmlNodeSetPtr(ret_val);
46466        call_tests++;
46467        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46468        des_xmlNodePtr(n_node, node, 1);
46469        xmlResetLastError();
46470        if (mem_base != xmlMemBlocks()) {
46471            printf("Leak of %d blocks found in xmlXPathNodeLeading",
46472	           xmlMemBlocks() - mem_base);
46473	    test_ret++;
46474            printf(" %d", n_nodes);
46475            printf(" %d", n_node);
46476            printf("\n");
46477        }
46478    }
46479    }
46480    function_tests++;
46481#endif
46482
46483    return(test_ret);
46484}
46485
46486
46487static int
46488test_xmlXPathNodeLeadingSorted(void) {
46489    int test_ret = 0;
46490
46491#if defined(LIBXML_XPATH_ENABLED)
46492    int mem_base;
46493    xmlNodeSetPtr ret_val;
46494    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46495    int n_nodes;
46496    xmlNodePtr node; /* a node */
46497    int n_node;
46498
46499    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46500    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46501        mem_base = xmlMemBlocks();
46502        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46503        node = gen_xmlNodePtr(n_node, 1);
46504
46505        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
46506        desret_xmlNodeSetPtr(ret_val);
46507        call_tests++;
46508        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46509        des_xmlNodePtr(n_node, node, 1);
46510        xmlResetLastError();
46511        if (mem_base != xmlMemBlocks()) {
46512            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
46513	           xmlMemBlocks() - mem_base);
46514	    test_ret++;
46515            printf(" %d", n_nodes);
46516            printf(" %d", n_node);
46517            printf("\n");
46518        }
46519    }
46520    }
46521    function_tests++;
46522#endif
46523
46524    return(test_ret);
46525}
46526
46527
46528static int
46529test_xmlXPathNodeSetAdd(void) {
46530    int test_ret = 0;
46531
46532#if defined(LIBXML_XPATH_ENABLED)
46533    int mem_base;
46534    xmlNodeSetPtr cur; /* the initial node set */
46535    int n_cur;
46536    xmlNodePtr val; /* a new xmlNodePtr */
46537    int n_val;
46538
46539    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46540    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46541        mem_base = xmlMemBlocks();
46542        cur = gen_xmlNodeSetPtr(n_cur, 0);
46543        val = gen_xmlNodePtr(n_val, 1);
46544
46545        xmlXPathNodeSetAdd(cur, val);
46546        call_tests++;
46547        des_xmlNodeSetPtr(n_cur, cur, 0);
46548        des_xmlNodePtr(n_val, val, 1);
46549        xmlResetLastError();
46550        if (mem_base != xmlMemBlocks()) {
46551            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
46552	           xmlMemBlocks() - mem_base);
46553	    test_ret++;
46554            printf(" %d", n_cur);
46555            printf(" %d", n_val);
46556            printf("\n");
46557        }
46558    }
46559    }
46560    function_tests++;
46561#endif
46562
46563    return(test_ret);
46564}
46565
46566
46567static int
46568test_xmlXPathNodeSetAddNs(void) {
46569    int test_ret = 0;
46570
46571#if defined(LIBXML_XPATH_ENABLED)
46572    int mem_base;
46573    xmlNodeSetPtr cur; /* the initial node set */
46574    int n_cur;
46575    xmlNodePtr node; /* the hosting node */
46576    int n_node;
46577    xmlNsPtr ns; /* a the namespace node */
46578    int n_ns;
46579
46580    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46581    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46582    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
46583        mem_base = xmlMemBlocks();
46584        cur = gen_xmlNodeSetPtr(n_cur, 0);
46585        node = gen_xmlNodePtr(n_node, 1);
46586        ns = gen_xmlNsPtr(n_ns, 2);
46587
46588        xmlXPathNodeSetAddNs(cur, node, ns);
46589        call_tests++;
46590        des_xmlNodeSetPtr(n_cur, cur, 0);
46591        des_xmlNodePtr(n_node, node, 1);
46592        des_xmlNsPtr(n_ns, ns, 2);
46593        xmlResetLastError();
46594        if (mem_base != xmlMemBlocks()) {
46595            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
46596	           xmlMemBlocks() - mem_base);
46597	    test_ret++;
46598            printf(" %d", n_cur);
46599            printf(" %d", n_node);
46600            printf(" %d", n_ns);
46601            printf("\n");
46602        }
46603    }
46604    }
46605    }
46606    function_tests++;
46607#endif
46608
46609    return(test_ret);
46610}
46611
46612
46613static int
46614test_xmlXPathNodeSetAddUnique(void) {
46615    int test_ret = 0;
46616
46617#if defined(LIBXML_XPATH_ENABLED)
46618    int mem_base;
46619    xmlNodeSetPtr cur; /* the initial node set */
46620    int n_cur;
46621    xmlNodePtr val; /* a new xmlNodePtr */
46622    int n_val;
46623
46624    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46625    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46626        mem_base = xmlMemBlocks();
46627        cur = gen_xmlNodeSetPtr(n_cur, 0);
46628        val = gen_xmlNodePtr(n_val, 1);
46629
46630        xmlXPathNodeSetAddUnique(cur, val);
46631        call_tests++;
46632        des_xmlNodeSetPtr(n_cur, cur, 0);
46633        des_xmlNodePtr(n_val, val, 1);
46634        xmlResetLastError();
46635        if (mem_base != xmlMemBlocks()) {
46636            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
46637	           xmlMemBlocks() - mem_base);
46638	    test_ret++;
46639            printf(" %d", n_cur);
46640            printf(" %d", n_val);
46641            printf("\n");
46642        }
46643    }
46644    }
46645    function_tests++;
46646#endif
46647
46648    return(test_ret);
46649}
46650
46651
46652static int
46653test_xmlXPathNodeSetContains(void) {
46654    int test_ret = 0;
46655
46656#if defined(LIBXML_XPATH_ENABLED)
46657    int mem_base;
46658    int ret_val;
46659    xmlNodeSetPtr cur; /* the node-set */
46660    int n_cur;
46661    xmlNodePtr val; /* the node */
46662    int n_val;
46663
46664    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46665    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46666        mem_base = xmlMemBlocks();
46667        cur = gen_xmlNodeSetPtr(n_cur, 0);
46668        val = gen_xmlNodePtr(n_val, 1);
46669
46670        ret_val = xmlXPathNodeSetContains(cur, val);
46671        desret_int(ret_val);
46672        call_tests++;
46673        des_xmlNodeSetPtr(n_cur, cur, 0);
46674        des_xmlNodePtr(n_val, val, 1);
46675        xmlResetLastError();
46676        if (mem_base != xmlMemBlocks()) {
46677            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
46678	           xmlMemBlocks() - mem_base);
46679	    test_ret++;
46680            printf(" %d", n_cur);
46681            printf(" %d", n_val);
46682            printf("\n");
46683        }
46684    }
46685    }
46686    function_tests++;
46687#endif
46688
46689    return(test_ret);
46690}
46691
46692
46693static int
46694test_xmlXPathNodeSetDel(void) {
46695    int test_ret = 0;
46696
46697#if defined(LIBXML_XPATH_ENABLED)
46698    int mem_base;
46699    xmlNodeSetPtr cur; /* the initial node set */
46700    int n_cur;
46701    xmlNodePtr val; /* an xmlNodePtr */
46702    int n_val;
46703
46704    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46705    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46706        mem_base = xmlMemBlocks();
46707        cur = gen_xmlNodeSetPtr(n_cur, 0);
46708        val = gen_xmlNodePtr(n_val, 1);
46709
46710        xmlXPathNodeSetDel(cur, val);
46711        call_tests++;
46712        des_xmlNodeSetPtr(n_cur, cur, 0);
46713        des_xmlNodePtr(n_val, val, 1);
46714        xmlResetLastError();
46715        if (mem_base != xmlMemBlocks()) {
46716            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
46717	           xmlMemBlocks() - mem_base);
46718	    test_ret++;
46719            printf(" %d", n_cur);
46720            printf(" %d", n_val);
46721            printf("\n");
46722        }
46723    }
46724    }
46725    function_tests++;
46726#endif
46727
46728    return(test_ret);
46729}
46730
46731
46732static int
46733test_xmlXPathNodeSetMerge(void) {
46734    int test_ret = 0;
46735
46736#if defined(LIBXML_XPATH_ENABLED)
46737    int mem_base;
46738    xmlNodeSetPtr ret_val;
46739    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
46740    int n_val1;
46741    xmlNodeSetPtr val2; /* the second NodeSet */
46742    int n_val2;
46743
46744    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
46745    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
46746        mem_base = xmlMemBlocks();
46747        val1 = gen_xmlNodeSetPtr(n_val1, 0);
46748        val2 = gen_xmlNodeSetPtr(n_val2, 1);
46749
46750        ret_val = xmlXPathNodeSetMerge(val1, val2);
46751        desret_xmlNodeSetPtr(ret_val);
46752        call_tests++;
46753        des_xmlNodeSetPtr(n_val1, val1, 0);
46754        des_xmlNodeSetPtr(n_val2, val2, 1);
46755        xmlResetLastError();
46756        if (mem_base != xmlMemBlocks()) {
46757            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
46758	           xmlMemBlocks() - mem_base);
46759	    test_ret++;
46760            printf(" %d", n_val1);
46761            printf(" %d", n_val2);
46762            printf("\n");
46763        }
46764    }
46765    }
46766    function_tests++;
46767#endif
46768
46769    return(test_ret);
46770}
46771
46772
46773static int
46774test_xmlXPathNodeSetRemove(void) {
46775    int test_ret = 0;
46776
46777#if defined(LIBXML_XPATH_ENABLED)
46778    int mem_base;
46779    xmlNodeSetPtr cur; /* the initial node set */
46780    int n_cur;
46781    int val; /* the index to remove */
46782    int n_val;
46783
46784    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
46785    for (n_val = 0;n_val < gen_nb_int;n_val++) {
46786        mem_base = xmlMemBlocks();
46787        cur = gen_xmlNodeSetPtr(n_cur, 0);
46788        val = gen_int(n_val, 1);
46789
46790        xmlXPathNodeSetRemove(cur, val);
46791        call_tests++;
46792        des_xmlNodeSetPtr(n_cur, cur, 0);
46793        des_int(n_val, val, 1);
46794        xmlResetLastError();
46795        if (mem_base != xmlMemBlocks()) {
46796            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
46797	           xmlMemBlocks() - mem_base);
46798	    test_ret++;
46799            printf(" %d", n_cur);
46800            printf(" %d", n_val);
46801            printf("\n");
46802        }
46803    }
46804    }
46805    function_tests++;
46806#endif
46807
46808    return(test_ret);
46809}
46810
46811
46812static int
46813test_xmlXPathNodeSetSort(void) {
46814    int test_ret = 0;
46815
46816#if defined(LIBXML_XPATH_ENABLED)
46817    int mem_base;
46818    xmlNodeSetPtr set; /* the node set */
46819    int n_set;
46820
46821    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
46822        mem_base = xmlMemBlocks();
46823        set = gen_xmlNodeSetPtr(n_set, 0);
46824
46825        xmlXPathNodeSetSort(set);
46826        call_tests++;
46827        des_xmlNodeSetPtr(n_set, set, 0);
46828        xmlResetLastError();
46829        if (mem_base != xmlMemBlocks()) {
46830            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
46831	           xmlMemBlocks() - mem_base);
46832	    test_ret++;
46833            printf(" %d", n_set);
46834            printf("\n");
46835        }
46836    }
46837    function_tests++;
46838#endif
46839
46840    return(test_ret);
46841}
46842
46843
46844static int
46845test_xmlXPathNodeTrailing(void) {
46846    int test_ret = 0;
46847
46848#if defined(LIBXML_XPATH_ENABLED)
46849    int mem_base;
46850    xmlNodeSetPtr ret_val;
46851    xmlNodeSetPtr nodes; /* a node-set */
46852    int n_nodes;
46853    xmlNodePtr node; /* a node */
46854    int n_node;
46855
46856    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46857    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46858        mem_base = xmlMemBlocks();
46859        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46860        node = gen_xmlNodePtr(n_node, 1);
46861
46862        ret_val = xmlXPathNodeTrailing(nodes, node);
46863        desret_xmlNodeSetPtr(ret_val);
46864        call_tests++;
46865        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46866        des_xmlNodePtr(n_node, node, 1);
46867        xmlResetLastError();
46868        if (mem_base != xmlMemBlocks()) {
46869            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
46870	           xmlMemBlocks() - mem_base);
46871	    test_ret++;
46872            printf(" %d", n_nodes);
46873            printf(" %d", n_node);
46874            printf("\n");
46875        }
46876    }
46877    }
46878    function_tests++;
46879#endif
46880
46881    return(test_ret);
46882}
46883
46884
46885static int
46886test_xmlXPathNodeTrailingSorted(void) {
46887    int test_ret = 0;
46888
46889#if defined(LIBXML_XPATH_ENABLED)
46890    int mem_base;
46891    xmlNodeSetPtr ret_val;
46892    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46893    int n_nodes;
46894    xmlNodePtr node; /* a node */
46895    int n_node;
46896
46897    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46898    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
46899        mem_base = xmlMemBlocks();
46900        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46901        node = gen_xmlNodePtr(n_node, 1);
46902
46903        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
46904        desret_xmlNodeSetPtr(ret_val);
46905        call_tests++;
46906        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46907        des_xmlNodePtr(n_node, node, 1);
46908        xmlResetLastError();
46909        if (mem_base != xmlMemBlocks()) {
46910            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
46911	           xmlMemBlocks() - mem_base);
46912	    test_ret++;
46913            printf(" %d", n_nodes);
46914            printf(" %d", n_node);
46915            printf("\n");
46916        }
46917    }
46918    }
46919    function_tests++;
46920#endif
46921
46922    return(test_ret);
46923}
46924
46925
46926static int
46927test_xmlXPathNormalizeFunction(void) {
46928    int test_ret = 0;
46929
46930#if defined(LIBXML_XPATH_ENABLED)
46931    int mem_base;
46932    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46933    int n_ctxt;
46934    int nargs; /* the number of arguments */
46935    int n_nargs;
46936
46937    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46938    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46939        mem_base = xmlMemBlocks();
46940        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46941        nargs = gen_int(n_nargs, 1);
46942
46943        xmlXPathNormalizeFunction(ctxt, nargs);
46944        call_tests++;
46945        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46946        des_int(n_nargs, nargs, 1);
46947        xmlResetLastError();
46948        if (mem_base != xmlMemBlocks()) {
46949            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
46950	           xmlMemBlocks() - mem_base);
46951	    test_ret++;
46952            printf(" %d", n_ctxt);
46953            printf(" %d", n_nargs);
46954            printf("\n");
46955        }
46956    }
46957    }
46958    function_tests++;
46959#endif
46960
46961    return(test_ret);
46962}
46963
46964
46965static int
46966test_xmlXPathNotEqualValues(void) {
46967    int test_ret = 0;
46968
46969#if defined(LIBXML_XPATH_ENABLED)
46970    int mem_base;
46971    int ret_val;
46972    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46973    int n_ctxt;
46974
46975    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46976        mem_base = xmlMemBlocks();
46977        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46978
46979        ret_val = xmlXPathNotEqualValues(ctxt);
46980        desret_int(ret_val);
46981        call_tests++;
46982        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46983        xmlResetLastError();
46984        if (mem_base != xmlMemBlocks()) {
46985            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
46986	           xmlMemBlocks() - mem_base);
46987	    test_ret++;
46988            printf(" %d", n_ctxt);
46989            printf("\n");
46990        }
46991    }
46992    function_tests++;
46993#endif
46994
46995    return(test_ret);
46996}
46997
46998
46999static int
47000test_xmlXPathNotFunction(void) {
47001    int test_ret = 0;
47002
47003#if defined(LIBXML_XPATH_ENABLED)
47004    int mem_base;
47005    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47006    int n_ctxt;
47007    int nargs; /* the number of arguments */
47008    int n_nargs;
47009
47010    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47011    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47012        mem_base = xmlMemBlocks();
47013        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47014        nargs = gen_int(n_nargs, 1);
47015
47016        xmlXPathNotFunction(ctxt, nargs);
47017        call_tests++;
47018        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47019        des_int(n_nargs, nargs, 1);
47020        xmlResetLastError();
47021        if (mem_base != xmlMemBlocks()) {
47022            printf("Leak of %d blocks found in xmlXPathNotFunction",
47023	           xmlMemBlocks() - mem_base);
47024	    test_ret++;
47025            printf(" %d", n_ctxt);
47026            printf(" %d", n_nargs);
47027            printf("\n");
47028        }
47029    }
47030    }
47031    function_tests++;
47032#endif
47033
47034    return(test_ret);
47035}
47036
47037
47038static int
47039test_xmlXPathNsLookup(void) {
47040    int test_ret = 0;
47041
47042#if defined(LIBXML_XPATH_ENABLED)
47043    int mem_base;
47044    const xmlChar * ret_val;
47045    xmlXPathContextPtr ctxt; /* the XPath context */
47046    int n_ctxt;
47047    xmlChar * prefix; /* the namespace prefix value */
47048    int n_prefix;
47049
47050    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47051    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
47052        mem_base = xmlMemBlocks();
47053        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47054        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
47055
47056        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
47057        desret_const_xmlChar_ptr(ret_val);
47058        call_tests++;
47059        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47060        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
47061        xmlResetLastError();
47062        if (mem_base != xmlMemBlocks()) {
47063            printf("Leak of %d blocks found in xmlXPathNsLookup",
47064	           xmlMemBlocks() - mem_base);
47065	    test_ret++;
47066            printf(" %d", n_ctxt);
47067            printf(" %d", n_prefix);
47068            printf("\n");
47069        }
47070    }
47071    }
47072    function_tests++;
47073#endif
47074
47075    return(test_ret);
47076}
47077
47078
47079static int
47080test_xmlXPathNumberFunction(void) {
47081    int test_ret = 0;
47082
47083#if defined(LIBXML_XPATH_ENABLED)
47084    int mem_base;
47085    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47086    int n_ctxt;
47087    int nargs; /* the number of arguments */
47088    int n_nargs;
47089
47090    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47091    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47092        mem_base = xmlMemBlocks();
47093        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47094        nargs = gen_int(n_nargs, 1);
47095
47096        xmlXPathNumberFunction(ctxt, nargs);
47097        call_tests++;
47098        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47099        des_int(n_nargs, nargs, 1);
47100        xmlResetLastError();
47101        if (mem_base != xmlMemBlocks()) {
47102            printf("Leak of %d blocks found in xmlXPathNumberFunction",
47103	           xmlMemBlocks() - mem_base);
47104	    test_ret++;
47105            printf(" %d", n_ctxt);
47106            printf(" %d", n_nargs);
47107            printf("\n");
47108        }
47109    }
47110    }
47111    function_tests++;
47112#endif
47113
47114    return(test_ret);
47115}
47116
47117
47118static int
47119test_xmlXPathParseNCName(void) {
47120    int test_ret = 0;
47121
47122#if defined(LIBXML_XPATH_ENABLED)
47123    int mem_base;
47124    xmlChar * ret_val;
47125    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47126    int n_ctxt;
47127
47128    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47129        mem_base = xmlMemBlocks();
47130        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47131
47132        ret_val = xmlXPathParseNCName(ctxt);
47133        desret_xmlChar_ptr(ret_val);
47134        call_tests++;
47135        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47136        xmlResetLastError();
47137        if (mem_base != xmlMemBlocks()) {
47138            printf("Leak of %d blocks found in xmlXPathParseNCName",
47139	           xmlMemBlocks() - mem_base);
47140	    test_ret++;
47141            printf(" %d", n_ctxt);
47142            printf("\n");
47143        }
47144    }
47145    function_tests++;
47146#endif
47147
47148    return(test_ret);
47149}
47150
47151
47152static int
47153test_xmlXPathParseName(void) {
47154    int test_ret = 0;
47155
47156#if defined(LIBXML_XPATH_ENABLED)
47157    int mem_base;
47158    xmlChar * ret_val;
47159    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47160    int n_ctxt;
47161
47162    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47163        mem_base = xmlMemBlocks();
47164        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47165
47166        ret_val = xmlXPathParseName(ctxt);
47167        desret_xmlChar_ptr(ret_val);
47168        call_tests++;
47169        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47170        xmlResetLastError();
47171        if (mem_base != xmlMemBlocks()) {
47172            printf("Leak of %d blocks found in xmlXPathParseName",
47173	           xmlMemBlocks() - mem_base);
47174	    test_ret++;
47175            printf(" %d", n_ctxt);
47176            printf("\n");
47177        }
47178    }
47179    function_tests++;
47180#endif
47181
47182    return(test_ret);
47183}
47184
47185
47186static int
47187test_xmlXPathPopBoolean(void) {
47188    int test_ret = 0;
47189
47190#if defined(LIBXML_XPATH_ENABLED)
47191    int mem_base;
47192    int ret_val;
47193    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47194    int n_ctxt;
47195
47196    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47197        mem_base = xmlMemBlocks();
47198        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47199
47200        ret_val = xmlXPathPopBoolean(ctxt);
47201        desret_int(ret_val);
47202        call_tests++;
47203        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47204        xmlResetLastError();
47205        if (mem_base != xmlMemBlocks()) {
47206            printf("Leak of %d blocks found in xmlXPathPopBoolean",
47207	           xmlMemBlocks() - mem_base);
47208	    test_ret++;
47209            printf(" %d", n_ctxt);
47210            printf("\n");
47211        }
47212    }
47213    function_tests++;
47214#endif
47215
47216    return(test_ret);
47217}
47218
47219
47220static int
47221test_xmlXPathPopExternal(void) {
47222    int test_ret = 0;
47223
47224#if defined(LIBXML_XPATH_ENABLED)
47225    int mem_base;
47226    void * ret_val;
47227    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47228    int n_ctxt;
47229
47230    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47231        mem_base = xmlMemBlocks();
47232        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47233
47234        ret_val = xmlXPathPopExternal(ctxt);
47235        desret_void_ptr(ret_val);
47236        call_tests++;
47237        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47238        xmlResetLastError();
47239        if (mem_base != xmlMemBlocks()) {
47240            printf("Leak of %d blocks found in xmlXPathPopExternal",
47241	           xmlMemBlocks() - mem_base);
47242	    test_ret++;
47243            printf(" %d", n_ctxt);
47244            printf("\n");
47245        }
47246    }
47247    function_tests++;
47248#endif
47249
47250    return(test_ret);
47251}
47252
47253
47254static int
47255test_xmlXPathPopNodeSet(void) {
47256    int test_ret = 0;
47257
47258#if defined(LIBXML_XPATH_ENABLED)
47259    int mem_base;
47260    xmlNodeSetPtr ret_val;
47261    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47262    int n_ctxt;
47263
47264    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47265        mem_base = xmlMemBlocks();
47266        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47267
47268        ret_val = xmlXPathPopNodeSet(ctxt);
47269        desret_xmlNodeSetPtr(ret_val);
47270        call_tests++;
47271        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47272        xmlResetLastError();
47273        if (mem_base != xmlMemBlocks()) {
47274            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
47275	           xmlMemBlocks() - mem_base);
47276	    test_ret++;
47277            printf(" %d", n_ctxt);
47278            printf("\n");
47279        }
47280    }
47281    function_tests++;
47282#endif
47283
47284    return(test_ret);
47285}
47286
47287
47288static int
47289test_xmlXPathPopNumber(void) {
47290    int test_ret = 0;
47291
47292#if defined(LIBXML_XPATH_ENABLED)
47293    int mem_base;
47294    double ret_val;
47295    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47296    int n_ctxt;
47297
47298    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47299        mem_base = xmlMemBlocks();
47300        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47301
47302        ret_val = xmlXPathPopNumber(ctxt);
47303        desret_double(ret_val);
47304        call_tests++;
47305        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47306        xmlResetLastError();
47307        if (mem_base != xmlMemBlocks()) {
47308            printf("Leak of %d blocks found in xmlXPathPopNumber",
47309	           xmlMemBlocks() - mem_base);
47310	    test_ret++;
47311            printf(" %d", n_ctxt);
47312            printf("\n");
47313        }
47314    }
47315    function_tests++;
47316#endif
47317
47318    return(test_ret);
47319}
47320
47321
47322static int
47323test_xmlXPathPopString(void) {
47324    int test_ret = 0;
47325
47326#if defined(LIBXML_XPATH_ENABLED)
47327    int mem_base;
47328    xmlChar * ret_val;
47329    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
47330    int n_ctxt;
47331
47332    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47333        mem_base = xmlMemBlocks();
47334        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47335
47336        ret_val = xmlXPathPopString(ctxt);
47337        desret_xmlChar_ptr(ret_val);
47338        call_tests++;
47339        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47340        xmlResetLastError();
47341        if (mem_base != xmlMemBlocks()) {
47342            printf("Leak of %d blocks found in xmlXPathPopString",
47343	           xmlMemBlocks() - mem_base);
47344	    test_ret++;
47345            printf(" %d", n_ctxt);
47346            printf("\n");
47347        }
47348    }
47349    function_tests++;
47350#endif
47351
47352    return(test_ret);
47353}
47354
47355
47356static int
47357test_xmlXPathPositionFunction(void) {
47358    int test_ret = 0;
47359
47360#if defined(LIBXML_XPATH_ENABLED)
47361    int mem_base;
47362    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47363    int n_ctxt;
47364    int nargs; /* the number of arguments */
47365    int n_nargs;
47366
47367    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47368    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47369        mem_base = xmlMemBlocks();
47370        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47371        nargs = gen_int(n_nargs, 1);
47372
47373        xmlXPathPositionFunction(ctxt, nargs);
47374        call_tests++;
47375        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47376        des_int(n_nargs, nargs, 1);
47377        xmlResetLastError();
47378        if (mem_base != xmlMemBlocks()) {
47379            printf("Leak of %d blocks found in xmlXPathPositionFunction",
47380	           xmlMemBlocks() - mem_base);
47381	    test_ret++;
47382            printf(" %d", n_ctxt);
47383            printf(" %d", n_nargs);
47384            printf("\n");
47385        }
47386    }
47387    }
47388    function_tests++;
47389#endif
47390
47391    return(test_ret);
47392}
47393
47394
47395static int
47396test_xmlXPathRegisterAllFunctions(void) {
47397    int test_ret = 0;
47398
47399#if defined(LIBXML_XPATH_ENABLED)
47400    int mem_base;
47401    xmlXPathContextPtr ctxt; /* the XPath context */
47402    int n_ctxt;
47403
47404    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47405        mem_base = xmlMemBlocks();
47406        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47407
47408        xmlXPathRegisterAllFunctions(ctxt);
47409        call_tests++;
47410        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47411        xmlResetLastError();
47412        if (mem_base != xmlMemBlocks()) {
47413            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
47414	           xmlMemBlocks() - mem_base);
47415	    test_ret++;
47416            printf(" %d", n_ctxt);
47417            printf("\n");
47418        }
47419    }
47420    function_tests++;
47421#endif
47422
47423    return(test_ret);
47424}
47425
47426
47427static int
47428test_xmlXPathRegisterFunc(void) {
47429    int test_ret = 0;
47430
47431
47432    /* missing type support */
47433    return(test_ret);
47434}
47435
47436
47437static int
47438test_xmlXPathRegisterFuncLookup(void) {
47439    int test_ret = 0;
47440
47441
47442    /* missing type support */
47443    return(test_ret);
47444}
47445
47446
47447static int
47448test_xmlXPathRegisterFuncNS(void) {
47449    int test_ret = 0;
47450
47451
47452    /* missing type support */
47453    return(test_ret);
47454}
47455
47456
47457static int
47458test_xmlXPathRegisterNs(void) {
47459    int test_ret = 0;
47460
47461#if defined(LIBXML_XPATH_ENABLED)
47462    int mem_base;
47463    int ret_val;
47464    xmlXPathContextPtr ctxt; /* the XPath context */
47465    int n_ctxt;
47466    xmlChar * prefix; /* the namespace prefix */
47467    int n_prefix;
47468    xmlChar * ns_uri; /* the namespace name */
47469    int n_ns_uri;
47470
47471    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47472    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
47473    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
47474        mem_base = xmlMemBlocks();
47475        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47476        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
47477        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
47478
47479        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
47480        desret_int(ret_val);
47481        call_tests++;
47482        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47483        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
47484        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
47485        xmlResetLastError();
47486        if (mem_base != xmlMemBlocks()) {
47487            printf("Leak of %d blocks found in xmlXPathRegisterNs",
47488	           xmlMemBlocks() - mem_base);
47489	    test_ret++;
47490            printf(" %d", n_ctxt);
47491            printf(" %d", n_prefix);
47492            printf(" %d", n_ns_uri);
47493            printf("\n");
47494        }
47495    }
47496    }
47497    }
47498    function_tests++;
47499#endif
47500
47501    return(test_ret);
47502}
47503
47504
47505static int
47506test_xmlXPathRegisterVariable(void) {
47507    int test_ret = 0;
47508
47509#if defined(LIBXML_XPATH_ENABLED)
47510    int mem_base;
47511    int ret_val;
47512    xmlXPathContextPtr ctxt; /* the XPath context */
47513    int n_ctxt;
47514    xmlChar * name; /* the variable name */
47515    int n_name;
47516    xmlXPathObjectPtr value; /* the variable value or NULL */
47517    int n_value;
47518
47519    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47520    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47521    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47522        mem_base = xmlMemBlocks();
47523        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47524        name = gen_const_xmlChar_ptr(n_name, 1);
47525        value = gen_xmlXPathObjectPtr(n_value, 2);
47526
47527        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
47528        desret_int(ret_val);
47529        call_tests++;
47530        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47531        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
47532        des_xmlXPathObjectPtr(n_value, value, 2);
47533        xmlResetLastError();
47534        if (mem_base != xmlMemBlocks()) {
47535            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
47536	           xmlMemBlocks() - mem_base);
47537	    test_ret++;
47538            printf(" %d", n_ctxt);
47539            printf(" %d", n_name);
47540            printf(" %d", n_value);
47541            printf("\n");
47542        }
47543    }
47544    }
47545    }
47546    function_tests++;
47547#endif
47548
47549    return(test_ret);
47550}
47551
47552
47553static int
47554test_xmlXPathRegisterVariableLookup(void) {
47555    int test_ret = 0;
47556
47557
47558    /* missing type support */
47559    return(test_ret);
47560}
47561
47562
47563static int
47564test_xmlXPathRegisterVariableNS(void) {
47565    int test_ret = 0;
47566
47567#if defined(LIBXML_XPATH_ENABLED)
47568    int mem_base;
47569    int ret_val;
47570    xmlXPathContextPtr ctxt; /* the XPath context */
47571    int n_ctxt;
47572    xmlChar * name; /* the variable name */
47573    int n_name;
47574    xmlChar * ns_uri; /* the variable namespace URI */
47575    int n_ns_uri;
47576    xmlXPathObjectPtr value; /* the variable value or NULL */
47577    int n_value;
47578
47579    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47580    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47581    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
47582    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
47583        mem_base = xmlMemBlocks();
47584        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47585        name = gen_const_xmlChar_ptr(n_name, 1);
47586        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
47587        value = gen_xmlXPathObjectPtr(n_value, 3);
47588
47589        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
47590        desret_int(ret_val);
47591        call_tests++;
47592        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47593        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
47594        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
47595        des_xmlXPathObjectPtr(n_value, value, 3);
47596        xmlResetLastError();
47597        if (mem_base != xmlMemBlocks()) {
47598            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
47599	           xmlMemBlocks() - mem_base);
47600	    test_ret++;
47601            printf(" %d", n_ctxt);
47602            printf(" %d", n_name);
47603            printf(" %d", n_ns_uri);
47604            printf(" %d", n_value);
47605            printf("\n");
47606        }
47607    }
47608    }
47609    }
47610    }
47611    function_tests++;
47612#endif
47613
47614    return(test_ret);
47615}
47616
47617
47618static int
47619test_xmlXPathRegisteredFuncsCleanup(void) {
47620    int test_ret = 0;
47621
47622#if defined(LIBXML_XPATH_ENABLED)
47623    int mem_base;
47624    xmlXPathContextPtr ctxt; /* the XPath context */
47625    int n_ctxt;
47626
47627    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47628        mem_base = xmlMemBlocks();
47629        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47630
47631        xmlXPathRegisteredFuncsCleanup(ctxt);
47632        call_tests++;
47633        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47634        xmlResetLastError();
47635        if (mem_base != xmlMemBlocks()) {
47636            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
47637	           xmlMemBlocks() - mem_base);
47638	    test_ret++;
47639            printf(" %d", n_ctxt);
47640            printf("\n");
47641        }
47642    }
47643    function_tests++;
47644#endif
47645
47646    return(test_ret);
47647}
47648
47649
47650static int
47651test_xmlXPathRegisteredNsCleanup(void) {
47652    int test_ret = 0;
47653
47654#if defined(LIBXML_XPATH_ENABLED)
47655    int mem_base;
47656    xmlXPathContextPtr ctxt; /* the XPath context */
47657    int n_ctxt;
47658
47659    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47660        mem_base = xmlMemBlocks();
47661        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47662
47663        xmlXPathRegisteredNsCleanup(ctxt);
47664        call_tests++;
47665        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47666        xmlResetLastError();
47667        if (mem_base != xmlMemBlocks()) {
47668            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
47669	           xmlMemBlocks() - mem_base);
47670	    test_ret++;
47671            printf(" %d", n_ctxt);
47672            printf("\n");
47673        }
47674    }
47675    function_tests++;
47676#endif
47677
47678    return(test_ret);
47679}
47680
47681
47682static int
47683test_xmlXPathRegisteredVariablesCleanup(void) {
47684    int test_ret = 0;
47685
47686#if defined(LIBXML_XPATH_ENABLED)
47687    int mem_base;
47688    xmlXPathContextPtr ctxt; /* the XPath context */
47689    int n_ctxt;
47690
47691    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47692        mem_base = xmlMemBlocks();
47693        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47694
47695        xmlXPathRegisteredVariablesCleanup(ctxt);
47696        call_tests++;
47697        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47698        xmlResetLastError();
47699        if (mem_base != xmlMemBlocks()) {
47700            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
47701	           xmlMemBlocks() - mem_base);
47702	    test_ret++;
47703            printf(" %d", n_ctxt);
47704            printf("\n");
47705        }
47706    }
47707    function_tests++;
47708#endif
47709
47710    return(test_ret);
47711}
47712
47713
47714static int
47715test_xmlXPathRoot(void) {
47716    int test_ret = 0;
47717
47718#if defined(LIBXML_XPATH_ENABLED)
47719    int mem_base;
47720    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47721    int n_ctxt;
47722
47723    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47724        mem_base = xmlMemBlocks();
47725        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47726
47727        xmlXPathRoot(ctxt);
47728        call_tests++;
47729        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47730        xmlResetLastError();
47731        if (mem_base != xmlMemBlocks()) {
47732            printf("Leak of %d blocks found in xmlXPathRoot",
47733	           xmlMemBlocks() - mem_base);
47734	    test_ret++;
47735            printf(" %d", n_ctxt);
47736            printf("\n");
47737        }
47738    }
47739    function_tests++;
47740#endif
47741
47742    return(test_ret);
47743}
47744
47745
47746static int
47747test_xmlXPathRoundFunction(void) {
47748    int test_ret = 0;
47749
47750#if defined(LIBXML_XPATH_ENABLED)
47751    int mem_base;
47752    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47753    int n_ctxt;
47754    int nargs; /* the number of arguments */
47755    int n_nargs;
47756
47757    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47758    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47759        mem_base = xmlMemBlocks();
47760        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47761        nargs = gen_int(n_nargs, 1);
47762
47763        xmlXPathRoundFunction(ctxt, nargs);
47764        call_tests++;
47765        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47766        des_int(n_nargs, nargs, 1);
47767        xmlResetLastError();
47768        if (mem_base != xmlMemBlocks()) {
47769            printf("Leak of %d blocks found in xmlXPathRoundFunction",
47770	           xmlMemBlocks() - mem_base);
47771	    test_ret++;
47772            printf(" %d", n_ctxt);
47773            printf(" %d", n_nargs);
47774            printf("\n");
47775        }
47776    }
47777    }
47778    function_tests++;
47779#endif
47780
47781    return(test_ret);
47782}
47783
47784
47785static int
47786test_xmlXPathStartsWithFunction(void) {
47787    int test_ret = 0;
47788
47789#if defined(LIBXML_XPATH_ENABLED)
47790    int mem_base;
47791    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47792    int n_ctxt;
47793    int nargs; /* the number of arguments */
47794    int n_nargs;
47795
47796    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47797    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47798        mem_base = xmlMemBlocks();
47799        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47800        nargs = gen_int(n_nargs, 1);
47801
47802        xmlXPathStartsWithFunction(ctxt, nargs);
47803        call_tests++;
47804        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47805        des_int(n_nargs, nargs, 1);
47806        xmlResetLastError();
47807        if (mem_base != xmlMemBlocks()) {
47808            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
47809	           xmlMemBlocks() - mem_base);
47810	    test_ret++;
47811            printf(" %d", n_ctxt);
47812            printf(" %d", n_nargs);
47813            printf("\n");
47814        }
47815    }
47816    }
47817    function_tests++;
47818#endif
47819
47820    return(test_ret);
47821}
47822
47823
47824static int
47825test_xmlXPathStringEvalNumber(void) {
47826    int test_ret = 0;
47827
47828#if defined(LIBXML_XPATH_ENABLED)
47829    int mem_base;
47830    double ret_val;
47831    xmlChar * str; /* A string to scan */
47832    int n_str;
47833
47834    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47835        mem_base = xmlMemBlocks();
47836        str = gen_const_xmlChar_ptr(n_str, 0);
47837
47838        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
47839        desret_double(ret_val);
47840        call_tests++;
47841        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
47842        xmlResetLastError();
47843        if (mem_base != xmlMemBlocks()) {
47844            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
47845	           xmlMemBlocks() - mem_base);
47846	    test_ret++;
47847            printf(" %d", n_str);
47848            printf("\n");
47849        }
47850    }
47851    function_tests++;
47852#endif
47853
47854    return(test_ret);
47855}
47856
47857
47858static int
47859test_xmlXPathStringFunction(void) {
47860    int test_ret = 0;
47861
47862#if defined(LIBXML_XPATH_ENABLED)
47863    int mem_base;
47864    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47865    int n_ctxt;
47866    int nargs; /* the number of arguments */
47867    int n_nargs;
47868
47869    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47870    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47871        mem_base = xmlMemBlocks();
47872        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47873        nargs = gen_int(n_nargs, 1);
47874
47875        xmlXPathStringFunction(ctxt, nargs);
47876        call_tests++;
47877        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47878        des_int(n_nargs, nargs, 1);
47879        xmlResetLastError();
47880        if (mem_base != xmlMemBlocks()) {
47881            printf("Leak of %d blocks found in xmlXPathStringFunction",
47882	           xmlMemBlocks() - mem_base);
47883	    test_ret++;
47884            printf(" %d", n_ctxt);
47885            printf(" %d", n_nargs);
47886            printf("\n");
47887        }
47888    }
47889    }
47890    function_tests++;
47891#endif
47892
47893    return(test_ret);
47894}
47895
47896
47897static int
47898test_xmlXPathStringLengthFunction(void) {
47899    int test_ret = 0;
47900
47901#if defined(LIBXML_XPATH_ENABLED)
47902    int mem_base;
47903    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47904    int n_ctxt;
47905    int nargs; /* the number of arguments */
47906    int n_nargs;
47907
47908    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47909    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47910        mem_base = xmlMemBlocks();
47911        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47912        nargs = gen_int(n_nargs, 1);
47913
47914        xmlXPathStringLengthFunction(ctxt, nargs);
47915        call_tests++;
47916        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47917        des_int(n_nargs, nargs, 1);
47918        xmlResetLastError();
47919        if (mem_base != xmlMemBlocks()) {
47920            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
47921	           xmlMemBlocks() - mem_base);
47922	    test_ret++;
47923            printf(" %d", n_ctxt);
47924            printf(" %d", n_nargs);
47925            printf("\n");
47926        }
47927    }
47928    }
47929    function_tests++;
47930#endif
47931
47932    return(test_ret);
47933}
47934
47935
47936static int
47937test_xmlXPathSubValues(void) {
47938    int test_ret = 0;
47939
47940#if defined(LIBXML_XPATH_ENABLED)
47941    int mem_base;
47942    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47943    int n_ctxt;
47944
47945    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47946        mem_base = xmlMemBlocks();
47947        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47948
47949        xmlXPathSubValues(ctxt);
47950        call_tests++;
47951        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47952        xmlResetLastError();
47953        if (mem_base != xmlMemBlocks()) {
47954            printf("Leak of %d blocks found in xmlXPathSubValues",
47955	           xmlMemBlocks() - mem_base);
47956	    test_ret++;
47957            printf(" %d", n_ctxt);
47958            printf("\n");
47959        }
47960    }
47961    function_tests++;
47962#endif
47963
47964    return(test_ret);
47965}
47966
47967
47968static int
47969test_xmlXPathSubstringAfterFunction(void) {
47970    int test_ret = 0;
47971
47972#if defined(LIBXML_XPATH_ENABLED)
47973    int mem_base;
47974    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47975    int n_ctxt;
47976    int nargs; /* the number of arguments */
47977    int n_nargs;
47978
47979    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47980    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47981        mem_base = xmlMemBlocks();
47982        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47983        nargs = gen_int(n_nargs, 1);
47984
47985        xmlXPathSubstringAfterFunction(ctxt, nargs);
47986        call_tests++;
47987        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47988        des_int(n_nargs, nargs, 1);
47989        xmlResetLastError();
47990        if (mem_base != xmlMemBlocks()) {
47991            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
47992	           xmlMemBlocks() - mem_base);
47993	    test_ret++;
47994            printf(" %d", n_ctxt);
47995            printf(" %d", n_nargs);
47996            printf("\n");
47997        }
47998    }
47999    }
48000    function_tests++;
48001#endif
48002
48003    return(test_ret);
48004}
48005
48006
48007static int
48008test_xmlXPathSubstringBeforeFunction(void) {
48009    int test_ret = 0;
48010
48011#if defined(LIBXML_XPATH_ENABLED)
48012    int mem_base;
48013    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48014    int n_ctxt;
48015    int nargs; /* the number of arguments */
48016    int n_nargs;
48017
48018    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48019    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48020        mem_base = xmlMemBlocks();
48021        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48022        nargs = gen_int(n_nargs, 1);
48023
48024        xmlXPathSubstringBeforeFunction(ctxt, nargs);
48025        call_tests++;
48026        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48027        des_int(n_nargs, nargs, 1);
48028        xmlResetLastError();
48029        if (mem_base != xmlMemBlocks()) {
48030            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
48031	           xmlMemBlocks() - mem_base);
48032	    test_ret++;
48033            printf(" %d", n_ctxt);
48034            printf(" %d", n_nargs);
48035            printf("\n");
48036        }
48037    }
48038    }
48039    function_tests++;
48040#endif
48041
48042    return(test_ret);
48043}
48044
48045
48046static int
48047test_xmlXPathSubstringFunction(void) {
48048    int test_ret = 0;
48049
48050#if defined(LIBXML_XPATH_ENABLED)
48051    int mem_base;
48052    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48053    int n_ctxt;
48054    int nargs; /* the number of arguments */
48055    int n_nargs;
48056
48057    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48058    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48059        mem_base = xmlMemBlocks();
48060        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48061        nargs = gen_int(n_nargs, 1);
48062
48063        xmlXPathSubstringFunction(ctxt, nargs);
48064        call_tests++;
48065        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48066        des_int(n_nargs, nargs, 1);
48067        xmlResetLastError();
48068        if (mem_base != xmlMemBlocks()) {
48069            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
48070	           xmlMemBlocks() - mem_base);
48071	    test_ret++;
48072            printf(" %d", n_ctxt);
48073            printf(" %d", n_nargs);
48074            printf("\n");
48075        }
48076    }
48077    }
48078    function_tests++;
48079#endif
48080
48081    return(test_ret);
48082}
48083
48084
48085static int
48086test_xmlXPathSumFunction(void) {
48087    int test_ret = 0;
48088
48089#if defined(LIBXML_XPATH_ENABLED)
48090    int mem_base;
48091    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48092    int n_ctxt;
48093    int nargs; /* the number of arguments */
48094    int n_nargs;
48095
48096    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48097    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48098        mem_base = xmlMemBlocks();
48099        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48100        nargs = gen_int(n_nargs, 1);
48101
48102        xmlXPathSumFunction(ctxt, nargs);
48103        call_tests++;
48104        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48105        des_int(n_nargs, nargs, 1);
48106        xmlResetLastError();
48107        if (mem_base != xmlMemBlocks()) {
48108            printf("Leak of %d blocks found in xmlXPathSumFunction",
48109	           xmlMemBlocks() - mem_base);
48110	    test_ret++;
48111            printf(" %d", n_ctxt);
48112            printf(" %d", n_nargs);
48113            printf("\n");
48114        }
48115    }
48116    }
48117    function_tests++;
48118#endif
48119
48120    return(test_ret);
48121}
48122
48123
48124static int
48125test_xmlXPathTrailing(void) {
48126    int test_ret = 0;
48127
48128#if defined(LIBXML_XPATH_ENABLED)
48129    int mem_base;
48130    xmlNodeSetPtr ret_val;
48131    xmlNodeSetPtr nodes1; /* a node-set */
48132    int n_nodes1;
48133    xmlNodeSetPtr nodes2; /* a node-set */
48134    int n_nodes2;
48135
48136    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48137    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48138        mem_base = xmlMemBlocks();
48139        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48140        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48141
48142        ret_val = xmlXPathTrailing(nodes1, nodes2);
48143        desret_xmlNodeSetPtr(ret_val);
48144        call_tests++;
48145        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48146        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48147        xmlResetLastError();
48148        if (mem_base != xmlMemBlocks()) {
48149            printf("Leak of %d blocks found in xmlXPathTrailing",
48150	           xmlMemBlocks() - mem_base);
48151	    test_ret++;
48152            printf(" %d", n_nodes1);
48153            printf(" %d", n_nodes2);
48154            printf("\n");
48155        }
48156    }
48157    }
48158    function_tests++;
48159#endif
48160
48161    return(test_ret);
48162}
48163
48164
48165static int
48166test_xmlXPathTrailingSorted(void) {
48167    int test_ret = 0;
48168
48169#if defined(LIBXML_XPATH_ENABLED)
48170    int mem_base;
48171    xmlNodeSetPtr ret_val;
48172    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
48173    int n_nodes1;
48174    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
48175    int n_nodes2;
48176
48177    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
48178    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
48179        mem_base = xmlMemBlocks();
48180        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
48181        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
48182
48183        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
48184        desret_xmlNodeSetPtr(ret_val);
48185        call_tests++;
48186        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
48187        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
48188        xmlResetLastError();
48189        if (mem_base != xmlMemBlocks()) {
48190            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
48191	           xmlMemBlocks() - mem_base);
48192	    test_ret++;
48193            printf(" %d", n_nodes1);
48194            printf(" %d", n_nodes2);
48195            printf("\n");
48196        }
48197    }
48198    }
48199    function_tests++;
48200#endif
48201
48202    return(test_ret);
48203}
48204
48205
48206static int
48207test_xmlXPathTranslateFunction(void) {
48208    int test_ret = 0;
48209
48210#if defined(LIBXML_XPATH_ENABLED)
48211    int mem_base;
48212    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48213    int n_ctxt;
48214    int nargs; /* the number of arguments */
48215    int n_nargs;
48216
48217    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48218    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48219        mem_base = xmlMemBlocks();
48220        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48221        nargs = gen_int(n_nargs, 1);
48222
48223        xmlXPathTranslateFunction(ctxt, nargs);
48224        call_tests++;
48225        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48226        des_int(n_nargs, nargs, 1);
48227        xmlResetLastError();
48228        if (mem_base != xmlMemBlocks()) {
48229            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
48230	           xmlMemBlocks() - mem_base);
48231	    test_ret++;
48232            printf(" %d", n_ctxt);
48233            printf(" %d", n_nargs);
48234            printf("\n");
48235        }
48236    }
48237    }
48238    function_tests++;
48239#endif
48240
48241    return(test_ret);
48242}
48243
48244
48245static int
48246test_xmlXPathTrueFunction(void) {
48247    int test_ret = 0;
48248
48249#if defined(LIBXML_XPATH_ENABLED)
48250    int mem_base;
48251    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48252    int n_ctxt;
48253    int nargs; /* the number of arguments */
48254    int n_nargs;
48255
48256    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48257    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48258        mem_base = xmlMemBlocks();
48259        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48260        nargs = gen_int(n_nargs, 1);
48261
48262        xmlXPathTrueFunction(ctxt, nargs);
48263        call_tests++;
48264        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48265        des_int(n_nargs, nargs, 1);
48266        xmlResetLastError();
48267        if (mem_base != xmlMemBlocks()) {
48268            printf("Leak of %d blocks found in xmlXPathTrueFunction",
48269	           xmlMemBlocks() - mem_base);
48270	    test_ret++;
48271            printf(" %d", n_ctxt);
48272            printf(" %d", n_nargs);
48273            printf("\n");
48274        }
48275    }
48276    }
48277    function_tests++;
48278#endif
48279
48280    return(test_ret);
48281}
48282
48283
48284static int
48285test_xmlXPathValueFlipSign(void) {
48286    int test_ret = 0;
48287
48288#if defined(LIBXML_XPATH_ENABLED)
48289    int mem_base;
48290    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48291    int n_ctxt;
48292
48293    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48294        mem_base = xmlMemBlocks();
48295        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48296
48297        xmlXPathValueFlipSign(ctxt);
48298        call_tests++;
48299        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48300        xmlResetLastError();
48301        if (mem_base != xmlMemBlocks()) {
48302            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
48303	           xmlMemBlocks() - mem_base);
48304	    test_ret++;
48305            printf(" %d", n_ctxt);
48306            printf("\n");
48307        }
48308    }
48309    function_tests++;
48310#endif
48311
48312    return(test_ret);
48313}
48314
48315
48316static int
48317test_xmlXPathVariableLookup(void) {
48318    int test_ret = 0;
48319
48320#if defined(LIBXML_XPATH_ENABLED)
48321    int mem_base;
48322    xmlXPathObjectPtr ret_val;
48323    xmlXPathContextPtr ctxt; /* the XPath context */
48324    int n_ctxt;
48325    xmlChar * name; /* the variable name */
48326    int n_name;
48327
48328    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48329    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48330        mem_base = xmlMemBlocks();
48331        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48332        name = gen_const_xmlChar_ptr(n_name, 1);
48333
48334        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
48335        desret_xmlXPathObjectPtr(ret_val);
48336        call_tests++;
48337        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48338        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48339        xmlResetLastError();
48340        if (mem_base != xmlMemBlocks()) {
48341            printf("Leak of %d blocks found in xmlXPathVariableLookup",
48342	           xmlMemBlocks() - mem_base);
48343	    test_ret++;
48344            printf(" %d", n_ctxt);
48345            printf(" %d", n_name);
48346            printf("\n");
48347        }
48348    }
48349    }
48350    function_tests++;
48351#endif
48352
48353    return(test_ret);
48354}
48355
48356
48357static int
48358test_xmlXPathVariableLookupNS(void) {
48359    int test_ret = 0;
48360
48361#if defined(LIBXML_XPATH_ENABLED)
48362    int mem_base;
48363    xmlXPathObjectPtr ret_val;
48364    xmlXPathContextPtr ctxt; /* the XPath context */
48365    int n_ctxt;
48366    xmlChar * name; /* the variable name */
48367    int n_name;
48368    xmlChar * ns_uri; /* the variable namespace URI */
48369    int n_ns_uri;
48370
48371    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48372    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
48373    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
48374        mem_base = xmlMemBlocks();
48375        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48376        name = gen_const_xmlChar_ptr(n_name, 1);
48377        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
48378
48379        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
48380        desret_xmlXPathObjectPtr(ret_val);
48381        call_tests++;
48382        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48383        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
48384        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
48385        xmlResetLastError();
48386        if (mem_base != xmlMemBlocks()) {
48387            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
48388	           xmlMemBlocks() - mem_base);
48389	    test_ret++;
48390            printf(" %d", n_ctxt);
48391            printf(" %d", n_name);
48392            printf(" %d", n_ns_uri);
48393            printf("\n");
48394        }
48395    }
48396    }
48397    }
48398    function_tests++;
48399#endif
48400
48401    return(test_ret);
48402}
48403
48404
48405static int
48406test_xmlXPathWrapCString(void) {
48407    int test_ret = 0;
48408
48409#if defined(LIBXML_XPATH_ENABLED)
48410    int mem_base;
48411    xmlXPathObjectPtr ret_val;
48412    char * val; /* the char * value */
48413    int n_val;
48414
48415    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
48416        mem_base = xmlMemBlocks();
48417        val = gen_char_ptr(n_val, 0);
48418
48419        ret_val = xmlXPathWrapCString(val);
48420        desret_xmlXPathObjectPtr(ret_val);
48421        call_tests++;
48422        des_char_ptr(n_val, val, 0);
48423        xmlResetLastError();
48424        if (mem_base != xmlMemBlocks()) {
48425            printf("Leak of %d blocks found in xmlXPathWrapCString",
48426	           xmlMemBlocks() - mem_base);
48427	    test_ret++;
48428            printf(" %d", n_val);
48429            printf("\n");
48430        }
48431    }
48432    function_tests++;
48433#endif
48434
48435    return(test_ret);
48436}
48437
48438
48439static int
48440test_xmlXPathWrapExternal(void) {
48441    int test_ret = 0;
48442
48443#if defined(LIBXML_XPATH_ENABLED)
48444    int mem_base;
48445    xmlXPathObjectPtr ret_val;
48446    void * val; /* the user data */
48447    int n_val;
48448
48449    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
48450        mem_base = xmlMemBlocks();
48451        val = gen_void_ptr(n_val, 0);
48452
48453        ret_val = xmlXPathWrapExternal(val);
48454        desret_xmlXPathObjectPtr(ret_val);
48455        call_tests++;
48456        des_void_ptr(n_val, val, 0);
48457        xmlResetLastError();
48458        if (mem_base != xmlMemBlocks()) {
48459            printf("Leak of %d blocks found in xmlXPathWrapExternal",
48460	           xmlMemBlocks() - mem_base);
48461	    test_ret++;
48462            printf(" %d", n_val);
48463            printf("\n");
48464        }
48465    }
48466    function_tests++;
48467#endif
48468
48469    return(test_ret);
48470}
48471
48472
48473static int
48474test_xmlXPathWrapNodeSet(void) {
48475    int test_ret = 0;
48476
48477#if defined(LIBXML_XPATH_ENABLED)
48478    int mem_base;
48479    xmlXPathObjectPtr ret_val;
48480    xmlNodeSetPtr val; /* the NodePtr value */
48481    int n_val;
48482
48483    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48484        mem_base = xmlMemBlocks();
48485        val = gen_xmlNodeSetPtr(n_val, 0);
48486
48487        ret_val = xmlXPathWrapNodeSet(val);
48488        desret_xmlXPathObjectPtr(ret_val);
48489        call_tests++;
48490        des_xmlNodeSetPtr(n_val, val, 0);
48491        xmlResetLastError();
48492        if (mem_base != xmlMemBlocks()) {
48493            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
48494	           xmlMemBlocks() - mem_base);
48495	    test_ret++;
48496            printf(" %d", n_val);
48497            printf("\n");
48498        }
48499    }
48500    function_tests++;
48501#endif
48502
48503    return(test_ret);
48504}
48505
48506
48507static int
48508test_xmlXPatherror(void) {
48509    int test_ret = 0;
48510
48511#if defined(LIBXML_XPATH_ENABLED)
48512    int mem_base;
48513    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48514    int n_ctxt;
48515    const char * file; /* the file name */
48516    int n_file;
48517    int line; /* the line number */
48518    int n_line;
48519    int no; /* the error number */
48520    int n_no;
48521
48522    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48523    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
48524    for (n_line = 0;n_line < gen_nb_int;n_line++) {
48525    for (n_no = 0;n_no < gen_nb_int;n_no++) {
48526        mem_base = xmlMemBlocks();
48527        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48528        file = gen_filepath(n_file, 1);
48529        line = gen_int(n_line, 2);
48530        no = gen_int(n_no, 3);
48531
48532        xmlXPatherror(ctxt, file, line, no);
48533        call_tests++;
48534        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48535        des_filepath(n_file, file, 1);
48536        des_int(n_line, line, 2);
48537        des_int(n_no, no, 3);
48538        xmlResetLastError();
48539        if (mem_base != xmlMemBlocks()) {
48540            printf("Leak of %d blocks found in xmlXPatherror",
48541	           xmlMemBlocks() - mem_base);
48542	    test_ret++;
48543            printf(" %d", n_ctxt);
48544            printf(" %d", n_file);
48545            printf(" %d", n_line);
48546            printf(" %d", n_no);
48547            printf("\n");
48548        }
48549    }
48550    }
48551    }
48552    }
48553    function_tests++;
48554#endif
48555
48556    return(test_ret);
48557}
48558
48559static int
48560test_xpathInternals(void) {
48561    int test_ret = 0;
48562
48563    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
48564    test_ret += test_valuePop();
48565    test_ret += test_valuePush();
48566    test_ret += test_xmlXPathAddValues();
48567    test_ret += test_xmlXPathBooleanFunction();
48568    test_ret += test_xmlXPathCeilingFunction();
48569    test_ret += test_xmlXPathCompareValues();
48570    test_ret += test_xmlXPathConcatFunction();
48571    test_ret += test_xmlXPathContainsFunction();
48572    test_ret += test_xmlXPathCountFunction();
48573    test_ret += test_xmlXPathDebugDumpCompExpr();
48574    test_ret += test_xmlXPathDebugDumpObject();
48575    test_ret += test_xmlXPathDifference();
48576    test_ret += test_xmlXPathDistinct();
48577    test_ret += test_xmlXPathDistinctSorted();
48578    test_ret += test_xmlXPathDivValues();
48579    test_ret += test_xmlXPathEqualValues();
48580    test_ret += test_xmlXPathErr();
48581    test_ret += test_xmlXPathEvalExpr();
48582    test_ret += test_xmlXPathEvaluatePredicateResult();
48583    test_ret += test_xmlXPathFalseFunction();
48584    test_ret += test_xmlXPathFloorFunction();
48585    test_ret += test_xmlXPathFunctionLookup();
48586    test_ret += test_xmlXPathFunctionLookupNS();
48587    test_ret += test_xmlXPathHasSameNodes();
48588    test_ret += test_xmlXPathIdFunction();
48589    test_ret += test_xmlXPathIntersection();
48590    test_ret += test_xmlXPathIsNodeType();
48591    test_ret += test_xmlXPathLangFunction();
48592    test_ret += test_xmlXPathLastFunction();
48593    test_ret += test_xmlXPathLeading();
48594    test_ret += test_xmlXPathLeadingSorted();
48595    test_ret += test_xmlXPathLocalNameFunction();
48596    test_ret += test_xmlXPathModValues();
48597    test_ret += test_xmlXPathMultValues();
48598    test_ret += test_xmlXPathNamespaceURIFunction();
48599    test_ret += test_xmlXPathNewBoolean();
48600    test_ret += test_xmlXPathNewCString();
48601    test_ret += test_xmlXPathNewFloat();
48602    test_ret += test_xmlXPathNewNodeSet();
48603    test_ret += test_xmlXPathNewNodeSetList();
48604    test_ret += test_xmlXPathNewParserContext();
48605    test_ret += test_xmlXPathNewString();
48606    test_ret += test_xmlXPathNextAncestor();
48607    test_ret += test_xmlXPathNextAncestorOrSelf();
48608    test_ret += test_xmlXPathNextAttribute();
48609    test_ret += test_xmlXPathNextChild();
48610    test_ret += test_xmlXPathNextDescendant();
48611    test_ret += test_xmlXPathNextDescendantOrSelf();
48612    test_ret += test_xmlXPathNextFollowing();
48613    test_ret += test_xmlXPathNextFollowingSibling();
48614    test_ret += test_xmlXPathNextNamespace();
48615    test_ret += test_xmlXPathNextParent();
48616    test_ret += test_xmlXPathNextPreceding();
48617    test_ret += test_xmlXPathNextPrecedingSibling();
48618    test_ret += test_xmlXPathNextSelf();
48619    test_ret += test_xmlXPathNodeLeading();
48620    test_ret += test_xmlXPathNodeLeadingSorted();
48621    test_ret += test_xmlXPathNodeSetAdd();
48622    test_ret += test_xmlXPathNodeSetAddNs();
48623    test_ret += test_xmlXPathNodeSetAddUnique();
48624    test_ret += test_xmlXPathNodeSetContains();
48625    test_ret += test_xmlXPathNodeSetDel();
48626    test_ret += test_xmlXPathNodeSetMerge();
48627    test_ret += test_xmlXPathNodeSetRemove();
48628    test_ret += test_xmlXPathNodeSetSort();
48629    test_ret += test_xmlXPathNodeTrailing();
48630    test_ret += test_xmlXPathNodeTrailingSorted();
48631    test_ret += test_xmlXPathNormalizeFunction();
48632    test_ret += test_xmlXPathNotEqualValues();
48633    test_ret += test_xmlXPathNotFunction();
48634    test_ret += test_xmlXPathNsLookup();
48635    test_ret += test_xmlXPathNumberFunction();
48636    test_ret += test_xmlXPathParseNCName();
48637    test_ret += test_xmlXPathParseName();
48638    test_ret += test_xmlXPathPopBoolean();
48639    test_ret += test_xmlXPathPopExternal();
48640    test_ret += test_xmlXPathPopNodeSet();
48641    test_ret += test_xmlXPathPopNumber();
48642    test_ret += test_xmlXPathPopString();
48643    test_ret += test_xmlXPathPositionFunction();
48644    test_ret += test_xmlXPathRegisterAllFunctions();
48645    test_ret += test_xmlXPathRegisterFunc();
48646    test_ret += test_xmlXPathRegisterFuncLookup();
48647    test_ret += test_xmlXPathRegisterFuncNS();
48648    test_ret += test_xmlXPathRegisterNs();
48649    test_ret += test_xmlXPathRegisterVariable();
48650    test_ret += test_xmlXPathRegisterVariableLookup();
48651    test_ret += test_xmlXPathRegisterVariableNS();
48652    test_ret += test_xmlXPathRegisteredFuncsCleanup();
48653    test_ret += test_xmlXPathRegisteredNsCleanup();
48654    test_ret += test_xmlXPathRegisteredVariablesCleanup();
48655    test_ret += test_xmlXPathRoot();
48656    test_ret += test_xmlXPathRoundFunction();
48657    test_ret += test_xmlXPathStartsWithFunction();
48658    test_ret += test_xmlXPathStringEvalNumber();
48659    test_ret += test_xmlXPathStringFunction();
48660    test_ret += test_xmlXPathStringLengthFunction();
48661    test_ret += test_xmlXPathSubValues();
48662    test_ret += test_xmlXPathSubstringAfterFunction();
48663    test_ret += test_xmlXPathSubstringBeforeFunction();
48664    test_ret += test_xmlXPathSubstringFunction();
48665    test_ret += test_xmlXPathSumFunction();
48666    test_ret += test_xmlXPathTrailing();
48667    test_ret += test_xmlXPathTrailingSorted();
48668    test_ret += test_xmlXPathTranslateFunction();
48669    test_ret += test_xmlXPathTrueFunction();
48670    test_ret += test_xmlXPathValueFlipSign();
48671    test_ret += test_xmlXPathVariableLookup();
48672    test_ret += test_xmlXPathVariableLookupNS();
48673    test_ret += test_xmlXPathWrapCString();
48674    test_ret += test_xmlXPathWrapExternal();
48675    test_ret += test_xmlXPathWrapNodeSet();
48676    test_ret += test_xmlXPatherror();
48677
48678    if (test_ret != 0)
48679	printf("Module xpathInternals: %d errors\n", test_ret);
48680    return(test_ret);
48681}
48682
48683static int
48684test_xmlXPtrBuildNodeList(void) {
48685    int test_ret = 0;
48686
48687#if defined(LIBXML_XPTR_ENABLED)
48688    int mem_base;
48689    xmlNodePtr ret_val;
48690    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
48691    int n_obj;
48692
48693    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
48694        mem_base = xmlMemBlocks();
48695        obj = gen_xmlXPathObjectPtr(n_obj, 0);
48696
48697        ret_val = xmlXPtrBuildNodeList(obj);
48698        desret_xmlNodePtr(ret_val);
48699        call_tests++;
48700        des_xmlXPathObjectPtr(n_obj, obj, 0);
48701        xmlResetLastError();
48702        if (mem_base != xmlMemBlocks()) {
48703            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
48704	           xmlMemBlocks() - mem_base);
48705	    test_ret++;
48706            printf(" %d", n_obj);
48707            printf("\n");
48708        }
48709    }
48710    function_tests++;
48711#endif
48712
48713    return(test_ret);
48714}
48715
48716
48717static int
48718test_xmlXPtrEval(void) {
48719    int test_ret = 0;
48720
48721#if defined(LIBXML_XPTR_ENABLED)
48722    int mem_base;
48723    xmlXPathObjectPtr ret_val;
48724    xmlChar * str; /* the XPointer expression */
48725    int n_str;
48726    xmlXPathContextPtr ctx; /* the XPointer context */
48727    int n_ctx;
48728
48729    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
48730    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
48731        mem_base = xmlMemBlocks();
48732        str = gen_const_xmlChar_ptr(n_str, 0);
48733        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
48734
48735        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
48736        desret_xmlXPathObjectPtr(ret_val);
48737        call_tests++;
48738        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
48739        des_xmlXPathContextPtr(n_ctx, ctx, 1);
48740        xmlResetLastError();
48741        if (mem_base != xmlMemBlocks()) {
48742            printf("Leak of %d blocks found in xmlXPtrEval",
48743	           xmlMemBlocks() - mem_base);
48744	    test_ret++;
48745            printf(" %d", n_str);
48746            printf(" %d", n_ctx);
48747            printf("\n");
48748        }
48749    }
48750    }
48751    function_tests++;
48752#endif
48753
48754    return(test_ret);
48755}
48756
48757
48758static int
48759test_xmlXPtrEvalRangePredicate(void) {
48760    int test_ret = 0;
48761
48762#if defined(LIBXML_XPTR_ENABLED)
48763    int mem_base;
48764    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
48765    int n_ctxt;
48766
48767    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48768        mem_base = xmlMemBlocks();
48769        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48770
48771        xmlXPtrEvalRangePredicate(ctxt);
48772        call_tests++;
48773        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48774        xmlResetLastError();
48775        if (mem_base != xmlMemBlocks()) {
48776            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
48777	           xmlMemBlocks() - mem_base);
48778	    test_ret++;
48779            printf(" %d", n_ctxt);
48780            printf("\n");
48781        }
48782    }
48783    function_tests++;
48784#endif
48785
48786    return(test_ret);
48787}
48788
48789#ifdef LIBXML_XPTR_ENABLED
48790
48791#define gen_nb_xmlLocationSetPtr 1
48792static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48793    return(NULL);
48794}
48795static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
48796}
48797#endif
48798
48799
48800static int
48801test_xmlXPtrLocationSetAdd(void) {
48802    int test_ret = 0;
48803
48804#if defined(LIBXML_XPTR_ENABLED)
48805    int mem_base;
48806    xmlLocationSetPtr cur; /* the initial range set */
48807    int n_cur;
48808    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
48809    int n_val;
48810
48811    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
48812    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
48813        mem_base = xmlMemBlocks();
48814        cur = gen_xmlLocationSetPtr(n_cur, 0);
48815        val = gen_xmlXPathObjectPtr(n_val, 1);
48816
48817        xmlXPtrLocationSetAdd(cur, val);
48818        call_tests++;
48819        des_xmlLocationSetPtr(n_cur, cur, 0);
48820        des_xmlXPathObjectPtr(n_val, val, 1);
48821        xmlResetLastError();
48822        if (mem_base != xmlMemBlocks()) {
48823            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
48824	           xmlMemBlocks() - mem_base);
48825	    test_ret++;
48826            printf(" %d", n_cur);
48827            printf(" %d", n_val);
48828            printf("\n");
48829        }
48830    }
48831    }
48832    function_tests++;
48833#endif
48834
48835    return(test_ret);
48836}
48837
48838
48839static int
48840test_xmlXPtrLocationSetCreate(void) {
48841    int test_ret = 0;
48842
48843
48844    /* missing type support */
48845    return(test_ret);
48846}
48847
48848
48849static int
48850test_xmlXPtrLocationSetDel(void) {
48851    int test_ret = 0;
48852
48853#if defined(LIBXML_XPTR_ENABLED)
48854    int mem_base;
48855    xmlLocationSetPtr cur; /* the initial range set */
48856    int n_cur;
48857    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
48858    int n_val;
48859
48860    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
48861    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
48862        mem_base = xmlMemBlocks();
48863        cur = gen_xmlLocationSetPtr(n_cur, 0);
48864        val = gen_xmlXPathObjectPtr(n_val, 1);
48865
48866        xmlXPtrLocationSetDel(cur, val);
48867        call_tests++;
48868        des_xmlLocationSetPtr(n_cur, cur, 0);
48869        des_xmlXPathObjectPtr(n_val, val, 1);
48870        xmlResetLastError();
48871        if (mem_base != xmlMemBlocks()) {
48872            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
48873	           xmlMemBlocks() - mem_base);
48874	    test_ret++;
48875            printf(" %d", n_cur);
48876            printf(" %d", n_val);
48877            printf("\n");
48878        }
48879    }
48880    }
48881    function_tests++;
48882#endif
48883
48884    return(test_ret);
48885}
48886
48887
48888static int
48889test_xmlXPtrLocationSetMerge(void) {
48890    int test_ret = 0;
48891
48892
48893    /* missing type support */
48894    return(test_ret);
48895}
48896
48897
48898static int
48899test_xmlXPtrLocationSetRemove(void) {
48900    int test_ret = 0;
48901
48902#if defined(LIBXML_XPTR_ENABLED)
48903    int mem_base;
48904    xmlLocationSetPtr cur; /* the initial range set */
48905    int n_cur;
48906    int val; /* the index to remove */
48907    int n_val;
48908
48909    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
48910    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48911        mem_base = xmlMemBlocks();
48912        cur = gen_xmlLocationSetPtr(n_cur, 0);
48913        val = gen_int(n_val, 1);
48914
48915        xmlXPtrLocationSetRemove(cur, val);
48916        call_tests++;
48917        des_xmlLocationSetPtr(n_cur, cur, 0);
48918        des_int(n_val, val, 1);
48919        xmlResetLastError();
48920        if (mem_base != xmlMemBlocks()) {
48921            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
48922	           xmlMemBlocks() - mem_base);
48923	    test_ret++;
48924            printf(" %d", n_cur);
48925            printf(" %d", n_val);
48926            printf("\n");
48927        }
48928    }
48929    }
48930    function_tests++;
48931#endif
48932
48933    return(test_ret);
48934}
48935
48936
48937static int
48938test_xmlXPtrNewCollapsedRange(void) {
48939    int test_ret = 0;
48940
48941#if defined(LIBXML_XPTR_ENABLED)
48942    int mem_base;
48943    xmlXPathObjectPtr ret_val;
48944    xmlNodePtr start; /* the starting and ending node */
48945    int n_start;
48946
48947    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
48948        mem_base = xmlMemBlocks();
48949        start = gen_xmlNodePtr(n_start, 0);
48950
48951        ret_val = xmlXPtrNewCollapsedRange(start);
48952        desret_xmlXPathObjectPtr(ret_val);
48953        call_tests++;
48954        des_xmlNodePtr(n_start, start, 0);
48955        xmlResetLastError();
48956        if (mem_base != xmlMemBlocks()) {
48957            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
48958	           xmlMemBlocks() - mem_base);
48959	    test_ret++;
48960            printf(" %d", n_start);
48961            printf("\n");
48962        }
48963    }
48964    function_tests++;
48965#endif
48966
48967    return(test_ret);
48968}
48969
48970
48971static int
48972test_xmlXPtrNewContext(void) {
48973    int test_ret = 0;
48974
48975
48976    /* missing type support */
48977    return(test_ret);
48978}
48979
48980
48981static int
48982test_xmlXPtrNewLocationSetNodeSet(void) {
48983    int test_ret = 0;
48984
48985#if defined(LIBXML_XPTR_ENABLED)
48986    int mem_base;
48987    xmlXPathObjectPtr ret_val;
48988    xmlNodeSetPtr set; /* a node set */
48989    int n_set;
48990
48991    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48992        mem_base = xmlMemBlocks();
48993        set = gen_xmlNodeSetPtr(n_set, 0);
48994
48995        ret_val = xmlXPtrNewLocationSetNodeSet(set);
48996        desret_xmlXPathObjectPtr(ret_val);
48997        call_tests++;
48998        des_xmlNodeSetPtr(n_set, set, 0);
48999        xmlResetLastError();
49000        if (mem_base != xmlMemBlocks()) {
49001            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
49002	           xmlMemBlocks() - mem_base);
49003	    test_ret++;
49004            printf(" %d", n_set);
49005            printf("\n");
49006        }
49007    }
49008    function_tests++;
49009#endif
49010
49011    return(test_ret);
49012}
49013
49014
49015static int
49016test_xmlXPtrNewLocationSetNodes(void) {
49017    int test_ret = 0;
49018
49019#if defined(LIBXML_XPTR_ENABLED)
49020    int mem_base;
49021    xmlXPathObjectPtr ret_val;
49022    xmlNodePtr start; /* the start NodePtr value */
49023    int n_start;
49024    xmlNodePtr end; /* the end NodePtr value or NULL */
49025    int n_end;
49026
49027    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49028    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49029        mem_base = xmlMemBlocks();
49030        start = gen_xmlNodePtr(n_start, 0);
49031        end = gen_xmlNodePtr(n_end, 1);
49032
49033        ret_val = xmlXPtrNewLocationSetNodes(start, end);
49034        desret_xmlXPathObjectPtr(ret_val);
49035        call_tests++;
49036        des_xmlNodePtr(n_start, start, 0);
49037        des_xmlNodePtr(n_end, end, 1);
49038        xmlResetLastError();
49039        if (mem_base != xmlMemBlocks()) {
49040            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
49041	           xmlMemBlocks() - mem_base);
49042	    test_ret++;
49043            printf(" %d", n_start);
49044            printf(" %d", n_end);
49045            printf("\n");
49046        }
49047    }
49048    }
49049    function_tests++;
49050#endif
49051
49052    return(test_ret);
49053}
49054
49055
49056static int
49057test_xmlXPtrNewRange(void) {
49058    int test_ret = 0;
49059
49060#if defined(LIBXML_XPTR_ENABLED)
49061    int mem_base;
49062    xmlXPathObjectPtr ret_val;
49063    xmlNodePtr start; /* the starting node */
49064    int n_start;
49065    int startindex; /* the start index */
49066    int n_startindex;
49067    xmlNodePtr end; /* the ending point */
49068    int n_end;
49069    int endindex; /* the ending index */
49070    int n_endindex;
49071
49072    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49073    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
49074    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49075    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
49076        mem_base = xmlMemBlocks();
49077        start = gen_xmlNodePtr(n_start, 0);
49078        startindex = gen_int(n_startindex, 1);
49079        end = gen_xmlNodePtr(n_end, 2);
49080        endindex = gen_int(n_endindex, 3);
49081
49082        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
49083        desret_xmlXPathObjectPtr(ret_val);
49084        call_tests++;
49085        des_xmlNodePtr(n_start, start, 0);
49086        des_int(n_startindex, startindex, 1);
49087        des_xmlNodePtr(n_end, end, 2);
49088        des_int(n_endindex, endindex, 3);
49089        xmlResetLastError();
49090        if (mem_base != xmlMemBlocks()) {
49091            printf("Leak of %d blocks found in xmlXPtrNewRange",
49092	           xmlMemBlocks() - mem_base);
49093	    test_ret++;
49094            printf(" %d", n_start);
49095            printf(" %d", n_startindex);
49096            printf(" %d", n_end);
49097            printf(" %d", n_endindex);
49098            printf("\n");
49099        }
49100    }
49101    }
49102    }
49103    }
49104    function_tests++;
49105#endif
49106
49107    return(test_ret);
49108}
49109
49110
49111static int
49112test_xmlXPtrNewRangeNodeObject(void) {
49113    int test_ret = 0;
49114
49115#if defined(LIBXML_XPTR_ENABLED)
49116    int mem_base;
49117    xmlXPathObjectPtr ret_val;
49118    xmlNodePtr start; /* the starting node */
49119    int n_start;
49120    xmlXPathObjectPtr end; /* the ending object */
49121    int n_end;
49122
49123    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49124    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
49125        mem_base = xmlMemBlocks();
49126        start = gen_xmlNodePtr(n_start, 0);
49127        end = gen_xmlXPathObjectPtr(n_end, 1);
49128
49129        ret_val = xmlXPtrNewRangeNodeObject(start, end);
49130        desret_xmlXPathObjectPtr(ret_val);
49131        call_tests++;
49132        des_xmlNodePtr(n_start, start, 0);
49133        des_xmlXPathObjectPtr(n_end, end, 1);
49134        xmlResetLastError();
49135        if (mem_base != xmlMemBlocks()) {
49136            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
49137	           xmlMemBlocks() - mem_base);
49138	    test_ret++;
49139            printf(" %d", n_start);
49140            printf(" %d", n_end);
49141            printf("\n");
49142        }
49143    }
49144    }
49145    function_tests++;
49146#endif
49147
49148    return(test_ret);
49149}
49150
49151
49152static int
49153test_xmlXPtrNewRangeNodePoint(void) {
49154    int test_ret = 0;
49155
49156#if defined(LIBXML_XPTR_ENABLED)
49157    int mem_base;
49158    xmlXPathObjectPtr ret_val;
49159    xmlNodePtr start; /* the starting node */
49160    int n_start;
49161    xmlXPathObjectPtr end; /* the ending point */
49162    int n_end;
49163
49164    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49165    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
49166        mem_base = xmlMemBlocks();
49167        start = gen_xmlNodePtr(n_start, 0);
49168        end = gen_xmlXPathObjectPtr(n_end, 1);
49169
49170        ret_val = xmlXPtrNewRangeNodePoint(start, end);
49171        desret_xmlXPathObjectPtr(ret_val);
49172        call_tests++;
49173        des_xmlNodePtr(n_start, start, 0);
49174        des_xmlXPathObjectPtr(n_end, end, 1);
49175        xmlResetLastError();
49176        if (mem_base != xmlMemBlocks()) {
49177            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
49178	           xmlMemBlocks() - mem_base);
49179	    test_ret++;
49180            printf(" %d", n_start);
49181            printf(" %d", n_end);
49182            printf("\n");
49183        }
49184    }
49185    }
49186    function_tests++;
49187#endif
49188
49189    return(test_ret);
49190}
49191
49192
49193static int
49194test_xmlXPtrNewRangeNodes(void) {
49195    int test_ret = 0;
49196
49197#if defined(LIBXML_XPTR_ENABLED)
49198    int mem_base;
49199    xmlXPathObjectPtr ret_val;
49200    xmlNodePtr start; /* the starting node */
49201    int n_start;
49202    xmlNodePtr end; /* the ending node */
49203    int n_end;
49204
49205    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
49206    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49207        mem_base = xmlMemBlocks();
49208        start = gen_xmlNodePtr(n_start, 0);
49209        end = gen_xmlNodePtr(n_end, 1);
49210
49211        ret_val = xmlXPtrNewRangeNodes(start, end);
49212        desret_xmlXPathObjectPtr(ret_val);
49213        call_tests++;
49214        des_xmlNodePtr(n_start, start, 0);
49215        des_xmlNodePtr(n_end, end, 1);
49216        xmlResetLastError();
49217        if (mem_base != xmlMemBlocks()) {
49218            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
49219	           xmlMemBlocks() - mem_base);
49220	    test_ret++;
49221            printf(" %d", n_start);
49222            printf(" %d", n_end);
49223            printf("\n");
49224        }
49225    }
49226    }
49227    function_tests++;
49228#endif
49229
49230    return(test_ret);
49231}
49232
49233
49234static int
49235test_xmlXPtrNewRangePointNode(void) {
49236    int test_ret = 0;
49237
49238#if defined(LIBXML_XPTR_ENABLED)
49239    int mem_base;
49240    xmlXPathObjectPtr ret_val;
49241    xmlXPathObjectPtr start; /* the starting point */
49242    int n_start;
49243    xmlNodePtr end; /* the ending node */
49244    int n_end;
49245
49246    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
49247    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
49248        mem_base = xmlMemBlocks();
49249        start = gen_xmlXPathObjectPtr(n_start, 0);
49250        end = gen_xmlNodePtr(n_end, 1);
49251
49252        ret_val = xmlXPtrNewRangePointNode(start, end);
49253        desret_xmlXPathObjectPtr(ret_val);
49254        call_tests++;
49255        des_xmlXPathObjectPtr(n_start, start, 0);
49256        des_xmlNodePtr(n_end, end, 1);
49257        xmlResetLastError();
49258        if (mem_base != xmlMemBlocks()) {
49259            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
49260	           xmlMemBlocks() - mem_base);
49261	    test_ret++;
49262            printf(" %d", n_start);
49263            printf(" %d", n_end);
49264            printf("\n");
49265        }
49266    }
49267    }
49268    function_tests++;
49269#endif
49270
49271    return(test_ret);
49272}
49273
49274
49275static int
49276test_xmlXPtrNewRangePoints(void) {
49277    int test_ret = 0;
49278
49279#if defined(LIBXML_XPTR_ENABLED)
49280    int mem_base;
49281    xmlXPathObjectPtr ret_val;
49282    xmlXPathObjectPtr start; /* the starting point */
49283    int n_start;
49284    xmlXPathObjectPtr end; /* the ending point */
49285    int n_end;
49286
49287    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
49288    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
49289        mem_base = xmlMemBlocks();
49290        start = gen_xmlXPathObjectPtr(n_start, 0);
49291        end = gen_xmlXPathObjectPtr(n_end, 1);
49292
49293        ret_val = xmlXPtrNewRangePoints(start, end);
49294        desret_xmlXPathObjectPtr(ret_val);
49295        call_tests++;
49296        des_xmlXPathObjectPtr(n_start, start, 0);
49297        des_xmlXPathObjectPtr(n_end, end, 1);
49298        xmlResetLastError();
49299        if (mem_base != xmlMemBlocks()) {
49300            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
49301	           xmlMemBlocks() - mem_base);
49302	    test_ret++;
49303            printf(" %d", n_start);
49304            printf(" %d", n_end);
49305            printf("\n");
49306        }
49307    }
49308    }
49309    function_tests++;
49310#endif
49311
49312    return(test_ret);
49313}
49314
49315
49316static int
49317test_xmlXPtrRangeToFunction(void) {
49318    int test_ret = 0;
49319
49320#if defined(LIBXML_XPTR_ENABLED)
49321    int mem_base;
49322    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
49323    int n_ctxt;
49324    int nargs; /* the number of args */
49325    int n_nargs;
49326
49327    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49328    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49329        mem_base = xmlMemBlocks();
49330        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49331        nargs = gen_int(n_nargs, 1);
49332
49333        xmlXPtrRangeToFunction(ctxt, nargs);
49334        call_tests++;
49335        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49336        des_int(n_nargs, nargs, 1);
49337        xmlResetLastError();
49338        if (mem_base != xmlMemBlocks()) {
49339            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
49340	           xmlMemBlocks() - mem_base);
49341	    test_ret++;
49342            printf(" %d", n_ctxt);
49343            printf(" %d", n_nargs);
49344            printf("\n");
49345        }
49346    }
49347    }
49348    function_tests++;
49349#endif
49350
49351    return(test_ret);
49352}
49353
49354
49355static int
49356test_xmlXPtrWrapLocationSet(void) {
49357    int test_ret = 0;
49358
49359#if defined(LIBXML_XPTR_ENABLED)
49360    int mem_base;
49361    xmlXPathObjectPtr ret_val;
49362    xmlLocationSetPtr val; /* the LocationSet value */
49363    int n_val;
49364
49365    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
49366        mem_base = xmlMemBlocks();
49367        val = gen_xmlLocationSetPtr(n_val, 0);
49368
49369        ret_val = xmlXPtrWrapLocationSet(val);
49370        desret_xmlXPathObjectPtr(ret_val);
49371        call_tests++;
49372        des_xmlLocationSetPtr(n_val, val, 0);
49373        xmlResetLastError();
49374        if (mem_base != xmlMemBlocks()) {
49375            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
49376	           xmlMemBlocks() - mem_base);
49377	    test_ret++;
49378            printf(" %d", n_val);
49379            printf("\n");
49380        }
49381    }
49382    function_tests++;
49383#endif
49384
49385    return(test_ret);
49386}
49387
49388static int
49389test_xpointer(void) {
49390    int test_ret = 0;
49391
49392    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
49393    test_ret += test_xmlXPtrBuildNodeList();
49394    test_ret += test_xmlXPtrEval();
49395    test_ret += test_xmlXPtrEvalRangePredicate();
49396    test_ret += test_xmlXPtrLocationSetAdd();
49397    test_ret += test_xmlXPtrLocationSetCreate();
49398    test_ret += test_xmlXPtrLocationSetDel();
49399    test_ret += test_xmlXPtrLocationSetMerge();
49400    test_ret += test_xmlXPtrLocationSetRemove();
49401    test_ret += test_xmlXPtrNewCollapsedRange();
49402    test_ret += test_xmlXPtrNewContext();
49403    test_ret += test_xmlXPtrNewLocationSetNodeSet();
49404    test_ret += test_xmlXPtrNewLocationSetNodes();
49405    test_ret += test_xmlXPtrNewRange();
49406    test_ret += test_xmlXPtrNewRangeNodeObject();
49407    test_ret += test_xmlXPtrNewRangeNodePoint();
49408    test_ret += test_xmlXPtrNewRangeNodes();
49409    test_ret += test_xmlXPtrNewRangePointNode();
49410    test_ret += test_xmlXPtrNewRangePoints();
49411    test_ret += test_xmlXPtrRangeToFunction();
49412    test_ret += test_xmlXPtrWrapLocationSet();
49413
49414    if (test_ret != 0)
49415	printf("Module xpointer: %d errors\n", test_ret);
49416    return(test_ret);
49417}
49418static int
49419test_module(const char *module) {
49420    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
49421    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
49422    if (!strcmp(module, "SAX2")) return(test_SAX2());
49423    if (!strcmp(module, "c14n")) return(test_c14n());
49424    if (!strcmp(module, "catalog")) return(test_catalog());
49425    if (!strcmp(module, "chvalid")) return(test_chvalid());
49426    if (!strcmp(module, "debugXML")) return(test_debugXML());
49427    if (!strcmp(module, "dict")) return(test_dict());
49428    if (!strcmp(module, "encoding")) return(test_encoding());
49429    if (!strcmp(module, "entities")) return(test_entities());
49430    if (!strcmp(module, "hash")) return(test_hash());
49431    if (!strcmp(module, "list")) return(test_list());
49432    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
49433    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
49434    if (!strcmp(module, "parser")) return(test_parser());
49435    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
49436    if (!strcmp(module, "pattern")) return(test_pattern());
49437    if (!strcmp(module, "relaxng")) return(test_relaxng());
49438    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
49439    if (!strcmp(module, "tree")) return(test_tree());
49440    if (!strcmp(module, "uri")) return(test_uri());
49441    if (!strcmp(module, "valid")) return(test_valid());
49442    if (!strcmp(module, "xinclude")) return(test_xinclude());
49443    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
49444    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
49445    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
49446    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
49447    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
49448    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
49449    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
49450    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
49451    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
49452    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
49453    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
49454    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
49455    if (!strcmp(module, "xpath")) return(test_xpath());
49456    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
49457    if (!strcmp(module, "xpointer")) return(test_xpointer());
49458    return(0);
49459}
49460