testapi.c revision 27f2010023ac8978ab7377c5fc4d3cedd2ed1d5b
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] = "  chartab\n";
24static int inttab[1024];
25#if 0
26static unsigned long longtab[1024];
27#endif
28
29static xmlDocPtr api_doc = NULL;
30static xmlDtdPtr api_dtd = NULL;
31static xmlNodePtr api_root = NULL;
32static xmlAttrPtr api_attr = NULL;
33static xmlNsPtr api_ns = NULL;
34
35static void
36structured_errors(void *userData ATTRIBUTE_UNUSED,
37                  xmlErrorPtr error ATTRIBUTE_UNUSED) {
38    generic_errors++;
39}
40
41static void
42free_api_doc(void) {
43    xmlFreeDoc(api_doc);
44    api_doc = NULL;
45    api_dtd = NULL;
46    api_root = NULL;
47    api_attr = NULL;
48    api_ns = NULL;
49}
50
51static xmlDocPtr
52get_api_doc(void) {
53    if (api_doc == NULL) {
54        api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
55	api_root = NULL;
56	api_attr = NULL;
57    }
58    return(api_doc);
59}
60
61static xmlDtdPtr
62get_api_dtd(void) {
63    if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
64        get_api_doc();
65	if ((api_doc != NULL) && (api_doc->children != NULL) &&
66	    (api_doc->children->type == XML_DTD_NODE))
67	    api_dtd = api_doc->children;
68    }
69    return(api_dtd);
70}
71
72static xmlNodePtr
73get_api_root(void) {
74    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
75        get_api_doc();
76	if ((api_doc != NULL) && (api_doc->children != NULL) &&
77	    (api_doc->children->next != NULL) &&
78	    (api_doc->children->next->type == XML_ELEMENT_NODE))
79	    api_root = api_doc->children->next;
80    }
81    return(api_root);
82}
83
84static xmlNsPtr
85get_api_ns(void) {
86    get_api_root();
87    if (api_root != NULL)
88        api_ns = api_root->nsDef;
89    return(api_ns);
90}
91
92static xmlAttrPtr
93get_api_attr(void) {
94    static int nr = 0;
95    xmlChar name[20];
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    snprintf((char *) name, 20, "foo%d", nr++);
107    api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
108    return(api_attr);
109}
110
111int main(int argc, char **argv) {
112    int ret;
113    int blocks, mem;
114
115    xmlInitParser();
116#ifdef LIBXML_SCHEMAS_ENABLED
117    xmlRelaxNGInitTypes();
118#endif
119
120    LIBXML_TEST_VERSION
121
122    xmlSetStructuredErrorFunc(NULL, structured_errors);
123
124    if (argc == 2)
125        ret = test_module(argv[1]);
126    else
127	ret = testlibxml2();
128
129    xmlCleanupParser();
130    blocks = xmlMemBlocks();
131    mem = xmlMemUsed();
132    if ((blocks != 0) || (mem != 0)) {
133        printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
134    }
135    xmlMemoryDump();
136
137    return (ret != 0);
138}
139
140#include <libxml/HTMLparser.h>
141#include <libxml/HTMLtree.h>
142#include <libxml/catalog.h>
143#include <libxml/chvalid.h>
144#include <libxml/dict.h>
145#include <libxml/encoding.h>
146#include <libxml/entities.h>
147#include <libxml/hash.h>
148#include <libxml/list.h>
149#include <libxml/nanoftp.h>
150#include <libxml/nanohttp.h>
151#include <libxml/parser.h>
152#include <libxml/pattern.h>
153#include <libxml/relaxng.h>
154#include <libxml/schemasInternals.h>
155#include <libxml/tree.h>
156#include <libxml/uri.h>
157#include <libxml/valid.h>
158#include <libxml/xinclude.h>
159#include <libxml/xmlIO.h>
160#include <libxml/xmlerror.h>
161#include <libxml/xmlreader.h>
162#include <libxml/xmlsave.h>
163#include <libxml/xmlschemas.h>
164#include <libxml/xmlschemastypes.h>
165#include <libxml/xmlstring.h>
166#include <libxml/xmlwriter.h>
167#include <libxml/xpath.h>
168#include <libxml/xpointer.h>
169
170#define gen_nb_void_ptr 2
171
172static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
173    return(NULL);
174}
175static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
176}
177
178#if 0
179#define gen_nb_const_void_ptr 2
180
181static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
182    if (no == 0) return((const void *) "immutable string");
183    return(NULL);
184}
185static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
186}
187#endif
188
189#define gen_nb_userdata 3
190
191static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
192    if (no == 0) return((void *) &call_tests);
193    if (no == 1) return((void *) -1);
194    return(NULL);
195}
196static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
197}
198
199
200#define gen_nb_int 4
201
202static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
203    if (no == 0) return(0);
204    if (no == 1) return(1);
205    if (no == 1) return(-1);
206    if (no == 2) return(122);
207    return(-1);
208}
209
210static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
211}
212
213#if 0
214#define gen_nb_long 4
215
216static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
217    if (no == 0) return(0);
218    if (no == 1) return(1);
219    if (no == 1) return(-1);
220    if (no == 2) return(122);
221    return(-1);
222}
223
224static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
225}
226#endif
227
228#define gen_nb_unsigned_int 3
229
230static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
231    if (no == 0) return(0);
232    if (no == 1) return(1);
233    if (no == 2) return(122);
234    return(-1);
235}
236
237static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
238}
239
240#if 0
241#define gen_nb_unsigned_long 3
242
243static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
244    if (no == 0) return(0);
245    if (no == 1) return(1);
246    if (no == 2) return(122);
247    return(-1);
248}
249
250static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
251}
252
253#define gen_nb_unsigned_long_ptr 2
254
255static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
256    if (no == 0) return(&longtab[nr]);
257    return(NULL);
258}
259
260static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
261}
262#endif
263
264#define gen_nb_int_ptr 2
265
266static int *gen_int_ptr(int no, int nr) {
267    if (no == 0) return(&inttab[nr]);
268    return(NULL);
269}
270
271static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
272}
273
274#define gen_nb_const_char_ptr 4
275
276static const char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
277    if (no == 0) return("foo");
278    if (no == 1) return("<foo/>");
279    if (no == 2) return("test/ent2");
280    return(NULL);
281}
282static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
283}
284
285#define gen_nb_xmlChar_ptr 2
286
287static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
288    if (no == 0) return(&chartab[0]);
289    return(NULL);
290}
291static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
292}
293
294#define gen_nb_FILE_ptr 2
295
296static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
297    if (no == 0) return(fopen("test.out", "a+"));
298    return(NULL);
299}
300static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
301    if (val != NULL) fclose(val);
302}
303
304#define gen_nb_const_xmlChar_ptr 5
305
306static const xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
307    if (no == 0) return((const xmlChar *) "foo");
308    if (no == 1) return((const xmlChar *) "<foo/>");
309    if (no == 2) return((const xmlChar *) "n�ne");
310    if (no == 3) return((const xmlChar *) " 2ab ");
311    return(NULL);
312}
313static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
314}
315
316#define gen_nb_filepath 8
317
318static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
319    if (no == 0) return("missing.xml");
320    if (no == 1) return("<foo/>");
321    if (no == 2) return("test/ent2");
322    if (no == 3) return("test/valid/REC-xml-19980210.xml");
323    if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
324    if (no == 5) return("http://missing.example.org/");
325    if (no == 6) return("http://missing. example.org/");
326    return(NULL);
327}
328static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
329}
330
331#define gen_nb_eaten_name 2
332
333static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
334    if (no == 0) return(xmlStrdup("eaten"));
335    return(NULL);
336}
337static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
338}
339
340#define gen_nb_fileoutput 6
341
342static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
343    if (no == 0) return("/missing.xml");
344    if (no == 1) return("<foo/>");
345    if (no == 2) return("ftp://missing.example.org/foo");
346    if (no == 3) return("http://missing.example.org/");
347    if (no == 4) return("http://missing. example.org/");
348    return(NULL);
349}
350static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
351}
352
353#define gen_nb_xmlParserCtxtPtr 2
354static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
355    if (no == 0) return(xmlNewParserCtxt());
356    return(NULL);
357}
358static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
359    if (val != NULL)
360        xmlFreeParserCtxt(val);
361}
362
363#define gen_nb_xmlSAXHandlerPtr 2
364static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
365    if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
366    return(NULL);
367}
368static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
369}
370
371#define gen_nb_xmlValidCtxtPtr 2
372static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
373    if (no == 0) return(xmlNewValidCtxt());
374    return(NULL);
375}
376static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
377    if (val != NULL)
378        xmlFreeValidCtxt(val);
379}
380
381#define gen_nb_xmlParserInputBufferPtr 8
382
383static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
384    if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
385    if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
386    if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
387    if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
388    if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
389    if (no == 5) return(xmlParserInputBufferCreateFilename("http://missing.example.org/", XML_CHAR_ENCODING_NONE));
390    if (no == 6) return(xmlParserInputBufferCreateFilename("http://missing. example.org/", XML_CHAR_ENCODING_NONE));
391    return(NULL);
392}
393static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
394    xmlFreeParserInputBuffer(val);
395}
396
397#define gen_nb_xmlDocPtr 3
398static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
399    if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
400    if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
401    return(NULL);
402}
403static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
404    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
405        xmlFreeDoc(val);
406}
407
408#define gen_nb_xmlAttrPtr 2
409static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
410    if (no == 0) return(get_api_attr());
411    return(NULL);
412}
413static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
414    if (no == 0) free_api_doc();
415}
416
417#define gen_nb_xmlDictPtr 2
418static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
419    if (no == 0) return(xmlDictCreate());
420    return(NULL);
421}
422static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
423    if (val != NULL)
424        xmlDictFree(val);
425}
426
427#define gen_nb_xmlNodePtr 3
428static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
429    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
430    if (no == 1) return(get_api_root());
431    return(NULL);
432/*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
433}
434static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
435    if (no == 1) free_api_doc();
436    else if (val != NULL) {
437        xmlUnlinkNode(val);
438        xmlFreeNode(val);
439    }
440}
441
442#define gen_nb_xmlDtdPtr 3
443static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
444    if (no == 0) return(xmlNewDtd(NULL, BAD_CAST "dtd", "foo", "bar"));
445    if (no == 1) return(get_api_dtd());
446    return(NULL);
447}
448static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
449    if (no == 1) free_api_doc();
450    else if (val != NULL) {
451        xmlUnlinkNode(val);
452        xmlFreeNode(val);
453    }
454}
455
456#define gen_nb_xmlNsPtr 2
457static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
458    if (no == 0) return(get_api_ns());
459    return(NULL);
460}
461static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
462    if (no == 0) free_api_doc();
463}
464
465#define gen_nb_xmlNodePtr_in 3
466static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
467    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
468    if (no == 0) return(xmlNewText(BAD_CAST "text"));
469    return(NULL);
470}
471static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
472}
473
474#define gen_nb_xmlTextWriterPtr 2
475static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
476    if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
477    return(NULL);
478}
479static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
480    if (val != NULL) xmlFreeTextWriter(val);
481}
482
483#define gen_nb_xmlTextReaderPtr 4
484static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
485    if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
486    if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
487    if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
488    return(NULL);
489}
490static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
491    if (val != NULL) xmlFreeTextReader(val);
492}
493
494#define gen_nb_xmlBufferPtr 3
495static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
496    if (no == 0) return(xmlBufferCreate());
497    if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
498    return(NULL);
499}
500static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
501    if (val != NULL) {
502        xmlBufferFree(val);
503    }
504}
505
506#define gen_nb_xmlListPtr 2
507static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
508    if (no == 0) return(xmlListCreate(NULL, NULL));
509    return(NULL);
510}
511static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
512    if (val != NULL) {
513        xmlListDelete(val);
514    }
515}
516
517#define gen_nb_xmlHashTablePtr 2
518static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
519    if (no == 0) return(xmlHashCreate(10));
520    return(NULL);
521}
522static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
523    if (val != NULL) {
524        xmlHashFree(val, NULL);
525    }
526}
527
528#include <libxml/xpathInternals.h>
529
530#define gen_nb_xmlXPathObjectPtr 5
531static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
532    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
533    if (no == 1) return(xmlXPathNewFloat(1.1));
534    if (no == 2) return(xmlXPathNewBoolean(1));
535    if (no == 3) return(xmlXPathNewNodeSet(NULL));
536    return(NULL);
537}
538static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
539    if (val != NULL) {
540        xmlXPathFreeObject(val);
541    }
542}
543
544#define gen_nb_xmlOutputBufferPtr 2
545static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
546    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
547    return(NULL);
548}
549static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
550    if (val != NULL) {
551        xmlOutputBufferClose(val);
552    }
553}
554
555#define gen_nb_xmlNanoFTPCtxtPtr 4
556static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
557    if (no == 0) return(xmlNanoFTPNewCtxt("ftp://example.com/"));
558    if (no == 1) return(xmlNanoFTPNewCtxt("http://example.com/"));
559    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
560    return(NULL);
561}
562static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
563    if (val != NULL) {
564        xmlNanoFTPFreeCtxt(val);
565    }
566}
567
568#define gen_nb_xmlNanoHTTPCtxtPtr 1
569static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
570    return(NULL);
571}
572static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
573}
574
575#define gen_nb_xmlCharEncoding 4
576static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
577    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
578    if (no == 1) return(XML_CHAR_ENCODING_NONE);
579    if (no == 0) return(XML_CHAR_ENCODING_8859_1);
580    return(XML_CHAR_ENCODING_ERROR);
581}
582static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
583}
584
585
586static void desret_int(int val ATTRIBUTE_UNUSED) {
587}
588static void desret_long(long val ATTRIBUTE_UNUSED) {
589}
590static void desret_double(double val ATTRIBUTE_UNUSED) {
591}
592static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
593}
594#if 0
595static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
596}
597#endif
598static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
599}
600static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
601}
602static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
603}
604static void desret_xmlChar_ptr(xmlChar *val) {
605    if (val != NULL)
606	xmlFree(val);
607}
608static void desret_xmlDocPtr(xmlDocPtr val) {
609    if (val != api_doc)
610	xmlFreeDoc(val);
611}
612static void desret_xmlDictPtr(xmlDictPtr val) {
613    xmlDictFree(val);
614}
615static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
616    xmlFreeTextReader(val);
617}
618static void desret_xmlNodePtr(xmlNodePtr val) {
619    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
620	xmlUnlinkNode(val);
621	xmlFreeNode(val);
622    }
623}
624static void desret_xmlDtdPtr(xmlDtdPtr val) {
625    desret_xmlNodePtr((xmlNodePtr)val);
626}
627static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
628    xmlXPathFreeObject(val);
629}
630static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
631    xmlFreeParserCtxt(val);
632}
633
634/* CUT HERE: everything below that line is generated */
635#include <libxml/HTMLparser.h>
636#include <libxml/HTMLtree.h>
637#include <libxml/catalog.h>
638#include <libxml/chvalid.h>
639#include <libxml/dict.h>
640#include <libxml/encoding.h>
641#include <libxml/entities.h>
642#include <libxml/hash.h>
643#include <libxml/list.h>
644#include <libxml/nanoftp.h>
645#include <libxml/nanohttp.h>
646#include <libxml/parser.h>
647#include <libxml/pattern.h>
648#include <libxml/relaxng.h>
649#include <libxml/schemasInternals.h>
650#include <libxml/tree.h>
651#include <libxml/uri.h>
652#include <libxml/valid.h>
653#include <libxml/xinclude.h>
654#include <libxml/xmlIO.h>
655#include <libxml/xmlerror.h>
656#include <libxml/xmlreader.h>
657#include <libxml/xmlsave.h>
658#include <libxml/xmlschemas.h>
659#include <libxml/xmlschemastypes.h>
660#include <libxml/xmlstring.h>
661#include <libxml/xmlwriter.h>
662#include <libxml/xpath.h>
663#include <libxml/xpointer.h>
664static int test_HTMLparser(void);
665static int test_HTMLtree(void);
666static int test_catalog(void);
667static int test_chvalid(void);
668static int test_dict(void);
669static int test_encoding(void);
670static int test_entities(void);
671static int test_hash(void);
672static int test_list(void);
673static int test_nanoftp(void);
674static int test_nanohttp(void);
675static int test_parser(void);
676static int test_pattern(void);
677static int test_relaxng(void);
678static int test_schemasInternals(void);
679static int test_tree(void);
680static int test_uri(void);
681static int test_valid(void);
682static int test_xinclude(void);
683static int test_xmlIO(void);
684static int test_xmlerror(void);
685static int test_xmlreader(void);
686static int test_xmlsave(void);
687static int test_xmlschemas(void);
688static int test_xmlschemastypes(void);
689static int test_xmlstring(void);
690static int test_xmlwriter(void);
691static int test_xpath(void);
692static int test_xpointer(void);
693
694/**
695 * testlibxml2:
696 *
697 * Main entry point of the tester for the full libxml2 module,
698 * it calls all the tester entry point for each module.
699 *
700 * Returns the number of error found
701 */
702static int
703testlibxml2(void)
704{
705    int ret = 0;
706
707    ret += test_HTMLparser();
708    ret += test_HTMLtree();
709    ret += test_catalog();
710    ret += test_chvalid();
711    ret += test_dict();
712    ret += test_encoding();
713    ret += test_entities();
714    ret += test_hash();
715    ret += test_list();
716    ret += test_nanoftp();
717    ret += test_nanohttp();
718    ret += test_parser();
719    ret += test_pattern();
720    ret += test_relaxng();
721    ret += test_schemasInternals();
722    ret += test_tree();
723    ret += test_uri();
724    ret += test_valid();
725    ret += test_xinclude();
726    ret += test_xmlIO();
727    ret += test_xmlerror();
728    ret += test_xmlreader();
729    ret += test_xmlsave();
730    ret += test_xmlschemas();
731    ret += test_xmlschemastypes();
732    ret += test_xmlstring();
733    ret += test_xmlwriter();
734    ret += test_xpath();
735    ret += test_xpointer();
736
737    printf("Total: %d functions, %d tests, %d errors\n",
738           function_tests, call_tests, ret);
739    return(ret);
740}
741
742
743static int
744test_UTF8ToHtml(void) {
745    int ret = 0;
746
747
748    /* missing type support */
749    return(ret);
750}
751
752
753static int
754test_htmlAttrAllowed(void) {
755    int ret = 0;
756
757
758    /* missing type support */
759    return(ret);
760}
761
762
763static int
764test_htmlAutoCloseTag(void) {
765    int ret = 0;
766
767#ifdef LIBXML_HTML_ENABLED
768    int mem_base;
769    int ret_val;
770    htmlDocPtr doc; /* the HTML document */
771    int n_doc;
772    const xmlChar * name; /* The tag name */
773    int n_name;
774    htmlNodePtr elem; /* the HTML element */
775    int n_elem;
776
777    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
778    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
779    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
780        mem_base = xmlMemBlocks();
781        doc = gen_xmlDocPtr(n_doc, 0);
782        name = gen_const_xmlChar_ptr(n_name, 1);
783        elem = gen_xmlNodePtr(n_elem, 2);
784
785        ret_val = htmlAutoCloseTag(doc, name, elem);
786        desret_int(ret_val);
787        call_tests++;
788        des_xmlDocPtr(n_doc, doc, 0);
789        des_const_xmlChar_ptr(n_name, name, 1);
790        des_xmlNodePtr(n_elem, elem, 2);
791        xmlResetLastError();
792        if (mem_base != xmlMemBlocks()) {
793            printf("Leak of %d blocks found in htmlAutoCloseTag",
794	           xmlMemBlocks() - mem_base);
795	    ret++;
796            printf(" %d", n_doc);
797            printf(" %d", n_name);
798            printf(" %d", n_elem);
799            printf("\n");
800        }
801    }
802    }
803    }
804#endif
805
806    function_tests++;
807    return(ret);
808}
809
810
811static int
812test_htmlCreateMemoryParserCtxt(void) {
813    int ret = 0;
814
815#ifdef LIBXML_HTML_ENABLED
816    int mem_base;
817    htmlParserCtxtPtr ret_val;
818    const char * buffer; /* a pointer to a char array */
819    int n_buffer;
820    int size; /* the size of the array */
821    int n_size;
822
823    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
824    for (n_size = 0;n_size < gen_nb_int;n_size++) {
825        mem_base = xmlMemBlocks();
826        buffer = gen_const_char_ptr(n_buffer, 0);
827        size = gen_int(n_size, 1);
828
829        ret_val = htmlCreateMemoryParserCtxt(buffer, size);
830        desret_xmlParserCtxtPtr(ret_val);
831        call_tests++;
832        des_const_char_ptr(n_buffer, buffer, 0);
833        des_int(n_size, size, 1);
834        xmlResetLastError();
835        if (mem_base != xmlMemBlocks()) {
836            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
837	           xmlMemBlocks() - mem_base);
838	    ret++;
839            printf(" %d", n_buffer);
840            printf(" %d", n_size);
841            printf("\n");
842        }
843    }
844    }
845#endif
846
847    function_tests++;
848    return(ret);
849}
850
851
852static int
853test_htmlCreatePushParserCtxt(void) {
854    int ret = 0;
855
856
857    /* missing type support */
858    return(ret);
859}
860
861
862static int
863test_htmlCtxtReadDoc(void) {
864    int ret = 0;
865
866#ifdef LIBXML_HTML_ENABLED
867    int mem_base;
868    htmlDocPtr ret_val;
869    htmlParserCtxtPtr ctxt; /* an HTML parser context */
870    int n_ctxt;
871    const xmlChar * cur; /* a pointer to a zero terminated string */
872    int n_cur;
873    const char * URL; /* the base URL to use for the document */
874    int n_URL;
875    const char * encoding; /* the document encoding, or NULL */
876    int n_encoding;
877    int options; /* a combination of htmlParserOption(s) */
878    int n_options;
879
880    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
881    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
882    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
883    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
884    for (n_options = 0;n_options < gen_nb_int;n_options++) {
885        mem_base = xmlMemBlocks();
886        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
887        cur = gen_const_xmlChar_ptr(n_cur, 1);
888        URL = gen_filepath(n_URL, 2);
889        encoding = gen_const_char_ptr(n_encoding, 3);
890        options = gen_int(n_options, 4);
891
892        ret_val = htmlCtxtReadDoc(ctxt, cur, URL, encoding, options);
893        desret_xmlDocPtr(ret_val);
894        call_tests++;
895        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
896        des_const_xmlChar_ptr(n_cur, cur, 1);
897        des_filepath(n_URL, URL, 2);
898        des_const_char_ptr(n_encoding, encoding, 3);
899        des_int(n_options, options, 4);
900        xmlResetLastError();
901        if (mem_base != xmlMemBlocks()) {
902            printf("Leak of %d blocks found in htmlCtxtReadDoc",
903	           xmlMemBlocks() - mem_base);
904	    ret++;
905            printf(" %d", n_ctxt);
906            printf(" %d", n_cur);
907            printf(" %d", n_URL);
908            printf(" %d", n_encoding);
909            printf(" %d", n_options);
910            printf("\n");
911        }
912    }
913    }
914    }
915    }
916    }
917#endif
918
919    function_tests++;
920    return(ret);
921}
922
923
924static int
925test_htmlCtxtReadFile(void) {
926    int ret = 0;
927
928#ifdef LIBXML_HTML_ENABLED
929    int mem_base;
930    htmlDocPtr ret_val;
931    htmlParserCtxtPtr ctxt; /* an HTML parser context */
932    int n_ctxt;
933    const char * filename; /* a file or URL */
934    int n_filename;
935    const char * encoding; /* the document encoding, or NULL */
936    int n_encoding;
937    int options; /* a combination of htmlParserOption(s) */
938    int n_options;
939
940    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
941    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
942    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
943    for (n_options = 0;n_options < gen_nb_int;n_options++) {
944        mem_base = xmlMemBlocks();
945        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
946        filename = gen_filepath(n_filename, 1);
947        encoding = gen_const_char_ptr(n_encoding, 2);
948        options = gen_int(n_options, 3);
949
950        ret_val = htmlCtxtReadFile(ctxt, filename, encoding, options);
951        desret_xmlDocPtr(ret_val);
952        call_tests++;
953        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
954        des_filepath(n_filename, filename, 1);
955        des_const_char_ptr(n_encoding, encoding, 2);
956        des_int(n_options, options, 3);
957        xmlResetLastError();
958        if (mem_base != xmlMemBlocks()) {
959            printf("Leak of %d blocks found in htmlCtxtReadFile",
960	           xmlMemBlocks() - mem_base);
961	    ret++;
962            printf(" %d", n_ctxt);
963            printf(" %d", n_filename);
964            printf(" %d", n_encoding);
965            printf(" %d", n_options);
966            printf("\n");
967        }
968    }
969    }
970    }
971    }
972#endif
973
974    function_tests++;
975    return(ret);
976}
977
978
979static int
980test_htmlCtxtReadMemory(void) {
981    int ret = 0;
982
983#ifdef LIBXML_HTML_ENABLED
984    int mem_base;
985    htmlDocPtr ret_val;
986    htmlParserCtxtPtr ctxt; /* an HTML parser context */
987    int n_ctxt;
988    const char * buffer; /* a pointer to a char array */
989    int n_buffer;
990    int size; /* the size of the array */
991    int n_size;
992    const char * URL; /* the base URL to use for the document */
993    int n_URL;
994    const char * encoding; /* the document encoding, or NULL */
995    int n_encoding;
996    int options; /* a combination of htmlParserOption(s) */
997    int n_options;
998
999    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1000    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1001    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1002    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1003    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1004    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1005        mem_base = xmlMemBlocks();
1006        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1007        buffer = gen_const_char_ptr(n_buffer, 1);
1008        size = gen_int(n_size, 2);
1009        URL = gen_filepath(n_URL, 3);
1010        encoding = gen_const_char_ptr(n_encoding, 4);
1011        options = gen_int(n_options, 5);
1012
1013        ret_val = htmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options);
1014        desret_xmlDocPtr(ret_val);
1015        call_tests++;
1016        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1017        des_const_char_ptr(n_buffer, buffer, 1);
1018        des_int(n_size, size, 2);
1019        des_filepath(n_URL, URL, 3);
1020        des_const_char_ptr(n_encoding, encoding, 4);
1021        des_int(n_options, options, 5);
1022        xmlResetLastError();
1023        if (mem_base != xmlMemBlocks()) {
1024            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1025	           xmlMemBlocks() - mem_base);
1026	    ret++;
1027            printf(" %d", n_ctxt);
1028            printf(" %d", n_buffer);
1029            printf(" %d", n_size);
1030            printf(" %d", n_URL);
1031            printf(" %d", n_encoding);
1032            printf(" %d", n_options);
1033            printf("\n");
1034        }
1035    }
1036    }
1037    }
1038    }
1039    }
1040    }
1041#endif
1042
1043    function_tests++;
1044    return(ret);
1045}
1046
1047
1048static int
1049test_htmlCtxtReset(void) {
1050    int ret = 0;
1051
1052#ifdef LIBXML_HTML_ENABLED
1053    int mem_base;
1054    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1055    int n_ctxt;
1056
1057    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1058        mem_base = xmlMemBlocks();
1059        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1060
1061        htmlCtxtReset(ctxt);
1062        call_tests++;
1063        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1064        xmlResetLastError();
1065        if (mem_base != xmlMemBlocks()) {
1066            printf("Leak of %d blocks found in htmlCtxtReset",
1067	           xmlMemBlocks() - mem_base);
1068	    ret++;
1069            printf(" %d", n_ctxt);
1070            printf("\n");
1071        }
1072    }
1073#endif
1074
1075    function_tests++;
1076    return(ret);
1077}
1078
1079
1080static int
1081test_htmlCtxtUseOptions(void) {
1082    int ret = 0;
1083
1084#ifdef LIBXML_HTML_ENABLED
1085    int mem_base;
1086    int ret_val;
1087    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1088    int n_ctxt;
1089    int options; /* a combination of htmlParserOption(s) */
1090    int n_options;
1091
1092    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1093    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1094        mem_base = xmlMemBlocks();
1095        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1096        options = gen_int(n_options, 1);
1097
1098        ret_val = htmlCtxtUseOptions(ctxt, options);
1099        desret_int(ret_val);
1100        call_tests++;
1101        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1102        des_int(n_options, options, 1);
1103        xmlResetLastError();
1104        if (mem_base != xmlMemBlocks()) {
1105            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1106	           xmlMemBlocks() - mem_base);
1107	    ret++;
1108            printf(" %d", n_ctxt);
1109            printf(" %d", n_options);
1110            printf("\n");
1111        }
1112    }
1113    }
1114#endif
1115
1116    function_tests++;
1117    return(ret);
1118}
1119
1120
1121static int
1122test_htmlElementAllowedHere(void) {
1123    int ret = 0;
1124
1125
1126    /* missing type support */
1127    return(ret);
1128}
1129
1130
1131static int
1132test_htmlElementStatusHere(void) {
1133    int ret = 0;
1134
1135
1136    /* missing type support */
1137    return(ret);
1138}
1139
1140
1141static int
1142test_htmlEncodeEntities(void) {
1143    int ret = 0;
1144
1145
1146    /* missing type support */
1147    return(ret);
1148}
1149
1150
1151static int
1152test_htmlEntityLookup(void) {
1153    int ret = 0;
1154
1155
1156    /* missing type support */
1157    return(ret);
1158}
1159
1160
1161static int
1162test_htmlEntityValueLookup(void) {
1163    int ret = 0;
1164
1165
1166    /* missing type support */
1167    return(ret);
1168}
1169
1170
1171static int
1172test_htmlHandleOmittedElem(void) {
1173    int ret = 0;
1174
1175#ifdef LIBXML_HTML_ENABLED
1176    int mem_base;
1177    int ret_val;
1178    int val; /* int 0 or 1 */
1179    int n_val;
1180
1181    for (n_val = 0;n_val < gen_nb_int;n_val++) {
1182        mem_base = xmlMemBlocks();
1183        val = gen_int(n_val, 0);
1184
1185        ret_val = htmlHandleOmittedElem(val);
1186        desret_int(ret_val);
1187        call_tests++;
1188        des_int(n_val, val, 0);
1189        xmlResetLastError();
1190        if (mem_base != xmlMemBlocks()) {
1191            printf("Leak of %d blocks found in htmlHandleOmittedElem",
1192	           xmlMemBlocks() - mem_base);
1193	    ret++;
1194            printf(" %d", n_val);
1195            printf("\n");
1196        }
1197    }
1198#endif
1199
1200    function_tests++;
1201    return(ret);
1202}
1203
1204
1205static int
1206test_htmlIsAutoClosed(void) {
1207    int ret = 0;
1208
1209#ifdef LIBXML_HTML_ENABLED
1210    int mem_base;
1211    int ret_val;
1212    htmlDocPtr doc; /* the HTML document */
1213    int n_doc;
1214    htmlNodePtr elem; /* the HTML element */
1215    int n_elem;
1216
1217    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
1218    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
1219        mem_base = xmlMemBlocks();
1220        doc = gen_xmlDocPtr(n_doc, 0);
1221        elem = gen_xmlNodePtr(n_elem, 1);
1222
1223        ret_val = htmlIsAutoClosed(doc, elem);
1224        desret_int(ret_val);
1225        call_tests++;
1226        des_xmlDocPtr(n_doc, doc, 0);
1227        des_xmlNodePtr(n_elem, elem, 1);
1228        xmlResetLastError();
1229        if (mem_base != xmlMemBlocks()) {
1230            printf("Leak of %d blocks found in htmlIsAutoClosed",
1231	           xmlMemBlocks() - mem_base);
1232	    ret++;
1233            printf(" %d", n_doc);
1234            printf(" %d", n_elem);
1235            printf("\n");
1236        }
1237    }
1238    }
1239#endif
1240
1241    function_tests++;
1242    return(ret);
1243}
1244
1245
1246static int
1247test_htmlIsScriptAttribute(void) {
1248    int ret = 0;
1249
1250#ifdef LIBXML_HTML_ENABLED
1251    int mem_base;
1252    int ret_val;
1253    const xmlChar * name; /* an attribute name */
1254    int n_name;
1255
1256    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1257        mem_base = xmlMemBlocks();
1258        name = gen_const_xmlChar_ptr(n_name, 0);
1259
1260        ret_val = htmlIsScriptAttribute(name);
1261        desret_int(ret_val);
1262        call_tests++;
1263        des_const_xmlChar_ptr(n_name, name, 0);
1264        xmlResetLastError();
1265        if (mem_base != xmlMemBlocks()) {
1266            printf("Leak of %d blocks found in htmlIsScriptAttribute",
1267	           xmlMemBlocks() - mem_base);
1268	    ret++;
1269            printf(" %d", n_name);
1270            printf("\n");
1271        }
1272    }
1273#endif
1274
1275    function_tests++;
1276    return(ret);
1277}
1278
1279
1280static int
1281test_htmlNodeStatus(void) {
1282    int ret = 0;
1283
1284
1285    /* missing type support */
1286    return(ret);
1287}
1288
1289
1290static int
1291test_htmlParseCharRef(void) {
1292    int ret = 0;
1293
1294#ifdef LIBXML_HTML_ENABLED
1295    int mem_base;
1296    int ret_val;
1297    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1298    int n_ctxt;
1299
1300    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1301        mem_base = xmlMemBlocks();
1302        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1303
1304        ret_val = htmlParseCharRef(ctxt);
1305        desret_int(ret_val);
1306        call_tests++;
1307        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1308        xmlResetLastError();
1309        if (mem_base != xmlMemBlocks()) {
1310            printf("Leak of %d blocks found in htmlParseCharRef",
1311	           xmlMemBlocks() - mem_base);
1312	    ret++;
1313            printf(" %d", n_ctxt);
1314            printf("\n");
1315        }
1316    }
1317#endif
1318
1319    function_tests++;
1320    return(ret);
1321}
1322
1323
1324static int
1325test_htmlParseChunk(void) {
1326    int ret = 0;
1327
1328#ifdef LIBXML_HTML_ENABLED
1329#ifdef LIBXML_PUSH_ENABLED
1330    int mem_base;
1331    int ret_val;
1332    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1333    int n_ctxt;
1334    const char * chunk; /* an char array */
1335    int n_chunk;
1336    int size; /* the size in byte of the chunk */
1337    int n_size;
1338    int terminate; /* last chunk indicator */
1339    int n_terminate;
1340
1341    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1342    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1343    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1344    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
1345        mem_base = xmlMemBlocks();
1346        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1347        chunk = gen_const_char_ptr(n_chunk, 1);
1348        size = gen_int(n_size, 2);
1349        terminate = gen_int(n_terminate, 3);
1350
1351        ret_val = htmlParseChunk(ctxt, chunk, size, terminate);
1352        desret_int(ret_val);
1353        call_tests++;
1354        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1355        des_const_char_ptr(n_chunk, chunk, 1);
1356        des_int(n_size, size, 2);
1357        des_int(n_terminate, terminate, 3);
1358        xmlResetLastError();
1359        if (mem_base != xmlMemBlocks()) {
1360            printf("Leak of %d blocks found in htmlParseChunk",
1361	           xmlMemBlocks() - mem_base);
1362	    ret++;
1363            printf(" %d", n_ctxt);
1364            printf(" %d", n_chunk);
1365            printf(" %d", n_size);
1366            printf(" %d", n_terminate);
1367            printf("\n");
1368        }
1369    }
1370    }
1371    }
1372    }
1373#endif
1374#endif
1375
1376    function_tests++;
1377    return(ret);
1378}
1379
1380
1381static int
1382test_htmlParseDoc(void) {
1383    int ret = 0;
1384
1385#ifdef LIBXML_HTML_ENABLED
1386    int mem_base;
1387    htmlDocPtr ret_val;
1388    xmlChar * cur; /* a pointer to an array of xmlChar */
1389    int n_cur;
1390    const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
1391    int n_encoding;
1392
1393    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
1394    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1395        mem_base = xmlMemBlocks();
1396        cur = gen_xmlChar_ptr(n_cur, 0);
1397        encoding = gen_const_char_ptr(n_encoding, 1);
1398
1399        ret_val = htmlParseDoc(cur, encoding);
1400        desret_xmlDocPtr(ret_val);
1401        call_tests++;
1402        des_xmlChar_ptr(n_cur, cur, 0);
1403        des_const_char_ptr(n_encoding, encoding, 1);
1404        xmlResetLastError();
1405        if (mem_base != xmlMemBlocks()) {
1406            printf("Leak of %d blocks found in htmlParseDoc",
1407	           xmlMemBlocks() - mem_base);
1408	    ret++;
1409            printf(" %d", n_cur);
1410            printf(" %d", n_encoding);
1411            printf("\n");
1412        }
1413    }
1414    }
1415#endif
1416
1417    function_tests++;
1418    return(ret);
1419}
1420
1421
1422static int
1423test_htmlParseDocument(void) {
1424    int ret = 0;
1425
1426#ifdef LIBXML_HTML_ENABLED
1427    int mem_base;
1428    int ret_val;
1429    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1430    int n_ctxt;
1431
1432    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1433        mem_base = xmlMemBlocks();
1434        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1435
1436        ret_val = htmlParseDocument(ctxt);
1437        desret_int(ret_val);
1438        call_tests++;
1439        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1440        xmlResetLastError();
1441        if (mem_base != xmlMemBlocks()) {
1442            printf("Leak of %d blocks found in htmlParseDocument",
1443	           xmlMemBlocks() - mem_base);
1444	    ret++;
1445            printf(" %d", n_ctxt);
1446            printf("\n");
1447        }
1448    }
1449#endif
1450
1451    function_tests++;
1452    return(ret);
1453}
1454
1455
1456static int
1457test_htmlParseElement(void) {
1458    int ret = 0;
1459
1460#ifdef LIBXML_HTML_ENABLED
1461    int mem_base;
1462    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1463    int n_ctxt;
1464
1465    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
1466        mem_base = xmlMemBlocks();
1467        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
1468
1469        htmlParseElement(ctxt);
1470        call_tests++;
1471        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
1472        xmlResetLastError();
1473        if (mem_base != xmlMemBlocks()) {
1474            printf("Leak of %d blocks found in htmlParseElement",
1475	           xmlMemBlocks() - mem_base);
1476	    ret++;
1477            printf(" %d", n_ctxt);
1478            printf("\n");
1479        }
1480    }
1481#endif
1482
1483    function_tests++;
1484    return(ret);
1485}
1486
1487
1488static int
1489test_htmlParseEntityRef(void) {
1490    int ret = 0;
1491
1492
1493    /* missing type support */
1494    return(ret);
1495}
1496
1497
1498static int
1499test_htmlParseFile(void) {
1500    int ret = 0;
1501
1502#ifdef LIBXML_HTML_ENABLED
1503    htmlDocPtr ret_val;
1504    const char * filename; /* the filename */
1505    int n_filename;
1506    const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
1507    int n_encoding;
1508
1509    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1510    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1511        filename = gen_filepath(n_filename, 0);
1512        encoding = gen_const_char_ptr(n_encoding, 1);
1513
1514        ret_val = htmlParseFile(filename, encoding);
1515        desret_xmlDocPtr(ret_val);
1516        call_tests++;
1517        des_filepath(n_filename, filename, 0);
1518        des_const_char_ptr(n_encoding, encoding, 1);
1519        xmlResetLastError();
1520    }
1521    }
1522#endif
1523
1524    function_tests++;
1525    return(ret);
1526}
1527
1528
1529static int
1530test_htmlReadDoc(void) {
1531    int ret = 0;
1532
1533#ifdef LIBXML_HTML_ENABLED
1534    int mem_base;
1535    htmlDocPtr ret_val;
1536    const xmlChar * cur; /* a pointer to a zero terminated string */
1537    int n_cur;
1538    const char * URL; /* the base URL to use for the document */
1539    int n_URL;
1540    const char * encoding; /* the document encoding, or NULL */
1541    int n_encoding;
1542    int options; /* a combination of htmlParserOption(s) */
1543    int n_options;
1544
1545    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1546    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1547    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1548    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1549        mem_base = xmlMemBlocks();
1550        cur = gen_const_xmlChar_ptr(n_cur, 0);
1551        URL = gen_filepath(n_URL, 1);
1552        encoding = gen_const_char_ptr(n_encoding, 2);
1553        options = gen_int(n_options, 3);
1554
1555        ret_val = htmlReadDoc(cur, URL, encoding, options);
1556        desret_xmlDocPtr(ret_val);
1557        call_tests++;
1558        des_const_xmlChar_ptr(n_cur, cur, 0);
1559        des_filepath(n_URL, URL, 1);
1560        des_const_char_ptr(n_encoding, encoding, 2);
1561        des_int(n_options, options, 3);
1562        xmlResetLastError();
1563        if (mem_base != xmlMemBlocks()) {
1564            printf("Leak of %d blocks found in htmlReadDoc",
1565	           xmlMemBlocks() - mem_base);
1566	    ret++;
1567            printf(" %d", n_cur);
1568            printf(" %d", n_URL);
1569            printf(" %d", n_encoding);
1570            printf(" %d", n_options);
1571            printf("\n");
1572        }
1573    }
1574    }
1575    }
1576    }
1577#endif
1578
1579    function_tests++;
1580    return(ret);
1581}
1582
1583
1584static int
1585test_htmlReadFile(void) {
1586    int ret = 0;
1587
1588#ifdef LIBXML_HTML_ENABLED
1589    int mem_base;
1590    htmlDocPtr ret_val;
1591    const char * filename; /* a file or URL */
1592    int n_filename;
1593    const char * encoding; /* the document encoding, or NULL */
1594    int n_encoding;
1595    int options; /* a combination of htmlParserOption(s) */
1596    int n_options;
1597
1598    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1599    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1600    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1601        mem_base = xmlMemBlocks();
1602        filename = gen_filepath(n_filename, 0);
1603        encoding = gen_const_char_ptr(n_encoding, 1);
1604        options = gen_int(n_options, 2);
1605
1606        ret_val = htmlReadFile(filename, encoding, options);
1607        desret_xmlDocPtr(ret_val);
1608        call_tests++;
1609        des_filepath(n_filename, filename, 0);
1610        des_const_char_ptr(n_encoding, encoding, 1);
1611        des_int(n_options, options, 2);
1612        xmlResetLastError();
1613        if (mem_base != xmlMemBlocks()) {
1614            printf("Leak of %d blocks found in htmlReadFile",
1615	           xmlMemBlocks() - mem_base);
1616	    ret++;
1617            printf(" %d", n_filename);
1618            printf(" %d", n_encoding);
1619            printf(" %d", n_options);
1620            printf("\n");
1621        }
1622    }
1623    }
1624    }
1625#endif
1626
1627    function_tests++;
1628    return(ret);
1629}
1630
1631
1632static int
1633test_htmlReadMemory(void) {
1634    int ret = 0;
1635
1636#ifdef LIBXML_HTML_ENABLED
1637    int mem_base;
1638    htmlDocPtr ret_val;
1639    const char * buffer; /* a pointer to a char array */
1640    int n_buffer;
1641    int size; /* the size of the array */
1642    int n_size;
1643    const char * URL; /* the base URL to use for the document */
1644    int n_URL;
1645    const char * encoding; /* the document encoding, or NULL */
1646    int n_encoding;
1647    int options; /* a combination of htmlParserOption(s) */
1648    int n_options;
1649
1650    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1651    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1652    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1653    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1654    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1655        mem_base = xmlMemBlocks();
1656        buffer = gen_const_char_ptr(n_buffer, 0);
1657        size = gen_int(n_size, 1);
1658        URL = gen_filepath(n_URL, 2);
1659        encoding = gen_const_char_ptr(n_encoding, 3);
1660        options = gen_int(n_options, 4);
1661
1662        ret_val = htmlReadMemory(buffer, size, URL, encoding, options);
1663        desret_xmlDocPtr(ret_val);
1664        call_tests++;
1665        des_const_char_ptr(n_buffer, buffer, 0);
1666        des_int(n_size, size, 1);
1667        des_filepath(n_URL, URL, 2);
1668        des_const_char_ptr(n_encoding, encoding, 3);
1669        des_int(n_options, options, 4);
1670        xmlResetLastError();
1671        if (mem_base != xmlMemBlocks()) {
1672            printf("Leak of %d blocks found in htmlReadMemory",
1673	           xmlMemBlocks() - mem_base);
1674	    ret++;
1675            printf(" %d", n_buffer);
1676            printf(" %d", n_size);
1677            printf(" %d", n_URL);
1678            printf(" %d", n_encoding);
1679            printf(" %d", n_options);
1680            printf("\n");
1681        }
1682    }
1683    }
1684    }
1685    }
1686    }
1687#endif
1688
1689    function_tests++;
1690    return(ret);
1691}
1692
1693
1694static int
1695test_htmlSAXParseDoc(void) {
1696    int ret = 0;
1697
1698
1699    /* missing type support */
1700    return(ret);
1701}
1702
1703
1704static int
1705test_htmlSAXParseFile(void) {
1706    int ret = 0;
1707
1708
1709    /* missing type support */
1710    return(ret);
1711}
1712
1713
1714static int
1715test_htmlTagLookup(void) {
1716    int ret = 0;
1717
1718
1719    /* missing type support */
1720    return(ret);
1721}
1722
1723static int
1724test_HTMLparser(void) {
1725    int ret = 0;
1726
1727    printf("Testing HTMLparser : 19 of 37 functions ...\n");
1728    ret += test_UTF8ToHtml();
1729    ret += test_htmlAttrAllowed();
1730    ret += test_htmlAutoCloseTag();
1731    ret += test_htmlCreateMemoryParserCtxt();
1732    ret += test_htmlCreatePushParserCtxt();
1733    ret += test_htmlCtxtReadDoc();
1734    ret += test_htmlCtxtReadFile();
1735    ret += test_htmlCtxtReadMemory();
1736    ret += test_htmlCtxtReset();
1737    ret += test_htmlCtxtUseOptions();
1738    ret += test_htmlElementAllowedHere();
1739    ret += test_htmlElementStatusHere();
1740    ret += test_htmlEncodeEntities();
1741    ret += test_htmlEntityLookup();
1742    ret += test_htmlEntityValueLookup();
1743    ret += test_htmlHandleOmittedElem();
1744    ret += test_htmlIsAutoClosed();
1745    ret += test_htmlIsScriptAttribute();
1746    ret += test_htmlNodeStatus();
1747    ret += test_htmlParseCharRef();
1748    ret += test_htmlParseChunk();
1749    ret += test_htmlParseDoc();
1750    ret += test_htmlParseDocument();
1751    ret += test_htmlParseElement();
1752    ret += test_htmlParseEntityRef();
1753    ret += test_htmlParseFile();
1754    ret += test_htmlReadDoc();
1755    ret += test_htmlReadFile();
1756    ret += test_htmlReadMemory();
1757    ret += test_htmlSAXParseDoc();
1758    ret += test_htmlSAXParseFile();
1759    ret += test_htmlTagLookup();
1760
1761    if (ret != 0)
1762	printf("Module HTMLparser: %d errors\n", ret);
1763    return(ret);
1764}
1765
1766static int
1767test_htmlDocContentDumpFormatOutput(void) {
1768    int ret = 0;
1769
1770#ifdef LIBXML_HTML_ENABLED
1771#ifdef LIBXML_OUTPUT_ENABLED
1772    int mem_base;
1773    xmlOutputBufferPtr buf; /* the HTML buffer output */
1774    int n_buf;
1775    xmlDocPtr cur; /* the document */
1776    int n_cur;
1777    const char * encoding; /* the encoding string */
1778    int n_encoding;
1779    int format; /* should formatting spaces been added */
1780    int n_format;
1781
1782    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
1783    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
1784    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1785    for (n_format = 0;n_format < gen_nb_int;n_format++) {
1786        mem_base = xmlMemBlocks();
1787        buf = gen_xmlOutputBufferPtr(n_buf, 0);
1788        cur = gen_xmlDocPtr(n_cur, 1);
1789        encoding = gen_const_char_ptr(n_encoding, 2);
1790        format = gen_int(n_format, 3);
1791
1792        htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
1793        call_tests++;
1794        des_xmlOutputBufferPtr(n_buf, buf, 0);
1795        des_xmlDocPtr(n_cur, cur, 1);
1796        des_const_char_ptr(n_encoding, encoding, 2);
1797        des_int(n_format, format, 3);
1798        xmlResetLastError();
1799        if (mem_base != xmlMemBlocks()) {
1800            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
1801	           xmlMemBlocks() - mem_base);
1802	    ret++;
1803            printf(" %d", n_buf);
1804            printf(" %d", n_cur);
1805            printf(" %d", n_encoding);
1806            printf(" %d", n_format);
1807            printf("\n");
1808        }
1809    }
1810    }
1811    }
1812    }
1813#endif
1814#endif
1815
1816    function_tests++;
1817    return(ret);
1818}
1819
1820
1821static int
1822test_htmlDocContentDumpOutput(void) {
1823    int ret = 0;
1824
1825#ifdef LIBXML_HTML_ENABLED
1826#ifdef LIBXML_OUTPUT_ENABLED
1827    int mem_base;
1828    xmlOutputBufferPtr buf; /* the HTML buffer output */
1829    int n_buf;
1830    xmlDocPtr cur; /* the document */
1831    int n_cur;
1832    const char * encoding; /* the encoding string */
1833    int n_encoding;
1834
1835    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
1836    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
1837    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1838        mem_base = xmlMemBlocks();
1839        buf = gen_xmlOutputBufferPtr(n_buf, 0);
1840        cur = gen_xmlDocPtr(n_cur, 1);
1841        encoding = gen_const_char_ptr(n_encoding, 2);
1842
1843        htmlDocContentDumpOutput(buf, cur, encoding);
1844        call_tests++;
1845        des_xmlOutputBufferPtr(n_buf, buf, 0);
1846        des_xmlDocPtr(n_cur, cur, 1);
1847        des_const_char_ptr(n_encoding, encoding, 2);
1848        xmlResetLastError();
1849        if (mem_base != xmlMemBlocks()) {
1850            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
1851	           xmlMemBlocks() - mem_base);
1852	    ret++;
1853            printf(" %d", n_buf);
1854            printf(" %d", n_cur);
1855            printf(" %d", n_encoding);
1856            printf("\n");
1857        }
1858    }
1859    }
1860    }
1861#endif
1862#endif
1863
1864    function_tests++;
1865    return(ret);
1866}
1867
1868
1869static int
1870test_htmlDocDump(void) {
1871    int ret = 0;
1872
1873#ifdef LIBXML_HTML_ENABLED
1874#ifdef LIBXML_OUTPUT_ENABLED
1875    int mem_base;
1876    int ret_val;
1877    FILE * f; /* the FILE* */
1878    int n_f;
1879    xmlDocPtr cur; /* the document */
1880    int n_cur;
1881
1882    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
1883    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
1884        mem_base = xmlMemBlocks();
1885        f = gen_FILE_ptr(n_f, 0);
1886        cur = gen_xmlDocPtr(n_cur, 1);
1887
1888        ret_val = htmlDocDump(f, cur);
1889        desret_int(ret_val);
1890        call_tests++;
1891        des_FILE_ptr(n_f, f, 0);
1892        des_xmlDocPtr(n_cur, cur, 1);
1893        xmlResetLastError();
1894        if (mem_base != xmlMemBlocks()) {
1895            printf("Leak of %d blocks found in htmlDocDump",
1896	           xmlMemBlocks() - mem_base);
1897	    ret++;
1898            printf(" %d", n_f);
1899            printf(" %d", n_cur);
1900            printf("\n");
1901        }
1902    }
1903    }
1904#endif
1905#endif
1906
1907    function_tests++;
1908    return(ret);
1909}
1910
1911
1912static int
1913test_htmlDocDumpMemory(void) {
1914    int ret = 0;
1915
1916
1917    /* missing type support */
1918    return(ret);
1919}
1920
1921
1922static int
1923test_htmlGetMetaEncoding(void) {
1924    int ret = 0;
1925
1926#ifdef LIBXML_HTML_ENABLED
1927    int mem_base;
1928    const xmlChar * ret_val;
1929    htmlDocPtr doc; /* the document */
1930    int n_doc;
1931
1932    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
1933        mem_base = xmlMemBlocks();
1934        doc = gen_xmlDocPtr(n_doc, 0);
1935
1936        ret_val = htmlGetMetaEncoding(doc);
1937        desret_const_xmlChar_ptr(ret_val);
1938        call_tests++;
1939        des_xmlDocPtr(n_doc, doc, 0);
1940        xmlResetLastError();
1941        if (mem_base != xmlMemBlocks()) {
1942            printf("Leak of %d blocks found in htmlGetMetaEncoding",
1943	           xmlMemBlocks() - mem_base);
1944	    ret++;
1945            printf(" %d", n_doc);
1946            printf("\n");
1947        }
1948    }
1949#endif
1950
1951    function_tests++;
1952    return(ret);
1953}
1954
1955
1956static int
1957test_htmlIsBooleanAttr(void) {
1958    int ret = 0;
1959
1960#ifdef LIBXML_HTML_ENABLED
1961    int mem_base;
1962    int ret_val;
1963    const xmlChar * name; /* the name of the attribute to check */
1964    int n_name;
1965
1966    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1967        mem_base = xmlMemBlocks();
1968        name = gen_const_xmlChar_ptr(n_name, 0);
1969
1970        ret_val = htmlIsBooleanAttr(name);
1971        desret_int(ret_val);
1972        call_tests++;
1973        des_const_xmlChar_ptr(n_name, name, 0);
1974        xmlResetLastError();
1975        if (mem_base != xmlMemBlocks()) {
1976            printf("Leak of %d blocks found in htmlIsBooleanAttr",
1977	           xmlMemBlocks() - mem_base);
1978	    ret++;
1979            printf(" %d", n_name);
1980            printf("\n");
1981        }
1982    }
1983#endif
1984
1985    function_tests++;
1986    return(ret);
1987}
1988
1989
1990static int
1991test_htmlNewDoc(void) {
1992    int ret = 0;
1993
1994#ifdef LIBXML_HTML_ENABLED
1995    int mem_base;
1996    htmlDocPtr ret_val;
1997    const xmlChar * URI; /* URI for the dtd, or NULL */
1998    int n_URI;
1999    const xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
2000    int n_ExternalID;
2001
2002    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
2003    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
2004        mem_base = xmlMemBlocks();
2005        URI = gen_const_xmlChar_ptr(n_URI, 0);
2006        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
2007
2008        ret_val = htmlNewDoc(URI, ExternalID);
2009        desret_xmlDocPtr(ret_val);
2010        call_tests++;
2011        des_const_xmlChar_ptr(n_URI, URI, 0);
2012        des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
2013        xmlResetLastError();
2014        if (mem_base != xmlMemBlocks()) {
2015            printf("Leak of %d blocks found in htmlNewDoc",
2016	           xmlMemBlocks() - mem_base);
2017	    ret++;
2018            printf(" %d", n_URI);
2019            printf(" %d", n_ExternalID);
2020            printf("\n");
2021        }
2022    }
2023    }
2024#endif
2025
2026    function_tests++;
2027    return(ret);
2028}
2029
2030
2031static int
2032test_htmlNewDocNoDtD(void) {
2033    int ret = 0;
2034
2035#ifdef LIBXML_HTML_ENABLED
2036    int mem_base;
2037    htmlDocPtr ret_val;
2038    const xmlChar * URI; /* URI for the dtd, or NULL */
2039    int n_URI;
2040    const xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
2041    int n_ExternalID;
2042
2043    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
2044    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
2045        mem_base = xmlMemBlocks();
2046        URI = gen_const_xmlChar_ptr(n_URI, 0);
2047        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
2048
2049        ret_val = htmlNewDocNoDtD(URI, ExternalID);
2050        desret_xmlDocPtr(ret_val);
2051        call_tests++;
2052        des_const_xmlChar_ptr(n_URI, URI, 0);
2053        des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
2054        xmlResetLastError();
2055        if (mem_base != xmlMemBlocks()) {
2056            printf("Leak of %d blocks found in htmlNewDocNoDtD",
2057	           xmlMemBlocks() - mem_base);
2058	    ret++;
2059            printf(" %d", n_URI);
2060            printf(" %d", n_ExternalID);
2061            printf("\n");
2062        }
2063    }
2064    }
2065#endif
2066
2067    function_tests++;
2068    return(ret);
2069}
2070
2071
2072static int
2073test_htmlNodeDump(void) {
2074    int ret = 0;
2075
2076#ifdef LIBXML_HTML_ENABLED
2077#ifdef LIBXML_OUTPUT_ENABLED
2078    int mem_base;
2079    int ret_val;
2080    xmlBufferPtr buf; /* the HTML buffer output */
2081    int n_buf;
2082    xmlDocPtr doc; /* the document */
2083    int n_doc;
2084    xmlNodePtr cur; /* the current node */
2085    int n_cur;
2086
2087    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
2088    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
2089    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
2090        mem_base = xmlMemBlocks();
2091        buf = gen_xmlBufferPtr(n_buf, 0);
2092        doc = gen_xmlDocPtr(n_doc, 1);
2093        cur = gen_xmlNodePtr(n_cur, 2);
2094
2095        ret_val = htmlNodeDump(buf, doc, cur);
2096        desret_int(ret_val);
2097        call_tests++;
2098        des_xmlBufferPtr(n_buf, buf, 0);
2099        des_xmlDocPtr(n_doc, doc, 1);
2100        des_xmlNodePtr(n_cur, cur, 2);
2101        xmlResetLastError();
2102        if (mem_base != xmlMemBlocks()) {
2103            printf("Leak of %d blocks found in htmlNodeDump",
2104	           xmlMemBlocks() - mem_base);
2105	    ret++;
2106            printf(" %d", n_buf);
2107            printf(" %d", n_doc);
2108            printf(" %d", n_cur);
2109            printf("\n");
2110        }
2111    }
2112    }
2113    }
2114#endif
2115#endif
2116
2117    function_tests++;
2118    return(ret);
2119}
2120
2121
2122static int
2123test_htmlNodeDumpFile(void) {
2124    int ret = 0;
2125
2126#ifdef LIBXML_HTML_ENABLED
2127#ifdef LIBXML_OUTPUT_ENABLED
2128    int mem_base;
2129    FILE * out; /* the FILE pointer */
2130    int n_out;
2131    xmlDocPtr doc; /* the document */
2132    int n_doc;
2133    xmlNodePtr cur; /* the current node */
2134    int n_cur;
2135
2136    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
2137    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
2138    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
2139        mem_base = xmlMemBlocks();
2140        out = gen_FILE_ptr(n_out, 0);
2141        doc = gen_xmlDocPtr(n_doc, 1);
2142        cur = gen_xmlNodePtr(n_cur, 2);
2143
2144        htmlNodeDumpFile(out, doc, cur);
2145        call_tests++;
2146        des_FILE_ptr(n_out, out, 0);
2147        des_xmlDocPtr(n_doc, doc, 1);
2148        des_xmlNodePtr(n_cur, cur, 2);
2149        xmlResetLastError();
2150        if (mem_base != xmlMemBlocks()) {
2151            printf("Leak of %d blocks found in htmlNodeDumpFile",
2152	           xmlMemBlocks() - mem_base);
2153	    ret++;
2154            printf(" %d", n_out);
2155            printf(" %d", n_doc);
2156            printf(" %d", n_cur);
2157            printf("\n");
2158        }
2159    }
2160    }
2161    }
2162#endif
2163#endif
2164
2165    function_tests++;
2166    return(ret);
2167}
2168
2169
2170static int
2171test_htmlNodeDumpFileFormat(void) {
2172    int ret = 0;
2173
2174#ifdef LIBXML_HTML_ENABLED
2175#ifdef LIBXML_OUTPUT_ENABLED
2176    int mem_base;
2177    int ret_val;
2178    FILE * out; /* the FILE pointer */
2179    int n_out;
2180    xmlDocPtr doc; /* the document */
2181    int n_doc;
2182    xmlNodePtr cur; /* the current node */
2183    int n_cur;
2184    const char * encoding; /* the document encoding */
2185    int n_encoding;
2186    int format; /* should formatting spaces been added */
2187    int n_format;
2188
2189    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
2190    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
2191    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
2192    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2193    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2194        mem_base = xmlMemBlocks();
2195        out = gen_FILE_ptr(n_out, 0);
2196        doc = gen_xmlDocPtr(n_doc, 1);
2197        cur = gen_xmlNodePtr(n_cur, 2);
2198        encoding = gen_const_char_ptr(n_encoding, 3);
2199        format = gen_int(n_format, 4);
2200
2201        ret_val = htmlNodeDumpFileFormat(out, doc, cur, encoding, format);
2202        desret_int(ret_val);
2203        call_tests++;
2204        des_FILE_ptr(n_out, out, 0);
2205        des_xmlDocPtr(n_doc, doc, 1);
2206        des_xmlNodePtr(n_cur, cur, 2);
2207        des_const_char_ptr(n_encoding, encoding, 3);
2208        des_int(n_format, format, 4);
2209        xmlResetLastError();
2210        if (mem_base != xmlMemBlocks()) {
2211            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
2212	           xmlMemBlocks() - mem_base);
2213	    ret++;
2214            printf(" %d", n_out);
2215            printf(" %d", n_doc);
2216            printf(" %d", n_cur);
2217            printf(" %d", n_encoding);
2218            printf(" %d", n_format);
2219            printf("\n");
2220        }
2221    }
2222    }
2223    }
2224    }
2225    }
2226#endif
2227#endif
2228
2229    function_tests++;
2230    return(ret);
2231}
2232
2233
2234static int
2235test_htmlNodeDumpFormatOutput(void) {
2236    int ret = 0;
2237
2238#ifdef LIBXML_HTML_ENABLED
2239#ifdef LIBXML_OUTPUT_ENABLED
2240    int mem_base;
2241    xmlOutputBufferPtr buf; /* the HTML buffer output */
2242    int n_buf;
2243    xmlDocPtr doc; /* the document */
2244    int n_doc;
2245    xmlNodePtr cur; /* the current node */
2246    int n_cur;
2247    const char * encoding; /* the encoding string */
2248    int n_encoding;
2249    int format; /* should formatting spaces been added */
2250    int n_format;
2251
2252    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2253    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
2254    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
2255    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2256    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2257        mem_base = xmlMemBlocks();
2258        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2259        doc = gen_xmlDocPtr(n_doc, 1);
2260        cur = gen_xmlNodePtr(n_cur, 2);
2261        encoding = gen_const_char_ptr(n_encoding, 3);
2262        format = gen_int(n_format, 4);
2263
2264        htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
2265        call_tests++;
2266        des_xmlOutputBufferPtr(n_buf, buf, 0);
2267        des_xmlDocPtr(n_doc, doc, 1);
2268        des_xmlNodePtr(n_cur, cur, 2);
2269        des_const_char_ptr(n_encoding, encoding, 3);
2270        des_int(n_format, format, 4);
2271        xmlResetLastError();
2272        if (mem_base != xmlMemBlocks()) {
2273            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
2274	           xmlMemBlocks() - mem_base);
2275	    ret++;
2276            printf(" %d", n_buf);
2277            printf(" %d", n_doc);
2278            printf(" %d", n_cur);
2279            printf(" %d", n_encoding);
2280            printf(" %d", n_format);
2281            printf("\n");
2282        }
2283    }
2284    }
2285    }
2286    }
2287    }
2288#endif
2289#endif
2290
2291    function_tests++;
2292    return(ret);
2293}
2294
2295
2296static int
2297test_htmlNodeDumpOutput(void) {
2298    int ret = 0;
2299
2300#ifdef LIBXML_HTML_ENABLED
2301#ifdef LIBXML_OUTPUT_ENABLED
2302    int mem_base;
2303    xmlOutputBufferPtr buf; /* the HTML buffer output */
2304    int n_buf;
2305    xmlDocPtr doc; /* the document */
2306    int n_doc;
2307    xmlNodePtr cur; /* the current node */
2308    int n_cur;
2309    const char * encoding; /* the encoding string */
2310    int n_encoding;
2311
2312    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2313    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
2314    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
2315    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2316        mem_base = xmlMemBlocks();
2317        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2318        doc = gen_xmlDocPtr(n_doc, 1);
2319        cur = gen_xmlNodePtr(n_cur, 2);
2320        encoding = gen_const_char_ptr(n_encoding, 3);
2321
2322        htmlNodeDumpOutput(buf, doc, cur, encoding);
2323        call_tests++;
2324        des_xmlOutputBufferPtr(n_buf, buf, 0);
2325        des_xmlDocPtr(n_doc, doc, 1);
2326        des_xmlNodePtr(n_cur, cur, 2);
2327        des_const_char_ptr(n_encoding, encoding, 3);
2328        xmlResetLastError();
2329        if (mem_base != xmlMemBlocks()) {
2330            printf("Leak of %d blocks found in htmlNodeDumpOutput",
2331	           xmlMemBlocks() - mem_base);
2332	    ret++;
2333            printf(" %d", n_buf);
2334            printf(" %d", n_doc);
2335            printf(" %d", n_cur);
2336            printf(" %d", n_encoding);
2337            printf("\n");
2338        }
2339    }
2340    }
2341    }
2342    }
2343#endif
2344#endif
2345
2346    function_tests++;
2347    return(ret);
2348}
2349
2350
2351static int
2352test_htmlSaveFile(void) {
2353    int ret = 0;
2354
2355#ifdef LIBXML_HTML_ENABLED
2356#ifdef LIBXML_OUTPUT_ENABLED
2357    int mem_base;
2358    int ret_val;
2359    const char * filename; /* the filename (or URL) */
2360    int n_filename;
2361    xmlDocPtr cur; /* the document */
2362    int n_cur;
2363
2364    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
2365    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2366        mem_base = xmlMemBlocks();
2367        filename = gen_fileoutput(n_filename, 0);
2368        cur = gen_xmlDocPtr(n_cur, 1);
2369
2370        ret_val = htmlSaveFile(filename, cur);
2371        desret_int(ret_val);
2372        call_tests++;
2373        des_fileoutput(n_filename, filename, 0);
2374        des_xmlDocPtr(n_cur, cur, 1);
2375        xmlResetLastError();
2376        if (mem_base != xmlMemBlocks()) {
2377            printf("Leak of %d blocks found in htmlSaveFile",
2378	           xmlMemBlocks() - mem_base);
2379	    ret++;
2380            printf(" %d", n_filename);
2381            printf(" %d", n_cur);
2382            printf("\n");
2383        }
2384    }
2385    }
2386#endif
2387#endif
2388
2389    function_tests++;
2390    return(ret);
2391}
2392
2393
2394static int
2395test_htmlSaveFileEnc(void) {
2396    int ret = 0;
2397
2398#ifdef LIBXML_HTML_ENABLED
2399#ifdef LIBXML_OUTPUT_ENABLED
2400    int mem_base;
2401    int ret_val;
2402    const char * filename; /* the filename */
2403    int n_filename;
2404    xmlDocPtr cur; /* the document */
2405    int n_cur;
2406    const char * encoding; /* the document encoding */
2407    int n_encoding;
2408
2409    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
2410    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2411    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2412        mem_base = xmlMemBlocks();
2413        filename = gen_fileoutput(n_filename, 0);
2414        cur = gen_xmlDocPtr(n_cur, 1);
2415        encoding = gen_const_char_ptr(n_encoding, 2);
2416
2417        ret_val = htmlSaveFileEnc(filename, cur, encoding);
2418        desret_int(ret_val);
2419        call_tests++;
2420        des_fileoutput(n_filename, filename, 0);
2421        des_xmlDocPtr(n_cur, cur, 1);
2422        des_const_char_ptr(n_encoding, encoding, 2);
2423        xmlResetLastError();
2424        if (mem_base != xmlMemBlocks()) {
2425            printf("Leak of %d blocks found in htmlSaveFileEnc",
2426	           xmlMemBlocks() - mem_base);
2427	    ret++;
2428            printf(" %d", n_filename);
2429            printf(" %d", n_cur);
2430            printf(" %d", n_encoding);
2431            printf("\n");
2432        }
2433    }
2434    }
2435    }
2436#endif
2437#endif
2438
2439    function_tests++;
2440    return(ret);
2441}
2442
2443
2444static int
2445test_htmlSaveFileFormat(void) {
2446    int ret = 0;
2447
2448#ifdef LIBXML_HTML_ENABLED
2449#ifdef LIBXML_OUTPUT_ENABLED
2450    int mem_base;
2451    int ret_val;
2452    const char * filename; /* the filename */
2453    int n_filename;
2454    xmlDocPtr cur; /* the document */
2455    int n_cur;
2456    const char * encoding; /* the document encoding */
2457    int n_encoding;
2458    int format; /* should formatting spaces been added */
2459    int n_format;
2460
2461    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
2462    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2463    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2464    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2465        mem_base = xmlMemBlocks();
2466        filename = gen_fileoutput(n_filename, 0);
2467        cur = gen_xmlDocPtr(n_cur, 1);
2468        encoding = gen_const_char_ptr(n_encoding, 2);
2469        format = gen_int(n_format, 3);
2470
2471        ret_val = htmlSaveFileFormat(filename, cur, encoding, format);
2472        desret_int(ret_val);
2473        call_tests++;
2474        des_fileoutput(n_filename, filename, 0);
2475        des_xmlDocPtr(n_cur, cur, 1);
2476        des_const_char_ptr(n_encoding, encoding, 2);
2477        des_int(n_format, format, 3);
2478        xmlResetLastError();
2479        if (mem_base != xmlMemBlocks()) {
2480            printf("Leak of %d blocks found in htmlSaveFileFormat",
2481	           xmlMemBlocks() - mem_base);
2482	    ret++;
2483            printf(" %d", n_filename);
2484            printf(" %d", n_cur);
2485            printf(" %d", n_encoding);
2486            printf(" %d", n_format);
2487            printf("\n");
2488        }
2489    }
2490    }
2491    }
2492    }
2493#endif
2494#endif
2495
2496    function_tests++;
2497    return(ret);
2498}
2499
2500
2501static int
2502test_htmlSetMetaEncoding(void) {
2503    int ret = 0;
2504
2505#ifdef LIBXML_HTML_ENABLED
2506    int mem_base;
2507    int ret_val;
2508    htmlDocPtr doc; /* the document */
2509    int n_doc;
2510    const xmlChar * encoding; /* the encoding string */
2511    int n_encoding;
2512
2513    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
2514    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
2515        mem_base = xmlMemBlocks();
2516        doc = gen_xmlDocPtr(n_doc, 0);
2517        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
2518
2519        ret_val = htmlSetMetaEncoding(doc, encoding);
2520        desret_int(ret_val);
2521        call_tests++;
2522        des_xmlDocPtr(n_doc, doc, 0);
2523        des_const_xmlChar_ptr(n_encoding, encoding, 1);
2524        xmlResetLastError();
2525        if (mem_base != xmlMemBlocks()) {
2526            printf("Leak of %d blocks found in htmlSetMetaEncoding",
2527	           xmlMemBlocks() - mem_base);
2528	    ret++;
2529            printf(" %d", n_doc);
2530            printf(" %d", n_encoding);
2531            printf("\n");
2532        }
2533    }
2534    }
2535#endif
2536
2537    function_tests++;
2538    return(ret);
2539}
2540
2541static int
2542test_HTMLtree(void) {
2543    int ret = 0;
2544
2545    printf("Testing HTMLtree : 16 of 17 functions ...\n");
2546    ret += test_htmlDocContentDumpFormatOutput();
2547    ret += test_htmlDocContentDumpOutput();
2548    ret += test_htmlDocDump();
2549    ret += test_htmlDocDumpMemory();
2550    ret += test_htmlGetMetaEncoding();
2551    ret += test_htmlIsBooleanAttr();
2552    ret += test_htmlNewDoc();
2553    ret += test_htmlNewDocNoDtD();
2554    ret += test_htmlNodeDump();
2555    ret += test_htmlNodeDumpFile();
2556    ret += test_htmlNodeDumpFileFormat();
2557    ret += test_htmlNodeDumpFormatOutput();
2558    ret += test_htmlNodeDumpOutput();
2559    ret += test_htmlSaveFile();
2560    ret += test_htmlSaveFileEnc();
2561    ret += test_htmlSaveFileFormat();
2562    ret += test_htmlSetMetaEncoding();
2563
2564    if (ret != 0)
2565	printf("Module HTMLtree: %d errors\n", ret);
2566    return(ret);
2567}
2568
2569static int
2570test_xmlACatalogAdd(void) {
2571    int ret = 0;
2572
2573
2574    /* missing type support */
2575    return(ret);
2576}
2577
2578
2579static int
2580test_xmlACatalogDump(void) {
2581    int ret = 0;
2582
2583
2584    /* missing type support */
2585    return(ret);
2586}
2587
2588
2589static int
2590test_xmlACatalogRemove(void) {
2591    int ret = 0;
2592
2593
2594    /* missing type support */
2595    return(ret);
2596}
2597
2598
2599static int
2600test_xmlACatalogResolve(void) {
2601    int ret = 0;
2602
2603
2604    /* missing type support */
2605    return(ret);
2606}
2607
2608
2609static int
2610test_xmlACatalogResolvePublic(void) {
2611    int ret = 0;
2612
2613
2614    /* missing type support */
2615    return(ret);
2616}
2617
2618
2619static int
2620test_xmlACatalogResolveSystem(void) {
2621    int ret = 0;
2622
2623
2624    /* missing type support */
2625    return(ret);
2626}
2627
2628
2629static int
2630test_xmlACatalogResolveURI(void) {
2631    int ret = 0;
2632
2633
2634    /* missing type support */
2635    return(ret);
2636}
2637
2638
2639static int
2640test_xmlCatalogAdd(void) {
2641    int ret = 0;
2642
2643#ifdef LIBXML_CATALOG_ENABLED
2644    int mem_base;
2645    int ret_val;
2646    const xmlChar * type; /* the type of record to add to the catalog */
2647    int n_type;
2648    const xmlChar * orig; /* the system, public or prefix to match */
2649    int n_orig;
2650    const xmlChar * replace; /* the replacement value for the match */
2651    int n_replace;
2652
2653    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
2654    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
2655    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
2656        mem_base = xmlMemBlocks();
2657        type = gen_const_xmlChar_ptr(n_type, 0);
2658        orig = gen_const_xmlChar_ptr(n_orig, 1);
2659        replace = gen_const_xmlChar_ptr(n_replace, 2);
2660
2661        ret_val = xmlCatalogAdd(type, orig, replace);
2662        desret_int(ret_val);
2663        call_tests++;
2664        des_const_xmlChar_ptr(n_type, type, 0);
2665        des_const_xmlChar_ptr(n_orig, orig, 1);
2666        des_const_xmlChar_ptr(n_replace, replace, 2);
2667        xmlResetLastError();
2668        if (mem_base != xmlMemBlocks()) {
2669            printf("Leak of %d blocks found in xmlCatalogAdd",
2670	           xmlMemBlocks() - mem_base);
2671	    ret++;
2672            printf(" %d", n_type);
2673            printf(" %d", n_orig);
2674            printf(" %d", n_replace);
2675            printf("\n");
2676        }
2677    }
2678    }
2679    }
2680#endif
2681
2682    function_tests++;
2683    return(ret);
2684}
2685
2686
2687static int
2688test_xmlCatalogCleanup(void) {
2689    int ret = 0;
2690
2691#ifdef LIBXML_CATALOG_ENABLED
2692
2693
2694        xmlCatalogCleanup();
2695        call_tests++;
2696        xmlResetLastError();
2697#endif
2698
2699    function_tests++;
2700    return(ret);
2701}
2702
2703
2704static int
2705test_xmlCatalogConvert(void) {
2706    int ret = 0;
2707
2708#ifdef LIBXML_CATALOG_ENABLED
2709    int ret_val;
2710
2711
2712        ret_val = xmlCatalogConvert();
2713        desret_int(ret_val);
2714        call_tests++;
2715        xmlResetLastError();
2716#endif
2717
2718    function_tests++;
2719    return(ret);
2720}
2721
2722
2723static int
2724test_xmlCatalogDump(void) {
2725    int ret = 0;
2726
2727#ifdef LIBXML_CATALOG_ENABLED
2728#ifdef LIBXML_OUTPUT_ENABLED
2729    int mem_base;
2730    FILE * out; /* the file. */
2731    int n_out;
2732
2733    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
2734        mem_base = xmlMemBlocks();
2735        out = gen_FILE_ptr(n_out, 0);
2736
2737        xmlCatalogDump(out);
2738        call_tests++;
2739        des_FILE_ptr(n_out, out, 0);
2740        xmlResetLastError();
2741        if (mem_base != xmlMemBlocks()) {
2742            printf("Leak of %d blocks found in xmlCatalogDump",
2743	           xmlMemBlocks() - mem_base);
2744	    ret++;
2745            printf(" %d", n_out);
2746            printf("\n");
2747        }
2748    }
2749#endif
2750#endif
2751
2752    function_tests++;
2753    return(ret);
2754}
2755
2756
2757static int
2758test_xmlCatalogGetDefaults(void) {
2759    int ret = 0;
2760
2761
2762    /* missing type support */
2763    return(ret);
2764}
2765
2766
2767static int
2768test_xmlCatalogIsEmpty(void) {
2769    int ret = 0;
2770
2771
2772    /* missing type support */
2773    return(ret);
2774}
2775
2776
2777static int
2778test_xmlCatalogLocalResolve(void) {
2779    int ret = 0;
2780
2781#ifdef LIBXML_CATALOG_ENABLED
2782    int mem_base;
2783    xmlChar * ret_val;
2784    void * catalogs; /* a document's list of catalogs */
2785    int n_catalogs;
2786    const xmlChar * pubID; /* the public ID string */
2787    int n_pubID;
2788    const xmlChar * sysID; /* the system ID string */
2789    int n_sysID;
2790
2791    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
2792    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
2793    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
2794        mem_base = xmlMemBlocks();
2795        catalogs = gen_void_ptr(n_catalogs, 0);
2796        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
2797        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
2798
2799        ret_val = xmlCatalogLocalResolve(catalogs, pubID, sysID);
2800        desret_xmlChar_ptr(ret_val);
2801        call_tests++;
2802        des_void_ptr(n_catalogs, catalogs, 0);
2803        des_const_xmlChar_ptr(n_pubID, pubID, 1);
2804        des_const_xmlChar_ptr(n_sysID, sysID, 2);
2805        xmlResetLastError();
2806        if (mem_base != xmlMemBlocks()) {
2807            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
2808	           xmlMemBlocks() - mem_base);
2809	    ret++;
2810            printf(" %d", n_catalogs);
2811            printf(" %d", n_pubID);
2812            printf(" %d", n_sysID);
2813            printf("\n");
2814        }
2815    }
2816    }
2817    }
2818#endif
2819
2820    function_tests++;
2821    return(ret);
2822}
2823
2824
2825static int
2826test_xmlCatalogLocalResolveURI(void) {
2827    int ret = 0;
2828
2829#ifdef LIBXML_CATALOG_ENABLED
2830    int mem_base;
2831    xmlChar * ret_val;
2832    void * catalogs; /* a document's list of catalogs */
2833    int n_catalogs;
2834    const xmlChar * URI; /* the URI */
2835    int n_URI;
2836
2837    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
2838    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
2839        mem_base = xmlMemBlocks();
2840        catalogs = gen_void_ptr(n_catalogs, 0);
2841        URI = gen_const_xmlChar_ptr(n_URI, 1);
2842
2843        ret_val = xmlCatalogLocalResolveURI(catalogs, URI);
2844        desret_xmlChar_ptr(ret_val);
2845        call_tests++;
2846        des_void_ptr(n_catalogs, catalogs, 0);
2847        des_const_xmlChar_ptr(n_URI, URI, 1);
2848        xmlResetLastError();
2849        if (mem_base != xmlMemBlocks()) {
2850            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
2851	           xmlMemBlocks() - mem_base);
2852	    ret++;
2853            printf(" %d", n_catalogs);
2854            printf(" %d", n_URI);
2855            printf("\n");
2856        }
2857    }
2858    }
2859#endif
2860
2861    function_tests++;
2862    return(ret);
2863}
2864
2865
2866static int
2867test_xmlCatalogRemove(void) {
2868    int ret = 0;
2869
2870#ifdef LIBXML_CATALOG_ENABLED
2871    int ret_val;
2872    const xmlChar * value; /* the value to remove */
2873    int n_value;
2874
2875    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
2876        value = gen_const_xmlChar_ptr(n_value, 0);
2877
2878        ret_val = xmlCatalogRemove(value);
2879        desret_int(ret_val);
2880        call_tests++;
2881        des_const_xmlChar_ptr(n_value, value, 0);
2882        xmlResetLastError();
2883    }
2884#endif
2885
2886    function_tests++;
2887    return(ret);
2888}
2889
2890
2891static int
2892test_xmlCatalogResolve(void) {
2893    int ret = 0;
2894
2895#ifdef LIBXML_CATALOG_ENABLED
2896    int mem_base;
2897    xmlChar * ret_val;
2898    const xmlChar * pubID; /* the public ID string */
2899    int n_pubID;
2900    const xmlChar * sysID; /* the system ID string */
2901    int n_sysID;
2902
2903    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
2904    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
2905        mem_base = xmlMemBlocks();
2906        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
2907        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
2908
2909        ret_val = xmlCatalogResolve(pubID, sysID);
2910        desret_xmlChar_ptr(ret_val);
2911        call_tests++;
2912        des_const_xmlChar_ptr(n_pubID, pubID, 0);
2913        des_const_xmlChar_ptr(n_sysID, sysID, 1);
2914        xmlResetLastError();
2915        if (mem_base != xmlMemBlocks()) {
2916            printf("Leak of %d blocks found in xmlCatalogResolve",
2917	           xmlMemBlocks() - mem_base);
2918	    ret++;
2919            printf(" %d", n_pubID);
2920            printf(" %d", n_sysID);
2921            printf("\n");
2922        }
2923    }
2924    }
2925#endif
2926
2927    function_tests++;
2928    return(ret);
2929}
2930
2931
2932static int
2933test_xmlCatalogResolvePublic(void) {
2934    int ret = 0;
2935
2936#ifdef LIBXML_CATALOG_ENABLED
2937    int mem_base;
2938    xmlChar * ret_val;
2939    const xmlChar * pubID; /* the public ID string */
2940    int n_pubID;
2941
2942    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
2943        mem_base = xmlMemBlocks();
2944        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
2945
2946        ret_val = xmlCatalogResolvePublic(pubID);
2947        desret_xmlChar_ptr(ret_val);
2948        call_tests++;
2949        des_const_xmlChar_ptr(n_pubID, pubID, 0);
2950        xmlResetLastError();
2951        if (mem_base != xmlMemBlocks()) {
2952            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
2953	           xmlMemBlocks() - mem_base);
2954	    ret++;
2955            printf(" %d", n_pubID);
2956            printf("\n");
2957        }
2958    }
2959#endif
2960
2961    function_tests++;
2962    return(ret);
2963}
2964
2965
2966static int
2967test_xmlCatalogResolveSystem(void) {
2968    int ret = 0;
2969
2970#ifdef LIBXML_CATALOG_ENABLED
2971    int mem_base;
2972    xmlChar * ret_val;
2973    const xmlChar * sysID; /* the system ID string */
2974    int n_sysID;
2975
2976    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
2977        mem_base = xmlMemBlocks();
2978        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
2979
2980        ret_val = xmlCatalogResolveSystem(sysID);
2981        desret_xmlChar_ptr(ret_val);
2982        call_tests++;
2983        des_const_xmlChar_ptr(n_sysID, sysID, 0);
2984        xmlResetLastError();
2985        if (mem_base != xmlMemBlocks()) {
2986            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
2987	           xmlMemBlocks() - mem_base);
2988	    ret++;
2989            printf(" %d", n_sysID);
2990            printf("\n");
2991        }
2992    }
2993#endif
2994
2995    function_tests++;
2996    return(ret);
2997}
2998
2999
3000static int
3001test_xmlCatalogResolveURI(void) {
3002    int ret = 0;
3003
3004#ifdef LIBXML_CATALOG_ENABLED
3005    int mem_base;
3006    xmlChar * ret_val;
3007    const xmlChar * URI; /* the URI */
3008    int n_URI;
3009
3010    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3011        mem_base = xmlMemBlocks();
3012        URI = gen_const_xmlChar_ptr(n_URI, 0);
3013
3014        ret_val = xmlCatalogResolveURI(URI);
3015        desret_xmlChar_ptr(ret_val);
3016        call_tests++;
3017        des_const_xmlChar_ptr(n_URI, URI, 0);
3018        xmlResetLastError();
3019        if (mem_base != xmlMemBlocks()) {
3020            printf("Leak of %d blocks found in xmlCatalogResolveURI",
3021	           xmlMemBlocks() - mem_base);
3022	    ret++;
3023            printf(" %d", n_URI);
3024            printf("\n");
3025        }
3026    }
3027#endif
3028
3029    function_tests++;
3030    return(ret);
3031}
3032
3033
3034static int
3035test_xmlCatalogSetDebug(void) {
3036    int ret = 0;
3037
3038#ifdef LIBXML_CATALOG_ENABLED
3039    int mem_base;
3040    int ret_val;
3041    int level; /* the debug level of catalogs required */
3042    int n_level;
3043
3044    for (n_level = 0;n_level < gen_nb_int;n_level++) {
3045        mem_base = xmlMemBlocks();
3046        level = gen_int(n_level, 0);
3047
3048        ret_val = xmlCatalogSetDebug(level);
3049        desret_int(ret_val);
3050        call_tests++;
3051        des_int(n_level, level, 0);
3052        xmlResetLastError();
3053        if (mem_base != xmlMemBlocks()) {
3054            printf("Leak of %d blocks found in xmlCatalogSetDebug",
3055	           xmlMemBlocks() - mem_base);
3056	    ret++;
3057            printf(" %d", n_level);
3058            printf("\n");
3059        }
3060    }
3061#endif
3062
3063    function_tests++;
3064    return(ret);
3065}
3066
3067
3068static int
3069test_xmlCatalogSetDefaultPrefer(void) {
3070    int ret = 0;
3071
3072
3073    /* missing type support */
3074    return(ret);
3075}
3076
3077
3078static int
3079test_xmlCatalogSetDefaults(void) {
3080    int ret = 0;
3081
3082
3083    /* missing type support */
3084    return(ret);
3085}
3086
3087
3088static int
3089test_xmlConvertSGMLCatalog(void) {
3090    int ret = 0;
3091
3092
3093    /* missing type support */
3094    return(ret);
3095}
3096
3097
3098static int
3099test_xmlInitializeCatalog(void) {
3100    int ret = 0;
3101
3102#ifdef LIBXML_CATALOG_ENABLED
3103    int mem_base;
3104
3105        mem_base = xmlMemBlocks();
3106
3107        xmlInitializeCatalog();
3108        call_tests++;
3109        xmlResetLastError();
3110        if (mem_base != xmlMemBlocks()) {
3111            printf("Leak of %d blocks found in xmlInitializeCatalog",
3112	           xmlMemBlocks() - mem_base);
3113	    ret++;
3114            printf("\n");
3115        }
3116#endif
3117
3118    function_tests++;
3119    return(ret);
3120}
3121
3122
3123static int
3124test_xmlLoadACatalog(void) {
3125    int ret = 0;
3126
3127
3128    /* missing type support */
3129    return(ret);
3130}
3131
3132
3133static int
3134test_xmlLoadCatalog(void) {
3135    int ret = 0;
3136
3137#ifdef LIBXML_CATALOG_ENABLED
3138    int ret_val;
3139    const char * filename; /* a file path */
3140    int n_filename;
3141
3142    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
3143        filename = gen_filepath(n_filename, 0);
3144
3145        ret_val = xmlLoadCatalog(filename);
3146        desret_int(ret_val);
3147        call_tests++;
3148        des_filepath(n_filename, filename, 0);
3149        xmlResetLastError();
3150    }
3151#endif
3152
3153    function_tests++;
3154    return(ret);
3155}
3156
3157
3158static int
3159test_xmlLoadCatalogs(void) {
3160    int ret = 0;
3161
3162#ifdef LIBXML_CATALOG_ENABLED
3163    const char * pathss; /* a list of directories separated by a colon or a space. */
3164    int n_pathss;
3165
3166    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
3167        pathss = gen_const_char_ptr(n_pathss, 0);
3168
3169        xmlLoadCatalogs(pathss);
3170        call_tests++;
3171        des_const_char_ptr(n_pathss, pathss, 0);
3172        xmlResetLastError();
3173    }
3174#endif
3175
3176    function_tests++;
3177    return(ret);
3178}
3179
3180
3181static int
3182test_xmlLoadSGMLSuperCatalog(void) {
3183    int ret = 0;
3184
3185
3186    /* missing type support */
3187    return(ret);
3188}
3189
3190
3191static int
3192test_xmlNewCatalog(void) {
3193    int ret = 0;
3194
3195
3196    /* missing type support */
3197    return(ret);
3198}
3199
3200
3201static int
3202test_xmlParseCatalogFile(void) {
3203    int ret = 0;
3204
3205#ifdef LIBXML_CATALOG_ENABLED
3206    int mem_base;
3207    xmlDocPtr ret_val;
3208    const char * filename; /* the filename */
3209    int n_filename;
3210
3211    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
3212        mem_base = xmlMemBlocks();
3213        filename = gen_filepath(n_filename, 0);
3214
3215        ret_val = xmlParseCatalogFile(filename);
3216        desret_xmlDocPtr(ret_val);
3217        call_tests++;
3218        des_filepath(n_filename, filename, 0);
3219        xmlResetLastError();
3220        if (mem_base != xmlMemBlocks()) {
3221            printf("Leak of %d blocks found in xmlParseCatalogFile",
3222	           xmlMemBlocks() - mem_base);
3223	    ret++;
3224            printf(" %d", n_filename);
3225            printf("\n");
3226        }
3227    }
3228#endif
3229
3230    function_tests++;
3231    return(ret);
3232}
3233
3234static int
3235test_catalog(void) {
3236    int ret = 0;
3237
3238    printf("Testing catalog : 16 of 36 functions ...\n");
3239    ret += test_xmlACatalogAdd();
3240    ret += test_xmlACatalogDump();
3241    ret += test_xmlACatalogRemove();
3242    ret += test_xmlACatalogResolve();
3243    ret += test_xmlACatalogResolvePublic();
3244    ret += test_xmlACatalogResolveSystem();
3245    ret += test_xmlACatalogResolveURI();
3246    ret += test_xmlCatalogAdd();
3247    ret += test_xmlCatalogCleanup();
3248    ret += test_xmlCatalogConvert();
3249    ret += test_xmlCatalogDump();
3250    ret += test_xmlCatalogGetDefaults();
3251    ret += test_xmlCatalogIsEmpty();
3252    ret += test_xmlCatalogLocalResolve();
3253    ret += test_xmlCatalogLocalResolveURI();
3254    ret += test_xmlCatalogRemove();
3255    ret += test_xmlCatalogResolve();
3256    ret += test_xmlCatalogResolvePublic();
3257    ret += test_xmlCatalogResolveSystem();
3258    ret += test_xmlCatalogResolveURI();
3259    ret += test_xmlCatalogSetDebug();
3260    ret += test_xmlCatalogSetDefaultPrefer();
3261    ret += test_xmlCatalogSetDefaults();
3262    ret += test_xmlConvertSGMLCatalog();
3263    ret += test_xmlInitializeCatalog();
3264    ret += test_xmlLoadACatalog();
3265    ret += test_xmlLoadCatalog();
3266    ret += test_xmlLoadCatalogs();
3267    ret += test_xmlLoadSGMLSuperCatalog();
3268    ret += test_xmlNewCatalog();
3269    ret += test_xmlParseCatalogFile();
3270
3271    if (ret != 0)
3272	printf("Module catalog: %d errors\n", ret);
3273    return(ret);
3274}
3275
3276static int
3277test_xmlCharInRange(void) {
3278    int ret = 0;
3279
3280
3281    /* missing type support */
3282    return(ret);
3283}
3284
3285
3286static int
3287test_xmlIsBaseChar(void) {
3288    int ret = 0;
3289
3290    int mem_base;
3291    int ret_val;
3292    unsigned int ch; /* character to validate */
3293    int n_ch;
3294
3295    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3296        mem_base = xmlMemBlocks();
3297        ch = gen_unsigned_int(n_ch, 0);
3298
3299        ret_val = xmlIsBaseChar(ch);
3300        desret_int(ret_val);
3301        call_tests++;
3302        des_unsigned_int(n_ch, ch, 0);
3303        xmlResetLastError();
3304        if (mem_base != xmlMemBlocks()) {
3305            printf("Leak of %d blocks found in xmlIsBaseChar",
3306	           xmlMemBlocks() - mem_base);
3307	    ret++;
3308            printf(" %d", n_ch);
3309            printf("\n");
3310        }
3311    }
3312
3313    function_tests++;
3314    return(ret);
3315}
3316
3317
3318static int
3319test_xmlIsBlank(void) {
3320    int ret = 0;
3321
3322    int mem_base;
3323    int ret_val;
3324    unsigned int ch; /* character to validate */
3325    int n_ch;
3326
3327    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3328        mem_base = xmlMemBlocks();
3329        ch = gen_unsigned_int(n_ch, 0);
3330
3331        ret_val = xmlIsBlank(ch);
3332        desret_int(ret_val);
3333        call_tests++;
3334        des_unsigned_int(n_ch, ch, 0);
3335        xmlResetLastError();
3336        if (mem_base != xmlMemBlocks()) {
3337            printf("Leak of %d blocks found in xmlIsBlank",
3338	           xmlMemBlocks() - mem_base);
3339	    ret++;
3340            printf(" %d", n_ch);
3341            printf("\n");
3342        }
3343    }
3344
3345    function_tests++;
3346    return(ret);
3347}
3348
3349
3350static int
3351test_xmlIsChar(void) {
3352    int ret = 0;
3353
3354    int mem_base;
3355    int ret_val;
3356    unsigned int ch; /* character to validate */
3357    int n_ch;
3358
3359    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3360        mem_base = xmlMemBlocks();
3361        ch = gen_unsigned_int(n_ch, 0);
3362
3363        ret_val = xmlIsChar(ch);
3364        desret_int(ret_val);
3365        call_tests++;
3366        des_unsigned_int(n_ch, ch, 0);
3367        xmlResetLastError();
3368        if (mem_base != xmlMemBlocks()) {
3369            printf("Leak of %d blocks found in xmlIsChar",
3370	           xmlMemBlocks() - mem_base);
3371	    ret++;
3372            printf(" %d", n_ch);
3373            printf("\n");
3374        }
3375    }
3376
3377    function_tests++;
3378    return(ret);
3379}
3380
3381
3382static int
3383test_xmlIsCombining(void) {
3384    int ret = 0;
3385
3386    int mem_base;
3387    int ret_val;
3388    unsigned int ch; /* character to validate */
3389    int n_ch;
3390
3391    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3392        mem_base = xmlMemBlocks();
3393        ch = gen_unsigned_int(n_ch, 0);
3394
3395        ret_val = xmlIsCombining(ch);
3396        desret_int(ret_val);
3397        call_tests++;
3398        des_unsigned_int(n_ch, ch, 0);
3399        xmlResetLastError();
3400        if (mem_base != xmlMemBlocks()) {
3401            printf("Leak of %d blocks found in xmlIsCombining",
3402	           xmlMemBlocks() - mem_base);
3403	    ret++;
3404            printf(" %d", n_ch);
3405            printf("\n");
3406        }
3407    }
3408
3409    function_tests++;
3410    return(ret);
3411}
3412
3413
3414static int
3415test_xmlIsDigit(void) {
3416    int ret = 0;
3417
3418    int mem_base;
3419    int ret_val;
3420    unsigned int ch; /* character to validate */
3421    int n_ch;
3422
3423    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3424        mem_base = xmlMemBlocks();
3425        ch = gen_unsigned_int(n_ch, 0);
3426
3427        ret_val = xmlIsDigit(ch);
3428        desret_int(ret_val);
3429        call_tests++;
3430        des_unsigned_int(n_ch, ch, 0);
3431        xmlResetLastError();
3432        if (mem_base != xmlMemBlocks()) {
3433            printf("Leak of %d blocks found in xmlIsDigit",
3434	           xmlMemBlocks() - mem_base);
3435	    ret++;
3436            printf(" %d", n_ch);
3437            printf("\n");
3438        }
3439    }
3440
3441    function_tests++;
3442    return(ret);
3443}
3444
3445
3446static int
3447test_xmlIsExtender(void) {
3448    int ret = 0;
3449
3450    int mem_base;
3451    int ret_val;
3452    unsigned int ch; /* character to validate */
3453    int n_ch;
3454
3455    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3456        mem_base = xmlMemBlocks();
3457        ch = gen_unsigned_int(n_ch, 0);
3458
3459        ret_val = xmlIsExtender(ch);
3460        desret_int(ret_val);
3461        call_tests++;
3462        des_unsigned_int(n_ch, ch, 0);
3463        xmlResetLastError();
3464        if (mem_base != xmlMemBlocks()) {
3465            printf("Leak of %d blocks found in xmlIsExtender",
3466	           xmlMemBlocks() - mem_base);
3467	    ret++;
3468            printf(" %d", n_ch);
3469            printf("\n");
3470        }
3471    }
3472
3473    function_tests++;
3474    return(ret);
3475}
3476
3477
3478static int
3479test_xmlIsIdeographic(void) {
3480    int ret = 0;
3481
3482    int mem_base;
3483    int ret_val;
3484    unsigned int ch; /* character to validate */
3485    int n_ch;
3486
3487    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3488        mem_base = xmlMemBlocks();
3489        ch = gen_unsigned_int(n_ch, 0);
3490
3491        ret_val = xmlIsIdeographic(ch);
3492        desret_int(ret_val);
3493        call_tests++;
3494        des_unsigned_int(n_ch, ch, 0);
3495        xmlResetLastError();
3496        if (mem_base != xmlMemBlocks()) {
3497            printf("Leak of %d blocks found in xmlIsIdeographic",
3498	           xmlMemBlocks() - mem_base);
3499	    ret++;
3500            printf(" %d", n_ch);
3501            printf("\n");
3502        }
3503    }
3504
3505    function_tests++;
3506    return(ret);
3507}
3508
3509
3510static int
3511test_xmlIsPubidChar(void) {
3512    int ret = 0;
3513
3514    int mem_base;
3515    int ret_val;
3516    unsigned int ch; /* character to validate */
3517    int n_ch;
3518
3519    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
3520        mem_base = xmlMemBlocks();
3521        ch = gen_unsigned_int(n_ch, 0);
3522
3523        ret_val = xmlIsPubidChar(ch);
3524        desret_int(ret_val);
3525        call_tests++;
3526        des_unsigned_int(n_ch, ch, 0);
3527        xmlResetLastError();
3528        if (mem_base != xmlMemBlocks()) {
3529            printf("Leak of %d blocks found in xmlIsPubidChar",
3530	           xmlMemBlocks() - mem_base);
3531	    ret++;
3532            printf(" %d", n_ch);
3533            printf("\n");
3534        }
3535    }
3536
3537    function_tests++;
3538    return(ret);
3539}
3540
3541static int
3542test_chvalid(void) {
3543    int ret = 0;
3544
3545    printf("Testing chvalid : 8 of 9 functions ...\n");
3546    ret += test_xmlCharInRange();
3547    ret += test_xmlIsBaseChar();
3548    ret += test_xmlIsBlank();
3549    ret += test_xmlIsChar();
3550    ret += test_xmlIsCombining();
3551    ret += test_xmlIsDigit();
3552    ret += test_xmlIsExtender();
3553    ret += test_xmlIsIdeographic();
3554    ret += test_xmlIsPubidChar();
3555
3556    if (ret != 0)
3557	printf("Module chvalid: %d errors\n", ret);
3558    return(ret);
3559}
3560
3561static int
3562test_xmlDictCreate(void) {
3563    int ret = 0;
3564
3565    int mem_base;
3566    xmlDictPtr ret_val;
3567
3568        mem_base = xmlMemBlocks();
3569
3570        ret_val = xmlDictCreate();
3571        desret_xmlDictPtr(ret_val);
3572        call_tests++;
3573        xmlResetLastError();
3574        if (mem_base != xmlMemBlocks()) {
3575            printf("Leak of %d blocks found in xmlDictCreate",
3576	           xmlMemBlocks() - mem_base);
3577	    ret++;
3578            printf("\n");
3579        }
3580
3581    function_tests++;
3582    return(ret);
3583}
3584
3585
3586static int
3587test_xmlDictCreateSub(void) {
3588    int ret = 0;
3589
3590    int mem_base;
3591    xmlDictPtr ret_val;
3592    xmlDictPtr sub; /* an existing dictionnary */
3593    int n_sub;
3594
3595    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
3596        mem_base = xmlMemBlocks();
3597        sub = gen_xmlDictPtr(n_sub, 0);
3598
3599        ret_val = xmlDictCreateSub(sub);
3600        desret_xmlDictPtr(ret_val);
3601        call_tests++;
3602        des_xmlDictPtr(n_sub, sub, 0);
3603        xmlResetLastError();
3604        if (mem_base != xmlMemBlocks()) {
3605            printf("Leak of %d blocks found in xmlDictCreateSub",
3606	           xmlMemBlocks() - mem_base);
3607	    ret++;
3608            printf(" %d", n_sub);
3609            printf("\n");
3610        }
3611    }
3612
3613    function_tests++;
3614    return(ret);
3615}
3616
3617
3618static int
3619test_xmlDictLookup(void) {
3620    int ret = 0;
3621
3622    int mem_base;
3623    const xmlChar * ret_val;
3624    xmlDictPtr dict; /* the dictionnary */
3625    int n_dict;
3626    const xmlChar * name; /* the name of the userdata */
3627    int n_name;
3628    int len; /* the length of the name, if -1 it is recomputed */
3629    int n_len;
3630
3631    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
3632    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3633    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3634        mem_base = xmlMemBlocks();
3635        dict = gen_xmlDictPtr(n_dict, 0);
3636        name = gen_const_xmlChar_ptr(n_name, 1);
3637        len = gen_int(n_len, 2);
3638
3639        ret_val = xmlDictLookup(dict, name, len);
3640        desret_const_xmlChar_ptr(ret_val);
3641        call_tests++;
3642        des_xmlDictPtr(n_dict, dict, 0);
3643        des_const_xmlChar_ptr(n_name, name, 1);
3644        des_int(n_len, len, 2);
3645        xmlResetLastError();
3646        if (mem_base != xmlMemBlocks()) {
3647            printf("Leak of %d blocks found in xmlDictLookup",
3648	           xmlMemBlocks() - mem_base);
3649	    ret++;
3650            printf(" %d", n_dict);
3651            printf(" %d", n_name);
3652            printf(" %d", n_len);
3653            printf("\n");
3654        }
3655    }
3656    }
3657    }
3658
3659    function_tests++;
3660    return(ret);
3661}
3662
3663
3664static int
3665test_xmlDictOwns(void) {
3666    int ret = 0;
3667
3668    int mem_base;
3669    int ret_val;
3670    xmlDictPtr dict; /* the dictionnary */
3671    int n_dict;
3672    const xmlChar * str; /* the string */
3673    int n_str;
3674
3675    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
3676    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
3677        mem_base = xmlMemBlocks();
3678        dict = gen_xmlDictPtr(n_dict, 0);
3679        str = gen_const_xmlChar_ptr(n_str, 1);
3680
3681        ret_val = xmlDictOwns(dict, str);
3682        desret_int(ret_val);
3683        call_tests++;
3684        des_xmlDictPtr(n_dict, dict, 0);
3685        des_const_xmlChar_ptr(n_str, str, 1);
3686        xmlResetLastError();
3687        if (mem_base != xmlMemBlocks()) {
3688            printf("Leak of %d blocks found in xmlDictOwns",
3689	           xmlMemBlocks() - mem_base);
3690	    ret++;
3691            printf(" %d", n_dict);
3692            printf(" %d", n_str);
3693            printf("\n");
3694        }
3695    }
3696    }
3697
3698    function_tests++;
3699    return(ret);
3700}
3701
3702
3703static int
3704test_xmlDictQLookup(void) {
3705    int ret = 0;
3706
3707    int mem_base;
3708    const xmlChar * ret_val;
3709    xmlDictPtr dict; /* the dictionnary */
3710    int n_dict;
3711    const xmlChar * prefix; /* the prefix */
3712    int n_prefix;
3713    const xmlChar * name; /* the name */
3714    int n_name;
3715
3716    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
3717    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
3718    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3719        mem_base = xmlMemBlocks();
3720        dict = gen_xmlDictPtr(n_dict, 0);
3721        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
3722        name = gen_const_xmlChar_ptr(n_name, 2);
3723
3724        ret_val = xmlDictQLookup(dict, prefix, name);
3725        desret_const_xmlChar_ptr(ret_val);
3726        call_tests++;
3727        des_xmlDictPtr(n_dict, dict, 0);
3728        des_const_xmlChar_ptr(n_prefix, prefix, 1);
3729        des_const_xmlChar_ptr(n_name, name, 2);
3730        xmlResetLastError();
3731        if (mem_base != xmlMemBlocks()) {
3732            printf("Leak of %d blocks found in xmlDictQLookup",
3733	           xmlMemBlocks() - mem_base);
3734	    ret++;
3735            printf(" %d", n_dict);
3736            printf(" %d", n_prefix);
3737            printf(" %d", n_name);
3738            printf("\n");
3739        }
3740    }
3741    }
3742    }
3743
3744    function_tests++;
3745    return(ret);
3746}
3747
3748
3749static int
3750test_xmlDictReference(void) {
3751    int ret = 0;
3752
3753    int mem_base;
3754    int ret_val;
3755    xmlDictPtr dict; /* the dictionnary */
3756    int n_dict;
3757
3758    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
3759        mem_base = xmlMemBlocks();
3760        dict = gen_xmlDictPtr(n_dict, 0);
3761
3762        ret_val = xmlDictReference(dict);
3763        xmlDictFree(dict);
3764        desret_int(ret_val);
3765        call_tests++;
3766        des_xmlDictPtr(n_dict, dict, 0);
3767        xmlResetLastError();
3768        if (mem_base != xmlMemBlocks()) {
3769            printf("Leak of %d blocks found in xmlDictReference",
3770	           xmlMemBlocks() - mem_base);
3771	    ret++;
3772            printf(" %d", n_dict);
3773            printf("\n");
3774        }
3775    }
3776
3777    function_tests++;
3778    return(ret);
3779}
3780
3781
3782static int
3783test_xmlDictSize(void) {
3784    int ret = 0;
3785
3786    int mem_base;
3787    int ret_val;
3788    xmlDictPtr dict; /* the dictionnary */
3789    int n_dict;
3790
3791    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
3792        mem_base = xmlMemBlocks();
3793        dict = gen_xmlDictPtr(n_dict, 0);
3794
3795        ret_val = xmlDictSize(dict);
3796        desret_int(ret_val);
3797        call_tests++;
3798        des_xmlDictPtr(n_dict, dict, 0);
3799        xmlResetLastError();
3800        if (mem_base != xmlMemBlocks()) {
3801            printf("Leak of %d blocks found in xmlDictSize",
3802	           xmlMemBlocks() - mem_base);
3803	    ret++;
3804            printf(" %d", n_dict);
3805            printf("\n");
3806        }
3807    }
3808
3809    function_tests++;
3810    return(ret);
3811}
3812
3813static int
3814test_dict(void) {
3815    int ret = 0;
3816
3817    printf("Testing dict : 7 of 8 functions ...\n");
3818    ret += test_xmlDictCreate();
3819    ret += test_xmlDictCreateSub();
3820    ret += test_xmlDictLookup();
3821    ret += test_xmlDictOwns();
3822    ret += test_xmlDictQLookup();
3823    ret += test_xmlDictReference();
3824    ret += test_xmlDictSize();
3825
3826    if (ret != 0)
3827	printf("Module dict: %d errors\n", ret);
3828    return(ret);
3829}
3830
3831static int
3832test_UTF8Toisolat1(void) {
3833    int ret = 0;
3834
3835
3836    /* missing type support */
3837    return(ret);
3838}
3839
3840
3841static int
3842test_isolat1ToUTF8(void) {
3843    int ret = 0;
3844
3845
3846    /* missing type support */
3847    return(ret);
3848}
3849
3850
3851static int
3852test_xmlAddEncodingAlias(void) {
3853    int ret = 0;
3854
3855    int ret_val;
3856    const char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
3857    int n_name;
3858    const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
3859    int n_alias;
3860
3861    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
3862    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
3863        name = gen_const_char_ptr(n_name, 0);
3864        alias = gen_const_char_ptr(n_alias, 1);
3865
3866        ret_val = xmlAddEncodingAlias(name, alias);
3867        desret_int(ret_val);
3868        call_tests++;
3869        des_const_char_ptr(n_name, name, 0);
3870        des_const_char_ptr(n_alias, alias, 1);
3871        xmlResetLastError();
3872    }
3873    }
3874
3875    function_tests++;
3876    return(ret);
3877}
3878
3879
3880static int
3881test_xmlCharEncCloseFunc(void) {
3882    int ret = 0;
3883
3884
3885    /* missing type support */
3886    return(ret);
3887}
3888
3889
3890static int
3891test_xmlCharEncFirstLine(void) {
3892    int ret = 0;
3893
3894
3895    /* missing type support */
3896    return(ret);
3897}
3898
3899
3900static int
3901test_xmlCharEncInFunc(void) {
3902    int ret = 0;
3903
3904
3905    /* missing type support */
3906    return(ret);
3907}
3908
3909
3910static int
3911test_xmlCharEncOutFunc(void) {
3912    int ret = 0;
3913
3914
3915    /* missing type support */
3916    return(ret);
3917}
3918
3919
3920static int
3921test_xmlCleanupCharEncodingHandlers(void) {
3922    int ret = 0;
3923
3924
3925
3926        xmlCleanupCharEncodingHandlers();
3927        call_tests++;
3928        xmlResetLastError();
3929
3930    function_tests++;
3931    return(ret);
3932}
3933
3934
3935static int
3936test_xmlCleanupEncodingAliases(void) {
3937    int ret = 0;
3938
3939    int mem_base;
3940
3941        mem_base = xmlMemBlocks();
3942
3943        xmlCleanupEncodingAliases();
3944        call_tests++;
3945        xmlResetLastError();
3946        if (mem_base != xmlMemBlocks()) {
3947            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
3948	           xmlMemBlocks() - mem_base);
3949	    ret++;
3950            printf("\n");
3951        }
3952
3953    function_tests++;
3954    return(ret);
3955}
3956
3957
3958static int
3959test_xmlDelEncodingAlias(void) {
3960    int ret = 0;
3961
3962    int mem_base;
3963    int ret_val;
3964    const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
3965    int n_alias;
3966
3967    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
3968        mem_base = xmlMemBlocks();
3969        alias = gen_const_char_ptr(n_alias, 0);
3970
3971        ret_val = xmlDelEncodingAlias(alias);
3972        desret_int(ret_val);
3973        call_tests++;
3974        des_const_char_ptr(n_alias, alias, 0);
3975        xmlResetLastError();
3976        if (mem_base != xmlMemBlocks()) {
3977            printf("Leak of %d blocks found in xmlDelEncodingAlias",
3978	           xmlMemBlocks() - mem_base);
3979	    ret++;
3980            printf(" %d", n_alias);
3981            printf("\n");
3982        }
3983    }
3984
3985    function_tests++;
3986    return(ret);
3987}
3988
3989
3990static int
3991test_xmlDetectCharEncoding(void) {
3992    int ret = 0;
3993
3994
3995    /* missing type support */
3996    return(ret);
3997}
3998
3999
4000static int
4001test_xmlFindCharEncodingHandler(void) {
4002    int ret = 0;
4003
4004
4005    /* missing type support */
4006    return(ret);
4007}
4008
4009
4010static int
4011test_xmlGetCharEncodingHandler(void) {
4012    int ret = 0;
4013
4014
4015    /* missing type support */
4016    return(ret);
4017}
4018
4019
4020static int
4021test_xmlGetCharEncodingName(void) {
4022    int ret = 0;
4023
4024    int mem_base;
4025    const char * ret_val;
4026    xmlCharEncoding enc; /* the encoding */
4027    int n_enc;
4028
4029    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
4030        mem_base = xmlMemBlocks();
4031        enc = gen_xmlCharEncoding(n_enc, 0);
4032
4033        ret_val = xmlGetCharEncodingName(enc);
4034        desret_const_char_ptr(ret_val);
4035        call_tests++;
4036        des_xmlCharEncoding(n_enc, enc, 0);
4037        xmlResetLastError();
4038        if (mem_base != xmlMemBlocks()) {
4039            printf("Leak of %d blocks found in xmlGetCharEncodingName",
4040	           xmlMemBlocks() - mem_base);
4041	    ret++;
4042            printf(" %d", n_enc);
4043            printf("\n");
4044        }
4045    }
4046
4047    function_tests++;
4048    return(ret);
4049}
4050
4051
4052static int
4053test_xmlGetEncodingAlias(void) {
4054    int ret = 0;
4055
4056    int mem_base;
4057    const char * ret_val;
4058    const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
4059    int n_alias;
4060
4061    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
4062        mem_base = xmlMemBlocks();
4063        alias = gen_const_char_ptr(n_alias, 0);
4064
4065        ret_val = xmlGetEncodingAlias(alias);
4066        desret_const_char_ptr(ret_val);
4067        call_tests++;
4068        des_const_char_ptr(n_alias, alias, 0);
4069        xmlResetLastError();
4070        if (mem_base != xmlMemBlocks()) {
4071            printf("Leak of %d blocks found in xmlGetEncodingAlias",
4072	           xmlMemBlocks() - mem_base);
4073	    ret++;
4074            printf(" %d", n_alias);
4075            printf("\n");
4076        }
4077    }
4078
4079    function_tests++;
4080    return(ret);
4081}
4082
4083
4084static int
4085test_xmlInitCharEncodingHandlers(void) {
4086    int ret = 0;
4087
4088
4089
4090        xmlInitCharEncodingHandlers();
4091        call_tests++;
4092        xmlResetLastError();
4093
4094    function_tests++;
4095    return(ret);
4096}
4097
4098
4099static int
4100test_xmlNewCharEncodingHandler(void) {
4101    int ret = 0;
4102
4103
4104    /* missing type support */
4105    return(ret);
4106}
4107
4108
4109static int
4110test_xmlParseCharEncoding(void) {
4111    int ret = 0;
4112
4113    int mem_base;
4114    xmlCharEncoding ret_val;
4115    const char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
4116    int n_name;
4117
4118    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
4119        mem_base = xmlMemBlocks();
4120        name = gen_const_char_ptr(n_name, 0);
4121
4122        ret_val = xmlParseCharEncoding(name);
4123        desret_xmlCharEncoding(ret_val);
4124        call_tests++;
4125        des_const_char_ptr(n_name, name, 0);
4126        xmlResetLastError();
4127        if (mem_base != xmlMemBlocks()) {
4128            printf("Leak of %d blocks found in xmlParseCharEncoding",
4129	           xmlMemBlocks() - mem_base);
4130	    ret++;
4131            printf(" %d", n_name);
4132            printf("\n");
4133        }
4134    }
4135
4136    function_tests++;
4137    return(ret);
4138}
4139
4140
4141static int
4142test_xmlRegisterCharEncodingHandler(void) {
4143    int ret = 0;
4144
4145
4146    /* missing type support */
4147    return(ret);
4148}
4149
4150static int
4151test_encoding(void) {
4152    int ret = 0;
4153
4154    printf("Testing encoding : 8 of 19 functions ...\n");
4155    ret += test_UTF8Toisolat1();
4156    ret += test_isolat1ToUTF8();
4157    ret += test_xmlAddEncodingAlias();
4158    ret += test_xmlCharEncCloseFunc();
4159    ret += test_xmlCharEncFirstLine();
4160    ret += test_xmlCharEncInFunc();
4161    ret += test_xmlCharEncOutFunc();
4162    ret += test_xmlCleanupCharEncodingHandlers();
4163    ret += test_xmlCleanupEncodingAliases();
4164    ret += test_xmlDelEncodingAlias();
4165    ret += test_xmlDetectCharEncoding();
4166    ret += test_xmlFindCharEncodingHandler();
4167    ret += test_xmlGetCharEncodingHandler();
4168    ret += test_xmlGetCharEncodingName();
4169    ret += test_xmlGetEncodingAlias();
4170    ret += test_xmlInitCharEncodingHandlers();
4171    ret += test_xmlNewCharEncodingHandler();
4172    ret += test_xmlParseCharEncoding();
4173    ret += test_xmlRegisterCharEncodingHandler();
4174
4175    if (ret != 0)
4176	printf("Module encoding: %d errors\n", ret);
4177    return(ret);
4178}
4179
4180static int
4181test_xmlAddDocEntity(void) {
4182    int ret = 0;
4183
4184
4185    /* missing type support */
4186    return(ret);
4187}
4188
4189
4190static int
4191test_xmlAddDtdEntity(void) {
4192    int ret = 0;
4193
4194
4195    /* missing type support */
4196    return(ret);
4197}
4198
4199
4200static int
4201test_xmlCleanupPredefinedEntities(void) {
4202    int ret = 0;
4203
4204    int mem_base;
4205
4206        mem_base = xmlMemBlocks();
4207
4208        xmlCleanupPredefinedEntities();
4209        call_tests++;
4210        xmlResetLastError();
4211        if (mem_base != xmlMemBlocks()) {
4212            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
4213	           xmlMemBlocks() - mem_base);
4214	    ret++;
4215            printf("\n");
4216        }
4217
4218    function_tests++;
4219    return(ret);
4220}
4221
4222
4223static int
4224test_xmlCopyEntitiesTable(void) {
4225    int ret = 0;
4226
4227
4228    /* missing type support */
4229    return(ret);
4230}
4231
4232
4233static int
4234test_xmlCreateEntitiesTable(void) {
4235    int ret = 0;
4236
4237
4238    /* missing type support */
4239    return(ret);
4240}
4241
4242
4243static int
4244test_xmlDumpEntitiesTable(void) {
4245    int ret = 0;
4246
4247
4248    /* missing type support */
4249    return(ret);
4250}
4251
4252
4253static int
4254test_xmlDumpEntityDecl(void) {
4255    int ret = 0;
4256
4257
4258    /* missing type support */
4259    return(ret);
4260}
4261
4262
4263static int
4264test_xmlEncodeEntitiesReentrant(void) {
4265    int ret = 0;
4266
4267    int mem_base;
4268    xmlChar * ret_val;
4269    xmlDocPtr doc; /* the document containing the string */
4270    int n_doc;
4271    const xmlChar * input; /* A string to convert to XML. */
4272    int n_input;
4273
4274    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
4275    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
4276        mem_base = xmlMemBlocks();
4277        doc = gen_xmlDocPtr(n_doc, 0);
4278        input = gen_const_xmlChar_ptr(n_input, 1);
4279
4280        ret_val = xmlEncodeEntitiesReentrant(doc, input);
4281        desret_xmlChar_ptr(ret_val);
4282        call_tests++;
4283        des_xmlDocPtr(n_doc, doc, 0);
4284        des_const_xmlChar_ptr(n_input, input, 1);
4285        xmlResetLastError();
4286        if (mem_base != xmlMemBlocks()) {
4287            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
4288	           xmlMemBlocks() - mem_base);
4289	    ret++;
4290            printf(" %d", n_doc);
4291            printf(" %d", n_input);
4292            printf("\n");
4293        }
4294    }
4295    }
4296
4297    function_tests++;
4298    return(ret);
4299}
4300
4301
4302static int
4303test_xmlEncodeSpecialChars(void) {
4304    int ret = 0;
4305
4306    int mem_base;
4307    xmlChar * ret_val;
4308    xmlDocPtr doc; /* the document containing the string */
4309    int n_doc;
4310    const xmlChar * input; /* A string to convert to XML. */
4311    int n_input;
4312
4313    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
4314    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
4315        mem_base = xmlMemBlocks();
4316        doc = gen_xmlDocPtr(n_doc, 0);
4317        input = gen_const_xmlChar_ptr(n_input, 1);
4318
4319        ret_val = xmlEncodeSpecialChars(doc, input);
4320        desret_xmlChar_ptr(ret_val);
4321        call_tests++;
4322        des_xmlDocPtr(n_doc, doc, 0);
4323        des_const_xmlChar_ptr(n_input, input, 1);
4324        xmlResetLastError();
4325        if (mem_base != xmlMemBlocks()) {
4326            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
4327	           xmlMemBlocks() - mem_base);
4328	    ret++;
4329            printf(" %d", n_doc);
4330            printf(" %d", n_input);
4331            printf("\n");
4332        }
4333    }
4334    }
4335
4336    function_tests++;
4337    return(ret);
4338}
4339
4340
4341static int
4342test_xmlGetDocEntity(void) {
4343    int ret = 0;
4344
4345
4346    /* missing type support */
4347    return(ret);
4348}
4349
4350
4351static int
4352test_xmlGetDtdEntity(void) {
4353    int ret = 0;
4354
4355
4356    /* missing type support */
4357    return(ret);
4358}
4359
4360
4361static int
4362test_xmlGetParameterEntity(void) {
4363    int ret = 0;
4364
4365
4366    /* missing type support */
4367    return(ret);
4368}
4369
4370
4371static int
4372test_xmlGetPredefinedEntity(void) {
4373    int ret = 0;
4374
4375
4376    /* missing type support */
4377    return(ret);
4378}
4379
4380
4381static int
4382test_xmlInitializePredefinedEntities(void) {
4383    int ret = 0;
4384
4385    int mem_base;
4386
4387        mem_base = xmlMemBlocks();
4388
4389        xmlInitializePredefinedEntities();
4390        call_tests++;
4391        xmlResetLastError();
4392        if (mem_base != xmlMemBlocks()) {
4393            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
4394	           xmlMemBlocks() - mem_base);
4395	    ret++;
4396            printf("\n");
4397        }
4398
4399    function_tests++;
4400    return(ret);
4401}
4402
4403static int
4404test_entities(void) {
4405    int ret = 0;
4406
4407    printf("Testing entities : 4 of 16 functions ...\n");
4408    ret += test_xmlAddDocEntity();
4409    ret += test_xmlAddDtdEntity();
4410    ret += test_xmlCleanupPredefinedEntities();
4411    ret += test_xmlCopyEntitiesTable();
4412    ret += test_xmlCreateEntitiesTable();
4413    ret += test_xmlDumpEntitiesTable();
4414    ret += test_xmlDumpEntityDecl();
4415    ret += test_xmlEncodeEntitiesReentrant();
4416    ret += test_xmlEncodeSpecialChars();
4417    ret += test_xmlGetDocEntity();
4418    ret += test_xmlGetDtdEntity();
4419    ret += test_xmlGetParameterEntity();
4420    ret += test_xmlGetPredefinedEntity();
4421    ret += test_xmlInitializePredefinedEntities();
4422
4423    if (ret != 0)
4424	printf("Module entities: %d errors\n", ret);
4425    return(ret);
4426}
4427
4428static int
4429test_xmlHashAddEntry(void) {
4430    int ret = 0;
4431
4432    int mem_base;
4433    int ret_val;
4434    xmlHashTablePtr table; /* the hash table */
4435    int n_table;
4436    const xmlChar * name; /* the name of the userdata */
4437    int n_name;
4438    void * userdata; /* a pointer to the userdata */
4439    int n_userdata;
4440
4441    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4442    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4443    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
4444        mem_base = xmlMemBlocks();
4445        table = gen_xmlHashTablePtr(n_table, 0);
4446        name = gen_const_xmlChar_ptr(n_name, 1);
4447        userdata = gen_userdata(n_userdata, 2);
4448
4449        ret_val = xmlHashAddEntry(table, name, userdata);
4450        desret_int(ret_val);
4451        call_tests++;
4452        des_xmlHashTablePtr(n_table, table, 0);
4453        des_const_xmlChar_ptr(n_name, name, 1);
4454        des_userdata(n_userdata, userdata, 2);
4455        xmlResetLastError();
4456        if (mem_base != xmlMemBlocks()) {
4457            printf("Leak of %d blocks found in xmlHashAddEntry",
4458	           xmlMemBlocks() - mem_base);
4459	    ret++;
4460            printf(" %d", n_table);
4461            printf(" %d", n_name);
4462            printf(" %d", n_userdata);
4463            printf("\n");
4464        }
4465    }
4466    }
4467    }
4468
4469    function_tests++;
4470    return(ret);
4471}
4472
4473
4474static int
4475test_xmlHashAddEntry2(void) {
4476    int ret = 0;
4477
4478    int mem_base;
4479    int ret_val;
4480    xmlHashTablePtr table; /* the hash table */
4481    int n_table;
4482    const xmlChar * name; /* the name of the userdata */
4483    int n_name;
4484    const xmlChar * name2; /* a second name of the userdata */
4485    int n_name2;
4486    void * userdata; /* a pointer to the userdata */
4487    int n_userdata;
4488
4489    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4490    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4491    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
4492    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
4493        mem_base = xmlMemBlocks();
4494        table = gen_xmlHashTablePtr(n_table, 0);
4495        name = gen_const_xmlChar_ptr(n_name, 1);
4496        name2 = gen_const_xmlChar_ptr(n_name2, 2);
4497        userdata = gen_userdata(n_userdata, 3);
4498
4499        ret_val = xmlHashAddEntry2(table, name, name2, userdata);
4500        desret_int(ret_val);
4501        call_tests++;
4502        des_xmlHashTablePtr(n_table, table, 0);
4503        des_const_xmlChar_ptr(n_name, name, 1);
4504        des_const_xmlChar_ptr(n_name2, name2, 2);
4505        des_userdata(n_userdata, userdata, 3);
4506        xmlResetLastError();
4507        if (mem_base != xmlMemBlocks()) {
4508            printf("Leak of %d blocks found in xmlHashAddEntry2",
4509	           xmlMemBlocks() - mem_base);
4510	    ret++;
4511            printf(" %d", n_table);
4512            printf(" %d", n_name);
4513            printf(" %d", n_name2);
4514            printf(" %d", n_userdata);
4515            printf("\n");
4516        }
4517    }
4518    }
4519    }
4520    }
4521
4522    function_tests++;
4523    return(ret);
4524}
4525
4526
4527static int
4528test_xmlHashAddEntry3(void) {
4529    int ret = 0;
4530
4531    int mem_base;
4532    int ret_val;
4533    xmlHashTablePtr table; /* the hash table */
4534    int n_table;
4535    const xmlChar * name; /* the name of the userdata */
4536    int n_name;
4537    const xmlChar * name2; /* a second name of the userdata */
4538    int n_name2;
4539    const xmlChar * name3; /* a third name of the userdata */
4540    int n_name3;
4541    void * userdata; /* a pointer to the userdata */
4542    int n_userdata;
4543
4544    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4545    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4546    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
4547    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
4548    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
4549        mem_base = xmlMemBlocks();
4550        table = gen_xmlHashTablePtr(n_table, 0);
4551        name = gen_const_xmlChar_ptr(n_name, 1);
4552        name2 = gen_const_xmlChar_ptr(n_name2, 2);
4553        name3 = gen_const_xmlChar_ptr(n_name3, 3);
4554        userdata = gen_userdata(n_userdata, 4);
4555
4556        ret_val = xmlHashAddEntry3(table, name, name2, name3, userdata);
4557        desret_int(ret_val);
4558        call_tests++;
4559        des_xmlHashTablePtr(n_table, table, 0);
4560        des_const_xmlChar_ptr(n_name, name, 1);
4561        des_const_xmlChar_ptr(n_name2, name2, 2);
4562        des_const_xmlChar_ptr(n_name3, name3, 3);
4563        des_userdata(n_userdata, userdata, 4);
4564        xmlResetLastError();
4565        if (mem_base != xmlMemBlocks()) {
4566            printf("Leak of %d blocks found in xmlHashAddEntry3",
4567	           xmlMemBlocks() - mem_base);
4568	    ret++;
4569            printf(" %d", n_table);
4570            printf(" %d", n_name);
4571            printf(" %d", n_name2);
4572            printf(" %d", n_name3);
4573            printf(" %d", n_userdata);
4574            printf("\n");
4575        }
4576    }
4577    }
4578    }
4579    }
4580    }
4581
4582    function_tests++;
4583    return(ret);
4584}
4585
4586
4587static int
4588test_xmlHashCopy(void) {
4589    int ret = 0;
4590
4591
4592    /* missing type support */
4593    return(ret);
4594}
4595
4596
4597static int
4598test_xmlHashCreate(void) {
4599    int ret = 0;
4600
4601
4602    /* missing type support */
4603    return(ret);
4604}
4605
4606
4607static int
4608test_xmlHashLookup(void) {
4609    int ret = 0;
4610
4611    int mem_base;
4612    void * ret_val;
4613    xmlHashTablePtr table; /* the hash table */
4614    int n_table;
4615    const xmlChar * name; /* the name of the userdata */
4616    int n_name;
4617
4618    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4619    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4620        mem_base = xmlMemBlocks();
4621        table = gen_xmlHashTablePtr(n_table, 0);
4622        name = gen_const_xmlChar_ptr(n_name, 1);
4623
4624        ret_val = xmlHashLookup(table, name);
4625        desret_void_ptr(ret_val);
4626        call_tests++;
4627        des_xmlHashTablePtr(n_table, table, 0);
4628        des_const_xmlChar_ptr(n_name, name, 1);
4629        xmlResetLastError();
4630        if (mem_base != xmlMemBlocks()) {
4631            printf("Leak of %d blocks found in xmlHashLookup",
4632	           xmlMemBlocks() - mem_base);
4633	    ret++;
4634            printf(" %d", n_table);
4635            printf(" %d", n_name);
4636            printf("\n");
4637        }
4638    }
4639    }
4640
4641    function_tests++;
4642    return(ret);
4643}
4644
4645
4646static int
4647test_xmlHashLookup2(void) {
4648    int ret = 0;
4649
4650    int mem_base;
4651    void * ret_val;
4652    xmlHashTablePtr table; /* the hash table */
4653    int n_table;
4654    const xmlChar * name; /* the name of the userdata */
4655    int n_name;
4656    const xmlChar * name2; /* a second name of the userdata */
4657    int n_name2;
4658
4659    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4660    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4661    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
4662        mem_base = xmlMemBlocks();
4663        table = gen_xmlHashTablePtr(n_table, 0);
4664        name = gen_const_xmlChar_ptr(n_name, 1);
4665        name2 = gen_const_xmlChar_ptr(n_name2, 2);
4666
4667        ret_val = xmlHashLookup2(table, name, name2);
4668        desret_void_ptr(ret_val);
4669        call_tests++;
4670        des_xmlHashTablePtr(n_table, table, 0);
4671        des_const_xmlChar_ptr(n_name, name, 1);
4672        des_const_xmlChar_ptr(n_name2, name2, 2);
4673        xmlResetLastError();
4674        if (mem_base != xmlMemBlocks()) {
4675            printf("Leak of %d blocks found in xmlHashLookup2",
4676	           xmlMemBlocks() - mem_base);
4677	    ret++;
4678            printf(" %d", n_table);
4679            printf(" %d", n_name);
4680            printf(" %d", n_name2);
4681            printf("\n");
4682        }
4683    }
4684    }
4685    }
4686
4687    function_tests++;
4688    return(ret);
4689}
4690
4691
4692static int
4693test_xmlHashLookup3(void) {
4694    int ret = 0;
4695
4696    int mem_base;
4697    void * ret_val;
4698    xmlHashTablePtr table; /* the hash table */
4699    int n_table;
4700    const xmlChar * name; /* the name of the userdata */
4701    int n_name;
4702    const xmlChar * name2; /* a second name of the userdata */
4703    int n_name2;
4704    const xmlChar * name3; /* a third name of the userdata */
4705    int n_name3;
4706
4707    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4708    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4709    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
4710    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
4711        mem_base = xmlMemBlocks();
4712        table = gen_xmlHashTablePtr(n_table, 0);
4713        name = gen_const_xmlChar_ptr(n_name, 1);
4714        name2 = gen_const_xmlChar_ptr(n_name2, 2);
4715        name3 = gen_const_xmlChar_ptr(n_name3, 3);
4716
4717        ret_val = xmlHashLookup3(table, name, name2, name3);
4718        desret_void_ptr(ret_val);
4719        call_tests++;
4720        des_xmlHashTablePtr(n_table, table, 0);
4721        des_const_xmlChar_ptr(n_name, name, 1);
4722        des_const_xmlChar_ptr(n_name2, name2, 2);
4723        des_const_xmlChar_ptr(n_name3, name3, 3);
4724        xmlResetLastError();
4725        if (mem_base != xmlMemBlocks()) {
4726            printf("Leak of %d blocks found in xmlHashLookup3",
4727	           xmlMemBlocks() - mem_base);
4728	    ret++;
4729            printf(" %d", n_table);
4730            printf(" %d", n_name);
4731            printf(" %d", n_name2);
4732            printf(" %d", n_name3);
4733            printf("\n");
4734        }
4735    }
4736    }
4737    }
4738    }
4739
4740    function_tests++;
4741    return(ret);
4742}
4743
4744
4745static int
4746test_xmlHashQLookup(void) {
4747    int ret = 0;
4748
4749    int mem_base;
4750    void * ret_val;
4751    xmlHashTablePtr table; /* the hash table */
4752    int n_table;
4753    const xmlChar * prefix; /* the prefix of the userdata */
4754    int n_prefix;
4755    const xmlChar * name; /* the name of the userdata */
4756    int n_name;
4757
4758    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4759    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4760    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4761        mem_base = xmlMemBlocks();
4762        table = gen_xmlHashTablePtr(n_table, 0);
4763        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
4764        name = gen_const_xmlChar_ptr(n_name, 2);
4765
4766        ret_val = xmlHashQLookup(table, prefix, name);
4767        desret_void_ptr(ret_val);
4768        call_tests++;
4769        des_xmlHashTablePtr(n_table, table, 0);
4770        des_const_xmlChar_ptr(n_prefix, prefix, 1);
4771        des_const_xmlChar_ptr(n_name, name, 2);
4772        xmlResetLastError();
4773        if (mem_base != xmlMemBlocks()) {
4774            printf("Leak of %d blocks found in xmlHashQLookup",
4775	           xmlMemBlocks() - mem_base);
4776	    ret++;
4777            printf(" %d", n_table);
4778            printf(" %d", n_prefix);
4779            printf(" %d", n_name);
4780            printf("\n");
4781        }
4782    }
4783    }
4784    }
4785
4786    function_tests++;
4787    return(ret);
4788}
4789
4790
4791static int
4792test_xmlHashQLookup2(void) {
4793    int ret = 0;
4794
4795    int mem_base;
4796    void * ret_val;
4797    xmlHashTablePtr table; /* the hash table */
4798    int n_table;
4799    const xmlChar * prefix; /* the prefix of the userdata */
4800    int n_prefix;
4801    const xmlChar * name; /* the name of the userdata */
4802    int n_name;
4803    const xmlChar * prefix2; /* the second prefix of the userdata */
4804    int n_prefix2;
4805    const xmlChar * name2; /* a second name of the userdata */
4806    int n_name2;
4807
4808    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4809    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4810    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4811    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
4812    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
4813        mem_base = xmlMemBlocks();
4814        table = gen_xmlHashTablePtr(n_table, 0);
4815        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
4816        name = gen_const_xmlChar_ptr(n_name, 2);
4817        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
4818        name2 = gen_const_xmlChar_ptr(n_name2, 4);
4819
4820        ret_val = xmlHashQLookup2(table, prefix, name, prefix2, name2);
4821        desret_void_ptr(ret_val);
4822        call_tests++;
4823        des_xmlHashTablePtr(n_table, table, 0);
4824        des_const_xmlChar_ptr(n_prefix, prefix, 1);
4825        des_const_xmlChar_ptr(n_name, name, 2);
4826        des_const_xmlChar_ptr(n_prefix2, prefix2, 3);
4827        des_const_xmlChar_ptr(n_name2, name2, 4);
4828        xmlResetLastError();
4829        if (mem_base != xmlMemBlocks()) {
4830            printf("Leak of %d blocks found in xmlHashQLookup2",
4831	           xmlMemBlocks() - mem_base);
4832	    ret++;
4833            printf(" %d", n_table);
4834            printf(" %d", n_prefix);
4835            printf(" %d", n_name);
4836            printf(" %d", n_prefix2);
4837            printf(" %d", n_name2);
4838            printf("\n");
4839        }
4840    }
4841    }
4842    }
4843    }
4844    }
4845
4846    function_tests++;
4847    return(ret);
4848}
4849
4850
4851static int
4852test_xmlHashQLookup3(void) {
4853    int ret = 0;
4854
4855    int mem_base;
4856    void * ret_val;
4857    xmlHashTablePtr table; /* the hash table */
4858    int n_table;
4859    const xmlChar * prefix; /* the prefix of the userdata */
4860    int n_prefix;
4861    const xmlChar * name; /* the name of the userdata */
4862    int n_name;
4863    const xmlChar * prefix2; /* the second prefix of the userdata */
4864    int n_prefix2;
4865    const xmlChar * name2; /* a second name of the userdata */
4866    int n_name2;
4867    const xmlChar * prefix3; /* the third prefix of the userdata */
4868    int n_prefix3;
4869    const xmlChar * name3; /* a third name of the userdata */
4870    int n_name3;
4871
4872    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
4873    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4874    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4875    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
4876    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
4877    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
4878    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
4879        mem_base = xmlMemBlocks();
4880        table = gen_xmlHashTablePtr(n_table, 0);
4881        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
4882        name = gen_const_xmlChar_ptr(n_name, 2);
4883        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
4884        name2 = gen_const_xmlChar_ptr(n_name2, 4);
4885        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
4886        name3 = gen_const_xmlChar_ptr(n_name3, 6);
4887
4888        ret_val = xmlHashQLookup3(table, prefix, name, prefix2, name2, prefix3, name3);
4889        desret_void_ptr(ret_val);
4890        call_tests++;
4891        des_xmlHashTablePtr(n_table, table, 0);
4892        des_const_xmlChar_ptr(n_prefix, prefix, 1);
4893        des_const_xmlChar_ptr(n_name, name, 2);
4894        des_const_xmlChar_ptr(n_prefix2, prefix2, 3);
4895        des_const_xmlChar_ptr(n_name2, name2, 4);
4896        des_const_xmlChar_ptr(n_prefix3, prefix3, 5);
4897        des_const_xmlChar_ptr(n_name3, name3, 6);
4898        xmlResetLastError();
4899        if (mem_base != xmlMemBlocks()) {
4900            printf("Leak of %d blocks found in xmlHashQLookup3",
4901	           xmlMemBlocks() - mem_base);
4902	    ret++;
4903            printf(" %d", n_table);
4904            printf(" %d", n_prefix);
4905            printf(" %d", n_name);
4906            printf(" %d", n_prefix2);
4907            printf(" %d", n_name2);
4908            printf(" %d", n_prefix3);
4909            printf(" %d", n_name3);
4910            printf("\n");
4911        }
4912    }
4913    }
4914    }
4915    }
4916    }
4917    }
4918    }
4919
4920    function_tests++;
4921    return(ret);
4922}
4923
4924
4925static int
4926test_xmlHashRemoveEntry(void) {
4927    int ret = 0;
4928
4929
4930    /* missing type support */
4931    return(ret);
4932}
4933
4934
4935static int
4936test_xmlHashRemoveEntry2(void) {
4937    int ret = 0;
4938
4939
4940    /* missing type support */
4941    return(ret);
4942}
4943
4944
4945static int
4946test_xmlHashRemoveEntry3(void) {
4947    int ret = 0;
4948
4949
4950    /* missing type support */
4951    return(ret);
4952}
4953
4954
4955static int
4956test_xmlHashScan(void) {
4957    int ret = 0;
4958
4959
4960    /* missing type support */
4961    return(ret);
4962}
4963
4964
4965static int
4966test_xmlHashScan3(void) {
4967    int ret = 0;
4968
4969
4970    /* missing type support */
4971    return(ret);
4972}
4973
4974
4975static int
4976test_xmlHashScanFull(void) {
4977    int ret = 0;
4978
4979
4980    /* missing type support */
4981    return(ret);
4982}
4983
4984
4985static int
4986test_xmlHashScanFull3(void) {
4987    int ret = 0;
4988
4989
4990    /* missing type support */
4991    return(ret);
4992}
4993
4994
4995static int
4996test_xmlHashSize(void) {
4997    int ret = 0;
4998
4999    int mem_base;
5000    int ret_val;
5001    xmlHashTablePtr table; /* the hash table */
5002    int n_table;
5003
5004    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
5005        mem_base = xmlMemBlocks();
5006        table = gen_xmlHashTablePtr(n_table, 0);
5007
5008        ret_val = xmlHashSize(table);
5009        desret_int(ret_val);
5010        call_tests++;
5011        des_xmlHashTablePtr(n_table, table, 0);
5012        xmlResetLastError();
5013        if (mem_base != xmlMemBlocks()) {
5014            printf("Leak of %d blocks found in xmlHashSize",
5015	           xmlMemBlocks() - mem_base);
5016	    ret++;
5017            printf(" %d", n_table);
5018            printf("\n");
5019        }
5020    }
5021
5022    function_tests++;
5023    return(ret);
5024}
5025
5026
5027static int
5028test_xmlHashUpdateEntry(void) {
5029    int ret = 0;
5030
5031
5032    /* missing type support */
5033    return(ret);
5034}
5035
5036
5037static int
5038test_xmlHashUpdateEntry2(void) {
5039    int ret = 0;
5040
5041
5042    /* missing type support */
5043    return(ret);
5044}
5045
5046
5047static int
5048test_xmlHashUpdateEntry3(void) {
5049    int ret = 0;
5050
5051
5052    /* missing type support */
5053    return(ret);
5054}
5055
5056static int
5057test_hash(void) {
5058    int ret = 0;
5059
5060    printf("Testing hash : 10 of 23 functions ...\n");
5061    ret += test_xmlHashAddEntry();
5062    ret += test_xmlHashAddEntry2();
5063    ret += test_xmlHashAddEntry3();
5064    ret += test_xmlHashCopy();
5065    ret += test_xmlHashCreate();
5066    ret += test_xmlHashLookup();
5067    ret += test_xmlHashLookup2();
5068    ret += test_xmlHashLookup3();
5069    ret += test_xmlHashQLookup();
5070    ret += test_xmlHashQLookup2();
5071    ret += test_xmlHashQLookup3();
5072    ret += test_xmlHashRemoveEntry();
5073    ret += test_xmlHashRemoveEntry2();
5074    ret += test_xmlHashRemoveEntry3();
5075    ret += test_xmlHashScan();
5076    ret += test_xmlHashScan3();
5077    ret += test_xmlHashScanFull();
5078    ret += test_xmlHashScanFull3();
5079    ret += test_xmlHashSize();
5080    ret += test_xmlHashUpdateEntry();
5081    ret += test_xmlHashUpdateEntry2();
5082    ret += test_xmlHashUpdateEntry3();
5083
5084    if (ret != 0)
5085	printf("Module hash: %d errors\n", ret);
5086    return(ret);
5087}
5088
5089static int
5090test_xmlLinkGetData(void) {
5091    int ret = 0;
5092
5093
5094    /* missing type support */
5095    return(ret);
5096}
5097
5098
5099static int
5100test_xmlListAppend(void) {
5101    int ret = 0;
5102
5103    int mem_base;
5104    int ret_val;
5105    xmlListPtr l; /* a list */
5106    int n_l;
5107    void * data; /* the data */
5108    int n_data;
5109
5110    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5111    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5112        mem_base = xmlMemBlocks();
5113        l = gen_xmlListPtr(n_l, 0);
5114        data = gen_userdata(n_data, 1);
5115
5116        ret_val = xmlListAppend(l, data);
5117        desret_int(ret_val);
5118        call_tests++;
5119        des_xmlListPtr(n_l, l, 0);
5120        des_userdata(n_data, data, 1);
5121        xmlResetLastError();
5122        if (mem_base != xmlMemBlocks()) {
5123            printf("Leak of %d blocks found in xmlListAppend",
5124	           xmlMemBlocks() - mem_base);
5125	    ret++;
5126            printf(" %d", n_l);
5127            printf(" %d", n_data);
5128            printf("\n");
5129        }
5130    }
5131    }
5132
5133    function_tests++;
5134    return(ret);
5135}
5136
5137
5138static int
5139test_xmlListClear(void) {
5140    int ret = 0;
5141
5142    int mem_base;
5143    xmlListPtr l; /* a list */
5144    int n_l;
5145
5146    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5147        mem_base = xmlMemBlocks();
5148        l = gen_xmlListPtr(n_l, 0);
5149
5150        xmlListClear(l);
5151        call_tests++;
5152        des_xmlListPtr(n_l, l, 0);
5153        xmlResetLastError();
5154        if (mem_base != xmlMemBlocks()) {
5155            printf("Leak of %d blocks found in xmlListClear",
5156	           xmlMemBlocks() - mem_base);
5157	    ret++;
5158            printf(" %d", n_l);
5159            printf("\n");
5160        }
5161    }
5162
5163    function_tests++;
5164    return(ret);
5165}
5166
5167
5168static int
5169test_xmlListCopy(void) {
5170    int ret = 0;
5171
5172
5173    /* missing type support */
5174    return(ret);
5175}
5176
5177
5178static int
5179test_xmlListCreate(void) {
5180    int ret = 0;
5181
5182
5183    /* missing type support */
5184    return(ret);
5185}
5186
5187
5188static int
5189test_xmlListDup(void) {
5190    int ret = 0;
5191
5192
5193    /* missing type support */
5194    return(ret);
5195}
5196
5197
5198static int
5199test_xmlListEmpty(void) {
5200    int ret = 0;
5201
5202    int mem_base;
5203    int ret_val;
5204    xmlListPtr l; /* a list */
5205    int n_l;
5206
5207    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5208        mem_base = xmlMemBlocks();
5209        l = gen_xmlListPtr(n_l, 0);
5210
5211        ret_val = xmlListEmpty(l);
5212        desret_int(ret_val);
5213        call_tests++;
5214        des_xmlListPtr(n_l, l, 0);
5215        xmlResetLastError();
5216        if (mem_base != xmlMemBlocks()) {
5217            printf("Leak of %d blocks found in xmlListEmpty",
5218	           xmlMemBlocks() - mem_base);
5219	    ret++;
5220            printf(" %d", n_l);
5221            printf("\n");
5222        }
5223    }
5224
5225    function_tests++;
5226    return(ret);
5227}
5228
5229
5230static int
5231test_xmlListEnd(void) {
5232    int ret = 0;
5233
5234
5235    /* missing type support */
5236    return(ret);
5237}
5238
5239
5240static int
5241test_xmlListFront(void) {
5242    int ret = 0;
5243
5244
5245    /* missing type support */
5246    return(ret);
5247}
5248
5249
5250static int
5251test_xmlListInsert(void) {
5252    int ret = 0;
5253
5254    int mem_base;
5255    int ret_val;
5256    xmlListPtr l; /* a list */
5257    int n_l;
5258    void * data; /* the data */
5259    int n_data;
5260
5261    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5262    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5263        mem_base = xmlMemBlocks();
5264        l = gen_xmlListPtr(n_l, 0);
5265        data = gen_userdata(n_data, 1);
5266
5267        ret_val = xmlListInsert(l, data);
5268        desret_int(ret_val);
5269        call_tests++;
5270        des_xmlListPtr(n_l, l, 0);
5271        des_userdata(n_data, data, 1);
5272        xmlResetLastError();
5273        if (mem_base != xmlMemBlocks()) {
5274            printf("Leak of %d blocks found in xmlListInsert",
5275	           xmlMemBlocks() - mem_base);
5276	    ret++;
5277            printf(" %d", n_l);
5278            printf(" %d", n_data);
5279            printf("\n");
5280        }
5281    }
5282    }
5283
5284    function_tests++;
5285    return(ret);
5286}
5287
5288
5289static int
5290test_xmlListMerge(void) {
5291    int ret = 0;
5292
5293    int mem_base;
5294    xmlListPtr l1; /* the original list */
5295    int n_l1;
5296    xmlListPtr l2; /* the new list */
5297    int n_l2;
5298
5299    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
5300    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
5301        mem_base = xmlMemBlocks();
5302        l1 = gen_xmlListPtr(n_l1, 0);
5303        l2 = gen_xmlListPtr(n_l2, 1);
5304
5305        xmlListMerge(l1, l2);
5306        call_tests++;
5307        des_xmlListPtr(n_l1, l1, 0);
5308        des_xmlListPtr(n_l2, l2, 1);
5309        xmlResetLastError();
5310        if (mem_base != xmlMemBlocks()) {
5311            printf("Leak of %d blocks found in xmlListMerge",
5312	           xmlMemBlocks() - mem_base);
5313	    ret++;
5314            printf(" %d", n_l1);
5315            printf(" %d", n_l2);
5316            printf("\n");
5317        }
5318    }
5319    }
5320
5321    function_tests++;
5322    return(ret);
5323}
5324
5325
5326static int
5327test_xmlListPopBack(void) {
5328    int ret = 0;
5329
5330    int mem_base;
5331    xmlListPtr l; /* a list */
5332    int n_l;
5333
5334    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5335        mem_base = xmlMemBlocks();
5336        l = gen_xmlListPtr(n_l, 0);
5337
5338        xmlListPopBack(l);
5339        call_tests++;
5340        des_xmlListPtr(n_l, l, 0);
5341        xmlResetLastError();
5342        if (mem_base != xmlMemBlocks()) {
5343            printf("Leak of %d blocks found in xmlListPopBack",
5344	           xmlMemBlocks() - mem_base);
5345	    ret++;
5346            printf(" %d", n_l);
5347            printf("\n");
5348        }
5349    }
5350
5351    function_tests++;
5352    return(ret);
5353}
5354
5355
5356static int
5357test_xmlListPopFront(void) {
5358    int ret = 0;
5359
5360    int mem_base;
5361    xmlListPtr l; /* a list */
5362    int n_l;
5363
5364    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5365        mem_base = xmlMemBlocks();
5366        l = gen_xmlListPtr(n_l, 0);
5367
5368        xmlListPopFront(l);
5369        call_tests++;
5370        des_xmlListPtr(n_l, l, 0);
5371        xmlResetLastError();
5372        if (mem_base != xmlMemBlocks()) {
5373            printf("Leak of %d blocks found in xmlListPopFront",
5374	           xmlMemBlocks() - mem_base);
5375	    ret++;
5376            printf(" %d", n_l);
5377            printf("\n");
5378        }
5379    }
5380
5381    function_tests++;
5382    return(ret);
5383}
5384
5385
5386static int
5387test_xmlListPushBack(void) {
5388    int ret = 0;
5389
5390    int mem_base;
5391    int ret_val;
5392    xmlListPtr l; /* a list */
5393    int n_l;
5394    void * data; /* new data */
5395    int n_data;
5396
5397    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5398    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5399        mem_base = xmlMemBlocks();
5400        l = gen_xmlListPtr(n_l, 0);
5401        data = gen_userdata(n_data, 1);
5402
5403        ret_val = xmlListPushBack(l, data);
5404        desret_int(ret_val);
5405        call_tests++;
5406        des_xmlListPtr(n_l, l, 0);
5407        des_userdata(n_data, data, 1);
5408        xmlResetLastError();
5409        if (mem_base != xmlMemBlocks()) {
5410            printf("Leak of %d blocks found in xmlListPushBack",
5411	           xmlMemBlocks() - mem_base);
5412	    ret++;
5413            printf(" %d", n_l);
5414            printf(" %d", n_data);
5415            printf("\n");
5416        }
5417    }
5418    }
5419
5420    function_tests++;
5421    return(ret);
5422}
5423
5424
5425static int
5426test_xmlListPushFront(void) {
5427    int ret = 0;
5428
5429    int mem_base;
5430    int ret_val;
5431    xmlListPtr l; /* a list */
5432    int n_l;
5433    void * data; /* new data */
5434    int n_data;
5435
5436    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5437    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5438        mem_base = xmlMemBlocks();
5439        l = gen_xmlListPtr(n_l, 0);
5440        data = gen_userdata(n_data, 1);
5441
5442        ret_val = xmlListPushFront(l, data);
5443        desret_int(ret_val);
5444        call_tests++;
5445        des_xmlListPtr(n_l, l, 0);
5446        des_userdata(n_data, data, 1);
5447        xmlResetLastError();
5448        if (mem_base != xmlMemBlocks()) {
5449            printf("Leak of %d blocks found in xmlListPushFront",
5450	           xmlMemBlocks() - mem_base);
5451	    ret++;
5452            printf(" %d", n_l);
5453            printf(" %d", n_data);
5454            printf("\n");
5455        }
5456    }
5457    }
5458
5459    function_tests++;
5460    return(ret);
5461}
5462
5463
5464static int
5465test_xmlListRemoveAll(void) {
5466    int ret = 0;
5467
5468    int mem_base;
5469    int ret_val;
5470    xmlListPtr l; /* a list */
5471    int n_l;
5472    void * data; /* list data */
5473    int n_data;
5474
5475    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5476    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5477        mem_base = xmlMemBlocks();
5478        l = gen_xmlListPtr(n_l, 0);
5479        data = gen_userdata(n_data, 1);
5480
5481        ret_val = xmlListRemoveAll(l, data);
5482        desret_int(ret_val);
5483        call_tests++;
5484        des_xmlListPtr(n_l, l, 0);
5485        des_userdata(n_data, data, 1);
5486        xmlResetLastError();
5487        if (mem_base != xmlMemBlocks()) {
5488            printf("Leak of %d blocks found in xmlListRemoveAll",
5489	           xmlMemBlocks() - mem_base);
5490	    ret++;
5491            printf(" %d", n_l);
5492            printf(" %d", n_data);
5493            printf("\n");
5494        }
5495    }
5496    }
5497
5498    function_tests++;
5499    return(ret);
5500}
5501
5502
5503static int
5504test_xmlListRemoveFirst(void) {
5505    int ret = 0;
5506
5507    int mem_base;
5508    int ret_val;
5509    xmlListPtr l; /* a list */
5510    int n_l;
5511    void * data; /* list data */
5512    int n_data;
5513
5514    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5515    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5516        mem_base = xmlMemBlocks();
5517        l = gen_xmlListPtr(n_l, 0);
5518        data = gen_userdata(n_data, 1);
5519
5520        ret_val = xmlListRemoveFirst(l, data);
5521        desret_int(ret_val);
5522        call_tests++;
5523        des_xmlListPtr(n_l, l, 0);
5524        des_userdata(n_data, data, 1);
5525        xmlResetLastError();
5526        if (mem_base != xmlMemBlocks()) {
5527            printf("Leak of %d blocks found in xmlListRemoveFirst",
5528	           xmlMemBlocks() - mem_base);
5529	    ret++;
5530            printf(" %d", n_l);
5531            printf(" %d", n_data);
5532            printf("\n");
5533        }
5534    }
5535    }
5536
5537    function_tests++;
5538    return(ret);
5539}
5540
5541
5542static int
5543test_xmlListRemoveLast(void) {
5544    int ret = 0;
5545
5546    int mem_base;
5547    int ret_val;
5548    xmlListPtr l; /* a list */
5549    int n_l;
5550    void * data; /* list data */
5551    int n_data;
5552
5553    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5554    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5555        mem_base = xmlMemBlocks();
5556        l = gen_xmlListPtr(n_l, 0);
5557        data = gen_userdata(n_data, 1);
5558
5559        ret_val = xmlListRemoveLast(l, data);
5560        desret_int(ret_val);
5561        call_tests++;
5562        des_xmlListPtr(n_l, l, 0);
5563        des_userdata(n_data, data, 1);
5564        xmlResetLastError();
5565        if (mem_base != xmlMemBlocks()) {
5566            printf("Leak of %d blocks found in xmlListRemoveLast",
5567	           xmlMemBlocks() - mem_base);
5568	    ret++;
5569            printf(" %d", n_l);
5570            printf(" %d", n_data);
5571            printf("\n");
5572        }
5573    }
5574    }
5575
5576    function_tests++;
5577    return(ret);
5578}
5579
5580
5581static int
5582test_xmlListReverse(void) {
5583    int ret = 0;
5584
5585    int mem_base;
5586    xmlListPtr l; /* a list */
5587    int n_l;
5588
5589    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5590        mem_base = xmlMemBlocks();
5591        l = gen_xmlListPtr(n_l, 0);
5592
5593        xmlListReverse(l);
5594        call_tests++;
5595        des_xmlListPtr(n_l, l, 0);
5596        xmlResetLastError();
5597        if (mem_base != xmlMemBlocks()) {
5598            printf("Leak of %d blocks found in xmlListReverse",
5599	           xmlMemBlocks() - mem_base);
5600	    ret++;
5601            printf(" %d", n_l);
5602            printf("\n");
5603        }
5604    }
5605
5606    function_tests++;
5607    return(ret);
5608}
5609
5610
5611static int
5612test_xmlListReverseSearch(void) {
5613    int ret = 0;
5614
5615    int mem_base;
5616    void * ret_val;
5617    xmlListPtr l; /* a list */
5618    int n_l;
5619    void * data; /* a search value */
5620    int n_data;
5621
5622    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5623    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5624        mem_base = xmlMemBlocks();
5625        l = gen_xmlListPtr(n_l, 0);
5626        data = gen_userdata(n_data, 1);
5627
5628        ret_val = xmlListReverseSearch(l, data);
5629        desret_void_ptr(ret_val);
5630        call_tests++;
5631        des_xmlListPtr(n_l, l, 0);
5632        des_userdata(n_data, data, 1);
5633        xmlResetLastError();
5634        if (mem_base != xmlMemBlocks()) {
5635            printf("Leak of %d blocks found in xmlListReverseSearch",
5636	           xmlMemBlocks() - mem_base);
5637	    ret++;
5638            printf(" %d", n_l);
5639            printf(" %d", n_data);
5640            printf("\n");
5641        }
5642    }
5643    }
5644
5645    function_tests++;
5646    return(ret);
5647}
5648
5649
5650static int
5651test_xmlListReverseWalk(void) {
5652    int ret = 0;
5653
5654
5655    /* missing type support */
5656    return(ret);
5657}
5658
5659
5660static int
5661test_xmlListSearch(void) {
5662    int ret = 0;
5663
5664    int mem_base;
5665    void * ret_val;
5666    xmlListPtr l; /* a list */
5667    int n_l;
5668    void * data; /* a search value */
5669    int n_data;
5670
5671    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5672    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
5673        mem_base = xmlMemBlocks();
5674        l = gen_xmlListPtr(n_l, 0);
5675        data = gen_userdata(n_data, 1);
5676
5677        ret_val = xmlListSearch(l, data);
5678        desret_void_ptr(ret_val);
5679        call_tests++;
5680        des_xmlListPtr(n_l, l, 0);
5681        des_userdata(n_data, data, 1);
5682        xmlResetLastError();
5683        if (mem_base != xmlMemBlocks()) {
5684            printf("Leak of %d blocks found in xmlListSearch",
5685	           xmlMemBlocks() - mem_base);
5686	    ret++;
5687            printf(" %d", n_l);
5688            printf(" %d", n_data);
5689            printf("\n");
5690        }
5691    }
5692    }
5693
5694    function_tests++;
5695    return(ret);
5696}
5697
5698
5699static int
5700test_xmlListSize(void) {
5701    int ret = 0;
5702
5703    int mem_base;
5704    int ret_val;
5705    xmlListPtr l; /* a list */
5706    int n_l;
5707
5708    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5709        mem_base = xmlMemBlocks();
5710        l = gen_xmlListPtr(n_l, 0);
5711
5712        ret_val = xmlListSize(l);
5713        desret_int(ret_val);
5714        call_tests++;
5715        des_xmlListPtr(n_l, l, 0);
5716        xmlResetLastError();
5717        if (mem_base != xmlMemBlocks()) {
5718            printf("Leak of %d blocks found in xmlListSize",
5719	           xmlMemBlocks() - mem_base);
5720	    ret++;
5721            printf(" %d", n_l);
5722            printf("\n");
5723        }
5724    }
5725
5726    function_tests++;
5727    return(ret);
5728}
5729
5730
5731static int
5732test_xmlListSort(void) {
5733    int ret = 0;
5734
5735    int mem_base;
5736    xmlListPtr l; /* a list */
5737    int n_l;
5738
5739    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
5740        mem_base = xmlMemBlocks();
5741        l = gen_xmlListPtr(n_l, 0);
5742
5743        xmlListSort(l);
5744        call_tests++;
5745        des_xmlListPtr(n_l, l, 0);
5746        xmlResetLastError();
5747        if (mem_base != xmlMemBlocks()) {
5748            printf("Leak of %d blocks found in xmlListSort",
5749	           xmlMemBlocks() - mem_base);
5750	    ret++;
5751            printf(" %d", n_l);
5752            printf("\n");
5753        }
5754    }
5755
5756    function_tests++;
5757    return(ret);
5758}
5759
5760
5761static int
5762test_xmlListWalk(void) {
5763    int ret = 0;
5764
5765
5766    /* missing type support */
5767    return(ret);
5768}
5769
5770static int
5771test_list(void) {
5772    int ret = 0;
5773
5774    printf("Testing list : 17 of 26 functions ...\n");
5775    ret += test_xmlLinkGetData();
5776    ret += test_xmlListAppend();
5777    ret += test_xmlListClear();
5778    ret += test_xmlListCopy();
5779    ret += test_xmlListCreate();
5780    ret += test_xmlListDup();
5781    ret += test_xmlListEmpty();
5782    ret += test_xmlListEnd();
5783    ret += test_xmlListFront();
5784    ret += test_xmlListInsert();
5785    ret += test_xmlListMerge();
5786    ret += test_xmlListPopBack();
5787    ret += test_xmlListPopFront();
5788    ret += test_xmlListPushBack();
5789    ret += test_xmlListPushFront();
5790    ret += test_xmlListRemoveAll();
5791    ret += test_xmlListRemoveFirst();
5792    ret += test_xmlListRemoveLast();
5793    ret += test_xmlListReverse();
5794    ret += test_xmlListReverseSearch();
5795    ret += test_xmlListReverseWalk();
5796    ret += test_xmlListSearch();
5797    ret += test_xmlListSize();
5798    ret += test_xmlListSort();
5799    ret += test_xmlListWalk();
5800
5801    if (ret != 0)
5802	printf("Module list: %d errors\n", ret);
5803    return(ret);
5804}
5805
5806static int
5807test_xmlNanoFTPCheckResponse(void) {
5808    int ret = 0;
5809
5810#ifdef LIBXML_FTP_ENABLED
5811    int mem_base;
5812    int ret_val;
5813    void * ctx; /* an FTP context */
5814    int n_ctx;
5815
5816    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
5817        mem_base = xmlMemBlocks();
5818        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
5819
5820        ret_val = xmlNanoFTPCheckResponse(ctx);
5821        desret_int(ret_val);
5822        call_tests++;
5823        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
5824        xmlResetLastError();
5825        if (mem_base != xmlMemBlocks()) {
5826            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
5827	           xmlMemBlocks() - mem_base);
5828	    ret++;
5829            printf(" %d", n_ctx);
5830            printf("\n");
5831        }
5832    }
5833#endif
5834
5835    function_tests++;
5836    return(ret);
5837}
5838
5839
5840static int
5841test_xmlNanoFTPCleanup(void) {
5842    int ret = 0;
5843
5844#ifdef LIBXML_FTP_ENABLED
5845    int mem_base;
5846
5847        mem_base = xmlMemBlocks();
5848
5849        xmlNanoFTPCleanup();
5850        call_tests++;
5851        xmlResetLastError();
5852        if (mem_base != xmlMemBlocks()) {
5853            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
5854	           xmlMemBlocks() - mem_base);
5855	    ret++;
5856            printf("\n");
5857        }
5858#endif
5859
5860    function_tests++;
5861    return(ret);
5862}
5863
5864
5865static int
5866test_xmlNanoFTPCloseConnection(void) {
5867    int ret = 0;
5868
5869#ifdef LIBXML_FTP_ENABLED
5870    int mem_base;
5871    int ret_val;
5872    void * ctx; /* an FTP context */
5873    int n_ctx;
5874
5875    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
5876        mem_base = xmlMemBlocks();
5877        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
5878
5879        ret_val = xmlNanoFTPCloseConnection(ctx);
5880        desret_int(ret_val);
5881        call_tests++;
5882        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
5883        xmlResetLastError();
5884        if (mem_base != xmlMemBlocks()) {
5885            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
5886	           xmlMemBlocks() - mem_base);
5887	    ret++;
5888            printf(" %d", n_ctx);
5889            printf("\n");
5890        }
5891    }
5892#endif
5893
5894    function_tests++;
5895    return(ret);
5896}
5897
5898
5899static int
5900test_xmlNanoFTPCwd(void) {
5901    int ret = 0;
5902
5903#ifdef LIBXML_FTP_ENABLED
5904    int mem_base;
5905    int ret_val;
5906    void * ctx; /* an FTP context */
5907    int n_ctx;
5908    const char * directory; /* a directory on the server */
5909    int n_directory;
5910
5911    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
5912    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
5913        mem_base = xmlMemBlocks();
5914        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
5915        directory = gen_const_char_ptr(n_directory, 1);
5916
5917        ret_val = xmlNanoFTPCwd(ctx, directory);
5918        desret_int(ret_val);
5919        call_tests++;
5920        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
5921        des_const_char_ptr(n_directory, directory, 1);
5922        xmlResetLastError();
5923        if (mem_base != xmlMemBlocks()) {
5924            printf("Leak of %d blocks found in xmlNanoFTPCwd",
5925	           xmlMemBlocks() - mem_base);
5926	    ret++;
5927            printf(" %d", n_ctx);
5928            printf(" %d", n_directory);
5929            printf("\n");
5930        }
5931    }
5932    }
5933#endif
5934
5935    function_tests++;
5936    return(ret);
5937}
5938
5939
5940static int
5941test_xmlNanoFTPDele(void) {
5942    int ret = 0;
5943
5944#ifdef LIBXML_FTP_ENABLED
5945    int mem_base;
5946    int ret_val;
5947    void * ctx; /* an FTP context */
5948    int n_ctx;
5949    const char * file; /* a file or directory on the server */
5950    int n_file;
5951
5952    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
5953    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
5954        mem_base = xmlMemBlocks();
5955        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
5956        file = gen_filepath(n_file, 1);
5957
5958        ret_val = xmlNanoFTPDele(ctx, file);
5959        desret_int(ret_val);
5960        call_tests++;
5961        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
5962        des_filepath(n_file, file, 1);
5963        xmlResetLastError();
5964        if (mem_base != xmlMemBlocks()) {
5965            printf("Leak of %d blocks found in xmlNanoFTPDele",
5966	           xmlMemBlocks() - mem_base);
5967	    ret++;
5968            printf(" %d", n_ctx);
5969            printf(" %d", n_file);
5970            printf("\n");
5971        }
5972    }
5973    }
5974#endif
5975
5976    function_tests++;
5977    return(ret);
5978}
5979
5980
5981static int
5982test_xmlNanoFTPGet(void) {
5983    int ret = 0;
5984
5985
5986    /* missing type support */
5987    return(ret);
5988}
5989
5990
5991static int
5992test_xmlNanoFTPGetConnection(void) {
5993    int ret = 0;
5994
5995#ifdef LIBXML_FTP_ENABLED
5996    int mem_base;
5997    int ret_val;
5998    void * ctx; /* an FTP context */
5999    int n_ctx;
6000
6001    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
6002        mem_base = xmlMemBlocks();
6003        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
6004
6005        ret_val = xmlNanoFTPGetConnection(ctx);
6006        desret_int(ret_val);
6007        call_tests++;
6008        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
6009        xmlResetLastError();
6010        if (mem_base != xmlMemBlocks()) {
6011            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
6012	           xmlMemBlocks() - mem_base);
6013	    ret++;
6014            printf(" %d", n_ctx);
6015            printf("\n");
6016        }
6017    }
6018#endif
6019
6020    function_tests++;
6021    return(ret);
6022}
6023
6024
6025static int
6026test_xmlNanoFTPGetResponse(void) {
6027    int ret = 0;
6028
6029#ifdef LIBXML_FTP_ENABLED
6030    int mem_base;
6031    int ret_val;
6032    void * ctx; /* an FTP context */
6033    int n_ctx;
6034
6035    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
6036        mem_base = xmlMemBlocks();
6037        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
6038
6039        ret_val = xmlNanoFTPGetResponse(ctx);
6040        desret_int(ret_val);
6041        call_tests++;
6042        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
6043        xmlResetLastError();
6044        if (mem_base != xmlMemBlocks()) {
6045            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
6046	           xmlMemBlocks() - mem_base);
6047	    ret++;
6048            printf(" %d", n_ctx);
6049            printf("\n");
6050        }
6051    }
6052#endif
6053
6054    function_tests++;
6055    return(ret);
6056}
6057
6058
6059static int
6060test_xmlNanoFTPGetSocket(void) {
6061    int ret = 0;
6062
6063#ifdef LIBXML_FTP_ENABLED
6064    int mem_base;
6065    int ret_val;
6066    void * ctx; /* an FTP context */
6067    int n_ctx;
6068    const char * filename; /* the file to retrieve (or NULL if path is in context). */
6069    int n_filename;
6070
6071    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
6072    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6073        mem_base = xmlMemBlocks();
6074        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
6075        filename = gen_filepath(n_filename, 1);
6076
6077        ret_val = xmlNanoFTPGetSocket(ctx, filename);
6078        desret_int(ret_val);
6079        call_tests++;
6080        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
6081        des_filepath(n_filename, filename, 1);
6082        xmlResetLastError();
6083        if (mem_base != xmlMemBlocks()) {
6084            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
6085	           xmlMemBlocks() - mem_base);
6086	    ret++;
6087            printf(" %d", n_ctx);
6088            printf(" %d", n_filename);
6089            printf("\n");
6090        }
6091    }
6092    }
6093#endif
6094
6095    function_tests++;
6096    return(ret);
6097}
6098
6099
6100static int
6101test_xmlNanoFTPInit(void) {
6102    int ret = 0;
6103
6104#ifdef LIBXML_FTP_ENABLED
6105    int mem_base;
6106
6107        mem_base = xmlMemBlocks();
6108
6109        xmlNanoFTPInit();
6110        call_tests++;
6111        xmlResetLastError();
6112        if (mem_base != xmlMemBlocks()) {
6113            printf("Leak of %d blocks found in xmlNanoFTPInit",
6114	           xmlMemBlocks() - mem_base);
6115	    ret++;
6116            printf("\n");
6117        }
6118#endif
6119
6120    function_tests++;
6121    return(ret);
6122}
6123
6124
6125static int
6126test_xmlNanoFTPList(void) {
6127    int ret = 0;
6128
6129
6130    /* missing type support */
6131    return(ret);
6132}
6133
6134
6135static int
6136test_xmlNanoFTPNewCtxt(void) {
6137    int ret = 0;
6138
6139
6140    /* missing type support */
6141    return(ret);
6142}
6143
6144
6145static int
6146test_xmlNanoFTPOpen(void) {
6147    int ret = 0;
6148
6149#ifdef LIBXML_FTP_ENABLED
6150    int mem_base;
6151    void * ret_val;
6152    const char * URL; /* the URL to the resource */
6153    int n_URL;
6154
6155    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
6156        mem_base = xmlMemBlocks();
6157        URL = gen_filepath(n_URL, 0);
6158
6159        ret_val = xmlNanoFTPOpen(URL);
6160        desret_void_ptr(ret_val);
6161        call_tests++;
6162        des_filepath(n_URL, URL, 0);
6163        xmlResetLastError();
6164        if (mem_base != xmlMemBlocks()) {
6165            printf("Leak of %d blocks found in xmlNanoFTPOpen",
6166	           xmlMemBlocks() - mem_base);
6167	    ret++;
6168            printf(" %d", n_URL);
6169            printf("\n");
6170        }
6171    }
6172#endif
6173
6174    function_tests++;
6175    return(ret);
6176}
6177
6178
6179static int
6180test_xmlNanoFTPProxy(void) {
6181    int ret = 0;
6182
6183#ifdef LIBXML_FTP_ENABLED
6184    const char * host; /* the proxy host name */
6185    int n_host;
6186    int port; /* the proxy port */
6187    int n_port;
6188    const char * user; /* the proxy user name */
6189    int n_user;
6190    const char * passwd; /* the proxy password */
6191    int n_passwd;
6192    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
6193    int n_type;
6194
6195    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
6196    for (n_port = 0;n_port < gen_nb_int;n_port++) {
6197    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
6198    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
6199    for (n_type = 0;n_type < gen_nb_int;n_type++) {
6200        host = gen_const_char_ptr(n_host, 0);
6201        port = gen_int(n_port, 1);
6202        user = gen_const_char_ptr(n_user, 2);
6203        passwd = gen_const_char_ptr(n_passwd, 3);
6204        type = gen_int(n_type, 4);
6205
6206        xmlNanoFTPProxy(host, port, user, passwd, type);
6207        call_tests++;
6208        des_const_char_ptr(n_host, host, 0);
6209        des_int(n_port, port, 1);
6210        des_const_char_ptr(n_user, user, 2);
6211        des_const_char_ptr(n_passwd, passwd, 3);
6212        des_int(n_type, type, 4);
6213        xmlResetLastError();
6214    }
6215    }
6216    }
6217    }
6218    }
6219#endif
6220
6221    function_tests++;
6222    return(ret);
6223}
6224
6225
6226static int
6227test_xmlNanoFTPQuit(void) {
6228    int ret = 0;
6229
6230#ifdef LIBXML_FTP_ENABLED
6231    int mem_base;
6232    int ret_val;
6233    void * ctx; /* an FTP context */
6234    int n_ctx;
6235
6236    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
6237        mem_base = xmlMemBlocks();
6238        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
6239
6240        ret_val = xmlNanoFTPQuit(ctx);
6241        desret_int(ret_val);
6242        call_tests++;
6243        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
6244        xmlResetLastError();
6245        if (mem_base != xmlMemBlocks()) {
6246            printf("Leak of %d blocks found in xmlNanoFTPQuit",
6247	           xmlMemBlocks() - mem_base);
6248	    ret++;
6249            printf(" %d", n_ctx);
6250            printf("\n");
6251        }
6252    }
6253#endif
6254
6255    function_tests++;
6256    return(ret);
6257}
6258
6259
6260static int
6261test_xmlNanoFTPRead(void) {
6262    int ret = 0;
6263
6264#ifdef LIBXML_FTP_ENABLED
6265    int mem_base;
6266    int ret_val;
6267    void * ctx; /* the FTP context */
6268    int n_ctx;
6269    void * dest; /* a buffer */
6270    int n_dest;
6271    int len; /* the buffer length */
6272    int n_len;
6273
6274    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
6275    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
6276    for (n_len = 0;n_len < gen_nb_int;n_len++) {
6277        mem_base = xmlMemBlocks();
6278        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
6279        dest = gen_void_ptr(n_dest, 1);
6280        len = gen_int(n_len, 2);
6281
6282        ret_val = xmlNanoFTPRead(ctx, dest, len);
6283        desret_int(ret_val);
6284        call_tests++;
6285        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
6286        des_void_ptr(n_dest, dest, 1);
6287        des_int(n_len, len, 2);
6288        xmlResetLastError();
6289        if (mem_base != xmlMemBlocks()) {
6290            printf("Leak of %d blocks found in xmlNanoFTPRead",
6291	           xmlMemBlocks() - mem_base);
6292	    ret++;
6293            printf(" %d", n_ctx);
6294            printf(" %d", n_dest);
6295            printf(" %d", n_len);
6296            printf("\n");
6297        }
6298    }
6299    }
6300    }
6301#endif
6302
6303    function_tests++;
6304    return(ret);
6305}
6306
6307
6308static int
6309test_xmlNanoFTPScanProxy(void) {
6310    int ret = 0;
6311
6312#ifdef LIBXML_FTP_ENABLED
6313    const char * URL; /* The proxy URL used to initialize the proxy context */
6314    int n_URL;
6315
6316    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
6317        URL = gen_filepath(n_URL, 0);
6318
6319        xmlNanoFTPScanProxy(URL);
6320        call_tests++;
6321        des_filepath(n_URL, URL, 0);
6322        xmlResetLastError();
6323    }
6324#endif
6325
6326    function_tests++;
6327    return(ret);
6328}
6329
6330
6331static int
6332test_xmlNanoFTPUpdateURL(void) {
6333    int ret = 0;
6334
6335#ifdef LIBXML_FTP_ENABLED
6336    int mem_base;
6337    int ret_val;
6338    void * ctx; /* an FTP context */
6339    int n_ctx;
6340    const char * URL; /* The URL used to update the context */
6341    int n_URL;
6342
6343    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
6344    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
6345        mem_base = xmlMemBlocks();
6346        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
6347        URL = gen_filepath(n_URL, 1);
6348
6349        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
6350        desret_int(ret_val);
6351        call_tests++;
6352        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
6353        des_filepath(n_URL, URL, 1);
6354        xmlResetLastError();
6355        if (mem_base != xmlMemBlocks()) {
6356            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
6357	           xmlMemBlocks() - mem_base);
6358	    ret++;
6359            printf(" %d", n_ctx);
6360            printf(" %d", n_URL);
6361            printf("\n");
6362        }
6363    }
6364    }
6365#endif
6366
6367    function_tests++;
6368    return(ret);
6369}
6370
6371static int
6372test_nanoftp(void) {
6373    int ret = 0;
6374
6375    printf("Testing nanoftp : 15 of 22 functions ...\n");
6376    ret += test_xmlNanoFTPCheckResponse();
6377    ret += test_xmlNanoFTPCleanup();
6378    ret += test_xmlNanoFTPCloseConnection();
6379    ret += test_xmlNanoFTPCwd();
6380    ret += test_xmlNanoFTPDele();
6381    ret += test_xmlNanoFTPGet();
6382    ret += test_xmlNanoFTPGetConnection();
6383    ret += test_xmlNanoFTPGetResponse();
6384    ret += test_xmlNanoFTPGetSocket();
6385    ret += test_xmlNanoFTPInit();
6386    ret += test_xmlNanoFTPList();
6387    ret += test_xmlNanoFTPNewCtxt();
6388    ret += test_xmlNanoFTPOpen();
6389    ret += test_xmlNanoFTPProxy();
6390    ret += test_xmlNanoFTPQuit();
6391    ret += test_xmlNanoFTPRead();
6392    ret += test_xmlNanoFTPScanProxy();
6393    ret += test_xmlNanoFTPUpdateURL();
6394
6395    if (ret != 0)
6396	printf("Module nanoftp: %d errors\n", ret);
6397    return(ret);
6398}
6399
6400static int
6401test_xmlNanoHTTPAuthHeader(void) {
6402    int ret = 0;
6403
6404#ifdef LIBXML_HTTP_ENABLED
6405    int mem_base;
6406    const char * ret_val;
6407    void * ctx; /* the HTTP context */
6408    int n_ctx;
6409
6410    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
6411        mem_base = xmlMemBlocks();
6412        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
6413
6414        ret_val = xmlNanoHTTPAuthHeader(ctx);
6415        desret_const_char_ptr(ret_val);
6416        call_tests++;
6417        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
6418        xmlResetLastError();
6419        if (mem_base != xmlMemBlocks()) {
6420            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
6421	           xmlMemBlocks() - mem_base);
6422	    ret++;
6423            printf(" %d", n_ctx);
6424            printf("\n");
6425        }
6426    }
6427#endif
6428
6429    function_tests++;
6430    return(ret);
6431}
6432
6433
6434static int
6435test_xmlNanoHTTPCleanup(void) {
6436    int ret = 0;
6437
6438#ifdef LIBXML_HTTP_ENABLED
6439    int mem_base;
6440
6441        mem_base = xmlMemBlocks();
6442
6443        xmlNanoHTTPCleanup();
6444        call_tests++;
6445        xmlResetLastError();
6446        if (mem_base != xmlMemBlocks()) {
6447            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
6448	           xmlMemBlocks() - mem_base);
6449	    ret++;
6450            printf("\n");
6451        }
6452#endif
6453
6454    function_tests++;
6455    return(ret);
6456}
6457
6458
6459static int
6460test_xmlNanoHTTPClose(void) {
6461    int ret = 0;
6462
6463#ifdef LIBXML_HTTP_ENABLED
6464    int mem_base;
6465    void * ctx; /* the HTTP context */
6466    int n_ctx;
6467
6468    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
6469        mem_base = xmlMemBlocks();
6470        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
6471
6472        xmlNanoHTTPClose(ctx);
6473        call_tests++;
6474        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
6475        xmlResetLastError();
6476        if (mem_base != xmlMemBlocks()) {
6477            printf("Leak of %d blocks found in xmlNanoHTTPClose",
6478	           xmlMemBlocks() - mem_base);
6479	    ret++;
6480            printf(" %d", n_ctx);
6481            printf("\n");
6482        }
6483    }
6484#endif
6485
6486    function_tests++;
6487    return(ret);
6488}
6489
6490
6491static int
6492test_xmlNanoHTTPContentLength(void) {
6493    int ret = 0;
6494
6495#ifdef LIBXML_HTTP_ENABLED
6496    int mem_base;
6497    int ret_val;
6498    void * ctx; /* the HTTP context */
6499    int n_ctx;
6500
6501    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
6502        mem_base = xmlMemBlocks();
6503        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
6504
6505        ret_val = xmlNanoHTTPContentLength(ctx);
6506        desret_int(ret_val);
6507        call_tests++;
6508        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
6509        xmlResetLastError();
6510        if (mem_base != xmlMemBlocks()) {
6511            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
6512	           xmlMemBlocks() - mem_base);
6513	    ret++;
6514            printf(" %d", n_ctx);
6515            printf("\n");
6516        }
6517    }
6518#endif
6519
6520    function_tests++;
6521    return(ret);
6522}
6523
6524
6525static int
6526test_xmlNanoHTTPEncoding(void) {
6527    int ret = 0;
6528
6529#ifdef LIBXML_HTTP_ENABLED
6530    int mem_base;
6531    const char * ret_val;
6532    void * ctx; /* the HTTP context */
6533    int n_ctx;
6534
6535    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
6536        mem_base = xmlMemBlocks();
6537        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
6538
6539        ret_val = xmlNanoHTTPEncoding(ctx);
6540        desret_const_char_ptr(ret_val);
6541        call_tests++;
6542        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
6543        xmlResetLastError();
6544        if (mem_base != xmlMemBlocks()) {
6545            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
6546	           xmlMemBlocks() - mem_base);
6547	    ret++;
6548            printf(" %d", n_ctx);
6549            printf("\n");
6550        }
6551    }
6552#endif
6553
6554    function_tests++;
6555    return(ret);
6556}
6557
6558
6559static int
6560test_xmlNanoHTTPFetch(void) {
6561    int ret = 0;
6562
6563
6564    /* missing type support */
6565    return(ret);
6566}
6567
6568
6569static int
6570test_xmlNanoHTTPInit(void) {
6571    int ret = 0;
6572
6573#ifdef LIBXML_HTTP_ENABLED
6574    int mem_base;
6575
6576        mem_base = xmlMemBlocks();
6577
6578        xmlNanoHTTPInit();
6579        call_tests++;
6580        xmlResetLastError();
6581        if (mem_base != xmlMemBlocks()) {
6582            printf("Leak of %d blocks found in xmlNanoHTTPInit",
6583	           xmlMemBlocks() - mem_base);
6584	    ret++;
6585            printf("\n");
6586        }
6587#endif
6588
6589    function_tests++;
6590    return(ret);
6591}
6592
6593
6594static int
6595test_xmlNanoHTTPMethod(void) {
6596    int ret = 0;
6597
6598
6599    /* missing type support */
6600    return(ret);
6601}
6602
6603
6604static int
6605test_xmlNanoHTTPMethodRedir(void) {
6606    int ret = 0;
6607
6608
6609    /* missing type support */
6610    return(ret);
6611}
6612
6613
6614static int
6615test_xmlNanoHTTPMimeType(void) {
6616    int ret = 0;
6617
6618#ifdef LIBXML_HTTP_ENABLED
6619    int mem_base;
6620    const char * ret_val;
6621    void * ctx; /* the HTTP context */
6622    int n_ctx;
6623
6624    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
6625        mem_base = xmlMemBlocks();
6626        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
6627
6628        ret_val = xmlNanoHTTPMimeType(ctx);
6629        desret_const_char_ptr(ret_val);
6630        call_tests++;
6631        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
6632        xmlResetLastError();
6633        if (mem_base != xmlMemBlocks()) {
6634            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
6635	           xmlMemBlocks() - mem_base);
6636	    ret++;
6637            printf(" %d", n_ctx);
6638            printf("\n");
6639        }
6640    }
6641#endif
6642
6643    function_tests++;
6644    return(ret);
6645}
6646
6647
6648static int
6649test_xmlNanoHTTPOpen(void) {
6650    int ret = 0;
6651
6652
6653    /* missing type support */
6654    return(ret);
6655}
6656
6657
6658static int
6659test_xmlNanoHTTPOpenRedir(void) {
6660    int ret = 0;
6661
6662
6663    /* missing type support */
6664    return(ret);
6665}
6666
6667
6668static int
6669test_xmlNanoHTTPRead(void) {
6670    int ret = 0;
6671
6672#ifdef LIBXML_HTTP_ENABLED
6673    int mem_base;
6674    int ret_val;
6675    void * ctx; /* the HTTP context */
6676    int n_ctx;
6677    void * dest; /* a buffer */
6678    int n_dest;
6679    int len; /* the buffer length */
6680    int n_len;
6681
6682    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
6683    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
6684    for (n_len = 0;n_len < gen_nb_int;n_len++) {
6685        mem_base = xmlMemBlocks();
6686        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
6687        dest = gen_void_ptr(n_dest, 1);
6688        len = gen_int(n_len, 2);
6689
6690        ret_val = xmlNanoHTTPRead(ctx, dest, len);
6691        desret_int(ret_val);
6692        call_tests++;
6693        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
6694        des_void_ptr(n_dest, dest, 1);
6695        des_int(n_len, len, 2);
6696        xmlResetLastError();
6697        if (mem_base != xmlMemBlocks()) {
6698            printf("Leak of %d blocks found in xmlNanoHTTPRead",
6699	           xmlMemBlocks() - mem_base);
6700	    ret++;
6701            printf(" %d", n_ctx);
6702            printf(" %d", n_dest);
6703            printf(" %d", n_len);
6704            printf("\n");
6705        }
6706    }
6707    }
6708    }
6709#endif
6710
6711    function_tests++;
6712    return(ret);
6713}
6714
6715
6716static int
6717test_xmlNanoHTTPRedir(void) {
6718    int ret = 0;
6719
6720
6721    /* missing type support */
6722    return(ret);
6723}
6724
6725
6726static int
6727test_xmlNanoHTTPReturnCode(void) {
6728    int ret = 0;
6729
6730#ifdef LIBXML_HTTP_ENABLED
6731    int mem_base;
6732    int ret_val;
6733    void * ctx; /* the HTTP context */
6734    int n_ctx;
6735
6736    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
6737        mem_base = xmlMemBlocks();
6738        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
6739
6740        ret_val = xmlNanoHTTPReturnCode(ctx);
6741        desret_int(ret_val);
6742        call_tests++;
6743        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
6744        xmlResetLastError();
6745        if (mem_base != xmlMemBlocks()) {
6746            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
6747	           xmlMemBlocks() - mem_base);
6748	    ret++;
6749            printf(" %d", n_ctx);
6750            printf("\n");
6751        }
6752    }
6753#endif
6754
6755    function_tests++;
6756    return(ret);
6757}
6758
6759
6760static int
6761test_xmlNanoHTTPSave(void) {
6762    int ret = 0;
6763
6764#ifdef LIBXML_HTTP_ENABLED
6765#ifdef LIBXML_OUTPUT_ENABLED
6766    int mem_base;
6767    int ret_val;
6768    void * ctxt; /* the HTTP context */
6769    int n_ctxt;
6770    const char * filename; /* the filename where the content should be saved */
6771    int n_filename;
6772
6773    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
6774    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
6775        mem_base = xmlMemBlocks();
6776        ctxt = gen_void_ptr(n_ctxt, 0);
6777        filename = gen_fileoutput(n_filename, 1);
6778
6779        ret_val = xmlNanoHTTPSave(ctxt, filename);
6780        desret_int(ret_val);
6781        call_tests++;
6782        des_void_ptr(n_ctxt, ctxt, 0);
6783        des_fileoutput(n_filename, filename, 1);
6784        xmlResetLastError();
6785        if (mem_base != xmlMemBlocks()) {
6786            printf("Leak of %d blocks found in xmlNanoHTTPSave",
6787	           xmlMemBlocks() - mem_base);
6788	    ret++;
6789            printf(" %d", n_ctxt);
6790            printf(" %d", n_filename);
6791            printf("\n");
6792        }
6793    }
6794    }
6795#endif
6796#endif
6797
6798    function_tests++;
6799    return(ret);
6800}
6801
6802
6803static int
6804test_xmlNanoHTTPScanProxy(void) {
6805    int ret = 0;
6806
6807#ifdef LIBXML_HTTP_ENABLED
6808    const char * URL; /* The proxy URL used to initialize the proxy context */
6809    int n_URL;
6810
6811    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
6812        URL = gen_filepath(n_URL, 0);
6813
6814        xmlNanoHTTPScanProxy(URL);
6815        call_tests++;
6816        des_filepath(n_URL, URL, 0);
6817        xmlResetLastError();
6818    }
6819#endif
6820
6821    function_tests++;
6822    return(ret);
6823}
6824
6825static int
6826test_nanohttp(void) {
6827    int ret = 0;
6828
6829    printf("Testing nanohttp : 11 of 17 functions ...\n");
6830    ret += test_xmlNanoHTTPAuthHeader();
6831    ret += test_xmlNanoHTTPCleanup();
6832    ret += test_xmlNanoHTTPClose();
6833    ret += test_xmlNanoHTTPContentLength();
6834    ret += test_xmlNanoHTTPEncoding();
6835    ret += test_xmlNanoHTTPFetch();
6836    ret += test_xmlNanoHTTPInit();
6837    ret += test_xmlNanoHTTPMethod();
6838    ret += test_xmlNanoHTTPMethodRedir();
6839    ret += test_xmlNanoHTTPMimeType();
6840    ret += test_xmlNanoHTTPOpen();
6841    ret += test_xmlNanoHTTPOpenRedir();
6842    ret += test_xmlNanoHTTPRead();
6843    ret += test_xmlNanoHTTPRedir();
6844    ret += test_xmlNanoHTTPReturnCode();
6845    ret += test_xmlNanoHTTPSave();
6846    ret += test_xmlNanoHTTPScanProxy();
6847
6848    if (ret != 0)
6849	printf("Module nanohttp: %d errors\n", ret);
6850    return(ret);
6851}
6852
6853static int
6854test_xmlByteConsumed(void) {
6855    int ret = 0;
6856
6857    int mem_base;
6858    long ret_val;
6859    xmlParserCtxtPtr ctxt; /* an XML parser context */
6860    int n_ctxt;
6861
6862    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
6863        mem_base = xmlMemBlocks();
6864        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
6865
6866        ret_val = xmlByteConsumed(ctxt);
6867        desret_long(ret_val);
6868        call_tests++;
6869        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
6870        xmlResetLastError();
6871        if (mem_base != xmlMemBlocks()) {
6872            printf("Leak of %d blocks found in xmlByteConsumed",
6873	           xmlMemBlocks() - mem_base);
6874	    ret++;
6875            printf(" %d", n_ctxt);
6876            printf("\n");
6877        }
6878    }
6879
6880    function_tests++;
6881    return(ret);
6882}
6883
6884
6885static int
6886test_xmlClearNodeInfoSeq(void) {
6887    int ret = 0;
6888
6889
6890    /* missing type support */
6891    return(ret);
6892}
6893
6894
6895static int
6896test_xmlClearParserCtxt(void) {
6897    int ret = 0;
6898
6899    int mem_base;
6900    xmlParserCtxtPtr ctxt; /* an XML parser context */
6901    int n_ctxt;
6902
6903    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
6904        mem_base = xmlMemBlocks();
6905        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
6906
6907        xmlClearParserCtxt(ctxt);
6908        call_tests++;
6909        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
6910        xmlResetLastError();
6911        if (mem_base != xmlMemBlocks()) {
6912            printf("Leak of %d blocks found in xmlClearParserCtxt",
6913	           xmlMemBlocks() - mem_base);
6914	    ret++;
6915            printf(" %d", n_ctxt);
6916            printf("\n");
6917        }
6918    }
6919
6920    function_tests++;
6921    return(ret);
6922}
6923
6924
6925static int
6926test_xmlCreateDocParserCtxt(void) {
6927    int ret = 0;
6928
6929    int mem_base;
6930    xmlParserCtxtPtr ret_val;
6931    const xmlChar * cur; /* a pointer to an array of xmlChar */
6932    int n_cur;
6933
6934    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
6935        mem_base = xmlMemBlocks();
6936        cur = gen_const_xmlChar_ptr(n_cur, 0);
6937
6938        ret_val = xmlCreateDocParserCtxt(cur);
6939        desret_xmlParserCtxtPtr(ret_val);
6940        call_tests++;
6941        des_const_xmlChar_ptr(n_cur, cur, 0);
6942        xmlResetLastError();
6943        if (mem_base != xmlMemBlocks()) {
6944            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
6945	           xmlMemBlocks() - mem_base);
6946	    ret++;
6947            printf(" %d", n_cur);
6948            printf("\n");
6949        }
6950    }
6951
6952    function_tests++;
6953    return(ret);
6954}
6955
6956
6957static int
6958test_xmlCreateIOParserCtxt(void) {
6959    int ret = 0;
6960
6961
6962    /* missing type support */
6963    return(ret);
6964}
6965
6966
6967static int
6968test_xmlCreatePushParserCtxt(void) {
6969    int ret = 0;
6970
6971#ifdef LIBXML_PUSH_ENABLED
6972    int mem_base;
6973    xmlParserCtxtPtr ret_val;
6974    xmlSAXHandlerPtr sax; /* a SAX handler */
6975    int n_sax;
6976    void * user_data; /* The user data returned on SAX callbacks */
6977    int n_user_data;
6978    const char * chunk; /* a pointer to an array of chars */
6979    int n_chunk;
6980    int size; /* number of chars in the array */
6981    int n_size;
6982    const char * filename; /* an optional file name or URI */
6983    int n_filename;
6984
6985    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
6986    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
6987    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
6988    for (n_size = 0;n_size < gen_nb_int;n_size++) {
6989    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6990        mem_base = xmlMemBlocks();
6991        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
6992        user_data = gen_userdata(n_user_data, 1);
6993        chunk = gen_const_char_ptr(n_chunk, 2);
6994        size = gen_int(n_size, 3);
6995        filename = gen_filepath(n_filename, 4);
6996
6997        ret_val = xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename);
6998        desret_xmlParserCtxtPtr(ret_val);
6999        call_tests++;
7000        des_xmlSAXHandlerPtr(n_sax, sax, 0);
7001        des_userdata(n_user_data, user_data, 1);
7002        des_const_char_ptr(n_chunk, chunk, 2);
7003        des_int(n_size, size, 3);
7004        des_filepath(n_filename, filename, 4);
7005        xmlResetLastError();
7006        if (mem_base != xmlMemBlocks()) {
7007            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
7008	           xmlMemBlocks() - mem_base);
7009	    ret++;
7010            printf(" %d", n_sax);
7011            printf(" %d", n_user_data);
7012            printf(" %d", n_chunk);
7013            printf(" %d", n_size);
7014            printf(" %d", n_filename);
7015            printf("\n");
7016        }
7017    }
7018    }
7019    }
7020    }
7021    }
7022#endif
7023
7024    function_tests++;
7025    return(ret);
7026}
7027
7028
7029static int
7030test_xmlCtxtReadDoc(void) {
7031    int ret = 0;
7032
7033    int mem_base;
7034    xmlDocPtr ret_val;
7035    xmlParserCtxtPtr ctxt; /* an XML parser context */
7036    int n_ctxt;
7037    const xmlChar * cur; /* a pointer to a zero terminated string */
7038    int n_cur;
7039    const char * URL; /* the base URL to use for the document */
7040    int n_URL;
7041    const char * encoding; /* the document encoding, or NULL */
7042    int n_encoding;
7043    int options; /* a combination of xmlParserOption */
7044    int n_options;
7045
7046    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7047    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
7048    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
7049    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
7050    for (n_options = 0;n_options < gen_nb_int;n_options++) {
7051        mem_base = xmlMemBlocks();
7052        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7053        cur = gen_const_xmlChar_ptr(n_cur, 1);
7054        URL = gen_filepath(n_URL, 2);
7055        encoding = gen_const_char_ptr(n_encoding, 3);
7056        options = gen_int(n_options, 4);
7057
7058        ret_val = xmlCtxtReadDoc(ctxt, cur, URL, encoding, options);
7059        desret_xmlDocPtr(ret_val);
7060        call_tests++;
7061        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7062        des_const_xmlChar_ptr(n_cur, cur, 1);
7063        des_filepath(n_URL, URL, 2);
7064        des_const_char_ptr(n_encoding, encoding, 3);
7065        des_int(n_options, options, 4);
7066        xmlResetLastError();
7067        if (mem_base != xmlMemBlocks()) {
7068            printf("Leak of %d blocks found in xmlCtxtReadDoc",
7069	           xmlMemBlocks() - mem_base);
7070	    ret++;
7071            printf(" %d", n_ctxt);
7072            printf(" %d", n_cur);
7073            printf(" %d", n_URL);
7074            printf(" %d", n_encoding);
7075            printf(" %d", n_options);
7076            printf("\n");
7077        }
7078    }
7079    }
7080    }
7081    }
7082    }
7083
7084    function_tests++;
7085    return(ret);
7086}
7087
7088
7089static int
7090test_xmlCtxtReadFile(void) {
7091    int ret = 0;
7092
7093    int mem_base;
7094    xmlDocPtr ret_val;
7095    xmlParserCtxtPtr ctxt; /* an XML parser context */
7096    int n_ctxt;
7097    const char * filename; /* a file or URL */
7098    int n_filename;
7099    const char * encoding; /* the document encoding, or NULL */
7100    int n_encoding;
7101    int options; /* a combination of xmlParserOption */
7102    int n_options;
7103
7104    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7105    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
7106    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
7107    for (n_options = 0;n_options < gen_nb_int;n_options++) {
7108        mem_base = xmlMemBlocks();
7109        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7110        filename = gen_filepath(n_filename, 1);
7111        encoding = gen_const_char_ptr(n_encoding, 2);
7112        options = gen_int(n_options, 3);
7113
7114        ret_val = xmlCtxtReadFile(ctxt, filename, encoding, options);
7115        desret_xmlDocPtr(ret_val);
7116        call_tests++;
7117        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7118        des_filepath(n_filename, filename, 1);
7119        des_const_char_ptr(n_encoding, encoding, 2);
7120        des_int(n_options, options, 3);
7121        xmlResetLastError();
7122        if (mem_base != xmlMemBlocks()) {
7123            printf("Leak of %d blocks found in xmlCtxtReadFile",
7124	           xmlMemBlocks() - mem_base);
7125	    ret++;
7126            printf(" %d", n_ctxt);
7127            printf(" %d", n_filename);
7128            printf(" %d", n_encoding);
7129            printf(" %d", n_options);
7130            printf("\n");
7131        }
7132    }
7133    }
7134    }
7135    }
7136
7137    function_tests++;
7138    return(ret);
7139}
7140
7141
7142static int
7143test_xmlCtxtReadMemory(void) {
7144    int ret = 0;
7145
7146    int mem_base;
7147    xmlDocPtr ret_val;
7148    xmlParserCtxtPtr ctxt; /* an XML parser context */
7149    int n_ctxt;
7150    const char * buffer; /* a pointer to a char array */
7151    int n_buffer;
7152    int size; /* the size of the array */
7153    int n_size;
7154    const char * URL; /* the base URL to use for the document */
7155    int n_URL;
7156    const char * encoding; /* the document encoding, or NULL */
7157    int n_encoding;
7158    int options; /* a combination of xmlParserOption */
7159    int n_options;
7160
7161    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7162    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
7163    for (n_size = 0;n_size < gen_nb_int;n_size++) {
7164    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
7165    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
7166    for (n_options = 0;n_options < gen_nb_int;n_options++) {
7167        mem_base = xmlMemBlocks();
7168        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7169        buffer = gen_const_char_ptr(n_buffer, 1);
7170        size = gen_int(n_size, 2);
7171        URL = gen_filepath(n_URL, 3);
7172        encoding = gen_const_char_ptr(n_encoding, 4);
7173        options = gen_int(n_options, 5);
7174
7175        ret_val = xmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options);
7176        desret_xmlDocPtr(ret_val);
7177        call_tests++;
7178        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7179        des_const_char_ptr(n_buffer, buffer, 1);
7180        des_int(n_size, size, 2);
7181        des_filepath(n_URL, URL, 3);
7182        des_const_char_ptr(n_encoding, encoding, 4);
7183        des_int(n_options, options, 5);
7184        xmlResetLastError();
7185        if (mem_base != xmlMemBlocks()) {
7186            printf("Leak of %d blocks found in xmlCtxtReadMemory",
7187	           xmlMemBlocks() - mem_base);
7188	    ret++;
7189            printf(" %d", n_ctxt);
7190            printf(" %d", n_buffer);
7191            printf(" %d", n_size);
7192            printf(" %d", n_URL);
7193            printf(" %d", n_encoding);
7194            printf(" %d", n_options);
7195            printf("\n");
7196        }
7197    }
7198    }
7199    }
7200    }
7201    }
7202    }
7203
7204    function_tests++;
7205    return(ret);
7206}
7207
7208
7209static int
7210test_xmlCtxtReset(void) {
7211    int ret = 0;
7212
7213    int mem_base;
7214    xmlParserCtxtPtr ctxt; /* an XML parser context */
7215    int n_ctxt;
7216
7217    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7218        mem_base = xmlMemBlocks();
7219        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7220
7221        xmlCtxtReset(ctxt);
7222        call_tests++;
7223        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7224        xmlResetLastError();
7225        if (mem_base != xmlMemBlocks()) {
7226            printf("Leak of %d blocks found in xmlCtxtReset",
7227	           xmlMemBlocks() - mem_base);
7228	    ret++;
7229            printf(" %d", n_ctxt);
7230            printf("\n");
7231        }
7232    }
7233
7234    function_tests++;
7235    return(ret);
7236}
7237
7238
7239static int
7240test_xmlCtxtResetPush(void) {
7241    int ret = 0;
7242
7243    int mem_base;
7244    int ret_val;
7245    xmlParserCtxtPtr ctxt; /* an XML parser context */
7246    int n_ctxt;
7247    const char * chunk; /* a pointer to an array of chars */
7248    int n_chunk;
7249    int size; /* number of chars in the array */
7250    int n_size;
7251    const char * filename; /* an optional file name or URI */
7252    int n_filename;
7253    const char * encoding; /* the document encoding, or NULL */
7254    int n_encoding;
7255
7256    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7257    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
7258    for (n_size = 0;n_size < gen_nb_int;n_size++) {
7259    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
7260    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
7261        mem_base = xmlMemBlocks();
7262        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7263        chunk = gen_const_char_ptr(n_chunk, 1);
7264        size = gen_int(n_size, 2);
7265        filename = gen_filepath(n_filename, 3);
7266        encoding = gen_const_char_ptr(n_encoding, 4);
7267
7268        ret_val = xmlCtxtResetPush(ctxt, chunk, size, filename, encoding);
7269        desret_int(ret_val);
7270        call_tests++;
7271        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7272        des_const_char_ptr(n_chunk, chunk, 1);
7273        des_int(n_size, size, 2);
7274        des_filepath(n_filename, filename, 3);
7275        des_const_char_ptr(n_encoding, encoding, 4);
7276        xmlResetLastError();
7277        if (mem_base != xmlMemBlocks()) {
7278            printf("Leak of %d blocks found in xmlCtxtResetPush",
7279	           xmlMemBlocks() - mem_base);
7280	    ret++;
7281            printf(" %d", n_ctxt);
7282            printf(" %d", n_chunk);
7283            printf(" %d", n_size);
7284            printf(" %d", n_filename);
7285            printf(" %d", n_encoding);
7286            printf("\n");
7287        }
7288    }
7289    }
7290    }
7291    }
7292    }
7293
7294    function_tests++;
7295    return(ret);
7296}
7297
7298
7299static int
7300test_xmlCtxtUseOptions(void) {
7301    int ret = 0;
7302
7303    int mem_base;
7304    int ret_val;
7305    xmlParserCtxtPtr ctxt; /* an XML parser context */
7306    int n_ctxt;
7307    int options; /* a combination of xmlParserOption */
7308    int n_options;
7309
7310    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7311    for (n_options = 0;n_options < gen_nb_int;n_options++) {
7312        mem_base = xmlMemBlocks();
7313        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7314        options = gen_int(n_options, 1);
7315
7316        ret_val = xmlCtxtUseOptions(ctxt, options);
7317        desret_int(ret_val);
7318        call_tests++;
7319        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7320        des_int(n_options, options, 1);
7321        xmlResetLastError();
7322        if (mem_base != xmlMemBlocks()) {
7323            printf("Leak of %d blocks found in xmlCtxtUseOptions",
7324	           xmlMemBlocks() - mem_base);
7325	    ret++;
7326            printf(" %d", n_ctxt);
7327            printf(" %d", n_options);
7328            printf("\n");
7329        }
7330    }
7331    }
7332
7333    function_tests++;
7334    return(ret);
7335}
7336
7337
7338static int
7339test_xmlGetExternalEntityLoader(void) {
7340    int ret = 0;
7341
7342
7343    /* missing type support */
7344    return(ret);
7345}
7346
7347
7348static int
7349test_xmlGetFeature(void) {
7350    int ret = 0;
7351
7352    int mem_base;
7353    int ret_val;
7354    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
7355    int n_ctxt;
7356    const char * name; /* the feature name */
7357    int n_name;
7358    void * result; /* location to store the result */
7359    int n_result;
7360
7361    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7362    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
7363    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
7364        mem_base = xmlMemBlocks();
7365        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7366        name = gen_const_char_ptr(n_name, 1);
7367        result = gen_void_ptr(n_result, 2);
7368
7369        ret_val = xmlGetFeature(ctxt, name, result);
7370        desret_int(ret_val);
7371        call_tests++;
7372        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7373        des_const_char_ptr(n_name, name, 1);
7374        des_void_ptr(n_result, result, 2);
7375        xmlResetLastError();
7376        if (mem_base != xmlMemBlocks()) {
7377            printf("Leak of %d blocks found in xmlGetFeature",
7378	           xmlMemBlocks() - mem_base);
7379	    ret++;
7380            printf(" %d", n_ctxt);
7381            printf(" %d", n_name);
7382            printf(" %d", n_result);
7383            printf("\n");
7384        }
7385    }
7386    }
7387    }
7388
7389    function_tests++;
7390    return(ret);
7391}
7392
7393
7394static int
7395test_xmlGetFeaturesList(void) {
7396    int ret = 0;
7397
7398
7399    /* missing type support */
7400    return(ret);
7401}
7402
7403
7404static int
7405test_xmlIOParseDTD(void) {
7406    int ret = 0;
7407
7408    int mem_base;
7409    xmlDtdPtr ret_val;
7410    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
7411    int n_sax;
7412    xmlParserInputBufferPtr input; /* an Input Buffer */
7413    int n_input;
7414    xmlCharEncoding enc; /* the charset encoding if known */
7415    int n_enc;
7416
7417    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
7418    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
7419    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
7420        mem_base = xmlMemBlocks();
7421        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
7422        input = gen_xmlParserInputBufferPtr(n_input, 1);
7423        enc = gen_xmlCharEncoding(n_enc, 2);
7424
7425        ret_val = xmlIOParseDTD(sax, input, enc);
7426        input = NULL;
7427        desret_xmlDtdPtr(ret_val);
7428        call_tests++;
7429        des_xmlSAXHandlerPtr(n_sax, sax, 0);
7430        des_xmlParserInputBufferPtr(n_input, input, 1);
7431        des_xmlCharEncoding(n_enc, enc, 2);
7432        xmlResetLastError();
7433        if (mem_base != xmlMemBlocks()) {
7434            printf("Leak of %d blocks found in xmlIOParseDTD",
7435	           xmlMemBlocks() - mem_base);
7436	    ret++;
7437            printf(" %d", n_sax);
7438            printf(" %d", n_input);
7439            printf(" %d", n_enc);
7440            printf("\n");
7441        }
7442    }
7443    }
7444    }
7445
7446    function_tests++;
7447    return(ret);
7448}
7449
7450
7451static int
7452test_xmlInitNodeInfoSeq(void) {
7453    int ret = 0;
7454
7455
7456    /* missing type support */
7457    return(ret);
7458}
7459
7460
7461static int
7462test_xmlInitParser(void) {
7463    int ret = 0;
7464
7465    int mem_base;
7466
7467        mem_base = xmlMemBlocks();
7468
7469        xmlInitParser();
7470        call_tests++;
7471        xmlResetLastError();
7472        if (mem_base != xmlMemBlocks()) {
7473            printf("Leak of %d blocks found in xmlInitParser",
7474	           xmlMemBlocks() - mem_base);
7475	    ret++;
7476            printf("\n");
7477        }
7478
7479    function_tests++;
7480    return(ret);
7481}
7482
7483
7484static int
7485test_xmlInitParserCtxt(void) {
7486    int ret = 0;
7487
7488    int mem_base;
7489    int ret_val;
7490    xmlParserCtxtPtr ctxt; /* an XML parser context */
7491    int n_ctxt;
7492
7493    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7494        mem_base = xmlMemBlocks();
7495        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7496
7497        ret_val = xmlInitParserCtxt(ctxt);
7498        desret_int(ret_val);
7499        call_tests++;
7500        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7501        xmlResetLastError();
7502        if (mem_base != xmlMemBlocks()) {
7503            printf("Leak of %d blocks found in xmlInitParserCtxt",
7504	           xmlMemBlocks() - mem_base);
7505	    ret++;
7506            printf(" %d", n_ctxt);
7507            printf("\n");
7508        }
7509    }
7510
7511    function_tests++;
7512    return(ret);
7513}
7514
7515
7516static int
7517test_xmlKeepBlanksDefault(void) {
7518    int ret = 0;
7519
7520    int mem_base;
7521    int ret_val;
7522    int val; /* int 0 or 1 */
7523    int n_val;
7524
7525    for (n_val = 0;n_val < gen_nb_int;n_val++) {
7526        mem_base = xmlMemBlocks();
7527        val = gen_int(n_val, 0);
7528
7529        ret_val = xmlKeepBlanksDefault(val);
7530        desret_int(ret_val);
7531        call_tests++;
7532        des_int(n_val, val, 0);
7533        xmlResetLastError();
7534        if (mem_base != xmlMemBlocks()) {
7535            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
7536	           xmlMemBlocks() - mem_base);
7537	    ret++;
7538            printf(" %d", n_val);
7539            printf("\n");
7540        }
7541    }
7542
7543    function_tests++;
7544    return(ret);
7545}
7546
7547
7548static int
7549test_xmlLineNumbersDefault(void) {
7550    int ret = 0;
7551
7552    int mem_base;
7553    int ret_val;
7554    int val; /* int 0 or 1 */
7555    int n_val;
7556
7557    for (n_val = 0;n_val < gen_nb_int;n_val++) {
7558        mem_base = xmlMemBlocks();
7559        val = gen_int(n_val, 0);
7560
7561        ret_val = xmlLineNumbersDefault(val);
7562        desret_int(ret_val);
7563        call_tests++;
7564        des_int(n_val, val, 0);
7565        xmlResetLastError();
7566        if (mem_base != xmlMemBlocks()) {
7567            printf("Leak of %d blocks found in xmlLineNumbersDefault",
7568	           xmlMemBlocks() - mem_base);
7569	    ret++;
7570            printf(" %d", n_val);
7571            printf("\n");
7572        }
7573    }
7574
7575    function_tests++;
7576    return(ret);
7577}
7578
7579
7580static int
7581test_xmlLoadExternalEntity(void) {
7582    int ret = 0;
7583
7584
7585    /* missing type support */
7586    return(ret);
7587}
7588
7589
7590static int
7591test_xmlNewIOInputStream(void) {
7592    int ret = 0;
7593
7594
7595    /* missing type support */
7596    return(ret);
7597}
7598
7599
7600static int
7601test_xmlNewParserCtxt(void) {
7602    int ret = 0;
7603
7604    int mem_base;
7605    xmlParserCtxtPtr ret_val;
7606
7607        mem_base = xmlMemBlocks();
7608
7609        ret_val = xmlNewParserCtxt();
7610        desret_xmlParserCtxtPtr(ret_val);
7611        call_tests++;
7612        xmlResetLastError();
7613        if (mem_base != xmlMemBlocks()) {
7614            printf("Leak of %d blocks found in xmlNewParserCtxt",
7615	           xmlMemBlocks() - mem_base);
7616	    ret++;
7617            printf("\n");
7618        }
7619
7620    function_tests++;
7621    return(ret);
7622}
7623
7624
7625static int
7626test_xmlParseBalancedChunkMemory(void) {
7627    int ret = 0;
7628
7629
7630    /* missing type support */
7631    return(ret);
7632}
7633
7634
7635static int
7636test_xmlParseBalancedChunkMemoryRecover(void) {
7637    int ret = 0;
7638
7639
7640    /* missing type support */
7641    return(ret);
7642}
7643
7644
7645static int
7646test_xmlParseChunk(void) {
7647    int ret = 0;
7648
7649#ifdef LIBXML_PUSH_ENABLED
7650    int mem_base;
7651    int ret_val;
7652    xmlParserCtxtPtr ctxt; /* an XML parser context */
7653    int n_ctxt;
7654    const char * chunk; /* an char array */
7655    int n_chunk;
7656    int size; /* the size in byte of the chunk */
7657    int n_size;
7658    int terminate; /* last chunk indicator */
7659    int n_terminate;
7660
7661    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7662    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
7663    for (n_size = 0;n_size < gen_nb_int;n_size++) {
7664    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
7665        mem_base = xmlMemBlocks();
7666        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7667        chunk = gen_const_char_ptr(n_chunk, 1);
7668        size = gen_int(n_size, 2);
7669        terminate = gen_int(n_terminate, 3);
7670
7671        ret_val = xmlParseChunk(ctxt, chunk, size, terminate);
7672        desret_int(ret_val);
7673        call_tests++;
7674        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7675        des_const_char_ptr(n_chunk, chunk, 1);
7676        des_int(n_size, size, 2);
7677        des_int(n_terminate, terminate, 3);
7678        xmlResetLastError();
7679        if (mem_base != xmlMemBlocks()) {
7680            printf("Leak of %d blocks found in xmlParseChunk",
7681	           xmlMemBlocks() - mem_base);
7682	    ret++;
7683            printf(" %d", n_ctxt);
7684            printf(" %d", n_chunk);
7685            printf(" %d", n_size);
7686            printf(" %d", n_terminate);
7687            printf("\n");
7688        }
7689    }
7690    }
7691    }
7692    }
7693#endif
7694
7695    function_tests++;
7696    return(ret);
7697}
7698
7699
7700static int
7701test_xmlParseCtxtExternalEntity(void) {
7702    int ret = 0;
7703
7704
7705    /* missing type support */
7706    return(ret);
7707}
7708
7709
7710static int
7711test_xmlParseDTD(void) {
7712    int ret = 0;
7713
7714    int mem_base;
7715    xmlDtdPtr ret_val;
7716    const xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
7717    int n_ExternalID;
7718    const xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
7719    int n_SystemID;
7720
7721    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
7722    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
7723        mem_base = xmlMemBlocks();
7724        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
7725        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
7726
7727        ret_val = xmlParseDTD(ExternalID, SystemID);
7728        desret_xmlDtdPtr(ret_val);
7729        call_tests++;
7730        des_const_xmlChar_ptr(n_ExternalID, ExternalID, 0);
7731        des_const_xmlChar_ptr(n_SystemID, SystemID, 1);
7732        xmlResetLastError();
7733        if (mem_base != xmlMemBlocks()) {
7734            printf("Leak of %d blocks found in xmlParseDTD",
7735	           xmlMemBlocks() - mem_base);
7736	    ret++;
7737            printf(" %d", n_ExternalID);
7738            printf(" %d", n_SystemID);
7739            printf("\n");
7740        }
7741    }
7742    }
7743
7744    function_tests++;
7745    return(ret);
7746}
7747
7748
7749static int
7750test_xmlParseDoc(void) {
7751    int ret = 0;
7752
7753    int mem_base;
7754    xmlDocPtr ret_val;
7755    xmlChar * cur; /* a pointer to an array of xmlChar */
7756    int n_cur;
7757
7758    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
7759        mem_base = xmlMemBlocks();
7760        cur = gen_xmlChar_ptr(n_cur, 0);
7761
7762        ret_val = xmlParseDoc(cur);
7763        desret_xmlDocPtr(ret_val);
7764        call_tests++;
7765        des_xmlChar_ptr(n_cur, cur, 0);
7766        xmlResetLastError();
7767        if (mem_base != xmlMemBlocks()) {
7768            printf("Leak of %d blocks found in xmlParseDoc",
7769	           xmlMemBlocks() - mem_base);
7770	    ret++;
7771            printf(" %d", n_cur);
7772            printf("\n");
7773        }
7774    }
7775
7776    function_tests++;
7777    return(ret);
7778}
7779
7780
7781static int
7782test_xmlParseDocument(void) {
7783    int ret = 0;
7784
7785    int mem_base;
7786    int ret_val;
7787    xmlParserCtxtPtr ctxt; /* an XML parser context */
7788    int n_ctxt;
7789
7790    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7791        mem_base = xmlMemBlocks();
7792        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7793
7794        ret_val = xmlParseDocument(ctxt);
7795        desret_int(ret_val);
7796        call_tests++;
7797        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7798        xmlResetLastError();
7799        if (mem_base != xmlMemBlocks()) {
7800            printf("Leak of %d blocks found in xmlParseDocument",
7801	           xmlMemBlocks() - mem_base);
7802	    ret++;
7803            printf(" %d", n_ctxt);
7804            printf("\n");
7805        }
7806    }
7807
7808    function_tests++;
7809    return(ret);
7810}
7811
7812
7813static int
7814test_xmlParseEntity(void) {
7815    int ret = 0;
7816
7817    int mem_base;
7818    xmlDocPtr ret_val;
7819    const char * filename; /* the filename */
7820    int n_filename;
7821
7822    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
7823        mem_base = xmlMemBlocks();
7824        filename = gen_filepath(n_filename, 0);
7825
7826        ret_val = xmlParseEntity(filename);
7827        desret_xmlDocPtr(ret_val);
7828        call_tests++;
7829        des_filepath(n_filename, filename, 0);
7830        xmlResetLastError();
7831        if (mem_base != xmlMemBlocks()) {
7832            printf("Leak of %d blocks found in xmlParseEntity",
7833	           xmlMemBlocks() - mem_base);
7834	    ret++;
7835            printf(" %d", n_filename);
7836            printf("\n");
7837        }
7838    }
7839
7840    function_tests++;
7841    return(ret);
7842}
7843
7844
7845static int
7846test_xmlParseExtParsedEnt(void) {
7847    int ret = 0;
7848
7849    int mem_base;
7850    int ret_val;
7851    xmlParserCtxtPtr ctxt; /* an XML parser context */
7852    int n_ctxt;
7853
7854    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
7855        mem_base = xmlMemBlocks();
7856        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
7857
7858        ret_val = xmlParseExtParsedEnt(ctxt);
7859        desret_int(ret_val);
7860        call_tests++;
7861        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
7862        xmlResetLastError();
7863        if (mem_base != xmlMemBlocks()) {
7864            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
7865	           xmlMemBlocks() - mem_base);
7866	    ret++;
7867            printf(" %d", n_ctxt);
7868            printf("\n");
7869        }
7870    }
7871
7872    function_tests++;
7873    return(ret);
7874}
7875
7876
7877static int
7878test_xmlParseExternalEntity(void) {
7879    int ret = 0;
7880
7881
7882    /* missing type support */
7883    return(ret);
7884}
7885
7886
7887static int
7888test_xmlParseFile(void) {
7889    int ret = 0;
7890
7891    int mem_base;
7892    xmlDocPtr ret_val;
7893    const char * filename; /* the filename */
7894    int n_filename;
7895
7896    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
7897        mem_base = xmlMemBlocks();
7898        filename = gen_filepath(n_filename, 0);
7899
7900        ret_val = xmlParseFile(filename);
7901        desret_xmlDocPtr(ret_val);
7902        call_tests++;
7903        des_filepath(n_filename, filename, 0);
7904        xmlResetLastError();
7905        if (mem_base != xmlMemBlocks()) {
7906            printf("Leak of %d blocks found in xmlParseFile",
7907	           xmlMemBlocks() - mem_base);
7908	    ret++;
7909            printf(" %d", n_filename);
7910            printf("\n");
7911        }
7912    }
7913
7914    function_tests++;
7915    return(ret);
7916}
7917
7918
7919static int
7920test_xmlParseInNodeContext(void) {
7921    int ret = 0;
7922
7923
7924    /* missing type support */
7925    return(ret);
7926}
7927
7928
7929static int
7930test_xmlParseMemory(void) {
7931    int ret = 0;
7932
7933    int mem_base;
7934    xmlDocPtr ret_val;
7935    const char * buffer; /* an pointer to a char array */
7936    int n_buffer;
7937    int size; /* the size of the array */
7938    int n_size;
7939
7940    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
7941    for (n_size = 0;n_size < gen_nb_int;n_size++) {
7942        mem_base = xmlMemBlocks();
7943        buffer = gen_const_char_ptr(n_buffer, 0);
7944        size = gen_int(n_size, 1);
7945
7946        ret_val = xmlParseMemory(buffer, size);
7947        desret_xmlDocPtr(ret_val);
7948        call_tests++;
7949        des_const_char_ptr(n_buffer, buffer, 0);
7950        des_int(n_size, size, 1);
7951        xmlResetLastError();
7952        if (mem_base != xmlMemBlocks()) {
7953            printf("Leak of %d blocks found in xmlParseMemory",
7954	           xmlMemBlocks() - mem_base);
7955	    ret++;
7956            printf(" %d", n_buffer);
7957            printf(" %d", n_size);
7958            printf("\n");
7959        }
7960    }
7961    }
7962
7963    function_tests++;
7964    return(ret);
7965}
7966
7967
7968static int
7969test_xmlParserAddNodeInfo(void) {
7970    int ret = 0;
7971
7972
7973    /* missing type support */
7974    return(ret);
7975}
7976
7977
7978static int
7979test_xmlParserFindNodeInfo(void) {
7980    int ret = 0;
7981
7982
7983    /* missing type support */
7984    return(ret);
7985}
7986
7987
7988static int
7989test_xmlParserFindNodeInfoIndex(void) {
7990    int ret = 0;
7991
7992
7993    /* missing type support */
7994    return(ret);
7995}
7996
7997
7998static int
7999test_xmlParserInputGrow(void) {
8000    int ret = 0;
8001
8002
8003    /* missing type support */
8004    return(ret);
8005}
8006
8007
8008static int
8009test_xmlParserInputRead(void) {
8010    int ret = 0;
8011
8012
8013    /* missing type support */
8014    return(ret);
8015}
8016
8017
8018static int
8019test_xmlPedanticParserDefault(void) {
8020    int ret = 0;
8021
8022    int mem_base;
8023    int ret_val;
8024    int val; /* int 0 or 1 */
8025    int n_val;
8026
8027    for (n_val = 0;n_val < gen_nb_int;n_val++) {
8028        mem_base = xmlMemBlocks();
8029        val = gen_int(n_val, 0);
8030
8031        ret_val = xmlPedanticParserDefault(val);
8032        desret_int(ret_val);
8033        call_tests++;
8034        des_int(n_val, val, 0);
8035        xmlResetLastError();
8036        if (mem_base != xmlMemBlocks()) {
8037            printf("Leak of %d blocks found in xmlPedanticParserDefault",
8038	           xmlMemBlocks() - mem_base);
8039	    ret++;
8040            printf(" %d", n_val);
8041            printf("\n");
8042        }
8043    }
8044
8045    function_tests++;
8046    return(ret);
8047}
8048
8049
8050static int
8051test_xmlReadDoc(void) {
8052    int ret = 0;
8053
8054    int mem_base;
8055    xmlDocPtr ret_val;
8056    const xmlChar * cur; /* a pointer to a zero terminated string */
8057    int n_cur;
8058    const char * URL; /* the base URL to use for the document */
8059    int n_URL;
8060    const char * encoding; /* the document encoding, or NULL */
8061    int n_encoding;
8062    int options; /* a combination of xmlParserOption */
8063    int n_options;
8064
8065    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
8066    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
8067    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
8068    for (n_options = 0;n_options < gen_nb_int;n_options++) {
8069        mem_base = xmlMemBlocks();
8070        cur = gen_const_xmlChar_ptr(n_cur, 0);
8071        URL = gen_filepath(n_URL, 1);
8072        encoding = gen_const_char_ptr(n_encoding, 2);
8073        options = gen_int(n_options, 3);
8074
8075        ret_val = xmlReadDoc(cur, URL, encoding, options);
8076        desret_xmlDocPtr(ret_val);
8077        call_tests++;
8078        des_const_xmlChar_ptr(n_cur, cur, 0);
8079        des_filepath(n_URL, URL, 1);
8080        des_const_char_ptr(n_encoding, encoding, 2);
8081        des_int(n_options, options, 3);
8082        xmlResetLastError();
8083        if (mem_base != xmlMemBlocks()) {
8084            printf("Leak of %d blocks found in xmlReadDoc",
8085	           xmlMemBlocks() - mem_base);
8086	    ret++;
8087            printf(" %d", n_cur);
8088            printf(" %d", n_URL);
8089            printf(" %d", n_encoding);
8090            printf(" %d", n_options);
8091            printf("\n");
8092        }
8093    }
8094    }
8095    }
8096    }
8097
8098    function_tests++;
8099    return(ret);
8100}
8101
8102
8103static int
8104test_xmlReadFile(void) {
8105    int ret = 0;
8106
8107    int mem_base;
8108    xmlDocPtr ret_val;
8109    const char * filename; /* a file or URL */
8110    int n_filename;
8111    const char * encoding; /* the document encoding, or NULL */
8112    int n_encoding;
8113    int options; /* a combination of xmlParserOption */
8114    int n_options;
8115
8116    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
8117    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
8118    for (n_options = 0;n_options < gen_nb_int;n_options++) {
8119        mem_base = xmlMemBlocks();
8120        filename = gen_filepath(n_filename, 0);
8121        encoding = gen_const_char_ptr(n_encoding, 1);
8122        options = gen_int(n_options, 2);
8123
8124        ret_val = xmlReadFile(filename, encoding, options);
8125        desret_xmlDocPtr(ret_val);
8126        call_tests++;
8127        des_filepath(n_filename, filename, 0);
8128        des_const_char_ptr(n_encoding, encoding, 1);
8129        des_int(n_options, options, 2);
8130        xmlResetLastError();
8131        if (mem_base != xmlMemBlocks()) {
8132            printf("Leak of %d blocks found in xmlReadFile",
8133	           xmlMemBlocks() - mem_base);
8134	    ret++;
8135            printf(" %d", n_filename);
8136            printf(" %d", n_encoding);
8137            printf(" %d", n_options);
8138            printf("\n");
8139        }
8140    }
8141    }
8142    }
8143
8144    function_tests++;
8145    return(ret);
8146}
8147
8148
8149static int
8150test_xmlReadMemory(void) {
8151    int ret = 0;
8152
8153    int mem_base;
8154    xmlDocPtr ret_val;
8155    const char * buffer; /* a pointer to a char array */
8156    int n_buffer;
8157    int size; /* the size of the array */
8158    int n_size;
8159    const char * URL; /* the base URL to use for the document */
8160    int n_URL;
8161    const char * encoding; /* the document encoding, or NULL */
8162    int n_encoding;
8163    int options; /* a combination of xmlParserOption */
8164    int n_options;
8165
8166    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
8167    for (n_size = 0;n_size < gen_nb_int;n_size++) {
8168    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
8169    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
8170    for (n_options = 0;n_options < gen_nb_int;n_options++) {
8171        mem_base = xmlMemBlocks();
8172        buffer = gen_const_char_ptr(n_buffer, 0);
8173        size = gen_int(n_size, 1);
8174        URL = gen_filepath(n_URL, 2);
8175        encoding = gen_const_char_ptr(n_encoding, 3);
8176        options = gen_int(n_options, 4);
8177
8178        ret_val = xmlReadMemory(buffer, size, URL, encoding, options);
8179        desret_xmlDocPtr(ret_val);
8180        call_tests++;
8181        des_const_char_ptr(n_buffer, buffer, 0);
8182        des_int(n_size, size, 1);
8183        des_filepath(n_URL, URL, 2);
8184        des_const_char_ptr(n_encoding, encoding, 3);
8185        des_int(n_options, options, 4);
8186        xmlResetLastError();
8187        if (mem_base != xmlMemBlocks()) {
8188            printf("Leak of %d blocks found in xmlReadMemory",
8189	           xmlMemBlocks() - mem_base);
8190	    ret++;
8191            printf(" %d", n_buffer);
8192            printf(" %d", n_size);
8193            printf(" %d", n_URL);
8194            printf(" %d", n_encoding);
8195            printf(" %d", n_options);
8196            printf("\n");
8197        }
8198    }
8199    }
8200    }
8201    }
8202    }
8203
8204    function_tests++;
8205    return(ret);
8206}
8207
8208
8209static int
8210test_xmlRecoverDoc(void) {
8211    int ret = 0;
8212
8213    int mem_base;
8214    xmlDocPtr ret_val;
8215    xmlChar * cur; /* a pointer to an array of xmlChar */
8216    int n_cur;
8217
8218    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
8219        mem_base = xmlMemBlocks();
8220        cur = gen_xmlChar_ptr(n_cur, 0);
8221
8222        ret_val = xmlRecoverDoc(cur);
8223        desret_xmlDocPtr(ret_val);
8224        call_tests++;
8225        des_xmlChar_ptr(n_cur, cur, 0);
8226        xmlResetLastError();
8227        if (mem_base != xmlMemBlocks()) {
8228            printf("Leak of %d blocks found in xmlRecoverDoc",
8229	           xmlMemBlocks() - mem_base);
8230	    ret++;
8231            printf(" %d", n_cur);
8232            printf("\n");
8233        }
8234    }
8235
8236    function_tests++;
8237    return(ret);
8238}
8239
8240
8241static int
8242test_xmlRecoverFile(void) {
8243    int ret = 0;
8244
8245    int mem_base;
8246    xmlDocPtr ret_val;
8247    const char * filename; /* the filename */
8248    int n_filename;
8249
8250    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
8251        mem_base = xmlMemBlocks();
8252        filename = gen_filepath(n_filename, 0);
8253
8254        ret_val = xmlRecoverFile(filename);
8255        desret_xmlDocPtr(ret_val);
8256        call_tests++;
8257        des_filepath(n_filename, filename, 0);
8258        xmlResetLastError();
8259        if (mem_base != xmlMemBlocks()) {
8260            printf("Leak of %d blocks found in xmlRecoverFile",
8261	           xmlMemBlocks() - mem_base);
8262	    ret++;
8263            printf(" %d", n_filename);
8264            printf("\n");
8265        }
8266    }
8267
8268    function_tests++;
8269    return(ret);
8270}
8271
8272
8273static int
8274test_xmlRecoverMemory(void) {
8275    int ret = 0;
8276
8277    int mem_base;
8278    xmlDocPtr ret_val;
8279    const char * buffer; /* an pointer to a char array */
8280    int n_buffer;
8281    int size; /* the size of the array */
8282    int n_size;
8283
8284    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
8285    for (n_size = 0;n_size < gen_nb_int;n_size++) {
8286        mem_base = xmlMemBlocks();
8287        buffer = gen_const_char_ptr(n_buffer, 0);
8288        size = gen_int(n_size, 1);
8289
8290        ret_val = xmlRecoverMemory(buffer, size);
8291        desret_xmlDocPtr(ret_val);
8292        call_tests++;
8293        des_const_char_ptr(n_buffer, buffer, 0);
8294        des_int(n_size, size, 1);
8295        xmlResetLastError();
8296        if (mem_base != xmlMemBlocks()) {
8297            printf("Leak of %d blocks found in xmlRecoverMemory",
8298	           xmlMemBlocks() - mem_base);
8299	    ret++;
8300            printf(" %d", n_buffer);
8301            printf(" %d", n_size);
8302            printf("\n");
8303        }
8304    }
8305    }
8306
8307    function_tests++;
8308    return(ret);
8309}
8310
8311
8312static int
8313test_xmlSAXParseDTD(void) {
8314    int ret = 0;
8315
8316    int mem_base;
8317    xmlDtdPtr ret_val;
8318    xmlSAXHandlerPtr sax; /* the SAX handler block */
8319    int n_sax;
8320    const xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
8321    int n_ExternalID;
8322    const xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
8323    int n_SystemID;
8324
8325    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8326    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
8327    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
8328        mem_base = xmlMemBlocks();
8329        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8330        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
8331        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
8332
8333        ret_val = xmlSAXParseDTD(sax, ExternalID, SystemID);
8334        desret_xmlDtdPtr(ret_val);
8335        call_tests++;
8336        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8337        des_const_xmlChar_ptr(n_ExternalID, ExternalID, 1);
8338        des_const_xmlChar_ptr(n_SystemID, SystemID, 2);
8339        xmlResetLastError();
8340        if (mem_base != xmlMemBlocks()) {
8341            printf("Leak of %d blocks found in xmlSAXParseDTD",
8342	           xmlMemBlocks() - mem_base);
8343	    ret++;
8344            printf(" %d", n_sax);
8345            printf(" %d", n_ExternalID);
8346            printf(" %d", n_SystemID);
8347            printf("\n");
8348        }
8349    }
8350    }
8351    }
8352
8353    function_tests++;
8354    return(ret);
8355}
8356
8357
8358static int
8359test_xmlSAXParseDoc(void) {
8360    int ret = 0;
8361
8362    int mem_base;
8363    xmlDocPtr ret_val;
8364    xmlSAXHandlerPtr sax; /* the SAX handler block */
8365    int n_sax;
8366    xmlChar * cur; /* a pointer to an array of xmlChar */
8367    int n_cur;
8368    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
8369    int n_recovery;
8370
8371    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8372    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
8373    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
8374        mem_base = xmlMemBlocks();
8375        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8376        cur = gen_xmlChar_ptr(n_cur, 1);
8377        recovery = gen_int(n_recovery, 2);
8378
8379        ret_val = xmlSAXParseDoc(sax, cur, recovery);
8380        desret_xmlDocPtr(ret_val);
8381        call_tests++;
8382        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8383        des_xmlChar_ptr(n_cur, cur, 1);
8384        des_int(n_recovery, recovery, 2);
8385        xmlResetLastError();
8386        if (mem_base != xmlMemBlocks()) {
8387            printf("Leak of %d blocks found in xmlSAXParseDoc",
8388	           xmlMemBlocks() - mem_base);
8389	    ret++;
8390            printf(" %d", n_sax);
8391            printf(" %d", n_cur);
8392            printf(" %d", n_recovery);
8393            printf("\n");
8394        }
8395    }
8396    }
8397    }
8398
8399    function_tests++;
8400    return(ret);
8401}
8402
8403
8404static int
8405test_xmlSAXParseEntity(void) {
8406    int ret = 0;
8407
8408    int mem_base;
8409    xmlDocPtr ret_val;
8410    xmlSAXHandlerPtr sax; /* the SAX handler block */
8411    int n_sax;
8412    const char * filename; /* the filename */
8413    int n_filename;
8414
8415    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8416    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
8417        mem_base = xmlMemBlocks();
8418        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8419        filename = gen_filepath(n_filename, 1);
8420
8421        ret_val = xmlSAXParseEntity(sax, filename);
8422        desret_xmlDocPtr(ret_val);
8423        call_tests++;
8424        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8425        des_filepath(n_filename, filename, 1);
8426        xmlResetLastError();
8427        if (mem_base != xmlMemBlocks()) {
8428            printf("Leak of %d blocks found in xmlSAXParseEntity",
8429	           xmlMemBlocks() - mem_base);
8430	    ret++;
8431            printf(" %d", n_sax);
8432            printf(" %d", n_filename);
8433            printf("\n");
8434        }
8435    }
8436    }
8437
8438    function_tests++;
8439    return(ret);
8440}
8441
8442
8443static int
8444test_xmlSAXParseFile(void) {
8445    int ret = 0;
8446
8447    int mem_base;
8448    xmlDocPtr ret_val;
8449    xmlSAXHandlerPtr sax; /* the SAX handler block */
8450    int n_sax;
8451    const char * filename; /* the filename */
8452    int n_filename;
8453    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
8454    int n_recovery;
8455
8456    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8457    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
8458    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
8459        mem_base = xmlMemBlocks();
8460        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8461        filename = gen_filepath(n_filename, 1);
8462        recovery = gen_int(n_recovery, 2);
8463
8464        ret_val = xmlSAXParseFile(sax, filename, recovery);
8465        desret_xmlDocPtr(ret_val);
8466        call_tests++;
8467        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8468        des_filepath(n_filename, filename, 1);
8469        des_int(n_recovery, recovery, 2);
8470        xmlResetLastError();
8471        if (mem_base != xmlMemBlocks()) {
8472            printf("Leak of %d blocks found in xmlSAXParseFile",
8473	           xmlMemBlocks() - mem_base);
8474	    ret++;
8475            printf(" %d", n_sax);
8476            printf(" %d", n_filename);
8477            printf(" %d", n_recovery);
8478            printf("\n");
8479        }
8480    }
8481    }
8482    }
8483
8484    function_tests++;
8485    return(ret);
8486}
8487
8488
8489static int
8490test_xmlSAXParseFileWithData(void) {
8491    int ret = 0;
8492
8493    int mem_base;
8494    xmlDocPtr ret_val;
8495    xmlSAXHandlerPtr sax; /* the SAX handler block */
8496    int n_sax;
8497    const char * filename; /* the filename */
8498    int n_filename;
8499    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
8500    int n_recovery;
8501    void * data; /* the userdata */
8502    int n_data;
8503
8504    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8505    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
8506    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
8507    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
8508        mem_base = xmlMemBlocks();
8509        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8510        filename = gen_filepath(n_filename, 1);
8511        recovery = gen_int(n_recovery, 2);
8512        data = gen_userdata(n_data, 3);
8513
8514        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
8515        desret_xmlDocPtr(ret_val);
8516        call_tests++;
8517        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8518        des_filepath(n_filename, filename, 1);
8519        des_int(n_recovery, recovery, 2);
8520        des_userdata(n_data, data, 3);
8521        xmlResetLastError();
8522        if (mem_base != xmlMemBlocks()) {
8523            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
8524	           xmlMemBlocks() - mem_base);
8525	    ret++;
8526            printf(" %d", n_sax);
8527            printf(" %d", n_filename);
8528            printf(" %d", n_recovery);
8529            printf(" %d", n_data);
8530            printf("\n");
8531        }
8532    }
8533    }
8534    }
8535    }
8536
8537    function_tests++;
8538    return(ret);
8539}
8540
8541
8542static int
8543test_xmlSAXParseMemory(void) {
8544    int ret = 0;
8545
8546    int mem_base;
8547    xmlDocPtr ret_val;
8548    xmlSAXHandlerPtr sax; /* the SAX handler block */
8549    int n_sax;
8550    const char * buffer; /* an pointer to a char array */
8551    int n_buffer;
8552    int size; /* the size of the array */
8553    int n_size;
8554    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
8555    int n_recovery;
8556
8557    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8558    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
8559    for (n_size = 0;n_size < gen_nb_int;n_size++) {
8560    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
8561        mem_base = xmlMemBlocks();
8562        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8563        buffer = gen_const_char_ptr(n_buffer, 1);
8564        size = gen_int(n_size, 2);
8565        recovery = gen_int(n_recovery, 3);
8566
8567        ret_val = xmlSAXParseMemory(sax, buffer, size, recovery);
8568        desret_xmlDocPtr(ret_val);
8569        call_tests++;
8570        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8571        des_const_char_ptr(n_buffer, buffer, 1);
8572        des_int(n_size, size, 2);
8573        des_int(n_recovery, recovery, 3);
8574        xmlResetLastError();
8575        if (mem_base != xmlMemBlocks()) {
8576            printf("Leak of %d blocks found in xmlSAXParseMemory",
8577	           xmlMemBlocks() - mem_base);
8578	    ret++;
8579            printf(" %d", n_sax);
8580            printf(" %d", n_buffer);
8581            printf(" %d", n_size);
8582            printf(" %d", n_recovery);
8583            printf("\n");
8584        }
8585    }
8586    }
8587    }
8588    }
8589
8590    function_tests++;
8591    return(ret);
8592}
8593
8594
8595static int
8596test_xmlSAXParseMemoryWithData(void) {
8597    int ret = 0;
8598
8599    int mem_base;
8600    xmlDocPtr ret_val;
8601    xmlSAXHandlerPtr sax; /* the SAX handler block */
8602    int n_sax;
8603    const char * buffer; /* an pointer to a char array */
8604    int n_buffer;
8605    int size; /* the size of the array */
8606    int n_size;
8607    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
8608    int n_recovery;
8609    void * data; /* the userdata */
8610    int n_data;
8611
8612    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8613    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
8614    for (n_size = 0;n_size < gen_nb_int;n_size++) {
8615    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
8616    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
8617        mem_base = xmlMemBlocks();
8618        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8619        buffer = gen_const_char_ptr(n_buffer, 1);
8620        size = gen_int(n_size, 2);
8621        recovery = gen_int(n_recovery, 3);
8622        data = gen_userdata(n_data, 4);
8623
8624        ret_val = xmlSAXParseMemoryWithData(sax, buffer, size, recovery, data);
8625        desret_xmlDocPtr(ret_val);
8626        call_tests++;
8627        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8628        des_const_char_ptr(n_buffer, buffer, 1);
8629        des_int(n_size, size, 2);
8630        des_int(n_recovery, recovery, 3);
8631        des_userdata(n_data, data, 4);
8632        xmlResetLastError();
8633        if (mem_base != xmlMemBlocks()) {
8634            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
8635	           xmlMemBlocks() - mem_base);
8636	    ret++;
8637            printf(" %d", n_sax);
8638            printf(" %d", n_buffer);
8639            printf(" %d", n_size);
8640            printf(" %d", n_recovery);
8641            printf(" %d", n_data);
8642            printf("\n");
8643        }
8644    }
8645    }
8646    }
8647    }
8648    }
8649
8650    function_tests++;
8651    return(ret);
8652}
8653
8654
8655static int
8656test_xmlSAXUserParseFile(void) {
8657    int ret = 0;
8658
8659    int mem_base;
8660    int ret_val;
8661    xmlSAXHandlerPtr sax; /* a SAX handler */
8662    int n_sax;
8663    void * user_data; /* The user data returned on SAX callbacks */
8664    int n_user_data;
8665    const char * filename; /* a file name */
8666    int n_filename;
8667
8668    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8669    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
8670    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
8671        mem_base = xmlMemBlocks();
8672        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8673        user_data = gen_userdata(n_user_data, 1);
8674        filename = gen_filepath(n_filename, 2);
8675        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
8676
8677        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
8678        desret_int(ret_val);
8679        call_tests++;
8680        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8681        des_userdata(n_user_data, user_data, 1);
8682        des_filepath(n_filename, filename, 2);
8683        xmlResetLastError();
8684        if (mem_base != xmlMemBlocks()) {
8685            printf("Leak of %d blocks found in xmlSAXUserParseFile",
8686	           xmlMemBlocks() - mem_base);
8687	    ret++;
8688            printf(" %d", n_sax);
8689            printf(" %d", n_user_data);
8690            printf(" %d", n_filename);
8691            printf("\n");
8692        }
8693    }
8694    }
8695    }
8696
8697    function_tests++;
8698    return(ret);
8699}
8700
8701
8702static int
8703test_xmlSAXUserParseMemory(void) {
8704    int ret = 0;
8705
8706    int mem_base;
8707    int ret_val;
8708    xmlSAXHandlerPtr sax; /* a SAX handler */
8709    int n_sax;
8710    void * user_data; /* The user data returned on SAX callbacks */
8711    int n_user_data;
8712    const char * buffer; /* an in-memory XML document input */
8713    int n_buffer;
8714    int size; /* the length of the XML document in bytes */
8715    int n_size;
8716
8717    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
8718    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
8719    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
8720    for (n_size = 0;n_size < gen_nb_int;n_size++) {
8721        mem_base = xmlMemBlocks();
8722        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
8723        user_data = gen_userdata(n_user_data, 1);
8724        buffer = gen_const_char_ptr(n_buffer, 2);
8725        size = gen_int(n_size, 3);
8726        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
8727
8728        ret_val = xmlSAXUserParseMemory(sax, user_data, buffer, size);
8729        desret_int(ret_val);
8730        call_tests++;
8731        des_xmlSAXHandlerPtr(n_sax, sax, 0);
8732        des_userdata(n_user_data, user_data, 1);
8733        des_const_char_ptr(n_buffer, buffer, 2);
8734        des_int(n_size, size, 3);
8735        xmlResetLastError();
8736        if (mem_base != xmlMemBlocks()) {
8737            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
8738	           xmlMemBlocks() - mem_base);
8739	    ret++;
8740            printf(" %d", n_sax);
8741            printf(" %d", n_user_data);
8742            printf(" %d", n_buffer);
8743            printf(" %d", n_size);
8744            printf("\n");
8745        }
8746    }
8747    }
8748    }
8749    }
8750
8751    function_tests++;
8752    return(ret);
8753}
8754
8755
8756static int
8757test_xmlSetExternalEntityLoader(void) {
8758    int ret = 0;
8759
8760
8761    /* missing type support */
8762    return(ret);
8763}
8764
8765
8766static int
8767test_xmlSetFeature(void) {
8768    int ret = 0;
8769
8770    int mem_base;
8771    int ret_val;
8772    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
8773    int n_ctxt;
8774    const char * name; /* the feature name */
8775    int n_name;
8776    void * value; /* pointer to the location of the new value */
8777    int n_value;
8778
8779    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
8780    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8781    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
8782        mem_base = xmlMemBlocks();
8783        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
8784        name = gen_const_char_ptr(n_name, 1);
8785        value = gen_void_ptr(n_value, 2);
8786
8787        ret_val = xmlSetFeature(ctxt, name, value);
8788        desret_int(ret_val);
8789        call_tests++;
8790        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
8791        des_const_char_ptr(n_name, name, 1);
8792        des_void_ptr(n_value, value, 2);
8793        xmlResetLastError();
8794        if (mem_base != xmlMemBlocks()) {
8795            printf("Leak of %d blocks found in xmlSetFeature",
8796	           xmlMemBlocks() - mem_base);
8797	    ret++;
8798            printf(" %d", n_ctxt);
8799            printf(" %d", n_name);
8800            printf(" %d", n_value);
8801            printf("\n");
8802        }
8803    }
8804    }
8805    }
8806
8807    function_tests++;
8808    return(ret);
8809}
8810
8811
8812static int
8813test_xmlSetupParserForBuffer(void) {
8814    int ret = 0;
8815
8816    int mem_base;
8817    xmlParserCtxtPtr ctxt; /* an XML parser context */
8818    int n_ctxt;
8819    const xmlChar * buffer; /* a xmlChar * buffer */
8820    int n_buffer;
8821    const char * filename; /* a file name */
8822    int n_filename;
8823
8824    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
8825    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
8826    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
8827        mem_base = xmlMemBlocks();
8828        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
8829        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
8830        filename = gen_filepath(n_filename, 2);
8831
8832        xmlSetupParserForBuffer(ctxt, buffer, filename);
8833        call_tests++;
8834        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
8835        des_const_xmlChar_ptr(n_buffer, buffer, 1);
8836        des_filepath(n_filename, filename, 2);
8837        xmlResetLastError();
8838        if (mem_base != xmlMemBlocks()) {
8839            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
8840	           xmlMemBlocks() - mem_base);
8841	    ret++;
8842            printf(" %d", n_ctxt);
8843            printf(" %d", n_buffer);
8844            printf(" %d", n_filename);
8845            printf("\n");
8846        }
8847    }
8848    }
8849    }
8850
8851    function_tests++;
8852    return(ret);
8853}
8854
8855
8856static int
8857test_xmlStopParser(void) {
8858    int ret = 0;
8859
8860    int mem_base;
8861    xmlParserCtxtPtr ctxt; /* an XML parser context */
8862    int n_ctxt;
8863
8864    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
8865        mem_base = xmlMemBlocks();
8866        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
8867
8868        xmlStopParser(ctxt);
8869        call_tests++;
8870        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
8871        xmlResetLastError();
8872        if (mem_base != xmlMemBlocks()) {
8873            printf("Leak of %d blocks found in xmlStopParser",
8874	           xmlMemBlocks() - mem_base);
8875	    ret++;
8876            printf(" %d", n_ctxt);
8877            printf("\n");
8878        }
8879    }
8880
8881    function_tests++;
8882    return(ret);
8883}
8884
8885
8886static int
8887test_xmlSubstituteEntitiesDefault(void) {
8888    int ret = 0;
8889
8890    int mem_base;
8891    int ret_val;
8892    int val; /* int 0 or 1 */
8893    int n_val;
8894
8895    for (n_val = 0;n_val < gen_nb_int;n_val++) {
8896        mem_base = xmlMemBlocks();
8897        val = gen_int(n_val, 0);
8898
8899        ret_val = xmlSubstituteEntitiesDefault(val);
8900        desret_int(ret_val);
8901        call_tests++;
8902        des_int(n_val, val, 0);
8903        xmlResetLastError();
8904        if (mem_base != xmlMemBlocks()) {
8905            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
8906	           xmlMemBlocks() - mem_base);
8907	    ret++;
8908            printf(" %d", n_val);
8909            printf("\n");
8910        }
8911    }
8912
8913    function_tests++;
8914    return(ret);
8915}
8916
8917static int
8918test_parser(void) {
8919    int ret = 0;
8920
8921    printf("Testing parser : 45 of 69 functions ...\n");
8922    ret += test_xmlByteConsumed();
8923    ret += test_xmlClearNodeInfoSeq();
8924    ret += test_xmlClearParserCtxt();
8925    ret += test_xmlCreateDocParserCtxt();
8926    ret += test_xmlCreateIOParserCtxt();
8927    ret += test_xmlCreatePushParserCtxt();
8928    ret += test_xmlCtxtReadDoc();
8929    ret += test_xmlCtxtReadFile();
8930    ret += test_xmlCtxtReadMemory();
8931    ret += test_xmlCtxtReset();
8932    ret += test_xmlCtxtResetPush();
8933    ret += test_xmlCtxtUseOptions();
8934    ret += test_xmlGetExternalEntityLoader();
8935    ret += test_xmlGetFeature();
8936    ret += test_xmlGetFeaturesList();
8937    ret += test_xmlIOParseDTD();
8938    ret += test_xmlInitNodeInfoSeq();
8939    ret += test_xmlInitParser();
8940    ret += test_xmlInitParserCtxt();
8941    ret += test_xmlKeepBlanksDefault();
8942    ret += test_xmlLineNumbersDefault();
8943    ret += test_xmlLoadExternalEntity();
8944    ret += test_xmlNewIOInputStream();
8945    ret += test_xmlNewParserCtxt();
8946    ret += test_xmlParseBalancedChunkMemory();
8947    ret += test_xmlParseBalancedChunkMemoryRecover();
8948    ret += test_xmlParseChunk();
8949    ret += test_xmlParseCtxtExternalEntity();
8950    ret += test_xmlParseDTD();
8951    ret += test_xmlParseDoc();
8952    ret += test_xmlParseDocument();
8953    ret += test_xmlParseEntity();
8954    ret += test_xmlParseExtParsedEnt();
8955    ret += test_xmlParseExternalEntity();
8956    ret += test_xmlParseFile();
8957    ret += test_xmlParseInNodeContext();
8958    ret += test_xmlParseMemory();
8959    ret += test_xmlParserAddNodeInfo();
8960    ret += test_xmlParserFindNodeInfo();
8961    ret += test_xmlParserFindNodeInfoIndex();
8962    ret += test_xmlParserInputGrow();
8963    ret += test_xmlParserInputRead();
8964    ret += test_xmlPedanticParserDefault();
8965    ret += test_xmlReadDoc();
8966    ret += test_xmlReadFile();
8967    ret += test_xmlReadMemory();
8968    ret += test_xmlRecoverDoc();
8969    ret += test_xmlRecoverFile();
8970    ret += test_xmlRecoverMemory();
8971    ret += test_xmlSAXParseDTD();
8972    ret += test_xmlSAXParseDoc();
8973    ret += test_xmlSAXParseEntity();
8974    ret += test_xmlSAXParseFile();
8975    ret += test_xmlSAXParseFileWithData();
8976    ret += test_xmlSAXParseMemory();
8977    ret += test_xmlSAXParseMemoryWithData();
8978    ret += test_xmlSAXUserParseFile();
8979    ret += test_xmlSAXUserParseMemory();
8980    ret += test_xmlSetExternalEntityLoader();
8981    ret += test_xmlSetFeature();
8982    ret += test_xmlSetupParserForBuffer();
8983    ret += test_xmlStopParser();
8984    ret += test_xmlSubstituteEntitiesDefault();
8985
8986    if (ret != 0)
8987	printf("Module parser: %d errors\n", ret);
8988    return(ret);
8989}
8990
8991static int
8992test_xmlPatternMatch(void) {
8993    int ret = 0;
8994
8995
8996    /* missing type support */
8997    return(ret);
8998}
8999
9000
9001static int
9002test_xmlPatterncompile(void) {
9003    int ret = 0;
9004
9005
9006    /* missing type support */
9007    return(ret);
9008}
9009
9010static int
9011test_pattern(void) {
9012    int ret = 0;
9013
9014    printf("Testing pattern : 0 of 4 functions ...\n");
9015    ret += test_xmlPatternMatch();
9016    ret += test_xmlPatterncompile();
9017
9018    if (ret != 0)
9019	printf("Module pattern: %d errors\n", ret);
9020    return(ret);
9021}
9022
9023static int
9024test_xmlRelaxNGDump(void) {
9025    int ret = 0;
9026
9027
9028    /* missing type support */
9029    return(ret);
9030}
9031
9032
9033static int
9034test_xmlRelaxNGDumpTree(void) {
9035    int ret = 0;
9036
9037
9038    /* missing type support */
9039    return(ret);
9040}
9041
9042
9043static int
9044test_xmlRelaxNGGetParserErrors(void) {
9045    int ret = 0;
9046
9047
9048    /* missing type support */
9049    return(ret);
9050}
9051
9052
9053static int
9054test_xmlRelaxNGGetValidErrors(void) {
9055    int ret = 0;
9056
9057
9058    /* missing type support */
9059    return(ret);
9060}
9061
9062
9063static int
9064test_xmlRelaxNGInitTypes(void) {
9065    int ret = 0;
9066
9067#ifdef LIBXML_SCHEMAS_ENABLED
9068    int mem_base;
9069    int ret_val;
9070
9071        mem_base = xmlMemBlocks();
9072
9073        ret_val = xmlRelaxNGInitTypes();
9074        desret_int(ret_val);
9075        call_tests++;
9076        xmlResetLastError();
9077        if (mem_base != xmlMemBlocks()) {
9078            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
9079	           xmlMemBlocks() - mem_base);
9080	    ret++;
9081            printf("\n");
9082        }
9083#endif
9084
9085    function_tests++;
9086    return(ret);
9087}
9088
9089
9090static int
9091test_xmlRelaxNGNewDocParserCtxt(void) {
9092    int ret = 0;
9093
9094
9095    /* missing type support */
9096    return(ret);
9097}
9098
9099
9100static int
9101test_xmlRelaxNGNewMemParserCtxt(void) {
9102    int ret = 0;
9103
9104
9105    /* missing type support */
9106    return(ret);
9107}
9108
9109
9110static int
9111test_xmlRelaxNGNewParserCtxt(void) {
9112    int ret = 0;
9113
9114
9115    /* missing type support */
9116    return(ret);
9117}
9118
9119
9120static int
9121test_xmlRelaxNGNewValidCtxt(void) {
9122    int ret = 0;
9123
9124
9125    /* missing type support */
9126    return(ret);
9127}
9128
9129
9130static int
9131test_xmlRelaxNGParse(void) {
9132    int ret = 0;
9133
9134
9135    /* missing type support */
9136    return(ret);
9137}
9138
9139
9140static int
9141test_xmlRelaxNGSetParserErrors(void) {
9142    int ret = 0;
9143
9144
9145    /* missing type support */
9146    return(ret);
9147}
9148
9149
9150static int
9151test_xmlRelaxNGSetValidErrors(void) {
9152    int ret = 0;
9153
9154
9155    /* missing type support */
9156    return(ret);
9157}
9158
9159
9160static int
9161test_xmlRelaxNGValidateDoc(void) {
9162    int ret = 0;
9163
9164
9165    /* missing type support */
9166    return(ret);
9167}
9168
9169
9170static int
9171test_xmlRelaxNGValidateFullElement(void) {
9172    int ret = 0;
9173
9174
9175    /* missing type support */
9176    return(ret);
9177}
9178
9179
9180static int
9181test_xmlRelaxNGValidatePopElement(void) {
9182    int ret = 0;
9183
9184
9185    /* missing type support */
9186    return(ret);
9187}
9188
9189
9190static int
9191test_xmlRelaxNGValidatePushCData(void) {
9192    int ret = 0;
9193
9194
9195    /* missing type support */
9196    return(ret);
9197}
9198
9199
9200static int
9201test_xmlRelaxNGValidatePushElement(void) {
9202    int ret = 0;
9203
9204
9205    /* missing type support */
9206    return(ret);
9207}
9208
9209
9210static int
9211test_xmlRelaxParserSetFlag(void) {
9212    int ret = 0;
9213
9214
9215    /* missing type support */
9216    return(ret);
9217}
9218
9219static int
9220test_relaxng(void) {
9221    int ret = 0;
9222
9223    printf("Testing relaxng : 1 of 22 functions ...\n");
9224    ret += test_xmlRelaxNGDump();
9225    ret += test_xmlRelaxNGDumpTree();
9226    ret += test_xmlRelaxNGGetParserErrors();
9227    ret += test_xmlRelaxNGGetValidErrors();
9228    ret += test_xmlRelaxNGInitTypes();
9229    ret += test_xmlRelaxNGNewDocParserCtxt();
9230    ret += test_xmlRelaxNGNewMemParserCtxt();
9231    ret += test_xmlRelaxNGNewParserCtxt();
9232    ret += test_xmlRelaxNGNewValidCtxt();
9233    ret += test_xmlRelaxNGParse();
9234    ret += test_xmlRelaxNGSetParserErrors();
9235    ret += test_xmlRelaxNGSetValidErrors();
9236    ret += test_xmlRelaxNGValidateDoc();
9237    ret += test_xmlRelaxNGValidateFullElement();
9238    ret += test_xmlRelaxNGValidatePopElement();
9239    ret += test_xmlRelaxNGValidatePushCData();
9240    ret += test_xmlRelaxNGValidatePushElement();
9241    ret += test_xmlRelaxParserSetFlag();
9242
9243    if (ret != 0)
9244	printf("Module relaxng: %d errors\n", ret);
9245    return(ret);
9246}
9247static int
9248test_schemasInternals(void) {
9249    int ret = 0;
9250
9251    printf("Testing schemasInternals : 0 of 2 functions ...\n");
9252
9253    if (ret != 0)
9254	printf("Module schemasInternals: %d errors\n", ret);
9255    return(ret);
9256}
9257
9258static int
9259test_xmlAddChild(void) {
9260    int ret = 0;
9261
9262    int mem_base;
9263    xmlNodePtr ret_val;
9264    xmlNodePtr parent; /* the parent node */
9265    int n_parent;
9266    xmlNodePtr cur; /* the child node */
9267    int n_cur;
9268
9269    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
9270    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
9271        mem_base = xmlMemBlocks();
9272        parent = gen_xmlNodePtr(n_parent, 0);
9273        cur = gen_xmlNodePtr_in(n_cur, 1);
9274
9275        ret_val = xmlAddChild(parent, cur);
9276        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
9277        desret_xmlNodePtr(ret_val);
9278        call_tests++;
9279        des_xmlNodePtr(n_parent, parent, 0);
9280        des_xmlNodePtr_in(n_cur, cur, 1);
9281        xmlResetLastError();
9282        if (mem_base != xmlMemBlocks()) {
9283            printf("Leak of %d blocks found in xmlAddChild",
9284	           xmlMemBlocks() - mem_base);
9285	    ret++;
9286            printf(" %d", n_parent);
9287            printf(" %d", n_cur);
9288            printf("\n");
9289        }
9290    }
9291    }
9292
9293    function_tests++;
9294    return(ret);
9295}
9296
9297
9298static int
9299test_xmlAddChildList(void) {
9300    int ret = 0;
9301
9302    int mem_base;
9303    xmlNodePtr ret_val;
9304    xmlNodePtr parent; /* the parent node */
9305    int n_parent;
9306    xmlNodePtr cur; /* the first node in the list */
9307    int n_cur;
9308
9309    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
9310    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
9311        mem_base = xmlMemBlocks();
9312        parent = gen_xmlNodePtr(n_parent, 0);
9313        cur = gen_xmlNodePtr_in(n_cur, 1);
9314
9315        ret_val = xmlAddChildList(parent, cur);
9316        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
9317        desret_xmlNodePtr(ret_val);
9318        call_tests++;
9319        des_xmlNodePtr(n_parent, parent, 0);
9320        des_xmlNodePtr_in(n_cur, cur, 1);
9321        xmlResetLastError();
9322        if (mem_base != xmlMemBlocks()) {
9323            printf("Leak of %d blocks found in xmlAddChildList",
9324	           xmlMemBlocks() - mem_base);
9325	    ret++;
9326            printf(" %d", n_parent);
9327            printf(" %d", n_cur);
9328            printf("\n");
9329        }
9330    }
9331    }
9332
9333    function_tests++;
9334    return(ret);
9335}
9336
9337
9338static int
9339test_xmlAddNextSibling(void) {
9340    int ret = 0;
9341
9342    int mem_base;
9343    xmlNodePtr ret_val;
9344    xmlNodePtr cur; /* the child node */
9345    int n_cur;
9346    xmlNodePtr elem; /* the new node */
9347    int n_elem;
9348
9349    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
9350    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
9351        mem_base = xmlMemBlocks();
9352        cur = gen_xmlNodePtr(n_cur, 0);
9353        elem = gen_xmlNodePtr_in(n_elem, 1);
9354
9355        ret_val = xmlAddNextSibling(cur, elem);
9356        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
9357        desret_xmlNodePtr(ret_val);
9358        call_tests++;
9359        des_xmlNodePtr(n_cur, cur, 0);
9360        des_xmlNodePtr_in(n_elem, elem, 1);
9361        xmlResetLastError();
9362        if (mem_base != xmlMemBlocks()) {
9363            printf("Leak of %d blocks found in xmlAddNextSibling",
9364	           xmlMemBlocks() - mem_base);
9365	    ret++;
9366            printf(" %d", n_cur);
9367            printf(" %d", n_elem);
9368            printf("\n");
9369        }
9370    }
9371    }
9372
9373    function_tests++;
9374    return(ret);
9375}
9376
9377
9378static int
9379test_xmlAddPrevSibling(void) {
9380    int ret = 0;
9381
9382#ifdef LIBXML_TREE_ENABLED
9383    int mem_base;
9384    xmlNodePtr ret_val;
9385    xmlNodePtr cur; /* the child node */
9386    int n_cur;
9387    xmlNodePtr elem; /* the new node */
9388    int n_elem;
9389
9390    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
9391    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
9392        mem_base = xmlMemBlocks();
9393        cur = gen_xmlNodePtr(n_cur, 0);
9394        elem = gen_xmlNodePtr_in(n_elem, 1);
9395
9396        ret_val = xmlAddPrevSibling(cur, elem);
9397        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
9398        desret_xmlNodePtr(ret_val);
9399        call_tests++;
9400        des_xmlNodePtr(n_cur, cur, 0);
9401        des_xmlNodePtr_in(n_elem, elem, 1);
9402        xmlResetLastError();
9403        if (mem_base != xmlMemBlocks()) {
9404            printf("Leak of %d blocks found in xmlAddPrevSibling",
9405	           xmlMemBlocks() - mem_base);
9406	    ret++;
9407            printf(" %d", n_cur);
9408            printf(" %d", n_elem);
9409            printf("\n");
9410        }
9411    }
9412    }
9413#endif
9414
9415    function_tests++;
9416    return(ret);
9417}
9418
9419
9420static int
9421test_xmlAddSibling(void) {
9422    int ret = 0;
9423
9424    int mem_base;
9425    xmlNodePtr ret_val;
9426    xmlNodePtr cur; /* the child node */
9427    int n_cur;
9428    xmlNodePtr elem; /* the new node */
9429    int n_elem;
9430
9431    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
9432    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
9433        mem_base = xmlMemBlocks();
9434        cur = gen_xmlNodePtr(n_cur, 0);
9435        elem = gen_xmlNodePtr_in(n_elem, 1);
9436
9437        ret_val = xmlAddSibling(cur, elem);
9438        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
9439        desret_xmlNodePtr(ret_val);
9440        call_tests++;
9441        des_xmlNodePtr(n_cur, cur, 0);
9442        des_xmlNodePtr_in(n_elem, elem, 1);
9443        xmlResetLastError();
9444        if (mem_base != xmlMemBlocks()) {
9445            printf("Leak of %d blocks found in xmlAddSibling",
9446	           xmlMemBlocks() - mem_base);
9447	    ret++;
9448            printf(" %d", n_cur);
9449            printf(" %d", n_elem);
9450            printf("\n");
9451        }
9452    }
9453    }
9454
9455    function_tests++;
9456    return(ret);
9457}
9458
9459
9460static int
9461test_xmlAttrSerializeTxtContent(void) {
9462    int ret = 0;
9463
9464    int mem_base;
9465    xmlBufferPtr buf; /* the XML buffer output */
9466    int n_buf;
9467    xmlDocPtr doc; /* the document */
9468    int n_doc;
9469    xmlAttrPtr attr; /* the attribute node */
9470    int n_attr;
9471    const xmlChar * string; /* the text content */
9472    int n_string;
9473
9474    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9475    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9476    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
9477    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
9478        mem_base = xmlMemBlocks();
9479        buf = gen_xmlBufferPtr(n_buf, 0);
9480        doc = gen_xmlDocPtr(n_doc, 1);
9481        attr = gen_xmlAttrPtr(n_attr, 2);
9482        string = gen_const_xmlChar_ptr(n_string, 3);
9483
9484        xmlAttrSerializeTxtContent(buf, doc, attr, string);
9485        call_tests++;
9486        des_xmlBufferPtr(n_buf, buf, 0);
9487        des_xmlDocPtr(n_doc, doc, 1);
9488        des_xmlAttrPtr(n_attr, attr, 2);
9489        des_const_xmlChar_ptr(n_string, string, 3);
9490        xmlResetLastError();
9491        if (mem_base != xmlMemBlocks()) {
9492            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
9493	           xmlMemBlocks() - mem_base);
9494	    ret++;
9495            printf(" %d", n_buf);
9496            printf(" %d", n_doc);
9497            printf(" %d", n_attr);
9498            printf(" %d", n_string);
9499            printf("\n");
9500        }
9501    }
9502    }
9503    }
9504    }
9505
9506    function_tests++;
9507    return(ret);
9508}
9509
9510
9511static int
9512test_xmlBufferAdd(void) {
9513    int ret = 0;
9514
9515    int mem_base;
9516    int ret_val;
9517    xmlBufferPtr buf; /* the buffer to dump */
9518    int n_buf;
9519    const xmlChar * str; /* the #xmlChar string */
9520    int n_str;
9521    int len; /* the number of #xmlChar to add */
9522    int n_len;
9523
9524    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9525    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
9526    for (n_len = 0;n_len < gen_nb_int;n_len++) {
9527        mem_base = xmlMemBlocks();
9528        buf = gen_xmlBufferPtr(n_buf, 0);
9529        str = gen_const_xmlChar_ptr(n_str, 1);
9530        len = gen_int(n_len, 2);
9531
9532        ret_val = xmlBufferAdd(buf, str, len);
9533        desret_int(ret_val);
9534        call_tests++;
9535        des_xmlBufferPtr(n_buf, buf, 0);
9536        des_const_xmlChar_ptr(n_str, str, 1);
9537        des_int(n_len, len, 2);
9538        xmlResetLastError();
9539        if (mem_base != xmlMemBlocks()) {
9540            printf("Leak of %d blocks found in xmlBufferAdd",
9541	           xmlMemBlocks() - mem_base);
9542	    ret++;
9543            printf(" %d", n_buf);
9544            printf(" %d", n_str);
9545            printf(" %d", n_len);
9546            printf("\n");
9547        }
9548    }
9549    }
9550    }
9551
9552    function_tests++;
9553    return(ret);
9554}
9555
9556
9557static int
9558test_xmlBufferAddHead(void) {
9559    int ret = 0;
9560
9561    int mem_base;
9562    int ret_val;
9563    xmlBufferPtr buf; /* the buffer */
9564    int n_buf;
9565    const xmlChar * str; /* the #xmlChar string */
9566    int n_str;
9567    int len; /* the number of #xmlChar to add */
9568    int n_len;
9569
9570    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9571    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
9572    for (n_len = 0;n_len < gen_nb_int;n_len++) {
9573        mem_base = xmlMemBlocks();
9574        buf = gen_xmlBufferPtr(n_buf, 0);
9575        str = gen_const_xmlChar_ptr(n_str, 1);
9576        len = gen_int(n_len, 2);
9577
9578        ret_val = xmlBufferAddHead(buf, str, len);
9579        desret_int(ret_val);
9580        call_tests++;
9581        des_xmlBufferPtr(n_buf, buf, 0);
9582        des_const_xmlChar_ptr(n_str, str, 1);
9583        des_int(n_len, len, 2);
9584        xmlResetLastError();
9585        if (mem_base != xmlMemBlocks()) {
9586            printf("Leak of %d blocks found in xmlBufferAddHead",
9587	           xmlMemBlocks() - mem_base);
9588	    ret++;
9589            printf(" %d", n_buf);
9590            printf(" %d", n_str);
9591            printf(" %d", n_len);
9592            printf("\n");
9593        }
9594    }
9595    }
9596    }
9597
9598    function_tests++;
9599    return(ret);
9600}
9601
9602
9603static int
9604test_xmlBufferCCat(void) {
9605    int ret = 0;
9606
9607    int mem_base;
9608    int ret_val;
9609    xmlBufferPtr buf; /* the buffer to dump */
9610    int n_buf;
9611    const char * str; /* the C char string */
9612    int n_str;
9613
9614    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9615    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
9616        mem_base = xmlMemBlocks();
9617        buf = gen_xmlBufferPtr(n_buf, 0);
9618        str = gen_const_char_ptr(n_str, 1);
9619
9620        ret_val = xmlBufferCCat(buf, str);
9621        desret_int(ret_val);
9622        call_tests++;
9623        des_xmlBufferPtr(n_buf, buf, 0);
9624        des_const_char_ptr(n_str, str, 1);
9625        xmlResetLastError();
9626        if (mem_base != xmlMemBlocks()) {
9627            printf("Leak of %d blocks found in xmlBufferCCat",
9628	           xmlMemBlocks() - mem_base);
9629	    ret++;
9630            printf(" %d", n_buf);
9631            printf(" %d", n_str);
9632            printf("\n");
9633        }
9634    }
9635    }
9636
9637    function_tests++;
9638    return(ret);
9639}
9640
9641
9642static int
9643test_xmlBufferCat(void) {
9644    int ret = 0;
9645
9646    int mem_base;
9647    int ret_val;
9648    xmlBufferPtr buf; /* the buffer to add to */
9649    int n_buf;
9650    const xmlChar * str; /* the #xmlChar string */
9651    int n_str;
9652
9653    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9654    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
9655        mem_base = xmlMemBlocks();
9656        buf = gen_xmlBufferPtr(n_buf, 0);
9657        str = gen_const_xmlChar_ptr(n_str, 1);
9658
9659        ret_val = xmlBufferCat(buf, str);
9660        desret_int(ret_val);
9661        call_tests++;
9662        des_xmlBufferPtr(n_buf, buf, 0);
9663        des_const_xmlChar_ptr(n_str, str, 1);
9664        xmlResetLastError();
9665        if (mem_base != xmlMemBlocks()) {
9666            printf("Leak of %d blocks found in xmlBufferCat",
9667	           xmlMemBlocks() - mem_base);
9668	    ret++;
9669            printf(" %d", n_buf);
9670            printf(" %d", n_str);
9671            printf("\n");
9672        }
9673    }
9674    }
9675
9676    function_tests++;
9677    return(ret);
9678}
9679
9680
9681static int
9682test_xmlBufferContent(void) {
9683    int ret = 0;
9684
9685
9686    /* missing type support */
9687    return(ret);
9688}
9689
9690
9691static int
9692test_xmlBufferCreate(void) {
9693    int ret = 0;
9694
9695
9696    /* missing type support */
9697    return(ret);
9698}
9699
9700
9701static int
9702test_xmlBufferCreateSize(void) {
9703    int ret = 0;
9704
9705
9706    /* missing type support */
9707    return(ret);
9708}
9709
9710
9711static int
9712test_xmlBufferCreateStatic(void) {
9713    int ret = 0;
9714
9715
9716    /* missing type support */
9717    return(ret);
9718}
9719
9720
9721static int
9722test_xmlBufferEmpty(void) {
9723    int ret = 0;
9724
9725    int mem_base;
9726    xmlBufferPtr buf; /* the buffer */
9727    int n_buf;
9728
9729    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9730        mem_base = xmlMemBlocks();
9731        buf = gen_xmlBufferPtr(n_buf, 0);
9732
9733        xmlBufferEmpty(buf);
9734        call_tests++;
9735        des_xmlBufferPtr(n_buf, buf, 0);
9736        xmlResetLastError();
9737        if (mem_base != xmlMemBlocks()) {
9738            printf("Leak of %d blocks found in xmlBufferEmpty",
9739	           xmlMemBlocks() - mem_base);
9740	    ret++;
9741            printf(" %d", n_buf);
9742            printf("\n");
9743        }
9744    }
9745
9746    function_tests++;
9747    return(ret);
9748}
9749
9750
9751static int
9752test_xmlBufferGrow(void) {
9753    int ret = 0;
9754
9755    int mem_base;
9756    int ret_val;
9757    xmlBufferPtr buf; /* the buffer */
9758    int n_buf;
9759    unsigned int len; /* the minimum free size to allocate */
9760    int n_len;
9761
9762    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9763    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
9764        mem_base = xmlMemBlocks();
9765        buf = gen_xmlBufferPtr(n_buf, 0);
9766        len = gen_unsigned_int(n_len, 1);
9767
9768        ret_val = xmlBufferGrow(buf, len);
9769        desret_int(ret_val);
9770        call_tests++;
9771        des_xmlBufferPtr(n_buf, buf, 0);
9772        des_unsigned_int(n_len, len, 1);
9773        xmlResetLastError();
9774        if (mem_base != xmlMemBlocks()) {
9775            printf("Leak of %d blocks found in xmlBufferGrow",
9776	           xmlMemBlocks() - mem_base);
9777	    ret++;
9778            printf(" %d", n_buf);
9779            printf(" %d", n_len);
9780            printf("\n");
9781        }
9782    }
9783    }
9784
9785    function_tests++;
9786    return(ret);
9787}
9788
9789
9790static int
9791test_xmlBufferLength(void) {
9792    int ret = 0;
9793
9794
9795    /* missing type support */
9796    return(ret);
9797}
9798
9799
9800static int
9801test_xmlBufferResize(void) {
9802    int ret = 0;
9803
9804    int mem_base;
9805    int ret_val;
9806    xmlBufferPtr buf; /* the buffer to resize */
9807    int n_buf;
9808    unsigned int size; /* the desired size */
9809    int n_size;
9810
9811    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9812    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
9813        mem_base = xmlMemBlocks();
9814        buf = gen_xmlBufferPtr(n_buf, 0);
9815        size = gen_unsigned_int(n_size, 1);
9816
9817        ret_val = xmlBufferResize(buf, size);
9818        desret_int(ret_val);
9819        call_tests++;
9820        des_xmlBufferPtr(n_buf, buf, 0);
9821        des_unsigned_int(n_size, size, 1);
9822        xmlResetLastError();
9823        if (mem_base != xmlMemBlocks()) {
9824            printf("Leak of %d blocks found in xmlBufferResize",
9825	           xmlMemBlocks() - mem_base);
9826	    ret++;
9827            printf(" %d", n_buf);
9828            printf(" %d", n_size);
9829            printf("\n");
9830        }
9831    }
9832    }
9833
9834    function_tests++;
9835    return(ret);
9836}
9837
9838
9839static int
9840test_xmlBufferSetAllocationScheme(void) {
9841    int ret = 0;
9842
9843
9844    /* missing type support */
9845    return(ret);
9846}
9847
9848
9849static int
9850test_xmlBufferShrink(void) {
9851    int ret = 0;
9852
9853    int mem_base;
9854    int ret_val;
9855    xmlBufferPtr buf; /* the buffer to dump */
9856    int n_buf;
9857    unsigned int len; /* the number of xmlChar to remove */
9858    int n_len;
9859
9860    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9861    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
9862        mem_base = xmlMemBlocks();
9863        buf = gen_xmlBufferPtr(n_buf, 0);
9864        len = gen_unsigned_int(n_len, 1);
9865
9866        ret_val = xmlBufferShrink(buf, len);
9867        desret_int(ret_val);
9868        call_tests++;
9869        des_xmlBufferPtr(n_buf, buf, 0);
9870        des_unsigned_int(n_len, len, 1);
9871        xmlResetLastError();
9872        if (mem_base != xmlMemBlocks()) {
9873            printf("Leak of %d blocks found in xmlBufferShrink",
9874	           xmlMemBlocks() - mem_base);
9875	    ret++;
9876            printf(" %d", n_buf);
9877            printf(" %d", n_len);
9878            printf("\n");
9879        }
9880    }
9881    }
9882
9883    function_tests++;
9884    return(ret);
9885}
9886
9887
9888static int
9889test_xmlBufferWriteCHAR(void) {
9890    int ret = 0;
9891
9892    int mem_base;
9893    xmlBufferPtr buf; /* the XML buffer */
9894    int n_buf;
9895    const xmlChar * string; /* the string to add */
9896    int n_string;
9897
9898    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9899    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
9900        mem_base = xmlMemBlocks();
9901        buf = gen_xmlBufferPtr(n_buf, 0);
9902        string = gen_const_xmlChar_ptr(n_string, 1);
9903
9904        xmlBufferWriteCHAR(buf, string);
9905        call_tests++;
9906        des_xmlBufferPtr(n_buf, buf, 0);
9907        des_const_xmlChar_ptr(n_string, string, 1);
9908        xmlResetLastError();
9909        if (mem_base != xmlMemBlocks()) {
9910            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
9911	           xmlMemBlocks() - mem_base);
9912	    ret++;
9913            printf(" %d", n_buf);
9914            printf(" %d", n_string);
9915            printf("\n");
9916        }
9917    }
9918    }
9919
9920    function_tests++;
9921    return(ret);
9922}
9923
9924
9925static int
9926test_xmlBufferWriteChar(void) {
9927    int ret = 0;
9928
9929    int mem_base;
9930    xmlBufferPtr buf; /* the XML buffer output */
9931    int n_buf;
9932    const char * string; /* the string to add */
9933    int n_string;
9934
9935    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9936    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
9937        mem_base = xmlMemBlocks();
9938        buf = gen_xmlBufferPtr(n_buf, 0);
9939        string = gen_const_char_ptr(n_string, 1);
9940
9941        xmlBufferWriteChar(buf, string);
9942        call_tests++;
9943        des_xmlBufferPtr(n_buf, buf, 0);
9944        des_const_char_ptr(n_string, string, 1);
9945        xmlResetLastError();
9946        if (mem_base != xmlMemBlocks()) {
9947            printf("Leak of %d blocks found in xmlBufferWriteChar",
9948	           xmlMemBlocks() - mem_base);
9949	    ret++;
9950            printf(" %d", n_buf);
9951            printf(" %d", n_string);
9952            printf("\n");
9953        }
9954    }
9955    }
9956
9957    function_tests++;
9958    return(ret);
9959}
9960
9961
9962static int
9963test_xmlBufferWriteQuotedString(void) {
9964    int ret = 0;
9965
9966    int mem_base;
9967    xmlBufferPtr buf; /* the XML buffer output */
9968    int n_buf;
9969    const xmlChar * string; /* the string to add */
9970    int n_string;
9971
9972    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9973    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
9974        mem_base = xmlMemBlocks();
9975        buf = gen_xmlBufferPtr(n_buf, 0);
9976        string = gen_const_xmlChar_ptr(n_string, 1);
9977
9978        xmlBufferWriteQuotedString(buf, string);
9979        call_tests++;
9980        des_xmlBufferPtr(n_buf, buf, 0);
9981        des_const_xmlChar_ptr(n_string, string, 1);
9982        xmlResetLastError();
9983        if (mem_base != xmlMemBlocks()) {
9984            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
9985	           xmlMemBlocks() - mem_base);
9986	    ret++;
9987            printf(" %d", n_buf);
9988            printf(" %d", n_string);
9989            printf("\n");
9990        }
9991    }
9992    }
9993
9994    function_tests++;
9995    return(ret);
9996}
9997
9998
9999static int
10000test_xmlBuildQName(void) {
10001    int ret = 0;
10002
10003    int mem_base;
10004    xmlChar * ret_val;
10005    const xmlChar * ncname; /* the Name */
10006    int n_ncname;
10007    const xmlChar * prefix; /* the prefix */
10008    int n_prefix;
10009    xmlChar * memory; /* preallocated memory */
10010    int n_memory;
10011    int len; /* preallocated memory length */
10012    int n_len;
10013
10014    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
10015    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10016    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
10017    for (n_len = 0;n_len < gen_nb_int;n_len++) {
10018        mem_base = xmlMemBlocks();
10019        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
10020        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10021        memory = gen_xmlChar_ptr(n_memory, 2);
10022        len = gen_int(n_len, 3);
10023
10024        ret_val = xmlBuildQName(ncname, prefix, memory, len);
10025        if ((ret_val != NULL) && (ret_val != ncname) &&
10026              (ret_val != prefix) && (ret_val != memory))
10027              xmlFree(ret_val);
10028	  ret_val = NULL;
10029        desret_xmlChar_ptr(ret_val);
10030        call_tests++;
10031        des_const_xmlChar_ptr(n_ncname, ncname, 0);
10032        des_const_xmlChar_ptr(n_prefix, prefix, 1);
10033        des_xmlChar_ptr(n_memory, memory, 2);
10034        des_int(n_len, len, 3);
10035        xmlResetLastError();
10036        if (mem_base != xmlMemBlocks()) {
10037            printf("Leak of %d blocks found in xmlBuildQName",
10038	           xmlMemBlocks() - mem_base);
10039	    ret++;
10040            printf(" %d", n_ncname);
10041            printf(" %d", n_prefix);
10042            printf(" %d", n_memory);
10043            printf(" %d", n_len);
10044            printf("\n");
10045        }
10046    }
10047    }
10048    }
10049    }
10050
10051    function_tests++;
10052    return(ret);
10053}
10054
10055
10056static int
10057test_xmlCopyDoc(void) {
10058    int ret = 0;
10059
10060#ifdef LIBXML_TREE_ENABLED
10061    int mem_base;
10062    xmlDocPtr ret_val;
10063    xmlDocPtr doc; /* the document */
10064    int n_doc;
10065    int recursive; /* if not zero do a recursive copy. */
10066    int n_recursive;
10067
10068    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10069    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
10070        mem_base = xmlMemBlocks();
10071        doc = gen_xmlDocPtr(n_doc, 0);
10072        recursive = gen_int(n_recursive, 1);
10073
10074        ret_val = xmlCopyDoc(doc, recursive);
10075        desret_xmlDocPtr(ret_val);
10076        call_tests++;
10077        des_xmlDocPtr(n_doc, doc, 0);
10078        des_int(n_recursive, recursive, 1);
10079        xmlResetLastError();
10080        if (mem_base != xmlMemBlocks()) {
10081            printf("Leak of %d blocks found in xmlCopyDoc",
10082	           xmlMemBlocks() - mem_base);
10083	    ret++;
10084            printf(" %d", n_doc);
10085            printf(" %d", n_recursive);
10086            printf("\n");
10087        }
10088    }
10089    }
10090#endif
10091
10092    function_tests++;
10093    return(ret);
10094}
10095
10096
10097static int
10098test_xmlCopyDtd(void) {
10099    int ret = 0;
10100
10101#ifdef LIBXML_TREE_ENABLED
10102    int mem_base;
10103    xmlDtdPtr ret_val;
10104    xmlDtdPtr dtd; /* the dtd */
10105    int n_dtd;
10106
10107    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
10108        mem_base = xmlMemBlocks();
10109        dtd = gen_xmlDtdPtr(n_dtd, 0);
10110
10111        ret_val = xmlCopyDtd(dtd);
10112        desret_xmlDtdPtr(ret_val);
10113        call_tests++;
10114        des_xmlDtdPtr(n_dtd, dtd, 0);
10115        xmlResetLastError();
10116        if (mem_base != xmlMemBlocks()) {
10117            printf("Leak of %d blocks found in xmlCopyDtd",
10118	           xmlMemBlocks() - mem_base);
10119	    ret++;
10120            printf(" %d", n_dtd);
10121            printf("\n");
10122        }
10123    }
10124#endif
10125
10126    function_tests++;
10127    return(ret);
10128}
10129
10130
10131static int
10132test_xmlCopyNamespace(void) {
10133    int ret = 0;
10134
10135
10136    /* missing type support */
10137    return(ret);
10138}
10139
10140
10141static int
10142test_xmlCopyNamespaceList(void) {
10143    int ret = 0;
10144
10145
10146    /* missing type support */
10147    return(ret);
10148}
10149
10150
10151static int
10152test_xmlCopyNode(void) {
10153    int ret = 0;
10154
10155
10156    /* missing type support */
10157    return(ret);
10158}
10159
10160
10161static int
10162test_xmlCopyNodeList(void) {
10163    int ret = 0;
10164
10165
10166    /* missing type support */
10167    return(ret);
10168}
10169
10170
10171static int
10172test_xmlCopyProp(void) {
10173    int ret = 0;
10174
10175
10176    /* missing type support */
10177    return(ret);
10178}
10179
10180
10181static int
10182test_xmlCopyPropList(void) {
10183    int ret = 0;
10184
10185
10186    /* missing type support */
10187    return(ret);
10188}
10189
10190
10191static int
10192test_xmlCreateIntSubset(void) {
10193    int ret = 0;
10194
10195    int mem_base;
10196    xmlDtdPtr ret_val;
10197    xmlDocPtr doc; /* the document pointer */
10198    int n_doc;
10199    const xmlChar * name; /* the DTD name */
10200    int n_name;
10201    const xmlChar * ExternalID; /* the external (PUBLIC) ID */
10202    int n_ExternalID;
10203    const xmlChar * SystemID; /* the system ID */
10204    int n_SystemID;
10205
10206    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10207    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10208    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
10209    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
10210        mem_base = xmlMemBlocks();
10211        doc = gen_xmlDocPtr(n_doc, 0);
10212        name = gen_const_xmlChar_ptr(n_name, 1);
10213        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
10214        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
10215
10216        ret_val = xmlCreateIntSubset(doc, name, ExternalID, SystemID);
10217        desret_xmlDtdPtr(ret_val);
10218        call_tests++;
10219        des_xmlDocPtr(n_doc, doc, 0);
10220        des_const_xmlChar_ptr(n_name, name, 1);
10221        des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
10222        des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
10223        xmlResetLastError();
10224        if (mem_base != xmlMemBlocks()) {
10225            printf("Leak of %d blocks found in xmlCreateIntSubset",
10226	           xmlMemBlocks() - mem_base);
10227	    ret++;
10228            printf(" %d", n_doc);
10229            printf(" %d", n_name);
10230            printf(" %d", n_ExternalID);
10231            printf(" %d", n_SystemID);
10232            printf("\n");
10233        }
10234    }
10235    }
10236    }
10237    }
10238
10239    function_tests++;
10240    return(ret);
10241}
10242
10243
10244static int
10245test_xmlDocCopyNode(void) {
10246    int ret = 0;
10247
10248
10249    /* missing type support */
10250    return(ret);
10251}
10252
10253
10254static int
10255test_xmlDocCopyNodeList(void) {
10256    int ret = 0;
10257
10258
10259    /* missing type support */
10260    return(ret);
10261}
10262
10263
10264static int
10265test_xmlDocDump(void) {
10266    int ret = 0;
10267
10268#ifdef LIBXML_OUTPUT_ENABLED
10269    int mem_base;
10270    int ret_val;
10271    FILE * f; /* the FILE* */
10272    int n_f;
10273    xmlDocPtr cur; /* the document */
10274    int n_cur;
10275
10276    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
10277    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
10278        mem_base = xmlMemBlocks();
10279        f = gen_FILE_ptr(n_f, 0);
10280        cur = gen_xmlDocPtr(n_cur, 1);
10281
10282        ret_val = xmlDocDump(f, cur);
10283        desret_int(ret_val);
10284        call_tests++;
10285        des_FILE_ptr(n_f, f, 0);
10286        des_xmlDocPtr(n_cur, cur, 1);
10287        xmlResetLastError();
10288        if (mem_base != xmlMemBlocks()) {
10289            printf("Leak of %d blocks found in xmlDocDump",
10290	           xmlMemBlocks() - mem_base);
10291	    ret++;
10292            printf(" %d", n_f);
10293            printf(" %d", n_cur);
10294            printf("\n");
10295        }
10296    }
10297    }
10298#endif
10299
10300    function_tests++;
10301    return(ret);
10302}
10303
10304
10305static int
10306test_xmlDocDumpFormatMemory(void) {
10307    int ret = 0;
10308
10309
10310    /* missing type support */
10311    return(ret);
10312}
10313
10314
10315static int
10316test_xmlDocDumpFormatMemoryEnc(void) {
10317    int ret = 0;
10318
10319
10320    /* missing type support */
10321    return(ret);
10322}
10323
10324
10325static int
10326test_xmlDocDumpMemory(void) {
10327    int ret = 0;
10328
10329
10330    /* missing type support */
10331    return(ret);
10332}
10333
10334
10335static int
10336test_xmlDocDumpMemoryEnc(void) {
10337    int ret = 0;
10338
10339
10340    /* missing type support */
10341    return(ret);
10342}
10343
10344
10345static int
10346test_xmlDocFormatDump(void) {
10347    int ret = 0;
10348
10349#ifdef LIBXML_OUTPUT_ENABLED
10350    int mem_base;
10351    int ret_val;
10352    FILE * f; /* the FILE* */
10353    int n_f;
10354    xmlDocPtr cur; /* the document */
10355    int n_cur;
10356    int format; /* should formatting spaces been added */
10357    int n_format;
10358
10359    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
10360    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
10361    for (n_format = 0;n_format < gen_nb_int;n_format++) {
10362        mem_base = xmlMemBlocks();
10363        f = gen_FILE_ptr(n_f, 0);
10364        cur = gen_xmlDocPtr(n_cur, 1);
10365        format = gen_int(n_format, 2);
10366
10367        ret_val = xmlDocFormatDump(f, cur, format);
10368        desret_int(ret_val);
10369        call_tests++;
10370        des_FILE_ptr(n_f, f, 0);
10371        des_xmlDocPtr(n_cur, cur, 1);
10372        des_int(n_format, format, 2);
10373        xmlResetLastError();
10374        if (mem_base != xmlMemBlocks()) {
10375            printf("Leak of %d blocks found in xmlDocFormatDump",
10376	           xmlMemBlocks() - mem_base);
10377	    ret++;
10378            printf(" %d", n_f);
10379            printf(" %d", n_cur);
10380            printf(" %d", n_format);
10381            printf("\n");
10382        }
10383    }
10384    }
10385    }
10386#endif
10387
10388    function_tests++;
10389    return(ret);
10390}
10391
10392
10393static int
10394test_xmlDocGetRootElement(void) {
10395    int ret = 0;
10396
10397    int mem_base;
10398    xmlNodePtr ret_val;
10399    xmlDocPtr doc; /* the document */
10400    int n_doc;
10401
10402    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10403        mem_base = xmlMemBlocks();
10404        doc = gen_xmlDocPtr(n_doc, 0);
10405
10406        ret_val = xmlDocGetRootElement(doc);
10407        desret_xmlNodePtr(ret_val);
10408        call_tests++;
10409        des_xmlDocPtr(n_doc, doc, 0);
10410        xmlResetLastError();
10411        if (mem_base != xmlMemBlocks()) {
10412            printf("Leak of %d blocks found in xmlDocGetRootElement",
10413	           xmlMemBlocks() - mem_base);
10414	    ret++;
10415            printf(" %d", n_doc);
10416            printf("\n");
10417        }
10418    }
10419
10420    function_tests++;
10421    return(ret);
10422}
10423
10424
10425static int
10426test_xmlDocSetRootElement(void) {
10427    int ret = 0;
10428
10429#ifdef LIBXML_TREE_ENABLED
10430    int mem_base;
10431    xmlNodePtr ret_val;
10432    xmlDocPtr doc; /* the document */
10433    int n_doc;
10434    xmlNodePtr root; /* the new document root element */
10435    int n_root;
10436
10437    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10438    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
10439        mem_base = xmlMemBlocks();
10440        doc = gen_xmlDocPtr(n_doc, 0);
10441        root = gen_xmlNodePtr_in(n_root, 1);
10442
10443        ret_val = xmlDocSetRootElement(doc, root);
10444        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
10445        desret_xmlNodePtr(ret_val);
10446        call_tests++;
10447        des_xmlDocPtr(n_doc, doc, 0);
10448        des_xmlNodePtr_in(n_root, root, 1);
10449        xmlResetLastError();
10450        if (mem_base != xmlMemBlocks()) {
10451            printf("Leak of %d blocks found in xmlDocSetRootElement",
10452	           xmlMemBlocks() - mem_base);
10453	    ret++;
10454            printf(" %d", n_doc);
10455            printf(" %d", n_root);
10456            printf("\n");
10457        }
10458    }
10459    }
10460#endif
10461
10462    function_tests++;
10463    return(ret);
10464}
10465
10466
10467static int
10468test_xmlElemDump(void) {
10469    int ret = 0;
10470
10471#ifdef LIBXML_OUTPUT_ENABLED
10472    int mem_base;
10473    FILE * f; /* the FILE * for the output */
10474    int n_f;
10475    xmlDocPtr doc; /* the document */
10476    int n_doc;
10477    xmlNodePtr cur; /* the current node */
10478    int n_cur;
10479
10480    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
10481    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10482    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
10483        mem_base = xmlMemBlocks();
10484        f = gen_FILE_ptr(n_f, 0);
10485        doc = gen_xmlDocPtr(n_doc, 1);
10486        cur = gen_xmlNodePtr(n_cur, 2);
10487
10488        xmlElemDump(f, doc, cur);
10489        call_tests++;
10490        des_FILE_ptr(n_f, f, 0);
10491        des_xmlDocPtr(n_doc, doc, 1);
10492        des_xmlNodePtr(n_cur, cur, 2);
10493        xmlResetLastError();
10494        if (mem_base != xmlMemBlocks()) {
10495            printf("Leak of %d blocks found in xmlElemDump",
10496	           xmlMemBlocks() - mem_base);
10497	    ret++;
10498            printf(" %d", n_f);
10499            printf(" %d", n_doc);
10500            printf(" %d", n_cur);
10501            printf("\n");
10502        }
10503    }
10504    }
10505    }
10506#endif
10507
10508    function_tests++;
10509    return(ret);
10510}
10511
10512
10513static int
10514test_xmlGetBufferAllocationScheme(void) {
10515    int ret = 0;
10516
10517
10518    /* missing type support */
10519    return(ret);
10520}
10521
10522
10523static int
10524test_xmlGetCompressMode(void) {
10525    int ret = 0;
10526
10527    int mem_base;
10528    int ret_val;
10529
10530        mem_base = xmlMemBlocks();
10531
10532        ret_val = xmlGetCompressMode();
10533        desret_int(ret_val);
10534        call_tests++;
10535        xmlResetLastError();
10536        if (mem_base != xmlMemBlocks()) {
10537            printf("Leak of %d blocks found in xmlGetCompressMode",
10538	           xmlMemBlocks() - mem_base);
10539	    ret++;
10540            printf("\n");
10541        }
10542
10543    function_tests++;
10544    return(ret);
10545}
10546
10547
10548static int
10549test_xmlGetDocCompressMode(void) {
10550    int ret = 0;
10551
10552    int mem_base;
10553    int ret_val;
10554    xmlDocPtr doc; /* the document */
10555    int n_doc;
10556
10557    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10558        mem_base = xmlMemBlocks();
10559        doc = gen_xmlDocPtr(n_doc, 0);
10560
10561        ret_val = xmlGetDocCompressMode(doc);
10562        desret_int(ret_val);
10563        call_tests++;
10564        des_xmlDocPtr(n_doc, doc, 0);
10565        xmlResetLastError();
10566        if (mem_base != xmlMemBlocks()) {
10567            printf("Leak of %d blocks found in xmlGetDocCompressMode",
10568	           xmlMemBlocks() - mem_base);
10569	    ret++;
10570            printf(" %d", n_doc);
10571            printf("\n");
10572        }
10573    }
10574
10575    function_tests++;
10576    return(ret);
10577}
10578
10579
10580static int
10581test_xmlGetIntSubset(void) {
10582    int ret = 0;
10583
10584    int mem_base;
10585    xmlDtdPtr ret_val;
10586    xmlDocPtr doc; /* the document pointer */
10587    int n_doc;
10588
10589    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10590        mem_base = xmlMemBlocks();
10591        doc = gen_xmlDocPtr(n_doc, 0);
10592
10593        ret_val = xmlGetIntSubset(doc);
10594        desret_xmlDtdPtr(ret_val);
10595        call_tests++;
10596        des_xmlDocPtr(n_doc, doc, 0);
10597        xmlResetLastError();
10598        if (mem_base != xmlMemBlocks()) {
10599            printf("Leak of %d blocks found in xmlGetIntSubset",
10600	           xmlMemBlocks() - mem_base);
10601	    ret++;
10602            printf(" %d", n_doc);
10603            printf("\n");
10604        }
10605    }
10606
10607    function_tests++;
10608    return(ret);
10609}
10610
10611
10612static int
10613test_xmlGetLastChild(void) {
10614    int ret = 0;
10615
10616    int mem_base;
10617    xmlNodePtr ret_val;
10618    xmlNodePtr parent; /* the parent node */
10619    int n_parent;
10620
10621    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
10622        mem_base = xmlMemBlocks();
10623        parent = gen_xmlNodePtr(n_parent, 0);
10624
10625        ret_val = xmlGetLastChild(parent);
10626        desret_xmlNodePtr(ret_val);
10627        call_tests++;
10628        des_xmlNodePtr(n_parent, parent, 0);
10629        xmlResetLastError();
10630        if (mem_base != xmlMemBlocks()) {
10631            printf("Leak of %d blocks found in xmlGetLastChild",
10632	           xmlMemBlocks() - mem_base);
10633	    ret++;
10634            printf(" %d", n_parent);
10635            printf("\n");
10636        }
10637    }
10638
10639    function_tests++;
10640    return(ret);
10641}
10642
10643
10644static int
10645test_xmlGetLineNo(void) {
10646    int ret = 0;
10647
10648    int mem_base;
10649    long ret_val;
10650    xmlNodePtr node; /* valid node */
10651    int n_node;
10652
10653    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
10654        mem_base = xmlMemBlocks();
10655        node = gen_xmlNodePtr(n_node, 0);
10656
10657        ret_val = xmlGetLineNo(node);
10658        desret_long(ret_val);
10659        call_tests++;
10660        des_xmlNodePtr(n_node, node, 0);
10661        xmlResetLastError();
10662        if (mem_base != xmlMemBlocks()) {
10663            printf("Leak of %d blocks found in xmlGetLineNo",
10664	           xmlMemBlocks() - mem_base);
10665	    ret++;
10666            printf(" %d", n_node);
10667            printf("\n");
10668        }
10669    }
10670
10671    function_tests++;
10672    return(ret);
10673}
10674
10675
10676static int
10677test_xmlGetNoNsProp(void) {
10678    int ret = 0;
10679
10680    int mem_base;
10681    xmlChar * ret_val;
10682    xmlNodePtr node; /* the node */
10683    int n_node;
10684    const xmlChar * name; /* the attribute name */
10685    int n_name;
10686
10687    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
10688    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10689        mem_base = xmlMemBlocks();
10690        node = gen_xmlNodePtr(n_node, 0);
10691        name = gen_const_xmlChar_ptr(n_name, 1);
10692
10693        ret_val = xmlGetNoNsProp(node, name);
10694        desret_xmlChar_ptr(ret_val);
10695        call_tests++;
10696        des_xmlNodePtr(n_node, node, 0);
10697        des_const_xmlChar_ptr(n_name, name, 1);
10698        xmlResetLastError();
10699        if (mem_base != xmlMemBlocks()) {
10700            printf("Leak of %d blocks found in xmlGetNoNsProp",
10701	           xmlMemBlocks() - mem_base);
10702	    ret++;
10703            printf(" %d", n_node);
10704            printf(" %d", n_name);
10705            printf("\n");
10706        }
10707    }
10708    }
10709
10710    function_tests++;
10711    return(ret);
10712}
10713
10714
10715static int
10716test_xmlGetNodePath(void) {
10717    int ret = 0;
10718
10719#ifdef LIBXML_TREE_ENABLED
10720    int mem_base;
10721    xmlChar * ret_val;
10722    xmlNodePtr node; /* a node */
10723    int n_node;
10724
10725    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
10726        mem_base = xmlMemBlocks();
10727        node = gen_xmlNodePtr(n_node, 0);
10728
10729        ret_val = xmlGetNodePath(node);
10730        desret_xmlChar_ptr(ret_val);
10731        call_tests++;
10732        des_xmlNodePtr(n_node, node, 0);
10733        xmlResetLastError();
10734        if (mem_base != xmlMemBlocks()) {
10735            printf("Leak of %d blocks found in xmlGetNodePath",
10736	           xmlMemBlocks() - mem_base);
10737	    ret++;
10738            printf(" %d", n_node);
10739            printf("\n");
10740        }
10741    }
10742#endif
10743
10744    function_tests++;
10745    return(ret);
10746}
10747
10748
10749static int
10750test_xmlGetNsList(void) {
10751    int ret = 0;
10752
10753
10754    /* missing type support */
10755    return(ret);
10756}
10757
10758
10759static int
10760test_xmlGetNsProp(void) {
10761    int ret = 0;
10762
10763    int mem_base;
10764    xmlChar * ret_val;
10765    xmlNodePtr node; /* the node */
10766    int n_node;
10767    const xmlChar * name; /* the attribute name */
10768    int n_name;
10769    const xmlChar * nameSpace; /* the URI of the namespace */
10770    int n_nameSpace;
10771
10772    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
10773    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10774    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
10775        mem_base = xmlMemBlocks();
10776        node = gen_xmlNodePtr(n_node, 0);
10777        name = gen_const_xmlChar_ptr(n_name, 1);
10778        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
10779
10780        ret_val = xmlGetNsProp(node, name, nameSpace);
10781        desret_xmlChar_ptr(ret_val);
10782        call_tests++;
10783        des_xmlNodePtr(n_node, node, 0);
10784        des_const_xmlChar_ptr(n_name, name, 1);
10785        des_const_xmlChar_ptr(n_nameSpace, nameSpace, 2);
10786        xmlResetLastError();
10787        if (mem_base != xmlMemBlocks()) {
10788            printf("Leak of %d blocks found in xmlGetNsProp",
10789	           xmlMemBlocks() - mem_base);
10790	    ret++;
10791            printf(" %d", n_node);
10792            printf(" %d", n_name);
10793            printf(" %d", n_nameSpace);
10794            printf("\n");
10795        }
10796    }
10797    }
10798    }
10799
10800    function_tests++;
10801    return(ret);
10802}
10803
10804
10805static int
10806test_xmlGetProp(void) {
10807    int ret = 0;
10808
10809    int mem_base;
10810    xmlChar * ret_val;
10811    xmlNodePtr node; /* the node */
10812    int n_node;
10813    const xmlChar * name; /* the attribute name */
10814    int n_name;
10815
10816    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
10817    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10818        mem_base = xmlMemBlocks();
10819        node = gen_xmlNodePtr(n_node, 0);
10820        name = gen_const_xmlChar_ptr(n_name, 1);
10821
10822        ret_val = xmlGetProp(node, name);
10823        desret_xmlChar_ptr(ret_val);
10824        call_tests++;
10825        des_xmlNodePtr(n_node, node, 0);
10826        des_const_xmlChar_ptr(n_name, name, 1);
10827        xmlResetLastError();
10828        if (mem_base != xmlMemBlocks()) {
10829            printf("Leak of %d blocks found in xmlGetProp",
10830	           xmlMemBlocks() - mem_base);
10831	    ret++;
10832            printf(" %d", n_node);
10833            printf(" %d", n_name);
10834            printf("\n");
10835        }
10836    }
10837    }
10838
10839    function_tests++;
10840    return(ret);
10841}
10842
10843
10844static int
10845test_xmlHasNsProp(void) {
10846    int ret = 0;
10847
10848
10849    /* missing type support */
10850    return(ret);
10851}
10852
10853
10854static int
10855test_xmlHasProp(void) {
10856    int ret = 0;
10857
10858
10859    /* missing type support */
10860    return(ret);
10861}
10862
10863
10864static int
10865test_xmlIsBlankNode(void) {
10866    int ret = 0;
10867
10868    int mem_base;
10869    int ret_val;
10870    xmlNodePtr node; /* the node */
10871    int n_node;
10872
10873    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
10874        mem_base = xmlMemBlocks();
10875        node = gen_xmlNodePtr(n_node, 0);
10876
10877        ret_val = xmlIsBlankNode(node);
10878        desret_int(ret_val);
10879        call_tests++;
10880        des_xmlNodePtr(n_node, node, 0);
10881        xmlResetLastError();
10882        if (mem_base != xmlMemBlocks()) {
10883            printf("Leak of %d blocks found in xmlIsBlankNode",
10884	           xmlMemBlocks() - mem_base);
10885	    ret++;
10886            printf(" %d", n_node);
10887            printf("\n");
10888        }
10889    }
10890
10891    function_tests++;
10892    return(ret);
10893}
10894
10895
10896static int
10897test_xmlIsXHTML(void) {
10898    int ret = 0;
10899
10900    int mem_base;
10901    int ret_val;
10902    const xmlChar * systemID; /* the system identifier */
10903    int n_systemID;
10904    const xmlChar * publicID; /* the public identifier */
10905    int n_publicID;
10906
10907    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
10908    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
10909        mem_base = xmlMemBlocks();
10910        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
10911        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
10912
10913        ret_val = xmlIsXHTML(systemID, publicID);
10914        desret_int(ret_val);
10915        call_tests++;
10916        des_const_xmlChar_ptr(n_systemID, systemID, 0);
10917        des_const_xmlChar_ptr(n_publicID, publicID, 1);
10918        xmlResetLastError();
10919        if (mem_base != xmlMemBlocks()) {
10920            printf("Leak of %d blocks found in xmlIsXHTML",
10921	           xmlMemBlocks() - mem_base);
10922	    ret++;
10923            printf(" %d", n_systemID);
10924            printf(" %d", n_publicID);
10925            printf("\n");
10926        }
10927    }
10928    }
10929
10930    function_tests++;
10931    return(ret);
10932}
10933
10934
10935static int
10936test_xmlNewCDataBlock(void) {
10937    int ret = 0;
10938
10939    int mem_base;
10940    xmlNodePtr ret_val;
10941    xmlDocPtr doc; /* the document */
10942    int n_doc;
10943    const xmlChar * content; /* the CDATA block content content */
10944    int n_content;
10945    int len; /* the length of the block */
10946    int n_len;
10947
10948    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10949    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
10950    for (n_len = 0;n_len < gen_nb_int;n_len++) {
10951        mem_base = xmlMemBlocks();
10952        doc = gen_xmlDocPtr(n_doc, 0);
10953        content = gen_const_xmlChar_ptr(n_content, 1);
10954        len = gen_int(n_len, 2);
10955
10956        ret_val = xmlNewCDataBlock(doc, content, len);
10957        desret_xmlNodePtr(ret_val);
10958        call_tests++;
10959        des_xmlDocPtr(n_doc, doc, 0);
10960        des_const_xmlChar_ptr(n_content, content, 1);
10961        des_int(n_len, len, 2);
10962        xmlResetLastError();
10963        if (mem_base != xmlMemBlocks()) {
10964            printf("Leak of %d blocks found in xmlNewCDataBlock",
10965	           xmlMemBlocks() - mem_base);
10966	    ret++;
10967            printf(" %d", n_doc);
10968            printf(" %d", n_content);
10969            printf(" %d", n_len);
10970            printf("\n");
10971        }
10972    }
10973    }
10974    }
10975
10976    function_tests++;
10977    return(ret);
10978}
10979
10980
10981static int
10982test_xmlNewCharRef(void) {
10983    int ret = 0;
10984
10985    int mem_base;
10986    xmlNodePtr ret_val;
10987    xmlDocPtr doc; /* the document */
10988    int n_doc;
10989    const xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
10990    int n_name;
10991
10992    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
10993    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10994        mem_base = xmlMemBlocks();
10995        doc = gen_xmlDocPtr(n_doc, 0);
10996        name = gen_const_xmlChar_ptr(n_name, 1);
10997
10998        ret_val = xmlNewCharRef(doc, name);
10999        desret_xmlNodePtr(ret_val);
11000        call_tests++;
11001        des_xmlDocPtr(n_doc, doc, 0);
11002        des_const_xmlChar_ptr(n_name, name, 1);
11003        xmlResetLastError();
11004        if (mem_base != xmlMemBlocks()) {
11005            printf("Leak of %d blocks found in xmlNewCharRef",
11006	           xmlMemBlocks() - mem_base);
11007	    ret++;
11008            printf(" %d", n_doc);
11009            printf(" %d", n_name);
11010            printf("\n");
11011        }
11012    }
11013    }
11014
11015    function_tests++;
11016    return(ret);
11017}
11018
11019
11020static int
11021test_xmlNewChild(void) {
11022    int ret = 0;
11023
11024    int mem_base;
11025    xmlNodePtr ret_val;
11026    xmlNodePtr parent; /* the parent node */
11027    int n_parent;
11028    xmlNsPtr ns; /* a namespace if any */
11029    int n_ns;
11030    const xmlChar * name; /* the name of the child */
11031    int n_name;
11032    const xmlChar * content; /* the XML content of the child if any. */
11033    int n_content;
11034
11035    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
11036    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
11037    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11038    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11039        mem_base = xmlMemBlocks();
11040        parent = gen_xmlNodePtr(n_parent, 0);
11041        ns = gen_xmlNsPtr(n_ns, 1);
11042        name = gen_const_xmlChar_ptr(n_name, 2);
11043        content = gen_const_xmlChar_ptr(n_content, 3);
11044
11045        ret_val = xmlNewChild(parent, ns, name, content);
11046        desret_xmlNodePtr(ret_val);
11047        call_tests++;
11048        des_xmlNodePtr(n_parent, parent, 0);
11049        des_xmlNsPtr(n_ns, ns, 1);
11050        des_const_xmlChar_ptr(n_name, name, 2);
11051        des_const_xmlChar_ptr(n_content, content, 3);
11052        xmlResetLastError();
11053        if (mem_base != xmlMemBlocks()) {
11054            printf("Leak of %d blocks found in xmlNewChild",
11055	           xmlMemBlocks() - mem_base);
11056	    ret++;
11057            printf(" %d", n_parent);
11058            printf(" %d", n_ns);
11059            printf(" %d", n_name);
11060            printf(" %d", n_content);
11061            printf("\n");
11062        }
11063    }
11064    }
11065    }
11066    }
11067
11068    function_tests++;
11069    return(ret);
11070}
11071
11072
11073static int
11074test_xmlNewComment(void) {
11075    int ret = 0;
11076
11077    int mem_base;
11078    xmlNodePtr ret_val;
11079    const xmlChar * content; /* the comment content */
11080    int n_content;
11081
11082    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11083        mem_base = xmlMemBlocks();
11084        content = gen_const_xmlChar_ptr(n_content, 0);
11085
11086        ret_val = xmlNewComment(content);
11087        desret_xmlNodePtr(ret_val);
11088        call_tests++;
11089        des_const_xmlChar_ptr(n_content, content, 0);
11090        xmlResetLastError();
11091        if (mem_base != xmlMemBlocks()) {
11092            printf("Leak of %d blocks found in xmlNewComment",
11093	           xmlMemBlocks() - mem_base);
11094	    ret++;
11095            printf(" %d", n_content);
11096            printf("\n");
11097        }
11098    }
11099
11100    function_tests++;
11101    return(ret);
11102}
11103
11104
11105static int
11106test_xmlNewDoc(void) {
11107    int ret = 0;
11108
11109    int mem_base;
11110    xmlDocPtr ret_val;
11111    const xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
11112    int n_version;
11113
11114    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
11115        mem_base = xmlMemBlocks();
11116        version = gen_const_xmlChar_ptr(n_version, 0);
11117
11118        ret_val = xmlNewDoc(version);
11119        desret_xmlDocPtr(ret_val);
11120        call_tests++;
11121        des_const_xmlChar_ptr(n_version, version, 0);
11122        xmlResetLastError();
11123        if (mem_base != xmlMemBlocks()) {
11124            printf("Leak of %d blocks found in xmlNewDoc",
11125	           xmlMemBlocks() - mem_base);
11126	    ret++;
11127            printf(" %d", n_version);
11128            printf("\n");
11129        }
11130    }
11131
11132    function_tests++;
11133    return(ret);
11134}
11135
11136
11137static int
11138test_xmlNewDocComment(void) {
11139    int ret = 0;
11140
11141    int mem_base;
11142    xmlNodePtr ret_val;
11143    xmlDocPtr doc; /* the document */
11144    int n_doc;
11145    const xmlChar * content; /* the comment content */
11146    int n_content;
11147
11148    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11149    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11150        mem_base = xmlMemBlocks();
11151        doc = gen_xmlDocPtr(n_doc, 0);
11152        content = gen_const_xmlChar_ptr(n_content, 1);
11153
11154        ret_val = xmlNewDocComment(doc, content);
11155        desret_xmlNodePtr(ret_val);
11156        call_tests++;
11157        des_xmlDocPtr(n_doc, doc, 0);
11158        des_const_xmlChar_ptr(n_content, content, 1);
11159        xmlResetLastError();
11160        if (mem_base != xmlMemBlocks()) {
11161            printf("Leak of %d blocks found in xmlNewDocComment",
11162	           xmlMemBlocks() - mem_base);
11163	    ret++;
11164            printf(" %d", n_doc);
11165            printf(" %d", n_content);
11166            printf("\n");
11167        }
11168    }
11169    }
11170
11171    function_tests++;
11172    return(ret);
11173}
11174
11175
11176static int
11177test_xmlNewDocFragment(void) {
11178    int ret = 0;
11179
11180#ifdef LIBXML_TREE_ENABLED
11181    int mem_base;
11182    xmlNodePtr ret_val;
11183    xmlDocPtr doc; /* the document owning the fragment */
11184    int n_doc;
11185
11186    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11187        mem_base = xmlMemBlocks();
11188        doc = gen_xmlDocPtr(n_doc, 0);
11189
11190        ret_val = xmlNewDocFragment(doc);
11191        desret_xmlNodePtr(ret_val);
11192        call_tests++;
11193        des_xmlDocPtr(n_doc, doc, 0);
11194        xmlResetLastError();
11195        if (mem_base != xmlMemBlocks()) {
11196            printf("Leak of %d blocks found in xmlNewDocFragment",
11197	           xmlMemBlocks() - mem_base);
11198	    ret++;
11199            printf(" %d", n_doc);
11200            printf("\n");
11201        }
11202    }
11203#endif
11204
11205    function_tests++;
11206    return(ret);
11207}
11208
11209
11210static int
11211test_xmlNewDocNode(void) {
11212    int ret = 0;
11213
11214    int mem_base;
11215    xmlNodePtr ret_val;
11216    xmlDocPtr doc; /* the document */
11217    int n_doc;
11218    xmlNsPtr ns; /* namespace if any */
11219    int n_ns;
11220    const xmlChar * name; /* the node name */
11221    int n_name;
11222    const xmlChar * content; /* the XML text content if any */
11223    int n_content;
11224
11225    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11226    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
11227    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11228    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11229        mem_base = xmlMemBlocks();
11230        doc = gen_xmlDocPtr(n_doc, 0);
11231        ns = gen_xmlNsPtr(n_ns, 1);
11232        name = gen_const_xmlChar_ptr(n_name, 2);
11233        content = gen_const_xmlChar_ptr(n_content, 3);
11234
11235        ret_val = xmlNewDocNode(doc, ns, name, content);
11236        desret_xmlNodePtr(ret_val);
11237        call_tests++;
11238        des_xmlDocPtr(n_doc, doc, 0);
11239        des_xmlNsPtr(n_ns, ns, 1);
11240        des_const_xmlChar_ptr(n_name, name, 2);
11241        des_const_xmlChar_ptr(n_content, content, 3);
11242        xmlResetLastError();
11243        if (mem_base != xmlMemBlocks()) {
11244            printf("Leak of %d blocks found in xmlNewDocNode",
11245	           xmlMemBlocks() - mem_base);
11246	    ret++;
11247            printf(" %d", n_doc);
11248            printf(" %d", n_ns);
11249            printf(" %d", n_name);
11250            printf(" %d", n_content);
11251            printf("\n");
11252        }
11253    }
11254    }
11255    }
11256    }
11257
11258    function_tests++;
11259    return(ret);
11260}
11261
11262
11263static int
11264test_xmlNewDocNodeEatName(void) {
11265    int ret = 0;
11266
11267    int mem_base;
11268    xmlNodePtr ret_val;
11269    xmlDocPtr doc; /* the document */
11270    int n_doc;
11271    xmlNsPtr ns; /* namespace if any */
11272    int n_ns;
11273    xmlChar * name; /* the node name */
11274    int n_name;
11275    const xmlChar * content; /* the XML text content if any */
11276    int n_content;
11277
11278    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11279    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
11280    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
11281    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11282        mem_base = xmlMemBlocks();
11283        doc = gen_xmlDocPtr(n_doc, 0);
11284        ns = gen_xmlNsPtr(n_ns, 1);
11285        name = gen_eaten_name(n_name, 2);
11286        content = gen_const_xmlChar_ptr(n_content, 3);
11287
11288        ret_val = xmlNewDocNodeEatName(doc, ns, name, content);
11289        desret_xmlNodePtr(ret_val);
11290        call_tests++;
11291        des_xmlDocPtr(n_doc, doc, 0);
11292        des_xmlNsPtr(n_ns, ns, 1);
11293        des_eaten_name(n_name, name, 2);
11294        des_const_xmlChar_ptr(n_content, content, 3);
11295        xmlResetLastError();
11296        if (mem_base != xmlMemBlocks()) {
11297            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
11298	           xmlMemBlocks() - mem_base);
11299	    ret++;
11300            printf(" %d", n_doc);
11301            printf(" %d", n_ns);
11302            printf(" %d", n_name);
11303            printf(" %d", n_content);
11304            printf("\n");
11305        }
11306    }
11307    }
11308    }
11309    }
11310
11311    function_tests++;
11312    return(ret);
11313}
11314
11315
11316static int
11317test_xmlNewDocPI(void) {
11318    int ret = 0;
11319
11320    int mem_base;
11321    xmlNodePtr ret_val;
11322    xmlDocPtr doc; /* the target document */
11323    int n_doc;
11324    const xmlChar * name; /* the processing instruction name */
11325    int n_name;
11326    const xmlChar * content; /* the PI content */
11327    int n_content;
11328
11329    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11330    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11331    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11332        mem_base = xmlMemBlocks();
11333        doc = gen_xmlDocPtr(n_doc, 0);
11334        name = gen_const_xmlChar_ptr(n_name, 1);
11335        content = gen_const_xmlChar_ptr(n_content, 2);
11336
11337        ret_val = xmlNewDocPI(doc, name, content);
11338        desret_xmlNodePtr(ret_val);
11339        call_tests++;
11340        des_xmlDocPtr(n_doc, doc, 0);
11341        des_const_xmlChar_ptr(n_name, name, 1);
11342        des_const_xmlChar_ptr(n_content, content, 2);
11343        xmlResetLastError();
11344        if (mem_base != xmlMemBlocks()) {
11345            printf("Leak of %d blocks found in xmlNewDocPI",
11346	           xmlMemBlocks() - mem_base);
11347	    ret++;
11348            printf(" %d", n_doc);
11349            printf(" %d", n_name);
11350            printf(" %d", n_content);
11351            printf("\n");
11352        }
11353    }
11354    }
11355    }
11356
11357    function_tests++;
11358    return(ret);
11359}
11360
11361
11362static int
11363test_xmlNewDocProp(void) {
11364    int ret = 0;
11365
11366
11367    /* missing type support */
11368    return(ret);
11369}
11370
11371
11372static int
11373test_xmlNewDocRawNode(void) {
11374    int ret = 0;
11375
11376    int mem_base;
11377    xmlNodePtr ret_val;
11378    xmlDocPtr doc; /* the document */
11379    int n_doc;
11380    xmlNsPtr ns; /* namespace if any */
11381    int n_ns;
11382    const xmlChar * name; /* the node name */
11383    int n_name;
11384    const xmlChar * content; /* the text content if any */
11385    int n_content;
11386
11387    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11388    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
11389    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11390    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11391        mem_base = xmlMemBlocks();
11392        doc = gen_xmlDocPtr(n_doc, 0);
11393        ns = gen_xmlNsPtr(n_ns, 1);
11394        name = gen_const_xmlChar_ptr(n_name, 2);
11395        content = gen_const_xmlChar_ptr(n_content, 3);
11396
11397        ret_val = xmlNewDocRawNode(doc, ns, name, content);
11398        desret_xmlNodePtr(ret_val);
11399        call_tests++;
11400        des_xmlDocPtr(n_doc, doc, 0);
11401        des_xmlNsPtr(n_ns, ns, 1);
11402        des_const_xmlChar_ptr(n_name, name, 2);
11403        des_const_xmlChar_ptr(n_content, content, 3);
11404        xmlResetLastError();
11405        if (mem_base != xmlMemBlocks()) {
11406            printf("Leak of %d blocks found in xmlNewDocRawNode",
11407	           xmlMemBlocks() - mem_base);
11408	    ret++;
11409            printf(" %d", n_doc);
11410            printf(" %d", n_ns);
11411            printf(" %d", n_name);
11412            printf(" %d", n_content);
11413            printf("\n");
11414        }
11415    }
11416    }
11417    }
11418    }
11419
11420    function_tests++;
11421    return(ret);
11422}
11423
11424
11425static int
11426test_xmlNewDocText(void) {
11427    int ret = 0;
11428
11429    int mem_base;
11430    xmlNodePtr ret_val;
11431    xmlDocPtr doc; /* the document */
11432    int n_doc;
11433    const xmlChar * content; /* the text content */
11434    int n_content;
11435
11436    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11437    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11438        mem_base = xmlMemBlocks();
11439        doc = gen_xmlDocPtr(n_doc, 0);
11440        content = gen_const_xmlChar_ptr(n_content, 1);
11441
11442        ret_val = xmlNewDocText(doc, content);
11443        desret_xmlNodePtr(ret_val);
11444        call_tests++;
11445        des_xmlDocPtr(n_doc, doc, 0);
11446        des_const_xmlChar_ptr(n_content, content, 1);
11447        xmlResetLastError();
11448        if (mem_base != xmlMemBlocks()) {
11449            printf("Leak of %d blocks found in xmlNewDocText",
11450	           xmlMemBlocks() - mem_base);
11451	    ret++;
11452            printf(" %d", n_doc);
11453            printf(" %d", n_content);
11454            printf("\n");
11455        }
11456    }
11457    }
11458
11459    function_tests++;
11460    return(ret);
11461}
11462
11463
11464static int
11465test_xmlNewDocTextLen(void) {
11466    int ret = 0;
11467
11468    int mem_base;
11469    xmlNodePtr ret_val;
11470    xmlDocPtr doc; /* the document */
11471    int n_doc;
11472    const xmlChar * content; /* the text content */
11473    int n_content;
11474    int len; /* the text len. */
11475    int n_len;
11476
11477    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11478    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11479    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11480        mem_base = xmlMemBlocks();
11481        doc = gen_xmlDocPtr(n_doc, 0);
11482        content = gen_const_xmlChar_ptr(n_content, 1);
11483        len = gen_int(n_len, 2);
11484
11485        ret_val = xmlNewDocTextLen(doc, content, len);
11486        desret_xmlNodePtr(ret_val);
11487        call_tests++;
11488        des_xmlDocPtr(n_doc, doc, 0);
11489        des_const_xmlChar_ptr(n_content, content, 1);
11490        des_int(n_len, len, 2);
11491        xmlResetLastError();
11492        if (mem_base != xmlMemBlocks()) {
11493            printf("Leak of %d blocks found in xmlNewDocTextLen",
11494	           xmlMemBlocks() - mem_base);
11495	    ret++;
11496            printf(" %d", n_doc);
11497            printf(" %d", n_content);
11498            printf(" %d", n_len);
11499            printf("\n");
11500        }
11501    }
11502    }
11503    }
11504
11505    function_tests++;
11506    return(ret);
11507}
11508
11509
11510static int
11511test_xmlNewDtd(void) {
11512    int ret = 0;
11513
11514    int mem_base;
11515    xmlDtdPtr ret_val;
11516    xmlDocPtr doc; /* the document pointer */
11517    int n_doc;
11518    const xmlChar * name; /* the DTD name */
11519    int n_name;
11520    const xmlChar * ExternalID; /* the external ID */
11521    int n_ExternalID;
11522    const xmlChar * SystemID; /* the system ID */
11523    int n_SystemID;
11524
11525    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11526    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11527    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
11528    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
11529        mem_base = xmlMemBlocks();
11530        doc = gen_xmlDocPtr(n_doc, 0);
11531        name = gen_const_xmlChar_ptr(n_name, 1);
11532        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
11533        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
11534
11535        ret_val = xmlNewDtd(doc, name, ExternalID, SystemID);
11536        desret_xmlDtdPtr(ret_val);
11537        call_tests++;
11538        des_xmlDocPtr(n_doc, doc, 0);
11539        des_const_xmlChar_ptr(n_name, name, 1);
11540        des_const_xmlChar_ptr(n_ExternalID, ExternalID, 2);
11541        des_const_xmlChar_ptr(n_SystemID, SystemID, 3);
11542        xmlResetLastError();
11543        if (mem_base != xmlMemBlocks()) {
11544            printf("Leak of %d blocks found in xmlNewDtd",
11545	           xmlMemBlocks() - mem_base);
11546	    ret++;
11547            printf(" %d", n_doc);
11548            printf(" %d", n_name);
11549            printf(" %d", n_ExternalID);
11550            printf(" %d", n_SystemID);
11551            printf("\n");
11552        }
11553    }
11554    }
11555    }
11556    }
11557
11558    function_tests++;
11559    return(ret);
11560}
11561
11562
11563static int
11564test_xmlNewGlobalNs(void) {
11565    int ret = 0;
11566
11567
11568    /* missing type support */
11569    return(ret);
11570}
11571
11572
11573static int
11574test_xmlNewNode(void) {
11575    int ret = 0;
11576
11577    int mem_base;
11578    xmlNodePtr ret_val;
11579    xmlNsPtr ns; /* namespace if any */
11580    int n_ns;
11581    const xmlChar * name; /* the node name */
11582    int n_name;
11583
11584    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
11585    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11586        mem_base = xmlMemBlocks();
11587        ns = gen_xmlNsPtr(n_ns, 0);
11588        name = gen_const_xmlChar_ptr(n_name, 1);
11589
11590        ret_val = xmlNewNode(ns, name);
11591        desret_xmlNodePtr(ret_val);
11592        call_tests++;
11593        des_xmlNsPtr(n_ns, ns, 0);
11594        des_const_xmlChar_ptr(n_name, name, 1);
11595        xmlResetLastError();
11596        if (mem_base != xmlMemBlocks()) {
11597            printf("Leak of %d blocks found in xmlNewNode",
11598	           xmlMemBlocks() - mem_base);
11599	    ret++;
11600            printf(" %d", n_ns);
11601            printf(" %d", n_name);
11602            printf("\n");
11603        }
11604    }
11605    }
11606
11607    function_tests++;
11608    return(ret);
11609}
11610
11611
11612static int
11613test_xmlNewNodeEatName(void) {
11614    int ret = 0;
11615
11616    int mem_base;
11617    xmlNodePtr ret_val;
11618    xmlNsPtr ns; /* namespace if any */
11619    int n_ns;
11620    xmlChar * name; /* the node name */
11621    int n_name;
11622
11623    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
11624    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
11625        mem_base = xmlMemBlocks();
11626        ns = gen_xmlNsPtr(n_ns, 0);
11627        name = gen_eaten_name(n_name, 1);
11628
11629        ret_val = xmlNewNodeEatName(ns, name);
11630        desret_xmlNodePtr(ret_val);
11631        call_tests++;
11632        des_xmlNsPtr(n_ns, ns, 0);
11633        des_eaten_name(n_name, name, 1);
11634        xmlResetLastError();
11635        if (mem_base != xmlMemBlocks()) {
11636            printf("Leak of %d blocks found in xmlNewNodeEatName",
11637	           xmlMemBlocks() - mem_base);
11638	    ret++;
11639            printf(" %d", n_ns);
11640            printf(" %d", n_name);
11641            printf("\n");
11642        }
11643    }
11644    }
11645
11646    function_tests++;
11647    return(ret);
11648}
11649
11650
11651static int
11652test_xmlNewNs(void) {
11653    int ret = 0;
11654
11655
11656    /* missing type support */
11657    return(ret);
11658}
11659
11660
11661static int
11662test_xmlNewNsProp(void) {
11663    int ret = 0;
11664
11665
11666    /* missing type support */
11667    return(ret);
11668}
11669
11670
11671static int
11672test_xmlNewNsPropEatName(void) {
11673    int ret = 0;
11674
11675
11676    /* missing type support */
11677    return(ret);
11678}
11679
11680
11681static int
11682test_xmlNewPI(void) {
11683    int ret = 0;
11684
11685    int mem_base;
11686    xmlNodePtr ret_val;
11687    const xmlChar * name; /* the processing instruction name */
11688    int n_name;
11689    const xmlChar * content; /* the PI content */
11690    int n_content;
11691
11692    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11693    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11694        mem_base = xmlMemBlocks();
11695        name = gen_const_xmlChar_ptr(n_name, 0);
11696        content = gen_const_xmlChar_ptr(n_content, 1);
11697
11698        ret_val = xmlNewPI(name, content);
11699        desret_xmlNodePtr(ret_val);
11700        call_tests++;
11701        des_const_xmlChar_ptr(n_name, name, 0);
11702        des_const_xmlChar_ptr(n_content, content, 1);
11703        xmlResetLastError();
11704        if (mem_base != xmlMemBlocks()) {
11705            printf("Leak of %d blocks found in xmlNewPI",
11706	           xmlMemBlocks() - mem_base);
11707	    ret++;
11708            printf(" %d", n_name);
11709            printf(" %d", n_content);
11710            printf("\n");
11711        }
11712    }
11713    }
11714
11715    function_tests++;
11716    return(ret);
11717}
11718
11719
11720static int
11721test_xmlNewProp(void) {
11722    int ret = 0;
11723
11724
11725    /* missing type support */
11726    return(ret);
11727}
11728
11729
11730static int
11731test_xmlNewReference(void) {
11732    int ret = 0;
11733
11734    int mem_base;
11735    xmlNodePtr ret_val;
11736    xmlDocPtr doc; /* the document */
11737    int n_doc;
11738    const xmlChar * name; /* the reference name, or the reference string with & and ; */
11739    int n_name;
11740
11741    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
11742    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11743        mem_base = xmlMemBlocks();
11744        doc = gen_xmlDocPtr(n_doc, 0);
11745        name = gen_const_xmlChar_ptr(n_name, 1);
11746
11747        ret_val = xmlNewReference(doc, name);
11748        desret_xmlNodePtr(ret_val);
11749        call_tests++;
11750        des_xmlDocPtr(n_doc, doc, 0);
11751        des_const_xmlChar_ptr(n_name, name, 1);
11752        xmlResetLastError();
11753        if (mem_base != xmlMemBlocks()) {
11754            printf("Leak of %d blocks found in xmlNewReference",
11755	           xmlMemBlocks() - mem_base);
11756	    ret++;
11757            printf(" %d", n_doc);
11758            printf(" %d", n_name);
11759            printf("\n");
11760        }
11761    }
11762    }
11763
11764    function_tests++;
11765    return(ret);
11766}
11767
11768
11769static int
11770test_xmlNewText(void) {
11771    int ret = 0;
11772
11773    int mem_base;
11774    xmlNodePtr ret_val;
11775    const xmlChar * content; /* the text content */
11776    int n_content;
11777
11778    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11779        mem_base = xmlMemBlocks();
11780        content = gen_const_xmlChar_ptr(n_content, 0);
11781
11782        ret_val = xmlNewText(content);
11783        desret_xmlNodePtr(ret_val);
11784        call_tests++;
11785        des_const_xmlChar_ptr(n_content, content, 0);
11786        xmlResetLastError();
11787        if (mem_base != xmlMemBlocks()) {
11788            printf("Leak of %d blocks found in xmlNewText",
11789	           xmlMemBlocks() - mem_base);
11790	    ret++;
11791            printf(" %d", n_content);
11792            printf("\n");
11793        }
11794    }
11795
11796    function_tests++;
11797    return(ret);
11798}
11799
11800
11801static int
11802test_xmlNewTextChild(void) {
11803    int ret = 0;
11804
11805    int mem_base;
11806    xmlNodePtr ret_val;
11807    xmlNodePtr parent; /* the parent node */
11808    int n_parent;
11809    xmlNsPtr ns; /* a namespace if any */
11810    int n_ns;
11811    const xmlChar * name; /* the name of the child */
11812    int n_name;
11813    const xmlChar * content; /* the text content of the child if any. */
11814    int n_content;
11815
11816    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
11817    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
11818    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
11819    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11820        mem_base = xmlMemBlocks();
11821        parent = gen_xmlNodePtr(n_parent, 0);
11822        ns = gen_xmlNsPtr(n_ns, 1);
11823        name = gen_const_xmlChar_ptr(n_name, 2);
11824        content = gen_const_xmlChar_ptr(n_content, 3);
11825
11826        ret_val = xmlNewTextChild(parent, ns, name, content);
11827        desret_xmlNodePtr(ret_val);
11828        call_tests++;
11829        des_xmlNodePtr(n_parent, parent, 0);
11830        des_xmlNsPtr(n_ns, ns, 1);
11831        des_const_xmlChar_ptr(n_name, name, 2);
11832        des_const_xmlChar_ptr(n_content, content, 3);
11833        xmlResetLastError();
11834        if (mem_base != xmlMemBlocks()) {
11835            printf("Leak of %d blocks found in xmlNewTextChild",
11836	           xmlMemBlocks() - mem_base);
11837	    ret++;
11838            printf(" %d", n_parent);
11839            printf(" %d", n_ns);
11840            printf(" %d", n_name);
11841            printf(" %d", n_content);
11842            printf("\n");
11843        }
11844    }
11845    }
11846    }
11847    }
11848
11849    function_tests++;
11850    return(ret);
11851}
11852
11853
11854static int
11855test_xmlNewTextLen(void) {
11856    int ret = 0;
11857
11858    int mem_base;
11859    xmlNodePtr ret_val;
11860    const xmlChar * content; /* the text content */
11861    int n_content;
11862    int len; /* the text len. */
11863    int n_len;
11864
11865    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11866    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11867        mem_base = xmlMemBlocks();
11868        content = gen_const_xmlChar_ptr(n_content, 0);
11869        len = gen_int(n_len, 1);
11870
11871        ret_val = xmlNewTextLen(content, len);
11872        desret_xmlNodePtr(ret_val);
11873        call_tests++;
11874        des_const_xmlChar_ptr(n_content, content, 0);
11875        des_int(n_len, len, 1);
11876        xmlResetLastError();
11877        if (mem_base != xmlMemBlocks()) {
11878            printf("Leak of %d blocks found in xmlNewTextLen",
11879	           xmlMemBlocks() - mem_base);
11880	    ret++;
11881            printf(" %d", n_content);
11882            printf(" %d", n_len);
11883            printf("\n");
11884        }
11885    }
11886    }
11887
11888    function_tests++;
11889    return(ret);
11890}
11891
11892
11893static int
11894test_xmlNodeAddContent(void) {
11895    int ret = 0;
11896
11897    int mem_base;
11898    xmlNodePtr cur; /* the node being modified */
11899    int n_cur;
11900    const xmlChar * content; /* extra content */
11901    int n_content;
11902
11903    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
11904    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11905        mem_base = xmlMemBlocks();
11906        cur = gen_xmlNodePtr(n_cur, 0);
11907        content = gen_const_xmlChar_ptr(n_content, 1);
11908
11909        xmlNodeAddContent(cur, content);
11910        call_tests++;
11911        des_xmlNodePtr(n_cur, cur, 0);
11912        des_const_xmlChar_ptr(n_content, content, 1);
11913        xmlResetLastError();
11914        if (mem_base != xmlMemBlocks()) {
11915            printf("Leak of %d blocks found in xmlNodeAddContent",
11916	           xmlMemBlocks() - mem_base);
11917	    ret++;
11918            printf(" %d", n_cur);
11919            printf(" %d", n_content);
11920            printf("\n");
11921        }
11922    }
11923    }
11924
11925    function_tests++;
11926    return(ret);
11927}
11928
11929
11930static int
11931test_xmlNodeAddContentLen(void) {
11932    int ret = 0;
11933
11934    int mem_base;
11935    xmlNodePtr cur; /* the node being modified */
11936    int n_cur;
11937    const xmlChar * content; /* extra content */
11938    int n_content;
11939    int len; /* the size of @content */
11940    int n_len;
11941
11942    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
11943    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
11944    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11945        mem_base = xmlMemBlocks();
11946        cur = gen_xmlNodePtr(n_cur, 0);
11947        content = gen_const_xmlChar_ptr(n_content, 1);
11948        len = gen_int(n_len, 2);
11949
11950        xmlNodeAddContentLen(cur, content, len);
11951        call_tests++;
11952        des_xmlNodePtr(n_cur, cur, 0);
11953        des_const_xmlChar_ptr(n_content, content, 1);
11954        des_int(n_len, len, 2);
11955        xmlResetLastError();
11956        if (mem_base != xmlMemBlocks()) {
11957            printf("Leak of %d blocks found in xmlNodeAddContentLen",
11958	           xmlMemBlocks() - mem_base);
11959	    ret++;
11960            printf(" %d", n_cur);
11961            printf(" %d", n_content);
11962            printf(" %d", n_len);
11963            printf("\n");
11964        }
11965    }
11966    }
11967    }
11968
11969    function_tests++;
11970    return(ret);
11971}
11972
11973
11974static int
11975test_xmlNodeBufGetContent(void) {
11976    int ret = 0;
11977
11978    int mem_base;
11979    int ret_val;
11980    xmlBufferPtr buffer; /* a buffer */
11981    int n_buffer;
11982    xmlNodePtr cur; /* the node being read */
11983    int n_cur;
11984
11985    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
11986    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
11987        mem_base = xmlMemBlocks();
11988        buffer = gen_xmlBufferPtr(n_buffer, 0);
11989        cur = gen_xmlNodePtr(n_cur, 1);
11990
11991        ret_val = xmlNodeBufGetContent(buffer, cur);
11992        desret_int(ret_val);
11993        call_tests++;
11994        des_xmlBufferPtr(n_buffer, buffer, 0);
11995        des_xmlNodePtr(n_cur, cur, 1);
11996        xmlResetLastError();
11997        if (mem_base != xmlMemBlocks()) {
11998            printf("Leak of %d blocks found in xmlNodeBufGetContent",
11999	           xmlMemBlocks() - mem_base);
12000	    ret++;
12001            printf(" %d", n_buffer);
12002            printf(" %d", n_cur);
12003            printf("\n");
12004        }
12005    }
12006    }
12007
12008    function_tests++;
12009    return(ret);
12010}
12011
12012
12013static int
12014test_xmlNodeDump(void) {
12015    int ret = 0;
12016
12017#ifdef LIBXML_OUTPUT_ENABLED
12018    int mem_base;
12019    int ret_val;
12020    xmlBufferPtr buf; /* the XML buffer output */
12021    int n_buf;
12022    xmlDocPtr doc; /* the document */
12023    int n_doc;
12024    xmlNodePtr cur; /* the current node */
12025    int n_cur;
12026    int level; /* the imbrication level for indenting */
12027    int n_level;
12028    int format; /* is formatting allowed */
12029    int n_format;
12030
12031    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
12032    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
12033    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12034    for (n_level = 0;n_level < gen_nb_int;n_level++) {
12035    for (n_format = 0;n_format < gen_nb_int;n_format++) {
12036        mem_base = xmlMemBlocks();
12037        buf = gen_xmlBufferPtr(n_buf, 0);
12038        doc = gen_xmlDocPtr(n_doc, 1);
12039        cur = gen_xmlNodePtr(n_cur, 2);
12040        level = gen_int(n_level, 3);
12041        format = gen_int(n_format, 4);
12042
12043        ret_val = xmlNodeDump(buf, doc, cur, level, format);
12044        desret_int(ret_val);
12045        call_tests++;
12046        des_xmlBufferPtr(n_buf, buf, 0);
12047        des_xmlDocPtr(n_doc, doc, 1);
12048        des_xmlNodePtr(n_cur, cur, 2);
12049        des_int(n_level, level, 3);
12050        des_int(n_format, format, 4);
12051        xmlResetLastError();
12052        if (mem_base != xmlMemBlocks()) {
12053            printf("Leak of %d blocks found in xmlNodeDump",
12054	           xmlMemBlocks() - mem_base);
12055	    ret++;
12056            printf(" %d", n_buf);
12057            printf(" %d", n_doc);
12058            printf(" %d", n_cur);
12059            printf(" %d", n_level);
12060            printf(" %d", n_format);
12061            printf("\n");
12062        }
12063    }
12064    }
12065    }
12066    }
12067    }
12068#endif
12069
12070    function_tests++;
12071    return(ret);
12072}
12073
12074
12075static int
12076test_xmlNodeDumpOutput(void) {
12077    int ret = 0;
12078
12079#ifdef LIBXML_OUTPUT_ENABLED
12080    int mem_base;
12081    xmlOutputBufferPtr buf; /* the XML buffer output */
12082    int n_buf;
12083    xmlDocPtr doc; /* the document */
12084    int n_doc;
12085    xmlNodePtr cur; /* the current node */
12086    int n_cur;
12087    int level; /* the imbrication level for indenting */
12088    int n_level;
12089    int format; /* is formatting allowed */
12090    int n_format;
12091    const char * encoding; /* an optional encoding string */
12092    int n_encoding;
12093
12094    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
12095    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
12096    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12097    for (n_level = 0;n_level < gen_nb_int;n_level++) {
12098    for (n_format = 0;n_format < gen_nb_int;n_format++) {
12099    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12100        mem_base = xmlMemBlocks();
12101        buf = gen_xmlOutputBufferPtr(n_buf, 0);
12102        doc = gen_xmlDocPtr(n_doc, 1);
12103        cur = gen_xmlNodePtr(n_cur, 2);
12104        level = gen_int(n_level, 3);
12105        format = gen_int(n_format, 4);
12106        encoding = gen_const_char_ptr(n_encoding, 5);
12107
12108        xmlNodeDumpOutput(buf, doc, cur, level, format, encoding);
12109        call_tests++;
12110        des_xmlOutputBufferPtr(n_buf, buf, 0);
12111        des_xmlDocPtr(n_doc, doc, 1);
12112        des_xmlNodePtr(n_cur, cur, 2);
12113        des_int(n_level, level, 3);
12114        des_int(n_format, format, 4);
12115        des_const_char_ptr(n_encoding, encoding, 5);
12116        xmlResetLastError();
12117        if (mem_base != xmlMemBlocks()) {
12118            printf("Leak of %d blocks found in xmlNodeDumpOutput",
12119	           xmlMemBlocks() - mem_base);
12120	    ret++;
12121            printf(" %d", n_buf);
12122            printf(" %d", n_doc);
12123            printf(" %d", n_cur);
12124            printf(" %d", n_level);
12125            printf(" %d", n_format);
12126            printf(" %d", n_encoding);
12127            printf("\n");
12128        }
12129    }
12130    }
12131    }
12132    }
12133    }
12134    }
12135#endif
12136
12137    function_tests++;
12138    return(ret);
12139}
12140
12141
12142static int
12143test_xmlNodeGetBase(void) {
12144    int ret = 0;
12145
12146    int mem_base;
12147    xmlChar * ret_val;
12148    xmlDocPtr doc; /* the document the node pertains to */
12149    int n_doc;
12150    xmlNodePtr cur; /* the node being checked */
12151    int n_cur;
12152
12153    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
12154    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12155        mem_base = xmlMemBlocks();
12156        doc = gen_xmlDocPtr(n_doc, 0);
12157        cur = gen_xmlNodePtr(n_cur, 1);
12158
12159        ret_val = xmlNodeGetBase(doc, cur);
12160        desret_xmlChar_ptr(ret_val);
12161        call_tests++;
12162        des_xmlDocPtr(n_doc, doc, 0);
12163        des_xmlNodePtr(n_cur, cur, 1);
12164        xmlResetLastError();
12165        if (mem_base != xmlMemBlocks()) {
12166            printf("Leak of %d blocks found in xmlNodeGetBase",
12167	           xmlMemBlocks() - mem_base);
12168	    ret++;
12169            printf(" %d", n_doc);
12170            printf(" %d", n_cur);
12171            printf("\n");
12172        }
12173    }
12174    }
12175
12176    function_tests++;
12177    return(ret);
12178}
12179
12180
12181static int
12182test_xmlNodeGetContent(void) {
12183    int ret = 0;
12184
12185    int mem_base;
12186    xmlChar * ret_val;
12187    xmlNodePtr cur; /* the node being read */
12188    int n_cur;
12189
12190    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12191        mem_base = xmlMemBlocks();
12192        cur = gen_xmlNodePtr(n_cur, 0);
12193
12194        ret_val = xmlNodeGetContent(cur);
12195        desret_xmlChar_ptr(ret_val);
12196        call_tests++;
12197        des_xmlNodePtr(n_cur, cur, 0);
12198        xmlResetLastError();
12199        if (mem_base != xmlMemBlocks()) {
12200            printf("Leak of %d blocks found in xmlNodeGetContent",
12201	           xmlMemBlocks() - mem_base);
12202	    ret++;
12203            printf(" %d", n_cur);
12204            printf("\n");
12205        }
12206    }
12207
12208    function_tests++;
12209    return(ret);
12210}
12211
12212
12213static int
12214test_xmlNodeGetLang(void) {
12215    int ret = 0;
12216
12217    int mem_base;
12218    xmlChar * ret_val;
12219    xmlNodePtr cur; /* the node being checked */
12220    int n_cur;
12221
12222    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12223        mem_base = xmlMemBlocks();
12224        cur = gen_xmlNodePtr(n_cur, 0);
12225
12226        ret_val = xmlNodeGetLang(cur);
12227        desret_xmlChar_ptr(ret_val);
12228        call_tests++;
12229        des_xmlNodePtr(n_cur, cur, 0);
12230        xmlResetLastError();
12231        if (mem_base != xmlMemBlocks()) {
12232            printf("Leak of %d blocks found in xmlNodeGetLang",
12233	           xmlMemBlocks() - mem_base);
12234	    ret++;
12235            printf(" %d", n_cur);
12236            printf("\n");
12237        }
12238    }
12239
12240    function_tests++;
12241    return(ret);
12242}
12243
12244
12245static int
12246test_xmlNodeGetSpacePreserve(void) {
12247    int ret = 0;
12248
12249    int mem_base;
12250    int ret_val;
12251    xmlNodePtr cur; /* the node being checked */
12252    int n_cur;
12253
12254    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12255        mem_base = xmlMemBlocks();
12256        cur = gen_xmlNodePtr(n_cur, 0);
12257
12258        ret_val = xmlNodeGetSpacePreserve(cur);
12259        desret_int(ret_val);
12260        call_tests++;
12261        des_xmlNodePtr(n_cur, cur, 0);
12262        xmlResetLastError();
12263        if (mem_base != xmlMemBlocks()) {
12264            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
12265	           xmlMemBlocks() - mem_base);
12266	    ret++;
12267            printf(" %d", n_cur);
12268            printf("\n");
12269        }
12270    }
12271
12272    function_tests++;
12273    return(ret);
12274}
12275
12276
12277static int
12278test_xmlNodeIsText(void) {
12279    int ret = 0;
12280
12281    int mem_base;
12282    int ret_val;
12283    xmlNodePtr node; /* the node */
12284    int n_node;
12285
12286    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
12287        mem_base = xmlMemBlocks();
12288        node = gen_xmlNodePtr(n_node, 0);
12289
12290        ret_val = xmlNodeIsText(node);
12291        desret_int(ret_val);
12292        call_tests++;
12293        des_xmlNodePtr(n_node, node, 0);
12294        xmlResetLastError();
12295        if (mem_base != xmlMemBlocks()) {
12296            printf("Leak of %d blocks found in xmlNodeIsText",
12297	           xmlMemBlocks() - mem_base);
12298	    ret++;
12299            printf(" %d", n_node);
12300            printf("\n");
12301        }
12302    }
12303
12304    function_tests++;
12305    return(ret);
12306}
12307
12308
12309static int
12310test_xmlNodeListGetRawString(void) {
12311    int ret = 0;
12312
12313#ifdef LIBXML_TREE_ENABLED
12314    int mem_base;
12315    xmlChar * ret_val;
12316    xmlDocPtr doc; /* the document */
12317    int n_doc;
12318    xmlNodePtr list; /* a Node list */
12319    int n_list;
12320    int inLine; /* should we replace entity contents or show their external form */
12321    int n_inLine;
12322
12323    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
12324    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
12325    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
12326        mem_base = xmlMemBlocks();
12327        doc = gen_xmlDocPtr(n_doc, 0);
12328        list = gen_xmlNodePtr(n_list, 1);
12329        inLine = gen_int(n_inLine, 2);
12330
12331        ret_val = xmlNodeListGetRawString(doc, list, inLine);
12332        desret_xmlChar_ptr(ret_val);
12333        call_tests++;
12334        des_xmlDocPtr(n_doc, doc, 0);
12335        des_xmlNodePtr(n_list, list, 1);
12336        des_int(n_inLine, inLine, 2);
12337        xmlResetLastError();
12338        if (mem_base != xmlMemBlocks()) {
12339            printf("Leak of %d blocks found in xmlNodeListGetRawString",
12340	           xmlMemBlocks() - mem_base);
12341	    ret++;
12342            printf(" %d", n_doc);
12343            printf(" %d", n_list);
12344            printf(" %d", n_inLine);
12345            printf("\n");
12346        }
12347    }
12348    }
12349    }
12350#endif
12351
12352    function_tests++;
12353    return(ret);
12354}
12355
12356
12357static int
12358test_xmlNodeListGetString(void) {
12359    int ret = 0;
12360
12361    int mem_base;
12362    xmlChar * ret_val;
12363    xmlDocPtr doc; /* the document */
12364    int n_doc;
12365    xmlNodePtr list; /* a Node list */
12366    int n_list;
12367    int inLine; /* should we replace entity contents or show their external form */
12368    int n_inLine;
12369
12370    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
12371    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
12372    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
12373        mem_base = xmlMemBlocks();
12374        doc = gen_xmlDocPtr(n_doc, 0);
12375        list = gen_xmlNodePtr(n_list, 1);
12376        inLine = gen_int(n_inLine, 2);
12377
12378        ret_val = xmlNodeListGetString(doc, list, inLine);
12379        desret_xmlChar_ptr(ret_val);
12380        call_tests++;
12381        des_xmlDocPtr(n_doc, doc, 0);
12382        des_xmlNodePtr(n_list, list, 1);
12383        des_int(n_inLine, inLine, 2);
12384        xmlResetLastError();
12385        if (mem_base != xmlMemBlocks()) {
12386            printf("Leak of %d blocks found in xmlNodeListGetString",
12387	           xmlMemBlocks() - mem_base);
12388	    ret++;
12389            printf(" %d", n_doc);
12390            printf(" %d", n_list);
12391            printf(" %d", n_inLine);
12392            printf("\n");
12393        }
12394    }
12395    }
12396    }
12397
12398    function_tests++;
12399    return(ret);
12400}
12401
12402
12403static int
12404test_xmlNodeSetBase(void) {
12405    int ret = 0;
12406
12407#ifdef LIBXML_TREE_ENABLED
12408    int mem_base;
12409    xmlNodePtr cur; /* the node being changed */
12410    int n_cur;
12411    const xmlChar * uri; /* the new base URI */
12412    int n_uri;
12413
12414    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12415    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
12416        mem_base = xmlMemBlocks();
12417        cur = gen_xmlNodePtr(n_cur, 0);
12418        uri = gen_const_xmlChar_ptr(n_uri, 1);
12419
12420        xmlNodeSetBase(cur, uri);
12421        call_tests++;
12422        des_xmlNodePtr(n_cur, cur, 0);
12423        des_const_xmlChar_ptr(n_uri, uri, 1);
12424        xmlResetLastError();
12425        if (mem_base != xmlMemBlocks()) {
12426            printf("Leak of %d blocks found in xmlNodeSetBase",
12427	           xmlMemBlocks() - mem_base);
12428	    ret++;
12429            printf(" %d", n_cur);
12430            printf(" %d", n_uri);
12431            printf("\n");
12432        }
12433    }
12434    }
12435#endif
12436
12437    function_tests++;
12438    return(ret);
12439}
12440
12441
12442static int
12443test_xmlNodeSetContent(void) {
12444    int ret = 0;
12445
12446    int mem_base;
12447    xmlNodePtr cur; /* the node being modified */
12448    int n_cur;
12449    const xmlChar * content; /* the new value of the content */
12450    int n_content;
12451
12452    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12453    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
12454        mem_base = xmlMemBlocks();
12455        cur = gen_xmlNodePtr(n_cur, 0);
12456        content = gen_const_xmlChar_ptr(n_content, 1);
12457
12458        xmlNodeSetContent(cur, content);
12459        call_tests++;
12460        des_xmlNodePtr(n_cur, cur, 0);
12461        des_const_xmlChar_ptr(n_content, content, 1);
12462        xmlResetLastError();
12463        if (mem_base != xmlMemBlocks()) {
12464            printf("Leak of %d blocks found in xmlNodeSetContent",
12465	           xmlMemBlocks() - mem_base);
12466	    ret++;
12467            printf(" %d", n_cur);
12468            printf(" %d", n_content);
12469            printf("\n");
12470        }
12471    }
12472    }
12473
12474    function_tests++;
12475    return(ret);
12476}
12477
12478
12479static int
12480test_xmlNodeSetContentLen(void) {
12481    int ret = 0;
12482
12483#ifdef LIBXML_TREE_ENABLED
12484    int mem_base;
12485    xmlNodePtr cur; /* the node being modified */
12486    int n_cur;
12487    const xmlChar * content; /* the new value of the content */
12488    int n_content;
12489    int len; /* the size of @content */
12490    int n_len;
12491
12492    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12493    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
12494    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12495        mem_base = xmlMemBlocks();
12496        cur = gen_xmlNodePtr(n_cur, 0);
12497        content = gen_const_xmlChar_ptr(n_content, 1);
12498        len = gen_int(n_len, 2);
12499
12500        xmlNodeSetContentLen(cur, content, len);
12501        call_tests++;
12502        des_xmlNodePtr(n_cur, cur, 0);
12503        des_const_xmlChar_ptr(n_content, content, 1);
12504        des_int(n_len, len, 2);
12505        xmlResetLastError();
12506        if (mem_base != xmlMemBlocks()) {
12507            printf("Leak of %d blocks found in xmlNodeSetContentLen",
12508	           xmlMemBlocks() - mem_base);
12509	    ret++;
12510            printf(" %d", n_cur);
12511            printf(" %d", n_content);
12512            printf(" %d", n_len);
12513            printf("\n");
12514        }
12515    }
12516    }
12517    }
12518#endif
12519
12520    function_tests++;
12521    return(ret);
12522}
12523
12524
12525static int
12526test_xmlNodeSetLang(void) {
12527    int ret = 0;
12528
12529#ifdef LIBXML_TREE_ENABLED
12530    int mem_base;
12531    xmlNodePtr cur; /* the node being changed */
12532    int n_cur;
12533    const xmlChar * lang; /* the language description */
12534    int n_lang;
12535
12536    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12537    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
12538        mem_base = xmlMemBlocks();
12539        cur = gen_xmlNodePtr(n_cur, 0);
12540        lang = gen_const_xmlChar_ptr(n_lang, 1);
12541
12542        xmlNodeSetLang(cur, lang);
12543        call_tests++;
12544        des_xmlNodePtr(n_cur, cur, 0);
12545        des_const_xmlChar_ptr(n_lang, lang, 1);
12546        xmlResetLastError();
12547        if (mem_base != xmlMemBlocks()) {
12548            printf("Leak of %d blocks found in xmlNodeSetLang",
12549	           xmlMemBlocks() - mem_base);
12550	    ret++;
12551            printf(" %d", n_cur);
12552            printf(" %d", n_lang);
12553            printf("\n");
12554        }
12555    }
12556    }
12557#endif
12558
12559    function_tests++;
12560    return(ret);
12561}
12562
12563
12564static int
12565test_xmlNodeSetName(void) {
12566    int ret = 0;
12567
12568#ifdef LIBXML_TREE_ENABLED
12569    int mem_base;
12570    xmlNodePtr cur; /* the node being changed */
12571    int n_cur;
12572    const xmlChar * name; /* the new tag name */
12573    int n_name;
12574
12575    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12576    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
12577        mem_base = xmlMemBlocks();
12578        cur = gen_xmlNodePtr(n_cur, 0);
12579        name = gen_const_xmlChar_ptr(n_name, 1);
12580
12581        xmlNodeSetName(cur, name);
12582        call_tests++;
12583        des_xmlNodePtr(n_cur, cur, 0);
12584        des_const_xmlChar_ptr(n_name, name, 1);
12585        xmlResetLastError();
12586        if (mem_base != xmlMemBlocks()) {
12587            printf("Leak of %d blocks found in xmlNodeSetName",
12588	           xmlMemBlocks() - mem_base);
12589	    ret++;
12590            printf(" %d", n_cur);
12591            printf(" %d", n_name);
12592            printf("\n");
12593        }
12594    }
12595    }
12596#endif
12597
12598    function_tests++;
12599    return(ret);
12600}
12601
12602
12603static int
12604test_xmlNodeSetSpacePreserve(void) {
12605    int ret = 0;
12606
12607#ifdef LIBXML_TREE_ENABLED
12608    int mem_base;
12609    xmlNodePtr cur; /* the node being changed */
12610    int n_cur;
12611    int val; /* the xml:space value ("0": default, 1: "preserve") */
12612    int n_val;
12613
12614    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
12615    for (n_val = 0;n_val < gen_nb_int;n_val++) {
12616        mem_base = xmlMemBlocks();
12617        cur = gen_xmlNodePtr(n_cur, 0);
12618        val = gen_int(n_val, 1);
12619
12620        xmlNodeSetSpacePreserve(cur, val);
12621        call_tests++;
12622        des_xmlNodePtr(n_cur, cur, 0);
12623        des_int(n_val, val, 1);
12624        xmlResetLastError();
12625        if (mem_base != xmlMemBlocks()) {
12626            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
12627	           xmlMemBlocks() - mem_base);
12628	    ret++;
12629            printf(" %d", n_cur);
12630            printf(" %d", n_val);
12631            printf("\n");
12632        }
12633    }
12634    }
12635#endif
12636
12637    function_tests++;
12638    return(ret);
12639}
12640
12641
12642static int
12643test_xmlReconciliateNs(void) {
12644    int ret = 0;
12645
12646    int mem_base;
12647    int ret_val;
12648    xmlDocPtr doc; /* the document */
12649    int n_doc;
12650    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
12651    int n_tree;
12652
12653    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
12654    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
12655        mem_base = xmlMemBlocks();
12656        doc = gen_xmlDocPtr(n_doc, 0);
12657        tree = gen_xmlNodePtr(n_tree, 1);
12658
12659        ret_val = xmlReconciliateNs(doc, tree);
12660        desret_int(ret_val);
12661        call_tests++;
12662        des_xmlDocPtr(n_doc, doc, 0);
12663        des_xmlNodePtr(n_tree, tree, 1);
12664        xmlResetLastError();
12665        if (mem_base != xmlMemBlocks()) {
12666            printf("Leak of %d blocks found in xmlReconciliateNs",
12667	           xmlMemBlocks() - mem_base);
12668	    ret++;
12669            printf(" %d", n_doc);
12670            printf(" %d", n_tree);
12671            printf("\n");
12672        }
12673    }
12674    }
12675
12676    function_tests++;
12677    return(ret);
12678}
12679
12680
12681static int
12682test_xmlRemoveProp(void) {
12683    int ret = 0;
12684
12685#ifdef LIBXML_TREE_ENABLED
12686    int mem_base;
12687    int ret_val;
12688    xmlAttrPtr cur; /* an attribute */
12689    int n_cur;
12690
12691    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
12692        mem_base = xmlMemBlocks();
12693        cur = gen_xmlAttrPtr(n_cur, 0);
12694
12695        ret_val = xmlRemoveProp(cur);
12696        cur = NULL;
12697        desret_int(ret_val);
12698        call_tests++;
12699        des_xmlAttrPtr(n_cur, cur, 0);
12700        xmlResetLastError();
12701        if (mem_base != xmlMemBlocks()) {
12702            printf("Leak of %d blocks found in xmlRemoveProp",
12703	           xmlMemBlocks() - mem_base);
12704	    ret++;
12705            printf(" %d", n_cur);
12706            printf("\n");
12707        }
12708    }
12709#endif
12710
12711    function_tests++;
12712    return(ret);
12713}
12714
12715
12716static int
12717test_xmlReplaceNode(void) {
12718    int ret = 0;
12719
12720#ifdef LIBXML_TREE_ENABLED
12721    int mem_base;
12722    xmlNodePtr ret_val;
12723    xmlNodePtr old; /* the old node */
12724    int n_old;
12725    xmlNodePtr cur; /* the node */
12726    int n_cur;
12727
12728    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
12729    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
12730        mem_base = xmlMemBlocks();
12731        old = gen_xmlNodePtr(n_old, 0);
12732        cur = gen_xmlNodePtr_in(n_cur, 1);
12733
12734        ret_val = xmlReplaceNode(old, cur);
12735        if (cur != NULL) {
12736              xmlUnlinkNode(cur);
12737              xmlFreeNode(cur) ; cur = NULL ; }
12738          if (old != NULL) {
12739              xmlUnlinkNode(old);
12740              xmlFreeNode(old) ; old = NULL ; }
12741	  ret_val = NULL;
12742        desret_xmlNodePtr(ret_val);
12743        call_tests++;
12744        des_xmlNodePtr(n_old, old, 0);
12745        des_xmlNodePtr_in(n_cur, cur, 1);
12746        xmlResetLastError();
12747        if (mem_base != xmlMemBlocks()) {
12748            printf("Leak of %d blocks found in xmlReplaceNode",
12749	           xmlMemBlocks() - mem_base);
12750	    ret++;
12751            printf(" %d", n_old);
12752            printf(" %d", n_cur);
12753            printf("\n");
12754        }
12755    }
12756    }
12757#endif
12758
12759    function_tests++;
12760    return(ret);
12761}
12762
12763
12764static int
12765test_xmlSaveFile(void) {
12766    int ret = 0;
12767
12768#ifdef LIBXML_OUTPUT_ENABLED
12769    int mem_base;
12770    int ret_val;
12771    const char * filename; /* the filename (or URL) */
12772    int n_filename;
12773    xmlDocPtr cur; /* the document */
12774    int n_cur;
12775
12776    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12777    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
12778        mem_base = xmlMemBlocks();
12779        filename = gen_fileoutput(n_filename, 0);
12780        cur = gen_xmlDocPtr(n_cur, 1);
12781
12782        ret_val = xmlSaveFile(filename, cur);
12783        desret_int(ret_val);
12784        call_tests++;
12785        des_fileoutput(n_filename, filename, 0);
12786        des_xmlDocPtr(n_cur, cur, 1);
12787        xmlResetLastError();
12788        if (mem_base != xmlMemBlocks()) {
12789            printf("Leak of %d blocks found in xmlSaveFile",
12790	           xmlMemBlocks() - mem_base);
12791	    ret++;
12792            printf(" %d", n_filename);
12793            printf(" %d", n_cur);
12794            printf("\n");
12795        }
12796    }
12797    }
12798#endif
12799
12800    function_tests++;
12801    return(ret);
12802}
12803
12804
12805static int
12806test_xmlSaveFileEnc(void) {
12807    int ret = 0;
12808
12809#ifdef LIBXML_OUTPUT_ENABLED
12810    int mem_base;
12811    int ret_val;
12812    const char * filename; /* the filename (or URL) */
12813    int n_filename;
12814    xmlDocPtr cur; /* the document */
12815    int n_cur;
12816    const char * encoding; /* the name of an encoding (or NULL) */
12817    int n_encoding;
12818
12819    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12820    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
12821    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12822        mem_base = xmlMemBlocks();
12823        filename = gen_fileoutput(n_filename, 0);
12824        cur = gen_xmlDocPtr(n_cur, 1);
12825        encoding = gen_const_char_ptr(n_encoding, 2);
12826
12827        ret_val = xmlSaveFileEnc(filename, cur, encoding);
12828        desret_int(ret_val);
12829        call_tests++;
12830        des_fileoutput(n_filename, filename, 0);
12831        des_xmlDocPtr(n_cur, cur, 1);
12832        des_const_char_ptr(n_encoding, encoding, 2);
12833        xmlResetLastError();
12834        if (mem_base != xmlMemBlocks()) {
12835            printf("Leak of %d blocks found in xmlSaveFileEnc",
12836	           xmlMemBlocks() - mem_base);
12837	    ret++;
12838            printf(" %d", n_filename);
12839            printf(" %d", n_cur);
12840            printf(" %d", n_encoding);
12841            printf("\n");
12842        }
12843    }
12844    }
12845    }
12846#endif
12847
12848    function_tests++;
12849    return(ret);
12850}
12851
12852
12853static int
12854test_xmlSaveFileTo(void) {
12855    int ret = 0;
12856
12857#ifdef LIBXML_OUTPUT_ENABLED
12858    int mem_base;
12859    int ret_val;
12860    xmlOutputBufferPtr buf; /* an output I/O buffer */
12861    int n_buf;
12862    xmlDocPtr cur; /* the document */
12863    int n_cur;
12864    const char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
12865    int n_encoding;
12866
12867    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
12868    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
12869    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12870        mem_base = xmlMemBlocks();
12871        buf = gen_xmlOutputBufferPtr(n_buf, 0);
12872        cur = gen_xmlDocPtr(n_cur, 1);
12873        encoding = gen_const_char_ptr(n_encoding, 2);
12874
12875        ret_val = xmlSaveFileTo(buf, cur, encoding);
12876        buf = NULL;
12877        desret_int(ret_val);
12878        call_tests++;
12879        des_xmlOutputBufferPtr(n_buf, buf, 0);
12880        des_xmlDocPtr(n_cur, cur, 1);
12881        des_const_char_ptr(n_encoding, encoding, 2);
12882        xmlResetLastError();
12883        if (mem_base != xmlMemBlocks()) {
12884            printf("Leak of %d blocks found in xmlSaveFileTo",
12885	           xmlMemBlocks() - mem_base);
12886	    ret++;
12887            printf(" %d", n_buf);
12888            printf(" %d", n_cur);
12889            printf(" %d", n_encoding);
12890            printf("\n");
12891        }
12892    }
12893    }
12894    }
12895#endif
12896
12897    function_tests++;
12898    return(ret);
12899}
12900
12901
12902static int
12903test_xmlSaveFormatFile(void) {
12904    int ret = 0;
12905
12906#ifdef LIBXML_OUTPUT_ENABLED
12907    int mem_base;
12908    int ret_val;
12909    const char * filename; /* the filename (or URL) */
12910    int n_filename;
12911    xmlDocPtr cur; /* the document */
12912    int n_cur;
12913    int format; /* should formatting spaces been added */
12914    int n_format;
12915
12916    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12917    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
12918    for (n_format = 0;n_format < gen_nb_int;n_format++) {
12919        mem_base = xmlMemBlocks();
12920        filename = gen_fileoutput(n_filename, 0);
12921        cur = gen_xmlDocPtr(n_cur, 1);
12922        format = gen_int(n_format, 2);
12923
12924        ret_val = xmlSaveFormatFile(filename, cur, format);
12925        desret_int(ret_val);
12926        call_tests++;
12927        des_fileoutput(n_filename, filename, 0);
12928        des_xmlDocPtr(n_cur, cur, 1);
12929        des_int(n_format, format, 2);
12930        xmlResetLastError();
12931        if (mem_base != xmlMemBlocks()) {
12932            printf("Leak of %d blocks found in xmlSaveFormatFile",
12933	           xmlMemBlocks() - mem_base);
12934	    ret++;
12935            printf(" %d", n_filename);
12936            printf(" %d", n_cur);
12937            printf(" %d", n_format);
12938            printf("\n");
12939        }
12940    }
12941    }
12942    }
12943#endif
12944
12945    function_tests++;
12946    return(ret);
12947}
12948
12949
12950static int
12951test_xmlSaveFormatFileEnc(void) {
12952    int ret = 0;
12953
12954#ifdef LIBXML_OUTPUT_ENABLED
12955    int mem_base;
12956    int ret_val;
12957    const char * filename; /* the filename or URL to output */
12958    int n_filename;
12959    xmlDocPtr cur; /* the document being saved */
12960    int n_cur;
12961    const char * encoding; /* the name of the encoding to use or NULL. */
12962    int n_encoding;
12963    int format; /* should formatting spaces be added. */
12964    int n_format;
12965
12966    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12967    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
12968    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12969    for (n_format = 0;n_format < gen_nb_int;n_format++) {
12970        mem_base = xmlMemBlocks();
12971        filename = gen_fileoutput(n_filename, 0);
12972        cur = gen_xmlDocPtr(n_cur, 1);
12973        encoding = gen_const_char_ptr(n_encoding, 2);
12974        format = gen_int(n_format, 3);
12975
12976        ret_val = xmlSaveFormatFileEnc(filename, cur, encoding, format);
12977        desret_int(ret_val);
12978        call_tests++;
12979        des_fileoutput(n_filename, filename, 0);
12980        des_xmlDocPtr(n_cur, cur, 1);
12981        des_const_char_ptr(n_encoding, encoding, 2);
12982        des_int(n_format, format, 3);
12983        xmlResetLastError();
12984        if (mem_base != xmlMemBlocks()) {
12985            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
12986	           xmlMemBlocks() - mem_base);
12987	    ret++;
12988            printf(" %d", n_filename);
12989            printf(" %d", n_cur);
12990            printf(" %d", n_encoding);
12991            printf(" %d", n_format);
12992            printf("\n");
12993        }
12994    }
12995    }
12996    }
12997    }
12998#endif
12999
13000    function_tests++;
13001    return(ret);
13002}
13003
13004
13005static int
13006test_xmlSaveFormatFileTo(void) {
13007    int ret = 0;
13008
13009#ifdef LIBXML_OUTPUT_ENABLED
13010    int mem_base;
13011    int ret_val;
13012    xmlOutputBufferPtr buf; /* an output I/O buffer */
13013    int n_buf;
13014    xmlDocPtr cur; /* the document */
13015    int n_cur;
13016    const char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
13017    int n_encoding;
13018    int format; /* should formatting spaces been added */
13019    int n_format;
13020
13021    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
13022    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
13023    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
13024    for (n_format = 0;n_format < gen_nb_int;n_format++) {
13025        mem_base = xmlMemBlocks();
13026        buf = gen_xmlOutputBufferPtr(n_buf, 0);
13027        cur = gen_xmlDocPtr(n_cur, 1);
13028        encoding = gen_const_char_ptr(n_encoding, 2);
13029        format = gen_int(n_format, 3);
13030
13031        ret_val = xmlSaveFormatFileTo(buf, cur, encoding, format);
13032        buf = NULL;
13033        desret_int(ret_val);
13034        call_tests++;
13035        des_xmlOutputBufferPtr(n_buf, buf, 0);
13036        des_xmlDocPtr(n_cur, cur, 1);
13037        des_const_char_ptr(n_encoding, encoding, 2);
13038        des_int(n_format, format, 3);
13039        xmlResetLastError();
13040        if (mem_base != xmlMemBlocks()) {
13041            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
13042	           xmlMemBlocks() - mem_base);
13043	    ret++;
13044            printf(" %d", n_buf);
13045            printf(" %d", n_cur);
13046            printf(" %d", n_encoding);
13047            printf(" %d", n_format);
13048            printf("\n");
13049        }
13050    }
13051    }
13052    }
13053    }
13054#endif
13055
13056    function_tests++;
13057    return(ret);
13058}
13059
13060
13061static int
13062test_xmlSearchNs(void) {
13063    int ret = 0;
13064
13065
13066    /* missing type support */
13067    return(ret);
13068}
13069
13070
13071static int
13072test_xmlSearchNsByHref(void) {
13073    int ret = 0;
13074
13075
13076    /* missing type support */
13077    return(ret);
13078}
13079
13080
13081static int
13082test_xmlSetBufferAllocationScheme(void) {
13083    int ret = 0;
13084
13085
13086    /* missing type support */
13087    return(ret);
13088}
13089
13090
13091static int
13092test_xmlSetCompressMode(void) {
13093    int ret = 0;
13094
13095    int mem_base;
13096    int mode; /* the compression ratio */
13097    int n_mode;
13098
13099    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
13100        mem_base = xmlMemBlocks();
13101        mode = gen_int(n_mode, 0);
13102
13103        xmlSetCompressMode(mode);
13104        call_tests++;
13105        des_int(n_mode, mode, 0);
13106        xmlResetLastError();
13107        if (mem_base != xmlMemBlocks()) {
13108            printf("Leak of %d blocks found in xmlSetCompressMode",
13109	           xmlMemBlocks() - mem_base);
13110	    ret++;
13111            printf(" %d", n_mode);
13112            printf("\n");
13113        }
13114    }
13115
13116    function_tests++;
13117    return(ret);
13118}
13119
13120
13121static int
13122test_xmlSetDocCompressMode(void) {
13123    int ret = 0;
13124
13125    int mem_base;
13126    xmlDocPtr doc; /* the document */
13127    int n_doc;
13128    int mode; /* the compression ratio */
13129    int n_mode;
13130
13131    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13132    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
13133        mem_base = xmlMemBlocks();
13134        doc = gen_xmlDocPtr(n_doc, 0);
13135        mode = gen_int(n_mode, 1);
13136
13137        xmlSetDocCompressMode(doc, mode);
13138        call_tests++;
13139        des_xmlDocPtr(n_doc, doc, 0);
13140        des_int(n_mode, mode, 1);
13141        xmlResetLastError();
13142        if (mem_base != xmlMemBlocks()) {
13143            printf("Leak of %d blocks found in xmlSetDocCompressMode",
13144	           xmlMemBlocks() - mem_base);
13145	    ret++;
13146            printf(" %d", n_doc);
13147            printf(" %d", n_mode);
13148            printf("\n");
13149        }
13150    }
13151    }
13152
13153    function_tests++;
13154    return(ret);
13155}
13156
13157
13158static int
13159test_xmlSetNs(void) {
13160    int ret = 0;
13161
13162    int mem_base;
13163    xmlNodePtr node; /* a node in the document */
13164    int n_node;
13165    xmlNsPtr ns; /* a namespace pointer */
13166    int n_ns;
13167
13168    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13169    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
13170        mem_base = xmlMemBlocks();
13171        node = gen_xmlNodePtr(n_node, 0);
13172        ns = gen_xmlNsPtr(n_ns, 1);
13173
13174        xmlSetNs(node, ns);
13175        call_tests++;
13176        des_xmlNodePtr(n_node, node, 0);
13177        des_xmlNsPtr(n_ns, ns, 1);
13178        xmlResetLastError();
13179        if (mem_base != xmlMemBlocks()) {
13180            printf("Leak of %d blocks found in xmlSetNs",
13181	           xmlMemBlocks() - mem_base);
13182	    ret++;
13183            printf(" %d", n_node);
13184            printf(" %d", n_ns);
13185            printf("\n");
13186        }
13187    }
13188    }
13189
13190    function_tests++;
13191    return(ret);
13192}
13193
13194
13195static int
13196test_xmlSetNsProp(void) {
13197    int ret = 0;
13198
13199
13200    /* missing type support */
13201    return(ret);
13202}
13203
13204
13205static int
13206test_xmlSetProp(void) {
13207    int ret = 0;
13208
13209
13210    /* missing type support */
13211    return(ret);
13212}
13213
13214
13215static int
13216test_xmlSplitQName2(void) {
13217    int ret = 0;
13218
13219
13220    /* missing type support */
13221    return(ret);
13222}
13223
13224
13225static int
13226test_xmlSplitQName3(void) {
13227    int ret = 0;
13228
13229    int mem_base;
13230    const xmlChar * ret_val;
13231    const xmlChar * name; /* the full QName */
13232    int n_name;
13233    int * len; /* an int * */
13234    int n_len;
13235
13236    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
13237    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13238        mem_base = xmlMemBlocks();
13239        name = gen_const_xmlChar_ptr(n_name, 0);
13240        len = gen_int_ptr(n_len, 1);
13241
13242        ret_val = xmlSplitQName3(name, len);
13243        desret_const_xmlChar_ptr(ret_val);
13244        call_tests++;
13245        des_const_xmlChar_ptr(n_name, name, 0);
13246        des_int_ptr(n_len, len, 1);
13247        xmlResetLastError();
13248        if (mem_base != xmlMemBlocks()) {
13249            printf("Leak of %d blocks found in xmlSplitQName3",
13250	           xmlMemBlocks() - mem_base);
13251	    ret++;
13252            printf(" %d", n_name);
13253            printf(" %d", n_len);
13254            printf("\n");
13255        }
13256    }
13257    }
13258
13259    function_tests++;
13260    return(ret);
13261}
13262
13263
13264static int
13265test_xmlStringGetNodeList(void) {
13266    int ret = 0;
13267
13268    int mem_base;
13269    xmlNodePtr ret_val;
13270    xmlDocPtr doc; /* the document */
13271    int n_doc;
13272    const xmlChar * value; /* the value of the attribute */
13273    int n_value;
13274
13275    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13276    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
13277        mem_base = xmlMemBlocks();
13278        doc = gen_xmlDocPtr(n_doc, 0);
13279        value = gen_const_xmlChar_ptr(n_value, 1);
13280
13281        ret_val = xmlStringGetNodeList(doc, value);
13282        desret_xmlNodePtr(ret_val);
13283        call_tests++;
13284        des_xmlDocPtr(n_doc, doc, 0);
13285        des_const_xmlChar_ptr(n_value, value, 1);
13286        xmlResetLastError();
13287        if (mem_base != xmlMemBlocks()) {
13288            printf("Leak of %d blocks found in xmlStringGetNodeList",
13289	           xmlMemBlocks() - mem_base);
13290	    ret++;
13291            printf(" %d", n_doc);
13292            printf(" %d", n_value);
13293            printf("\n");
13294        }
13295    }
13296    }
13297
13298    function_tests++;
13299    return(ret);
13300}
13301
13302
13303static int
13304test_xmlStringLenGetNodeList(void) {
13305    int ret = 0;
13306
13307    int mem_base;
13308    xmlNodePtr ret_val;
13309    xmlDocPtr doc; /* the document */
13310    int n_doc;
13311    const xmlChar * value; /* the value of the text */
13312    int n_value;
13313    int len; /* the length of the string value */
13314    int n_len;
13315
13316    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13317    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
13318    for (n_len = 0;n_len < gen_nb_int;n_len++) {
13319        mem_base = xmlMemBlocks();
13320        doc = gen_xmlDocPtr(n_doc, 0);
13321        value = gen_const_xmlChar_ptr(n_value, 1);
13322        len = gen_int(n_len, 2);
13323
13324        ret_val = xmlStringLenGetNodeList(doc, value, len);
13325        desret_xmlNodePtr(ret_val);
13326        call_tests++;
13327        des_xmlDocPtr(n_doc, doc, 0);
13328        des_const_xmlChar_ptr(n_value, value, 1);
13329        des_int(n_len, len, 2);
13330        xmlResetLastError();
13331        if (mem_base != xmlMemBlocks()) {
13332            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
13333	           xmlMemBlocks() - mem_base);
13334	    ret++;
13335            printf(" %d", n_doc);
13336            printf(" %d", n_value);
13337            printf(" %d", n_len);
13338            printf("\n");
13339        }
13340    }
13341    }
13342    }
13343
13344    function_tests++;
13345    return(ret);
13346}
13347
13348
13349static int
13350test_xmlTextConcat(void) {
13351    int ret = 0;
13352
13353    int mem_base;
13354    int ret_val;
13355    xmlNodePtr node; /* the node */
13356    int n_node;
13357    const xmlChar * content; /* the content */
13358    int n_content;
13359    int len; /* @content length */
13360    int n_len;
13361
13362    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13363    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
13364    for (n_len = 0;n_len < gen_nb_int;n_len++) {
13365        mem_base = xmlMemBlocks();
13366        node = gen_xmlNodePtr(n_node, 0);
13367        content = gen_const_xmlChar_ptr(n_content, 1);
13368        len = gen_int(n_len, 2);
13369
13370        ret_val = xmlTextConcat(node, content, len);
13371        desret_int(ret_val);
13372        call_tests++;
13373        des_xmlNodePtr(n_node, node, 0);
13374        des_const_xmlChar_ptr(n_content, content, 1);
13375        des_int(n_len, len, 2);
13376        xmlResetLastError();
13377        if (mem_base != xmlMemBlocks()) {
13378            printf("Leak of %d blocks found in xmlTextConcat",
13379	           xmlMemBlocks() - mem_base);
13380	    ret++;
13381            printf(" %d", n_node);
13382            printf(" %d", n_content);
13383            printf(" %d", n_len);
13384            printf("\n");
13385        }
13386    }
13387    }
13388    }
13389
13390    function_tests++;
13391    return(ret);
13392}
13393
13394
13395static int
13396test_xmlTextMerge(void) {
13397    int ret = 0;
13398
13399    int mem_base;
13400    xmlNodePtr ret_val;
13401    xmlNodePtr first; /* the first text node */
13402    int n_first;
13403    xmlNodePtr second; /* the second text node being merged */
13404    int n_second;
13405
13406    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
13407    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
13408        mem_base = xmlMemBlocks();
13409        first = gen_xmlNodePtr_in(n_first, 0);
13410        second = gen_xmlNodePtr_in(n_second, 1);
13411
13412        ret_val = xmlTextMerge(first, second);
13413        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
13414              xmlUnlinkNode(second);
13415              xmlFreeNode(second) ; second = NULL ; }
13416        desret_xmlNodePtr(ret_val);
13417        call_tests++;
13418        des_xmlNodePtr_in(n_first, first, 0);
13419        des_xmlNodePtr_in(n_second, second, 1);
13420        xmlResetLastError();
13421        if (mem_base != xmlMemBlocks()) {
13422            printf("Leak of %d blocks found in xmlTextMerge",
13423	           xmlMemBlocks() - mem_base);
13424	    ret++;
13425            printf(" %d", n_first);
13426            printf(" %d", n_second);
13427            printf("\n");
13428        }
13429    }
13430    }
13431
13432    function_tests++;
13433    return(ret);
13434}
13435
13436
13437static int
13438test_xmlUnsetNsProp(void) {
13439    int ret = 0;
13440
13441#ifdef LIBXML_TREE_ENABLED
13442    int mem_base;
13443    int ret_val;
13444    xmlNodePtr node; /* the node */
13445    int n_node;
13446    xmlNsPtr ns; /* the namespace definition */
13447    int n_ns;
13448    const xmlChar * name; /* the attribute name */
13449    int n_name;
13450
13451    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13452    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
13453    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
13454        mem_base = xmlMemBlocks();
13455        node = gen_xmlNodePtr(n_node, 0);
13456        ns = gen_xmlNsPtr(n_ns, 1);
13457        name = gen_const_xmlChar_ptr(n_name, 2);
13458
13459        ret_val = xmlUnsetNsProp(node, ns, name);
13460        desret_int(ret_val);
13461        call_tests++;
13462        des_xmlNodePtr(n_node, node, 0);
13463        des_xmlNsPtr(n_ns, ns, 1);
13464        des_const_xmlChar_ptr(n_name, name, 2);
13465        xmlResetLastError();
13466        if (mem_base != xmlMemBlocks()) {
13467            printf("Leak of %d blocks found in xmlUnsetNsProp",
13468	           xmlMemBlocks() - mem_base);
13469	    ret++;
13470            printf(" %d", n_node);
13471            printf(" %d", n_ns);
13472            printf(" %d", n_name);
13473            printf("\n");
13474        }
13475    }
13476    }
13477    }
13478#endif
13479
13480    function_tests++;
13481    return(ret);
13482}
13483
13484
13485static int
13486test_xmlUnsetProp(void) {
13487    int ret = 0;
13488
13489#ifdef LIBXML_TREE_ENABLED
13490    int mem_base;
13491    int ret_val;
13492    xmlNodePtr node; /* the node */
13493    int n_node;
13494    const xmlChar * name; /* the attribute name */
13495    int n_name;
13496
13497    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13498    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
13499        mem_base = xmlMemBlocks();
13500        node = gen_xmlNodePtr(n_node, 0);
13501        name = gen_const_xmlChar_ptr(n_name, 1);
13502
13503        ret_val = xmlUnsetProp(node, name);
13504        desret_int(ret_val);
13505        call_tests++;
13506        des_xmlNodePtr(n_node, node, 0);
13507        des_const_xmlChar_ptr(n_name, name, 1);
13508        xmlResetLastError();
13509        if (mem_base != xmlMemBlocks()) {
13510            printf("Leak of %d blocks found in xmlUnsetProp",
13511	           xmlMemBlocks() - mem_base);
13512	    ret++;
13513            printf(" %d", n_node);
13514            printf(" %d", n_name);
13515            printf("\n");
13516        }
13517    }
13518    }
13519#endif
13520
13521    function_tests++;
13522    return(ret);
13523}
13524
13525
13526static int
13527test_xmlValidateNCName(void) {
13528    int ret = 0;
13529
13530    int mem_base;
13531    int ret_val;
13532    const xmlChar * value; /* the value to check */
13533    int n_value;
13534    int space; /* allow spaces in front and end of the string */
13535    int n_space;
13536
13537    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
13538    for (n_space = 0;n_space < gen_nb_int;n_space++) {
13539        mem_base = xmlMemBlocks();
13540        value = gen_const_xmlChar_ptr(n_value, 0);
13541        space = gen_int(n_space, 1);
13542
13543        ret_val = xmlValidateNCName(value, space);
13544        desret_int(ret_val);
13545        call_tests++;
13546        des_const_xmlChar_ptr(n_value, value, 0);
13547        des_int(n_space, space, 1);
13548        xmlResetLastError();
13549        if (mem_base != xmlMemBlocks()) {
13550            printf("Leak of %d blocks found in xmlValidateNCName",
13551	           xmlMemBlocks() - mem_base);
13552	    ret++;
13553            printf(" %d", n_value);
13554            printf(" %d", n_space);
13555            printf("\n");
13556        }
13557    }
13558    }
13559
13560    function_tests++;
13561    return(ret);
13562}
13563
13564
13565static int
13566test_xmlValidateNMToken(void) {
13567    int ret = 0;
13568
13569    int mem_base;
13570    int ret_val;
13571    const xmlChar * value; /* the value to check */
13572    int n_value;
13573    int space; /* allow spaces in front and end of the string */
13574    int n_space;
13575
13576    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
13577    for (n_space = 0;n_space < gen_nb_int;n_space++) {
13578        mem_base = xmlMemBlocks();
13579        value = gen_const_xmlChar_ptr(n_value, 0);
13580        space = gen_int(n_space, 1);
13581
13582        ret_val = xmlValidateNMToken(value, space);
13583        desret_int(ret_val);
13584        call_tests++;
13585        des_const_xmlChar_ptr(n_value, value, 0);
13586        des_int(n_space, space, 1);
13587        xmlResetLastError();
13588        if (mem_base != xmlMemBlocks()) {
13589            printf("Leak of %d blocks found in xmlValidateNMToken",
13590	           xmlMemBlocks() - mem_base);
13591	    ret++;
13592            printf(" %d", n_value);
13593            printf(" %d", n_space);
13594            printf("\n");
13595        }
13596    }
13597    }
13598
13599    function_tests++;
13600    return(ret);
13601}
13602
13603
13604static int
13605test_xmlValidateName(void) {
13606    int ret = 0;
13607
13608    int mem_base;
13609    int ret_val;
13610    const xmlChar * value; /* the value to check */
13611    int n_value;
13612    int space; /* allow spaces in front and end of the string */
13613    int n_space;
13614
13615    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
13616    for (n_space = 0;n_space < gen_nb_int;n_space++) {
13617        mem_base = xmlMemBlocks();
13618        value = gen_const_xmlChar_ptr(n_value, 0);
13619        space = gen_int(n_space, 1);
13620
13621        ret_val = xmlValidateName(value, space);
13622        desret_int(ret_val);
13623        call_tests++;
13624        des_const_xmlChar_ptr(n_value, value, 0);
13625        des_int(n_space, space, 1);
13626        xmlResetLastError();
13627        if (mem_base != xmlMemBlocks()) {
13628            printf("Leak of %d blocks found in xmlValidateName",
13629	           xmlMemBlocks() - mem_base);
13630	    ret++;
13631            printf(" %d", n_value);
13632            printf(" %d", n_space);
13633            printf("\n");
13634        }
13635    }
13636    }
13637
13638    function_tests++;
13639    return(ret);
13640}
13641
13642
13643static int
13644test_xmlValidateQName(void) {
13645    int ret = 0;
13646
13647    int mem_base;
13648    int ret_val;
13649    const xmlChar * value; /* the value to check */
13650    int n_value;
13651    int space; /* allow spaces in front and end of the string */
13652    int n_space;
13653
13654    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
13655    for (n_space = 0;n_space < gen_nb_int;n_space++) {
13656        mem_base = xmlMemBlocks();
13657        value = gen_const_xmlChar_ptr(n_value, 0);
13658        space = gen_int(n_space, 1);
13659
13660        ret_val = xmlValidateQName(value, space);
13661        desret_int(ret_val);
13662        call_tests++;
13663        des_const_xmlChar_ptr(n_value, value, 0);
13664        des_int(n_space, space, 1);
13665        xmlResetLastError();
13666        if (mem_base != xmlMemBlocks()) {
13667            printf("Leak of %d blocks found in xmlValidateQName",
13668	           xmlMemBlocks() - mem_base);
13669	    ret++;
13670            printf(" %d", n_value);
13671            printf(" %d", n_space);
13672            printf("\n");
13673        }
13674    }
13675    }
13676
13677    function_tests++;
13678    return(ret);
13679}
13680
13681static int
13682test_tree(void) {
13683    int ret = 0;
13684
13685    printf("Testing tree : 99 of 146 functions ...\n");
13686    ret += test_xmlAddChild();
13687    ret += test_xmlAddChildList();
13688    ret += test_xmlAddNextSibling();
13689    ret += test_xmlAddPrevSibling();
13690    ret += test_xmlAddSibling();
13691    ret += test_xmlAttrSerializeTxtContent();
13692    ret += test_xmlBufferAdd();
13693    ret += test_xmlBufferAddHead();
13694    ret += test_xmlBufferCCat();
13695    ret += test_xmlBufferCat();
13696    ret += test_xmlBufferContent();
13697    ret += test_xmlBufferCreate();
13698    ret += test_xmlBufferCreateSize();
13699    ret += test_xmlBufferCreateStatic();
13700    ret += test_xmlBufferEmpty();
13701    ret += test_xmlBufferGrow();
13702    ret += test_xmlBufferLength();
13703    ret += test_xmlBufferResize();
13704    ret += test_xmlBufferSetAllocationScheme();
13705    ret += test_xmlBufferShrink();
13706    ret += test_xmlBufferWriteCHAR();
13707    ret += test_xmlBufferWriteChar();
13708    ret += test_xmlBufferWriteQuotedString();
13709    ret += test_xmlBuildQName();
13710    ret += test_xmlCopyDoc();
13711    ret += test_xmlCopyDtd();
13712    ret += test_xmlCopyNamespace();
13713    ret += test_xmlCopyNamespaceList();
13714    ret += test_xmlCopyNode();
13715    ret += test_xmlCopyNodeList();
13716    ret += test_xmlCopyProp();
13717    ret += test_xmlCopyPropList();
13718    ret += test_xmlCreateIntSubset();
13719    ret += test_xmlDocCopyNode();
13720    ret += test_xmlDocCopyNodeList();
13721    ret += test_xmlDocDump();
13722    ret += test_xmlDocDumpFormatMemory();
13723    ret += test_xmlDocDumpFormatMemoryEnc();
13724    ret += test_xmlDocDumpMemory();
13725    ret += test_xmlDocDumpMemoryEnc();
13726    ret += test_xmlDocFormatDump();
13727    ret += test_xmlDocGetRootElement();
13728    ret += test_xmlDocSetRootElement();
13729    ret += test_xmlElemDump();
13730    ret += test_xmlGetBufferAllocationScheme();
13731    ret += test_xmlGetCompressMode();
13732    ret += test_xmlGetDocCompressMode();
13733    ret += test_xmlGetIntSubset();
13734    ret += test_xmlGetLastChild();
13735    ret += test_xmlGetLineNo();
13736    ret += test_xmlGetNoNsProp();
13737    ret += test_xmlGetNodePath();
13738    ret += test_xmlGetNsList();
13739    ret += test_xmlGetNsProp();
13740    ret += test_xmlGetProp();
13741    ret += test_xmlHasNsProp();
13742    ret += test_xmlHasProp();
13743    ret += test_xmlIsBlankNode();
13744    ret += test_xmlIsXHTML();
13745    ret += test_xmlNewCDataBlock();
13746    ret += test_xmlNewCharRef();
13747    ret += test_xmlNewChild();
13748    ret += test_xmlNewComment();
13749    ret += test_xmlNewDoc();
13750    ret += test_xmlNewDocComment();
13751    ret += test_xmlNewDocFragment();
13752    ret += test_xmlNewDocNode();
13753    ret += test_xmlNewDocNodeEatName();
13754    ret += test_xmlNewDocPI();
13755    ret += test_xmlNewDocProp();
13756    ret += test_xmlNewDocRawNode();
13757    ret += test_xmlNewDocText();
13758    ret += test_xmlNewDocTextLen();
13759    ret += test_xmlNewDtd();
13760    ret += test_xmlNewGlobalNs();
13761    ret += test_xmlNewNode();
13762    ret += test_xmlNewNodeEatName();
13763    ret += test_xmlNewNs();
13764    ret += test_xmlNewNsProp();
13765    ret += test_xmlNewNsPropEatName();
13766    ret += test_xmlNewPI();
13767    ret += test_xmlNewProp();
13768    ret += test_xmlNewReference();
13769    ret += test_xmlNewText();
13770    ret += test_xmlNewTextChild();
13771    ret += test_xmlNewTextLen();
13772    ret += test_xmlNodeAddContent();
13773    ret += test_xmlNodeAddContentLen();
13774    ret += test_xmlNodeBufGetContent();
13775    ret += test_xmlNodeDump();
13776    ret += test_xmlNodeDumpOutput();
13777    ret += test_xmlNodeGetBase();
13778    ret += test_xmlNodeGetContent();
13779    ret += test_xmlNodeGetLang();
13780    ret += test_xmlNodeGetSpacePreserve();
13781    ret += test_xmlNodeIsText();
13782    ret += test_xmlNodeListGetRawString();
13783    ret += test_xmlNodeListGetString();
13784    ret += test_xmlNodeSetBase();
13785    ret += test_xmlNodeSetContent();
13786    ret += test_xmlNodeSetContentLen();
13787    ret += test_xmlNodeSetLang();
13788    ret += test_xmlNodeSetName();
13789    ret += test_xmlNodeSetSpacePreserve();
13790    ret += test_xmlReconciliateNs();
13791    ret += test_xmlRemoveProp();
13792    ret += test_xmlReplaceNode();
13793    ret += test_xmlSaveFile();
13794    ret += test_xmlSaveFileEnc();
13795    ret += test_xmlSaveFileTo();
13796    ret += test_xmlSaveFormatFile();
13797    ret += test_xmlSaveFormatFileEnc();
13798    ret += test_xmlSaveFormatFileTo();
13799    ret += test_xmlSearchNs();
13800    ret += test_xmlSearchNsByHref();
13801    ret += test_xmlSetBufferAllocationScheme();
13802    ret += test_xmlSetCompressMode();
13803    ret += test_xmlSetDocCompressMode();
13804    ret += test_xmlSetNs();
13805    ret += test_xmlSetNsProp();
13806    ret += test_xmlSetProp();
13807    ret += test_xmlSplitQName2();
13808    ret += test_xmlSplitQName3();
13809    ret += test_xmlStringGetNodeList();
13810    ret += test_xmlStringLenGetNodeList();
13811    ret += test_xmlTextConcat();
13812    ret += test_xmlTextMerge();
13813    ret += test_xmlUnsetNsProp();
13814    ret += test_xmlUnsetProp();
13815    ret += test_xmlValidateNCName();
13816    ret += test_xmlValidateNMToken();
13817    ret += test_xmlValidateName();
13818    ret += test_xmlValidateQName();
13819
13820    if (ret != 0)
13821	printf("Module tree: %d errors\n", ret);
13822    return(ret);
13823}
13824
13825static int
13826test_xmlBuildRelativeURI(void) {
13827    int ret = 0;
13828
13829    int mem_base;
13830    xmlChar * ret_val;
13831    const xmlChar * URI; /* the URI reference under consideration */
13832    int n_URI;
13833    const xmlChar * base; /* the base value */
13834    int n_base;
13835
13836    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
13837    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
13838        mem_base = xmlMemBlocks();
13839        URI = gen_const_xmlChar_ptr(n_URI, 0);
13840        base = gen_const_xmlChar_ptr(n_base, 1);
13841
13842        ret_val = xmlBuildRelativeURI(URI, base);
13843        desret_xmlChar_ptr(ret_val);
13844        call_tests++;
13845        des_const_xmlChar_ptr(n_URI, URI, 0);
13846        des_const_xmlChar_ptr(n_base, base, 1);
13847        xmlResetLastError();
13848        if (mem_base != xmlMemBlocks()) {
13849            printf("Leak of %d blocks found in xmlBuildRelativeURI",
13850	           xmlMemBlocks() - mem_base);
13851	    ret++;
13852            printf(" %d", n_URI);
13853            printf(" %d", n_base);
13854            printf("\n");
13855        }
13856    }
13857    }
13858
13859    function_tests++;
13860    return(ret);
13861}
13862
13863
13864static int
13865test_xmlBuildURI(void) {
13866    int ret = 0;
13867
13868    int mem_base;
13869    xmlChar * ret_val;
13870    const xmlChar * URI; /* the URI instance found in the document */
13871    int n_URI;
13872    const xmlChar * base; /* the base value */
13873    int n_base;
13874
13875    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
13876    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
13877        mem_base = xmlMemBlocks();
13878        URI = gen_const_xmlChar_ptr(n_URI, 0);
13879        base = gen_const_xmlChar_ptr(n_base, 1);
13880
13881        ret_val = xmlBuildURI(URI, base);
13882        desret_xmlChar_ptr(ret_val);
13883        call_tests++;
13884        des_const_xmlChar_ptr(n_URI, URI, 0);
13885        des_const_xmlChar_ptr(n_base, base, 1);
13886        xmlResetLastError();
13887        if (mem_base != xmlMemBlocks()) {
13888            printf("Leak of %d blocks found in xmlBuildURI",
13889	           xmlMemBlocks() - mem_base);
13890	    ret++;
13891            printf(" %d", n_URI);
13892            printf(" %d", n_base);
13893            printf("\n");
13894        }
13895    }
13896    }
13897
13898    function_tests++;
13899    return(ret);
13900}
13901
13902
13903static int
13904test_xmlCanonicPath(void) {
13905    int ret = 0;
13906
13907    int mem_base;
13908    xmlChar * ret_val;
13909    const xmlChar * path; /* the resource locator in a filesystem notation */
13910    int n_path;
13911
13912    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
13913        mem_base = xmlMemBlocks();
13914        path = gen_const_xmlChar_ptr(n_path, 0);
13915
13916        ret_val = xmlCanonicPath(path);
13917        desret_xmlChar_ptr(ret_val);
13918        call_tests++;
13919        des_const_xmlChar_ptr(n_path, path, 0);
13920        xmlResetLastError();
13921        if (mem_base != xmlMemBlocks()) {
13922            printf("Leak of %d blocks found in xmlCanonicPath",
13923	           xmlMemBlocks() - mem_base);
13924	    ret++;
13925            printf(" %d", n_path);
13926            printf("\n");
13927        }
13928    }
13929
13930    function_tests++;
13931    return(ret);
13932}
13933
13934
13935static int
13936test_xmlCreateURI(void) {
13937    int ret = 0;
13938
13939
13940    /* missing type support */
13941    return(ret);
13942}
13943
13944
13945static int
13946test_xmlNormalizeURIPath(void) {
13947    int ret = 0;
13948
13949
13950    /* missing type support */
13951    return(ret);
13952}
13953
13954
13955static int
13956test_xmlParseURI(void) {
13957    int ret = 0;
13958
13959
13960    /* missing type support */
13961    return(ret);
13962}
13963
13964
13965static int
13966test_xmlParseURIReference(void) {
13967    int ret = 0;
13968
13969
13970    /* missing type support */
13971    return(ret);
13972}
13973
13974
13975static int
13976test_xmlPrintURI(void) {
13977    int ret = 0;
13978
13979
13980    /* missing type support */
13981    return(ret);
13982}
13983
13984
13985static int
13986test_xmlSaveUri(void) {
13987    int ret = 0;
13988
13989
13990    /* missing type support */
13991    return(ret);
13992}
13993
13994
13995static int
13996test_xmlURIEscape(void) {
13997    int ret = 0;
13998
13999    int mem_base;
14000    xmlChar * ret_val;
14001    const xmlChar * str; /* the string of the URI to escape */
14002    int n_str;
14003
14004    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
14005        mem_base = xmlMemBlocks();
14006        str = gen_const_xmlChar_ptr(n_str, 0);
14007
14008        ret_val = xmlURIEscape(str);
14009        desret_xmlChar_ptr(ret_val);
14010        call_tests++;
14011        des_const_xmlChar_ptr(n_str, str, 0);
14012        xmlResetLastError();
14013        if (mem_base != xmlMemBlocks()) {
14014            printf("Leak of %d blocks found in xmlURIEscape",
14015	           xmlMemBlocks() - mem_base);
14016	    ret++;
14017            printf(" %d", n_str);
14018            printf("\n");
14019        }
14020    }
14021
14022    function_tests++;
14023    return(ret);
14024}
14025
14026
14027static int
14028test_xmlURIEscapeStr(void) {
14029    int ret = 0;
14030
14031    int mem_base;
14032    xmlChar * ret_val;
14033    const xmlChar * str; /* string to escape */
14034    int n_str;
14035    const xmlChar * list; /* exception list string of chars not to escape */
14036    int n_list;
14037
14038    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
14039    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
14040        mem_base = xmlMemBlocks();
14041        str = gen_const_xmlChar_ptr(n_str, 0);
14042        list = gen_const_xmlChar_ptr(n_list, 1);
14043
14044        ret_val = xmlURIEscapeStr(str, list);
14045        desret_xmlChar_ptr(ret_val);
14046        call_tests++;
14047        des_const_xmlChar_ptr(n_str, str, 0);
14048        des_const_xmlChar_ptr(n_list, list, 1);
14049        xmlResetLastError();
14050        if (mem_base != xmlMemBlocks()) {
14051            printf("Leak of %d blocks found in xmlURIEscapeStr",
14052	           xmlMemBlocks() - mem_base);
14053	    ret++;
14054            printf(" %d", n_str);
14055            printf(" %d", n_list);
14056            printf("\n");
14057        }
14058    }
14059    }
14060
14061    function_tests++;
14062    return(ret);
14063}
14064
14065
14066static int
14067test_xmlURIUnescapeString(void) {
14068    int ret = 0;
14069
14070
14071    /* missing type support */
14072    return(ret);
14073}
14074
14075static int
14076test_uri(void) {
14077    int ret = 0;
14078
14079    printf("Testing uri : 5 of 13 functions ...\n");
14080    ret += test_xmlBuildRelativeURI();
14081    ret += test_xmlBuildURI();
14082    ret += test_xmlCanonicPath();
14083    ret += test_xmlCreateURI();
14084    ret += test_xmlNormalizeURIPath();
14085    ret += test_xmlParseURI();
14086    ret += test_xmlParseURIReference();
14087    ret += test_xmlPrintURI();
14088    ret += test_xmlSaveUri();
14089    ret += test_xmlURIEscape();
14090    ret += test_xmlURIEscapeStr();
14091    ret += test_xmlURIUnescapeString();
14092
14093    if (ret != 0)
14094	printf("Module uri: %d errors\n", ret);
14095    return(ret);
14096}
14097
14098static int
14099test_xmlAddAttributeDecl(void) {
14100    int ret = 0;
14101
14102
14103    /* missing type support */
14104    return(ret);
14105}
14106
14107
14108static int
14109test_xmlAddElementDecl(void) {
14110    int ret = 0;
14111
14112
14113    /* missing type support */
14114    return(ret);
14115}
14116
14117
14118static int
14119test_xmlAddID(void) {
14120    int ret = 0;
14121
14122
14123    /* missing type support */
14124    return(ret);
14125}
14126
14127
14128static int
14129test_xmlAddNotationDecl(void) {
14130    int ret = 0;
14131
14132
14133    /* missing type support */
14134    return(ret);
14135}
14136
14137
14138static int
14139test_xmlAddRef(void) {
14140    int ret = 0;
14141
14142
14143    /* missing type support */
14144    return(ret);
14145}
14146
14147
14148static int
14149test_xmlCopyAttributeTable(void) {
14150    int ret = 0;
14151
14152
14153    /* missing type support */
14154    return(ret);
14155}
14156
14157
14158static int
14159test_xmlCopyElementContent(void) {
14160    int ret = 0;
14161
14162
14163    /* missing type support */
14164    return(ret);
14165}
14166
14167
14168static int
14169test_xmlCopyElementTable(void) {
14170    int ret = 0;
14171
14172
14173    /* missing type support */
14174    return(ret);
14175}
14176
14177
14178static int
14179test_xmlCopyEnumeration(void) {
14180    int ret = 0;
14181
14182
14183    /* missing type support */
14184    return(ret);
14185}
14186
14187
14188static int
14189test_xmlCopyNotationTable(void) {
14190    int ret = 0;
14191
14192
14193    /* missing type support */
14194    return(ret);
14195}
14196
14197
14198static int
14199test_xmlCreateEnumeration(void) {
14200    int ret = 0;
14201
14202
14203    /* missing type support */
14204    return(ret);
14205}
14206
14207
14208static int
14209test_xmlDumpAttributeDecl(void) {
14210    int ret = 0;
14211
14212
14213    /* missing type support */
14214    return(ret);
14215}
14216
14217
14218static int
14219test_xmlDumpAttributeTable(void) {
14220    int ret = 0;
14221
14222
14223    /* missing type support */
14224    return(ret);
14225}
14226
14227
14228static int
14229test_xmlDumpElementDecl(void) {
14230    int ret = 0;
14231
14232
14233    /* missing type support */
14234    return(ret);
14235}
14236
14237
14238static int
14239test_xmlDumpElementTable(void) {
14240    int ret = 0;
14241
14242
14243    /* missing type support */
14244    return(ret);
14245}
14246
14247
14248static int
14249test_xmlDumpNotationDecl(void) {
14250    int ret = 0;
14251
14252
14253    /* missing type support */
14254    return(ret);
14255}
14256
14257
14258static int
14259test_xmlDumpNotationTable(void) {
14260    int ret = 0;
14261
14262
14263    /* missing type support */
14264    return(ret);
14265}
14266
14267
14268static int
14269test_xmlGetDtdAttrDesc(void) {
14270    int ret = 0;
14271
14272
14273    /* missing type support */
14274    return(ret);
14275}
14276
14277
14278static int
14279test_xmlGetDtdElementDesc(void) {
14280    int ret = 0;
14281
14282
14283    /* missing type support */
14284    return(ret);
14285}
14286
14287
14288static int
14289test_xmlGetDtdNotationDesc(void) {
14290    int ret = 0;
14291
14292
14293    /* missing type support */
14294    return(ret);
14295}
14296
14297
14298static int
14299test_xmlGetDtdQAttrDesc(void) {
14300    int ret = 0;
14301
14302
14303    /* missing type support */
14304    return(ret);
14305}
14306
14307
14308static int
14309test_xmlGetDtdQElementDesc(void) {
14310    int ret = 0;
14311
14312
14313    /* missing type support */
14314    return(ret);
14315}
14316
14317
14318static int
14319test_xmlGetID(void) {
14320    int ret = 0;
14321
14322
14323    /* missing type support */
14324    return(ret);
14325}
14326
14327
14328static int
14329test_xmlGetRefs(void) {
14330    int ret = 0;
14331
14332
14333    /* missing type support */
14334    return(ret);
14335}
14336
14337
14338static int
14339test_xmlIsID(void) {
14340    int ret = 0;
14341
14342    int mem_base;
14343    int ret_val;
14344    xmlDocPtr doc; /* the document */
14345    int n_doc;
14346    xmlNodePtr elem; /* the element carrying the attribute */
14347    int n_elem;
14348    xmlAttrPtr attr; /* the attribute */
14349    int n_attr;
14350
14351    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14352    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
14353    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
14354        mem_base = xmlMemBlocks();
14355        doc = gen_xmlDocPtr(n_doc, 0);
14356        elem = gen_xmlNodePtr(n_elem, 1);
14357        attr = gen_xmlAttrPtr(n_attr, 2);
14358
14359        ret_val = xmlIsID(doc, elem, attr);
14360        desret_int(ret_val);
14361        call_tests++;
14362        des_xmlDocPtr(n_doc, doc, 0);
14363        des_xmlNodePtr(n_elem, elem, 1);
14364        des_xmlAttrPtr(n_attr, attr, 2);
14365        xmlResetLastError();
14366        if (mem_base != xmlMemBlocks()) {
14367            printf("Leak of %d blocks found in xmlIsID",
14368	           xmlMemBlocks() - mem_base);
14369	    ret++;
14370            printf(" %d", n_doc);
14371            printf(" %d", n_elem);
14372            printf(" %d", n_attr);
14373            printf("\n");
14374        }
14375    }
14376    }
14377    }
14378
14379    function_tests++;
14380    return(ret);
14381}
14382
14383
14384static int
14385test_xmlIsMixedElement(void) {
14386    int ret = 0;
14387
14388    int mem_base;
14389    int ret_val;
14390    xmlDocPtr doc; /* the document */
14391    int n_doc;
14392    const xmlChar * name; /* the element name */
14393    int n_name;
14394
14395    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14396    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
14397        mem_base = xmlMemBlocks();
14398        doc = gen_xmlDocPtr(n_doc, 0);
14399        name = gen_const_xmlChar_ptr(n_name, 1);
14400
14401        ret_val = xmlIsMixedElement(doc, name);
14402        desret_int(ret_val);
14403        call_tests++;
14404        des_xmlDocPtr(n_doc, doc, 0);
14405        des_const_xmlChar_ptr(n_name, name, 1);
14406        xmlResetLastError();
14407        if (mem_base != xmlMemBlocks()) {
14408            printf("Leak of %d blocks found in xmlIsMixedElement",
14409	           xmlMemBlocks() - mem_base);
14410	    ret++;
14411            printf(" %d", n_doc);
14412            printf(" %d", n_name);
14413            printf("\n");
14414        }
14415    }
14416    }
14417
14418    function_tests++;
14419    return(ret);
14420}
14421
14422
14423static int
14424test_xmlIsRef(void) {
14425    int ret = 0;
14426
14427    int mem_base;
14428    int ret_val;
14429    xmlDocPtr doc; /* the document */
14430    int n_doc;
14431    xmlNodePtr elem; /* the element carrying the attribute */
14432    int n_elem;
14433    xmlAttrPtr attr; /* the attribute */
14434    int n_attr;
14435
14436    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14437    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
14438    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
14439        mem_base = xmlMemBlocks();
14440        doc = gen_xmlDocPtr(n_doc, 0);
14441        elem = gen_xmlNodePtr(n_elem, 1);
14442        attr = gen_xmlAttrPtr(n_attr, 2);
14443
14444        ret_val = xmlIsRef(doc, elem, attr);
14445        desret_int(ret_val);
14446        call_tests++;
14447        des_xmlDocPtr(n_doc, doc, 0);
14448        des_xmlNodePtr(n_elem, elem, 1);
14449        des_xmlAttrPtr(n_attr, attr, 2);
14450        xmlResetLastError();
14451        if (mem_base != xmlMemBlocks()) {
14452            printf("Leak of %d blocks found in xmlIsRef",
14453	           xmlMemBlocks() - mem_base);
14454	    ret++;
14455            printf(" %d", n_doc);
14456            printf(" %d", n_elem);
14457            printf(" %d", n_attr);
14458            printf("\n");
14459        }
14460    }
14461    }
14462    }
14463
14464    function_tests++;
14465    return(ret);
14466}
14467
14468
14469static int
14470test_xmlNewElementContent(void) {
14471    int ret = 0;
14472
14473
14474    /* missing type support */
14475    return(ret);
14476}
14477
14478
14479static int
14480test_xmlNewValidCtxt(void) {
14481    int ret = 0;
14482
14483
14484    /* missing type support */
14485    return(ret);
14486}
14487
14488
14489static int
14490test_xmlRemoveID(void) {
14491    int ret = 0;
14492
14493    int mem_base;
14494    int ret_val;
14495    xmlDocPtr doc; /* the document */
14496    int n_doc;
14497    xmlAttrPtr attr; /* the attribute */
14498    int n_attr;
14499
14500    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14501    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
14502        mem_base = xmlMemBlocks();
14503        doc = gen_xmlDocPtr(n_doc, 0);
14504        attr = gen_xmlAttrPtr(n_attr, 1);
14505
14506        ret_val = xmlRemoveID(doc, attr);
14507        desret_int(ret_val);
14508        call_tests++;
14509        des_xmlDocPtr(n_doc, doc, 0);
14510        des_xmlAttrPtr(n_attr, attr, 1);
14511        xmlResetLastError();
14512        if (mem_base != xmlMemBlocks()) {
14513            printf("Leak of %d blocks found in xmlRemoveID",
14514	           xmlMemBlocks() - mem_base);
14515	    ret++;
14516            printf(" %d", n_doc);
14517            printf(" %d", n_attr);
14518            printf("\n");
14519        }
14520    }
14521    }
14522
14523    function_tests++;
14524    return(ret);
14525}
14526
14527
14528static int
14529test_xmlRemoveRef(void) {
14530    int ret = 0;
14531
14532    int mem_base;
14533    int ret_val;
14534    xmlDocPtr doc; /* the document */
14535    int n_doc;
14536    xmlAttrPtr attr; /* the attribute */
14537    int n_attr;
14538
14539    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14540    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
14541        mem_base = xmlMemBlocks();
14542        doc = gen_xmlDocPtr(n_doc, 0);
14543        attr = gen_xmlAttrPtr(n_attr, 1);
14544
14545        ret_val = xmlRemoveRef(doc, attr);
14546        desret_int(ret_val);
14547        call_tests++;
14548        des_xmlDocPtr(n_doc, doc, 0);
14549        des_xmlAttrPtr(n_attr, attr, 1);
14550        xmlResetLastError();
14551        if (mem_base != xmlMemBlocks()) {
14552            printf("Leak of %d blocks found in xmlRemoveRef",
14553	           xmlMemBlocks() - mem_base);
14554	    ret++;
14555            printf(" %d", n_doc);
14556            printf(" %d", n_attr);
14557            printf("\n");
14558        }
14559    }
14560    }
14561
14562    function_tests++;
14563    return(ret);
14564}
14565
14566
14567static int
14568test_xmlSnprintfElementContent(void) {
14569    int ret = 0;
14570
14571
14572    /* missing type support */
14573    return(ret);
14574}
14575
14576
14577static int
14578test_xmlSprintfElementContent(void) {
14579    int ret = 0;
14580
14581
14582    /* missing type support */
14583    return(ret);
14584}
14585
14586
14587static int
14588test_xmlValidBuildContentModel(void) {
14589    int ret = 0;
14590
14591
14592    /* missing type support */
14593    return(ret);
14594}
14595
14596
14597static int
14598test_xmlValidCtxtNormalizeAttributeValue(void) {
14599    int ret = 0;
14600
14601#ifdef LIBXML_VALID_ENABLED
14602    int mem_base;
14603    xmlChar * ret_val;
14604    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
14605    int n_ctxt;
14606    xmlDocPtr doc; /* the document */
14607    int n_doc;
14608    xmlNodePtr elem; /* the parent */
14609    int n_elem;
14610    const xmlChar * name; /* the attribute name */
14611    int n_name;
14612    const xmlChar * value; /* the attribute value */
14613    int n_value;
14614
14615    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
14616    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14617    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
14618    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
14619    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
14620        mem_base = xmlMemBlocks();
14621        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
14622        doc = gen_xmlDocPtr(n_doc, 1);
14623        elem = gen_xmlNodePtr(n_elem, 2);
14624        name = gen_const_xmlChar_ptr(n_name, 3);
14625        value = gen_const_xmlChar_ptr(n_value, 4);
14626
14627        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, name, value);
14628        desret_xmlChar_ptr(ret_val);
14629        call_tests++;
14630        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
14631        des_xmlDocPtr(n_doc, doc, 1);
14632        des_xmlNodePtr(n_elem, elem, 2);
14633        des_const_xmlChar_ptr(n_name, name, 3);
14634        des_const_xmlChar_ptr(n_value, value, 4);
14635        xmlResetLastError();
14636        if (mem_base != xmlMemBlocks()) {
14637            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
14638	           xmlMemBlocks() - mem_base);
14639	    ret++;
14640            printf(" %d", n_ctxt);
14641            printf(" %d", n_doc);
14642            printf(" %d", n_elem);
14643            printf(" %d", n_name);
14644            printf(" %d", n_value);
14645            printf("\n");
14646        }
14647    }
14648    }
14649    }
14650    }
14651    }
14652#endif
14653
14654    function_tests++;
14655    return(ret);
14656}
14657
14658
14659static int
14660test_xmlValidGetPotentialChildren(void) {
14661    int ret = 0;
14662
14663
14664    /* missing type support */
14665    return(ret);
14666}
14667
14668
14669static int
14670test_xmlValidGetValidElements(void) {
14671    int ret = 0;
14672
14673
14674    /* missing type support */
14675    return(ret);
14676}
14677
14678
14679static int
14680test_xmlValidNormalizeAttributeValue(void) {
14681    int ret = 0;
14682
14683#ifdef LIBXML_VALID_ENABLED
14684    int mem_base;
14685    xmlChar * ret_val;
14686    xmlDocPtr doc; /* the document */
14687    int n_doc;
14688    xmlNodePtr elem; /* the parent */
14689    int n_elem;
14690    const xmlChar * name; /* the attribute name */
14691    int n_name;
14692    const xmlChar * value; /* the attribute value */
14693    int n_value;
14694
14695    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14696    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
14697    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
14698    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
14699        mem_base = xmlMemBlocks();
14700        doc = gen_xmlDocPtr(n_doc, 0);
14701        elem = gen_xmlNodePtr(n_elem, 1);
14702        name = gen_const_xmlChar_ptr(n_name, 2);
14703        value = gen_const_xmlChar_ptr(n_value, 3);
14704
14705        ret_val = xmlValidNormalizeAttributeValue(doc, elem, name, value);
14706        desret_xmlChar_ptr(ret_val);
14707        call_tests++;
14708        des_xmlDocPtr(n_doc, doc, 0);
14709        des_xmlNodePtr(n_elem, elem, 1);
14710        des_const_xmlChar_ptr(n_name, name, 2);
14711        des_const_xmlChar_ptr(n_value, value, 3);
14712        xmlResetLastError();
14713        if (mem_base != xmlMemBlocks()) {
14714            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
14715	           xmlMemBlocks() - mem_base);
14716	    ret++;
14717            printf(" %d", n_doc);
14718            printf(" %d", n_elem);
14719            printf(" %d", n_name);
14720            printf(" %d", n_value);
14721            printf("\n");
14722        }
14723    }
14724    }
14725    }
14726    }
14727#endif
14728
14729    function_tests++;
14730    return(ret);
14731}
14732
14733
14734static int
14735test_xmlValidateAttributeDecl(void) {
14736    int ret = 0;
14737
14738
14739    /* missing type support */
14740    return(ret);
14741}
14742
14743
14744static int
14745test_xmlValidateAttributeValue(void) {
14746    int ret = 0;
14747
14748
14749    /* missing type support */
14750    return(ret);
14751}
14752
14753
14754static int
14755test_xmlValidateDocument(void) {
14756    int ret = 0;
14757
14758#ifdef LIBXML_VALID_ENABLED
14759    int mem_base;
14760    int ret_val;
14761    xmlValidCtxtPtr ctxt; /* the validation context */
14762    int n_ctxt;
14763    xmlDocPtr doc; /* a document instance */
14764    int n_doc;
14765
14766    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
14767    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14768        mem_base = xmlMemBlocks();
14769        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
14770        doc = gen_xmlDocPtr(n_doc, 1);
14771
14772        ret_val = xmlValidateDocument(ctxt, doc);
14773        desret_int(ret_val);
14774        call_tests++;
14775        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
14776        des_xmlDocPtr(n_doc, doc, 1);
14777        xmlResetLastError();
14778        if (mem_base != xmlMemBlocks()) {
14779            printf("Leak of %d blocks found in xmlValidateDocument",
14780	           xmlMemBlocks() - mem_base);
14781	    ret++;
14782            printf(" %d", n_ctxt);
14783            printf(" %d", n_doc);
14784            printf("\n");
14785        }
14786    }
14787    }
14788#endif
14789
14790    function_tests++;
14791    return(ret);
14792}
14793
14794
14795static int
14796test_xmlValidateDocumentFinal(void) {
14797    int ret = 0;
14798
14799#ifdef LIBXML_VALID_ENABLED
14800    int mem_base;
14801    int ret_val;
14802    xmlValidCtxtPtr ctxt; /* the validation context */
14803    int n_ctxt;
14804    xmlDocPtr doc; /* a document instance */
14805    int n_doc;
14806
14807    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
14808    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14809        mem_base = xmlMemBlocks();
14810        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
14811        doc = gen_xmlDocPtr(n_doc, 1);
14812
14813        ret_val = xmlValidateDocumentFinal(ctxt, doc);
14814        desret_int(ret_val);
14815        call_tests++;
14816        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
14817        des_xmlDocPtr(n_doc, doc, 1);
14818        xmlResetLastError();
14819        if (mem_base != xmlMemBlocks()) {
14820            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
14821	           xmlMemBlocks() - mem_base);
14822	    ret++;
14823            printf(" %d", n_ctxt);
14824            printf(" %d", n_doc);
14825            printf("\n");
14826        }
14827    }
14828    }
14829#endif
14830
14831    function_tests++;
14832    return(ret);
14833}
14834
14835
14836static int
14837test_xmlValidateDtd(void) {
14838    int ret = 0;
14839
14840#ifdef LIBXML_VALID_ENABLED
14841    int mem_base;
14842    int ret_val;
14843    xmlValidCtxtPtr ctxt; /* the validation context */
14844    int n_ctxt;
14845    xmlDocPtr doc; /* a document instance */
14846    int n_doc;
14847    xmlDtdPtr dtd; /* a dtd instance */
14848    int n_dtd;
14849
14850    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
14851    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14852    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
14853        mem_base = xmlMemBlocks();
14854        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
14855        doc = gen_xmlDocPtr(n_doc, 1);
14856        dtd = gen_xmlDtdPtr(n_dtd, 2);
14857
14858        ret_val = xmlValidateDtd(ctxt, doc, dtd);
14859        desret_int(ret_val);
14860        call_tests++;
14861        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
14862        des_xmlDocPtr(n_doc, doc, 1);
14863        des_xmlDtdPtr(n_dtd, dtd, 2);
14864        xmlResetLastError();
14865        if (mem_base != xmlMemBlocks()) {
14866            printf("Leak of %d blocks found in xmlValidateDtd",
14867	           xmlMemBlocks() - mem_base);
14868	    ret++;
14869            printf(" %d", n_ctxt);
14870            printf(" %d", n_doc);
14871            printf(" %d", n_dtd);
14872            printf("\n");
14873        }
14874    }
14875    }
14876    }
14877#endif
14878
14879    function_tests++;
14880    return(ret);
14881}
14882
14883
14884static int
14885test_xmlValidateDtdFinal(void) {
14886    int ret = 0;
14887
14888#ifdef LIBXML_VALID_ENABLED
14889    int mem_base;
14890    int ret_val;
14891    xmlValidCtxtPtr ctxt; /* the validation context */
14892    int n_ctxt;
14893    xmlDocPtr doc; /* a document instance */
14894    int n_doc;
14895
14896    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
14897    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14898        mem_base = xmlMemBlocks();
14899        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
14900        doc = gen_xmlDocPtr(n_doc, 1);
14901
14902        ret_val = xmlValidateDtdFinal(ctxt, doc);
14903        desret_int(ret_val);
14904        call_tests++;
14905        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
14906        des_xmlDocPtr(n_doc, doc, 1);
14907        xmlResetLastError();
14908        if (mem_base != xmlMemBlocks()) {
14909            printf("Leak of %d blocks found in xmlValidateDtdFinal",
14910	           xmlMemBlocks() - mem_base);
14911	    ret++;
14912            printf(" %d", n_ctxt);
14913            printf(" %d", n_doc);
14914            printf("\n");
14915        }
14916    }
14917    }
14918#endif
14919
14920    function_tests++;
14921    return(ret);
14922}
14923
14924
14925static int
14926test_xmlValidateElement(void) {
14927    int ret = 0;
14928
14929#ifdef LIBXML_VALID_ENABLED
14930    int mem_base;
14931    int ret_val;
14932    xmlValidCtxtPtr ctxt; /* the validation context */
14933    int n_ctxt;
14934    xmlDocPtr doc; /* a document instance */
14935    int n_doc;
14936    xmlNodePtr elem; /* an element instance */
14937    int n_elem;
14938
14939    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
14940    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14941    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
14942        mem_base = xmlMemBlocks();
14943        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
14944        doc = gen_xmlDocPtr(n_doc, 1);
14945        elem = gen_xmlNodePtr(n_elem, 2);
14946
14947        ret_val = xmlValidateElement(ctxt, doc, elem);
14948        desret_int(ret_val);
14949        call_tests++;
14950        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
14951        des_xmlDocPtr(n_doc, doc, 1);
14952        des_xmlNodePtr(n_elem, elem, 2);
14953        xmlResetLastError();
14954        if (mem_base != xmlMemBlocks()) {
14955            printf("Leak of %d blocks found in xmlValidateElement",
14956	           xmlMemBlocks() - mem_base);
14957	    ret++;
14958            printf(" %d", n_ctxt);
14959            printf(" %d", n_doc);
14960            printf(" %d", n_elem);
14961            printf("\n");
14962        }
14963    }
14964    }
14965    }
14966#endif
14967
14968    function_tests++;
14969    return(ret);
14970}
14971
14972
14973static int
14974test_xmlValidateElementDecl(void) {
14975    int ret = 0;
14976
14977
14978    /* missing type support */
14979    return(ret);
14980}
14981
14982
14983static int
14984test_xmlValidateNameValue(void) {
14985    int ret = 0;
14986
14987#ifdef LIBXML_VALID_ENABLED
14988    int mem_base;
14989    int ret_val;
14990    const xmlChar * value; /* an Name value */
14991    int n_value;
14992
14993    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
14994        mem_base = xmlMemBlocks();
14995        value = gen_const_xmlChar_ptr(n_value, 0);
14996
14997        ret_val = xmlValidateNameValue(value);
14998        desret_int(ret_val);
14999        call_tests++;
15000        des_const_xmlChar_ptr(n_value, value, 0);
15001        xmlResetLastError();
15002        if (mem_base != xmlMemBlocks()) {
15003            printf("Leak of %d blocks found in xmlValidateNameValue",
15004	           xmlMemBlocks() - mem_base);
15005	    ret++;
15006            printf(" %d", n_value);
15007            printf("\n");
15008        }
15009    }
15010#endif
15011
15012    function_tests++;
15013    return(ret);
15014}
15015
15016
15017static int
15018test_xmlValidateNamesValue(void) {
15019    int ret = 0;
15020
15021#ifdef LIBXML_VALID_ENABLED
15022    int mem_base;
15023    int ret_val;
15024    const xmlChar * value; /* an Names value */
15025    int n_value;
15026
15027    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15028        mem_base = xmlMemBlocks();
15029        value = gen_const_xmlChar_ptr(n_value, 0);
15030
15031        ret_val = xmlValidateNamesValue(value);
15032        desret_int(ret_val);
15033        call_tests++;
15034        des_const_xmlChar_ptr(n_value, value, 0);
15035        xmlResetLastError();
15036        if (mem_base != xmlMemBlocks()) {
15037            printf("Leak of %d blocks found in xmlValidateNamesValue",
15038	           xmlMemBlocks() - mem_base);
15039	    ret++;
15040            printf(" %d", n_value);
15041            printf("\n");
15042        }
15043    }
15044#endif
15045
15046    function_tests++;
15047    return(ret);
15048}
15049
15050
15051static int
15052test_xmlValidateNmtokenValue(void) {
15053    int ret = 0;
15054
15055#ifdef LIBXML_VALID_ENABLED
15056    int mem_base;
15057    int ret_val;
15058    const xmlChar * value; /* an Nmtoken value */
15059    int n_value;
15060
15061    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15062        mem_base = xmlMemBlocks();
15063        value = gen_const_xmlChar_ptr(n_value, 0);
15064
15065        ret_val = xmlValidateNmtokenValue(value);
15066        desret_int(ret_val);
15067        call_tests++;
15068        des_const_xmlChar_ptr(n_value, value, 0);
15069        xmlResetLastError();
15070        if (mem_base != xmlMemBlocks()) {
15071            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
15072	           xmlMemBlocks() - mem_base);
15073	    ret++;
15074            printf(" %d", n_value);
15075            printf("\n");
15076        }
15077    }
15078#endif
15079
15080    function_tests++;
15081    return(ret);
15082}
15083
15084
15085static int
15086test_xmlValidateNmtokensValue(void) {
15087    int ret = 0;
15088
15089#ifdef LIBXML_VALID_ENABLED
15090    int mem_base;
15091    int ret_val;
15092    const xmlChar * value; /* an Nmtokens value */
15093    int n_value;
15094
15095    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15096        mem_base = xmlMemBlocks();
15097        value = gen_const_xmlChar_ptr(n_value, 0);
15098
15099        ret_val = xmlValidateNmtokensValue(value);
15100        desret_int(ret_val);
15101        call_tests++;
15102        des_const_xmlChar_ptr(n_value, value, 0);
15103        xmlResetLastError();
15104        if (mem_base != xmlMemBlocks()) {
15105            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
15106	           xmlMemBlocks() - mem_base);
15107	    ret++;
15108            printf(" %d", n_value);
15109            printf("\n");
15110        }
15111    }
15112#endif
15113
15114    function_tests++;
15115    return(ret);
15116}
15117
15118
15119static int
15120test_xmlValidateNotationDecl(void) {
15121    int ret = 0;
15122
15123
15124    /* missing type support */
15125    return(ret);
15126}
15127
15128
15129static int
15130test_xmlValidateNotationUse(void) {
15131    int ret = 0;
15132
15133#ifdef LIBXML_VALID_ENABLED
15134    int mem_base;
15135    int ret_val;
15136    xmlValidCtxtPtr ctxt; /* the validation context */
15137    int n_ctxt;
15138    xmlDocPtr doc; /* the document */
15139    int n_doc;
15140    const xmlChar * notationName; /* the notation name to check */
15141    int n_notationName;
15142
15143    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15144    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15145    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
15146        mem_base = xmlMemBlocks();
15147        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15148        doc = gen_xmlDocPtr(n_doc, 1);
15149        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
15150
15151        ret_val = xmlValidateNotationUse(ctxt, doc, notationName);
15152        desret_int(ret_val);
15153        call_tests++;
15154        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15155        des_xmlDocPtr(n_doc, doc, 1);
15156        des_const_xmlChar_ptr(n_notationName, notationName, 2);
15157        xmlResetLastError();
15158        if (mem_base != xmlMemBlocks()) {
15159            printf("Leak of %d blocks found in xmlValidateNotationUse",
15160	           xmlMemBlocks() - mem_base);
15161	    ret++;
15162            printf(" %d", n_ctxt);
15163            printf(" %d", n_doc);
15164            printf(" %d", n_notationName);
15165            printf("\n");
15166        }
15167    }
15168    }
15169    }
15170#endif
15171
15172    function_tests++;
15173    return(ret);
15174}
15175
15176
15177static int
15178test_xmlValidateOneAttribute(void) {
15179    int ret = 0;
15180
15181#ifdef LIBXML_VALID_ENABLED
15182    int mem_base;
15183    int ret_val;
15184    xmlValidCtxtPtr ctxt; /* the validation context */
15185    int n_ctxt;
15186    xmlDocPtr doc; /* a document instance */
15187    int n_doc;
15188    xmlNodePtr elem; /* an element instance */
15189    int n_elem;
15190    xmlAttrPtr attr; /* an attribute instance */
15191    int n_attr;
15192    const xmlChar * value; /* the attribute value (without entities processing) */
15193    int n_value;
15194
15195    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15196    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15197    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
15198    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
15199    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15200        mem_base = xmlMemBlocks();
15201        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15202        doc = gen_xmlDocPtr(n_doc, 1);
15203        elem = gen_xmlNodePtr(n_elem, 2);
15204        attr = gen_xmlAttrPtr(n_attr, 3);
15205        value = gen_const_xmlChar_ptr(n_value, 4);
15206
15207        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
15208        desret_int(ret_val);
15209        call_tests++;
15210        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15211        des_xmlDocPtr(n_doc, doc, 1);
15212        des_xmlNodePtr(n_elem, elem, 2);
15213        des_xmlAttrPtr(n_attr, attr, 3);
15214        des_const_xmlChar_ptr(n_value, value, 4);
15215        xmlResetLastError();
15216        if (mem_base != xmlMemBlocks()) {
15217            printf("Leak of %d blocks found in xmlValidateOneAttribute",
15218	           xmlMemBlocks() - mem_base);
15219	    ret++;
15220            printf(" %d", n_ctxt);
15221            printf(" %d", n_doc);
15222            printf(" %d", n_elem);
15223            printf(" %d", n_attr);
15224            printf(" %d", n_value);
15225            printf("\n");
15226        }
15227    }
15228    }
15229    }
15230    }
15231    }
15232#endif
15233
15234    function_tests++;
15235    return(ret);
15236}
15237
15238
15239static int
15240test_xmlValidateOneElement(void) {
15241    int ret = 0;
15242
15243#ifdef LIBXML_VALID_ENABLED
15244    int mem_base;
15245    int ret_val;
15246    xmlValidCtxtPtr ctxt; /* the validation context */
15247    int n_ctxt;
15248    xmlDocPtr doc; /* a document instance */
15249    int n_doc;
15250    xmlNodePtr elem; /* an element instance */
15251    int n_elem;
15252
15253    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15254    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15255    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
15256        mem_base = xmlMemBlocks();
15257        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15258        doc = gen_xmlDocPtr(n_doc, 1);
15259        elem = gen_xmlNodePtr(n_elem, 2);
15260
15261        ret_val = xmlValidateOneElement(ctxt, doc, elem);
15262        desret_int(ret_val);
15263        call_tests++;
15264        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15265        des_xmlDocPtr(n_doc, doc, 1);
15266        des_xmlNodePtr(n_elem, elem, 2);
15267        xmlResetLastError();
15268        if (mem_base != xmlMemBlocks()) {
15269            printf("Leak of %d blocks found in xmlValidateOneElement",
15270	           xmlMemBlocks() - mem_base);
15271	    ret++;
15272            printf(" %d", n_ctxt);
15273            printf(" %d", n_doc);
15274            printf(" %d", n_elem);
15275            printf("\n");
15276        }
15277    }
15278    }
15279    }
15280#endif
15281
15282    function_tests++;
15283    return(ret);
15284}
15285
15286
15287static int
15288test_xmlValidateOneNamespace(void) {
15289    int ret = 0;
15290
15291#ifdef LIBXML_VALID_ENABLED
15292    int mem_base;
15293    int ret_val;
15294    xmlValidCtxtPtr ctxt; /* the validation context */
15295    int n_ctxt;
15296    xmlDocPtr doc; /* a document instance */
15297    int n_doc;
15298    xmlNodePtr elem; /* an element instance */
15299    int n_elem;
15300    const xmlChar * prefix; /* the namespace prefix */
15301    int n_prefix;
15302    xmlNsPtr ns; /* an namespace declaration instance */
15303    int n_ns;
15304    const xmlChar * value; /* the attribute value (without entities processing) */
15305    int n_value;
15306
15307    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15308    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15309    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
15310    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
15311    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
15312    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15313        mem_base = xmlMemBlocks();
15314        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15315        doc = gen_xmlDocPtr(n_doc, 1);
15316        elem = gen_xmlNodePtr(n_elem, 2);
15317        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
15318        ns = gen_xmlNsPtr(n_ns, 4);
15319        value = gen_const_xmlChar_ptr(n_value, 5);
15320
15321        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, prefix, ns, value);
15322        desret_int(ret_val);
15323        call_tests++;
15324        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15325        des_xmlDocPtr(n_doc, doc, 1);
15326        des_xmlNodePtr(n_elem, elem, 2);
15327        des_const_xmlChar_ptr(n_prefix, prefix, 3);
15328        des_xmlNsPtr(n_ns, ns, 4);
15329        des_const_xmlChar_ptr(n_value, value, 5);
15330        xmlResetLastError();
15331        if (mem_base != xmlMemBlocks()) {
15332            printf("Leak of %d blocks found in xmlValidateOneNamespace",
15333	           xmlMemBlocks() - mem_base);
15334	    ret++;
15335            printf(" %d", n_ctxt);
15336            printf(" %d", n_doc);
15337            printf(" %d", n_elem);
15338            printf(" %d", n_prefix);
15339            printf(" %d", n_ns);
15340            printf(" %d", n_value);
15341            printf("\n");
15342        }
15343    }
15344    }
15345    }
15346    }
15347    }
15348    }
15349#endif
15350
15351    function_tests++;
15352    return(ret);
15353}
15354
15355
15356static int
15357test_xmlValidatePopElement(void) {
15358    int ret = 0;
15359
15360#ifdef LIBXML_REGEXP_ENABLED
15361    int mem_base;
15362    int ret_val;
15363    xmlValidCtxtPtr ctxt; /* the validation context */
15364    int n_ctxt;
15365    xmlDocPtr doc; /* a document instance */
15366    int n_doc;
15367    xmlNodePtr elem; /* an element instance */
15368    int n_elem;
15369    const xmlChar * qname; /* the qualified name as appearing in the serialization */
15370    int n_qname;
15371
15372    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15373    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15374    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
15375    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
15376        mem_base = xmlMemBlocks();
15377        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15378        doc = gen_xmlDocPtr(n_doc, 1);
15379        elem = gen_xmlNodePtr(n_elem, 2);
15380        qname = gen_const_xmlChar_ptr(n_qname, 3);
15381
15382        ret_val = xmlValidatePopElement(ctxt, doc, elem, qname);
15383        desret_int(ret_val);
15384        call_tests++;
15385        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15386        des_xmlDocPtr(n_doc, doc, 1);
15387        des_xmlNodePtr(n_elem, elem, 2);
15388        des_const_xmlChar_ptr(n_qname, qname, 3);
15389        xmlResetLastError();
15390        if (mem_base != xmlMemBlocks()) {
15391            printf("Leak of %d blocks found in xmlValidatePopElement",
15392	           xmlMemBlocks() - mem_base);
15393	    ret++;
15394            printf(" %d", n_ctxt);
15395            printf(" %d", n_doc);
15396            printf(" %d", n_elem);
15397            printf(" %d", n_qname);
15398            printf("\n");
15399        }
15400    }
15401    }
15402    }
15403    }
15404#endif
15405
15406    function_tests++;
15407    return(ret);
15408}
15409
15410
15411static int
15412test_xmlValidatePushCData(void) {
15413    int ret = 0;
15414
15415#ifdef LIBXML_REGEXP_ENABLED
15416    int mem_base;
15417    int ret_val;
15418    xmlValidCtxtPtr ctxt; /* the validation context */
15419    int n_ctxt;
15420    const xmlChar * data; /* some character data read */
15421    int n_data;
15422    int len; /* the lenght of the data */
15423    int n_len;
15424
15425    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15426    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
15427    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15428        mem_base = xmlMemBlocks();
15429        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15430        data = gen_const_xmlChar_ptr(n_data, 1);
15431        len = gen_int(n_len, 2);
15432
15433        ret_val = xmlValidatePushCData(ctxt, data, len);
15434        desret_int(ret_val);
15435        call_tests++;
15436        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15437        des_const_xmlChar_ptr(n_data, data, 1);
15438        des_int(n_len, len, 2);
15439        xmlResetLastError();
15440        if (mem_base != xmlMemBlocks()) {
15441            printf("Leak of %d blocks found in xmlValidatePushCData",
15442	           xmlMemBlocks() - mem_base);
15443	    ret++;
15444            printf(" %d", n_ctxt);
15445            printf(" %d", n_data);
15446            printf(" %d", n_len);
15447            printf("\n");
15448        }
15449    }
15450    }
15451    }
15452#endif
15453
15454    function_tests++;
15455    return(ret);
15456}
15457
15458
15459static int
15460test_xmlValidatePushElement(void) {
15461    int ret = 0;
15462
15463#ifdef LIBXML_REGEXP_ENABLED
15464    int mem_base;
15465    int ret_val;
15466    xmlValidCtxtPtr ctxt; /* the validation context */
15467    int n_ctxt;
15468    xmlDocPtr doc; /* a document instance */
15469    int n_doc;
15470    xmlNodePtr elem; /* an element instance */
15471    int n_elem;
15472    const xmlChar * qname; /* the qualified name as appearing in the serialization */
15473    int n_qname;
15474
15475    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15476    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15477    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
15478    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
15479        mem_base = xmlMemBlocks();
15480        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15481        doc = gen_xmlDocPtr(n_doc, 1);
15482        elem = gen_xmlNodePtr(n_elem, 2);
15483        qname = gen_const_xmlChar_ptr(n_qname, 3);
15484
15485        ret_val = xmlValidatePushElement(ctxt, doc, elem, qname);
15486        desret_int(ret_val);
15487        call_tests++;
15488        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15489        des_xmlDocPtr(n_doc, doc, 1);
15490        des_xmlNodePtr(n_elem, elem, 2);
15491        des_const_xmlChar_ptr(n_qname, qname, 3);
15492        xmlResetLastError();
15493        if (mem_base != xmlMemBlocks()) {
15494            printf("Leak of %d blocks found in xmlValidatePushElement",
15495	           xmlMemBlocks() - mem_base);
15496	    ret++;
15497            printf(" %d", n_ctxt);
15498            printf(" %d", n_doc);
15499            printf(" %d", n_elem);
15500            printf(" %d", n_qname);
15501            printf("\n");
15502        }
15503    }
15504    }
15505    }
15506    }
15507#endif
15508
15509    function_tests++;
15510    return(ret);
15511}
15512
15513
15514static int
15515test_xmlValidateRoot(void) {
15516    int ret = 0;
15517
15518#ifdef LIBXML_VALID_ENABLED
15519    int mem_base;
15520    int ret_val;
15521    xmlValidCtxtPtr ctxt; /* the validation context */
15522    int n_ctxt;
15523    xmlDocPtr doc; /* a document instance */
15524    int n_doc;
15525
15526    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
15527    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15528        mem_base = xmlMemBlocks();
15529        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
15530        doc = gen_xmlDocPtr(n_doc, 1);
15531
15532        ret_val = xmlValidateRoot(ctxt, doc);
15533        desret_int(ret_val);
15534        call_tests++;
15535        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
15536        des_xmlDocPtr(n_doc, doc, 1);
15537        xmlResetLastError();
15538        if (mem_base != xmlMemBlocks()) {
15539            printf("Leak of %d blocks found in xmlValidateRoot",
15540	           xmlMemBlocks() - mem_base);
15541	    ret++;
15542            printf(" %d", n_ctxt);
15543            printf(" %d", n_doc);
15544            printf("\n");
15545        }
15546    }
15547    }
15548#endif
15549
15550    function_tests++;
15551    return(ret);
15552}
15553
15554static int
15555test_valid(void) {
15556    int ret = 0;
15557
15558    printf("Testing valid : 24 of 67 functions ...\n");
15559    ret += test_xmlAddAttributeDecl();
15560    ret += test_xmlAddElementDecl();
15561    ret += test_xmlAddID();
15562    ret += test_xmlAddNotationDecl();
15563    ret += test_xmlAddRef();
15564    ret += test_xmlCopyAttributeTable();
15565    ret += test_xmlCopyElementContent();
15566    ret += test_xmlCopyElementTable();
15567    ret += test_xmlCopyEnumeration();
15568    ret += test_xmlCopyNotationTable();
15569    ret += test_xmlCreateEnumeration();
15570    ret += test_xmlDumpAttributeDecl();
15571    ret += test_xmlDumpAttributeTable();
15572    ret += test_xmlDumpElementDecl();
15573    ret += test_xmlDumpElementTable();
15574    ret += test_xmlDumpNotationDecl();
15575    ret += test_xmlDumpNotationTable();
15576    ret += test_xmlGetDtdAttrDesc();
15577    ret += test_xmlGetDtdElementDesc();
15578    ret += test_xmlGetDtdNotationDesc();
15579    ret += test_xmlGetDtdQAttrDesc();
15580    ret += test_xmlGetDtdQElementDesc();
15581    ret += test_xmlGetID();
15582    ret += test_xmlGetRefs();
15583    ret += test_xmlIsID();
15584    ret += test_xmlIsMixedElement();
15585    ret += test_xmlIsRef();
15586    ret += test_xmlNewElementContent();
15587    ret += test_xmlNewValidCtxt();
15588    ret += test_xmlRemoveID();
15589    ret += test_xmlRemoveRef();
15590    ret += test_xmlSnprintfElementContent();
15591    ret += test_xmlSprintfElementContent();
15592    ret += test_xmlValidBuildContentModel();
15593    ret += test_xmlValidCtxtNormalizeAttributeValue();
15594    ret += test_xmlValidGetPotentialChildren();
15595    ret += test_xmlValidGetValidElements();
15596    ret += test_xmlValidNormalizeAttributeValue();
15597    ret += test_xmlValidateAttributeDecl();
15598    ret += test_xmlValidateAttributeValue();
15599    ret += test_xmlValidateDocument();
15600    ret += test_xmlValidateDocumentFinal();
15601    ret += test_xmlValidateDtd();
15602    ret += test_xmlValidateDtdFinal();
15603    ret += test_xmlValidateElement();
15604    ret += test_xmlValidateElementDecl();
15605    ret += test_xmlValidateNameValue();
15606    ret += test_xmlValidateNamesValue();
15607    ret += test_xmlValidateNmtokenValue();
15608    ret += test_xmlValidateNmtokensValue();
15609    ret += test_xmlValidateNotationDecl();
15610    ret += test_xmlValidateNotationUse();
15611    ret += test_xmlValidateOneAttribute();
15612    ret += test_xmlValidateOneElement();
15613    ret += test_xmlValidateOneNamespace();
15614    ret += test_xmlValidatePopElement();
15615    ret += test_xmlValidatePushCData();
15616    ret += test_xmlValidatePushElement();
15617    ret += test_xmlValidateRoot();
15618
15619    if (ret != 0)
15620	printf("Module valid: %d errors\n", ret);
15621    return(ret);
15622}
15623
15624static int
15625test_xmlXIncludeNewContext(void) {
15626    int ret = 0;
15627
15628
15629    /* missing type support */
15630    return(ret);
15631}
15632
15633
15634static int
15635test_xmlXIncludeProcess(void) {
15636    int ret = 0;
15637
15638#ifdef LIBXML_XINCLUDE_ENABLED
15639    int mem_base;
15640    int ret_val;
15641    xmlDocPtr doc; /* an XML document */
15642    int n_doc;
15643
15644    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15645        mem_base = xmlMemBlocks();
15646        doc = gen_xmlDocPtr(n_doc, 0);
15647
15648        ret_val = xmlXIncludeProcess(doc);
15649        desret_int(ret_val);
15650        call_tests++;
15651        des_xmlDocPtr(n_doc, doc, 0);
15652        xmlResetLastError();
15653        if (mem_base != xmlMemBlocks()) {
15654            printf("Leak of %d blocks found in xmlXIncludeProcess",
15655	           xmlMemBlocks() - mem_base);
15656	    ret++;
15657            printf(" %d", n_doc);
15658            printf("\n");
15659        }
15660    }
15661#endif
15662
15663    function_tests++;
15664    return(ret);
15665}
15666
15667
15668static int
15669test_xmlXIncludeProcessFlags(void) {
15670    int ret = 0;
15671
15672#ifdef LIBXML_XINCLUDE_ENABLED
15673    int mem_base;
15674    int ret_val;
15675    xmlDocPtr doc; /* an XML document */
15676    int n_doc;
15677    int flags; /* a set of xmlParserOption used for parsing XML includes */
15678    int n_flags;
15679
15680    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
15681    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
15682        mem_base = xmlMemBlocks();
15683        doc = gen_xmlDocPtr(n_doc, 0);
15684        flags = gen_int(n_flags, 1);
15685
15686        ret_val = xmlXIncludeProcessFlags(doc, flags);
15687        desret_int(ret_val);
15688        call_tests++;
15689        des_xmlDocPtr(n_doc, doc, 0);
15690        des_int(n_flags, flags, 1);
15691        xmlResetLastError();
15692        if (mem_base != xmlMemBlocks()) {
15693            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
15694	           xmlMemBlocks() - mem_base);
15695	    ret++;
15696            printf(" %d", n_doc);
15697            printf(" %d", n_flags);
15698            printf("\n");
15699        }
15700    }
15701    }
15702#endif
15703
15704    function_tests++;
15705    return(ret);
15706}
15707
15708
15709static int
15710test_xmlXIncludeProcessNode(void) {
15711    int ret = 0;
15712
15713
15714    /* missing type support */
15715    return(ret);
15716}
15717
15718
15719static int
15720test_xmlXIncludeProcessTree(void) {
15721    int ret = 0;
15722
15723#ifdef LIBXML_XINCLUDE_ENABLED
15724    int mem_base;
15725    int ret_val;
15726    xmlNodePtr tree; /* a node in an XML document */
15727    int n_tree;
15728
15729    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
15730        mem_base = xmlMemBlocks();
15731        tree = gen_xmlNodePtr(n_tree, 0);
15732
15733        ret_val = xmlXIncludeProcessTree(tree);
15734        desret_int(ret_val);
15735        call_tests++;
15736        des_xmlNodePtr(n_tree, tree, 0);
15737        xmlResetLastError();
15738        if (mem_base != xmlMemBlocks()) {
15739            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
15740	           xmlMemBlocks() - mem_base);
15741	    ret++;
15742            printf(" %d", n_tree);
15743            printf("\n");
15744        }
15745    }
15746#endif
15747
15748    function_tests++;
15749    return(ret);
15750}
15751
15752
15753static int
15754test_xmlXIncludeProcessTreeFlags(void) {
15755    int ret = 0;
15756
15757#ifdef LIBXML_XINCLUDE_ENABLED
15758    int mem_base;
15759    int ret_val;
15760    xmlNodePtr tree; /* a node in an XML document */
15761    int n_tree;
15762    int flags; /* a set of xmlParserOption used for parsing XML includes */
15763    int n_flags;
15764
15765    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
15766    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
15767        mem_base = xmlMemBlocks();
15768        tree = gen_xmlNodePtr(n_tree, 0);
15769        flags = gen_int(n_flags, 1);
15770
15771        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
15772        desret_int(ret_val);
15773        call_tests++;
15774        des_xmlNodePtr(n_tree, tree, 0);
15775        des_int(n_flags, flags, 1);
15776        xmlResetLastError();
15777        if (mem_base != xmlMemBlocks()) {
15778            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
15779	           xmlMemBlocks() - mem_base);
15780	    ret++;
15781            printf(" %d", n_tree);
15782            printf(" %d", n_flags);
15783            printf("\n");
15784        }
15785    }
15786    }
15787#endif
15788
15789    function_tests++;
15790    return(ret);
15791}
15792
15793
15794static int
15795test_xmlXIncludeSetFlags(void) {
15796    int ret = 0;
15797
15798
15799    /* missing type support */
15800    return(ret);
15801}
15802
15803static int
15804test_xinclude(void) {
15805    int ret = 0;
15806
15807    printf("Testing xinclude : 4 of 8 functions ...\n");
15808    ret += test_xmlXIncludeNewContext();
15809    ret += test_xmlXIncludeProcess();
15810    ret += test_xmlXIncludeProcessFlags();
15811    ret += test_xmlXIncludeProcessNode();
15812    ret += test_xmlXIncludeProcessTree();
15813    ret += test_xmlXIncludeProcessTreeFlags();
15814    ret += test_xmlXIncludeSetFlags();
15815
15816    if (ret != 0)
15817	printf("Module xinclude: %d errors\n", ret);
15818    return(ret);
15819}
15820
15821static int
15822test_xmlAllocOutputBuffer(void) {
15823    int ret = 0;
15824
15825
15826    /* missing type support */
15827    return(ret);
15828}
15829
15830
15831static int
15832test_xmlAllocParserInputBuffer(void) {
15833    int ret = 0;
15834
15835
15836    /* missing type support */
15837    return(ret);
15838}
15839
15840
15841static int
15842test_xmlCheckFilename(void) {
15843    int ret = 0;
15844
15845    int mem_base;
15846    int ret_val;
15847    const char * path; /* the path to check */
15848    int n_path;
15849
15850    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
15851        mem_base = xmlMemBlocks();
15852        path = gen_const_char_ptr(n_path, 0);
15853
15854        ret_val = xmlCheckFilename(path);
15855        desret_int(ret_val);
15856        call_tests++;
15857        des_const_char_ptr(n_path, path, 0);
15858        xmlResetLastError();
15859        if (mem_base != xmlMemBlocks()) {
15860            printf("Leak of %d blocks found in xmlCheckFilename",
15861	           xmlMemBlocks() - mem_base);
15862	    ret++;
15863            printf(" %d", n_path);
15864            printf("\n");
15865        }
15866    }
15867
15868    function_tests++;
15869    return(ret);
15870}
15871
15872
15873static int
15874test_xmlCheckHTTPInput(void) {
15875    int ret = 0;
15876
15877
15878    /* missing type support */
15879    return(ret);
15880}
15881
15882
15883static int
15884test_xmlCleanupInputCallbacks(void) {
15885    int ret = 0;
15886
15887    int mem_base;
15888
15889        mem_base = xmlMemBlocks();
15890
15891        xmlCleanupInputCallbacks();
15892        call_tests++;
15893        xmlResetLastError();
15894        if (mem_base != xmlMemBlocks()) {
15895            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
15896	           xmlMemBlocks() - mem_base);
15897	    ret++;
15898            printf("\n");
15899        }
15900
15901    function_tests++;
15902    return(ret);
15903}
15904
15905
15906static int
15907test_xmlCleanupOutputCallbacks(void) {
15908    int ret = 0;
15909
15910#ifdef LIBXML_OUTPUT_ENABLED
15911    int mem_base;
15912
15913        mem_base = xmlMemBlocks();
15914
15915        xmlCleanupOutputCallbacks();
15916        call_tests++;
15917        xmlResetLastError();
15918        if (mem_base != xmlMemBlocks()) {
15919            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
15920	           xmlMemBlocks() - mem_base);
15921	    ret++;
15922            printf("\n");
15923        }
15924#endif
15925
15926    function_tests++;
15927    return(ret);
15928}
15929
15930
15931static int
15932test_xmlFileClose(void) {
15933    int ret = 0;
15934
15935    int mem_base;
15936    int ret_val;
15937    void * context; /* the I/O context */
15938    int n_context;
15939
15940    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
15941        mem_base = xmlMemBlocks();
15942        context = gen_void_ptr(n_context, 0);
15943
15944        ret_val = xmlFileClose(context);
15945        desret_int(ret_val);
15946        call_tests++;
15947        des_void_ptr(n_context, context, 0);
15948        xmlResetLastError();
15949        if (mem_base != xmlMemBlocks()) {
15950            printf("Leak of %d blocks found in xmlFileClose",
15951	           xmlMemBlocks() - mem_base);
15952	    ret++;
15953            printf(" %d", n_context);
15954            printf("\n");
15955        }
15956    }
15957
15958    function_tests++;
15959    return(ret);
15960}
15961
15962
15963static int
15964test_xmlFileMatch(void) {
15965    int ret = 0;
15966
15967    int mem_base;
15968    int ret_val;
15969    const char * filename; /* the URI for matching */
15970    int n_filename;
15971
15972    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15973        mem_base = xmlMemBlocks();
15974        filename = gen_filepath(n_filename, 0);
15975
15976        ret_val = xmlFileMatch(filename);
15977        desret_int(ret_val);
15978        call_tests++;
15979        des_filepath(n_filename, filename, 0);
15980        xmlResetLastError();
15981        if (mem_base != xmlMemBlocks()) {
15982            printf("Leak of %d blocks found in xmlFileMatch",
15983	           xmlMemBlocks() - mem_base);
15984	    ret++;
15985            printf(" %d", n_filename);
15986            printf("\n");
15987        }
15988    }
15989
15990    function_tests++;
15991    return(ret);
15992}
15993
15994
15995static int
15996test_xmlFileOpen(void) {
15997    int ret = 0;
15998
15999    int mem_base;
16000    void * ret_val;
16001    const char * filename; /* the URI for matching */
16002    int n_filename;
16003
16004    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16005        mem_base = xmlMemBlocks();
16006        filename = gen_filepath(n_filename, 0);
16007
16008        ret_val = xmlFileOpen(filename);
16009        desret_void_ptr(ret_val);
16010        call_tests++;
16011        des_filepath(n_filename, filename, 0);
16012        xmlResetLastError();
16013        if (mem_base != xmlMemBlocks()) {
16014            printf("Leak of %d blocks found in xmlFileOpen",
16015	           xmlMemBlocks() - mem_base);
16016	    ret++;
16017            printf(" %d", n_filename);
16018            printf("\n");
16019        }
16020    }
16021
16022    function_tests++;
16023    return(ret);
16024}
16025
16026
16027static int
16028test_xmlFileRead(void) {
16029    int ret = 0;
16030
16031
16032    /* missing type support */
16033    return(ret);
16034}
16035
16036
16037static int
16038test_xmlIOFTPClose(void) {
16039    int ret = 0;
16040
16041#ifdef LIBXML_FTP_ENABLED
16042    int mem_base;
16043    int ret_val;
16044    void * context; /* the I/O context */
16045    int n_context;
16046
16047    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
16048        mem_base = xmlMemBlocks();
16049        context = gen_void_ptr(n_context, 0);
16050
16051        ret_val = xmlIOFTPClose(context);
16052        desret_int(ret_val);
16053        call_tests++;
16054        des_void_ptr(n_context, context, 0);
16055        xmlResetLastError();
16056        if (mem_base != xmlMemBlocks()) {
16057            printf("Leak of %d blocks found in xmlIOFTPClose",
16058	           xmlMemBlocks() - mem_base);
16059	    ret++;
16060            printf(" %d", n_context);
16061            printf("\n");
16062        }
16063    }
16064#endif
16065
16066    function_tests++;
16067    return(ret);
16068}
16069
16070
16071static int
16072test_xmlIOFTPMatch(void) {
16073    int ret = 0;
16074
16075#ifdef LIBXML_FTP_ENABLED
16076    int mem_base;
16077    int ret_val;
16078    const char * filename; /* the URI for matching */
16079    int n_filename;
16080
16081    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16082        mem_base = xmlMemBlocks();
16083        filename = gen_filepath(n_filename, 0);
16084
16085        ret_val = xmlIOFTPMatch(filename);
16086        desret_int(ret_val);
16087        call_tests++;
16088        des_filepath(n_filename, filename, 0);
16089        xmlResetLastError();
16090        if (mem_base != xmlMemBlocks()) {
16091            printf("Leak of %d blocks found in xmlIOFTPMatch",
16092	           xmlMemBlocks() - mem_base);
16093	    ret++;
16094            printf(" %d", n_filename);
16095            printf("\n");
16096        }
16097    }
16098#endif
16099
16100    function_tests++;
16101    return(ret);
16102}
16103
16104
16105static int
16106test_xmlIOFTPOpen(void) {
16107    int ret = 0;
16108
16109#ifdef LIBXML_FTP_ENABLED
16110    int mem_base;
16111    void * ret_val;
16112    const char * filename; /* the URI for matching */
16113    int n_filename;
16114
16115    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16116        mem_base = xmlMemBlocks();
16117        filename = gen_filepath(n_filename, 0);
16118
16119        ret_val = xmlIOFTPOpen(filename);
16120        desret_void_ptr(ret_val);
16121        call_tests++;
16122        des_filepath(n_filename, filename, 0);
16123        xmlResetLastError();
16124        if (mem_base != xmlMemBlocks()) {
16125            printf("Leak of %d blocks found in xmlIOFTPOpen",
16126	           xmlMemBlocks() - mem_base);
16127	    ret++;
16128            printf(" %d", n_filename);
16129            printf("\n");
16130        }
16131    }
16132#endif
16133
16134    function_tests++;
16135    return(ret);
16136}
16137
16138
16139static int
16140test_xmlIOFTPRead(void) {
16141    int ret = 0;
16142
16143
16144    /* missing type support */
16145    return(ret);
16146}
16147
16148
16149static int
16150test_xmlIOHTTPClose(void) {
16151    int ret = 0;
16152
16153#ifdef LIBXML_HTTP_ENABLED
16154    int mem_base;
16155    int ret_val;
16156    void * context; /* the I/O context */
16157    int n_context;
16158
16159    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
16160        mem_base = xmlMemBlocks();
16161        context = gen_void_ptr(n_context, 0);
16162
16163        ret_val = xmlIOHTTPClose(context);
16164        desret_int(ret_val);
16165        call_tests++;
16166        des_void_ptr(n_context, context, 0);
16167        xmlResetLastError();
16168        if (mem_base != xmlMemBlocks()) {
16169            printf("Leak of %d blocks found in xmlIOHTTPClose",
16170	           xmlMemBlocks() - mem_base);
16171	    ret++;
16172            printf(" %d", n_context);
16173            printf("\n");
16174        }
16175    }
16176#endif
16177
16178    function_tests++;
16179    return(ret);
16180}
16181
16182
16183static int
16184test_xmlIOHTTPMatch(void) {
16185    int ret = 0;
16186
16187#ifdef LIBXML_HTTP_ENABLED
16188    int mem_base;
16189    int ret_val;
16190    const char * filename; /* the URI for matching */
16191    int n_filename;
16192
16193    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16194        mem_base = xmlMemBlocks();
16195        filename = gen_filepath(n_filename, 0);
16196
16197        ret_val = xmlIOHTTPMatch(filename);
16198        desret_int(ret_val);
16199        call_tests++;
16200        des_filepath(n_filename, filename, 0);
16201        xmlResetLastError();
16202        if (mem_base != xmlMemBlocks()) {
16203            printf("Leak of %d blocks found in xmlIOHTTPMatch",
16204	           xmlMemBlocks() - mem_base);
16205	    ret++;
16206            printf(" %d", n_filename);
16207            printf("\n");
16208        }
16209    }
16210#endif
16211
16212    function_tests++;
16213    return(ret);
16214}
16215
16216
16217static int
16218test_xmlIOHTTPOpen(void) {
16219    int ret = 0;
16220
16221#ifdef LIBXML_HTTP_ENABLED
16222    int mem_base;
16223    void * ret_val;
16224    const char * filename; /* the URI for matching */
16225    int n_filename;
16226
16227    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16228        mem_base = xmlMemBlocks();
16229        filename = gen_filepath(n_filename, 0);
16230
16231        ret_val = xmlIOHTTPOpen(filename);
16232        desret_void_ptr(ret_val);
16233        call_tests++;
16234        des_filepath(n_filename, filename, 0);
16235        xmlResetLastError();
16236        if (mem_base != xmlMemBlocks()) {
16237            printf("Leak of %d blocks found in xmlIOHTTPOpen",
16238	           xmlMemBlocks() - mem_base);
16239	    ret++;
16240            printf(" %d", n_filename);
16241            printf("\n");
16242        }
16243    }
16244#endif
16245
16246    function_tests++;
16247    return(ret);
16248}
16249
16250
16251static int
16252test_xmlIOHTTPOpenW(void) {
16253    int ret = 0;
16254
16255
16256    /* missing type support */
16257    return(ret);
16258}
16259
16260
16261static int
16262test_xmlIOHTTPRead(void) {
16263    int ret = 0;
16264
16265
16266    /* missing type support */
16267    return(ret);
16268}
16269
16270
16271static int
16272test_xmlNoNetExternalEntityLoader(void) {
16273    int ret = 0;
16274
16275
16276    /* missing type support */
16277    return(ret);
16278}
16279
16280
16281static int
16282test_xmlNormalizeWindowsPath(void) {
16283    int ret = 0;
16284
16285    int mem_base;
16286    xmlChar * ret_val;
16287    const xmlChar * path; /* the input file path */
16288    int n_path;
16289
16290    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
16291        mem_base = xmlMemBlocks();
16292        path = gen_const_xmlChar_ptr(n_path, 0);
16293
16294        ret_val = xmlNormalizeWindowsPath(path);
16295        desret_xmlChar_ptr(ret_val);
16296        call_tests++;
16297        des_const_xmlChar_ptr(n_path, path, 0);
16298        xmlResetLastError();
16299        if (mem_base != xmlMemBlocks()) {
16300            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
16301	           xmlMemBlocks() - mem_base);
16302	    ret++;
16303            printf(" %d", n_path);
16304            printf("\n");
16305        }
16306    }
16307
16308    function_tests++;
16309    return(ret);
16310}
16311
16312
16313static int
16314test_xmlOutputBufferCreateFd(void) {
16315    int ret = 0;
16316
16317
16318    /* missing type support */
16319    return(ret);
16320}
16321
16322
16323static int
16324test_xmlOutputBufferCreateFile(void) {
16325    int ret = 0;
16326
16327
16328    /* missing type support */
16329    return(ret);
16330}
16331
16332
16333static int
16334test_xmlOutputBufferCreateFilename(void) {
16335    int ret = 0;
16336
16337
16338    /* missing type support */
16339    return(ret);
16340}
16341
16342
16343static int
16344test_xmlOutputBufferCreateIO(void) {
16345    int ret = 0;
16346
16347
16348    /* missing type support */
16349    return(ret);
16350}
16351
16352
16353static int
16354test_xmlOutputBufferFlush(void) {
16355    int ret = 0;
16356
16357#ifdef LIBXML_OUTPUT_ENABLED
16358    int mem_base;
16359    int ret_val;
16360    xmlOutputBufferPtr out; /* a buffered output */
16361    int n_out;
16362
16363    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
16364        mem_base = xmlMemBlocks();
16365        out = gen_xmlOutputBufferPtr(n_out, 0);
16366
16367        ret_val = xmlOutputBufferFlush(out);
16368        desret_int(ret_val);
16369        call_tests++;
16370        des_xmlOutputBufferPtr(n_out, out, 0);
16371        xmlResetLastError();
16372        if (mem_base != xmlMemBlocks()) {
16373            printf("Leak of %d blocks found in xmlOutputBufferFlush",
16374	           xmlMemBlocks() - mem_base);
16375	    ret++;
16376            printf(" %d", n_out);
16377            printf("\n");
16378        }
16379    }
16380#endif
16381
16382    function_tests++;
16383    return(ret);
16384}
16385
16386
16387static int
16388test_xmlOutputBufferWrite(void) {
16389    int ret = 0;
16390
16391#ifdef LIBXML_OUTPUT_ENABLED
16392    int mem_base;
16393    int ret_val;
16394    xmlOutputBufferPtr out; /* a buffered parser output */
16395    int n_out;
16396    int len; /* the size in bytes of the array. */
16397    int n_len;
16398    const char * buf; /* an char array */
16399    int n_buf;
16400
16401    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
16402    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16403    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
16404        mem_base = xmlMemBlocks();
16405        out = gen_xmlOutputBufferPtr(n_out, 0);
16406        len = gen_int(n_len, 1);
16407        buf = gen_const_char_ptr(n_buf, 2);
16408
16409        ret_val = xmlOutputBufferWrite(out, len, buf);
16410        desret_int(ret_val);
16411        call_tests++;
16412        des_xmlOutputBufferPtr(n_out, out, 0);
16413        des_int(n_len, len, 1);
16414        des_const_char_ptr(n_buf, buf, 2);
16415        xmlResetLastError();
16416        if (mem_base != xmlMemBlocks()) {
16417            printf("Leak of %d blocks found in xmlOutputBufferWrite",
16418	           xmlMemBlocks() - mem_base);
16419	    ret++;
16420            printf(" %d", n_out);
16421            printf(" %d", n_len);
16422            printf(" %d", n_buf);
16423            printf("\n");
16424        }
16425    }
16426    }
16427    }
16428#endif
16429
16430    function_tests++;
16431    return(ret);
16432}
16433
16434
16435static int
16436test_xmlOutputBufferWriteEscape(void) {
16437    int ret = 0;
16438
16439
16440    /* missing type support */
16441    return(ret);
16442}
16443
16444
16445static int
16446test_xmlOutputBufferWriteString(void) {
16447    int ret = 0;
16448
16449#ifdef LIBXML_OUTPUT_ENABLED
16450    int mem_base;
16451    int ret_val;
16452    xmlOutputBufferPtr out; /* a buffered parser output */
16453    int n_out;
16454    const char * str; /* a zero terminated C string */
16455    int n_str;
16456
16457    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
16458    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
16459        mem_base = xmlMemBlocks();
16460        out = gen_xmlOutputBufferPtr(n_out, 0);
16461        str = gen_const_char_ptr(n_str, 1);
16462
16463        ret_val = xmlOutputBufferWriteString(out, str);
16464        desret_int(ret_val);
16465        call_tests++;
16466        des_xmlOutputBufferPtr(n_out, out, 0);
16467        des_const_char_ptr(n_str, str, 1);
16468        xmlResetLastError();
16469        if (mem_base != xmlMemBlocks()) {
16470            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
16471	           xmlMemBlocks() - mem_base);
16472	    ret++;
16473            printf(" %d", n_out);
16474            printf(" %d", n_str);
16475            printf("\n");
16476        }
16477    }
16478    }
16479#endif
16480
16481    function_tests++;
16482    return(ret);
16483}
16484
16485
16486static int
16487test_xmlParserGetDirectory(void) {
16488    int ret = 0;
16489
16490
16491    /* missing type support */
16492    return(ret);
16493}
16494
16495
16496static int
16497test_xmlParserInputBufferCreateFd(void) {
16498    int ret = 0;
16499
16500
16501    /* missing type support */
16502    return(ret);
16503}
16504
16505
16506static int
16507test_xmlParserInputBufferCreateFile(void) {
16508    int ret = 0;
16509
16510
16511    /* missing type support */
16512    return(ret);
16513}
16514
16515
16516static int
16517test_xmlParserInputBufferCreateFilename(void) {
16518    int ret = 0;
16519
16520
16521    /* missing type support */
16522    return(ret);
16523}
16524
16525
16526static int
16527test_xmlParserInputBufferCreateIO(void) {
16528    int ret = 0;
16529
16530
16531    /* missing type support */
16532    return(ret);
16533}
16534
16535
16536static int
16537test_xmlParserInputBufferCreateMem(void) {
16538    int ret = 0;
16539
16540
16541    /* missing type support */
16542    return(ret);
16543}
16544
16545
16546static int
16547test_xmlParserInputBufferCreateStatic(void) {
16548    int ret = 0;
16549
16550
16551    /* missing type support */
16552    return(ret);
16553}
16554
16555
16556static int
16557test_xmlParserInputBufferGrow(void) {
16558    int ret = 0;
16559
16560    int mem_base;
16561    int ret_val;
16562    xmlParserInputBufferPtr in; /* a buffered parser input */
16563    int n_in;
16564    int len; /* indicative value of the amount of chars to read */
16565    int n_len;
16566
16567    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
16568    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16569        mem_base = xmlMemBlocks();
16570        in = gen_xmlParserInputBufferPtr(n_in, 0);
16571        len = gen_int(n_len, 1);
16572
16573        ret_val = xmlParserInputBufferGrow(in, len);
16574        desret_int(ret_val);
16575        call_tests++;
16576        des_xmlParserInputBufferPtr(n_in, in, 0);
16577        des_int(n_len, len, 1);
16578        xmlResetLastError();
16579        if (mem_base != xmlMemBlocks()) {
16580            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
16581	           xmlMemBlocks() - mem_base);
16582	    ret++;
16583            printf(" %d", n_in);
16584            printf(" %d", n_len);
16585            printf("\n");
16586        }
16587    }
16588    }
16589
16590    function_tests++;
16591    return(ret);
16592}
16593
16594
16595static int
16596test_xmlParserInputBufferPush(void) {
16597    int ret = 0;
16598
16599    int mem_base;
16600    int ret_val;
16601    xmlParserInputBufferPtr in; /* a buffered parser input */
16602    int n_in;
16603    int len; /* the size in bytes of the array. */
16604    int n_len;
16605    const char * buf; /* an char array */
16606    int n_buf;
16607
16608    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
16609    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16610    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
16611        mem_base = xmlMemBlocks();
16612        in = gen_xmlParserInputBufferPtr(n_in, 0);
16613        len = gen_int(n_len, 1);
16614        buf = gen_const_char_ptr(n_buf, 2);
16615
16616        ret_val = xmlParserInputBufferPush(in, len, buf);
16617        desret_int(ret_val);
16618        call_tests++;
16619        des_xmlParserInputBufferPtr(n_in, in, 0);
16620        des_int(n_len, len, 1);
16621        des_const_char_ptr(n_buf, buf, 2);
16622        xmlResetLastError();
16623        if (mem_base != xmlMemBlocks()) {
16624            printf("Leak of %d blocks found in xmlParserInputBufferPush",
16625	           xmlMemBlocks() - mem_base);
16626	    ret++;
16627            printf(" %d", n_in);
16628            printf(" %d", n_len);
16629            printf(" %d", n_buf);
16630            printf("\n");
16631        }
16632    }
16633    }
16634    }
16635
16636    function_tests++;
16637    return(ret);
16638}
16639
16640
16641static int
16642test_xmlParserInputBufferRead(void) {
16643    int ret = 0;
16644
16645    int mem_base;
16646    int ret_val;
16647    xmlParserInputBufferPtr in; /* a buffered parser input */
16648    int n_in;
16649    int len; /* indicative value of the amount of chars to read */
16650    int n_len;
16651
16652    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
16653    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16654        mem_base = xmlMemBlocks();
16655        in = gen_xmlParserInputBufferPtr(n_in, 0);
16656        len = gen_int(n_len, 1);
16657
16658        ret_val = xmlParserInputBufferRead(in, len);
16659        desret_int(ret_val);
16660        call_tests++;
16661        des_xmlParserInputBufferPtr(n_in, in, 0);
16662        des_int(n_len, len, 1);
16663        xmlResetLastError();
16664        if (mem_base != xmlMemBlocks()) {
16665            printf("Leak of %d blocks found in xmlParserInputBufferRead",
16666	           xmlMemBlocks() - mem_base);
16667	    ret++;
16668            printf(" %d", n_in);
16669            printf(" %d", n_len);
16670            printf("\n");
16671        }
16672    }
16673    }
16674
16675    function_tests++;
16676    return(ret);
16677}
16678
16679
16680static int
16681test_xmlPopInputCallbacks(void) {
16682    int ret = 0;
16683
16684    int mem_base;
16685    int ret_val;
16686
16687        mem_base = xmlMemBlocks();
16688
16689        ret_val = xmlPopInputCallbacks();
16690        desret_int(ret_val);
16691        call_tests++;
16692        xmlResetLastError();
16693        if (mem_base != xmlMemBlocks()) {
16694            printf("Leak of %d blocks found in xmlPopInputCallbacks",
16695	           xmlMemBlocks() - mem_base);
16696	    ret++;
16697            printf("\n");
16698        }
16699
16700    function_tests++;
16701    return(ret);
16702}
16703
16704
16705static int
16706test_xmlRegisterDefaultInputCallbacks(void) {
16707    int ret = 0;
16708
16709    int mem_base;
16710
16711        mem_base = xmlMemBlocks();
16712
16713        xmlRegisterDefaultInputCallbacks();
16714        call_tests++;
16715        xmlResetLastError();
16716        if (mem_base != xmlMemBlocks()) {
16717            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
16718	           xmlMemBlocks() - mem_base);
16719	    ret++;
16720            printf("\n");
16721        }
16722
16723    function_tests++;
16724    return(ret);
16725}
16726
16727
16728static int
16729test_xmlRegisterDefaultOutputCallbacks(void) {
16730    int ret = 0;
16731
16732#ifdef LIBXML_OUTPUT_ENABLED
16733    int mem_base;
16734
16735        mem_base = xmlMemBlocks();
16736
16737        xmlRegisterDefaultOutputCallbacks();
16738        call_tests++;
16739        xmlResetLastError();
16740        if (mem_base != xmlMemBlocks()) {
16741            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
16742	           xmlMemBlocks() - mem_base);
16743	    ret++;
16744            printf("\n");
16745        }
16746#endif
16747
16748    function_tests++;
16749    return(ret);
16750}
16751
16752
16753static int
16754test_xmlRegisterHTTPPostCallbacks(void) {
16755    int ret = 0;
16756
16757#ifdef LIBXML_HTTP_ENABLED
16758    int mem_base;
16759
16760        mem_base = xmlMemBlocks();
16761
16762        xmlRegisterHTTPPostCallbacks();
16763        call_tests++;
16764        xmlResetLastError();
16765        if (mem_base != xmlMemBlocks()) {
16766            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
16767	           xmlMemBlocks() - mem_base);
16768	    ret++;
16769            printf("\n");
16770        }
16771#endif
16772
16773    function_tests++;
16774    return(ret);
16775}
16776
16777
16778static int
16779test_xmlRegisterInputCallbacks(void) {
16780    int ret = 0;
16781
16782
16783    /* missing type support */
16784    return(ret);
16785}
16786
16787
16788static int
16789test_xmlRegisterOutputCallbacks(void) {
16790    int ret = 0;
16791
16792
16793    /* missing type support */
16794    return(ret);
16795}
16796
16797static int
16798test_xmlIO(void) {
16799    int ret = 0;
16800
16801    printf("Testing xmlIO : 23 of 47 functions ...\n");
16802    ret += test_xmlAllocOutputBuffer();
16803    ret += test_xmlAllocParserInputBuffer();
16804    ret += test_xmlCheckFilename();
16805    ret += test_xmlCheckHTTPInput();
16806    ret += test_xmlCleanupInputCallbacks();
16807    ret += test_xmlCleanupOutputCallbacks();
16808    ret += test_xmlFileClose();
16809    ret += test_xmlFileMatch();
16810    ret += test_xmlFileOpen();
16811    ret += test_xmlFileRead();
16812    ret += test_xmlIOFTPClose();
16813    ret += test_xmlIOFTPMatch();
16814    ret += test_xmlIOFTPOpen();
16815    ret += test_xmlIOFTPRead();
16816    ret += test_xmlIOHTTPClose();
16817    ret += test_xmlIOHTTPMatch();
16818    ret += test_xmlIOHTTPOpen();
16819    ret += test_xmlIOHTTPOpenW();
16820    ret += test_xmlIOHTTPRead();
16821    ret += test_xmlNoNetExternalEntityLoader();
16822    ret += test_xmlNormalizeWindowsPath();
16823    ret += test_xmlOutputBufferCreateFd();
16824    ret += test_xmlOutputBufferCreateFile();
16825    ret += test_xmlOutputBufferCreateFilename();
16826    ret += test_xmlOutputBufferCreateIO();
16827    ret += test_xmlOutputBufferFlush();
16828    ret += test_xmlOutputBufferWrite();
16829    ret += test_xmlOutputBufferWriteEscape();
16830    ret += test_xmlOutputBufferWriteString();
16831    ret += test_xmlParserGetDirectory();
16832    ret += test_xmlParserInputBufferCreateFd();
16833    ret += test_xmlParserInputBufferCreateFile();
16834    ret += test_xmlParserInputBufferCreateFilename();
16835    ret += test_xmlParserInputBufferCreateIO();
16836    ret += test_xmlParserInputBufferCreateMem();
16837    ret += test_xmlParserInputBufferCreateStatic();
16838    ret += test_xmlParserInputBufferGrow();
16839    ret += test_xmlParserInputBufferPush();
16840    ret += test_xmlParserInputBufferRead();
16841    ret += test_xmlPopInputCallbacks();
16842    ret += test_xmlRegisterDefaultInputCallbacks();
16843    ret += test_xmlRegisterDefaultOutputCallbacks();
16844    ret += test_xmlRegisterHTTPPostCallbacks();
16845    ret += test_xmlRegisterInputCallbacks();
16846    ret += test_xmlRegisterOutputCallbacks();
16847
16848    if (ret != 0)
16849	printf("Module xmlIO: %d errors\n", ret);
16850    return(ret);
16851}
16852
16853static int
16854test_initGenericErrorDefaultFunc(void) {
16855    int ret = 0;
16856
16857
16858    /* missing type support */
16859    return(ret);
16860}
16861
16862
16863static int
16864test_xmlCopyError(void) {
16865    int ret = 0;
16866
16867
16868    /* missing type support */
16869    return(ret);
16870}
16871
16872
16873static int
16874test_xmlCtxtGetLastError(void) {
16875    int ret = 0;
16876
16877
16878    /* missing type support */
16879    return(ret);
16880}
16881
16882
16883static int
16884test_xmlCtxtResetLastError(void) {
16885    int ret = 0;
16886
16887    int mem_base;
16888    void * ctx; /* an XML parser context */
16889    int n_ctx;
16890
16891    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
16892        mem_base = xmlMemBlocks();
16893        ctx = gen_void_ptr(n_ctx, 0);
16894
16895        xmlCtxtResetLastError(ctx);
16896        call_tests++;
16897        des_void_ptr(n_ctx, ctx, 0);
16898        xmlResetLastError();
16899        if (mem_base != xmlMemBlocks()) {
16900            printf("Leak of %d blocks found in xmlCtxtResetLastError",
16901	           xmlMemBlocks() - mem_base);
16902	    ret++;
16903            printf(" %d", n_ctx);
16904            printf("\n");
16905        }
16906    }
16907
16908    function_tests++;
16909    return(ret);
16910}
16911
16912
16913static int
16914test_xmlGetLastError(void) {
16915    int ret = 0;
16916
16917
16918    /* missing type support */
16919    return(ret);
16920}
16921
16922
16923static int
16924test_xmlParserError(void) {
16925    int ret = 0;
16926
16927
16928    /* missing type support */
16929    return(ret);
16930}
16931
16932
16933static int
16934test_xmlParserPrintFileContext(void) {
16935    int ret = 0;
16936
16937
16938    /* missing type support */
16939    return(ret);
16940}
16941
16942
16943static int
16944test_xmlParserPrintFileInfo(void) {
16945    int ret = 0;
16946
16947
16948    /* missing type support */
16949    return(ret);
16950}
16951
16952
16953static int
16954test_xmlParserValidityError(void) {
16955    int ret = 0;
16956
16957
16958    /* missing type support */
16959    return(ret);
16960}
16961
16962
16963static int
16964test_xmlParserValidityWarning(void) {
16965    int ret = 0;
16966
16967
16968    /* missing type support */
16969    return(ret);
16970}
16971
16972
16973static int
16974test_xmlParserWarning(void) {
16975    int ret = 0;
16976
16977
16978    /* missing type support */
16979    return(ret);
16980}
16981
16982
16983static int
16984test_xmlResetError(void) {
16985    int ret = 0;
16986
16987
16988    /* missing type support */
16989    return(ret);
16990}
16991
16992
16993static int
16994test_xmlResetLastError(void) {
16995    int ret = 0;
16996
16997
16998
16999        xmlResetLastError();
17000        call_tests++;
17001        xmlResetLastError();
17002
17003    function_tests++;
17004    return(ret);
17005}
17006
17007
17008static int
17009test_xmlSetGenericErrorFunc(void) {
17010    int ret = 0;
17011
17012
17013    /* missing type support */
17014    return(ret);
17015}
17016
17017
17018static int
17019test_xmlSetStructuredErrorFunc(void) {
17020    int ret = 0;
17021
17022
17023    /* missing type support */
17024    return(ret);
17025}
17026
17027static int
17028test_xmlerror(void) {
17029    int ret = 0;
17030
17031    printf("Testing xmlerror : 2 of 15 functions ...\n");
17032    ret += test_initGenericErrorDefaultFunc();
17033    ret += test_xmlCopyError();
17034    ret += test_xmlCtxtGetLastError();
17035    ret += test_xmlCtxtResetLastError();
17036    ret += test_xmlGetLastError();
17037    ret += test_xmlParserError();
17038    ret += test_xmlParserPrintFileContext();
17039    ret += test_xmlParserPrintFileInfo();
17040    ret += test_xmlParserValidityError();
17041    ret += test_xmlParserValidityWarning();
17042    ret += test_xmlParserWarning();
17043    ret += test_xmlResetError();
17044    ret += test_xmlResetLastError();
17045    ret += test_xmlSetGenericErrorFunc();
17046    ret += test_xmlSetStructuredErrorFunc();
17047
17048    if (ret != 0)
17049	printf("Module xmlerror: %d errors\n", ret);
17050    return(ret);
17051}
17052
17053static int
17054test_xmlNewTextReader(void) {
17055    int ret = 0;
17056
17057#ifdef LIBXML_READER_ENABLED
17058    int mem_base;
17059    xmlTextReaderPtr ret_val;
17060    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
17061    int n_input;
17062    const char * URI; /* the URI information for the source if available */
17063    int n_URI;
17064
17065    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
17066    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
17067        mem_base = xmlMemBlocks();
17068        input = gen_xmlParserInputBufferPtr(n_input, 0);
17069        URI = gen_filepath(n_URI, 1);
17070
17071        ret_val = xmlNewTextReader(input, URI);
17072        desret_xmlTextReaderPtr(ret_val);
17073        call_tests++;
17074        des_xmlParserInputBufferPtr(n_input, input, 0);
17075        des_filepath(n_URI, URI, 1);
17076        xmlResetLastError();
17077        if (mem_base != xmlMemBlocks()) {
17078            printf("Leak of %d blocks found in xmlNewTextReader",
17079	           xmlMemBlocks() - mem_base);
17080	    ret++;
17081            printf(" %d", n_input);
17082            printf(" %d", n_URI);
17083            printf("\n");
17084        }
17085    }
17086    }
17087#endif
17088
17089    function_tests++;
17090    return(ret);
17091}
17092
17093
17094static int
17095test_xmlNewTextReaderFilename(void) {
17096    int ret = 0;
17097
17098#ifdef LIBXML_READER_ENABLED
17099    int mem_base;
17100    xmlTextReaderPtr ret_val;
17101    const char * URI; /* the URI of the resource to process */
17102    int n_URI;
17103
17104    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
17105        mem_base = xmlMemBlocks();
17106        URI = gen_filepath(n_URI, 0);
17107
17108        ret_val = xmlNewTextReaderFilename(URI);
17109        desret_xmlTextReaderPtr(ret_val);
17110        call_tests++;
17111        des_filepath(n_URI, URI, 0);
17112        xmlResetLastError();
17113        if (mem_base != xmlMemBlocks()) {
17114            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
17115	           xmlMemBlocks() - mem_base);
17116	    ret++;
17117            printf(" %d", n_URI);
17118            printf("\n");
17119        }
17120    }
17121#endif
17122
17123    function_tests++;
17124    return(ret);
17125}
17126
17127
17128static int
17129test_xmlReaderForDoc(void) {
17130    int ret = 0;
17131
17132#ifdef LIBXML_READER_ENABLED
17133    int mem_base;
17134    xmlTextReaderPtr ret_val;
17135    const xmlChar * cur; /* a pointer to a zero terminated string */
17136    int n_cur;
17137    const char * URL; /* the base URL to use for the document */
17138    int n_URL;
17139    const char * encoding; /* the document encoding, or NULL */
17140    int n_encoding;
17141    int options; /* a combination of xmlParserOption */
17142    int n_options;
17143
17144    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
17145    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
17146    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
17147    for (n_options = 0;n_options < gen_nb_int;n_options++) {
17148        mem_base = xmlMemBlocks();
17149        cur = gen_const_xmlChar_ptr(n_cur, 0);
17150        URL = gen_filepath(n_URL, 1);
17151        encoding = gen_const_char_ptr(n_encoding, 2);
17152        options = gen_int(n_options, 3);
17153
17154        ret_val = xmlReaderForDoc(cur, URL, encoding, options);
17155        desret_xmlTextReaderPtr(ret_val);
17156        call_tests++;
17157        des_const_xmlChar_ptr(n_cur, cur, 0);
17158        des_filepath(n_URL, URL, 1);
17159        des_const_char_ptr(n_encoding, encoding, 2);
17160        des_int(n_options, options, 3);
17161        xmlResetLastError();
17162        if (mem_base != xmlMemBlocks()) {
17163            printf("Leak of %d blocks found in xmlReaderForDoc",
17164	           xmlMemBlocks() - mem_base);
17165	    ret++;
17166            printf(" %d", n_cur);
17167            printf(" %d", n_URL);
17168            printf(" %d", n_encoding);
17169            printf(" %d", n_options);
17170            printf("\n");
17171        }
17172    }
17173    }
17174    }
17175    }
17176#endif
17177
17178    function_tests++;
17179    return(ret);
17180}
17181
17182
17183static int
17184test_xmlReaderForFile(void) {
17185    int ret = 0;
17186
17187#ifdef LIBXML_READER_ENABLED
17188    int mem_base;
17189    xmlTextReaderPtr ret_val;
17190    const char * filename; /* a file or URL */
17191    int n_filename;
17192    const char * encoding; /* the document encoding, or NULL */
17193    int n_encoding;
17194    int options; /* a combination of xmlParserOption */
17195    int n_options;
17196
17197    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
17198    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
17199    for (n_options = 0;n_options < gen_nb_int;n_options++) {
17200        mem_base = xmlMemBlocks();
17201        filename = gen_filepath(n_filename, 0);
17202        encoding = gen_const_char_ptr(n_encoding, 1);
17203        options = gen_int(n_options, 2);
17204
17205        ret_val = xmlReaderForFile(filename, encoding, options);
17206        desret_xmlTextReaderPtr(ret_val);
17207        call_tests++;
17208        des_filepath(n_filename, filename, 0);
17209        des_const_char_ptr(n_encoding, encoding, 1);
17210        des_int(n_options, options, 2);
17211        xmlResetLastError();
17212        if (mem_base != xmlMemBlocks()) {
17213            printf("Leak of %d blocks found in xmlReaderForFile",
17214	           xmlMemBlocks() - mem_base);
17215	    ret++;
17216            printf(" %d", n_filename);
17217            printf(" %d", n_encoding);
17218            printf(" %d", n_options);
17219            printf("\n");
17220        }
17221    }
17222    }
17223    }
17224#endif
17225
17226    function_tests++;
17227    return(ret);
17228}
17229
17230
17231static int
17232test_xmlReaderForIO(void) {
17233    int ret = 0;
17234
17235
17236    /* missing type support */
17237    return(ret);
17238}
17239
17240
17241static int
17242test_xmlReaderForMemory(void) {
17243    int ret = 0;
17244
17245#ifdef LIBXML_READER_ENABLED
17246    int mem_base;
17247    xmlTextReaderPtr ret_val;
17248    const char * buffer; /* a pointer to a char array */
17249    int n_buffer;
17250    int size; /* the size of the array */
17251    int n_size;
17252    const char * URL; /* the base URL to use for the document */
17253    int n_URL;
17254    const char * encoding; /* the document encoding, or NULL */
17255    int n_encoding;
17256    int options; /* a combination of xmlParserOption */
17257    int n_options;
17258
17259    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17260    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17261    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
17262    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
17263    for (n_options = 0;n_options < gen_nb_int;n_options++) {
17264        mem_base = xmlMemBlocks();
17265        buffer = gen_const_char_ptr(n_buffer, 0);
17266        size = gen_int(n_size, 1);
17267        URL = gen_filepath(n_URL, 2);
17268        encoding = gen_const_char_ptr(n_encoding, 3);
17269        options = gen_int(n_options, 4);
17270
17271        ret_val = xmlReaderForMemory(buffer, size, URL, encoding, options);
17272        desret_xmlTextReaderPtr(ret_val);
17273        call_tests++;
17274        des_const_char_ptr(n_buffer, buffer, 0);
17275        des_int(n_size, size, 1);
17276        des_filepath(n_URL, URL, 2);
17277        des_const_char_ptr(n_encoding, encoding, 3);
17278        des_int(n_options, options, 4);
17279        xmlResetLastError();
17280        if (mem_base != xmlMemBlocks()) {
17281            printf("Leak of %d blocks found in xmlReaderForMemory",
17282	           xmlMemBlocks() - mem_base);
17283	    ret++;
17284            printf(" %d", n_buffer);
17285            printf(" %d", n_size);
17286            printf(" %d", n_URL);
17287            printf(" %d", n_encoding);
17288            printf(" %d", n_options);
17289            printf("\n");
17290        }
17291    }
17292    }
17293    }
17294    }
17295    }
17296#endif
17297
17298    function_tests++;
17299    return(ret);
17300}
17301
17302
17303static int
17304test_xmlReaderNewDoc(void) {
17305    int ret = 0;
17306
17307#ifdef LIBXML_READER_ENABLED
17308    int mem_base;
17309    int ret_val;
17310    xmlTextReaderPtr reader; /* an XML reader */
17311    int n_reader;
17312    const xmlChar * cur; /* a pointer to a zero terminated string */
17313    int n_cur;
17314    const char * URL; /* the base URL to use for the document */
17315    int n_URL;
17316    const char * encoding; /* the document encoding, or NULL */
17317    int n_encoding;
17318    int options; /* a combination of xmlParserOption */
17319    int n_options;
17320
17321    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17322    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
17323    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
17324    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
17325    for (n_options = 0;n_options < gen_nb_int;n_options++) {
17326        mem_base = xmlMemBlocks();
17327        reader = gen_xmlTextReaderPtr(n_reader, 0);
17328        cur = gen_const_xmlChar_ptr(n_cur, 1);
17329        URL = gen_filepath(n_URL, 2);
17330        encoding = gen_const_char_ptr(n_encoding, 3);
17331        options = gen_int(n_options, 4);
17332
17333        ret_val = xmlReaderNewDoc(reader, cur, URL, encoding, options);
17334        desret_int(ret_val);
17335        call_tests++;
17336        des_xmlTextReaderPtr(n_reader, reader, 0);
17337        des_const_xmlChar_ptr(n_cur, cur, 1);
17338        des_filepath(n_URL, URL, 2);
17339        des_const_char_ptr(n_encoding, encoding, 3);
17340        des_int(n_options, options, 4);
17341        xmlResetLastError();
17342        if (mem_base != xmlMemBlocks()) {
17343            printf("Leak of %d blocks found in xmlReaderNewDoc",
17344	           xmlMemBlocks() - mem_base);
17345	    ret++;
17346            printf(" %d", n_reader);
17347            printf(" %d", n_cur);
17348            printf(" %d", n_URL);
17349            printf(" %d", n_encoding);
17350            printf(" %d", n_options);
17351            printf("\n");
17352        }
17353    }
17354    }
17355    }
17356    }
17357    }
17358#endif
17359
17360    function_tests++;
17361    return(ret);
17362}
17363
17364
17365static int
17366test_xmlReaderNewFile(void) {
17367    int ret = 0;
17368
17369#ifdef LIBXML_READER_ENABLED
17370    int mem_base;
17371    int ret_val;
17372    xmlTextReaderPtr reader; /* an XML reader */
17373    int n_reader;
17374    const char * filename; /* a file or URL */
17375    int n_filename;
17376    const char * encoding; /* the document encoding, or NULL */
17377    int n_encoding;
17378    int options; /* a combination of xmlParserOption */
17379    int n_options;
17380
17381    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17382    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
17383    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
17384    for (n_options = 0;n_options < gen_nb_int;n_options++) {
17385        mem_base = xmlMemBlocks();
17386        reader = gen_xmlTextReaderPtr(n_reader, 0);
17387        filename = gen_filepath(n_filename, 1);
17388        encoding = gen_const_char_ptr(n_encoding, 2);
17389        options = gen_int(n_options, 3);
17390
17391        ret_val = xmlReaderNewFile(reader, filename, encoding, options);
17392        desret_int(ret_val);
17393        call_tests++;
17394        des_xmlTextReaderPtr(n_reader, reader, 0);
17395        des_filepath(n_filename, filename, 1);
17396        des_const_char_ptr(n_encoding, encoding, 2);
17397        des_int(n_options, options, 3);
17398        xmlResetLastError();
17399        if (mem_base != xmlMemBlocks()) {
17400            printf("Leak of %d blocks found in xmlReaderNewFile",
17401	           xmlMemBlocks() - mem_base);
17402	    ret++;
17403            printf(" %d", n_reader);
17404            printf(" %d", n_filename);
17405            printf(" %d", n_encoding);
17406            printf(" %d", n_options);
17407            printf("\n");
17408        }
17409    }
17410    }
17411    }
17412    }
17413#endif
17414
17415    function_tests++;
17416    return(ret);
17417}
17418
17419
17420static int
17421test_xmlReaderNewMemory(void) {
17422    int ret = 0;
17423
17424#ifdef LIBXML_READER_ENABLED
17425    int mem_base;
17426    int ret_val;
17427    xmlTextReaderPtr reader; /* an XML reader */
17428    int n_reader;
17429    const char * buffer; /* a pointer to a char array */
17430    int n_buffer;
17431    int size; /* the size of the array */
17432    int n_size;
17433    const char * URL; /* the base URL to use for the document */
17434    int n_URL;
17435    const char * encoding; /* the document encoding, or NULL */
17436    int n_encoding;
17437    int options; /* a combination of xmlParserOption */
17438    int n_options;
17439
17440    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17441    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17442    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17443    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
17444    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
17445    for (n_options = 0;n_options < gen_nb_int;n_options++) {
17446        mem_base = xmlMemBlocks();
17447        reader = gen_xmlTextReaderPtr(n_reader, 0);
17448        buffer = gen_const_char_ptr(n_buffer, 1);
17449        size = gen_int(n_size, 2);
17450        URL = gen_filepath(n_URL, 3);
17451        encoding = gen_const_char_ptr(n_encoding, 4);
17452        options = gen_int(n_options, 5);
17453
17454        ret_val = xmlReaderNewMemory(reader, buffer, size, URL, encoding, options);
17455        desret_int(ret_val);
17456        call_tests++;
17457        des_xmlTextReaderPtr(n_reader, reader, 0);
17458        des_const_char_ptr(n_buffer, buffer, 1);
17459        des_int(n_size, size, 2);
17460        des_filepath(n_URL, URL, 3);
17461        des_const_char_ptr(n_encoding, encoding, 4);
17462        des_int(n_options, options, 5);
17463        xmlResetLastError();
17464        if (mem_base != xmlMemBlocks()) {
17465            printf("Leak of %d blocks found in xmlReaderNewMemory",
17466	           xmlMemBlocks() - mem_base);
17467	    ret++;
17468            printf(" %d", n_reader);
17469            printf(" %d", n_buffer);
17470            printf(" %d", n_size);
17471            printf(" %d", n_URL);
17472            printf(" %d", n_encoding);
17473            printf(" %d", n_options);
17474            printf("\n");
17475        }
17476    }
17477    }
17478    }
17479    }
17480    }
17481    }
17482#endif
17483
17484    function_tests++;
17485    return(ret);
17486}
17487
17488
17489static int
17490test_xmlReaderNewWalker(void) {
17491    int ret = 0;
17492
17493#ifdef LIBXML_READER_ENABLED
17494    int mem_base;
17495    int ret_val;
17496    xmlTextReaderPtr reader; /* an XML reader */
17497    int n_reader;
17498    xmlDocPtr doc; /* a preparsed document */
17499    int n_doc;
17500
17501    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17502    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17503        mem_base = xmlMemBlocks();
17504        reader = gen_xmlTextReaderPtr(n_reader, 0);
17505        doc = gen_xmlDocPtr(n_doc, 1);
17506
17507        ret_val = xmlReaderNewWalker(reader, doc);
17508        desret_int(ret_val);
17509        call_tests++;
17510        des_xmlTextReaderPtr(n_reader, reader, 0);
17511        des_xmlDocPtr(n_doc, doc, 1);
17512        xmlResetLastError();
17513        if (mem_base != xmlMemBlocks()) {
17514            printf("Leak of %d blocks found in xmlReaderNewWalker",
17515	           xmlMemBlocks() - mem_base);
17516	    ret++;
17517            printf(" %d", n_reader);
17518            printf(" %d", n_doc);
17519            printf("\n");
17520        }
17521    }
17522    }
17523#endif
17524
17525    function_tests++;
17526    return(ret);
17527}
17528
17529
17530static int
17531test_xmlReaderWalker(void) {
17532    int ret = 0;
17533
17534#ifdef LIBXML_READER_ENABLED
17535    int mem_base;
17536    xmlTextReaderPtr ret_val;
17537    xmlDocPtr doc; /* a preparsed document */
17538    int n_doc;
17539
17540    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17541        mem_base = xmlMemBlocks();
17542        doc = gen_xmlDocPtr(n_doc, 0);
17543
17544        ret_val = xmlReaderWalker(doc);
17545        desret_xmlTextReaderPtr(ret_val);
17546        call_tests++;
17547        des_xmlDocPtr(n_doc, doc, 0);
17548        xmlResetLastError();
17549        if (mem_base != xmlMemBlocks()) {
17550            printf("Leak of %d blocks found in xmlReaderWalker",
17551	           xmlMemBlocks() - mem_base);
17552	    ret++;
17553            printf(" %d", n_doc);
17554            printf("\n");
17555        }
17556    }
17557#endif
17558
17559    function_tests++;
17560    return(ret);
17561}
17562
17563
17564static int
17565test_xmlTextReaderAttributeCount(void) {
17566    int ret = 0;
17567
17568#ifdef LIBXML_READER_ENABLED
17569    int mem_base;
17570    int ret_val;
17571    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17572    int n_reader;
17573
17574    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17575        mem_base = xmlMemBlocks();
17576        reader = gen_xmlTextReaderPtr(n_reader, 0);
17577
17578        ret_val = xmlTextReaderAttributeCount(reader);
17579        desret_int(ret_val);
17580        call_tests++;
17581        des_xmlTextReaderPtr(n_reader, reader, 0);
17582        xmlResetLastError();
17583        if (mem_base != xmlMemBlocks()) {
17584            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
17585	           xmlMemBlocks() - mem_base);
17586	    ret++;
17587            printf(" %d", n_reader);
17588            printf("\n");
17589        }
17590    }
17591#endif
17592
17593    function_tests++;
17594    return(ret);
17595}
17596
17597
17598static int
17599test_xmlTextReaderBaseUri(void) {
17600    int ret = 0;
17601
17602#ifdef LIBXML_READER_ENABLED
17603    int mem_base;
17604    xmlChar * ret_val;
17605    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17606    int n_reader;
17607
17608    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17609        mem_base = xmlMemBlocks();
17610        reader = gen_xmlTextReaderPtr(n_reader, 0);
17611
17612        ret_val = xmlTextReaderBaseUri(reader);
17613        desret_xmlChar_ptr(ret_val);
17614        call_tests++;
17615        des_xmlTextReaderPtr(n_reader, reader, 0);
17616        xmlResetLastError();
17617        if (mem_base != xmlMemBlocks()) {
17618            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
17619	           xmlMemBlocks() - mem_base);
17620	    ret++;
17621            printf(" %d", n_reader);
17622            printf("\n");
17623        }
17624    }
17625#endif
17626
17627    function_tests++;
17628    return(ret);
17629}
17630
17631
17632static int
17633test_xmlTextReaderClose(void) {
17634    int ret = 0;
17635
17636#ifdef LIBXML_READER_ENABLED
17637    int mem_base;
17638    int ret_val;
17639    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17640    int n_reader;
17641
17642    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17643        mem_base = xmlMemBlocks();
17644        reader = gen_xmlTextReaderPtr(n_reader, 0);
17645
17646        ret_val = xmlTextReaderClose(reader);
17647        desret_int(ret_val);
17648        call_tests++;
17649        des_xmlTextReaderPtr(n_reader, reader, 0);
17650        xmlResetLastError();
17651        if (mem_base != xmlMemBlocks()) {
17652            printf("Leak of %d blocks found in xmlTextReaderClose",
17653	           xmlMemBlocks() - mem_base);
17654	    ret++;
17655            printf(" %d", n_reader);
17656            printf("\n");
17657        }
17658    }
17659#endif
17660
17661    function_tests++;
17662    return(ret);
17663}
17664
17665
17666static int
17667test_xmlTextReaderConstBaseUri(void) {
17668    int ret = 0;
17669
17670#ifdef LIBXML_READER_ENABLED
17671    int mem_base;
17672    const xmlChar * ret_val;
17673    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17674    int n_reader;
17675
17676    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17677        mem_base = xmlMemBlocks();
17678        reader = gen_xmlTextReaderPtr(n_reader, 0);
17679
17680        ret_val = xmlTextReaderConstBaseUri(reader);
17681        desret_const_xmlChar_ptr(ret_val);
17682        call_tests++;
17683        des_xmlTextReaderPtr(n_reader, reader, 0);
17684        xmlResetLastError();
17685        if (mem_base != xmlMemBlocks()) {
17686            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
17687	           xmlMemBlocks() - mem_base);
17688	    ret++;
17689            printf(" %d", n_reader);
17690            printf("\n");
17691        }
17692    }
17693#endif
17694
17695    function_tests++;
17696    return(ret);
17697}
17698
17699
17700static int
17701test_xmlTextReaderConstEncoding(void) {
17702    int ret = 0;
17703
17704#ifdef LIBXML_READER_ENABLED
17705    int mem_base;
17706    const xmlChar * ret_val;
17707    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17708    int n_reader;
17709
17710    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17711        mem_base = xmlMemBlocks();
17712        reader = gen_xmlTextReaderPtr(n_reader, 0);
17713
17714        ret_val = xmlTextReaderConstEncoding(reader);
17715        desret_const_xmlChar_ptr(ret_val);
17716        call_tests++;
17717        des_xmlTextReaderPtr(n_reader, reader, 0);
17718        xmlResetLastError();
17719        if (mem_base != xmlMemBlocks()) {
17720            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
17721	           xmlMemBlocks() - mem_base);
17722	    ret++;
17723            printf(" %d", n_reader);
17724            printf("\n");
17725        }
17726    }
17727#endif
17728
17729    function_tests++;
17730    return(ret);
17731}
17732
17733
17734static int
17735test_xmlTextReaderConstLocalName(void) {
17736    int ret = 0;
17737
17738#ifdef LIBXML_READER_ENABLED
17739    int mem_base;
17740    const xmlChar * ret_val;
17741    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17742    int n_reader;
17743
17744    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17745        mem_base = xmlMemBlocks();
17746        reader = gen_xmlTextReaderPtr(n_reader, 0);
17747
17748        ret_val = xmlTextReaderConstLocalName(reader);
17749        desret_const_xmlChar_ptr(ret_val);
17750        call_tests++;
17751        des_xmlTextReaderPtr(n_reader, reader, 0);
17752        xmlResetLastError();
17753        if (mem_base != xmlMemBlocks()) {
17754            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
17755	           xmlMemBlocks() - mem_base);
17756	    ret++;
17757            printf(" %d", n_reader);
17758            printf("\n");
17759        }
17760    }
17761#endif
17762
17763    function_tests++;
17764    return(ret);
17765}
17766
17767
17768static int
17769test_xmlTextReaderConstName(void) {
17770    int ret = 0;
17771
17772#ifdef LIBXML_READER_ENABLED
17773    int mem_base;
17774    const xmlChar * ret_val;
17775    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17776    int n_reader;
17777
17778    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17779        mem_base = xmlMemBlocks();
17780        reader = gen_xmlTextReaderPtr(n_reader, 0);
17781
17782        ret_val = xmlTextReaderConstName(reader);
17783        desret_const_xmlChar_ptr(ret_val);
17784        call_tests++;
17785        des_xmlTextReaderPtr(n_reader, reader, 0);
17786        xmlResetLastError();
17787        if (mem_base != xmlMemBlocks()) {
17788            printf("Leak of %d blocks found in xmlTextReaderConstName",
17789	           xmlMemBlocks() - mem_base);
17790	    ret++;
17791            printf(" %d", n_reader);
17792            printf("\n");
17793        }
17794    }
17795#endif
17796
17797    function_tests++;
17798    return(ret);
17799}
17800
17801
17802static int
17803test_xmlTextReaderConstNamespaceUri(void) {
17804    int ret = 0;
17805
17806#ifdef LIBXML_READER_ENABLED
17807    int mem_base;
17808    const xmlChar * ret_val;
17809    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17810    int n_reader;
17811
17812    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17813        mem_base = xmlMemBlocks();
17814        reader = gen_xmlTextReaderPtr(n_reader, 0);
17815
17816        ret_val = xmlTextReaderConstNamespaceUri(reader);
17817        desret_const_xmlChar_ptr(ret_val);
17818        call_tests++;
17819        des_xmlTextReaderPtr(n_reader, reader, 0);
17820        xmlResetLastError();
17821        if (mem_base != xmlMemBlocks()) {
17822            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
17823	           xmlMemBlocks() - mem_base);
17824	    ret++;
17825            printf(" %d", n_reader);
17826            printf("\n");
17827        }
17828    }
17829#endif
17830
17831    function_tests++;
17832    return(ret);
17833}
17834
17835
17836static int
17837test_xmlTextReaderConstPrefix(void) {
17838    int ret = 0;
17839
17840#ifdef LIBXML_READER_ENABLED
17841    int mem_base;
17842    const xmlChar * ret_val;
17843    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17844    int n_reader;
17845
17846    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17847        mem_base = xmlMemBlocks();
17848        reader = gen_xmlTextReaderPtr(n_reader, 0);
17849
17850        ret_val = xmlTextReaderConstPrefix(reader);
17851        desret_const_xmlChar_ptr(ret_val);
17852        call_tests++;
17853        des_xmlTextReaderPtr(n_reader, reader, 0);
17854        xmlResetLastError();
17855        if (mem_base != xmlMemBlocks()) {
17856            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
17857	           xmlMemBlocks() - mem_base);
17858	    ret++;
17859            printf(" %d", n_reader);
17860            printf("\n");
17861        }
17862    }
17863#endif
17864
17865    function_tests++;
17866    return(ret);
17867}
17868
17869
17870static int
17871test_xmlTextReaderConstString(void) {
17872    int ret = 0;
17873
17874#ifdef LIBXML_READER_ENABLED
17875    int mem_base;
17876    const xmlChar * ret_val;
17877    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17878    int n_reader;
17879    const xmlChar * str; /* the string to intern. */
17880    int n_str;
17881
17882    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17883    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17884        mem_base = xmlMemBlocks();
17885        reader = gen_xmlTextReaderPtr(n_reader, 0);
17886        str = gen_const_xmlChar_ptr(n_str, 1);
17887
17888        ret_val = xmlTextReaderConstString(reader, str);
17889        desret_const_xmlChar_ptr(ret_val);
17890        call_tests++;
17891        des_xmlTextReaderPtr(n_reader, reader, 0);
17892        des_const_xmlChar_ptr(n_str, str, 1);
17893        xmlResetLastError();
17894        if (mem_base != xmlMemBlocks()) {
17895            printf("Leak of %d blocks found in xmlTextReaderConstString",
17896	           xmlMemBlocks() - mem_base);
17897	    ret++;
17898            printf(" %d", n_reader);
17899            printf(" %d", n_str);
17900            printf("\n");
17901        }
17902    }
17903    }
17904#endif
17905
17906    function_tests++;
17907    return(ret);
17908}
17909
17910
17911static int
17912test_xmlTextReaderConstValue(void) {
17913    int ret = 0;
17914
17915#ifdef LIBXML_READER_ENABLED
17916    int mem_base;
17917    const xmlChar * ret_val;
17918    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17919    int n_reader;
17920
17921    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17922        mem_base = xmlMemBlocks();
17923        reader = gen_xmlTextReaderPtr(n_reader, 0);
17924
17925        ret_val = xmlTextReaderConstValue(reader);
17926        desret_const_xmlChar_ptr(ret_val);
17927        call_tests++;
17928        des_xmlTextReaderPtr(n_reader, reader, 0);
17929        xmlResetLastError();
17930        if (mem_base != xmlMemBlocks()) {
17931            printf("Leak of %d blocks found in xmlTextReaderConstValue",
17932	           xmlMemBlocks() - mem_base);
17933	    ret++;
17934            printf(" %d", n_reader);
17935            printf("\n");
17936        }
17937    }
17938#endif
17939
17940    function_tests++;
17941    return(ret);
17942}
17943
17944
17945static int
17946test_xmlTextReaderConstXmlLang(void) {
17947    int ret = 0;
17948
17949#ifdef LIBXML_READER_ENABLED
17950    int mem_base;
17951    const xmlChar * ret_val;
17952    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17953    int n_reader;
17954
17955    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17956        mem_base = xmlMemBlocks();
17957        reader = gen_xmlTextReaderPtr(n_reader, 0);
17958
17959        ret_val = xmlTextReaderConstXmlLang(reader);
17960        desret_const_xmlChar_ptr(ret_val);
17961        call_tests++;
17962        des_xmlTextReaderPtr(n_reader, reader, 0);
17963        xmlResetLastError();
17964        if (mem_base != xmlMemBlocks()) {
17965            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
17966	           xmlMemBlocks() - mem_base);
17967	    ret++;
17968            printf(" %d", n_reader);
17969            printf("\n");
17970        }
17971    }
17972#endif
17973
17974    function_tests++;
17975    return(ret);
17976}
17977
17978
17979static int
17980test_xmlTextReaderConstXmlVersion(void) {
17981    int ret = 0;
17982
17983#ifdef LIBXML_READER_ENABLED
17984    int mem_base;
17985    const xmlChar * ret_val;
17986    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
17987    int n_reader;
17988
17989    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
17990        mem_base = xmlMemBlocks();
17991        reader = gen_xmlTextReaderPtr(n_reader, 0);
17992
17993        ret_val = xmlTextReaderConstXmlVersion(reader);
17994        desret_const_xmlChar_ptr(ret_val);
17995        call_tests++;
17996        des_xmlTextReaderPtr(n_reader, reader, 0);
17997        xmlResetLastError();
17998        if (mem_base != xmlMemBlocks()) {
17999            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
18000	           xmlMemBlocks() - mem_base);
18001	    ret++;
18002            printf(" %d", n_reader);
18003            printf("\n");
18004        }
18005    }
18006#endif
18007
18008    function_tests++;
18009    return(ret);
18010}
18011
18012
18013static int
18014test_xmlTextReaderCurrentDoc(void) {
18015    int ret = 0;
18016
18017#ifdef LIBXML_READER_ENABLED
18018    int mem_base;
18019    xmlDocPtr ret_val;
18020    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18021    int n_reader;
18022
18023    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18024        mem_base = xmlMemBlocks();
18025        reader = gen_xmlTextReaderPtr(n_reader, 0);
18026
18027        ret_val = xmlTextReaderCurrentDoc(reader);
18028        desret_xmlDocPtr(ret_val);
18029        call_tests++;
18030        des_xmlTextReaderPtr(n_reader, reader, 0);
18031        xmlResetLastError();
18032        if (mem_base != xmlMemBlocks()) {
18033            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
18034	           xmlMemBlocks() - mem_base);
18035	    ret++;
18036            printf(" %d", n_reader);
18037            printf("\n");
18038        }
18039    }
18040#endif
18041
18042    function_tests++;
18043    return(ret);
18044}
18045
18046
18047static int
18048test_xmlTextReaderCurrentNode(void) {
18049    int ret = 0;
18050
18051#ifdef LIBXML_READER_ENABLED
18052    int mem_base;
18053    xmlNodePtr ret_val;
18054    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18055    int n_reader;
18056
18057    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18058        mem_base = xmlMemBlocks();
18059        reader = gen_xmlTextReaderPtr(n_reader, 0);
18060
18061        ret_val = xmlTextReaderCurrentNode(reader);
18062        desret_xmlNodePtr(ret_val);
18063        call_tests++;
18064        des_xmlTextReaderPtr(n_reader, reader, 0);
18065        xmlResetLastError();
18066        if (mem_base != xmlMemBlocks()) {
18067            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
18068	           xmlMemBlocks() - mem_base);
18069	    ret++;
18070            printf(" %d", n_reader);
18071            printf("\n");
18072        }
18073    }
18074#endif
18075
18076    function_tests++;
18077    return(ret);
18078}
18079
18080
18081static int
18082test_xmlTextReaderDepth(void) {
18083    int ret = 0;
18084
18085#ifdef LIBXML_READER_ENABLED
18086    int mem_base;
18087    int ret_val;
18088    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18089    int n_reader;
18090
18091    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18092        mem_base = xmlMemBlocks();
18093        reader = gen_xmlTextReaderPtr(n_reader, 0);
18094
18095        ret_val = xmlTextReaderDepth(reader);
18096        desret_int(ret_val);
18097        call_tests++;
18098        des_xmlTextReaderPtr(n_reader, reader, 0);
18099        xmlResetLastError();
18100        if (mem_base != xmlMemBlocks()) {
18101            printf("Leak of %d blocks found in xmlTextReaderDepth",
18102	           xmlMemBlocks() - mem_base);
18103	    ret++;
18104            printf(" %d", n_reader);
18105            printf("\n");
18106        }
18107    }
18108#endif
18109
18110    function_tests++;
18111    return(ret);
18112}
18113
18114
18115static int
18116test_xmlTextReaderExpand(void) {
18117    int ret = 0;
18118
18119#ifdef LIBXML_READER_ENABLED
18120    int mem_base;
18121    xmlNodePtr ret_val;
18122    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18123    int n_reader;
18124
18125    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18126        mem_base = xmlMemBlocks();
18127        reader = gen_xmlTextReaderPtr(n_reader, 0);
18128
18129        ret_val = xmlTextReaderExpand(reader);
18130        desret_xmlNodePtr(ret_val);
18131        call_tests++;
18132        des_xmlTextReaderPtr(n_reader, reader, 0);
18133        xmlResetLastError();
18134        if (mem_base != xmlMemBlocks()) {
18135            printf("Leak of %d blocks found in xmlTextReaderExpand",
18136	           xmlMemBlocks() - mem_base);
18137	    ret++;
18138            printf(" %d", n_reader);
18139            printf("\n");
18140        }
18141    }
18142#endif
18143
18144    function_tests++;
18145    return(ret);
18146}
18147
18148
18149static int
18150test_xmlTextReaderGetAttribute(void) {
18151    int ret = 0;
18152
18153#ifdef LIBXML_READER_ENABLED
18154    int mem_base;
18155    xmlChar * ret_val;
18156    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18157    int n_reader;
18158    const xmlChar * name; /* the qualified name of the attribute. */
18159    int n_name;
18160
18161    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18162    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
18163        mem_base = xmlMemBlocks();
18164        reader = gen_xmlTextReaderPtr(n_reader, 0);
18165        name = gen_const_xmlChar_ptr(n_name, 1);
18166
18167        ret_val = xmlTextReaderGetAttribute(reader, name);
18168        desret_xmlChar_ptr(ret_val);
18169        call_tests++;
18170        des_xmlTextReaderPtr(n_reader, reader, 0);
18171        des_const_xmlChar_ptr(n_name, name, 1);
18172        xmlResetLastError();
18173        if (mem_base != xmlMemBlocks()) {
18174            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
18175	           xmlMemBlocks() - mem_base);
18176	    ret++;
18177            printf(" %d", n_reader);
18178            printf(" %d", n_name);
18179            printf("\n");
18180        }
18181    }
18182    }
18183#endif
18184
18185    function_tests++;
18186    return(ret);
18187}
18188
18189
18190static int
18191test_xmlTextReaderGetAttributeNo(void) {
18192    int ret = 0;
18193
18194#ifdef LIBXML_READER_ENABLED
18195    int mem_base;
18196    xmlChar * ret_val;
18197    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18198    int n_reader;
18199    int no; /* the zero-based index of the attribute relative to the containing element */
18200    int n_no;
18201
18202    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18203    for (n_no = 0;n_no < gen_nb_int;n_no++) {
18204        mem_base = xmlMemBlocks();
18205        reader = gen_xmlTextReaderPtr(n_reader, 0);
18206        no = gen_int(n_no, 1);
18207
18208        ret_val = xmlTextReaderGetAttributeNo(reader, no);
18209        desret_xmlChar_ptr(ret_val);
18210        call_tests++;
18211        des_xmlTextReaderPtr(n_reader, reader, 0);
18212        des_int(n_no, no, 1);
18213        xmlResetLastError();
18214        if (mem_base != xmlMemBlocks()) {
18215            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
18216	           xmlMemBlocks() - mem_base);
18217	    ret++;
18218            printf(" %d", n_reader);
18219            printf(" %d", n_no);
18220            printf("\n");
18221        }
18222    }
18223    }
18224#endif
18225
18226    function_tests++;
18227    return(ret);
18228}
18229
18230
18231static int
18232test_xmlTextReaderGetAttributeNs(void) {
18233    int ret = 0;
18234
18235#ifdef LIBXML_READER_ENABLED
18236    int mem_base;
18237    xmlChar * ret_val;
18238    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18239    int n_reader;
18240    const xmlChar * localName; /* the local name of the attribute. */
18241    int n_localName;
18242    const xmlChar * namespaceURI; /* the namespace URI of the attribute. */
18243    int n_namespaceURI;
18244
18245    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18246    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
18247    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
18248        mem_base = xmlMemBlocks();
18249        reader = gen_xmlTextReaderPtr(n_reader, 0);
18250        localName = gen_const_xmlChar_ptr(n_localName, 1);
18251        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
18252
18253        ret_val = xmlTextReaderGetAttributeNs(reader, localName, namespaceURI);
18254        desret_xmlChar_ptr(ret_val);
18255        call_tests++;
18256        des_xmlTextReaderPtr(n_reader, reader, 0);
18257        des_const_xmlChar_ptr(n_localName, localName, 1);
18258        des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 2);
18259        xmlResetLastError();
18260        if (mem_base != xmlMemBlocks()) {
18261            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
18262	           xmlMemBlocks() - mem_base);
18263	    ret++;
18264            printf(" %d", n_reader);
18265            printf(" %d", n_localName);
18266            printf(" %d", n_namespaceURI);
18267            printf("\n");
18268        }
18269    }
18270    }
18271    }
18272#endif
18273
18274    function_tests++;
18275    return(ret);
18276}
18277
18278
18279static int
18280test_xmlTextReaderGetErrorHandler(void) {
18281    int ret = 0;
18282
18283
18284    /* missing type support */
18285    return(ret);
18286}
18287
18288
18289static int
18290test_xmlTextReaderGetParserProp(void) {
18291    int ret = 0;
18292
18293#ifdef LIBXML_READER_ENABLED
18294    int mem_base;
18295    int ret_val;
18296    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18297    int n_reader;
18298    int prop; /* the xmlParserProperties to get */
18299    int n_prop;
18300
18301    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18302    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
18303        mem_base = xmlMemBlocks();
18304        reader = gen_xmlTextReaderPtr(n_reader, 0);
18305        prop = gen_int(n_prop, 1);
18306
18307        ret_val = xmlTextReaderGetParserProp(reader, prop);
18308        desret_int(ret_val);
18309        call_tests++;
18310        des_xmlTextReaderPtr(n_reader, reader, 0);
18311        des_int(n_prop, prop, 1);
18312        xmlResetLastError();
18313        if (mem_base != xmlMemBlocks()) {
18314            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
18315	           xmlMemBlocks() - mem_base);
18316	    ret++;
18317            printf(" %d", n_reader);
18318            printf(" %d", n_prop);
18319            printf("\n");
18320        }
18321    }
18322    }
18323#endif
18324
18325    function_tests++;
18326    return(ret);
18327}
18328
18329
18330static int
18331test_xmlTextReaderGetRemainder(void) {
18332    int ret = 0;
18333
18334
18335    /* missing type support */
18336    return(ret);
18337}
18338
18339
18340static int
18341test_xmlTextReaderHasAttributes(void) {
18342    int ret = 0;
18343
18344#ifdef LIBXML_READER_ENABLED
18345    int mem_base;
18346    int ret_val;
18347    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18348    int n_reader;
18349
18350    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18351        mem_base = xmlMemBlocks();
18352        reader = gen_xmlTextReaderPtr(n_reader, 0);
18353
18354        ret_val = xmlTextReaderHasAttributes(reader);
18355        desret_int(ret_val);
18356        call_tests++;
18357        des_xmlTextReaderPtr(n_reader, reader, 0);
18358        xmlResetLastError();
18359        if (mem_base != xmlMemBlocks()) {
18360            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
18361	           xmlMemBlocks() - mem_base);
18362	    ret++;
18363            printf(" %d", n_reader);
18364            printf("\n");
18365        }
18366    }
18367#endif
18368
18369    function_tests++;
18370    return(ret);
18371}
18372
18373
18374static int
18375test_xmlTextReaderHasValue(void) {
18376    int ret = 0;
18377
18378#ifdef LIBXML_READER_ENABLED
18379    int mem_base;
18380    int ret_val;
18381    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18382    int n_reader;
18383
18384    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18385        mem_base = xmlMemBlocks();
18386        reader = gen_xmlTextReaderPtr(n_reader, 0);
18387
18388        ret_val = xmlTextReaderHasValue(reader);
18389        desret_int(ret_val);
18390        call_tests++;
18391        des_xmlTextReaderPtr(n_reader, reader, 0);
18392        xmlResetLastError();
18393        if (mem_base != xmlMemBlocks()) {
18394            printf("Leak of %d blocks found in xmlTextReaderHasValue",
18395	           xmlMemBlocks() - mem_base);
18396	    ret++;
18397            printf(" %d", n_reader);
18398            printf("\n");
18399        }
18400    }
18401#endif
18402
18403    function_tests++;
18404    return(ret);
18405}
18406
18407
18408static int
18409test_xmlTextReaderIsDefault(void) {
18410    int ret = 0;
18411
18412#ifdef LIBXML_READER_ENABLED
18413    int mem_base;
18414    int ret_val;
18415    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18416    int n_reader;
18417
18418    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18419        mem_base = xmlMemBlocks();
18420        reader = gen_xmlTextReaderPtr(n_reader, 0);
18421
18422        ret_val = xmlTextReaderIsDefault(reader);
18423        desret_int(ret_val);
18424        call_tests++;
18425        des_xmlTextReaderPtr(n_reader, reader, 0);
18426        xmlResetLastError();
18427        if (mem_base != xmlMemBlocks()) {
18428            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
18429	           xmlMemBlocks() - mem_base);
18430	    ret++;
18431            printf(" %d", n_reader);
18432            printf("\n");
18433        }
18434    }
18435#endif
18436
18437    function_tests++;
18438    return(ret);
18439}
18440
18441
18442static int
18443test_xmlTextReaderIsEmptyElement(void) {
18444    int ret = 0;
18445
18446#ifdef LIBXML_READER_ENABLED
18447    int mem_base;
18448    int ret_val;
18449    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18450    int n_reader;
18451
18452    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18453        mem_base = xmlMemBlocks();
18454        reader = gen_xmlTextReaderPtr(n_reader, 0);
18455
18456        ret_val = xmlTextReaderIsEmptyElement(reader);
18457        desret_int(ret_val);
18458        call_tests++;
18459        des_xmlTextReaderPtr(n_reader, reader, 0);
18460        xmlResetLastError();
18461        if (mem_base != xmlMemBlocks()) {
18462            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
18463	           xmlMemBlocks() - mem_base);
18464	    ret++;
18465            printf(" %d", n_reader);
18466            printf("\n");
18467        }
18468    }
18469#endif
18470
18471    function_tests++;
18472    return(ret);
18473}
18474
18475
18476static int
18477test_xmlTextReaderIsNamespaceDecl(void) {
18478    int ret = 0;
18479
18480#ifdef LIBXML_READER_ENABLED
18481    int mem_base;
18482    int ret_val;
18483    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18484    int n_reader;
18485
18486    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18487        mem_base = xmlMemBlocks();
18488        reader = gen_xmlTextReaderPtr(n_reader, 0);
18489
18490        ret_val = xmlTextReaderIsNamespaceDecl(reader);
18491        desret_int(ret_val);
18492        call_tests++;
18493        des_xmlTextReaderPtr(n_reader, reader, 0);
18494        xmlResetLastError();
18495        if (mem_base != xmlMemBlocks()) {
18496            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
18497	           xmlMemBlocks() - mem_base);
18498	    ret++;
18499            printf(" %d", n_reader);
18500            printf("\n");
18501        }
18502    }
18503#endif
18504
18505    function_tests++;
18506    return(ret);
18507}
18508
18509
18510static int
18511test_xmlTextReaderIsValid(void) {
18512    int ret = 0;
18513
18514#ifdef LIBXML_READER_ENABLED
18515    int mem_base;
18516    int ret_val;
18517    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18518    int n_reader;
18519
18520    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18521        mem_base = xmlMemBlocks();
18522        reader = gen_xmlTextReaderPtr(n_reader, 0);
18523
18524        ret_val = xmlTextReaderIsValid(reader);
18525        desret_int(ret_val);
18526        call_tests++;
18527        des_xmlTextReaderPtr(n_reader, reader, 0);
18528        xmlResetLastError();
18529        if (mem_base != xmlMemBlocks()) {
18530            printf("Leak of %d blocks found in xmlTextReaderIsValid",
18531	           xmlMemBlocks() - mem_base);
18532	    ret++;
18533            printf(" %d", n_reader);
18534            printf("\n");
18535        }
18536    }
18537#endif
18538
18539    function_tests++;
18540    return(ret);
18541}
18542
18543
18544static int
18545test_xmlTextReaderLocalName(void) {
18546    int ret = 0;
18547
18548#ifdef LIBXML_READER_ENABLED
18549    int mem_base;
18550    xmlChar * ret_val;
18551    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18552    int n_reader;
18553
18554    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18555        mem_base = xmlMemBlocks();
18556        reader = gen_xmlTextReaderPtr(n_reader, 0);
18557
18558        ret_val = xmlTextReaderLocalName(reader);
18559        desret_xmlChar_ptr(ret_val);
18560        call_tests++;
18561        des_xmlTextReaderPtr(n_reader, reader, 0);
18562        xmlResetLastError();
18563        if (mem_base != xmlMemBlocks()) {
18564            printf("Leak of %d blocks found in xmlTextReaderLocalName",
18565	           xmlMemBlocks() - mem_base);
18566	    ret++;
18567            printf(" %d", n_reader);
18568            printf("\n");
18569        }
18570    }
18571#endif
18572
18573    function_tests++;
18574    return(ret);
18575}
18576
18577
18578static int
18579test_xmlTextReaderLocatorBaseURI(void) {
18580    int ret = 0;
18581
18582
18583    /* missing type support */
18584    return(ret);
18585}
18586
18587
18588static int
18589test_xmlTextReaderLocatorLineNumber(void) {
18590    int ret = 0;
18591
18592
18593    /* missing type support */
18594    return(ret);
18595}
18596
18597
18598static int
18599test_xmlTextReaderLookupNamespace(void) {
18600    int ret = 0;
18601
18602#ifdef LIBXML_READER_ENABLED
18603    int mem_base;
18604    xmlChar * ret_val;
18605    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18606    int n_reader;
18607    const xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
18608    int n_prefix;
18609
18610    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18611    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18612        mem_base = xmlMemBlocks();
18613        reader = gen_xmlTextReaderPtr(n_reader, 0);
18614        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18615
18616        ret_val = xmlTextReaderLookupNamespace(reader, prefix);
18617        desret_xmlChar_ptr(ret_val);
18618        call_tests++;
18619        des_xmlTextReaderPtr(n_reader, reader, 0);
18620        des_const_xmlChar_ptr(n_prefix, prefix, 1);
18621        xmlResetLastError();
18622        if (mem_base != xmlMemBlocks()) {
18623            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
18624	           xmlMemBlocks() - mem_base);
18625	    ret++;
18626            printf(" %d", n_reader);
18627            printf(" %d", n_prefix);
18628            printf("\n");
18629        }
18630    }
18631    }
18632#endif
18633
18634    function_tests++;
18635    return(ret);
18636}
18637
18638
18639static int
18640test_xmlTextReaderMoveToAttribute(void) {
18641    int ret = 0;
18642
18643#ifdef LIBXML_READER_ENABLED
18644    int mem_base;
18645    int ret_val;
18646    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18647    int n_reader;
18648    const xmlChar * name; /* the qualified name of the attribute. */
18649    int n_name;
18650
18651    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18652    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
18653        mem_base = xmlMemBlocks();
18654        reader = gen_xmlTextReaderPtr(n_reader, 0);
18655        name = gen_const_xmlChar_ptr(n_name, 1);
18656
18657        ret_val = xmlTextReaderMoveToAttribute(reader, name);
18658        desret_int(ret_val);
18659        call_tests++;
18660        des_xmlTextReaderPtr(n_reader, reader, 0);
18661        des_const_xmlChar_ptr(n_name, name, 1);
18662        xmlResetLastError();
18663        if (mem_base != xmlMemBlocks()) {
18664            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
18665	           xmlMemBlocks() - mem_base);
18666	    ret++;
18667            printf(" %d", n_reader);
18668            printf(" %d", n_name);
18669            printf("\n");
18670        }
18671    }
18672    }
18673#endif
18674
18675    function_tests++;
18676    return(ret);
18677}
18678
18679
18680static int
18681test_xmlTextReaderMoveToAttributeNo(void) {
18682    int ret = 0;
18683
18684#ifdef LIBXML_READER_ENABLED
18685    int mem_base;
18686    int ret_val;
18687    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18688    int n_reader;
18689    int no; /* the zero-based index of the attribute relative to the containing element. */
18690    int n_no;
18691
18692    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18693    for (n_no = 0;n_no < gen_nb_int;n_no++) {
18694        mem_base = xmlMemBlocks();
18695        reader = gen_xmlTextReaderPtr(n_reader, 0);
18696        no = gen_int(n_no, 1);
18697
18698        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
18699        desret_int(ret_val);
18700        call_tests++;
18701        des_xmlTextReaderPtr(n_reader, reader, 0);
18702        des_int(n_no, no, 1);
18703        xmlResetLastError();
18704        if (mem_base != xmlMemBlocks()) {
18705            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
18706	           xmlMemBlocks() - mem_base);
18707	    ret++;
18708            printf(" %d", n_reader);
18709            printf(" %d", n_no);
18710            printf("\n");
18711        }
18712    }
18713    }
18714#endif
18715
18716    function_tests++;
18717    return(ret);
18718}
18719
18720
18721static int
18722test_xmlTextReaderMoveToAttributeNs(void) {
18723    int ret = 0;
18724
18725#ifdef LIBXML_READER_ENABLED
18726    int mem_base;
18727    int ret_val;
18728    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18729    int n_reader;
18730    const xmlChar * localName; /* the local name of the attribute. */
18731    int n_localName;
18732    const xmlChar * namespaceURI; /* the namespace URI of the attribute. */
18733    int n_namespaceURI;
18734
18735    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18736    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
18737    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
18738        mem_base = xmlMemBlocks();
18739        reader = gen_xmlTextReaderPtr(n_reader, 0);
18740        localName = gen_const_xmlChar_ptr(n_localName, 1);
18741        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
18742
18743        ret_val = xmlTextReaderMoveToAttributeNs(reader, localName, namespaceURI);
18744        desret_int(ret_val);
18745        call_tests++;
18746        des_xmlTextReaderPtr(n_reader, reader, 0);
18747        des_const_xmlChar_ptr(n_localName, localName, 1);
18748        des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 2);
18749        xmlResetLastError();
18750        if (mem_base != xmlMemBlocks()) {
18751            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
18752	           xmlMemBlocks() - mem_base);
18753	    ret++;
18754            printf(" %d", n_reader);
18755            printf(" %d", n_localName);
18756            printf(" %d", n_namespaceURI);
18757            printf("\n");
18758        }
18759    }
18760    }
18761    }
18762#endif
18763
18764    function_tests++;
18765    return(ret);
18766}
18767
18768
18769static int
18770test_xmlTextReaderMoveToElement(void) {
18771    int ret = 0;
18772
18773#ifdef LIBXML_READER_ENABLED
18774    int mem_base;
18775    int ret_val;
18776    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18777    int n_reader;
18778
18779    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18780        mem_base = xmlMemBlocks();
18781        reader = gen_xmlTextReaderPtr(n_reader, 0);
18782
18783        ret_val = xmlTextReaderMoveToElement(reader);
18784        desret_int(ret_val);
18785        call_tests++;
18786        des_xmlTextReaderPtr(n_reader, reader, 0);
18787        xmlResetLastError();
18788        if (mem_base != xmlMemBlocks()) {
18789            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
18790	           xmlMemBlocks() - mem_base);
18791	    ret++;
18792            printf(" %d", n_reader);
18793            printf("\n");
18794        }
18795    }
18796#endif
18797
18798    function_tests++;
18799    return(ret);
18800}
18801
18802
18803static int
18804test_xmlTextReaderMoveToFirstAttribute(void) {
18805    int ret = 0;
18806
18807#ifdef LIBXML_READER_ENABLED
18808    int mem_base;
18809    int ret_val;
18810    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18811    int n_reader;
18812
18813    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18814        mem_base = xmlMemBlocks();
18815        reader = gen_xmlTextReaderPtr(n_reader, 0);
18816
18817        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
18818        desret_int(ret_val);
18819        call_tests++;
18820        des_xmlTextReaderPtr(n_reader, reader, 0);
18821        xmlResetLastError();
18822        if (mem_base != xmlMemBlocks()) {
18823            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
18824	           xmlMemBlocks() - mem_base);
18825	    ret++;
18826            printf(" %d", n_reader);
18827            printf("\n");
18828        }
18829    }
18830#endif
18831
18832    function_tests++;
18833    return(ret);
18834}
18835
18836
18837static int
18838test_xmlTextReaderMoveToNextAttribute(void) {
18839    int ret = 0;
18840
18841#ifdef LIBXML_READER_ENABLED
18842    int mem_base;
18843    int ret_val;
18844    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18845    int n_reader;
18846
18847    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18848        mem_base = xmlMemBlocks();
18849        reader = gen_xmlTextReaderPtr(n_reader, 0);
18850
18851        ret_val = xmlTextReaderMoveToNextAttribute(reader);
18852        desret_int(ret_val);
18853        call_tests++;
18854        des_xmlTextReaderPtr(n_reader, reader, 0);
18855        xmlResetLastError();
18856        if (mem_base != xmlMemBlocks()) {
18857            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
18858	           xmlMemBlocks() - mem_base);
18859	    ret++;
18860            printf(" %d", n_reader);
18861            printf("\n");
18862        }
18863    }
18864#endif
18865
18866    function_tests++;
18867    return(ret);
18868}
18869
18870
18871static int
18872test_xmlTextReaderName(void) {
18873    int ret = 0;
18874
18875#ifdef LIBXML_READER_ENABLED
18876    int mem_base;
18877    xmlChar * ret_val;
18878    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18879    int n_reader;
18880
18881    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18882        mem_base = xmlMemBlocks();
18883        reader = gen_xmlTextReaderPtr(n_reader, 0);
18884
18885        ret_val = xmlTextReaderName(reader);
18886        desret_xmlChar_ptr(ret_val);
18887        call_tests++;
18888        des_xmlTextReaderPtr(n_reader, reader, 0);
18889        xmlResetLastError();
18890        if (mem_base != xmlMemBlocks()) {
18891            printf("Leak of %d blocks found in xmlTextReaderName",
18892	           xmlMemBlocks() - mem_base);
18893	    ret++;
18894            printf(" %d", n_reader);
18895            printf("\n");
18896        }
18897    }
18898#endif
18899
18900    function_tests++;
18901    return(ret);
18902}
18903
18904
18905static int
18906test_xmlTextReaderNamespaceUri(void) {
18907    int ret = 0;
18908
18909#ifdef LIBXML_READER_ENABLED
18910    int mem_base;
18911    xmlChar * ret_val;
18912    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18913    int n_reader;
18914
18915    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18916        mem_base = xmlMemBlocks();
18917        reader = gen_xmlTextReaderPtr(n_reader, 0);
18918
18919        ret_val = xmlTextReaderNamespaceUri(reader);
18920        desret_xmlChar_ptr(ret_val);
18921        call_tests++;
18922        des_xmlTextReaderPtr(n_reader, reader, 0);
18923        xmlResetLastError();
18924        if (mem_base != xmlMemBlocks()) {
18925            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
18926	           xmlMemBlocks() - mem_base);
18927	    ret++;
18928            printf(" %d", n_reader);
18929            printf("\n");
18930        }
18931    }
18932#endif
18933
18934    function_tests++;
18935    return(ret);
18936}
18937
18938
18939static int
18940test_xmlTextReaderNext(void) {
18941    int ret = 0;
18942
18943#ifdef LIBXML_READER_ENABLED
18944    int mem_base;
18945    int ret_val;
18946    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18947    int n_reader;
18948
18949    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18950        mem_base = xmlMemBlocks();
18951        reader = gen_xmlTextReaderPtr(n_reader, 0);
18952
18953        ret_val = xmlTextReaderNext(reader);
18954        desret_int(ret_val);
18955        call_tests++;
18956        des_xmlTextReaderPtr(n_reader, reader, 0);
18957        xmlResetLastError();
18958        if (mem_base != xmlMemBlocks()) {
18959            printf("Leak of %d blocks found in xmlTextReaderNext",
18960	           xmlMemBlocks() - mem_base);
18961	    ret++;
18962            printf(" %d", n_reader);
18963            printf("\n");
18964        }
18965    }
18966#endif
18967
18968    function_tests++;
18969    return(ret);
18970}
18971
18972
18973static int
18974test_xmlTextReaderNextSibling(void) {
18975    int ret = 0;
18976
18977#ifdef LIBXML_READER_ENABLED
18978    int mem_base;
18979    int ret_val;
18980    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
18981    int n_reader;
18982
18983    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
18984        mem_base = xmlMemBlocks();
18985        reader = gen_xmlTextReaderPtr(n_reader, 0);
18986
18987        ret_val = xmlTextReaderNextSibling(reader);
18988        desret_int(ret_val);
18989        call_tests++;
18990        des_xmlTextReaderPtr(n_reader, reader, 0);
18991        xmlResetLastError();
18992        if (mem_base != xmlMemBlocks()) {
18993            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
18994	           xmlMemBlocks() - mem_base);
18995	    ret++;
18996            printf(" %d", n_reader);
18997            printf("\n");
18998        }
18999    }
19000#endif
19001
19002    function_tests++;
19003    return(ret);
19004}
19005
19006
19007static int
19008test_xmlTextReaderNodeType(void) {
19009    int ret = 0;
19010
19011#ifdef LIBXML_READER_ENABLED
19012    int mem_base;
19013    int ret_val;
19014    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19015    int n_reader;
19016
19017    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19018        mem_base = xmlMemBlocks();
19019        reader = gen_xmlTextReaderPtr(n_reader, 0);
19020
19021        ret_val = xmlTextReaderNodeType(reader);
19022        desret_int(ret_val);
19023        call_tests++;
19024        des_xmlTextReaderPtr(n_reader, reader, 0);
19025        xmlResetLastError();
19026        if (mem_base != xmlMemBlocks()) {
19027            printf("Leak of %d blocks found in xmlTextReaderNodeType",
19028	           xmlMemBlocks() - mem_base);
19029	    ret++;
19030            printf(" %d", n_reader);
19031            printf("\n");
19032        }
19033    }
19034#endif
19035
19036    function_tests++;
19037    return(ret);
19038}
19039
19040
19041static int
19042test_xmlTextReaderNormalization(void) {
19043    int ret = 0;
19044
19045#ifdef LIBXML_READER_ENABLED
19046    int mem_base;
19047    int ret_val;
19048    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19049    int n_reader;
19050
19051    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19052        mem_base = xmlMemBlocks();
19053        reader = gen_xmlTextReaderPtr(n_reader, 0);
19054
19055        ret_val = xmlTextReaderNormalization(reader);
19056        desret_int(ret_val);
19057        call_tests++;
19058        des_xmlTextReaderPtr(n_reader, reader, 0);
19059        xmlResetLastError();
19060        if (mem_base != xmlMemBlocks()) {
19061            printf("Leak of %d blocks found in xmlTextReaderNormalization",
19062	           xmlMemBlocks() - mem_base);
19063	    ret++;
19064            printf(" %d", n_reader);
19065            printf("\n");
19066        }
19067    }
19068#endif
19069
19070    function_tests++;
19071    return(ret);
19072}
19073
19074
19075static int
19076test_xmlTextReaderPrefix(void) {
19077    int ret = 0;
19078
19079#ifdef LIBXML_READER_ENABLED
19080    int mem_base;
19081    xmlChar * ret_val;
19082    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19083    int n_reader;
19084
19085    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19086        mem_base = xmlMemBlocks();
19087        reader = gen_xmlTextReaderPtr(n_reader, 0);
19088
19089        ret_val = xmlTextReaderPrefix(reader);
19090        desret_xmlChar_ptr(ret_val);
19091        call_tests++;
19092        des_xmlTextReaderPtr(n_reader, reader, 0);
19093        xmlResetLastError();
19094        if (mem_base != xmlMemBlocks()) {
19095            printf("Leak of %d blocks found in xmlTextReaderPrefix",
19096	           xmlMemBlocks() - mem_base);
19097	    ret++;
19098            printf(" %d", n_reader);
19099            printf("\n");
19100        }
19101    }
19102#endif
19103
19104    function_tests++;
19105    return(ret);
19106}
19107
19108
19109static int
19110test_xmlTextReaderPreserve(void) {
19111    int ret = 0;
19112
19113#ifdef LIBXML_READER_ENABLED
19114    int mem_base;
19115    xmlNodePtr ret_val;
19116    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19117    int n_reader;
19118
19119    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19120        mem_base = xmlMemBlocks();
19121        reader = gen_xmlTextReaderPtr(n_reader, 0);
19122
19123        ret_val = xmlTextReaderPreserve(reader);
19124        desret_xmlNodePtr(ret_val);
19125        call_tests++;
19126        des_xmlTextReaderPtr(n_reader, reader, 0);
19127        xmlResetLastError();
19128        if (mem_base != xmlMemBlocks()) {
19129            printf("Leak of %d blocks found in xmlTextReaderPreserve",
19130	           xmlMemBlocks() - mem_base);
19131	    ret++;
19132            printf(" %d", n_reader);
19133            printf("\n");
19134        }
19135    }
19136#endif
19137
19138    function_tests++;
19139    return(ret);
19140}
19141
19142
19143static int
19144test_xmlTextReaderPreservePattern(void) {
19145    int ret = 0;
19146
19147
19148    /* missing type support */
19149    return(ret);
19150}
19151
19152
19153static int
19154test_xmlTextReaderQuoteChar(void) {
19155    int ret = 0;
19156
19157#ifdef LIBXML_READER_ENABLED
19158    int mem_base;
19159    int ret_val;
19160    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19161    int n_reader;
19162
19163    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19164        mem_base = xmlMemBlocks();
19165        reader = gen_xmlTextReaderPtr(n_reader, 0);
19166
19167        ret_val = xmlTextReaderQuoteChar(reader);
19168        desret_int(ret_val);
19169        call_tests++;
19170        des_xmlTextReaderPtr(n_reader, reader, 0);
19171        xmlResetLastError();
19172        if (mem_base != xmlMemBlocks()) {
19173            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
19174	           xmlMemBlocks() - mem_base);
19175	    ret++;
19176            printf(" %d", n_reader);
19177            printf("\n");
19178        }
19179    }
19180#endif
19181
19182    function_tests++;
19183    return(ret);
19184}
19185
19186
19187static int
19188test_xmlTextReaderRead(void) {
19189    int ret = 0;
19190
19191#ifdef LIBXML_READER_ENABLED
19192    int mem_base;
19193    int ret_val;
19194    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19195    int n_reader;
19196
19197    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19198        mem_base = xmlMemBlocks();
19199        reader = gen_xmlTextReaderPtr(n_reader, 0);
19200
19201        ret_val = xmlTextReaderRead(reader);
19202        desret_int(ret_val);
19203        call_tests++;
19204        des_xmlTextReaderPtr(n_reader, reader, 0);
19205        xmlResetLastError();
19206        if (mem_base != xmlMemBlocks()) {
19207            printf("Leak of %d blocks found in xmlTextReaderRead",
19208	           xmlMemBlocks() - mem_base);
19209	    ret++;
19210            printf(" %d", n_reader);
19211            printf("\n");
19212        }
19213    }
19214#endif
19215
19216    function_tests++;
19217    return(ret);
19218}
19219
19220
19221static int
19222test_xmlTextReaderReadAttributeValue(void) {
19223    int ret = 0;
19224
19225#ifdef LIBXML_READER_ENABLED
19226    int mem_base;
19227    int ret_val;
19228    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19229    int n_reader;
19230
19231    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19232        mem_base = xmlMemBlocks();
19233        reader = gen_xmlTextReaderPtr(n_reader, 0);
19234
19235        ret_val = xmlTextReaderReadAttributeValue(reader);
19236        desret_int(ret_val);
19237        call_tests++;
19238        des_xmlTextReaderPtr(n_reader, reader, 0);
19239        xmlResetLastError();
19240        if (mem_base != xmlMemBlocks()) {
19241            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
19242	           xmlMemBlocks() - mem_base);
19243	    ret++;
19244            printf(" %d", n_reader);
19245            printf("\n");
19246        }
19247    }
19248#endif
19249
19250    function_tests++;
19251    return(ret);
19252}
19253
19254
19255static int
19256test_xmlTextReaderReadState(void) {
19257    int ret = 0;
19258
19259#ifdef LIBXML_READER_ENABLED
19260    int mem_base;
19261    int ret_val;
19262    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19263    int n_reader;
19264
19265    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19266        mem_base = xmlMemBlocks();
19267        reader = gen_xmlTextReaderPtr(n_reader, 0);
19268
19269        ret_val = xmlTextReaderReadState(reader);
19270        desret_int(ret_val);
19271        call_tests++;
19272        des_xmlTextReaderPtr(n_reader, reader, 0);
19273        xmlResetLastError();
19274        if (mem_base != xmlMemBlocks()) {
19275            printf("Leak of %d blocks found in xmlTextReaderReadState",
19276	           xmlMemBlocks() - mem_base);
19277	    ret++;
19278            printf(" %d", n_reader);
19279            printf("\n");
19280        }
19281    }
19282#endif
19283
19284    function_tests++;
19285    return(ret);
19286}
19287
19288
19289static int
19290test_xmlTextReaderRelaxNGSetSchema(void) {
19291    int ret = 0;
19292
19293
19294    /* missing type support */
19295    return(ret);
19296}
19297
19298
19299static int
19300test_xmlTextReaderRelaxNGValidate(void) {
19301    int ret = 0;
19302
19303#ifdef LIBXML_READER_ENABLED
19304#ifdef LIBXML_SCHEMAS_ENABLED
19305    int mem_base;
19306    int ret_val;
19307    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19308    int n_reader;
19309    const char * rng; /* the path to a RelaxNG schema or NULL */
19310    int n_rng;
19311
19312    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19313    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
19314        mem_base = xmlMemBlocks();
19315        reader = gen_xmlTextReaderPtr(n_reader, 0);
19316        rng = gen_const_char_ptr(n_rng, 1);
19317
19318        ret_val = xmlTextReaderRelaxNGValidate(reader, rng);
19319        desret_int(ret_val);
19320        call_tests++;
19321        des_xmlTextReaderPtr(n_reader, reader, 0);
19322        des_const_char_ptr(n_rng, rng, 1);
19323        xmlResetLastError();
19324        if (mem_base != xmlMemBlocks()) {
19325            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
19326	           xmlMemBlocks() - mem_base);
19327	    ret++;
19328            printf(" %d", n_reader);
19329            printf(" %d", n_rng);
19330            printf("\n");
19331        }
19332    }
19333    }
19334#endif
19335#endif
19336
19337    function_tests++;
19338    return(ret);
19339}
19340
19341
19342static int
19343test_xmlTextReaderSetErrorHandler(void) {
19344    int ret = 0;
19345
19346
19347    /* missing type support */
19348    return(ret);
19349}
19350
19351
19352static int
19353test_xmlTextReaderSetParserProp(void) {
19354    int ret = 0;
19355
19356#ifdef LIBXML_READER_ENABLED
19357    int mem_base;
19358    int ret_val;
19359    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19360    int n_reader;
19361    int prop; /* the xmlParserProperties to set */
19362    int n_prop;
19363    int value; /* usually 0 or 1 to (de)activate it */
19364    int n_value;
19365
19366    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19367    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
19368    for (n_value = 0;n_value < gen_nb_int;n_value++) {
19369        mem_base = xmlMemBlocks();
19370        reader = gen_xmlTextReaderPtr(n_reader, 0);
19371        prop = gen_int(n_prop, 1);
19372        value = gen_int(n_value, 2);
19373
19374        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
19375        desret_int(ret_val);
19376        call_tests++;
19377        des_xmlTextReaderPtr(n_reader, reader, 0);
19378        des_int(n_prop, prop, 1);
19379        des_int(n_value, value, 2);
19380        xmlResetLastError();
19381        if (mem_base != xmlMemBlocks()) {
19382            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
19383	           xmlMemBlocks() - mem_base);
19384	    ret++;
19385            printf(" %d", n_reader);
19386            printf(" %d", n_prop);
19387            printf(" %d", n_value);
19388            printf("\n");
19389        }
19390    }
19391    }
19392    }
19393#endif
19394
19395    function_tests++;
19396    return(ret);
19397}
19398
19399
19400static int
19401test_xmlTextReaderSetStructuredErrorHandler(void) {
19402    int ret = 0;
19403
19404
19405    /* missing type support */
19406    return(ret);
19407}
19408
19409
19410static int
19411test_xmlTextReaderStandalone(void) {
19412    int ret = 0;
19413
19414#ifdef LIBXML_READER_ENABLED
19415    int mem_base;
19416    int ret_val;
19417    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19418    int n_reader;
19419
19420    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19421        mem_base = xmlMemBlocks();
19422        reader = gen_xmlTextReaderPtr(n_reader, 0);
19423
19424        ret_val = xmlTextReaderStandalone(reader);
19425        desret_int(ret_val);
19426        call_tests++;
19427        des_xmlTextReaderPtr(n_reader, reader, 0);
19428        xmlResetLastError();
19429        if (mem_base != xmlMemBlocks()) {
19430            printf("Leak of %d blocks found in xmlTextReaderStandalone",
19431	           xmlMemBlocks() - mem_base);
19432	    ret++;
19433            printf(" %d", n_reader);
19434            printf("\n");
19435        }
19436    }
19437#endif
19438
19439    function_tests++;
19440    return(ret);
19441}
19442
19443
19444static int
19445test_xmlTextReaderValue(void) {
19446    int ret = 0;
19447
19448#ifdef LIBXML_READER_ENABLED
19449    int mem_base;
19450    xmlChar * ret_val;
19451    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19452    int n_reader;
19453
19454    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19455        mem_base = xmlMemBlocks();
19456        reader = gen_xmlTextReaderPtr(n_reader, 0);
19457
19458        ret_val = xmlTextReaderValue(reader);
19459        desret_xmlChar_ptr(ret_val);
19460        call_tests++;
19461        des_xmlTextReaderPtr(n_reader, reader, 0);
19462        xmlResetLastError();
19463        if (mem_base != xmlMemBlocks()) {
19464            printf("Leak of %d blocks found in xmlTextReaderValue",
19465	           xmlMemBlocks() - mem_base);
19466	    ret++;
19467            printf(" %d", n_reader);
19468            printf("\n");
19469        }
19470    }
19471#endif
19472
19473    function_tests++;
19474    return(ret);
19475}
19476
19477
19478static int
19479test_xmlTextReaderXmlLang(void) {
19480    int ret = 0;
19481
19482#ifdef LIBXML_READER_ENABLED
19483    int mem_base;
19484    xmlChar * ret_val;
19485    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
19486    int n_reader;
19487
19488    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
19489        mem_base = xmlMemBlocks();
19490        reader = gen_xmlTextReaderPtr(n_reader, 0);
19491
19492        ret_val = xmlTextReaderXmlLang(reader);
19493        desret_xmlChar_ptr(ret_val);
19494        call_tests++;
19495        des_xmlTextReaderPtr(n_reader, reader, 0);
19496        xmlResetLastError();
19497        if (mem_base != xmlMemBlocks()) {
19498            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
19499	           xmlMemBlocks() - mem_base);
19500	    ret++;
19501            printf(" %d", n_reader);
19502            printf("\n");
19503        }
19504    }
19505#endif
19506
19507    function_tests++;
19508    return(ret);
19509}
19510
19511static int
19512test_xmlreader(void) {
19513    int ret = 0;
19514
19515    printf("Testing xmlreader : 62 of 78 functions ...\n");
19516    ret += test_xmlNewTextReader();
19517    ret += test_xmlNewTextReaderFilename();
19518    ret += test_xmlReaderForDoc();
19519    ret += test_xmlReaderForFile();
19520    ret += test_xmlReaderForIO();
19521    ret += test_xmlReaderForMemory();
19522    ret += test_xmlReaderNewDoc();
19523    ret += test_xmlReaderNewFile();
19524    ret += test_xmlReaderNewMemory();
19525    ret += test_xmlReaderNewWalker();
19526    ret += test_xmlReaderWalker();
19527    ret += test_xmlTextReaderAttributeCount();
19528    ret += test_xmlTextReaderBaseUri();
19529    ret += test_xmlTextReaderClose();
19530    ret += test_xmlTextReaderConstBaseUri();
19531    ret += test_xmlTextReaderConstEncoding();
19532    ret += test_xmlTextReaderConstLocalName();
19533    ret += test_xmlTextReaderConstName();
19534    ret += test_xmlTextReaderConstNamespaceUri();
19535    ret += test_xmlTextReaderConstPrefix();
19536    ret += test_xmlTextReaderConstString();
19537    ret += test_xmlTextReaderConstValue();
19538    ret += test_xmlTextReaderConstXmlLang();
19539    ret += test_xmlTextReaderConstXmlVersion();
19540    ret += test_xmlTextReaderCurrentDoc();
19541    ret += test_xmlTextReaderCurrentNode();
19542    ret += test_xmlTextReaderDepth();
19543    ret += test_xmlTextReaderExpand();
19544    ret += test_xmlTextReaderGetAttribute();
19545    ret += test_xmlTextReaderGetAttributeNo();
19546    ret += test_xmlTextReaderGetAttributeNs();
19547    ret += test_xmlTextReaderGetErrorHandler();
19548    ret += test_xmlTextReaderGetParserProp();
19549    ret += test_xmlTextReaderGetRemainder();
19550    ret += test_xmlTextReaderHasAttributes();
19551    ret += test_xmlTextReaderHasValue();
19552    ret += test_xmlTextReaderIsDefault();
19553    ret += test_xmlTextReaderIsEmptyElement();
19554    ret += test_xmlTextReaderIsNamespaceDecl();
19555    ret += test_xmlTextReaderIsValid();
19556    ret += test_xmlTextReaderLocalName();
19557    ret += test_xmlTextReaderLocatorBaseURI();
19558    ret += test_xmlTextReaderLocatorLineNumber();
19559    ret += test_xmlTextReaderLookupNamespace();
19560    ret += test_xmlTextReaderMoveToAttribute();
19561    ret += test_xmlTextReaderMoveToAttributeNo();
19562    ret += test_xmlTextReaderMoveToAttributeNs();
19563    ret += test_xmlTextReaderMoveToElement();
19564    ret += test_xmlTextReaderMoveToFirstAttribute();
19565    ret += test_xmlTextReaderMoveToNextAttribute();
19566    ret += test_xmlTextReaderName();
19567    ret += test_xmlTextReaderNamespaceUri();
19568    ret += test_xmlTextReaderNext();
19569    ret += test_xmlTextReaderNextSibling();
19570    ret += test_xmlTextReaderNodeType();
19571    ret += test_xmlTextReaderNormalization();
19572    ret += test_xmlTextReaderPrefix();
19573    ret += test_xmlTextReaderPreserve();
19574    ret += test_xmlTextReaderPreservePattern();
19575    ret += test_xmlTextReaderQuoteChar();
19576    ret += test_xmlTextReaderRead();
19577    ret += test_xmlTextReaderReadAttributeValue();
19578    ret += test_xmlTextReaderReadState();
19579    ret += test_xmlTextReaderRelaxNGSetSchema();
19580    ret += test_xmlTextReaderRelaxNGValidate();
19581    ret += test_xmlTextReaderSetErrorHandler();
19582    ret += test_xmlTextReaderSetParserProp();
19583    ret += test_xmlTextReaderSetStructuredErrorHandler();
19584    ret += test_xmlTextReaderStandalone();
19585    ret += test_xmlTextReaderValue();
19586    ret += test_xmlTextReaderXmlLang();
19587
19588    if (ret != 0)
19589	printf("Module xmlreader: %d errors\n", ret);
19590    return(ret);
19591}
19592
19593static int
19594test_xmlSaveClose(void) {
19595    int ret = 0;
19596
19597
19598    /* missing type support */
19599    return(ret);
19600}
19601
19602
19603static int
19604test_xmlSaveDoc(void) {
19605    int ret = 0;
19606
19607
19608    /* missing type support */
19609    return(ret);
19610}
19611
19612
19613static int
19614test_xmlSaveFlush(void) {
19615    int ret = 0;
19616
19617
19618    /* missing type support */
19619    return(ret);
19620}
19621
19622
19623static int
19624test_xmlSaveSetAttrEscape(void) {
19625    int ret = 0;
19626
19627
19628    /* missing type support */
19629    return(ret);
19630}
19631
19632
19633static int
19634test_xmlSaveSetEscape(void) {
19635    int ret = 0;
19636
19637
19638    /* missing type support */
19639    return(ret);
19640}
19641
19642
19643static int
19644test_xmlSaveToFd(void) {
19645    int ret = 0;
19646
19647
19648    /* missing type support */
19649    return(ret);
19650}
19651
19652
19653static int
19654test_xmlSaveToFilename(void) {
19655    int ret = 0;
19656
19657
19658    /* missing type support */
19659    return(ret);
19660}
19661
19662
19663static int
19664test_xmlSaveToIO(void) {
19665    int ret = 0;
19666
19667
19668    /* missing type support */
19669    return(ret);
19670}
19671
19672
19673static int
19674test_xmlSaveTree(void) {
19675    int ret = 0;
19676
19677
19678    /* missing type support */
19679    return(ret);
19680}
19681
19682static int
19683test_xmlsave(void) {
19684    int ret = 0;
19685
19686    printf("Testing xmlsave : 0 of 9 functions ...\n");
19687    ret += test_xmlSaveClose();
19688    ret += test_xmlSaveDoc();
19689    ret += test_xmlSaveFlush();
19690    ret += test_xmlSaveSetAttrEscape();
19691    ret += test_xmlSaveSetEscape();
19692    ret += test_xmlSaveToFd();
19693    ret += test_xmlSaveToFilename();
19694    ret += test_xmlSaveToIO();
19695    ret += test_xmlSaveTree();
19696
19697    if (ret != 0)
19698	printf("Module xmlsave: %d errors\n", ret);
19699    return(ret);
19700}
19701
19702static int
19703test_xmlSchemaDump(void) {
19704    int ret = 0;
19705
19706
19707    /* missing type support */
19708    return(ret);
19709}
19710
19711
19712static int
19713test_xmlSchemaGetParserErrors(void) {
19714    int ret = 0;
19715
19716
19717    /* missing type support */
19718    return(ret);
19719}
19720
19721
19722static int
19723test_xmlSchemaGetValidErrors(void) {
19724    int ret = 0;
19725
19726
19727    /* missing type support */
19728    return(ret);
19729}
19730
19731
19732static int
19733test_xmlSchemaNewDocParserCtxt(void) {
19734    int ret = 0;
19735
19736
19737    /* missing type support */
19738    return(ret);
19739}
19740
19741
19742static int
19743test_xmlSchemaNewMemParserCtxt(void) {
19744    int ret = 0;
19745
19746
19747    /* missing type support */
19748    return(ret);
19749}
19750
19751
19752static int
19753test_xmlSchemaNewParserCtxt(void) {
19754    int ret = 0;
19755
19756
19757    /* missing type support */
19758    return(ret);
19759}
19760
19761
19762static int
19763test_xmlSchemaNewValidCtxt(void) {
19764    int ret = 0;
19765
19766
19767    /* missing type support */
19768    return(ret);
19769}
19770
19771
19772static int
19773test_xmlSchemaParse(void) {
19774    int ret = 0;
19775
19776
19777    /* missing type support */
19778    return(ret);
19779}
19780
19781
19782static int
19783test_xmlSchemaSetParserErrors(void) {
19784    int ret = 0;
19785
19786
19787    /* missing type support */
19788    return(ret);
19789}
19790
19791
19792static int
19793test_xmlSchemaSetValidErrors(void) {
19794    int ret = 0;
19795
19796
19797    /* missing type support */
19798    return(ret);
19799}
19800
19801
19802static int
19803test_xmlSchemaSetValidOptions(void) {
19804    int ret = 0;
19805
19806
19807    /* missing type support */
19808    return(ret);
19809}
19810
19811
19812static int
19813test_xmlSchemaValidCtxtGetOptions(void) {
19814    int ret = 0;
19815
19816
19817    /* missing type support */
19818    return(ret);
19819}
19820
19821
19822static int
19823test_xmlSchemaValidateDoc(void) {
19824    int ret = 0;
19825
19826
19827    /* missing type support */
19828    return(ret);
19829}
19830
19831
19832static int
19833test_xmlSchemaValidateOneElement(void) {
19834    int ret = 0;
19835
19836
19837    /* missing type support */
19838    return(ret);
19839}
19840
19841
19842static int
19843test_xmlSchemaValidateStream(void) {
19844    int ret = 0;
19845
19846
19847    /* missing type support */
19848    return(ret);
19849}
19850
19851static int
19852test_xmlschemas(void) {
19853    int ret = 0;
19854
19855    printf("Testing xmlschemas : 0 of 18 functions ...\n");
19856    ret += test_xmlSchemaDump();
19857    ret += test_xmlSchemaGetParserErrors();
19858    ret += test_xmlSchemaGetValidErrors();
19859    ret += test_xmlSchemaNewDocParserCtxt();
19860    ret += test_xmlSchemaNewMemParserCtxt();
19861    ret += test_xmlSchemaNewParserCtxt();
19862    ret += test_xmlSchemaNewValidCtxt();
19863    ret += test_xmlSchemaParse();
19864    ret += test_xmlSchemaSetParserErrors();
19865    ret += test_xmlSchemaSetValidErrors();
19866    ret += test_xmlSchemaSetValidOptions();
19867    ret += test_xmlSchemaValidCtxtGetOptions();
19868    ret += test_xmlSchemaValidateDoc();
19869    ret += test_xmlSchemaValidateOneElement();
19870    ret += test_xmlSchemaValidateStream();
19871
19872    if (ret != 0)
19873	printf("Module xmlschemas: %d errors\n", ret);
19874    return(ret);
19875}
19876
19877static int
19878test_xmlSchemaCheckFacet(void) {
19879    int ret = 0;
19880
19881
19882    /* missing type support */
19883    return(ret);
19884}
19885
19886
19887static int
19888test_xmlSchemaCleanupTypes(void) {
19889    int ret = 0;
19890
19891#ifdef LIBXML_SCHEMAS_ENABLED
19892    int mem_base;
19893
19894        mem_base = xmlMemBlocks();
19895
19896        xmlSchemaCleanupTypes();
19897        call_tests++;
19898        xmlResetLastError();
19899        if (mem_base != xmlMemBlocks()) {
19900            printf("Leak of %d blocks found in xmlSchemaCleanupTypes",
19901	           xmlMemBlocks() - mem_base);
19902	    ret++;
19903            printf("\n");
19904        }
19905#endif
19906
19907    function_tests++;
19908    return(ret);
19909}
19910
19911
19912static int
19913test_xmlSchemaCollapseString(void) {
19914    int ret = 0;
19915
19916#ifdef LIBXML_SCHEMAS_ENABLED
19917    int mem_base;
19918    xmlChar * ret_val;
19919    const xmlChar * value; /* a value */
19920    int n_value;
19921
19922    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
19923        mem_base = xmlMemBlocks();
19924        value = gen_const_xmlChar_ptr(n_value, 0);
19925
19926        ret_val = xmlSchemaCollapseString(value);
19927        desret_xmlChar_ptr(ret_val);
19928        call_tests++;
19929        des_const_xmlChar_ptr(n_value, value, 0);
19930        xmlResetLastError();
19931        if (mem_base != xmlMemBlocks()) {
19932            printf("Leak of %d blocks found in xmlSchemaCollapseString",
19933	           xmlMemBlocks() - mem_base);
19934	    ret++;
19935            printf(" %d", n_value);
19936            printf("\n");
19937        }
19938    }
19939#endif
19940
19941    function_tests++;
19942    return(ret);
19943}
19944
19945
19946static int
19947test_xmlSchemaCompareValues(void) {
19948    int ret = 0;
19949
19950
19951    /* missing type support */
19952    return(ret);
19953}
19954
19955
19956static int
19957test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
19958    int ret = 0;
19959
19960
19961    /* missing type support */
19962    return(ret);
19963}
19964
19965
19966static int
19967test_xmlSchemaGetBuiltInType(void) {
19968    int ret = 0;
19969
19970
19971    /* missing type support */
19972    return(ret);
19973}
19974
19975
19976static int
19977test_xmlSchemaGetFacetValueAsULong(void) {
19978    int ret = 0;
19979
19980
19981    /* missing type support */
19982    return(ret);
19983}
19984
19985
19986static int
19987test_xmlSchemaGetPredefinedType(void) {
19988    int ret = 0;
19989
19990
19991    /* missing type support */
19992    return(ret);
19993}
19994
19995
19996static int
19997test_xmlSchemaInitTypes(void) {
19998    int ret = 0;
19999
20000#ifdef LIBXML_SCHEMAS_ENABLED
20001
20002
20003        xmlSchemaInitTypes();
20004        call_tests++;
20005        xmlResetLastError();
20006#endif
20007
20008    function_tests++;
20009    return(ret);
20010}
20011
20012
20013static int
20014test_xmlSchemaIsBuiltInTypeFacet(void) {
20015    int ret = 0;
20016
20017
20018    /* missing type support */
20019    return(ret);
20020}
20021
20022
20023static int
20024test_xmlSchemaNewFacet(void) {
20025    int ret = 0;
20026
20027
20028    /* missing type support */
20029    return(ret);
20030}
20031
20032
20033static int
20034test_xmlSchemaValPredefTypeNode(void) {
20035    int ret = 0;
20036
20037
20038    /* missing type support */
20039    return(ret);
20040}
20041
20042
20043static int
20044test_xmlSchemaValPredefTypeNodeNoNorm(void) {
20045    int ret = 0;
20046
20047
20048    /* missing type support */
20049    return(ret);
20050}
20051
20052
20053static int
20054test_xmlSchemaValidateFacet(void) {
20055    int ret = 0;
20056
20057
20058    /* missing type support */
20059    return(ret);
20060}
20061
20062
20063static int
20064test_xmlSchemaValidateLengthFacet(void) {
20065    int ret = 0;
20066
20067
20068    /* missing type support */
20069    return(ret);
20070}
20071
20072
20073static int
20074test_xmlSchemaValidateListSimpleTypeFacet(void) {
20075    int ret = 0;
20076
20077
20078    /* missing type support */
20079    return(ret);
20080}
20081
20082
20083static int
20084test_xmlSchemaValidatePredefinedType(void) {
20085    int ret = 0;
20086
20087
20088    /* missing type support */
20089    return(ret);
20090}
20091
20092static int
20093test_xmlschemastypes(void) {
20094    int ret = 0;
20095
20096    printf("Testing xmlschemastypes : 3 of 19 functions ...\n");
20097    ret += test_xmlSchemaCheckFacet();
20098    ret += test_xmlSchemaCleanupTypes();
20099    ret += test_xmlSchemaCollapseString();
20100    ret += test_xmlSchemaCompareValues();
20101    ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
20102    ret += test_xmlSchemaGetBuiltInType();
20103    ret += test_xmlSchemaGetFacetValueAsULong();
20104    ret += test_xmlSchemaGetPredefinedType();
20105    ret += test_xmlSchemaInitTypes();
20106    ret += test_xmlSchemaIsBuiltInTypeFacet();
20107    ret += test_xmlSchemaNewFacet();
20108    ret += test_xmlSchemaValPredefTypeNode();
20109    ret += test_xmlSchemaValPredefTypeNodeNoNorm();
20110    ret += test_xmlSchemaValidateFacet();
20111    ret += test_xmlSchemaValidateLengthFacet();
20112    ret += test_xmlSchemaValidateListSimpleTypeFacet();
20113    ret += test_xmlSchemaValidatePredefinedType();
20114
20115    if (ret != 0)
20116	printf("Module xmlschemastypes: %d errors\n", ret);
20117    return(ret);
20118}
20119
20120static int
20121test_xmlCharStrdup(void) {
20122    int ret = 0;
20123
20124    int mem_base;
20125    xmlChar * ret_val;
20126    const char * cur; /* the input char * */
20127    int n_cur;
20128
20129    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
20130        mem_base = xmlMemBlocks();
20131        cur = gen_const_char_ptr(n_cur, 0);
20132
20133        ret_val = xmlCharStrdup(cur);
20134        desret_xmlChar_ptr(ret_val);
20135        call_tests++;
20136        des_const_char_ptr(n_cur, cur, 0);
20137        xmlResetLastError();
20138        if (mem_base != xmlMemBlocks()) {
20139            printf("Leak of %d blocks found in xmlCharStrdup",
20140	           xmlMemBlocks() - mem_base);
20141	    ret++;
20142            printf(" %d", n_cur);
20143            printf("\n");
20144        }
20145    }
20146
20147    function_tests++;
20148    return(ret);
20149}
20150
20151
20152static int
20153test_xmlCharStrndup(void) {
20154    int ret = 0;
20155
20156    int mem_base;
20157    xmlChar * ret_val;
20158    const char * cur; /* the input char * */
20159    int n_cur;
20160    int len; /* the len of @cur */
20161    int n_len;
20162
20163    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
20164    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20165        mem_base = xmlMemBlocks();
20166        cur = gen_const_char_ptr(n_cur, 0);
20167        len = gen_int(n_len, 1);
20168
20169        ret_val = xmlCharStrndup(cur, len);
20170        desret_xmlChar_ptr(ret_val);
20171        call_tests++;
20172        des_const_char_ptr(n_cur, cur, 0);
20173        des_int(n_len, len, 1);
20174        xmlResetLastError();
20175        if (mem_base != xmlMemBlocks()) {
20176            printf("Leak of %d blocks found in xmlCharStrndup",
20177	           xmlMemBlocks() - mem_base);
20178	    ret++;
20179            printf(" %d", n_cur);
20180            printf(" %d", n_len);
20181            printf("\n");
20182        }
20183    }
20184    }
20185
20186    function_tests++;
20187    return(ret);
20188}
20189
20190
20191static int
20192test_xmlCheckUTF8(void) {
20193    int ret = 0;
20194
20195
20196    /* missing type support */
20197    return(ret);
20198}
20199
20200
20201static int
20202test_xmlGetUTF8Char(void) {
20203    int ret = 0;
20204
20205
20206    /* missing type support */
20207    return(ret);
20208}
20209
20210
20211static int
20212test_xmlStrEqual(void) {
20213    int ret = 0;
20214
20215    int mem_base;
20216    int ret_val;
20217    const xmlChar * str1; /* the first xmlChar * */
20218    int n_str1;
20219    const xmlChar * str2; /* the second xmlChar * */
20220    int n_str2;
20221
20222    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
20223    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
20224        mem_base = xmlMemBlocks();
20225        str1 = gen_const_xmlChar_ptr(n_str1, 0);
20226        str2 = gen_const_xmlChar_ptr(n_str2, 1);
20227
20228        ret_val = xmlStrEqual(str1, str2);
20229        desret_int(ret_val);
20230        call_tests++;
20231        des_const_xmlChar_ptr(n_str1, str1, 0);
20232        des_const_xmlChar_ptr(n_str2, str2, 1);
20233        xmlResetLastError();
20234        if (mem_base != xmlMemBlocks()) {
20235            printf("Leak of %d blocks found in xmlStrEqual",
20236	           xmlMemBlocks() - mem_base);
20237	    ret++;
20238            printf(" %d", n_str1);
20239            printf(" %d", n_str2);
20240            printf("\n");
20241        }
20242    }
20243    }
20244
20245    function_tests++;
20246    return(ret);
20247}
20248
20249
20250static int
20251test_xmlStrPrintf(void) {
20252    int ret = 0;
20253
20254
20255    /* missing type support */
20256    return(ret);
20257}
20258
20259
20260static int
20261test_xmlStrQEqual(void) {
20262    int ret = 0;
20263
20264    int mem_base;
20265    int ret_val;
20266    const xmlChar * pref; /* the prefix of the QName */
20267    int n_pref;
20268    const xmlChar * name; /* the localname of the QName */
20269    int n_name;
20270    const xmlChar * str; /* the second xmlChar * */
20271    int n_str;
20272
20273    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
20274    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20275    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
20276        mem_base = xmlMemBlocks();
20277        pref = gen_const_xmlChar_ptr(n_pref, 0);
20278        name = gen_const_xmlChar_ptr(n_name, 1);
20279        str = gen_const_xmlChar_ptr(n_str, 2);
20280
20281        ret_val = xmlStrQEqual(pref, name, str);
20282        desret_int(ret_val);
20283        call_tests++;
20284        des_const_xmlChar_ptr(n_pref, pref, 0);
20285        des_const_xmlChar_ptr(n_name, name, 1);
20286        des_const_xmlChar_ptr(n_str, str, 2);
20287        xmlResetLastError();
20288        if (mem_base != xmlMemBlocks()) {
20289            printf("Leak of %d blocks found in xmlStrQEqual",
20290	           xmlMemBlocks() - mem_base);
20291	    ret++;
20292            printf(" %d", n_pref);
20293            printf(" %d", n_name);
20294            printf(" %d", n_str);
20295            printf("\n");
20296        }
20297    }
20298    }
20299    }
20300
20301    function_tests++;
20302    return(ret);
20303}
20304
20305
20306static int
20307test_xmlStrVPrintf(void) {
20308    int ret = 0;
20309
20310
20311    /* missing type support */
20312    return(ret);
20313}
20314
20315
20316static int
20317test_xmlStrcasecmp(void) {
20318    int ret = 0;
20319
20320    int mem_base;
20321    int ret_val;
20322    const xmlChar * str1; /* the first xmlChar * */
20323    int n_str1;
20324    const xmlChar * str2; /* the second xmlChar * */
20325    int n_str2;
20326
20327    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
20328    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
20329        mem_base = xmlMemBlocks();
20330        str1 = gen_const_xmlChar_ptr(n_str1, 0);
20331        str2 = gen_const_xmlChar_ptr(n_str2, 1);
20332
20333        ret_val = xmlStrcasecmp(str1, str2);
20334        desret_int(ret_val);
20335        call_tests++;
20336        des_const_xmlChar_ptr(n_str1, str1, 0);
20337        des_const_xmlChar_ptr(n_str2, str2, 1);
20338        xmlResetLastError();
20339        if (mem_base != xmlMemBlocks()) {
20340            printf("Leak of %d blocks found in xmlStrcasecmp",
20341	           xmlMemBlocks() - mem_base);
20342	    ret++;
20343            printf(" %d", n_str1);
20344            printf(" %d", n_str2);
20345            printf("\n");
20346        }
20347    }
20348    }
20349
20350    function_tests++;
20351    return(ret);
20352}
20353
20354
20355static int
20356test_xmlStrcasestr(void) {
20357    int ret = 0;
20358
20359    int mem_base;
20360    const xmlChar * ret_val;
20361    const xmlChar * str; /* the xmlChar * array (haystack) */
20362    int n_str;
20363    xmlChar * val; /* the xmlChar to search (needle) */
20364    int n_val;
20365
20366    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
20367    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
20368        mem_base = xmlMemBlocks();
20369        str = gen_const_xmlChar_ptr(n_str, 0);
20370        val = gen_xmlChar_ptr(n_val, 1);
20371
20372        ret_val = xmlStrcasestr(str, val);
20373        desret_const_xmlChar_ptr(ret_val);
20374        call_tests++;
20375        des_const_xmlChar_ptr(n_str, str, 0);
20376        des_xmlChar_ptr(n_val, val, 1);
20377        xmlResetLastError();
20378        if (mem_base != xmlMemBlocks()) {
20379            printf("Leak of %d blocks found in xmlStrcasestr",
20380	           xmlMemBlocks() - mem_base);
20381	    ret++;
20382            printf(" %d", n_str);
20383            printf(" %d", n_val);
20384            printf("\n");
20385        }
20386    }
20387    }
20388
20389    function_tests++;
20390    return(ret);
20391}
20392
20393
20394static int
20395test_xmlStrchr(void) {
20396    int ret = 0;
20397
20398
20399    /* missing type support */
20400    return(ret);
20401}
20402
20403
20404static int
20405test_xmlStrcmp(void) {
20406    int ret = 0;
20407
20408    int mem_base;
20409    int ret_val;
20410    const xmlChar * str1; /* the first xmlChar * */
20411    int n_str1;
20412    const xmlChar * str2; /* the second xmlChar * */
20413    int n_str2;
20414
20415    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
20416    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
20417        mem_base = xmlMemBlocks();
20418        str1 = gen_const_xmlChar_ptr(n_str1, 0);
20419        str2 = gen_const_xmlChar_ptr(n_str2, 1);
20420
20421        ret_val = xmlStrcmp(str1, str2);
20422        desret_int(ret_val);
20423        call_tests++;
20424        des_const_xmlChar_ptr(n_str1, str1, 0);
20425        des_const_xmlChar_ptr(n_str2, str2, 1);
20426        xmlResetLastError();
20427        if (mem_base != xmlMemBlocks()) {
20428            printf("Leak of %d blocks found in xmlStrcmp",
20429	           xmlMemBlocks() - mem_base);
20430	    ret++;
20431            printf(" %d", n_str1);
20432            printf(" %d", n_str2);
20433            printf("\n");
20434        }
20435    }
20436    }
20437
20438    function_tests++;
20439    return(ret);
20440}
20441
20442
20443static int
20444test_xmlStrdup(void) {
20445    int ret = 0;
20446
20447    int mem_base;
20448    xmlChar * ret_val;
20449    const xmlChar * cur; /* the input xmlChar * */
20450    int n_cur;
20451
20452    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
20453        mem_base = xmlMemBlocks();
20454        cur = gen_const_xmlChar_ptr(n_cur, 0);
20455
20456        ret_val = xmlStrdup(cur);
20457        desret_xmlChar_ptr(ret_val);
20458        call_tests++;
20459        des_const_xmlChar_ptr(n_cur, cur, 0);
20460        xmlResetLastError();
20461        if (mem_base != xmlMemBlocks()) {
20462            printf("Leak of %d blocks found in xmlStrdup",
20463	           xmlMemBlocks() - mem_base);
20464	    ret++;
20465            printf(" %d", n_cur);
20466            printf("\n");
20467        }
20468    }
20469
20470    function_tests++;
20471    return(ret);
20472}
20473
20474
20475static int
20476test_xmlStrlen(void) {
20477    int ret = 0;
20478
20479    int mem_base;
20480    int ret_val;
20481    const xmlChar * str; /* the xmlChar * array */
20482    int n_str;
20483
20484    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
20485        mem_base = xmlMemBlocks();
20486        str = gen_const_xmlChar_ptr(n_str, 0);
20487
20488        ret_val = xmlStrlen(str);
20489        desret_int(ret_val);
20490        call_tests++;
20491        des_const_xmlChar_ptr(n_str, str, 0);
20492        xmlResetLastError();
20493        if (mem_base != xmlMemBlocks()) {
20494            printf("Leak of %d blocks found in xmlStrlen",
20495	           xmlMemBlocks() - mem_base);
20496	    ret++;
20497            printf(" %d", n_str);
20498            printf("\n");
20499        }
20500    }
20501
20502    function_tests++;
20503    return(ret);
20504}
20505
20506
20507static int
20508test_xmlStrncasecmp(void) {
20509    int ret = 0;
20510
20511    int mem_base;
20512    int ret_val;
20513    const xmlChar * str1; /* the first xmlChar * */
20514    int n_str1;
20515    const xmlChar * str2; /* the second xmlChar * */
20516    int n_str2;
20517    int len; /* the max comparison length */
20518    int n_len;
20519
20520    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
20521    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
20522    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20523        mem_base = xmlMemBlocks();
20524        str1 = gen_const_xmlChar_ptr(n_str1, 0);
20525        str2 = gen_const_xmlChar_ptr(n_str2, 1);
20526        len = gen_int(n_len, 2);
20527
20528        ret_val = xmlStrncasecmp(str1, str2, len);
20529        desret_int(ret_val);
20530        call_tests++;
20531        des_const_xmlChar_ptr(n_str1, str1, 0);
20532        des_const_xmlChar_ptr(n_str2, str2, 1);
20533        des_int(n_len, len, 2);
20534        xmlResetLastError();
20535        if (mem_base != xmlMemBlocks()) {
20536            printf("Leak of %d blocks found in xmlStrncasecmp",
20537	           xmlMemBlocks() - mem_base);
20538	    ret++;
20539            printf(" %d", n_str1);
20540            printf(" %d", n_str2);
20541            printf(" %d", n_len);
20542            printf("\n");
20543        }
20544    }
20545    }
20546    }
20547
20548    function_tests++;
20549    return(ret);
20550}
20551
20552
20553static int
20554test_xmlStrncatNew(void) {
20555    int ret = 0;
20556
20557    int mem_base;
20558    xmlChar * ret_val;
20559    const xmlChar * str1; /* first xmlChar string */
20560    int n_str1;
20561    const xmlChar * str2; /* second xmlChar string */
20562    int n_str2;
20563    int len; /* the len of @str2 */
20564    int n_len;
20565
20566    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
20567    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
20568    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20569        mem_base = xmlMemBlocks();
20570        str1 = gen_const_xmlChar_ptr(n_str1, 0);
20571        str2 = gen_const_xmlChar_ptr(n_str2, 1);
20572        len = gen_int(n_len, 2);
20573
20574        ret_val = xmlStrncatNew(str1, str2, len);
20575        desret_xmlChar_ptr(ret_val);
20576        call_tests++;
20577        des_const_xmlChar_ptr(n_str1, str1, 0);
20578        des_const_xmlChar_ptr(n_str2, str2, 1);
20579        des_int(n_len, len, 2);
20580        xmlResetLastError();
20581        if (mem_base != xmlMemBlocks()) {
20582            printf("Leak of %d blocks found in xmlStrncatNew",
20583	           xmlMemBlocks() - mem_base);
20584	    ret++;
20585            printf(" %d", n_str1);
20586            printf(" %d", n_str2);
20587            printf(" %d", n_len);
20588            printf("\n");
20589        }
20590    }
20591    }
20592    }
20593
20594    function_tests++;
20595    return(ret);
20596}
20597
20598
20599static int
20600test_xmlStrncmp(void) {
20601    int ret = 0;
20602
20603    int mem_base;
20604    int ret_val;
20605    const xmlChar * str1; /* the first xmlChar * */
20606    int n_str1;
20607    const xmlChar * str2; /* the second xmlChar * */
20608    int n_str2;
20609    int len; /* the max comparison length */
20610    int n_len;
20611
20612    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
20613    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
20614    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20615        mem_base = xmlMemBlocks();
20616        str1 = gen_const_xmlChar_ptr(n_str1, 0);
20617        str2 = gen_const_xmlChar_ptr(n_str2, 1);
20618        len = gen_int(n_len, 2);
20619
20620        ret_val = xmlStrncmp(str1, str2, len);
20621        desret_int(ret_val);
20622        call_tests++;
20623        des_const_xmlChar_ptr(n_str1, str1, 0);
20624        des_const_xmlChar_ptr(n_str2, str2, 1);
20625        des_int(n_len, len, 2);
20626        xmlResetLastError();
20627        if (mem_base != xmlMemBlocks()) {
20628            printf("Leak of %d blocks found in xmlStrncmp",
20629	           xmlMemBlocks() - mem_base);
20630	    ret++;
20631            printf(" %d", n_str1);
20632            printf(" %d", n_str2);
20633            printf(" %d", n_len);
20634            printf("\n");
20635        }
20636    }
20637    }
20638    }
20639
20640    function_tests++;
20641    return(ret);
20642}
20643
20644
20645static int
20646test_xmlStrndup(void) {
20647    int ret = 0;
20648
20649    int mem_base;
20650    xmlChar * ret_val;
20651    const xmlChar * cur; /* the input xmlChar * */
20652    int n_cur;
20653    int len; /* the len of @cur */
20654    int n_len;
20655
20656    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
20657    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20658        mem_base = xmlMemBlocks();
20659        cur = gen_const_xmlChar_ptr(n_cur, 0);
20660        len = gen_int(n_len, 1);
20661
20662        ret_val = xmlStrndup(cur, len);
20663        desret_xmlChar_ptr(ret_val);
20664        call_tests++;
20665        des_const_xmlChar_ptr(n_cur, cur, 0);
20666        des_int(n_len, len, 1);
20667        xmlResetLastError();
20668        if (mem_base != xmlMemBlocks()) {
20669            printf("Leak of %d blocks found in xmlStrndup",
20670	           xmlMemBlocks() - mem_base);
20671	    ret++;
20672            printf(" %d", n_cur);
20673            printf(" %d", n_len);
20674            printf("\n");
20675        }
20676    }
20677    }
20678
20679    function_tests++;
20680    return(ret);
20681}
20682
20683
20684static int
20685test_xmlStrstr(void) {
20686    int ret = 0;
20687
20688    int mem_base;
20689    const xmlChar * ret_val;
20690    const xmlChar * str; /* the xmlChar * array (haystack) */
20691    int n_str;
20692    const xmlChar * val; /* the xmlChar to search (needle) */
20693    int n_val;
20694
20695    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
20696    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
20697        mem_base = xmlMemBlocks();
20698        str = gen_const_xmlChar_ptr(n_str, 0);
20699        val = gen_const_xmlChar_ptr(n_val, 1);
20700
20701        ret_val = xmlStrstr(str, val);
20702        desret_const_xmlChar_ptr(ret_val);
20703        call_tests++;
20704        des_const_xmlChar_ptr(n_str, str, 0);
20705        des_const_xmlChar_ptr(n_val, val, 1);
20706        xmlResetLastError();
20707        if (mem_base != xmlMemBlocks()) {
20708            printf("Leak of %d blocks found in xmlStrstr",
20709	           xmlMemBlocks() - mem_base);
20710	    ret++;
20711            printf(" %d", n_str);
20712            printf(" %d", n_val);
20713            printf("\n");
20714        }
20715    }
20716    }
20717
20718    function_tests++;
20719    return(ret);
20720}
20721
20722
20723static int
20724test_xmlStrsub(void) {
20725    int ret = 0;
20726
20727    int mem_base;
20728    xmlChar * ret_val;
20729    const xmlChar * str; /* the xmlChar * array (haystack) */
20730    int n_str;
20731    int start; /* the index of the first char (zero based) */
20732    int n_start;
20733    int len; /* the length of the substring */
20734    int n_len;
20735
20736    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
20737    for (n_start = 0;n_start < gen_nb_int;n_start++) {
20738    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20739        mem_base = xmlMemBlocks();
20740        str = gen_const_xmlChar_ptr(n_str, 0);
20741        start = gen_int(n_start, 1);
20742        len = gen_int(n_len, 2);
20743
20744        ret_val = xmlStrsub(str, start, len);
20745        desret_xmlChar_ptr(ret_val);
20746        call_tests++;
20747        des_const_xmlChar_ptr(n_str, str, 0);
20748        des_int(n_start, start, 1);
20749        des_int(n_len, len, 2);
20750        xmlResetLastError();
20751        if (mem_base != xmlMemBlocks()) {
20752            printf("Leak of %d blocks found in xmlStrsub",
20753	           xmlMemBlocks() - mem_base);
20754	    ret++;
20755            printf(" %d", n_str);
20756            printf(" %d", n_start);
20757            printf(" %d", n_len);
20758            printf("\n");
20759        }
20760    }
20761    }
20762    }
20763
20764    function_tests++;
20765    return(ret);
20766}
20767
20768
20769static int
20770test_xmlUTF8Charcmp(void) {
20771    int ret = 0;
20772
20773    int mem_base;
20774    int ret_val;
20775    const xmlChar * utf1; /* pointer to first UTF8 char */
20776    int n_utf1;
20777    const xmlChar * utf2; /* pointer to second UTF8 char */
20778    int n_utf2;
20779
20780    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
20781    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
20782        mem_base = xmlMemBlocks();
20783        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
20784        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
20785
20786        ret_val = xmlUTF8Charcmp(utf1, utf2);
20787        desret_int(ret_val);
20788        call_tests++;
20789        des_const_xmlChar_ptr(n_utf1, utf1, 0);
20790        des_const_xmlChar_ptr(n_utf2, utf2, 1);
20791        xmlResetLastError();
20792        if (mem_base != xmlMemBlocks()) {
20793            printf("Leak of %d blocks found in xmlUTF8Charcmp",
20794	           xmlMemBlocks() - mem_base);
20795	    ret++;
20796            printf(" %d", n_utf1);
20797            printf(" %d", n_utf2);
20798            printf("\n");
20799        }
20800    }
20801    }
20802
20803    function_tests++;
20804    return(ret);
20805}
20806
20807
20808static int
20809test_xmlUTF8Size(void) {
20810    int ret = 0;
20811
20812    int mem_base;
20813    int ret_val;
20814    const xmlChar * utf; /* pointer to the UTF8 character */
20815    int n_utf;
20816
20817    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
20818        mem_base = xmlMemBlocks();
20819        utf = gen_const_xmlChar_ptr(n_utf, 0);
20820
20821        ret_val = xmlUTF8Size(utf);
20822        desret_int(ret_val);
20823        call_tests++;
20824        des_const_xmlChar_ptr(n_utf, utf, 0);
20825        xmlResetLastError();
20826        if (mem_base != xmlMemBlocks()) {
20827            printf("Leak of %d blocks found in xmlUTF8Size",
20828	           xmlMemBlocks() - mem_base);
20829	    ret++;
20830            printf(" %d", n_utf);
20831            printf("\n");
20832        }
20833    }
20834
20835    function_tests++;
20836    return(ret);
20837}
20838
20839
20840static int
20841test_xmlUTF8Strlen(void) {
20842    int ret = 0;
20843
20844    int mem_base;
20845    int ret_val;
20846    const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
20847    int n_utf;
20848
20849    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
20850        mem_base = xmlMemBlocks();
20851        utf = gen_const_xmlChar_ptr(n_utf, 0);
20852
20853        ret_val = xmlUTF8Strlen(utf);
20854        desret_int(ret_val);
20855        call_tests++;
20856        des_const_xmlChar_ptr(n_utf, utf, 0);
20857        xmlResetLastError();
20858        if (mem_base != xmlMemBlocks()) {
20859            printf("Leak of %d blocks found in xmlUTF8Strlen",
20860	           xmlMemBlocks() - mem_base);
20861	    ret++;
20862            printf(" %d", n_utf);
20863            printf("\n");
20864        }
20865    }
20866
20867    function_tests++;
20868    return(ret);
20869}
20870
20871
20872static int
20873test_xmlUTF8Strloc(void) {
20874    int ret = 0;
20875
20876    int mem_base;
20877    int ret_val;
20878    const xmlChar * utf; /* the input UTF8 * */
20879    int n_utf;
20880    const xmlChar * utfchar; /* the UTF8 character to be found */
20881    int n_utfchar;
20882
20883    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
20884    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
20885        mem_base = xmlMemBlocks();
20886        utf = gen_const_xmlChar_ptr(n_utf, 0);
20887        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
20888
20889        ret_val = xmlUTF8Strloc(utf, utfchar);
20890        desret_int(ret_val);
20891        call_tests++;
20892        des_const_xmlChar_ptr(n_utf, utf, 0);
20893        des_const_xmlChar_ptr(n_utfchar, utfchar, 1);
20894        xmlResetLastError();
20895        if (mem_base != xmlMemBlocks()) {
20896            printf("Leak of %d blocks found in xmlUTF8Strloc",
20897	           xmlMemBlocks() - mem_base);
20898	    ret++;
20899            printf(" %d", n_utf);
20900            printf(" %d", n_utfchar);
20901            printf("\n");
20902        }
20903    }
20904    }
20905
20906    function_tests++;
20907    return(ret);
20908}
20909
20910
20911static int
20912test_xmlUTF8Strndup(void) {
20913    int ret = 0;
20914
20915    int mem_base;
20916    xmlChar * ret_val;
20917    const xmlChar * utf; /* the input UTF8 * */
20918    int n_utf;
20919    int len; /* the len of @utf (in chars) */
20920    int n_len;
20921
20922    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
20923    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20924        mem_base = xmlMemBlocks();
20925        utf = gen_const_xmlChar_ptr(n_utf, 0);
20926        len = gen_int(n_len, 1);
20927
20928        ret_val = xmlUTF8Strndup(utf, len);
20929        desret_xmlChar_ptr(ret_val);
20930        call_tests++;
20931        des_const_xmlChar_ptr(n_utf, utf, 0);
20932        des_int(n_len, len, 1);
20933        xmlResetLastError();
20934        if (mem_base != xmlMemBlocks()) {
20935            printf("Leak of %d blocks found in xmlUTF8Strndup",
20936	           xmlMemBlocks() - mem_base);
20937	    ret++;
20938            printf(" %d", n_utf);
20939            printf(" %d", n_len);
20940            printf("\n");
20941        }
20942    }
20943    }
20944
20945    function_tests++;
20946    return(ret);
20947}
20948
20949
20950static int
20951test_xmlUTF8Strpos(void) {
20952    int ret = 0;
20953
20954    int mem_base;
20955    const xmlChar * ret_val;
20956    const xmlChar * utf; /* the input UTF8 * */
20957    int n_utf;
20958    int pos; /* the position of the desired UTF8 char (in chars) */
20959    int n_pos;
20960
20961    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
20962    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
20963        mem_base = xmlMemBlocks();
20964        utf = gen_const_xmlChar_ptr(n_utf, 0);
20965        pos = gen_int(n_pos, 1);
20966
20967        ret_val = xmlUTF8Strpos(utf, pos);
20968        desret_const_xmlChar_ptr(ret_val);
20969        call_tests++;
20970        des_const_xmlChar_ptr(n_utf, utf, 0);
20971        des_int(n_pos, pos, 1);
20972        xmlResetLastError();
20973        if (mem_base != xmlMemBlocks()) {
20974            printf("Leak of %d blocks found in xmlUTF8Strpos",
20975	           xmlMemBlocks() - mem_base);
20976	    ret++;
20977            printf(" %d", n_utf);
20978            printf(" %d", n_pos);
20979            printf("\n");
20980        }
20981    }
20982    }
20983
20984    function_tests++;
20985    return(ret);
20986}
20987
20988
20989static int
20990test_xmlUTF8Strsize(void) {
20991    int ret = 0;
20992
20993    int mem_base;
20994    int ret_val;
20995    const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
20996    int n_utf;
20997    int len; /* the number of characters in the array */
20998    int n_len;
20999
21000    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
21001    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21002        mem_base = xmlMemBlocks();
21003        utf = gen_const_xmlChar_ptr(n_utf, 0);
21004        len = gen_int(n_len, 1);
21005
21006        ret_val = xmlUTF8Strsize(utf, len);
21007        desret_int(ret_val);
21008        call_tests++;
21009        des_const_xmlChar_ptr(n_utf, utf, 0);
21010        des_int(n_len, len, 1);
21011        xmlResetLastError();
21012        if (mem_base != xmlMemBlocks()) {
21013            printf("Leak of %d blocks found in xmlUTF8Strsize",
21014	           xmlMemBlocks() - mem_base);
21015	    ret++;
21016            printf(" %d", n_utf);
21017            printf(" %d", n_len);
21018            printf("\n");
21019        }
21020    }
21021    }
21022
21023    function_tests++;
21024    return(ret);
21025}
21026
21027
21028static int
21029test_xmlUTF8Strsub(void) {
21030    int ret = 0;
21031
21032    int mem_base;
21033    xmlChar * ret_val;
21034    const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
21035    int n_utf;
21036    int start; /* relative pos of first char */
21037    int n_start;
21038    int len; /* total number to copy */
21039    int n_len;
21040
21041    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
21042    for (n_start = 0;n_start < gen_nb_int;n_start++) {
21043    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21044        mem_base = xmlMemBlocks();
21045        utf = gen_const_xmlChar_ptr(n_utf, 0);
21046        start = gen_int(n_start, 1);
21047        len = gen_int(n_len, 2);
21048
21049        ret_val = xmlUTF8Strsub(utf, start, len);
21050        desret_xmlChar_ptr(ret_val);
21051        call_tests++;
21052        des_const_xmlChar_ptr(n_utf, utf, 0);
21053        des_int(n_start, start, 1);
21054        des_int(n_len, len, 2);
21055        xmlResetLastError();
21056        if (mem_base != xmlMemBlocks()) {
21057            printf("Leak of %d blocks found in xmlUTF8Strsub",
21058	           xmlMemBlocks() - mem_base);
21059	    ret++;
21060            printf(" %d", n_utf);
21061            printf(" %d", n_start);
21062            printf(" %d", n_len);
21063            printf("\n");
21064        }
21065    }
21066    }
21067    }
21068
21069    function_tests++;
21070    return(ret);
21071}
21072
21073static int
21074test_xmlstring(void) {
21075    int ret = 0;
21076
21077    printf("Testing xmlstring : 23 of 30 functions ...\n");
21078    ret += test_xmlCharStrdup();
21079    ret += test_xmlCharStrndup();
21080    ret += test_xmlCheckUTF8();
21081    ret += test_xmlGetUTF8Char();
21082    ret += test_xmlStrEqual();
21083    ret += test_xmlStrPrintf();
21084    ret += test_xmlStrQEqual();
21085    ret += test_xmlStrVPrintf();
21086    ret += test_xmlStrcasecmp();
21087    ret += test_xmlStrcasestr();
21088    ret += test_xmlStrchr();
21089    ret += test_xmlStrcmp();
21090    ret += test_xmlStrdup();
21091    ret += test_xmlStrlen();
21092    ret += test_xmlStrncasecmp();
21093    ret += test_xmlStrncatNew();
21094    ret += test_xmlStrncmp();
21095    ret += test_xmlStrndup();
21096    ret += test_xmlStrstr();
21097    ret += test_xmlStrsub();
21098    ret += test_xmlUTF8Charcmp();
21099    ret += test_xmlUTF8Size();
21100    ret += test_xmlUTF8Strlen();
21101    ret += test_xmlUTF8Strloc();
21102    ret += test_xmlUTF8Strndup();
21103    ret += test_xmlUTF8Strpos();
21104    ret += test_xmlUTF8Strsize();
21105    ret += test_xmlUTF8Strsub();
21106
21107    if (ret != 0)
21108	printf("Module xmlstring: %d errors\n", ret);
21109    return(ret);
21110}
21111
21112static int
21113test_xmlNewTextWriter(void) {
21114    int ret = 0;
21115
21116
21117    /* missing type support */
21118    return(ret);
21119}
21120
21121
21122static int
21123test_xmlNewTextWriterDoc(void) {
21124    int ret = 0;
21125
21126
21127    /* missing type support */
21128    return(ret);
21129}
21130
21131
21132static int
21133test_xmlNewTextWriterFilename(void) {
21134    int ret = 0;
21135
21136
21137    /* missing type support */
21138    return(ret);
21139}
21140
21141
21142static int
21143test_xmlNewTextWriterMemory(void) {
21144    int ret = 0;
21145
21146
21147    /* missing type support */
21148    return(ret);
21149}
21150
21151
21152static int
21153test_xmlNewTextWriterPushParser(void) {
21154    int ret = 0;
21155
21156
21157    /* missing type support */
21158    return(ret);
21159}
21160
21161
21162static int
21163test_xmlNewTextWriterTree(void) {
21164    int ret = 0;
21165
21166
21167    /* missing type support */
21168    return(ret);
21169}
21170
21171
21172static int
21173test_xmlTextWriterEndAttribute(void) {
21174    int ret = 0;
21175
21176#ifdef LIBXML_WRITER_ENABLED
21177    int mem_base;
21178    int ret_val;
21179    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21180    int n_writer;
21181
21182    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21183        mem_base = xmlMemBlocks();
21184        writer = gen_xmlTextWriterPtr(n_writer, 0);
21185
21186        ret_val = xmlTextWriterEndAttribute(writer);
21187        desret_int(ret_val);
21188        call_tests++;
21189        des_xmlTextWriterPtr(n_writer, writer, 0);
21190        xmlResetLastError();
21191        if (mem_base != xmlMemBlocks()) {
21192            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
21193	           xmlMemBlocks() - mem_base);
21194	    ret++;
21195            printf(" %d", n_writer);
21196            printf("\n");
21197        }
21198    }
21199#endif
21200
21201    function_tests++;
21202    return(ret);
21203}
21204
21205
21206static int
21207test_xmlTextWriterEndCDATA(void) {
21208    int ret = 0;
21209
21210#ifdef LIBXML_WRITER_ENABLED
21211    int mem_base;
21212    int ret_val;
21213    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21214    int n_writer;
21215
21216    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21217        mem_base = xmlMemBlocks();
21218        writer = gen_xmlTextWriterPtr(n_writer, 0);
21219
21220        ret_val = xmlTextWriterEndCDATA(writer);
21221        desret_int(ret_val);
21222        call_tests++;
21223        des_xmlTextWriterPtr(n_writer, writer, 0);
21224        xmlResetLastError();
21225        if (mem_base != xmlMemBlocks()) {
21226            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
21227	           xmlMemBlocks() - mem_base);
21228	    ret++;
21229            printf(" %d", n_writer);
21230            printf("\n");
21231        }
21232    }
21233#endif
21234
21235    function_tests++;
21236    return(ret);
21237}
21238
21239
21240static int
21241test_xmlTextWriterEndComment(void) {
21242    int ret = 0;
21243
21244#ifdef LIBXML_WRITER_ENABLED
21245    int mem_base;
21246    int ret_val;
21247    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21248    int n_writer;
21249
21250    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21251        mem_base = xmlMemBlocks();
21252        writer = gen_xmlTextWriterPtr(n_writer, 0);
21253
21254        ret_val = xmlTextWriterEndComment(writer);
21255        desret_int(ret_val);
21256        call_tests++;
21257        des_xmlTextWriterPtr(n_writer, writer, 0);
21258        xmlResetLastError();
21259        if (mem_base != xmlMemBlocks()) {
21260            printf("Leak of %d blocks found in xmlTextWriterEndComment",
21261	           xmlMemBlocks() - mem_base);
21262	    ret++;
21263            printf(" %d", n_writer);
21264            printf("\n");
21265        }
21266    }
21267#endif
21268
21269    function_tests++;
21270    return(ret);
21271}
21272
21273
21274static int
21275test_xmlTextWriterEndDTD(void) {
21276    int ret = 0;
21277
21278#ifdef LIBXML_WRITER_ENABLED
21279    int mem_base;
21280    int ret_val;
21281    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21282    int n_writer;
21283
21284    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21285        mem_base = xmlMemBlocks();
21286        writer = gen_xmlTextWriterPtr(n_writer, 0);
21287
21288        ret_val = xmlTextWriterEndDTD(writer);
21289        desret_int(ret_val);
21290        call_tests++;
21291        des_xmlTextWriterPtr(n_writer, writer, 0);
21292        xmlResetLastError();
21293        if (mem_base != xmlMemBlocks()) {
21294            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
21295	           xmlMemBlocks() - mem_base);
21296	    ret++;
21297            printf(" %d", n_writer);
21298            printf("\n");
21299        }
21300    }
21301#endif
21302
21303    function_tests++;
21304    return(ret);
21305}
21306
21307
21308static int
21309test_xmlTextWriterEndDTDAttlist(void) {
21310    int ret = 0;
21311
21312#ifdef LIBXML_WRITER_ENABLED
21313    int mem_base;
21314    int ret_val;
21315    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21316    int n_writer;
21317
21318    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21319        mem_base = xmlMemBlocks();
21320        writer = gen_xmlTextWriterPtr(n_writer, 0);
21321
21322        ret_val = xmlTextWriterEndDTDAttlist(writer);
21323        desret_int(ret_val);
21324        call_tests++;
21325        des_xmlTextWriterPtr(n_writer, writer, 0);
21326        xmlResetLastError();
21327        if (mem_base != xmlMemBlocks()) {
21328            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
21329	           xmlMemBlocks() - mem_base);
21330	    ret++;
21331            printf(" %d", n_writer);
21332            printf("\n");
21333        }
21334    }
21335#endif
21336
21337    function_tests++;
21338    return(ret);
21339}
21340
21341
21342static int
21343test_xmlTextWriterEndDTDElement(void) {
21344    int ret = 0;
21345
21346#ifdef LIBXML_WRITER_ENABLED
21347    int mem_base;
21348    int ret_val;
21349    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21350    int n_writer;
21351
21352    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21353        mem_base = xmlMemBlocks();
21354        writer = gen_xmlTextWriterPtr(n_writer, 0);
21355
21356        ret_val = xmlTextWriterEndDTDElement(writer);
21357        desret_int(ret_val);
21358        call_tests++;
21359        des_xmlTextWriterPtr(n_writer, writer, 0);
21360        xmlResetLastError();
21361        if (mem_base != xmlMemBlocks()) {
21362            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
21363	           xmlMemBlocks() - mem_base);
21364	    ret++;
21365            printf(" %d", n_writer);
21366            printf("\n");
21367        }
21368    }
21369#endif
21370
21371    function_tests++;
21372    return(ret);
21373}
21374
21375
21376static int
21377test_xmlTextWriterEndDTDEntity(void) {
21378    int ret = 0;
21379
21380#ifdef LIBXML_WRITER_ENABLED
21381    int mem_base;
21382    int ret_val;
21383    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21384    int n_writer;
21385
21386    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21387        mem_base = xmlMemBlocks();
21388        writer = gen_xmlTextWriterPtr(n_writer, 0);
21389
21390        ret_val = xmlTextWriterEndDTDEntity(writer);
21391        desret_int(ret_val);
21392        call_tests++;
21393        des_xmlTextWriterPtr(n_writer, writer, 0);
21394        xmlResetLastError();
21395        if (mem_base != xmlMemBlocks()) {
21396            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
21397	           xmlMemBlocks() - mem_base);
21398	    ret++;
21399            printf(" %d", n_writer);
21400            printf("\n");
21401        }
21402    }
21403#endif
21404
21405    function_tests++;
21406    return(ret);
21407}
21408
21409
21410static int
21411test_xmlTextWriterEndDocument(void) {
21412    int ret = 0;
21413
21414#ifdef LIBXML_WRITER_ENABLED
21415    int mem_base;
21416    int ret_val;
21417    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21418    int n_writer;
21419
21420    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21421        mem_base = xmlMemBlocks();
21422        writer = gen_xmlTextWriterPtr(n_writer, 0);
21423
21424        ret_val = xmlTextWriterEndDocument(writer);
21425        desret_int(ret_val);
21426        call_tests++;
21427        des_xmlTextWriterPtr(n_writer, writer, 0);
21428        xmlResetLastError();
21429        if (mem_base != xmlMemBlocks()) {
21430            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
21431	           xmlMemBlocks() - mem_base);
21432	    ret++;
21433            printf(" %d", n_writer);
21434            printf("\n");
21435        }
21436    }
21437#endif
21438
21439    function_tests++;
21440    return(ret);
21441}
21442
21443
21444static int
21445test_xmlTextWriterEndElement(void) {
21446    int ret = 0;
21447
21448#ifdef LIBXML_WRITER_ENABLED
21449    int mem_base;
21450    int ret_val;
21451    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21452    int n_writer;
21453
21454    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21455        mem_base = xmlMemBlocks();
21456        writer = gen_xmlTextWriterPtr(n_writer, 0);
21457
21458        ret_val = xmlTextWriterEndElement(writer);
21459        desret_int(ret_val);
21460        call_tests++;
21461        des_xmlTextWriterPtr(n_writer, writer, 0);
21462        xmlResetLastError();
21463        if (mem_base != xmlMemBlocks()) {
21464            printf("Leak of %d blocks found in xmlTextWriterEndElement",
21465	           xmlMemBlocks() - mem_base);
21466	    ret++;
21467            printf(" %d", n_writer);
21468            printf("\n");
21469        }
21470    }
21471#endif
21472
21473    function_tests++;
21474    return(ret);
21475}
21476
21477
21478static int
21479test_xmlTextWriterEndPI(void) {
21480    int ret = 0;
21481
21482#ifdef LIBXML_WRITER_ENABLED
21483    int mem_base;
21484    int ret_val;
21485    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21486    int n_writer;
21487
21488    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21489        mem_base = xmlMemBlocks();
21490        writer = gen_xmlTextWriterPtr(n_writer, 0);
21491
21492        ret_val = xmlTextWriterEndPI(writer);
21493        desret_int(ret_val);
21494        call_tests++;
21495        des_xmlTextWriterPtr(n_writer, writer, 0);
21496        xmlResetLastError();
21497        if (mem_base != xmlMemBlocks()) {
21498            printf("Leak of %d blocks found in xmlTextWriterEndPI",
21499	           xmlMemBlocks() - mem_base);
21500	    ret++;
21501            printf(" %d", n_writer);
21502            printf("\n");
21503        }
21504    }
21505#endif
21506
21507    function_tests++;
21508    return(ret);
21509}
21510
21511
21512static int
21513test_xmlTextWriterFlush(void) {
21514    int ret = 0;
21515
21516#ifdef LIBXML_WRITER_ENABLED
21517    int mem_base;
21518    int ret_val;
21519    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21520    int n_writer;
21521
21522    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21523        mem_base = xmlMemBlocks();
21524        writer = gen_xmlTextWriterPtr(n_writer, 0);
21525
21526        ret_val = xmlTextWriterFlush(writer);
21527        desret_int(ret_val);
21528        call_tests++;
21529        des_xmlTextWriterPtr(n_writer, writer, 0);
21530        xmlResetLastError();
21531        if (mem_base != xmlMemBlocks()) {
21532            printf("Leak of %d blocks found in xmlTextWriterFlush",
21533	           xmlMemBlocks() - mem_base);
21534	    ret++;
21535            printf(" %d", n_writer);
21536            printf("\n");
21537        }
21538    }
21539#endif
21540
21541    function_tests++;
21542    return(ret);
21543}
21544
21545
21546static int
21547test_xmlTextWriterFullEndElement(void) {
21548    int ret = 0;
21549
21550#ifdef LIBXML_WRITER_ENABLED
21551    int mem_base;
21552    int ret_val;
21553    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21554    int n_writer;
21555
21556    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21557        mem_base = xmlMemBlocks();
21558        writer = gen_xmlTextWriterPtr(n_writer, 0);
21559
21560        ret_val = xmlTextWriterFullEndElement(writer);
21561        desret_int(ret_val);
21562        call_tests++;
21563        des_xmlTextWriterPtr(n_writer, writer, 0);
21564        xmlResetLastError();
21565        if (mem_base != xmlMemBlocks()) {
21566            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
21567	           xmlMemBlocks() - mem_base);
21568	    ret++;
21569            printf(" %d", n_writer);
21570            printf("\n");
21571        }
21572    }
21573#endif
21574
21575    function_tests++;
21576    return(ret);
21577}
21578
21579
21580static int
21581test_xmlTextWriterSetIndent(void) {
21582    int ret = 0;
21583
21584#ifdef LIBXML_WRITER_ENABLED
21585    int mem_base;
21586    int ret_val;
21587    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21588    int n_writer;
21589    int indent; /* do indentation? */
21590    int n_indent;
21591
21592    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21593    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
21594        mem_base = xmlMemBlocks();
21595        writer = gen_xmlTextWriterPtr(n_writer, 0);
21596        indent = gen_int(n_indent, 1);
21597
21598        ret_val = xmlTextWriterSetIndent(writer, indent);
21599        desret_int(ret_val);
21600        call_tests++;
21601        des_xmlTextWriterPtr(n_writer, writer, 0);
21602        des_int(n_indent, indent, 1);
21603        xmlResetLastError();
21604        if (mem_base != xmlMemBlocks()) {
21605            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
21606	           xmlMemBlocks() - mem_base);
21607	    ret++;
21608            printf(" %d", n_writer);
21609            printf(" %d", n_indent);
21610            printf("\n");
21611        }
21612    }
21613    }
21614#endif
21615
21616    function_tests++;
21617    return(ret);
21618}
21619
21620
21621static int
21622test_xmlTextWriterSetIndentString(void) {
21623    int ret = 0;
21624
21625#ifdef LIBXML_WRITER_ENABLED
21626    int mem_base;
21627    int ret_val;
21628    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21629    int n_writer;
21630    const xmlChar * str; /* the xmlChar string */
21631    int n_str;
21632
21633    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21634    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
21635        mem_base = xmlMemBlocks();
21636        writer = gen_xmlTextWriterPtr(n_writer, 0);
21637        str = gen_const_xmlChar_ptr(n_str, 1);
21638
21639        ret_val = xmlTextWriterSetIndentString(writer, str);
21640        desret_int(ret_val);
21641        call_tests++;
21642        des_xmlTextWriterPtr(n_writer, writer, 0);
21643        des_const_xmlChar_ptr(n_str, str, 1);
21644        xmlResetLastError();
21645        if (mem_base != xmlMemBlocks()) {
21646            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
21647	           xmlMemBlocks() - mem_base);
21648	    ret++;
21649            printf(" %d", n_writer);
21650            printf(" %d", n_str);
21651            printf("\n");
21652        }
21653    }
21654    }
21655#endif
21656
21657    function_tests++;
21658    return(ret);
21659}
21660
21661
21662static int
21663test_xmlTextWriterStartAttribute(void) {
21664    int ret = 0;
21665
21666#ifdef LIBXML_WRITER_ENABLED
21667    int mem_base;
21668    int ret_val;
21669    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21670    int n_writer;
21671    const xmlChar * name; /* element name */
21672    int n_name;
21673
21674    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21675    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21676        mem_base = xmlMemBlocks();
21677        writer = gen_xmlTextWriterPtr(n_writer, 0);
21678        name = gen_const_xmlChar_ptr(n_name, 1);
21679
21680        ret_val = xmlTextWriterStartAttribute(writer, name);
21681        desret_int(ret_val);
21682        call_tests++;
21683        des_xmlTextWriterPtr(n_writer, writer, 0);
21684        des_const_xmlChar_ptr(n_name, name, 1);
21685        xmlResetLastError();
21686        if (mem_base != xmlMemBlocks()) {
21687            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
21688	           xmlMemBlocks() - mem_base);
21689	    ret++;
21690            printf(" %d", n_writer);
21691            printf(" %d", n_name);
21692            printf("\n");
21693        }
21694    }
21695    }
21696#endif
21697
21698    function_tests++;
21699    return(ret);
21700}
21701
21702
21703static int
21704test_xmlTextWriterStartAttributeNS(void) {
21705    int ret = 0;
21706
21707#ifdef LIBXML_WRITER_ENABLED
21708    int mem_base;
21709    int ret_val;
21710    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21711    int n_writer;
21712    const xmlChar * prefix; /* namespace prefix or NULL */
21713    int n_prefix;
21714    const xmlChar * name; /* element local name */
21715    int n_name;
21716    const xmlChar * namespaceURI; /* namespace URI or NULL */
21717    int n_namespaceURI;
21718
21719    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21720    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21721    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21722    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
21723        mem_base = xmlMemBlocks();
21724        writer = gen_xmlTextWriterPtr(n_writer, 0);
21725        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
21726        name = gen_const_xmlChar_ptr(n_name, 2);
21727        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
21728
21729        ret_val = xmlTextWriterStartAttributeNS(writer, prefix, name, namespaceURI);
21730        desret_int(ret_val);
21731        call_tests++;
21732        des_xmlTextWriterPtr(n_writer, writer, 0);
21733        des_const_xmlChar_ptr(n_prefix, prefix, 1);
21734        des_const_xmlChar_ptr(n_name, name, 2);
21735        des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
21736        xmlResetLastError();
21737        if (mem_base != xmlMemBlocks()) {
21738            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
21739	           xmlMemBlocks() - mem_base);
21740	    ret++;
21741            printf(" %d", n_writer);
21742            printf(" %d", n_prefix);
21743            printf(" %d", n_name);
21744            printf(" %d", n_namespaceURI);
21745            printf("\n");
21746        }
21747    }
21748    }
21749    }
21750    }
21751#endif
21752
21753    function_tests++;
21754    return(ret);
21755}
21756
21757
21758static int
21759test_xmlTextWriterStartCDATA(void) {
21760    int ret = 0;
21761
21762#ifdef LIBXML_WRITER_ENABLED
21763    int mem_base;
21764    int ret_val;
21765    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21766    int n_writer;
21767
21768    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21769        mem_base = xmlMemBlocks();
21770        writer = gen_xmlTextWriterPtr(n_writer, 0);
21771
21772        ret_val = xmlTextWriterStartCDATA(writer);
21773        desret_int(ret_val);
21774        call_tests++;
21775        des_xmlTextWriterPtr(n_writer, writer, 0);
21776        xmlResetLastError();
21777        if (mem_base != xmlMemBlocks()) {
21778            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
21779	           xmlMemBlocks() - mem_base);
21780	    ret++;
21781            printf(" %d", n_writer);
21782            printf("\n");
21783        }
21784    }
21785#endif
21786
21787    function_tests++;
21788    return(ret);
21789}
21790
21791
21792static int
21793test_xmlTextWriterStartComment(void) {
21794    int ret = 0;
21795
21796#ifdef LIBXML_WRITER_ENABLED
21797    int mem_base;
21798    int ret_val;
21799    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21800    int n_writer;
21801
21802    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21803        mem_base = xmlMemBlocks();
21804        writer = gen_xmlTextWriterPtr(n_writer, 0);
21805
21806        ret_val = xmlTextWriterStartComment(writer);
21807        desret_int(ret_val);
21808        call_tests++;
21809        des_xmlTextWriterPtr(n_writer, writer, 0);
21810        xmlResetLastError();
21811        if (mem_base != xmlMemBlocks()) {
21812            printf("Leak of %d blocks found in xmlTextWriterStartComment",
21813	           xmlMemBlocks() - mem_base);
21814	    ret++;
21815            printf(" %d", n_writer);
21816            printf("\n");
21817        }
21818    }
21819#endif
21820
21821    function_tests++;
21822    return(ret);
21823}
21824
21825
21826static int
21827test_xmlTextWriterStartDTD(void) {
21828    int ret = 0;
21829
21830#ifdef LIBXML_WRITER_ENABLED
21831    int mem_base;
21832    int ret_val;
21833    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21834    int n_writer;
21835    const xmlChar * name; /* the name of the DTD */
21836    int n_name;
21837    const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
21838    int n_pubid;
21839    const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
21840    int n_sysid;
21841
21842    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21843    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21844    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
21845    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
21846        mem_base = xmlMemBlocks();
21847        writer = gen_xmlTextWriterPtr(n_writer, 0);
21848        name = gen_const_xmlChar_ptr(n_name, 1);
21849        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
21850        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
21851
21852        ret_val = xmlTextWriterStartDTD(writer, name, pubid, sysid);
21853        desret_int(ret_val);
21854        call_tests++;
21855        des_xmlTextWriterPtr(n_writer, writer, 0);
21856        des_const_xmlChar_ptr(n_name, name, 1);
21857        des_const_xmlChar_ptr(n_pubid, pubid, 2);
21858        des_const_xmlChar_ptr(n_sysid, sysid, 3);
21859        xmlResetLastError();
21860        if (mem_base != xmlMemBlocks()) {
21861            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
21862	           xmlMemBlocks() - mem_base);
21863	    ret++;
21864            printf(" %d", n_writer);
21865            printf(" %d", n_name);
21866            printf(" %d", n_pubid);
21867            printf(" %d", n_sysid);
21868            printf("\n");
21869        }
21870    }
21871    }
21872    }
21873    }
21874#endif
21875
21876    function_tests++;
21877    return(ret);
21878}
21879
21880
21881static int
21882test_xmlTextWriterStartDTDAttlist(void) {
21883    int ret = 0;
21884
21885#ifdef LIBXML_WRITER_ENABLED
21886    int mem_base;
21887    int ret_val;
21888    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21889    int n_writer;
21890    const xmlChar * name; /* the name of the DTD ATTLIST */
21891    int n_name;
21892
21893    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21894    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21895        mem_base = xmlMemBlocks();
21896        writer = gen_xmlTextWriterPtr(n_writer, 0);
21897        name = gen_const_xmlChar_ptr(n_name, 1);
21898
21899        ret_val = xmlTextWriterStartDTDAttlist(writer, name);
21900        desret_int(ret_val);
21901        call_tests++;
21902        des_xmlTextWriterPtr(n_writer, writer, 0);
21903        des_const_xmlChar_ptr(n_name, name, 1);
21904        xmlResetLastError();
21905        if (mem_base != xmlMemBlocks()) {
21906            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
21907	           xmlMemBlocks() - mem_base);
21908	    ret++;
21909            printf(" %d", n_writer);
21910            printf(" %d", n_name);
21911            printf("\n");
21912        }
21913    }
21914    }
21915#endif
21916
21917    function_tests++;
21918    return(ret);
21919}
21920
21921
21922static int
21923test_xmlTextWriterStartDTDElement(void) {
21924    int ret = 0;
21925
21926#ifdef LIBXML_WRITER_ENABLED
21927    int mem_base;
21928    int ret_val;
21929    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21930    int n_writer;
21931    const xmlChar * name; /* the name of the DTD element */
21932    int n_name;
21933
21934    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21935    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21936        mem_base = xmlMemBlocks();
21937        writer = gen_xmlTextWriterPtr(n_writer, 0);
21938        name = gen_const_xmlChar_ptr(n_name, 1);
21939
21940        ret_val = xmlTextWriterStartDTDElement(writer, name);
21941        desret_int(ret_val);
21942        call_tests++;
21943        des_xmlTextWriterPtr(n_writer, writer, 0);
21944        des_const_xmlChar_ptr(n_name, name, 1);
21945        xmlResetLastError();
21946        if (mem_base != xmlMemBlocks()) {
21947            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
21948	           xmlMemBlocks() - mem_base);
21949	    ret++;
21950            printf(" %d", n_writer);
21951            printf(" %d", n_name);
21952            printf("\n");
21953        }
21954    }
21955    }
21956#endif
21957
21958    function_tests++;
21959    return(ret);
21960}
21961
21962
21963static int
21964test_xmlTextWriterStartDTDEntity(void) {
21965    int ret = 0;
21966
21967#ifdef LIBXML_WRITER_ENABLED
21968    int mem_base;
21969    int ret_val;
21970    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
21971    int n_writer;
21972    int pe; /* TRUE if this is a parameter entity, FALSE if not */
21973    int n_pe;
21974    const xmlChar * name; /* the name of the DTD ATTLIST */
21975    int n_name;
21976
21977    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
21978    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
21979    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21980        mem_base = xmlMemBlocks();
21981        writer = gen_xmlTextWriterPtr(n_writer, 0);
21982        pe = gen_int(n_pe, 1);
21983        name = gen_const_xmlChar_ptr(n_name, 2);
21984
21985        ret_val = xmlTextWriterStartDTDEntity(writer, pe, name);
21986        desret_int(ret_val);
21987        call_tests++;
21988        des_xmlTextWriterPtr(n_writer, writer, 0);
21989        des_int(n_pe, pe, 1);
21990        des_const_xmlChar_ptr(n_name, name, 2);
21991        xmlResetLastError();
21992        if (mem_base != xmlMemBlocks()) {
21993            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
21994	           xmlMemBlocks() - mem_base);
21995	    ret++;
21996            printf(" %d", n_writer);
21997            printf(" %d", n_pe);
21998            printf(" %d", n_name);
21999            printf("\n");
22000        }
22001    }
22002    }
22003    }
22004#endif
22005
22006    function_tests++;
22007    return(ret);
22008}
22009
22010
22011static int
22012test_xmlTextWriterStartDocument(void) {
22013    int ret = 0;
22014
22015#ifdef LIBXML_WRITER_ENABLED
22016    int mem_base;
22017    int ret_val;
22018    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22019    int n_writer;
22020    const char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
22021    int n_version;
22022    const char * encoding; /* the encoding or NULL for default */
22023    int n_encoding;
22024    const char * standalone; /* "yes" or "no" or NULL for default */
22025    int n_standalone;
22026
22027    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22028    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
22029    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22030    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
22031        mem_base = xmlMemBlocks();
22032        writer = gen_xmlTextWriterPtr(n_writer, 0);
22033        version = gen_const_char_ptr(n_version, 1);
22034        encoding = gen_const_char_ptr(n_encoding, 2);
22035        standalone = gen_const_char_ptr(n_standalone, 3);
22036
22037        ret_val = xmlTextWriterStartDocument(writer, version, encoding, standalone);
22038        desret_int(ret_val);
22039        call_tests++;
22040        des_xmlTextWriterPtr(n_writer, writer, 0);
22041        des_const_char_ptr(n_version, version, 1);
22042        des_const_char_ptr(n_encoding, encoding, 2);
22043        des_const_char_ptr(n_standalone, standalone, 3);
22044        xmlResetLastError();
22045        if (mem_base != xmlMemBlocks()) {
22046            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
22047	           xmlMemBlocks() - mem_base);
22048	    ret++;
22049            printf(" %d", n_writer);
22050            printf(" %d", n_version);
22051            printf(" %d", n_encoding);
22052            printf(" %d", n_standalone);
22053            printf("\n");
22054        }
22055    }
22056    }
22057    }
22058    }
22059#endif
22060
22061    function_tests++;
22062    return(ret);
22063}
22064
22065
22066static int
22067test_xmlTextWriterStartElement(void) {
22068    int ret = 0;
22069
22070#ifdef LIBXML_WRITER_ENABLED
22071    int mem_base;
22072    int ret_val;
22073    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22074    int n_writer;
22075    const xmlChar * name; /* element name */
22076    int n_name;
22077
22078    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22079    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22080        mem_base = xmlMemBlocks();
22081        writer = gen_xmlTextWriterPtr(n_writer, 0);
22082        name = gen_const_xmlChar_ptr(n_name, 1);
22083
22084        ret_val = xmlTextWriterStartElement(writer, name);
22085        desret_int(ret_val);
22086        call_tests++;
22087        des_xmlTextWriterPtr(n_writer, writer, 0);
22088        des_const_xmlChar_ptr(n_name, name, 1);
22089        xmlResetLastError();
22090        if (mem_base != xmlMemBlocks()) {
22091            printf("Leak of %d blocks found in xmlTextWriterStartElement",
22092	           xmlMemBlocks() - mem_base);
22093	    ret++;
22094            printf(" %d", n_writer);
22095            printf(" %d", n_name);
22096            printf("\n");
22097        }
22098    }
22099    }
22100#endif
22101
22102    function_tests++;
22103    return(ret);
22104}
22105
22106
22107static int
22108test_xmlTextWriterStartElementNS(void) {
22109    int ret = 0;
22110
22111#ifdef LIBXML_WRITER_ENABLED
22112    int mem_base;
22113    int ret_val;
22114    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22115    int n_writer;
22116    const xmlChar * prefix; /* namespace prefix or NULL */
22117    int n_prefix;
22118    const xmlChar * name; /* element local name */
22119    int n_name;
22120    const xmlChar * namespaceURI; /* namespace URI or NULL */
22121    int n_namespaceURI;
22122
22123    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22124    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
22125    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22126    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
22127        mem_base = xmlMemBlocks();
22128        writer = gen_xmlTextWriterPtr(n_writer, 0);
22129        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
22130        name = gen_const_xmlChar_ptr(n_name, 2);
22131        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
22132
22133        ret_val = xmlTextWriterStartElementNS(writer, prefix, name, namespaceURI);
22134        desret_int(ret_val);
22135        call_tests++;
22136        des_xmlTextWriterPtr(n_writer, writer, 0);
22137        des_const_xmlChar_ptr(n_prefix, prefix, 1);
22138        des_const_xmlChar_ptr(n_name, name, 2);
22139        des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
22140        xmlResetLastError();
22141        if (mem_base != xmlMemBlocks()) {
22142            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
22143	           xmlMemBlocks() - mem_base);
22144	    ret++;
22145            printf(" %d", n_writer);
22146            printf(" %d", n_prefix);
22147            printf(" %d", n_name);
22148            printf(" %d", n_namespaceURI);
22149            printf("\n");
22150        }
22151    }
22152    }
22153    }
22154    }
22155#endif
22156
22157    function_tests++;
22158    return(ret);
22159}
22160
22161
22162static int
22163test_xmlTextWriterStartPI(void) {
22164    int ret = 0;
22165
22166#ifdef LIBXML_WRITER_ENABLED
22167    int mem_base;
22168    int ret_val;
22169    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22170    int n_writer;
22171    const xmlChar * target; /* PI target */
22172    int n_target;
22173
22174    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22175    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
22176        mem_base = xmlMemBlocks();
22177        writer = gen_xmlTextWriterPtr(n_writer, 0);
22178        target = gen_const_xmlChar_ptr(n_target, 1);
22179
22180        ret_val = xmlTextWriterStartPI(writer, target);
22181        desret_int(ret_val);
22182        call_tests++;
22183        des_xmlTextWriterPtr(n_writer, writer, 0);
22184        des_const_xmlChar_ptr(n_target, target, 1);
22185        xmlResetLastError();
22186        if (mem_base != xmlMemBlocks()) {
22187            printf("Leak of %d blocks found in xmlTextWriterStartPI",
22188	           xmlMemBlocks() - mem_base);
22189	    ret++;
22190            printf(" %d", n_writer);
22191            printf(" %d", n_target);
22192            printf("\n");
22193        }
22194    }
22195    }
22196#endif
22197
22198    function_tests++;
22199    return(ret);
22200}
22201
22202
22203static int
22204test_xmlTextWriterWriteAttribute(void) {
22205    int ret = 0;
22206
22207#ifdef LIBXML_WRITER_ENABLED
22208    int mem_base;
22209    int ret_val;
22210    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22211    int n_writer;
22212    const xmlChar * name; /* attribute name */
22213    int n_name;
22214    const xmlChar * content; /* attribute content */
22215    int n_content;
22216
22217    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22218    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22219    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22220        mem_base = xmlMemBlocks();
22221        writer = gen_xmlTextWriterPtr(n_writer, 0);
22222        name = gen_const_xmlChar_ptr(n_name, 1);
22223        content = gen_const_xmlChar_ptr(n_content, 2);
22224
22225        ret_val = xmlTextWriterWriteAttribute(writer, name, content);
22226        desret_int(ret_val);
22227        call_tests++;
22228        des_xmlTextWriterPtr(n_writer, writer, 0);
22229        des_const_xmlChar_ptr(n_name, name, 1);
22230        des_const_xmlChar_ptr(n_content, content, 2);
22231        xmlResetLastError();
22232        if (mem_base != xmlMemBlocks()) {
22233            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
22234	           xmlMemBlocks() - mem_base);
22235	    ret++;
22236            printf(" %d", n_writer);
22237            printf(" %d", n_name);
22238            printf(" %d", n_content);
22239            printf("\n");
22240        }
22241    }
22242    }
22243    }
22244#endif
22245
22246    function_tests++;
22247    return(ret);
22248}
22249
22250
22251static int
22252test_xmlTextWriterWriteAttributeNS(void) {
22253    int ret = 0;
22254
22255#ifdef LIBXML_WRITER_ENABLED
22256    int mem_base;
22257    int ret_val;
22258    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22259    int n_writer;
22260    const xmlChar * prefix; /* namespace prefix */
22261    int n_prefix;
22262    const xmlChar * name; /* attribute local name */
22263    int n_name;
22264    const xmlChar * namespaceURI; /* namespace URI */
22265    int n_namespaceURI;
22266    const xmlChar * content; /* attribute content */
22267    int n_content;
22268
22269    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22270    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
22271    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22272    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
22273    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22274        mem_base = xmlMemBlocks();
22275        writer = gen_xmlTextWriterPtr(n_writer, 0);
22276        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
22277        name = gen_const_xmlChar_ptr(n_name, 2);
22278        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
22279        content = gen_const_xmlChar_ptr(n_content, 4);
22280
22281        ret_val = xmlTextWriterWriteAttributeNS(writer, prefix, name, namespaceURI, content);
22282        desret_int(ret_val);
22283        call_tests++;
22284        des_xmlTextWriterPtr(n_writer, writer, 0);
22285        des_const_xmlChar_ptr(n_prefix, prefix, 1);
22286        des_const_xmlChar_ptr(n_name, name, 2);
22287        des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
22288        des_const_xmlChar_ptr(n_content, content, 4);
22289        xmlResetLastError();
22290        if (mem_base != xmlMemBlocks()) {
22291            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
22292	           xmlMemBlocks() - mem_base);
22293	    ret++;
22294            printf(" %d", n_writer);
22295            printf(" %d", n_prefix);
22296            printf(" %d", n_name);
22297            printf(" %d", n_namespaceURI);
22298            printf(" %d", n_content);
22299            printf("\n");
22300        }
22301    }
22302    }
22303    }
22304    }
22305    }
22306#endif
22307
22308    function_tests++;
22309    return(ret);
22310}
22311
22312
22313static int
22314test_xmlTextWriterWriteBase64(void) {
22315    int ret = 0;
22316
22317#ifdef LIBXML_WRITER_ENABLED
22318    int mem_base;
22319    int ret_val;
22320    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22321    int n_writer;
22322    const char * data; /* binary data */
22323    int n_data;
22324    int start; /* the position within the data of the first byte to encode */
22325    int n_start;
22326    int len; /* the number of bytes to encode */
22327    int n_len;
22328
22329    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22330    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
22331    for (n_start = 0;n_start < gen_nb_int;n_start++) {
22332    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22333        mem_base = xmlMemBlocks();
22334        writer = gen_xmlTextWriterPtr(n_writer, 0);
22335        data = gen_const_char_ptr(n_data, 1);
22336        start = gen_int(n_start, 2);
22337        len = gen_int(n_len, 3);
22338
22339        ret_val = xmlTextWriterWriteBase64(writer, data, start, len);
22340        desret_int(ret_val);
22341        call_tests++;
22342        des_xmlTextWriterPtr(n_writer, writer, 0);
22343        des_const_char_ptr(n_data, data, 1);
22344        des_int(n_start, start, 2);
22345        des_int(n_len, len, 3);
22346        xmlResetLastError();
22347        if (mem_base != xmlMemBlocks()) {
22348            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
22349	           xmlMemBlocks() - mem_base);
22350	    ret++;
22351            printf(" %d", n_writer);
22352            printf(" %d", n_data);
22353            printf(" %d", n_start);
22354            printf(" %d", n_len);
22355            printf("\n");
22356        }
22357    }
22358    }
22359    }
22360    }
22361#endif
22362
22363    function_tests++;
22364    return(ret);
22365}
22366
22367
22368static int
22369test_xmlTextWriterWriteBinHex(void) {
22370    int ret = 0;
22371
22372#ifdef LIBXML_WRITER_ENABLED
22373    int mem_base;
22374    int ret_val;
22375    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22376    int n_writer;
22377    const char * data; /* binary data */
22378    int n_data;
22379    int start; /* the position within the data of the first byte to encode */
22380    int n_start;
22381    int len; /* the number of bytes to encode */
22382    int n_len;
22383
22384    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22385    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
22386    for (n_start = 0;n_start < gen_nb_int;n_start++) {
22387    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22388        mem_base = xmlMemBlocks();
22389        writer = gen_xmlTextWriterPtr(n_writer, 0);
22390        data = gen_const_char_ptr(n_data, 1);
22391        start = gen_int(n_start, 2);
22392        len = gen_int(n_len, 3);
22393
22394        ret_val = xmlTextWriterWriteBinHex(writer, data, start, len);
22395        desret_int(ret_val);
22396        call_tests++;
22397        des_xmlTextWriterPtr(n_writer, writer, 0);
22398        des_const_char_ptr(n_data, data, 1);
22399        des_int(n_start, start, 2);
22400        des_int(n_len, len, 3);
22401        xmlResetLastError();
22402        if (mem_base != xmlMemBlocks()) {
22403            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
22404	           xmlMemBlocks() - mem_base);
22405	    ret++;
22406            printf(" %d", n_writer);
22407            printf(" %d", n_data);
22408            printf(" %d", n_start);
22409            printf(" %d", n_len);
22410            printf("\n");
22411        }
22412    }
22413    }
22414    }
22415    }
22416#endif
22417
22418    function_tests++;
22419    return(ret);
22420}
22421
22422
22423static int
22424test_xmlTextWriterWriteCDATA(void) {
22425    int ret = 0;
22426
22427#ifdef LIBXML_WRITER_ENABLED
22428    int mem_base;
22429    int ret_val;
22430    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22431    int n_writer;
22432    const xmlChar * content; /* CDATA content */
22433    int n_content;
22434
22435    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22436    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22437        mem_base = xmlMemBlocks();
22438        writer = gen_xmlTextWriterPtr(n_writer, 0);
22439        content = gen_const_xmlChar_ptr(n_content, 1);
22440
22441        ret_val = xmlTextWriterWriteCDATA(writer, content);
22442        desret_int(ret_val);
22443        call_tests++;
22444        des_xmlTextWriterPtr(n_writer, writer, 0);
22445        des_const_xmlChar_ptr(n_content, content, 1);
22446        xmlResetLastError();
22447        if (mem_base != xmlMemBlocks()) {
22448            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
22449	           xmlMemBlocks() - mem_base);
22450	    ret++;
22451            printf(" %d", n_writer);
22452            printf(" %d", n_content);
22453            printf("\n");
22454        }
22455    }
22456    }
22457#endif
22458
22459    function_tests++;
22460    return(ret);
22461}
22462
22463
22464static int
22465test_xmlTextWriterWriteComment(void) {
22466    int ret = 0;
22467
22468#ifdef LIBXML_WRITER_ENABLED
22469    int mem_base;
22470    int ret_val;
22471    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22472    int n_writer;
22473    const xmlChar * content; /* comment string */
22474    int n_content;
22475
22476    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22477    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22478        mem_base = xmlMemBlocks();
22479        writer = gen_xmlTextWriterPtr(n_writer, 0);
22480        content = gen_const_xmlChar_ptr(n_content, 1);
22481
22482        ret_val = xmlTextWriterWriteComment(writer, content);
22483        desret_int(ret_val);
22484        call_tests++;
22485        des_xmlTextWriterPtr(n_writer, writer, 0);
22486        des_const_xmlChar_ptr(n_content, content, 1);
22487        xmlResetLastError();
22488        if (mem_base != xmlMemBlocks()) {
22489            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
22490	           xmlMemBlocks() - mem_base);
22491	    ret++;
22492            printf(" %d", n_writer);
22493            printf(" %d", n_content);
22494            printf("\n");
22495        }
22496    }
22497    }
22498#endif
22499
22500    function_tests++;
22501    return(ret);
22502}
22503
22504
22505static int
22506test_xmlTextWriterWriteDTD(void) {
22507    int ret = 0;
22508
22509#ifdef LIBXML_WRITER_ENABLED
22510    int mem_base;
22511    int ret_val;
22512    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22513    int n_writer;
22514    const xmlChar * name; /* the name of the DTD */
22515    int n_name;
22516    const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
22517    int n_pubid;
22518    const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
22519    int n_sysid;
22520    const xmlChar * subset; /* string content of the DTD */
22521    int n_subset;
22522
22523    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22524    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22525    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
22526    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
22527    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
22528        mem_base = xmlMemBlocks();
22529        writer = gen_xmlTextWriterPtr(n_writer, 0);
22530        name = gen_const_xmlChar_ptr(n_name, 1);
22531        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
22532        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
22533        subset = gen_const_xmlChar_ptr(n_subset, 4);
22534
22535        ret_val = xmlTextWriterWriteDTD(writer, name, pubid, sysid, subset);
22536        desret_int(ret_val);
22537        call_tests++;
22538        des_xmlTextWriterPtr(n_writer, writer, 0);
22539        des_const_xmlChar_ptr(n_name, name, 1);
22540        des_const_xmlChar_ptr(n_pubid, pubid, 2);
22541        des_const_xmlChar_ptr(n_sysid, sysid, 3);
22542        des_const_xmlChar_ptr(n_subset, subset, 4);
22543        xmlResetLastError();
22544        if (mem_base != xmlMemBlocks()) {
22545            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
22546	           xmlMemBlocks() - mem_base);
22547	    ret++;
22548            printf(" %d", n_writer);
22549            printf(" %d", n_name);
22550            printf(" %d", n_pubid);
22551            printf(" %d", n_sysid);
22552            printf(" %d", n_subset);
22553            printf("\n");
22554        }
22555    }
22556    }
22557    }
22558    }
22559    }
22560#endif
22561
22562    function_tests++;
22563    return(ret);
22564}
22565
22566
22567static int
22568test_xmlTextWriterWriteDTDAttlist(void) {
22569    int ret = 0;
22570
22571#ifdef LIBXML_WRITER_ENABLED
22572    int mem_base;
22573    int ret_val;
22574    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22575    int n_writer;
22576    const xmlChar * name; /* the name of the DTD ATTLIST */
22577    int n_name;
22578    const xmlChar * content; /* content of the ATTLIST */
22579    int n_content;
22580
22581    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22582    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22583    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22584        mem_base = xmlMemBlocks();
22585        writer = gen_xmlTextWriterPtr(n_writer, 0);
22586        name = gen_const_xmlChar_ptr(n_name, 1);
22587        content = gen_const_xmlChar_ptr(n_content, 2);
22588
22589        ret_val = xmlTextWriterWriteDTDAttlist(writer, name, content);
22590        desret_int(ret_val);
22591        call_tests++;
22592        des_xmlTextWriterPtr(n_writer, writer, 0);
22593        des_const_xmlChar_ptr(n_name, name, 1);
22594        des_const_xmlChar_ptr(n_content, content, 2);
22595        xmlResetLastError();
22596        if (mem_base != xmlMemBlocks()) {
22597            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
22598	           xmlMemBlocks() - mem_base);
22599	    ret++;
22600            printf(" %d", n_writer);
22601            printf(" %d", n_name);
22602            printf(" %d", n_content);
22603            printf("\n");
22604        }
22605    }
22606    }
22607    }
22608#endif
22609
22610    function_tests++;
22611    return(ret);
22612}
22613
22614
22615static int
22616test_xmlTextWriterWriteDTDElement(void) {
22617    int ret = 0;
22618
22619#ifdef LIBXML_WRITER_ENABLED
22620    int mem_base;
22621    int ret_val;
22622    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22623    int n_writer;
22624    const xmlChar * name; /* the name of the DTD element */
22625    int n_name;
22626    const xmlChar * content; /* content of the element */
22627    int n_content;
22628
22629    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22630    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22631    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22632        mem_base = xmlMemBlocks();
22633        writer = gen_xmlTextWriterPtr(n_writer, 0);
22634        name = gen_const_xmlChar_ptr(n_name, 1);
22635        content = gen_const_xmlChar_ptr(n_content, 2);
22636
22637        ret_val = xmlTextWriterWriteDTDElement(writer, name, content);
22638        desret_int(ret_val);
22639        call_tests++;
22640        des_xmlTextWriterPtr(n_writer, writer, 0);
22641        des_const_xmlChar_ptr(n_name, name, 1);
22642        des_const_xmlChar_ptr(n_content, content, 2);
22643        xmlResetLastError();
22644        if (mem_base != xmlMemBlocks()) {
22645            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
22646	           xmlMemBlocks() - mem_base);
22647	    ret++;
22648            printf(" %d", n_writer);
22649            printf(" %d", n_name);
22650            printf(" %d", n_content);
22651            printf("\n");
22652        }
22653    }
22654    }
22655    }
22656#endif
22657
22658    function_tests++;
22659    return(ret);
22660}
22661
22662
22663static int
22664test_xmlTextWriterWriteDTDEntity(void) {
22665    int ret = 0;
22666
22667#ifdef LIBXML_WRITER_ENABLED
22668    int mem_base;
22669    int ret_val;
22670    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22671    int n_writer;
22672    int pe; /* TRUE if this is a parameter entity, FALSE if not */
22673    int n_pe;
22674    const xmlChar * name; /* the name of the DTD entity */
22675    int n_name;
22676    const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
22677    int n_pubid;
22678    const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
22679    int n_sysid;
22680    const xmlChar * ndataid; /* the xml notation name. */
22681    int n_ndataid;
22682    const xmlChar * content; /* content of the entity */
22683    int n_content;
22684
22685    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22686    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
22687    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22688    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
22689    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
22690    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
22691    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22692        mem_base = xmlMemBlocks();
22693        writer = gen_xmlTextWriterPtr(n_writer, 0);
22694        pe = gen_int(n_pe, 1);
22695        name = gen_const_xmlChar_ptr(n_name, 2);
22696        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
22697        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
22698        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
22699        content = gen_const_xmlChar_ptr(n_content, 6);
22700
22701        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, name, pubid, sysid, ndataid, content);
22702        desret_int(ret_val);
22703        call_tests++;
22704        des_xmlTextWriterPtr(n_writer, writer, 0);
22705        des_int(n_pe, pe, 1);
22706        des_const_xmlChar_ptr(n_name, name, 2);
22707        des_const_xmlChar_ptr(n_pubid, pubid, 3);
22708        des_const_xmlChar_ptr(n_sysid, sysid, 4);
22709        des_const_xmlChar_ptr(n_ndataid, ndataid, 5);
22710        des_const_xmlChar_ptr(n_content, content, 6);
22711        xmlResetLastError();
22712        if (mem_base != xmlMemBlocks()) {
22713            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
22714	           xmlMemBlocks() - mem_base);
22715	    ret++;
22716            printf(" %d", n_writer);
22717            printf(" %d", n_pe);
22718            printf(" %d", n_name);
22719            printf(" %d", n_pubid);
22720            printf(" %d", n_sysid);
22721            printf(" %d", n_ndataid);
22722            printf(" %d", n_content);
22723            printf("\n");
22724        }
22725    }
22726    }
22727    }
22728    }
22729    }
22730    }
22731    }
22732#endif
22733
22734    function_tests++;
22735    return(ret);
22736}
22737
22738
22739static int
22740test_xmlTextWriterWriteDTDExternalEntity(void) {
22741    int ret = 0;
22742
22743#ifdef LIBXML_WRITER_ENABLED
22744    int mem_base;
22745    int ret_val;
22746    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22747    int n_writer;
22748    int pe; /* TRUE if this is a parameter entity, FALSE if not */
22749    int n_pe;
22750    const xmlChar * name; /* the name of the DTD entity */
22751    int n_name;
22752    const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
22753    int n_pubid;
22754    const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
22755    int n_sysid;
22756    const xmlChar * ndataid; /* the xml notation name. */
22757    int n_ndataid;
22758
22759    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22760    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
22761    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22762    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
22763    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
22764    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
22765        mem_base = xmlMemBlocks();
22766        writer = gen_xmlTextWriterPtr(n_writer, 0);
22767        pe = gen_int(n_pe, 1);
22768        name = gen_const_xmlChar_ptr(n_name, 2);
22769        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
22770        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
22771        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
22772
22773        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, name, pubid, sysid, ndataid);
22774        desret_int(ret_val);
22775        call_tests++;
22776        des_xmlTextWriterPtr(n_writer, writer, 0);
22777        des_int(n_pe, pe, 1);
22778        des_const_xmlChar_ptr(n_name, name, 2);
22779        des_const_xmlChar_ptr(n_pubid, pubid, 3);
22780        des_const_xmlChar_ptr(n_sysid, sysid, 4);
22781        des_const_xmlChar_ptr(n_ndataid, ndataid, 5);
22782        xmlResetLastError();
22783        if (mem_base != xmlMemBlocks()) {
22784            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
22785	           xmlMemBlocks() - mem_base);
22786	    ret++;
22787            printf(" %d", n_writer);
22788            printf(" %d", n_pe);
22789            printf(" %d", n_name);
22790            printf(" %d", n_pubid);
22791            printf(" %d", n_sysid);
22792            printf(" %d", n_ndataid);
22793            printf("\n");
22794        }
22795    }
22796    }
22797    }
22798    }
22799    }
22800    }
22801#endif
22802
22803    function_tests++;
22804    return(ret);
22805}
22806
22807
22808static int
22809test_xmlTextWriterWriteDTDExternalEntityContents(void) {
22810    int ret = 0;
22811
22812#ifdef LIBXML_WRITER_ENABLED
22813    int mem_base;
22814    int ret_val;
22815    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22816    int n_writer;
22817    const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
22818    int n_pubid;
22819    const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
22820    int n_sysid;
22821    const xmlChar * ndataid; /* the xml notation name. */
22822    int n_ndataid;
22823
22824    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22825    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
22826    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
22827    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
22828        mem_base = xmlMemBlocks();
22829        writer = gen_xmlTextWriterPtr(n_writer, 0);
22830        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
22831        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
22832        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
22833
22834        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, pubid, sysid, ndataid);
22835        desret_int(ret_val);
22836        call_tests++;
22837        des_xmlTextWriterPtr(n_writer, writer, 0);
22838        des_const_xmlChar_ptr(n_pubid, pubid, 1);
22839        des_const_xmlChar_ptr(n_sysid, sysid, 2);
22840        des_const_xmlChar_ptr(n_ndataid, ndataid, 3);
22841        xmlResetLastError();
22842        if (mem_base != xmlMemBlocks()) {
22843            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
22844	           xmlMemBlocks() - mem_base);
22845	    ret++;
22846            printf(" %d", n_writer);
22847            printf(" %d", n_pubid);
22848            printf(" %d", n_sysid);
22849            printf(" %d", n_ndataid);
22850            printf("\n");
22851        }
22852    }
22853    }
22854    }
22855    }
22856#endif
22857
22858    function_tests++;
22859    return(ret);
22860}
22861
22862
22863static int
22864test_xmlTextWriterWriteDTDInternalEntity(void) {
22865    int ret = 0;
22866
22867#ifdef LIBXML_WRITER_ENABLED
22868    int mem_base;
22869    int ret_val;
22870    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22871    int n_writer;
22872    int pe; /* TRUE if this is a parameter entity, FALSE if not */
22873    int n_pe;
22874    const xmlChar * name; /* the name of the DTD entity */
22875    int n_name;
22876    const xmlChar * content; /* content of the entity */
22877    int n_content;
22878
22879    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22880    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
22881    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22882    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22883        mem_base = xmlMemBlocks();
22884        writer = gen_xmlTextWriterPtr(n_writer, 0);
22885        pe = gen_int(n_pe, 1);
22886        name = gen_const_xmlChar_ptr(n_name, 2);
22887        content = gen_const_xmlChar_ptr(n_content, 3);
22888
22889        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, name, content);
22890        desret_int(ret_val);
22891        call_tests++;
22892        des_xmlTextWriterPtr(n_writer, writer, 0);
22893        des_int(n_pe, pe, 1);
22894        des_const_xmlChar_ptr(n_name, name, 2);
22895        des_const_xmlChar_ptr(n_content, content, 3);
22896        xmlResetLastError();
22897        if (mem_base != xmlMemBlocks()) {
22898            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
22899	           xmlMemBlocks() - mem_base);
22900	    ret++;
22901            printf(" %d", n_writer);
22902            printf(" %d", n_pe);
22903            printf(" %d", n_name);
22904            printf(" %d", n_content);
22905            printf("\n");
22906        }
22907    }
22908    }
22909    }
22910    }
22911#endif
22912
22913    function_tests++;
22914    return(ret);
22915}
22916
22917
22918static int
22919test_xmlTextWriterWriteDTDNotation(void) {
22920    int ret = 0;
22921
22922#ifdef LIBXML_WRITER_ENABLED
22923    int mem_base;
22924    int ret_val;
22925    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22926    int n_writer;
22927    const xmlChar * name; /* the name of the xml notation */
22928    int n_name;
22929    const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
22930    int n_pubid;
22931    const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
22932    int n_sysid;
22933
22934    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22935    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22936    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
22937    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
22938        mem_base = xmlMemBlocks();
22939        writer = gen_xmlTextWriterPtr(n_writer, 0);
22940        name = gen_const_xmlChar_ptr(n_name, 1);
22941        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
22942        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
22943
22944        ret_val = xmlTextWriterWriteDTDNotation(writer, name, pubid, sysid);
22945        desret_int(ret_val);
22946        call_tests++;
22947        des_xmlTextWriterPtr(n_writer, writer, 0);
22948        des_const_xmlChar_ptr(n_name, name, 1);
22949        des_const_xmlChar_ptr(n_pubid, pubid, 2);
22950        des_const_xmlChar_ptr(n_sysid, sysid, 3);
22951        xmlResetLastError();
22952        if (mem_base != xmlMemBlocks()) {
22953            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
22954	           xmlMemBlocks() - mem_base);
22955	    ret++;
22956            printf(" %d", n_writer);
22957            printf(" %d", n_name);
22958            printf(" %d", n_pubid);
22959            printf(" %d", n_sysid);
22960            printf("\n");
22961        }
22962    }
22963    }
22964    }
22965    }
22966#endif
22967
22968    function_tests++;
22969    return(ret);
22970}
22971
22972
22973static int
22974test_xmlTextWriterWriteElement(void) {
22975    int ret = 0;
22976
22977#ifdef LIBXML_WRITER_ENABLED
22978    int mem_base;
22979    int ret_val;
22980    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
22981    int n_writer;
22982    const xmlChar * name; /* element name */
22983    int n_name;
22984    const xmlChar * content; /* element content */
22985    int n_content;
22986
22987    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
22988    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22989    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22990        mem_base = xmlMemBlocks();
22991        writer = gen_xmlTextWriterPtr(n_writer, 0);
22992        name = gen_const_xmlChar_ptr(n_name, 1);
22993        content = gen_const_xmlChar_ptr(n_content, 2);
22994
22995        ret_val = xmlTextWriterWriteElement(writer, name, content);
22996        desret_int(ret_val);
22997        call_tests++;
22998        des_xmlTextWriterPtr(n_writer, writer, 0);
22999        des_const_xmlChar_ptr(n_name, name, 1);
23000        des_const_xmlChar_ptr(n_content, content, 2);
23001        xmlResetLastError();
23002        if (mem_base != xmlMemBlocks()) {
23003            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
23004	           xmlMemBlocks() - mem_base);
23005	    ret++;
23006            printf(" %d", n_writer);
23007            printf(" %d", n_name);
23008            printf(" %d", n_content);
23009            printf("\n");
23010        }
23011    }
23012    }
23013    }
23014#endif
23015
23016    function_tests++;
23017    return(ret);
23018}
23019
23020
23021static int
23022test_xmlTextWriterWriteElementNS(void) {
23023    int ret = 0;
23024
23025#ifdef LIBXML_WRITER_ENABLED
23026    int mem_base;
23027    int ret_val;
23028    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
23029    int n_writer;
23030    const xmlChar * prefix; /* namespace prefix */
23031    int n_prefix;
23032    const xmlChar * name; /* element local name */
23033    int n_name;
23034    const xmlChar * namespaceURI; /* namespace URI */
23035    int n_namespaceURI;
23036    const xmlChar * content; /* element content */
23037    int n_content;
23038
23039    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
23040    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
23041    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23042    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
23043    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23044        mem_base = xmlMemBlocks();
23045        writer = gen_xmlTextWriterPtr(n_writer, 0);
23046        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
23047        name = gen_const_xmlChar_ptr(n_name, 2);
23048        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
23049        content = gen_const_xmlChar_ptr(n_content, 4);
23050
23051        ret_val = xmlTextWriterWriteElementNS(writer, prefix, name, namespaceURI, content);
23052        desret_int(ret_val);
23053        call_tests++;
23054        des_xmlTextWriterPtr(n_writer, writer, 0);
23055        des_const_xmlChar_ptr(n_prefix, prefix, 1);
23056        des_const_xmlChar_ptr(n_name, name, 2);
23057        des_const_xmlChar_ptr(n_namespaceURI, namespaceURI, 3);
23058        des_const_xmlChar_ptr(n_content, content, 4);
23059        xmlResetLastError();
23060        if (mem_base != xmlMemBlocks()) {
23061            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
23062	           xmlMemBlocks() - mem_base);
23063	    ret++;
23064            printf(" %d", n_writer);
23065            printf(" %d", n_prefix);
23066            printf(" %d", n_name);
23067            printf(" %d", n_namespaceURI);
23068            printf(" %d", n_content);
23069            printf("\n");
23070        }
23071    }
23072    }
23073    }
23074    }
23075    }
23076#endif
23077
23078    function_tests++;
23079    return(ret);
23080}
23081
23082
23083static int
23084test_xmlTextWriterWriteFormatAttribute(void) {
23085    int ret = 0;
23086
23087
23088    /* missing type support */
23089    return(ret);
23090}
23091
23092
23093static int
23094test_xmlTextWriterWriteFormatAttributeNS(void) {
23095    int ret = 0;
23096
23097
23098    /* missing type support */
23099    return(ret);
23100}
23101
23102
23103static int
23104test_xmlTextWriterWriteFormatCDATA(void) {
23105    int ret = 0;
23106
23107
23108    /* missing type support */
23109    return(ret);
23110}
23111
23112
23113static int
23114test_xmlTextWriterWriteFormatComment(void) {
23115    int ret = 0;
23116
23117
23118    /* missing type support */
23119    return(ret);
23120}
23121
23122
23123static int
23124test_xmlTextWriterWriteFormatDTD(void) {
23125    int ret = 0;
23126
23127
23128    /* missing type support */
23129    return(ret);
23130}
23131
23132
23133static int
23134test_xmlTextWriterWriteFormatDTDAttlist(void) {
23135    int ret = 0;
23136
23137
23138    /* missing type support */
23139    return(ret);
23140}
23141
23142
23143static int
23144test_xmlTextWriterWriteFormatDTDElement(void) {
23145    int ret = 0;
23146
23147
23148    /* missing type support */
23149    return(ret);
23150}
23151
23152
23153static int
23154test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
23155    int ret = 0;
23156
23157
23158    /* missing type support */
23159    return(ret);
23160}
23161
23162
23163static int
23164test_xmlTextWriterWriteFormatElement(void) {
23165    int ret = 0;
23166
23167
23168    /* missing type support */
23169    return(ret);
23170}
23171
23172
23173static int
23174test_xmlTextWriterWriteFormatElementNS(void) {
23175    int ret = 0;
23176
23177
23178    /* missing type support */
23179    return(ret);
23180}
23181
23182
23183static int
23184test_xmlTextWriterWriteFormatPI(void) {
23185    int ret = 0;
23186
23187
23188    /* missing type support */
23189    return(ret);
23190}
23191
23192
23193static int
23194test_xmlTextWriterWriteFormatRaw(void) {
23195    int ret = 0;
23196
23197
23198    /* missing type support */
23199    return(ret);
23200}
23201
23202
23203static int
23204test_xmlTextWriterWriteFormatString(void) {
23205    int ret = 0;
23206
23207
23208    /* missing type support */
23209    return(ret);
23210}
23211
23212
23213static int
23214test_xmlTextWriterWritePI(void) {
23215    int ret = 0;
23216
23217#ifdef LIBXML_WRITER_ENABLED
23218    int mem_base;
23219    int ret_val;
23220    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
23221    int n_writer;
23222    const xmlChar * target; /* PI target */
23223    int n_target;
23224    const xmlChar * content; /* PI content */
23225    int n_content;
23226
23227    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
23228    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
23229    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23230        mem_base = xmlMemBlocks();
23231        writer = gen_xmlTextWriterPtr(n_writer, 0);
23232        target = gen_const_xmlChar_ptr(n_target, 1);
23233        content = gen_const_xmlChar_ptr(n_content, 2);
23234
23235        ret_val = xmlTextWriterWritePI(writer, target, content);
23236        desret_int(ret_val);
23237        call_tests++;
23238        des_xmlTextWriterPtr(n_writer, writer, 0);
23239        des_const_xmlChar_ptr(n_target, target, 1);
23240        des_const_xmlChar_ptr(n_content, content, 2);
23241        xmlResetLastError();
23242        if (mem_base != xmlMemBlocks()) {
23243            printf("Leak of %d blocks found in xmlTextWriterWritePI",
23244	           xmlMemBlocks() - mem_base);
23245	    ret++;
23246            printf(" %d", n_writer);
23247            printf(" %d", n_target);
23248            printf(" %d", n_content);
23249            printf("\n");
23250        }
23251    }
23252    }
23253    }
23254#endif
23255
23256    function_tests++;
23257    return(ret);
23258}
23259
23260
23261static int
23262test_xmlTextWriterWriteRaw(void) {
23263    int ret = 0;
23264
23265#ifdef LIBXML_WRITER_ENABLED
23266    int mem_base;
23267    int ret_val;
23268    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
23269    int n_writer;
23270    const xmlChar * content; /* text string */
23271    int n_content;
23272
23273    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
23274    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23275        mem_base = xmlMemBlocks();
23276        writer = gen_xmlTextWriterPtr(n_writer, 0);
23277        content = gen_const_xmlChar_ptr(n_content, 1);
23278
23279        ret_val = xmlTextWriterWriteRaw(writer, content);
23280        desret_int(ret_val);
23281        call_tests++;
23282        des_xmlTextWriterPtr(n_writer, writer, 0);
23283        des_const_xmlChar_ptr(n_content, content, 1);
23284        xmlResetLastError();
23285        if (mem_base != xmlMemBlocks()) {
23286            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
23287	           xmlMemBlocks() - mem_base);
23288	    ret++;
23289            printf(" %d", n_writer);
23290            printf(" %d", n_content);
23291            printf("\n");
23292        }
23293    }
23294    }
23295#endif
23296
23297    function_tests++;
23298    return(ret);
23299}
23300
23301
23302static int
23303test_xmlTextWriterWriteRawLen(void) {
23304    int ret = 0;
23305
23306#ifdef LIBXML_WRITER_ENABLED
23307    int mem_base;
23308    int ret_val;
23309    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
23310    int n_writer;
23311    const xmlChar * content; /* text string */
23312    int n_content;
23313    int len; /* length of the text string */
23314    int n_len;
23315
23316    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
23317    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23318    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23319        mem_base = xmlMemBlocks();
23320        writer = gen_xmlTextWriterPtr(n_writer, 0);
23321        content = gen_const_xmlChar_ptr(n_content, 1);
23322        len = gen_int(n_len, 2);
23323
23324        ret_val = xmlTextWriterWriteRawLen(writer, content, len);
23325        desret_int(ret_val);
23326        call_tests++;
23327        des_xmlTextWriterPtr(n_writer, writer, 0);
23328        des_const_xmlChar_ptr(n_content, content, 1);
23329        des_int(n_len, len, 2);
23330        xmlResetLastError();
23331        if (mem_base != xmlMemBlocks()) {
23332            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
23333	           xmlMemBlocks() - mem_base);
23334	    ret++;
23335            printf(" %d", n_writer);
23336            printf(" %d", n_content);
23337            printf(" %d", n_len);
23338            printf("\n");
23339        }
23340    }
23341    }
23342    }
23343#endif
23344
23345    function_tests++;
23346    return(ret);
23347}
23348
23349
23350static int
23351test_xmlTextWriterWriteString(void) {
23352    int ret = 0;
23353
23354#ifdef LIBXML_WRITER_ENABLED
23355    int mem_base;
23356    int ret_val;
23357    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
23358    int n_writer;
23359    const xmlChar * content; /* text string */
23360    int n_content;
23361
23362    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
23363    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23364        mem_base = xmlMemBlocks();
23365        writer = gen_xmlTextWriterPtr(n_writer, 0);
23366        content = gen_const_xmlChar_ptr(n_content, 1);
23367
23368        ret_val = xmlTextWriterWriteString(writer, content);
23369        desret_int(ret_val);
23370        call_tests++;
23371        des_xmlTextWriterPtr(n_writer, writer, 0);
23372        des_const_xmlChar_ptr(n_content, content, 1);
23373        xmlResetLastError();
23374        if (mem_base != xmlMemBlocks()) {
23375            printf("Leak of %d blocks found in xmlTextWriterWriteString",
23376	           xmlMemBlocks() - mem_base);
23377	    ret++;
23378            printf(" %d", n_writer);
23379            printf(" %d", n_content);
23380            printf("\n");
23381        }
23382    }
23383    }
23384#endif
23385
23386    function_tests++;
23387    return(ret);
23388}
23389
23390
23391static int
23392test_xmlTextWriterWriteVFormatAttribute(void) {
23393    int ret = 0;
23394
23395
23396    /* missing type support */
23397    return(ret);
23398}
23399
23400
23401static int
23402test_xmlTextWriterWriteVFormatAttributeNS(void) {
23403    int ret = 0;
23404
23405
23406    /* missing type support */
23407    return(ret);
23408}
23409
23410
23411static int
23412test_xmlTextWriterWriteVFormatCDATA(void) {
23413    int ret = 0;
23414
23415
23416    /* missing type support */
23417    return(ret);
23418}
23419
23420
23421static int
23422test_xmlTextWriterWriteVFormatComment(void) {
23423    int ret = 0;
23424
23425
23426    /* missing type support */
23427    return(ret);
23428}
23429
23430
23431static int
23432test_xmlTextWriterWriteVFormatDTD(void) {
23433    int ret = 0;
23434
23435
23436    /* missing type support */
23437    return(ret);
23438}
23439
23440
23441static int
23442test_xmlTextWriterWriteVFormatDTDAttlist(void) {
23443    int ret = 0;
23444
23445
23446    /* missing type support */
23447    return(ret);
23448}
23449
23450
23451static int
23452test_xmlTextWriterWriteVFormatDTDElement(void) {
23453    int ret = 0;
23454
23455
23456    /* missing type support */
23457    return(ret);
23458}
23459
23460
23461static int
23462test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
23463    int ret = 0;
23464
23465
23466    /* missing type support */
23467    return(ret);
23468}
23469
23470
23471static int
23472test_xmlTextWriterWriteVFormatElement(void) {
23473    int ret = 0;
23474
23475
23476    /* missing type support */
23477    return(ret);
23478}
23479
23480
23481static int
23482test_xmlTextWriterWriteVFormatElementNS(void) {
23483    int ret = 0;
23484
23485
23486    /* missing type support */
23487    return(ret);
23488}
23489
23490
23491static int
23492test_xmlTextWriterWriteVFormatPI(void) {
23493    int ret = 0;
23494
23495
23496    /* missing type support */
23497    return(ret);
23498}
23499
23500
23501static int
23502test_xmlTextWriterWriteVFormatRaw(void) {
23503    int ret = 0;
23504
23505
23506    /* missing type support */
23507    return(ret);
23508}
23509
23510
23511static int
23512test_xmlTextWriterWriteVFormatString(void) {
23513    int ret = 0;
23514
23515
23516    /* missing type support */
23517    return(ret);
23518}
23519
23520static int
23521test_xmlwriter(void) {
23522    int ret = 0;
23523
23524    printf("Testing xmlwriter : 46 of 79 functions ...\n");
23525    ret += test_xmlNewTextWriter();
23526    ret += test_xmlNewTextWriterDoc();
23527    ret += test_xmlNewTextWriterFilename();
23528    ret += test_xmlNewTextWriterMemory();
23529    ret += test_xmlNewTextWriterPushParser();
23530    ret += test_xmlNewTextWriterTree();
23531    ret += test_xmlTextWriterEndAttribute();
23532    ret += test_xmlTextWriterEndCDATA();
23533    ret += test_xmlTextWriterEndComment();
23534    ret += test_xmlTextWriterEndDTD();
23535    ret += test_xmlTextWriterEndDTDAttlist();
23536    ret += test_xmlTextWriterEndDTDElement();
23537    ret += test_xmlTextWriterEndDTDEntity();
23538    ret += test_xmlTextWriterEndDocument();
23539    ret += test_xmlTextWriterEndElement();
23540    ret += test_xmlTextWriterEndPI();
23541    ret += test_xmlTextWriterFlush();
23542    ret += test_xmlTextWriterFullEndElement();
23543    ret += test_xmlTextWriterSetIndent();
23544    ret += test_xmlTextWriterSetIndentString();
23545    ret += test_xmlTextWriterStartAttribute();
23546    ret += test_xmlTextWriterStartAttributeNS();
23547    ret += test_xmlTextWriterStartCDATA();
23548    ret += test_xmlTextWriterStartComment();
23549    ret += test_xmlTextWriterStartDTD();
23550    ret += test_xmlTextWriterStartDTDAttlist();
23551    ret += test_xmlTextWriterStartDTDElement();
23552    ret += test_xmlTextWriterStartDTDEntity();
23553    ret += test_xmlTextWriterStartDocument();
23554    ret += test_xmlTextWriterStartElement();
23555    ret += test_xmlTextWriterStartElementNS();
23556    ret += test_xmlTextWriterStartPI();
23557    ret += test_xmlTextWriterWriteAttribute();
23558    ret += test_xmlTextWriterWriteAttributeNS();
23559    ret += test_xmlTextWriterWriteBase64();
23560    ret += test_xmlTextWriterWriteBinHex();
23561    ret += test_xmlTextWriterWriteCDATA();
23562    ret += test_xmlTextWriterWriteComment();
23563    ret += test_xmlTextWriterWriteDTD();
23564    ret += test_xmlTextWriterWriteDTDAttlist();
23565    ret += test_xmlTextWriterWriteDTDElement();
23566    ret += test_xmlTextWriterWriteDTDEntity();
23567    ret += test_xmlTextWriterWriteDTDExternalEntity();
23568    ret += test_xmlTextWriterWriteDTDExternalEntityContents();
23569    ret += test_xmlTextWriterWriteDTDInternalEntity();
23570    ret += test_xmlTextWriterWriteDTDNotation();
23571    ret += test_xmlTextWriterWriteElement();
23572    ret += test_xmlTextWriterWriteElementNS();
23573    ret += test_xmlTextWriterWriteFormatAttribute();
23574    ret += test_xmlTextWriterWriteFormatAttributeNS();
23575    ret += test_xmlTextWriterWriteFormatCDATA();
23576    ret += test_xmlTextWriterWriteFormatComment();
23577    ret += test_xmlTextWriterWriteFormatDTD();
23578    ret += test_xmlTextWriterWriteFormatDTDAttlist();
23579    ret += test_xmlTextWriterWriteFormatDTDElement();
23580    ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
23581    ret += test_xmlTextWriterWriteFormatElement();
23582    ret += test_xmlTextWriterWriteFormatElementNS();
23583    ret += test_xmlTextWriterWriteFormatPI();
23584    ret += test_xmlTextWriterWriteFormatRaw();
23585    ret += test_xmlTextWriterWriteFormatString();
23586    ret += test_xmlTextWriterWritePI();
23587    ret += test_xmlTextWriterWriteRaw();
23588    ret += test_xmlTextWriterWriteRawLen();
23589    ret += test_xmlTextWriterWriteString();
23590    ret += test_xmlTextWriterWriteVFormatAttribute();
23591    ret += test_xmlTextWriterWriteVFormatAttributeNS();
23592    ret += test_xmlTextWriterWriteVFormatCDATA();
23593    ret += test_xmlTextWriterWriteVFormatComment();
23594    ret += test_xmlTextWriterWriteVFormatDTD();
23595    ret += test_xmlTextWriterWriteVFormatDTDAttlist();
23596    ret += test_xmlTextWriterWriteVFormatDTDElement();
23597    ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
23598    ret += test_xmlTextWriterWriteVFormatElement();
23599    ret += test_xmlTextWriterWriteVFormatElementNS();
23600    ret += test_xmlTextWriterWriteVFormatPI();
23601    ret += test_xmlTextWriterWriteVFormatRaw();
23602    ret += test_xmlTextWriterWriteVFormatString();
23603
23604    if (ret != 0)
23605	printf("Module xmlwriter: %d errors\n", ret);
23606    return(ret);
23607}
23608
23609static int
23610test_xmlXPathCastBooleanToNumber(void) {
23611    int ret = 0;
23612
23613#ifdef LIBXML_XPATH_ENABLED
23614    int mem_base;
23615    double ret_val;
23616    int val; /* a boolean */
23617    int n_val;
23618
23619    for (n_val = 0;n_val < gen_nb_int;n_val++) {
23620        mem_base = xmlMemBlocks();
23621        val = gen_int(n_val, 0);
23622
23623        ret_val = xmlXPathCastBooleanToNumber(val);
23624        desret_double(ret_val);
23625        call_tests++;
23626        des_int(n_val, val, 0);
23627        xmlResetLastError();
23628        if (mem_base != xmlMemBlocks()) {
23629            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
23630	           xmlMemBlocks() - mem_base);
23631	    ret++;
23632            printf(" %d", n_val);
23633            printf("\n");
23634        }
23635    }
23636#endif
23637
23638    function_tests++;
23639    return(ret);
23640}
23641
23642
23643static int
23644test_xmlXPathCastBooleanToString(void) {
23645    int ret = 0;
23646
23647#ifdef LIBXML_XPATH_ENABLED
23648    int mem_base;
23649    xmlChar * ret_val;
23650    int val; /* a boolean */
23651    int n_val;
23652
23653    for (n_val = 0;n_val < gen_nb_int;n_val++) {
23654        mem_base = xmlMemBlocks();
23655        val = gen_int(n_val, 0);
23656
23657        ret_val = xmlXPathCastBooleanToString(val);
23658        desret_xmlChar_ptr(ret_val);
23659        call_tests++;
23660        des_int(n_val, val, 0);
23661        xmlResetLastError();
23662        if (mem_base != xmlMemBlocks()) {
23663            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
23664	           xmlMemBlocks() - mem_base);
23665	    ret++;
23666            printf(" %d", n_val);
23667            printf("\n");
23668        }
23669    }
23670#endif
23671
23672    function_tests++;
23673    return(ret);
23674}
23675
23676
23677static int
23678test_xmlXPathCastNodeSetToBoolean(void) {
23679    int ret = 0;
23680
23681
23682    /* missing type support */
23683    return(ret);
23684}
23685
23686
23687static int
23688test_xmlXPathCastNodeSetToNumber(void) {
23689    int ret = 0;
23690
23691
23692    /* missing type support */
23693    return(ret);
23694}
23695
23696
23697static int
23698test_xmlXPathCastNodeSetToString(void) {
23699    int ret = 0;
23700
23701
23702    /* missing type support */
23703    return(ret);
23704}
23705
23706
23707static int
23708test_xmlXPathCastNodeToNumber(void) {
23709    int ret = 0;
23710
23711#ifdef LIBXML_XPATH_ENABLED
23712    int mem_base;
23713    double ret_val;
23714    xmlNodePtr node; /* a node */
23715    int n_node;
23716
23717    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23718        mem_base = xmlMemBlocks();
23719        node = gen_xmlNodePtr(n_node, 0);
23720
23721        ret_val = xmlXPathCastNodeToNumber(node);
23722        desret_double(ret_val);
23723        call_tests++;
23724        des_xmlNodePtr(n_node, node, 0);
23725        xmlResetLastError();
23726        if (mem_base != xmlMemBlocks()) {
23727            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
23728	           xmlMemBlocks() - mem_base);
23729	    ret++;
23730            printf(" %d", n_node);
23731            printf("\n");
23732        }
23733    }
23734#endif
23735
23736    function_tests++;
23737    return(ret);
23738}
23739
23740
23741static int
23742test_xmlXPathCastNodeToString(void) {
23743    int ret = 0;
23744
23745#ifdef LIBXML_XPATH_ENABLED
23746    int mem_base;
23747    xmlChar * ret_val;
23748    xmlNodePtr node; /* a node */
23749    int n_node;
23750
23751    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23752        mem_base = xmlMemBlocks();
23753        node = gen_xmlNodePtr(n_node, 0);
23754
23755        ret_val = xmlXPathCastNodeToString(node);
23756        desret_xmlChar_ptr(ret_val);
23757        call_tests++;
23758        des_xmlNodePtr(n_node, node, 0);
23759        xmlResetLastError();
23760        if (mem_base != xmlMemBlocks()) {
23761            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
23762	           xmlMemBlocks() - mem_base);
23763	    ret++;
23764            printf(" %d", n_node);
23765            printf("\n");
23766        }
23767    }
23768#endif
23769
23770    function_tests++;
23771    return(ret);
23772}
23773
23774
23775static int
23776test_xmlXPathCastNumberToBoolean(void) {
23777    int ret = 0;
23778
23779
23780    /* missing type support */
23781    return(ret);
23782}
23783
23784
23785static int
23786test_xmlXPathCastNumberToString(void) {
23787    int ret = 0;
23788
23789
23790    /* missing type support */
23791    return(ret);
23792}
23793
23794
23795static int
23796test_xmlXPathCastStringToBoolean(void) {
23797    int ret = 0;
23798
23799#ifdef LIBXML_XPATH_ENABLED
23800    int mem_base;
23801    int ret_val;
23802    const xmlChar * val; /* a string */
23803    int n_val;
23804
23805    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
23806        mem_base = xmlMemBlocks();
23807        val = gen_const_xmlChar_ptr(n_val, 0);
23808
23809        ret_val = xmlXPathCastStringToBoolean(val);
23810        desret_int(ret_val);
23811        call_tests++;
23812        des_const_xmlChar_ptr(n_val, val, 0);
23813        xmlResetLastError();
23814        if (mem_base != xmlMemBlocks()) {
23815            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
23816	           xmlMemBlocks() - mem_base);
23817	    ret++;
23818            printf(" %d", n_val);
23819            printf("\n");
23820        }
23821    }
23822#endif
23823
23824    function_tests++;
23825    return(ret);
23826}
23827
23828
23829static int
23830test_xmlXPathCastStringToNumber(void) {
23831    int ret = 0;
23832
23833#ifdef LIBXML_XPATH_ENABLED
23834    int mem_base;
23835    double ret_val;
23836    const xmlChar * val; /* a string */
23837    int n_val;
23838
23839    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
23840        mem_base = xmlMemBlocks();
23841        val = gen_const_xmlChar_ptr(n_val, 0);
23842
23843        ret_val = xmlXPathCastStringToNumber(val);
23844        desret_double(ret_val);
23845        call_tests++;
23846        des_const_xmlChar_ptr(n_val, val, 0);
23847        xmlResetLastError();
23848        if (mem_base != xmlMemBlocks()) {
23849            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
23850	           xmlMemBlocks() - mem_base);
23851	    ret++;
23852            printf(" %d", n_val);
23853            printf("\n");
23854        }
23855    }
23856#endif
23857
23858    function_tests++;
23859    return(ret);
23860}
23861
23862
23863static int
23864test_xmlXPathCastToBoolean(void) {
23865    int ret = 0;
23866
23867#ifdef LIBXML_XPATH_ENABLED
23868    int mem_base;
23869    int ret_val;
23870    xmlXPathObjectPtr val; /* an XPath object */
23871    int n_val;
23872
23873    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
23874        mem_base = xmlMemBlocks();
23875        val = gen_xmlXPathObjectPtr(n_val, 0);
23876
23877        ret_val = xmlXPathCastToBoolean(val);
23878        desret_int(ret_val);
23879        call_tests++;
23880        des_xmlXPathObjectPtr(n_val, val, 0);
23881        xmlResetLastError();
23882        if (mem_base != xmlMemBlocks()) {
23883            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
23884	           xmlMemBlocks() - mem_base);
23885	    ret++;
23886            printf(" %d", n_val);
23887            printf("\n");
23888        }
23889    }
23890#endif
23891
23892    function_tests++;
23893    return(ret);
23894}
23895
23896
23897static int
23898test_xmlXPathCastToNumber(void) {
23899    int ret = 0;
23900
23901#ifdef LIBXML_XPATH_ENABLED
23902    int mem_base;
23903    double ret_val;
23904    xmlXPathObjectPtr val; /* an XPath object */
23905    int n_val;
23906
23907    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
23908        mem_base = xmlMemBlocks();
23909        val = gen_xmlXPathObjectPtr(n_val, 0);
23910
23911        ret_val = xmlXPathCastToNumber(val);
23912        desret_double(ret_val);
23913        call_tests++;
23914        des_xmlXPathObjectPtr(n_val, val, 0);
23915        xmlResetLastError();
23916        if (mem_base != xmlMemBlocks()) {
23917            printf("Leak of %d blocks found in xmlXPathCastToNumber",
23918	           xmlMemBlocks() - mem_base);
23919	    ret++;
23920            printf(" %d", n_val);
23921            printf("\n");
23922        }
23923    }
23924#endif
23925
23926    function_tests++;
23927    return(ret);
23928}
23929
23930
23931static int
23932test_xmlXPathCastToString(void) {
23933    int ret = 0;
23934
23935#ifdef LIBXML_XPATH_ENABLED
23936    int mem_base;
23937    xmlChar * ret_val;
23938    xmlXPathObjectPtr val; /* an XPath object */
23939    int n_val;
23940
23941    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
23942        mem_base = xmlMemBlocks();
23943        val = gen_xmlXPathObjectPtr(n_val, 0);
23944
23945        ret_val = xmlXPathCastToString(val);
23946        desret_xmlChar_ptr(ret_val);
23947        call_tests++;
23948        des_xmlXPathObjectPtr(n_val, val, 0);
23949        xmlResetLastError();
23950        if (mem_base != xmlMemBlocks()) {
23951            printf("Leak of %d blocks found in xmlXPathCastToString",
23952	           xmlMemBlocks() - mem_base);
23953	    ret++;
23954            printf(" %d", n_val);
23955            printf("\n");
23956        }
23957    }
23958#endif
23959
23960    function_tests++;
23961    return(ret);
23962}
23963
23964
23965static int
23966test_xmlXPathCmpNodes(void) {
23967    int ret = 0;
23968
23969#ifdef LIBXML_XPATH_ENABLED
23970    int mem_base;
23971    int ret_val;
23972    xmlNodePtr node1; /* the first node */
23973    int n_node1;
23974    xmlNodePtr node2; /* the second node */
23975    int n_node2;
23976
23977    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
23978    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
23979        mem_base = xmlMemBlocks();
23980        node1 = gen_xmlNodePtr(n_node1, 0);
23981        node2 = gen_xmlNodePtr(n_node2, 1);
23982
23983        ret_val = xmlXPathCmpNodes(node1, node2);
23984        desret_int(ret_val);
23985        call_tests++;
23986        des_xmlNodePtr(n_node1, node1, 0);
23987        des_xmlNodePtr(n_node2, node2, 1);
23988        xmlResetLastError();
23989        if (mem_base != xmlMemBlocks()) {
23990            printf("Leak of %d blocks found in xmlXPathCmpNodes",
23991	           xmlMemBlocks() - mem_base);
23992	    ret++;
23993            printf(" %d", n_node1);
23994            printf(" %d", n_node2);
23995            printf("\n");
23996        }
23997    }
23998    }
23999#endif
24000
24001    function_tests++;
24002    return(ret);
24003}
24004
24005
24006static int
24007test_xmlXPathCompile(void) {
24008    int ret = 0;
24009
24010
24011    /* missing type support */
24012    return(ret);
24013}
24014
24015
24016static int
24017test_xmlXPathCompiledEval(void) {
24018    int ret = 0;
24019
24020
24021    /* missing type support */
24022    return(ret);
24023}
24024
24025
24026static int
24027test_xmlXPathConvertBoolean(void) {
24028    int ret = 0;
24029
24030#ifdef LIBXML_XPATH_ENABLED
24031    int mem_base;
24032    xmlXPathObjectPtr ret_val;
24033    xmlXPathObjectPtr val; /* an XPath object */
24034    int n_val;
24035
24036    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
24037        mem_base = xmlMemBlocks();
24038        val = gen_xmlXPathObjectPtr(n_val, 0);
24039
24040        ret_val = xmlXPathConvertBoolean(val);
24041        val = NULL;
24042        desret_xmlXPathObjectPtr(ret_val);
24043        call_tests++;
24044        des_xmlXPathObjectPtr(n_val, val, 0);
24045        xmlResetLastError();
24046        if (mem_base != xmlMemBlocks()) {
24047            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
24048	           xmlMemBlocks() - mem_base);
24049	    ret++;
24050            printf(" %d", n_val);
24051            printf("\n");
24052        }
24053    }
24054#endif
24055
24056    function_tests++;
24057    return(ret);
24058}
24059
24060
24061static int
24062test_xmlXPathConvertNumber(void) {
24063    int ret = 0;
24064
24065#ifdef LIBXML_XPATH_ENABLED
24066    int mem_base;
24067    xmlXPathObjectPtr ret_val;
24068    xmlXPathObjectPtr val; /* an XPath object */
24069    int n_val;
24070
24071    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
24072        mem_base = xmlMemBlocks();
24073        val = gen_xmlXPathObjectPtr(n_val, 0);
24074
24075        ret_val = xmlXPathConvertNumber(val);
24076        val = NULL;
24077        desret_xmlXPathObjectPtr(ret_val);
24078        call_tests++;
24079        des_xmlXPathObjectPtr(n_val, val, 0);
24080        xmlResetLastError();
24081        if (mem_base != xmlMemBlocks()) {
24082            printf("Leak of %d blocks found in xmlXPathConvertNumber",
24083	           xmlMemBlocks() - mem_base);
24084	    ret++;
24085            printf(" %d", n_val);
24086            printf("\n");
24087        }
24088    }
24089#endif
24090
24091    function_tests++;
24092    return(ret);
24093}
24094
24095
24096static int
24097test_xmlXPathConvertString(void) {
24098    int ret = 0;
24099
24100#ifdef LIBXML_XPATH_ENABLED
24101    int mem_base;
24102    xmlXPathObjectPtr ret_val;
24103    xmlXPathObjectPtr val; /* an XPath object */
24104    int n_val;
24105
24106    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
24107        mem_base = xmlMemBlocks();
24108        val = gen_xmlXPathObjectPtr(n_val, 0);
24109
24110        ret_val = xmlXPathConvertString(val);
24111        val = NULL;
24112        desret_xmlXPathObjectPtr(ret_val);
24113        call_tests++;
24114        des_xmlXPathObjectPtr(n_val, val, 0);
24115        xmlResetLastError();
24116        if (mem_base != xmlMemBlocks()) {
24117            printf("Leak of %d blocks found in xmlXPathConvertString",
24118	           xmlMemBlocks() - mem_base);
24119	    ret++;
24120            printf(" %d", n_val);
24121            printf("\n");
24122        }
24123    }
24124#endif
24125
24126    function_tests++;
24127    return(ret);
24128}
24129
24130
24131static int
24132test_xmlXPathCtxtCompile(void) {
24133    int ret = 0;
24134
24135
24136    /* missing type support */
24137    return(ret);
24138}
24139
24140
24141static int
24142test_xmlXPathEval(void) {
24143    int ret = 0;
24144
24145
24146    /* missing type support */
24147    return(ret);
24148}
24149
24150
24151static int
24152test_xmlXPathEvalExpression(void) {
24153    int ret = 0;
24154
24155
24156    /* missing type support */
24157    return(ret);
24158}
24159
24160
24161static int
24162test_xmlXPathEvalPredicate(void) {
24163    int ret = 0;
24164
24165
24166    /* missing type support */
24167    return(ret);
24168}
24169
24170
24171static int
24172test_xmlXPathInit(void) {
24173    int ret = 0;
24174
24175#ifdef LIBXML_XPATH_ENABLED
24176    int mem_base;
24177
24178        mem_base = xmlMemBlocks();
24179
24180        xmlXPathInit();
24181        call_tests++;
24182        xmlResetLastError();
24183        if (mem_base != xmlMemBlocks()) {
24184            printf("Leak of %d blocks found in xmlXPathInit",
24185	           xmlMemBlocks() - mem_base);
24186	    ret++;
24187            printf("\n");
24188        }
24189#endif
24190
24191    function_tests++;
24192    return(ret);
24193}
24194
24195
24196static int
24197test_xmlXPathIsInf(void) {
24198    int ret = 0;
24199
24200
24201    /* missing type support */
24202    return(ret);
24203}
24204
24205
24206static int
24207test_xmlXPathIsNaN(void) {
24208    int ret = 0;
24209
24210
24211    /* missing type support */
24212    return(ret);
24213}
24214
24215
24216static int
24217test_xmlXPathNewContext(void) {
24218    int ret = 0;
24219
24220
24221    /* missing type support */
24222    return(ret);
24223}
24224
24225
24226static int
24227test_xmlXPathNodeSetCreate(void) {
24228    int ret = 0;
24229
24230
24231    /* missing type support */
24232    return(ret);
24233}
24234
24235
24236static int
24237test_xmlXPathObjectCopy(void) {
24238    int ret = 0;
24239
24240#ifdef LIBXML_XPATH_ENABLED
24241    int mem_base;
24242    xmlXPathObjectPtr ret_val;
24243    xmlXPathObjectPtr val; /* the original object */
24244    int n_val;
24245
24246    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
24247        mem_base = xmlMemBlocks();
24248        val = gen_xmlXPathObjectPtr(n_val, 0);
24249
24250        ret_val = xmlXPathObjectCopy(val);
24251        desret_xmlXPathObjectPtr(ret_val);
24252        call_tests++;
24253        des_xmlXPathObjectPtr(n_val, val, 0);
24254        xmlResetLastError();
24255        if (mem_base != xmlMemBlocks()) {
24256            printf("Leak of %d blocks found in xmlXPathObjectCopy",
24257	           xmlMemBlocks() - mem_base);
24258	    ret++;
24259            printf(" %d", n_val);
24260            printf("\n");
24261        }
24262    }
24263#endif
24264
24265    function_tests++;
24266    return(ret);
24267}
24268
24269
24270static int
24271test_xmlXPathOrderDocElems(void) {
24272    int ret = 0;
24273
24274#ifdef LIBXML_XPATH_ENABLED
24275    int mem_base;
24276    long ret_val;
24277    xmlDocPtr doc; /* an input document */
24278    int n_doc;
24279
24280    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24281        mem_base = xmlMemBlocks();
24282        doc = gen_xmlDocPtr(n_doc, 0);
24283
24284        ret_val = xmlXPathOrderDocElems(doc);
24285        desret_long(ret_val);
24286        call_tests++;
24287        des_xmlDocPtr(n_doc, doc, 0);
24288        xmlResetLastError();
24289        if (mem_base != xmlMemBlocks()) {
24290            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
24291	           xmlMemBlocks() - mem_base);
24292	    ret++;
24293            printf(" %d", n_doc);
24294            printf("\n");
24295        }
24296    }
24297#endif
24298
24299    function_tests++;
24300    return(ret);
24301}
24302
24303static int
24304test_xpath(void) {
24305    int ret = 0;
24306
24307    printf("Testing xpath : 16 of 36 functions ...\n");
24308    ret += test_xmlXPathCastBooleanToNumber();
24309    ret += test_xmlXPathCastBooleanToString();
24310    ret += test_xmlXPathCastNodeSetToBoolean();
24311    ret += test_xmlXPathCastNodeSetToNumber();
24312    ret += test_xmlXPathCastNodeSetToString();
24313    ret += test_xmlXPathCastNodeToNumber();
24314    ret += test_xmlXPathCastNodeToString();
24315    ret += test_xmlXPathCastNumberToBoolean();
24316    ret += test_xmlXPathCastNumberToString();
24317    ret += test_xmlXPathCastStringToBoolean();
24318    ret += test_xmlXPathCastStringToNumber();
24319    ret += test_xmlXPathCastToBoolean();
24320    ret += test_xmlXPathCastToNumber();
24321    ret += test_xmlXPathCastToString();
24322    ret += test_xmlXPathCmpNodes();
24323    ret += test_xmlXPathCompile();
24324    ret += test_xmlXPathCompiledEval();
24325    ret += test_xmlXPathConvertBoolean();
24326    ret += test_xmlXPathConvertNumber();
24327    ret += test_xmlXPathConvertString();
24328    ret += test_xmlXPathCtxtCompile();
24329    ret += test_xmlXPathEval();
24330    ret += test_xmlXPathEvalExpression();
24331    ret += test_xmlXPathEvalPredicate();
24332    ret += test_xmlXPathInit();
24333    ret += test_xmlXPathIsInf();
24334    ret += test_xmlXPathIsNaN();
24335    ret += test_xmlXPathNewContext();
24336    ret += test_xmlXPathNodeSetCreate();
24337    ret += test_xmlXPathObjectCopy();
24338    ret += test_xmlXPathOrderDocElems();
24339
24340    if (ret != 0)
24341	printf("Module xpath: %d errors\n", ret);
24342    return(ret);
24343}
24344
24345static int
24346test_xmlXPtrBuildNodeList(void) {
24347    int ret = 0;
24348
24349#ifdef LIBXML_XPTR_ENABLED
24350    int mem_base;
24351    xmlNodePtr ret_val;
24352    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
24353    int n_obj;
24354
24355    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
24356        mem_base = xmlMemBlocks();
24357        obj = gen_xmlXPathObjectPtr(n_obj, 0);
24358
24359        ret_val = xmlXPtrBuildNodeList(obj);
24360        desret_xmlNodePtr(ret_val);
24361        call_tests++;
24362        des_xmlXPathObjectPtr(n_obj, obj, 0);
24363        xmlResetLastError();
24364        if (mem_base != xmlMemBlocks()) {
24365            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
24366	           xmlMemBlocks() - mem_base);
24367	    ret++;
24368            printf(" %d", n_obj);
24369            printf("\n");
24370        }
24371    }
24372#endif
24373
24374    function_tests++;
24375    return(ret);
24376}
24377
24378
24379static int
24380test_xmlXPtrEval(void) {
24381    int ret = 0;
24382
24383
24384    /* missing type support */
24385    return(ret);
24386}
24387
24388
24389static int
24390test_xmlXPtrEvalRangePredicate(void) {
24391    int ret = 0;
24392
24393
24394    /* missing type support */
24395    return(ret);
24396}
24397
24398
24399static int
24400test_xmlXPtrLocationSetAdd(void) {
24401    int ret = 0;
24402
24403
24404    /* missing type support */
24405    return(ret);
24406}
24407
24408
24409static int
24410test_xmlXPtrLocationSetCreate(void) {
24411    int ret = 0;
24412
24413
24414    /* missing type support */
24415    return(ret);
24416}
24417
24418
24419static int
24420test_xmlXPtrLocationSetDel(void) {
24421    int ret = 0;
24422
24423
24424    /* missing type support */
24425    return(ret);
24426}
24427
24428
24429static int
24430test_xmlXPtrLocationSetMerge(void) {
24431    int ret = 0;
24432
24433
24434    /* missing type support */
24435    return(ret);
24436}
24437
24438
24439static int
24440test_xmlXPtrLocationSetRemove(void) {
24441    int ret = 0;
24442
24443
24444    /* missing type support */
24445    return(ret);
24446}
24447
24448
24449static int
24450test_xmlXPtrNewCollapsedRange(void) {
24451    int ret = 0;
24452
24453#ifdef LIBXML_XPTR_ENABLED
24454    int mem_base;
24455    xmlXPathObjectPtr ret_val;
24456    xmlNodePtr start; /* the starting and ending node */
24457    int n_start;
24458
24459    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
24460        mem_base = xmlMemBlocks();
24461        start = gen_xmlNodePtr(n_start, 0);
24462
24463        ret_val = xmlXPtrNewCollapsedRange(start);
24464        desret_xmlXPathObjectPtr(ret_val);
24465        call_tests++;
24466        des_xmlNodePtr(n_start, start, 0);
24467        xmlResetLastError();
24468        if (mem_base != xmlMemBlocks()) {
24469            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
24470	           xmlMemBlocks() - mem_base);
24471	    ret++;
24472            printf(" %d", n_start);
24473            printf("\n");
24474        }
24475    }
24476#endif
24477
24478    function_tests++;
24479    return(ret);
24480}
24481
24482
24483static int
24484test_xmlXPtrNewContext(void) {
24485    int ret = 0;
24486
24487
24488    /* missing type support */
24489    return(ret);
24490}
24491
24492
24493static int
24494test_xmlXPtrNewLocationSetNodeSet(void) {
24495    int ret = 0;
24496
24497
24498    /* missing type support */
24499    return(ret);
24500}
24501
24502
24503static int
24504test_xmlXPtrNewLocationSetNodes(void) {
24505    int ret = 0;
24506
24507#ifdef LIBXML_XPTR_ENABLED
24508    int mem_base;
24509    xmlXPathObjectPtr ret_val;
24510    xmlNodePtr start; /* the start NodePtr value */
24511    int n_start;
24512    xmlNodePtr end; /* the end NodePtr value or NULL */
24513    int n_end;
24514
24515    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
24516    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
24517        mem_base = xmlMemBlocks();
24518        start = gen_xmlNodePtr(n_start, 0);
24519        end = gen_xmlNodePtr(n_end, 1);
24520
24521        ret_val = xmlXPtrNewLocationSetNodes(start, end);
24522        desret_xmlXPathObjectPtr(ret_val);
24523        call_tests++;
24524        des_xmlNodePtr(n_start, start, 0);
24525        des_xmlNodePtr(n_end, end, 1);
24526        xmlResetLastError();
24527        if (mem_base != xmlMemBlocks()) {
24528            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
24529	           xmlMemBlocks() - mem_base);
24530	    ret++;
24531            printf(" %d", n_start);
24532            printf(" %d", n_end);
24533            printf("\n");
24534        }
24535    }
24536    }
24537#endif
24538
24539    function_tests++;
24540    return(ret);
24541}
24542
24543
24544static int
24545test_xmlXPtrNewRange(void) {
24546    int ret = 0;
24547
24548#ifdef LIBXML_XPTR_ENABLED
24549    int mem_base;
24550    xmlXPathObjectPtr ret_val;
24551    xmlNodePtr start; /* the starting node */
24552    int n_start;
24553    int startindex; /* the start index */
24554    int n_startindex;
24555    xmlNodePtr end; /* the ending point */
24556    int n_end;
24557    int endindex; /* the ending index */
24558    int n_endindex;
24559
24560    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
24561    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
24562    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
24563    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
24564        mem_base = xmlMemBlocks();
24565        start = gen_xmlNodePtr(n_start, 0);
24566        startindex = gen_int(n_startindex, 1);
24567        end = gen_xmlNodePtr(n_end, 2);
24568        endindex = gen_int(n_endindex, 3);
24569
24570        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
24571        desret_xmlXPathObjectPtr(ret_val);
24572        call_tests++;
24573        des_xmlNodePtr(n_start, start, 0);
24574        des_int(n_startindex, startindex, 1);
24575        des_xmlNodePtr(n_end, end, 2);
24576        des_int(n_endindex, endindex, 3);
24577        xmlResetLastError();
24578        if (mem_base != xmlMemBlocks()) {
24579            printf("Leak of %d blocks found in xmlXPtrNewRange",
24580	           xmlMemBlocks() - mem_base);
24581	    ret++;
24582            printf(" %d", n_start);
24583            printf(" %d", n_startindex);
24584            printf(" %d", n_end);
24585            printf(" %d", n_endindex);
24586            printf("\n");
24587        }
24588    }
24589    }
24590    }
24591    }
24592#endif
24593
24594    function_tests++;
24595    return(ret);
24596}
24597
24598
24599static int
24600test_xmlXPtrNewRangeNodeObject(void) {
24601    int ret = 0;
24602
24603#ifdef LIBXML_XPTR_ENABLED
24604    int mem_base;
24605    xmlXPathObjectPtr ret_val;
24606    xmlNodePtr start; /* the starting node */
24607    int n_start;
24608    xmlXPathObjectPtr end; /* the ending object */
24609    int n_end;
24610
24611    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
24612    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
24613        mem_base = xmlMemBlocks();
24614        start = gen_xmlNodePtr(n_start, 0);
24615        end = gen_xmlXPathObjectPtr(n_end, 1);
24616
24617        ret_val = xmlXPtrNewRangeNodeObject(start, end);
24618        desret_xmlXPathObjectPtr(ret_val);
24619        call_tests++;
24620        des_xmlNodePtr(n_start, start, 0);
24621        des_xmlXPathObjectPtr(n_end, end, 1);
24622        xmlResetLastError();
24623        if (mem_base != xmlMemBlocks()) {
24624            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
24625	           xmlMemBlocks() - mem_base);
24626	    ret++;
24627            printf(" %d", n_start);
24628            printf(" %d", n_end);
24629            printf("\n");
24630        }
24631    }
24632    }
24633#endif
24634
24635    function_tests++;
24636    return(ret);
24637}
24638
24639
24640static int
24641test_xmlXPtrNewRangeNodePoint(void) {
24642    int ret = 0;
24643
24644#ifdef LIBXML_XPTR_ENABLED
24645    int mem_base;
24646    xmlXPathObjectPtr ret_val;
24647    xmlNodePtr start; /* the starting node */
24648    int n_start;
24649    xmlXPathObjectPtr end; /* the ending point */
24650    int n_end;
24651
24652    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
24653    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
24654        mem_base = xmlMemBlocks();
24655        start = gen_xmlNodePtr(n_start, 0);
24656        end = gen_xmlXPathObjectPtr(n_end, 1);
24657
24658        ret_val = xmlXPtrNewRangeNodePoint(start, end);
24659        desret_xmlXPathObjectPtr(ret_val);
24660        call_tests++;
24661        des_xmlNodePtr(n_start, start, 0);
24662        des_xmlXPathObjectPtr(n_end, end, 1);
24663        xmlResetLastError();
24664        if (mem_base != xmlMemBlocks()) {
24665            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
24666	           xmlMemBlocks() - mem_base);
24667	    ret++;
24668            printf(" %d", n_start);
24669            printf(" %d", n_end);
24670            printf("\n");
24671        }
24672    }
24673    }
24674#endif
24675
24676    function_tests++;
24677    return(ret);
24678}
24679
24680
24681static int
24682test_xmlXPtrNewRangeNodes(void) {
24683    int ret = 0;
24684
24685#ifdef LIBXML_XPTR_ENABLED
24686    int mem_base;
24687    xmlXPathObjectPtr ret_val;
24688    xmlNodePtr start; /* the starting node */
24689    int n_start;
24690    xmlNodePtr end; /* the ending node */
24691    int n_end;
24692
24693    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
24694    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
24695        mem_base = xmlMemBlocks();
24696        start = gen_xmlNodePtr(n_start, 0);
24697        end = gen_xmlNodePtr(n_end, 1);
24698
24699        ret_val = xmlXPtrNewRangeNodes(start, end);
24700        desret_xmlXPathObjectPtr(ret_val);
24701        call_tests++;
24702        des_xmlNodePtr(n_start, start, 0);
24703        des_xmlNodePtr(n_end, end, 1);
24704        xmlResetLastError();
24705        if (mem_base != xmlMemBlocks()) {
24706            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
24707	           xmlMemBlocks() - mem_base);
24708	    ret++;
24709            printf(" %d", n_start);
24710            printf(" %d", n_end);
24711            printf("\n");
24712        }
24713    }
24714    }
24715#endif
24716
24717    function_tests++;
24718    return(ret);
24719}
24720
24721
24722static int
24723test_xmlXPtrNewRangePointNode(void) {
24724    int ret = 0;
24725
24726#ifdef LIBXML_XPTR_ENABLED
24727    int mem_base;
24728    xmlXPathObjectPtr ret_val;
24729    xmlXPathObjectPtr start; /* the starting point */
24730    int n_start;
24731    xmlNodePtr end; /* the ending node */
24732    int n_end;
24733
24734    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
24735    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
24736        mem_base = xmlMemBlocks();
24737        start = gen_xmlXPathObjectPtr(n_start, 0);
24738        end = gen_xmlNodePtr(n_end, 1);
24739
24740        ret_val = xmlXPtrNewRangePointNode(start, end);
24741        desret_xmlXPathObjectPtr(ret_val);
24742        call_tests++;
24743        des_xmlXPathObjectPtr(n_start, start, 0);
24744        des_xmlNodePtr(n_end, end, 1);
24745        xmlResetLastError();
24746        if (mem_base != xmlMemBlocks()) {
24747            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
24748	           xmlMemBlocks() - mem_base);
24749	    ret++;
24750            printf(" %d", n_start);
24751            printf(" %d", n_end);
24752            printf("\n");
24753        }
24754    }
24755    }
24756#endif
24757
24758    function_tests++;
24759    return(ret);
24760}
24761
24762
24763static int
24764test_xmlXPtrNewRangePoints(void) {
24765    int ret = 0;
24766
24767#ifdef LIBXML_XPTR_ENABLED
24768    int mem_base;
24769    xmlXPathObjectPtr ret_val;
24770    xmlXPathObjectPtr start; /* the starting point */
24771    int n_start;
24772    xmlXPathObjectPtr end; /* the ending point */
24773    int n_end;
24774
24775    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
24776    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
24777        mem_base = xmlMemBlocks();
24778        start = gen_xmlXPathObjectPtr(n_start, 0);
24779        end = gen_xmlXPathObjectPtr(n_end, 1);
24780
24781        ret_val = xmlXPtrNewRangePoints(start, end);
24782        desret_xmlXPathObjectPtr(ret_val);
24783        call_tests++;
24784        des_xmlXPathObjectPtr(n_start, start, 0);
24785        des_xmlXPathObjectPtr(n_end, end, 1);
24786        xmlResetLastError();
24787        if (mem_base != xmlMemBlocks()) {
24788            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
24789	           xmlMemBlocks() - mem_base);
24790	    ret++;
24791            printf(" %d", n_start);
24792            printf(" %d", n_end);
24793            printf("\n");
24794        }
24795    }
24796    }
24797#endif
24798
24799    function_tests++;
24800    return(ret);
24801}
24802
24803
24804static int
24805test_xmlXPtrRangeToFunction(void) {
24806    int ret = 0;
24807
24808
24809    /* missing type support */
24810    return(ret);
24811}
24812
24813
24814static int
24815test_xmlXPtrWrapLocationSet(void) {
24816    int ret = 0;
24817
24818
24819    /* missing type support */
24820    return(ret);
24821}
24822
24823static int
24824test_xpointer(void) {
24825    int ret = 0;
24826
24827    printf("Testing xpointer : 9 of 21 functions ...\n");
24828    ret += test_xmlXPtrBuildNodeList();
24829    ret += test_xmlXPtrEval();
24830    ret += test_xmlXPtrEvalRangePredicate();
24831    ret += test_xmlXPtrLocationSetAdd();
24832    ret += test_xmlXPtrLocationSetCreate();
24833    ret += test_xmlXPtrLocationSetDel();
24834    ret += test_xmlXPtrLocationSetMerge();
24835    ret += test_xmlXPtrLocationSetRemove();
24836    ret += test_xmlXPtrNewCollapsedRange();
24837    ret += test_xmlXPtrNewContext();
24838    ret += test_xmlXPtrNewLocationSetNodeSet();
24839    ret += test_xmlXPtrNewLocationSetNodes();
24840    ret += test_xmlXPtrNewRange();
24841    ret += test_xmlXPtrNewRangeNodeObject();
24842    ret += test_xmlXPtrNewRangeNodePoint();
24843    ret += test_xmlXPtrNewRangeNodes();
24844    ret += test_xmlXPtrNewRangePointNode();
24845    ret += test_xmlXPtrNewRangePoints();
24846    ret += test_xmlXPtrRangeToFunction();
24847    ret += test_xmlXPtrWrapLocationSet();
24848
24849    if (ret != 0)
24850	printf("Module xpointer: %d errors\n", ret);
24851    return(ret);
24852}
24853static int
24854test_module(const char *module) {
24855    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
24856    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
24857    if (!strcmp(module, "catalog")) return(test_catalog());
24858    if (!strcmp(module, "chvalid")) return(test_chvalid());
24859    if (!strcmp(module, "dict")) return(test_dict());
24860    if (!strcmp(module, "encoding")) return(test_encoding());
24861    if (!strcmp(module, "entities")) return(test_entities());
24862    if (!strcmp(module, "hash")) return(test_hash());
24863    if (!strcmp(module, "list")) return(test_list());
24864    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
24865    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
24866    if (!strcmp(module, "parser")) return(test_parser());
24867    if (!strcmp(module, "pattern")) return(test_pattern());
24868    if (!strcmp(module, "relaxng")) return(test_relaxng());
24869    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
24870    if (!strcmp(module, "tree")) return(test_tree());
24871    if (!strcmp(module, "uri")) return(test_uri());
24872    if (!strcmp(module, "valid")) return(test_valid());
24873    if (!strcmp(module, "xinclude")) return(test_xinclude());
24874    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
24875    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
24876    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
24877    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
24878    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
24879    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
24880    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
24881    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
24882    if (!strcmp(module, "xpath")) return(test_xpath());
24883    if (!strcmp(module, "xpointer")) return(test_xpointer());
24884    return(0);
24885}
24886