testapi.c revision 91b955c1af5636a0765201c32180cfc67ee426a8
1/*
2 * testapi.c: libxml2 API tester program.
3 *
4 * Automatically generated by gentest.py from libxml2-api.xml
5 *
6 * See Copyright for the status of this software.
7 *
8 * daniel@veillard.com
9 */
10
11#include <stdio.h>
12#include <string.h>
13#include <libxml/xmlerror.h>
14#include <libxml/relaxng.h>
15
16static int testlibxml2(void);
17static int test_module(const char *module);
18
19static int generic_errors = 0;
20static int call_tests = 0;
21static int function_tests = 0;
22
23static xmlChar chartab[1024];
24static int inttab[1024];
25static unsigned long longtab[1024];
26
27static xmlDocPtr api_doc = NULL;
28static xmlDtdPtr api_dtd = NULL;
29static xmlNodePtr api_root = NULL;
30static xmlAttrPtr api_attr = NULL;
31static xmlNsPtr api_ns = NULL;
32
33static void
34structured_errors(void *userData ATTRIBUTE_UNUSED,
35                  xmlErrorPtr error ATTRIBUTE_UNUSED) {
36    generic_errors++;
37}
38
39static void
40free_api_doc(void) {
41    xmlFreeDoc(api_doc);
42    api_doc = NULL;
43    api_dtd = NULL;
44    api_root = NULL;
45    api_attr = NULL;
46    api_ns = NULL;
47}
48
49static xmlDocPtr
50get_api_doc(void) {
51    if (api_doc == NULL) {
52        api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
53	api_root = NULL;
54	api_attr = NULL;
55    }
56    return(api_doc);
57}
58
59static xmlDtdPtr
60get_api_dtd(void) {
61    if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
62        get_api_doc();
63	if ((api_doc != NULL) && (api_doc->children != NULL) &&
64	    (api_doc->children->type == XML_DTD_NODE))
65	    api_dtd = (xmlDtdPtr) api_doc->children;
66    }
67    return(api_dtd);
68}
69
70static xmlNodePtr
71get_api_root(void) {
72    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
73        get_api_doc();
74	if ((api_doc != NULL) && (api_doc->children != NULL) &&
75	    (api_doc->children->next != NULL) &&
76	    (api_doc->children->next->type == XML_ELEMENT_NODE))
77	    api_root = api_doc->children->next;
78    }
79    return(api_root);
80}
81
82static xmlNsPtr
83get_api_ns(void) {
84    get_api_root();
85    if (api_root != NULL)
86        api_ns = api_root->nsDef;
87    return(api_ns);
88}
89
90static xmlAttrPtr
91get_api_attr(void) {
92#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
93    static int nr = 0;
94    xmlChar name[20];
95#endif
96
97    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
98        get_api_root();
99    }
100    if (api_root == NULL)
101        return(NULL);
102    if (api_root->properties != NULL) {
103        api_attr = api_root->properties;
104        return(api_root->properties);
105    }
106    api_attr = NULL;
107#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
108    snprintf((char *) name, 20, "foo%d", nr++);
109    api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
110#endif
111    return(api_attr);
112}
113
114static int quiet = 0;
115
116int main(int argc, char **argv) {
117    int ret;
118    int blocks, mem;
119
120    memset(chartab, 0, sizeof(chartab));
121    strncpy((char *) chartab, "  chartab\n", 20);
122    memset(inttab, 0, sizeof(inttab));
123    memset(longtab, 0, sizeof(longtab));
124
125    xmlInitParser();
126#ifdef LIBXML_SCHEMAS_ENABLED
127    xmlRelaxNGInitTypes();
128#endif
129
130    LIBXML_TEST_VERSION
131
132    xmlSetStructuredErrorFunc(NULL, structured_errors);
133
134    if (argc >= 2) {
135        if (!strcmp(argv[1], "-q")) {
136	    quiet = 1;
137	    if (argc >= 3)
138	        ret = test_module(argv[2]);
139	    else
140		ret = testlibxml2();
141        } else {
142	   ret = test_module(argv[1]);
143	}
144    } else
145	ret = testlibxml2();
146
147    xmlCleanupParser();
148    blocks = xmlMemBlocks();
149    mem = xmlMemUsed();
150    if ((blocks != 0) || (mem != 0)) {
151        printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
152    }
153    xmlMemoryDump();
154
155    return (ret != 0);
156}
157
158#include <libxml/HTMLparser.h>
159#include <libxml/HTMLtree.h>
160#include <libxml/catalog.h>
161#include <libxml/chvalid.h>
162#include <libxml/dict.h>
163#include <libxml/encoding.h>
164#include <libxml/entities.h>
165#include <libxml/hash.h>
166#include <libxml/list.h>
167#include <libxml/nanoftp.h>
168#include <libxml/nanohttp.h>
169#include <libxml/parser.h>
170#include <libxml/parserInternals.h>
171#include <libxml/pattern.h>
172#include <libxml/relaxng.h>
173#include <libxml/schemasInternals.h>
174#include <libxml/tree.h>
175#include <libxml/uri.h>
176#include <libxml/valid.h>
177#include <libxml/xinclude.h>
178#include <libxml/xmlIO.h>
179#include <libxml/xmlerror.h>
180#include <libxml/xmlreader.h>
181#include <libxml/xmlsave.h>
182#include <libxml/xmlschemas.h>
183#include <libxml/xmlschemastypes.h>
184#include <libxml/xmlstring.h>
185#include <libxml/xmlwriter.h>
186#include <libxml/xpath.h>
187#include <libxml/xpointer.h>
188#include <libxml/debugXML.h>
189
190/*
191  We manually define xmlErrMemory because it's normal declaration
192  is "hidden" by #ifdef IN_LIBXML
193*/
194void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
195
196#define gen_nb_void_ptr 2
197
198static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
199    return(NULL);
200}
201static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
202}
203
204#if 0
205#define gen_nb_const_void_ptr 2
206
207static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
208    if (no == 0) return((const void *) "immutable string");
209    return(NULL);
210}
211static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
212}
213#endif
214
215#define gen_nb_userdata 3
216
217static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
218    if (no == 0) return((void *) &call_tests);
219    if (no == 1) return((void *) -1);
220    return(NULL);
221}
222static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
223}
224
225
226#define gen_nb_int 4
227
228static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
229    if (no == 0) return(0);
230    if (no == 1) return(1);
231    if (no == 2) return(-1);
232    if (no == 3) return(122);
233    return(-1);
234}
235
236static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
237}
238
239#define gen_nb_parseroptions 5
240
241static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
242    if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
243    if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
244    if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
245    if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
246    return(XML_PARSE_SAX1);
247}
248
249static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
250}
251
252#if 0
253#define gen_nb_long 5
254
255static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
256    if (no == 0) return(0);
257    if (no == 1) return(1);
258    if (no == 2) return(-1);
259    if (no == 3) return(122);
260    return(-1);
261}
262
263static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
264}
265#endif
266
267#define gen_nb_xmlChar 4
268
269static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
270    if (no == 0) return('a');
271    if (no == 1) return(' ');
272    if (no == 2) return('�');
273    return(0);
274}
275
276static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
277}
278
279#define gen_nb_unsigned_int 3
280
281static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
282    if (no == 0) return(0);
283    if (no == 1) return(1);
284    if (no == 2) return(122);
285    return(-1);
286}
287
288static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
289}
290
291#define gen_nb_unsigned_long 4
292
293static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
294    if (no == 0) return(0);
295    if (no == 1) return(1);
296    if (no == 2) return(122);
297    return(-1);
298}
299
300static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
301}
302
303#define gen_nb_double 4
304
305static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
306    if (no == 0) return(0);
307    if (no == 1) return(-1.1);
308#if defined(LIBXML_XPATH_ENABLED)
309    if (no == 2) return(xmlXPathNAN);
310#endif
311    return(-1);
312}
313
314static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
315}
316
317#define gen_nb_unsigned_long_ptr 2
318
319static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
320    if (no == 0) return(&longtab[nr]);
321    return(NULL);
322}
323
324static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
325}
326
327#define gen_nb_int_ptr 2
328
329static int *gen_int_ptr(int no, int nr) {
330    if (no == 0) return(&inttab[nr]);
331    return(NULL);
332}
333
334static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
335}
336
337#define gen_nb_const_char_ptr 4
338
339static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
340    if (no == 0) return((char *) "foo");
341    if (no == 1) return((char *) "<foo/>");
342    if (no == 2) return((char *) "test/ent2");
343    return(NULL);
344}
345static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
346}
347
348#define gen_nb_xmlChar_ptr 2
349
350static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
351    if (no == 0) return(&chartab[0]);
352    return(NULL);
353}
354static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
355}
356
357#define gen_nb_FILE_ptr 2
358
359static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
360    if (no == 0) return(fopen("test.out", "a+"));
361    return(NULL);
362}
363static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
364    if (val != NULL) fclose(val);
365}
366
367#define gen_nb_debug_FILE_ptr 2
368static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
369    return(fopen("test.out", "a+"));
370}
371static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
372    if (val != NULL) fclose(val);
373}
374
375#define gen_nb_const_xmlChar_ptr 5
376
377static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
378    if (no == 0) return((xmlChar *) "foo");
379    if (no == 1) return((xmlChar *) "<foo/>");
380    if (no == 2) return((xmlChar *) "n�ne");
381    if (no == 3) return((xmlChar *) " 2ab ");
382    return(NULL);
383}
384static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
385}
386
387#define gen_nb_filepath 8
388
389static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
390    if (no == 0) return("missing.xml");
391    if (no == 1) return("<foo/>");
392    if (no == 2) return("test/ent2");
393    if (no == 3) return("test/valid/REC-xml-19980210.xml");
394    if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
395    if (no == 5) return("http://missing.example.org/");
396    if (no == 6) return("http://missing. example.org/");
397    return(NULL);
398}
399static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
400}
401
402#define gen_nb_eaten_name 2
403
404static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
405    if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
406    return(NULL);
407}
408static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
409}
410
411#define gen_nb_fileoutput 6
412
413static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
414    if (no == 0) return("/missing.xml");
415    if (no == 1) return("<foo/>");
416    if (no == 2) return("ftp://missing.example.org/foo");
417    if (no == 3) return("http://missing.example.org/");
418    if (no == 4) return("http://missing. example.org/");
419    return(NULL);
420}
421static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
422}
423
424#define gen_nb_xmlParserCtxtPtr 3
425static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
426    if (no == 0) return(xmlNewParserCtxt());
427    if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
428    return(NULL);
429}
430static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
431    if (val != NULL)
432        xmlFreeParserCtxt(val);
433}
434
435#define gen_nb_xmlSAXHandlerPtr 2
436static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
437#ifdef LIBXML_SAX1_ENABLED
438    if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
439#endif
440    return(NULL);
441}
442static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
443}
444
445#define gen_nb_xmlValidCtxtPtr 2
446static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
447#ifdef LIBXML_VALID_ENABLED
448    if (no == 0) return(xmlNewValidCtxt());
449#endif
450    return(NULL);
451}
452static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
453#ifdef LIBXML_VALID_ENABLED
454    if (val != NULL)
455        xmlFreeValidCtxt(val);
456#endif
457}
458
459#define gen_nb_xmlParserInputBufferPtr 8
460
461static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
462    if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
463    if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
464    if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
465    if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
466    if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
467    if (no == 5) return(xmlParserInputBufferCreateFilename("http://missing.example.org/", XML_CHAR_ENCODING_NONE));
468    if (no == 6) return(xmlParserInputBufferCreateFilename("http://missing. example.org/", XML_CHAR_ENCODING_NONE));
469    return(NULL);
470}
471static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
472    xmlFreeParserInputBuffer(val);
473}
474
475#define gen_nb_xmlDocPtr 3
476static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
477    if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
478    if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
479    return(NULL);
480}
481static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
482    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
483        xmlFreeDoc(val);
484}
485
486#define gen_nb_xmlAttrPtr 2
487static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
488    if (no == 0) return(get_api_attr());
489    return(NULL);
490}
491static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
492    if (no == 0) free_api_doc();
493}
494
495#define gen_nb_xmlDictPtr 2
496static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
497    if (no == 0) return(xmlDictCreate());
498    return(NULL);
499}
500static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
501    if (val != NULL)
502        xmlDictFree(val);
503}
504
505#define gen_nb_xmlNodePtr 3
506static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
507    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
508    if (no == 1) return(get_api_root());
509    return(NULL);
510/*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
511}
512static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
513    if (no == 1) free_api_doc();
514    else if (val != NULL) {
515        xmlUnlinkNode(val);
516        xmlFreeNode(val);
517    }
518}
519
520#define gen_nb_xmlDtdPtr 3
521static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
522    if (no == 0)
523        return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
524    if (no == 1) return(get_api_dtd());
525    return(NULL);
526}
527static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
528    if (no == 1) free_api_doc();
529    else if (val != NULL) {
530        xmlUnlinkNode((xmlNodePtr) val);
531        xmlFreeNode((xmlNodePtr) val);
532    }
533}
534
535#define gen_nb_xmlNsPtr 2
536static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
537    if (no == 0) return(get_api_ns());
538    return(NULL);
539}
540static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
541    if (no == 0) free_api_doc();
542}
543
544#define gen_nb_xmlNodePtr_in 3
545static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
546    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
547    if (no == 0) return(xmlNewText(BAD_CAST "text"));
548    return(NULL);
549}
550static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
551}
552
553#ifdef LIBXML_WRITER_ENABLED
554#define gen_nb_xmlTextWriterPtr 2
555static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
556    if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
557    return(NULL);
558}
559static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
560    if (val != NULL) xmlFreeTextWriter(val);
561}
562#endif
563
564#ifdef LIBXML_READER_ENABLED
565#define gen_nb_xmlTextReaderPtr 4
566static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
567    if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
568    if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
569    if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
570    return(NULL);
571}
572static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
573    if (val != NULL) xmlFreeTextReader(val);
574}
575#endif
576
577#define gen_nb_xmlBufferPtr 3
578static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
579    if (no == 0) return(xmlBufferCreate());
580    if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
581    return(NULL);
582}
583static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
584    if (val != NULL) {
585        xmlBufferFree(val);
586    }
587}
588
589#define gen_nb_xmlListPtr 2
590static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
591    if (no == 0) return(xmlListCreate(NULL, NULL));
592    return(NULL);
593}
594static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
595    if (val != NULL) {
596        xmlListDelete(val);
597    }
598}
599
600#define gen_nb_xmlHashTablePtr 2
601static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
602    if (no == 0) return(xmlHashCreate(10));
603    return(NULL);
604}
605static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
606    if (val != NULL) {
607        xmlHashFree(val, NULL);
608    }
609}
610
611#include <libxml/xpathInternals.h>
612
613#ifdef LIBXML_XPATH_ENABLED
614#define gen_nb_xmlXPathObjectPtr 5
615static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
616    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
617    if (no == 1) return(xmlXPathNewFloat(1.1));
618    if (no == 2) return(xmlXPathNewBoolean(1));
619    if (no == 3) return(xmlXPathNewNodeSet(NULL));
620    return(NULL);
621}
622static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
623    if (val != NULL) {
624        xmlXPathFreeObject(val);
625    }
626}
627#endif
628
629#ifdef LIBXML_OUTPUT_ENABLED
630#define gen_nb_xmlOutputBufferPtr 2
631static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
632    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
633    return(NULL);
634}
635static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
636    if (val != NULL) {
637        xmlOutputBufferClose(val);
638    }
639}
640#endif
641
642#ifdef LIBXML_FTP_ENABLED
643#define gen_nb_xmlNanoFTPCtxtPtr 4
644static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
645    if (no == 0) return(xmlNanoFTPNewCtxt("ftp://example.com/"));
646    if (no == 1) return(xmlNanoFTPNewCtxt("http://example.com/"));
647    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
648    return(NULL);
649}
650static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
651    if (val != NULL) {
652        xmlNanoFTPFreeCtxt(val);
653    }
654}
655#endif
656
657#ifdef LIBXML_HTTP_ENABLED
658#define gen_nb_xmlNanoHTTPCtxtPtr 1
659static void *gen_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
660    return(NULL);
661}
662static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
663}
664#endif
665
666#define gen_nb_xmlCharEncoding 4
667static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
668    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
669    if (no == 1) return(XML_CHAR_ENCODING_NONE);
670    if (no == 0) return(XML_CHAR_ENCODING_8859_1);
671    return(XML_CHAR_ENCODING_ERROR);
672}
673static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
674}
675
676#define gen_nb_xmlHashDeallocator 2
677static void
678test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
679}
680
681static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
682    if (no == 0) return(test_xmlHashDeallocator);
683    return(NULL);
684}
685static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
686}
687
688
689static void desret_int(int val ATTRIBUTE_UNUSED) {
690}
691static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
692}
693static void desret_long(long val ATTRIBUTE_UNUSED) {
694}
695static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
696}
697static void desret_double(double val ATTRIBUTE_UNUSED) {
698}
699static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
700}
701#if 0
702static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
703}
704#endif
705static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
706}
707static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
708}
709static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
710}
711static void desret_xmlChar_ptr(xmlChar *val) {
712    if (val != NULL)
713	xmlFree(val);
714}
715static void desret_xmlDocPtr(xmlDocPtr val) {
716    if (val != api_doc)
717	xmlFreeDoc(val);
718}
719static void desret_xmlDictPtr(xmlDictPtr val) {
720    xmlDictFree(val);
721}
722#ifdef LIBXML_OUTPUT_ENABLED
723static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
724    xmlOutputBufferClose(val);
725}
726#endif
727#ifdef LIBXML_READER_ENABLED
728static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
729    xmlFreeTextReader(val);
730}
731#endif
732static void desret_xmlNodePtr(xmlNodePtr val) {
733    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
734	xmlUnlinkNode(val);
735	xmlFreeNode(val);
736    }
737}
738static void desret_xmlAttrPtr(xmlAttrPtr val) {
739    if (val != NULL) {
740	xmlUnlinkNode((xmlNodePtr) val);
741	xmlFreeNode((xmlNodePtr) val);
742    }
743}
744static void desret_xmlEntityPtr(xmlEntityPtr val) {
745    if (val != NULL) {
746	xmlUnlinkNode((xmlNodePtr) val);
747	xmlFreeNode((xmlNodePtr) val);
748    }
749}
750static void desret_xmlElementPtr(xmlElementPtr val) {
751    if (val != NULL) {
752	xmlUnlinkNode((xmlNodePtr) val);
753    }
754}
755static void desret_xmlAttributePtr(xmlAttributePtr val) {
756    if (val != NULL) {
757	xmlUnlinkNode((xmlNodePtr) val);
758    }
759}
760static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
761}
762static void desret_xmlDtdPtr(xmlDtdPtr val) {
763    desret_xmlNodePtr((xmlNodePtr)val);
764}
765#ifdef LIBXML_XPATH_ENABLED
766static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
767    xmlXPathFreeObject(val);
768}
769static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
770    xmlXPathFreeNodeSet(val);
771}
772#endif
773static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
774    xmlFreeParserCtxt(val);
775}
776static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
777    xmlFreeParserInputBuffer(val);
778}
779static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
780    xmlFreeInputStream(val);
781}
782#ifdef LIBXML_WRITER_ENABLED
783static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
784    xmlFreeTextWriter(val);
785}
786#endif
787static void desret_xmlBufferPtr(xmlBufferPtr val) {
788    xmlBufferFree(val);
789}
790#ifdef LIBXML_SCHEMAS_ENABLED
791static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
792    xmlSchemaFreeParserCtxt(val);
793}
794static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
795}
796static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
797    xmlRelaxNGFreeParserCtxt(val);
798}
799#endif
800#ifdef LIBXML_HTML_ENABLED
801static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
802}
803#endif
804
805/* cut and pasted from autogenerated to avoid troubles */
806#define gen_nb_const_xmlChar_ptr_ptr 1
807static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
808    return(NULL);
809}
810static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
811}
812
813#define gen_nb_unsigned_char_ptr 1
814static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
815    return(NULL);
816}
817static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
818}
819
820#define gen_nb_const_unsigned_char_ptr 1
821static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
822    return(NULL);
823}
824static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
825}
826
827#ifdef LIBXML_HTML_ENABLED
828#define gen_nb_const_htmlNodePtr 1
829static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
830    return(NULL);
831}
832static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
833}
834#endif
835
836#ifdef LIBXML_HTML_ENABLED
837#define gen_nb_htmlDocPtr 3
838static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
839    if (no == 0) return(htmlNewDoc(NULL, NULL));
840    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
841    return(NULL);
842}
843static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
844    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
845        xmlFreeDoc(val);
846}
847static void desret_htmlDocPtr(htmlDocPtr val) {
848    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
849        xmlFreeDoc(val);
850}
851#define gen_nb_htmlParserCtxtPtr 3
852static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
853    if (no == 0) return(xmlNewParserCtxt());
854    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
855    return(NULL);
856}
857static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
858    if (val != NULL)
859        htmlFreeParserCtxt(val);
860}
861static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
862    if (val != NULL)
863        htmlFreeParserCtxt(val);
864}
865#endif
866
867#ifdef LIBXML_XPATH_ENABLED
868#define gen_nb_xmlNodeSetPtr 1
869static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
870    return(NULL);
871}
872static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
873}
874#endif
875
876#ifdef LIBXML_DEBUG_ENABLED
877#ifdef LIBXML_XPATH_ENABLED
878#define gen_nb_xmlShellCtxtPtr 1
879static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
880    return(NULL);
881}
882static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
883}
884#endif
885#endif
886
887#ifdef LIBXML_PATTERN_ENABLED
888#define gen_nb_xmlPatternPtr 1
889static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
890    return(NULL);
891}
892static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893}
894#endif
895
896#define gen_nb_xmlElementContentPtr 1
897static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
898    return(NULL);
899}
900static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
901    if (val != NULL)
902        xmlFreeElementContent(val);
903}
904static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
905    if (val != NULL)
906        xmlFreeElementContent(val);
907}
908
909#define gen_nb_xmlParserNodeInfoSeqPtr 1
910static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
911    return(NULL);
912}
913static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
914}
915
916static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
917}
918
919/************************************************************************
920 *									*
921 *   WARNING: end of the manually maintained part of the test code	*
922 *            do not remove or alter the CUT HERE line			*
923 *									*
924 ************************************************************************/
925
926/* CUT HERE: everything below that line is generated */
927#ifdef LIBXML_HTML_ENABLED
928static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
929}
930
931#endif
932
933#define gen_nb_xmlAttributeDefault 4
934static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
935    if (no == 1) return(XML_ATTRIBUTE_FIXED);
936    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
937    if (no == 3) return(XML_ATTRIBUTE_NONE);
938    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
939    return(0);
940}
941
942static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
943}
944
945#define gen_nb_xmlAttributeType 4
946static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
947    if (no == 1) return(XML_ATTRIBUTE_CDATA);
948    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
949    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
950    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
951    return(0);
952}
953
954static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
955}
956
957#define gen_nb_xmlBufferAllocationScheme 3
958static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
959    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
960    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
961    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
962    return(0);
963}
964
965static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
966}
967
968static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
969}
970
971#ifdef LIBXML_CATALOG_ENABLED
972#define gen_nb_xmlCatalogAllow 4
973static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
974    if (no == 1) return(XML_CATA_ALLOW_ALL);
975    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
976    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
977    if (no == 4) return(XML_CATA_ALLOW_NONE);
978    return(0);
979}
980
981static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
982}
983
984static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
985}
986
987#endif
988
989#ifdef LIBXML_CATALOG_ENABLED
990#define gen_nb_xmlCatalogPrefer 3
991static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
992    if (no == 1) return(XML_CATA_PREFER_NONE);
993    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
994    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
995    return(0);
996}
997
998static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
999}
1000
1001static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1002}
1003
1004#endif
1005
1006#define gen_nb_xmlElementContentType 4
1007static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1008    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1009    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1010    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1011    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1012    return(0);
1013}
1014
1015static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1016}
1017
1018#define gen_nb_xmlElementTypeVal 4
1019static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1020    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1021    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1022    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1023    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1024    return(0);
1025}
1026
1027static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1028}
1029
1030static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1031}
1032
1033#ifdef LIBXML_SCHEMAS_ENABLED
1034#define gen_nb_xmlSchemaValType 4
1035static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1036    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1037    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1038    if (no == 3) return(XML_SCHEMAS_ANYURI);
1039    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1040    return(0);
1041}
1042
1043static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1044}
1045
1046#endif
1047
1048#include <libxml/HTMLparser.h>
1049#include <libxml/HTMLtree.h>
1050#include <libxml/SAX2.h>
1051#include <libxml/c14n.h>
1052#include <libxml/catalog.h>
1053#include <libxml/chvalid.h>
1054#include <libxml/debugXML.h>
1055#include <libxml/dict.h>
1056#include <libxml/encoding.h>
1057#include <libxml/entities.h>
1058#include <libxml/hash.h>
1059#include <libxml/list.h>
1060#include <libxml/nanoftp.h>
1061#include <libxml/nanohttp.h>
1062#include <libxml/parser.h>
1063#include <libxml/parserInternals.h>
1064#include <libxml/pattern.h>
1065#include <libxml/relaxng.h>
1066#include <libxml/schemasInternals.h>
1067#include <libxml/tree.h>
1068#include <libxml/uri.h>
1069#include <libxml/valid.h>
1070#include <libxml/xinclude.h>
1071#include <libxml/xmlIO.h>
1072#include <libxml/xmlautomata.h>
1073#include <libxml/xmlerror.h>
1074#include <libxml/xmlreader.h>
1075#include <libxml/xmlregexp.h>
1076#include <libxml/xmlsave.h>
1077#include <libxml/xmlschemas.h>
1078#include <libxml/xmlschemastypes.h>
1079#include <libxml/xmlstring.h>
1080#include <libxml/xmlunicode.h>
1081#include <libxml/xmlwriter.h>
1082#include <libxml/xpath.h>
1083#include <libxml/xpathInternals.h>
1084#include <libxml/xpointer.h>
1085static int test_HTMLparser(void);
1086static int test_HTMLtree(void);
1087static int test_SAX2(void);
1088static int test_c14n(void);
1089static int test_catalog(void);
1090static int test_chvalid(void);
1091static int test_debugXML(void);
1092static int test_dict(void);
1093static int test_encoding(void);
1094static int test_entities(void);
1095static int test_hash(void);
1096static int test_list(void);
1097static int test_nanoftp(void);
1098static int test_nanohttp(void);
1099static int test_parser(void);
1100static int test_parserInternals(void);
1101static int test_pattern(void);
1102static int test_relaxng(void);
1103static int test_schemasInternals(void);
1104static int test_tree(void);
1105static int test_uri(void);
1106static int test_valid(void);
1107static int test_xinclude(void);
1108static int test_xmlIO(void);
1109static int test_xmlautomata(void);
1110static int test_xmlerror(void);
1111static int test_xmlreader(void);
1112static int test_xmlregexp(void);
1113static int test_xmlsave(void);
1114static int test_xmlschemas(void);
1115static int test_xmlschemastypes(void);
1116static int test_xmlstring(void);
1117static int test_xmlunicode(void);
1118static int test_xmlwriter(void);
1119static int test_xpath(void);
1120static int test_xpathInternals(void);
1121static int test_xpointer(void);
1122
1123/**
1124 * testlibxml2:
1125 *
1126 * Main entry point of the tester for the full libxml2 module,
1127 * it calls all the tester entry point for each module.
1128 *
1129 * Returns the number of error found
1130 */
1131static int
1132testlibxml2(void)
1133{
1134    int test_ret = 0;
1135
1136    test_ret += test_HTMLparser();
1137    test_ret += test_HTMLtree();
1138    test_ret += test_SAX2();
1139    test_ret += test_c14n();
1140    test_ret += test_catalog();
1141    test_ret += test_chvalid();
1142    test_ret += test_debugXML();
1143    test_ret += test_dict();
1144    test_ret += test_encoding();
1145    test_ret += test_entities();
1146    test_ret += test_hash();
1147    test_ret += test_list();
1148    test_ret += test_nanoftp();
1149    test_ret += test_nanohttp();
1150    test_ret += test_parser();
1151    test_ret += test_parserInternals();
1152    test_ret += test_pattern();
1153    test_ret += test_relaxng();
1154    test_ret += test_schemasInternals();
1155    test_ret += test_tree();
1156    test_ret += test_uri();
1157    test_ret += test_valid();
1158    test_ret += test_xinclude();
1159    test_ret += test_xmlIO();
1160    test_ret += test_xmlautomata();
1161    test_ret += test_xmlerror();
1162    test_ret += test_xmlreader();
1163    test_ret += test_xmlregexp();
1164    test_ret += test_xmlsave();
1165    test_ret += test_xmlschemas();
1166    test_ret += test_xmlschemastypes();
1167    test_ret += test_xmlstring();
1168    test_ret += test_xmlunicode();
1169    test_ret += test_xmlwriter();
1170    test_ret += test_xpath();
1171    test_ret += test_xpathInternals();
1172    test_ret += test_xpointer();
1173
1174    printf("Total: %d functions, %d tests, %d errors\n",
1175           function_tests, call_tests, test_ret);
1176    return(test_ret);
1177}
1178
1179
1180static int
1181test_UTF8ToHtml(void) {
1182    int test_ret = 0;
1183
1184#ifdef LIBXML_HTML_ENABLED
1185    int mem_base;
1186    int ret_val;
1187    unsigned char * out; /* a pointer to an array of bytes to store the result */
1188    int n_out;
1189    int * outlen; /* the length of @out */
1190    int n_outlen;
1191    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1192    int n_in;
1193    int * inlen; /* the length of @in */
1194    int n_inlen;
1195
1196    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1197    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1198    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1199    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1200        mem_base = xmlMemBlocks();
1201        out = gen_unsigned_char_ptr(n_out, 0);
1202        outlen = gen_int_ptr(n_outlen, 1);
1203        in = gen_const_unsigned_char_ptr(n_in, 2);
1204        inlen = gen_int_ptr(n_inlen, 3);
1205
1206        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1207        desret_int(ret_val);
1208        call_tests++;
1209        des_unsigned_char_ptr(n_out, out, 0);
1210        des_int_ptr(n_outlen, outlen, 1);
1211        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1212        des_int_ptr(n_inlen, inlen, 3);
1213        xmlResetLastError();
1214        if (mem_base != xmlMemBlocks()) {
1215            printf("Leak of %d blocks found in UTF8ToHtml",
1216	           xmlMemBlocks() - mem_base);
1217	    test_ret++;
1218            printf(" %d", n_out);
1219            printf(" %d", n_outlen);
1220            printf(" %d", n_in);
1221            printf(" %d", n_inlen);
1222            printf("\n");
1223        }
1224    }
1225    }
1226    }
1227    }
1228    function_tests++;
1229#endif
1230
1231    return(test_ret);
1232}
1233
1234#ifdef LIBXML_HTML_ENABLED
1235
1236#define gen_nb_const_htmlElemDesc_ptr 1
1237static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1238    return(NULL);
1239}
1240static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1241}
1242#endif
1243
1244
1245static int
1246test_htmlAttrAllowed(void) {
1247    int test_ret = 0;
1248
1249#ifdef LIBXML_HTML_ENABLED
1250    int mem_base;
1251    htmlStatus ret_val;
1252    htmlElemDesc * elt; /* HTML element */
1253    int n_elt;
1254    xmlChar * attr; /* HTML attribute */
1255    int n_attr;
1256    int legacy; /* whether to allow deprecated attributes */
1257    int n_legacy;
1258
1259    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1260    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1261    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1262        mem_base = xmlMemBlocks();
1263        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1264        attr = gen_const_xmlChar_ptr(n_attr, 1);
1265        legacy = gen_int(n_legacy, 2);
1266
1267        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1268        desret_htmlStatus(ret_val);
1269        call_tests++;
1270        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1271        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1272        des_int(n_legacy, legacy, 2);
1273        xmlResetLastError();
1274        if (mem_base != xmlMemBlocks()) {
1275            printf("Leak of %d blocks found in htmlAttrAllowed",
1276	           xmlMemBlocks() - mem_base);
1277	    test_ret++;
1278            printf(" %d", n_elt);
1279            printf(" %d", n_attr);
1280            printf(" %d", n_legacy);
1281            printf("\n");
1282        }
1283    }
1284    }
1285    }
1286    function_tests++;
1287#endif
1288
1289    return(test_ret);
1290}
1291
1292#ifdef LIBXML_HTML_ENABLED
1293
1294#define gen_nb_htmlNodePtr 1
1295static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1296    return(NULL);
1297}
1298static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1299}
1300#endif
1301
1302
1303static int
1304test_htmlAutoCloseTag(void) {
1305    int test_ret = 0;
1306
1307#ifdef LIBXML_HTML_ENABLED
1308    int mem_base;
1309    int ret_val;
1310    htmlDocPtr doc; /* the HTML document */
1311    int n_doc;
1312    xmlChar * name; /* The tag name */
1313    int n_name;
1314    htmlNodePtr elem; /* the HTML element */
1315    int n_elem;
1316
1317    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1318    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1319    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1320        mem_base = xmlMemBlocks();
1321        doc = gen_htmlDocPtr(n_doc, 0);
1322        name = gen_const_xmlChar_ptr(n_name, 1);
1323        elem = gen_htmlNodePtr(n_elem, 2);
1324
1325        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1326        desret_int(ret_val);
1327        call_tests++;
1328        des_htmlDocPtr(n_doc, doc, 0);
1329        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1330        des_htmlNodePtr(n_elem, elem, 2);
1331        xmlResetLastError();
1332        if (mem_base != xmlMemBlocks()) {
1333            printf("Leak of %d blocks found in htmlAutoCloseTag",
1334	           xmlMemBlocks() - mem_base);
1335	    test_ret++;
1336            printf(" %d", n_doc);
1337            printf(" %d", n_name);
1338            printf(" %d", n_elem);
1339            printf("\n");
1340        }
1341    }
1342    }
1343    }
1344    function_tests++;
1345#endif
1346
1347    return(test_ret);
1348}
1349
1350
1351static int
1352test_htmlCreateMemoryParserCtxt(void) {
1353    int test_ret = 0;
1354
1355#ifdef LIBXML_HTML_ENABLED
1356    int mem_base;
1357    htmlParserCtxtPtr ret_val;
1358    char * buffer; /* a pointer to a char array */
1359    int n_buffer;
1360    int size; /* the size of the array */
1361    int n_size;
1362
1363    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1364    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1365        mem_base = xmlMemBlocks();
1366        buffer = gen_const_char_ptr(n_buffer, 0);
1367        size = gen_int(n_size, 1);
1368
1369        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1370        desret_htmlParserCtxtPtr(ret_val);
1371        call_tests++;
1372        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1373        des_int(n_size, size, 1);
1374        xmlResetLastError();
1375        if (mem_base != xmlMemBlocks()) {
1376            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1377	           xmlMemBlocks() - mem_base);
1378	    test_ret++;
1379            printf(" %d", n_buffer);
1380            printf(" %d", n_size);
1381            printf("\n");
1382        }
1383    }
1384    }
1385    function_tests++;
1386#endif
1387
1388    return(test_ret);
1389}
1390
1391#ifdef LIBXML_HTML_ENABLED
1392
1393#define gen_nb_htmlSAXHandlerPtr 1
1394static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1395    return(NULL);
1396}
1397static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1398}
1399#endif
1400
1401
1402static int
1403test_htmlCreatePushParserCtxt(void) {
1404    int test_ret = 0;
1405
1406#ifdef LIBXML_HTML_ENABLED
1407#ifdef LIBXML_PUSH_ENABLED
1408    int mem_base;
1409    htmlParserCtxtPtr ret_val;
1410    htmlSAXHandlerPtr sax; /* a SAX handler */
1411    int n_sax;
1412    void * user_data; /* The user data returned on SAX callbacks */
1413    int n_user_data;
1414    char * chunk; /* a pointer to an array of chars */
1415    int n_chunk;
1416    int size; /* number of chars in the array */
1417    int n_size;
1418    const char * filename; /* an optional file name or URI */
1419    int n_filename;
1420    xmlCharEncoding enc; /* an optional encoding */
1421    int n_enc;
1422
1423    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1424    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1425    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1426    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1427    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1428    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1429        mem_base = xmlMemBlocks();
1430        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1431        user_data = gen_userdata(n_user_data, 1);
1432        chunk = gen_const_char_ptr(n_chunk, 2);
1433        size = gen_int(n_size, 3);
1434        filename = gen_fileoutput(n_filename, 4);
1435        enc = gen_xmlCharEncoding(n_enc, 5);
1436
1437        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1438        desret_htmlParserCtxtPtr(ret_val);
1439        call_tests++;
1440        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1441        des_userdata(n_user_data, user_data, 1);
1442        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1443        des_int(n_size, size, 3);
1444        des_fileoutput(n_filename, filename, 4);
1445        des_xmlCharEncoding(n_enc, enc, 5);
1446        xmlResetLastError();
1447        if (mem_base != xmlMemBlocks()) {
1448            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1449	           xmlMemBlocks() - mem_base);
1450	    test_ret++;
1451            printf(" %d", n_sax);
1452            printf(" %d", n_user_data);
1453            printf(" %d", n_chunk);
1454            printf(" %d", n_size);
1455            printf(" %d", n_filename);
1456            printf(" %d", n_enc);
1457            printf("\n");
1458        }
1459    }
1460    }
1461    }
1462    }
1463    }
1464    }
1465    function_tests++;
1466#endif
1467#endif
1468
1469    return(test_ret);
1470}
1471
1472
1473static int
1474test_htmlCtxtReadDoc(void) {
1475    int test_ret = 0;
1476
1477#ifdef LIBXML_HTML_ENABLED
1478    int mem_base;
1479    htmlDocPtr ret_val;
1480    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1481    int n_ctxt;
1482    xmlChar * cur; /* a pointer to a zero terminated string */
1483    int n_cur;
1484    const char * URL; /* the base URL to use for the document */
1485    int n_URL;
1486    char * encoding; /* the document encoding, or NULL */
1487    int n_encoding;
1488    int options; /* a combination of htmlParserOption(s) */
1489    int n_options;
1490
1491    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1492    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1493    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1494    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1495    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1496        mem_base = xmlMemBlocks();
1497        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1498        cur = gen_const_xmlChar_ptr(n_cur, 1);
1499        URL = gen_filepath(n_URL, 2);
1500        encoding = gen_const_char_ptr(n_encoding, 3);
1501        options = gen_int(n_options, 4);
1502
1503        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1504        desret_htmlDocPtr(ret_val);
1505        call_tests++;
1506        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1507        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1508        des_filepath(n_URL, URL, 2);
1509        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1510        des_int(n_options, options, 4);
1511        xmlResetLastError();
1512        if (mem_base != xmlMemBlocks()) {
1513            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1514	           xmlMemBlocks() - mem_base);
1515	    test_ret++;
1516            printf(" %d", n_ctxt);
1517            printf(" %d", n_cur);
1518            printf(" %d", n_URL);
1519            printf(" %d", n_encoding);
1520            printf(" %d", n_options);
1521            printf("\n");
1522        }
1523    }
1524    }
1525    }
1526    }
1527    }
1528    function_tests++;
1529#endif
1530
1531    return(test_ret);
1532}
1533
1534
1535static int
1536test_htmlCtxtReadFile(void) {
1537    int test_ret = 0;
1538
1539#ifdef LIBXML_HTML_ENABLED
1540    htmlDocPtr ret_val;
1541    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1542    int n_ctxt;
1543    const char * filename; /* a file or URL */
1544    int n_filename;
1545    char * encoding; /* the document encoding, or NULL */
1546    int n_encoding;
1547    int options; /* a combination of htmlParserOption(s) */
1548    int n_options;
1549
1550    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1551    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1552    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1553    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1554        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1555        filename = gen_filepath(n_filename, 1);
1556        encoding = gen_const_char_ptr(n_encoding, 2);
1557        options = gen_int(n_options, 3);
1558
1559        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1560        desret_htmlDocPtr(ret_val);
1561        call_tests++;
1562        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1563        des_filepath(n_filename, filename, 1);
1564        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1565        des_int(n_options, options, 3);
1566        xmlResetLastError();
1567    }
1568    }
1569    }
1570    }
1571    function_tests++;
1572#endif
1573
1574    return(test_ret);
1575}
1576
1577
1578static int
1579test_htmlCtxtReadMemory(void) {
1580    int test_ret = 0;
1581
1582#ifdef LIBXML_HTML_ENABLED
1583    int mem_base;
1584    htmlDocPtr ret_val;
1585    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1586    int n_ctxt;
1587    char * buffer; /* a pointer to a char array */
1588    int n_buffer;
1589    int size; /* the size of the array */
1590    int n_size;
1591    const char * URL; /* the base URL to use for the document */
1592    int n_URL;
1593    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_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1599    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1600    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1601    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1602    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1603    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1604        mem_base = xmlMemBlocks();
1605        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1606        buffer = gen_const_char_ptr(n_buffer, 1);
1607        size = gen_int(n_size, 2);
1608        URL = gen_filepath(n_URL, 3);
1609        encoding = gen_const_char_ptr(n_encoding, 4);
1610        options = gen_int(n_options, 5);
1611
1612        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1613        desret_htmlDocPtr(ret_val);
1614        call_tests++;
1615        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1616        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1617        des_int(n_size, size, 2);
1618        des_filepath(n_URL, URL, 3);
1619        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1620        des_int(n_options, options, 5);
1621        xmlResetLastError();
1622        if (mem_base != xmlMemBlocks()) {
1623            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1624	           xmlMemBlocks() - mem_base);
1625	    test_ret++;
1626            printf(" %d", n_ctxt);
1627            printf(" %d", n_buffer);
1628            printf(" %d", n_size);
1629            printf(" %d", n_URL);
1630            printf(" %d", n_encoding);
1631            printf(" %d", n_options);
1632            printf("\n");
1633        }
1634    }
1635    }
1636    }
1637    }
1638    }
1639    }
1640    function_tests++;
1641#endif
1642
1643    return(test_ret);
1644}
1645
1646
1647static int
1648test_htmlCtxtReset(void) {
1649    int test_ret = 0;
1650
1651#ifdef LIBXML_HTML_ENABLED
1652    int mem_base;
1653    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1654    int n_ctxt;
1655
1656    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1657        mem_base = xmlMemBlocks();
1658        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1659
1660        htmlCtxtReset(ctxt);
1661        call_tests++;
1662        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1663        xmlResetLastError();
1664        if (mem_base != xmlMemBlocks()) {
1665            printf("Leak of %d blocks found in htmlCtxtReset",
1666	           xmlMemBlocks() - mem_base);
1667	    test_ret++;
1668            printf(" %d", n_ctxt);
1669            printf("\n");
1670        }
1671    }
1672    function_tests++;
1673#endif
1674
1675    return(test_ret);
1676}
1677
1678
1679static int
1680test_htmlCtxtUseOptions(void) {
1681    int test_ret = 0;
1682
1683#ifdef LIBXML_HTML_ENABLED
1684    int mem_base;
1685    int ret_val;
1686    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1687    int n_ctxt;
1688    int options; /* a combination of htmlParserOption(s) */
1689    int n_options;
1690
1691    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1692    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1693        mem_base = xmlMemBlocks();
1694        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1695        options = gen_int(n_options, 1);
1696
1697        ret_val = htmlCtxtUseOptions(ctxt, options);
1698        desret_int(ret_val);
1699        call_tests++;
1700        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1701        des_int(n_options, options, 1);
1702        xmlResetLastError();
1703        if (mem_base != xmlMemBlocks()) {
1704            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1705	           xmlMemBlocks() - mem_base);
1706	    test_ret++;
1707            printf(" %d", n_ctxt);
1708            printf(" %d", n_options);
1709            printf("\n");
1710        }
1711    }
1712    }
1713    function_tests++;
1714#endif
1715
1716    return(test_ret);
1717}
1718
1719
1720static int
1721test_htmlElementAllowedHere(void) {
1722    int test_ret = 0;
1723
1724#ifdef LIBXML_HTML_ENABLED
1725    int mem_base;
1726    int ret_val;
1727    htmlElemDesc * parent; /* HTML parent element */
1728    int n_parent;
1729    xmlChar * elt; /* HTML element */
1730    int n_elt;
1731
1732    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1733    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1734        mem_base = xmlMemBlocks();
1735        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1736        elt = gen_const_xmlChar_ptr(n_elt, 1);
1737
1738        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1739        desret_int(ret_val);
1740        call_tests++;
1741        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1742        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1743        xmlResetLastError();
1744        if (mem_base != xmlMemBlocks()) {
1745            printf("Leak of %d blocks found in htmlElementAllowedHere",
1746	           xmlMemBlocks() - mem_base);
1747	    test_ret++;
1748            printf(" %d", n_parent);
1749            printf(" %d", n_elt);
1750            printf("\n");
1751        }
1752    }
1753    }
1754    function_tests++;
1755#endif
1756
1757    return(test_ret);
1758}
1759
1760
1761static int
1762test_htmlElementStatusHere(void) {
1763    int test_ret = 0;
1764
1765#ifdef LIBXML_HTML_ENABLED
1766    int mem_base;
1767    htmlStatus ret_val;
1768    htmlElemDesc * parent; /* HTML parent element */
1769    int n_parent;
1770    htmlElemDesc * elt; /* HTML element */
1771    int n_elt;
1772
1773    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1774    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1775        mem_base = xmlMemBlocks();
1776        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1777        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1778
1779        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1780        desret_htmlStatus(ret_val);
1781        call_tests++;
1782        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1783        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1784        xmlResetLastError();
1785        if (mem_base != xmlMemBlocks()) {
1786            printf("Leak of %d blocks found in htmlElementStatusHere",
1787	           xmlMemBlocks() - mem_base);
1788	    test_ret++;
1789            printf(" %d", n_parent);
1790            printf(" %d", n_elt);
1791            printf("\n");
1792        }
1793    }
1794    }
1795    function_tests++;
1796#endif
1797
1798    return(test_ret);
1799}
1800
1801
1802static int
1803test_htmlEncodeEntities(void) {
1804    int test_ret = 0;
1805
1806#ifdef LIBXML_HTML_ENABLED
1807    int mem_base;
1808    int ret_val;
1809    unsigned char * out; /* a pointer to an array of bytes to store the result */
1810    int n_out;
1811    int * outlen; /* the length of @out */
1812    int n_outlen;
1813    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1814    int n_in;
1815    int * inlen; /* the length of @in */
1816    int n_inlen;
1817    int quoteChar; /* the quote character to escape (' or ") or zero. */
1818    int n_quoteChar;
1819
1820    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1821    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1822    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1823    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1824    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1825        mem_base = xmlMemBlocks();
1826        out = gen_unsigned_char_ptr(n_out, 0);
1827        outlen = gen_int_ptr(n_outlen, 1);
1828        in = gen_const_unsigned_char_ptr(n_in, 2);
1829        inlen = gen_int_ptr(n_inlen, 3);
1830        quoteChar = gen_int(n_quoteChar, 4);
1831
1832        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1833        desret_int(ret_val);
1834        call_tests++;
1835        des_unsigned_char_ptr(n_out, out, 0);
1836        des_int_ptr(n_outlen, outlen, 1);
1837        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1838        des_int_ptr(n_inlen, inlen, 3);
1839        des_int(n_quoteChar, quoteChar, 4);
1840        xmlResetLastError();
1841        if (mem_base != xmlMemBlocks()) {
1842            printf("Leak of %d blocks found in htmlEncodeEntities",
1843	           xmlMemBlocks() - mem_base);
1844	    test_ret++;
1845            printf(" %d", n_out);
1846            printf(" %d", n_outlen);
1847            printf(" %d", n_in);
1848            printf(" %d", n_inlen);
1849            printf(" %d", n_quoteChar);
1850            printf("\n");
1851        }
1852    }
1853    }
1854    }
1855    }
1856    }
1857    function_tests++;
1858#endif
1859
1860    return(test_ret);
1861}
1862
1863
1864static int
1865test_htmlEntityLookup(void) {
1866    int test_ret = 0;
1867
1868#ifdef LIBXML_HTML_ENABLED
1869    int mem_base;
1870    const htmlEntityDesc * ret_val;
1871    xmlChar * name; /* the entity name */
1872    int n_name;
1873
1874    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1875        mem_base = xmlMemBlocks();
1876        name = gen_const_xmlChar_ptr(n_name, 0);
1877
1878        ret_val = htmlEntityLookup((const xmlChar *)name);
1879        desret_const_htmlEntityDesc_ptr(ret_val);
1880        call_tests++;
1881        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1882        xmlResetLastError();
1883        if (mem_base != xmlMemBlocks()) {
1884            printf("Leak of %d blocks found in htmlEntityLookup",
1885	           xmlMemBlocks() - mem_base);
1886	    test_ret++;
1887            printf(" %d", n_name);
1888            printf("\n");
1889        }
1890    }
1891    function_tests++;
1892#endif
1893
1894    return(test_ret);
1895}
1896
1897
1898static int
1899test_htmlEntityValueLookup(void) {
1900    int test_ret = 0;
1901
1902#ifdef LIBXML_HTML_ENABLED
1903    int mem_base;
1904    const htmlEntityDesc * ret_val;
1905    unsigned int value; /* the entity's unicode value */
1906    int n_value;
1907
1908    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
1909        mem_base = xmlMemBlocks();
1910        value = gen_unsigned_int(n_value, 0);
1911
1912        ret_val = htmlEntityValueLookup(value);
1913        desret_const_htmlEntityDesc_ptr(ret_val);
1914        call_tests++;
1915        des_unsigned_int(n_value, value, 0);
1916        xmlResetLastError();
1917        if (mem_base != xmlMemBlocks()) {
1918            printf("Leak of %d blocks found in htmlEntityValueLookup",
1919	           xmlMemBlocks() - mem_base);
1920	    test_ret++;
1921            printf(" %d", n_value);
1922            printf("\n");
1923        }
1924    }
1925    function_tests++;
1926#endif
1927
1928    return(test_ret);
1929}
1930
1931
1932static int
1933test_htmlHandleOmittedElem(void) {
1934    int test_ret = 0;
1935
1936#ifdef LIBXML_HTML_ENABLED
1937    int mem_base;
1938    int ret_val;
1939    int val; /* int 0 or 1 */
1940    int n_val;
1941
1942    for (n_val = 0;n_val < gen_nb_int;n_val++) {
1943        mem_base = xmlMemBlocks();
1944        val = gen_int(n_val, 0);
1945
1946        ret_val = htmlHandleOmittedElem(val);
1947        desret_int(ret_val);
1948        call_tests++;
1949        des_int(n_val, val, 0);
1950        xmlResetLastError();
1951        if (mem_base != xmlMemBlocks()) {
1952            printf("Leak of %d blocks found in htmlHandleOmittedElem",
1953	           xmlMemBlocks() - mem_base);
1954	    test_ret++;
1955            printf(" %d", n_val);
1956            printf("\n");
1957        }
1958    }
1959    function_tests++;
1960#endif
1961
1962    return(test_ret);
1963}
1964
1965
1966static int
1967test_htmlIsAutoClosed(void) {
1968    int test_ret = 0;
1969
1970#ifdef LIBXML_HTML_ENABLED
1971    int mem_base;
1972    int ret_val;
1973    htmlDocPtr doc; /* the HTML document */
1974    int n_doc;
1975    htmlNodePtr elem; /* the HTML element */
1976    int n_elem;
1977
1978    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1979    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1980        mem_base = xmlMemBlocks();
1981        doc = gen_htmlDocPtr(n_doc, 0);
1982        elem = gen_htmlNodePtr(n_elem, 1);
1983
1984        ret_val = htmlIsAutoClosed(doc, elem);
1985        desret_int(ret_val);
1986        call_tests++;
1987        des_htmlDocPtr(n_doc, doc, 0);
1988        des_htmlNodePtr(n_elem, elem, 1);
1989        xmlResetLastError();
1990        if (mem_base != xmlMemBlocks()) {
1991            printf("Leak of %d blocks found in htmlIsAutoClosed",
1992	           xmlMemBlocks() - mem_base);
1993	    test_ret++;
1994            printf(" %d", n_doc);
1995            printf(" %d", n_elem);
1996            printf("\n");
1997        }
1998    }
1999    }
2000    function_tests++;
2001#endif
2002
2003    return(test_ret);
2004}
2005
2006
2007static int
2008test_htmlIsScriptAttribute(void) {
2009    int test_ret = 0;
2010
2011#ifdef LIBXML_HTML_ENABLED
2012    int mem_base;
2013    int ret_val;
2014    xmlChar * name; /* an attribute name */
2015    int n_name;
2016
2017    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2018        mem_base = xmlMemBlocks();
2019        name = gen_const_xmlChar_ptr(n_name, 0);
2020
2021        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2022        desret_int(ret_val);
2023        call_tests++;
2024        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2025        xmlResetLastError();
2026        if (mem_base != xmlMemBlocks()) {
2027            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2028	           xmlMemBlocks() - mem_base);
2029	    test_ret++;
2030            printf(" %d", n_name);
2031            printf("\n");
2032        }
2033    }
2034    function_tests++;
2035#endif
2036
2037    return(test_ret);
2038}
2039
2040
2041static int
2042test_htmlNodeStatus(void) {
2043    int test_ret = 0;
2044
2045#ifdef LIBXML_HTML_ENABLED
2046    int mem_base;
2047    htmlStatus ret_val;
2048    htmlNodePtr node; /* an htmlNodePtr in a tree */
2049    int n_node;
2050    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2051    int n_legacy;
2052
2053    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2054    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2055        mem_base = xmlMemBlocks();
2056        node = gen_const_htmlNodePtr(n_node, 0);
2057        legacy = gen_int(n_legacy, 1);
2058
2059        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2060        desret_htmlStatus(ret_val);
2061        call_tests++;
2062        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2063        des_int(n_legacy, legacy, 1);
2064        xmlResetLastError();
2065        if (mem_base != xmlMemBlocks()) {
2066            printf("Leak of %d blocks found in htmlNodeStatus",
2067	           xmlMemBlocks() - mem_base);
2068	    test_ret++;
2069            printf(" %d", n_node);
2070            printf(" %d", n_legacy);
2071            printf("\n");
2072        }
2073    }
2074    }
2075    function_tests++;
2076#endif
2077
2078    return(test_ret);
2079}
2080
2081
2082static int
2083test_htmlParseCharRef(void) {
2084    int test_ret = 0;
2085
2086#ifdef LIBXML_HTML_ENABLED
2087    int mem_base;
2088    int ret_val;
2089    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2090    int n_ctxt;
2091
2092    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2093        mem_base = xmlMemBlocks();
2094        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2095
2096        ret_val = htmlParseCharRef(ctxt);
2097        desret_int(ret_val);
2098        call_tests++;
2099        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2100        xmlResetLastError();
2101        if (mem_base != xmlMemBlocks()) {
2102            printf("Leak of %d blocks found in htmlParseCharRef",
2103	           xmlMemBlocks() - mem_base);
2104	    test_ret++;
2105            printf(" %d", n_ctxt);
2106            printf("\n");
2107        }
2108    }
2109    function_tests++;
2110#endif
2111
2112    return(test_ret);
2113}
2114
2115
2116static int
2117test_htmlParseChunk(void) {
2118    int test_ret = 0;
2119
2120#ifdef LIBXML_HTML_ENABLED
2121#ifdef LIBXML_PUSH_ENABLED
2122    int mem_base;
2123    int ret_val;
2124    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2125    int n_ctxt;
2126    char * chunk; /* an char array */
2127    int n_chunk;
2128    int size; /* the size in byte of the chunk */
2129    int n_size;
2130    int terminate; /* last chunk indicator */
2131    int n_terminate;
2132
2133    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2134    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2135    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2136    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2137        mem_base = xmlMemBlocks();
2138        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2139        chunk = gen_const_char_ptr(n_chunk, 1);
2140        size = gen_int(n_size, 2);
2141        terminate = gen_int(n_terminate, 3);
2142
2143        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2144        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2145        desret_int(ret_val);
2146        call_tests++;
2147        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2148        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2149        des_int(n_size, size, 2);
2150        des_int(n_terminate, terminate, 3);
2151        xmlResetLastError();
2152        if (mem_base != xmlMemBlocks()) {
2153            printf("Leak of %d blocks found in htmlParseChunk",
2154	           xmlMemBlocks() - mem_base);
2155	    test_ret++;
2156            printf(" %d", n_ctxt);
2157            printf(" %d", n_chunk);
2158            printf(" %d", n_size);
2159            printf(" %d", n_terminate);
2160            printf("\n");
2161        }
2162    }
2163    }
2164    }
2165    }
2166    function_tests++;
2167#endif
2168#endif
2169
2170    return(test_ret);
2171}
2172
2173
2174static int
2175test_htmlParseDoc(void) {
2176    int test_ret = 0;
2177
2178#ifdef LIBXML_HTML_ENABLED
2179    int mem_base;
2180    htmlDocPtr ret_val;
2181    xmlChar * cur; /* a pointer to an array of xmlChar */
2182    int n_cur;
2183    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2184    int n_encoding;
2185
2186    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2187    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2188        mem_base = xmlMemBlocks();
2189        cur = gen_xmlChar_ptr(n_cur, 0);
2190        encoding = gen_const_char_ptr(n_encoding, 1);
2191
2192        ret_val = htmlParseDoc(cur, (const char *)encoding);
2193        desret_htmlDocPtr(ret_val);
2194        call_tests++;
2195        des_xmlChar_ptr(n_cur, cur, 0);
2196        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2197        xmlResetLastError();
2198        if (mem_base != xmlMemBlocks()) {
2199            printf("Leak of %d blocks found in htmlParseDoc",
2200	           xmlMemBlocks() - mem_base);
2201	    test_ret++;
2202            printf(" %d", n_cur);
2203            printf(" %d", n_encoding);
2204            printf("\n");
2205        }
2206    }
2207    }
2208    function_tests++;
2209#endif
2210
2211    return(test_ret);
2212}
2213
2214
2215static int
2216test_htmlParseDocument(void) {
2217    int test_ret = 0;
2218
2219#ifdef LIBXML_HTML_ENABLED
2220    int mem_base;
2221    int ret_val;
2222    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2223    int n_ctxt;
2224
2225    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2226        mem_base = xmlMemBlocks();
2227        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2228
2229        ret_val = htmlParseDocument(ctxt);
2230        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2231        desret_int(ret_val);
2232        call_tests++;
2233        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2234        xmlResetLastError();
2235        if (mem_base != xmlMemBlocks()) {
2236            printf("Leak of %d blocks found in htmlParseDocument",
2237	           xmlMemBlocks() - mem_base);
2238	    test_ret++;
2239            printf(" %d", n_ctxt);
2240            printf("\n");
2241        }
2242    }
2243    function_tests++;
2244#endif
2245
2246    return(test_ret);
2247}
2248
2249
2250static int
2251test_htmlParseElement(void) {
2252    int test_ret = 0;
2253
2254#ifdef LIBXML_HTML_ENABLED
2255    int mem_base;
2256    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2257    int n_ctxt;
2258
2259    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2260        mem_base = xmlMemBlocks();
2261        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2262
2263        htmlParseElement(ctxt);
2264        call_tests++;
2265        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2266        xmlResetLastError();
2267        if (mem_base != xmlMemBlocks()) {
2268            printf("Leak of %d blocks found in htmlParseElement",
2269	           xmlMemBlocks() - mem_base);
2270	    test_ret++;
2271            printf(" %d", n_ctxt);
2272            printf("\n");
2273        }
2274    }
2275    function_tests++;
2276#endif
2277
2278    return(test_ret);
2279}
2280
2281
2282static int
2283test_htmlParseEntityRef(void) {
2284    int test_ret = 0;
2285
2286#ifdef LIBXML_HTML_ENABLED
2287    int mem_base;
2288    const htmlEntityDesc * ret_val;
2289    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2290    int n_ctxt;
2291    xmlChar ** str; /* location to store the entity name */
2292    int n_str;
2293
2294    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2295    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2296        mem_base = xmlMemBlocks();
2297        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2298        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2299
2300        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2301        desret_const_htmlEntityDesc_ptr(ret_val);
2302        call_tests++;
2303        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2304        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2305        xmlResetLastError();
2306        if (mem_base != xmlMemBlocks()) {
2307            printf("Leak of %d blocks found in htmlParseEntityRef",
2308	           xmlMemBlocks() - mem_base);
2309	    test_ret++;
2310            printf(" %d", n_ctxt);
2311            printf(" %d", n_str);
2312            printf("\n");
2313        }
2314    }
2315    }
2316    function_tests++;
2317#endif
2318
2319    return(test_ret);
2320}
2321
2322
2323static int
2324test_htmlParseFile(void) {
2325    int test_ret = 0;
2326
2327#ifdef LIBXML_HTML_ENABLED
2328    htmlDocPtr ret_val;
2329    const char * filename; /* the filename */
2330    int n_filename;
2331    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2332    int n_encoding;
2333
2334    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2335    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2336        filename = gen_filepath(n_filename, 0);
2337        encoding = gen_const_char_ptr(n_encoding, 1);
2338
2339        ret_val = htmlParseFile(filename, (const char *)encoding);
2340        desret_htmlDocPtr(ret_val);
2341        call_tests++;
2342        des_filepath(n_filename, filename, 0);
2343        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2344        xmlResetLastError();
2345    }
2346    }
2347    function_tests++;
2348#endif
2349
2350    return(test_ret);
2351}
2352
2353
2354static int
2355test_htmlReadDoc(void) {
2356    int test_ret = 0;
2357
2358#ifdef LIBXML_HTML_ENABLED
2359    int mem_base;
2360    htmlDocPtr ret_val;
2361    xmlChar * cur; /* a pointer to a zero terminated string */
2362    int n_cur;
2363    const char * URL; /* the base URL to use for the document */
2364    int n_URL;
2365    char * encoding; /* the document encoding, or NULL */
2366    int n_encoding;
2367    int options; /* a combination of htmlParserOption(s) */
2368    int n_options;
2369
2370    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2371    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2372    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2373    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2374        mem_base = xmlMemBlocks();
2375        cur = gen_const_xmlChar_ptr(n_cur, 0);
2376        URL = gen_filepath(n_URL, 1);
2377        encoding = gen_const_char_ptr(n_encoding, 2);
2378        options = gen_int(n_options, 3);
2379
2380        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2381        desret_htmlDocPtr(ret_val);
2382        call_tests++;
2383        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2384        des_filepath(n_URL, URL, 1);
2385        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2386        des_int(n_options, options, 3);
2387        xmlResetLastError();
2388        if (mem_base != xmlMemBlocks()) {
2389            printf("Leak of %d blocks found in htmlReadDoc",
2390	           xmlMemBlocks() - mem_base);
2391	    test_ret++;
2392            printf(" %d", n_cur);
2393            printf(" %d", n_URL);
2394            printf(" %d", n_encoding);
2395            printf(" %d", n_options);
2396            printf("\n");
2397        }
2398    }
2399    }
2400    }
2401    }
2402    function_tests++;
2403#endif
2404
2405    return(test_ret);
2406}
2407
2408
2409static int
2410test_htmlReadFile(void) {
2411    int test_ret = 0;
2412
2413#ifdef LIBXML_HTML_ENABLED
2414    int mem_base;
2415    htmlDocPtr ret_val;
2416    const char * filename; /* a file or URL */
2417    int n_filename;
2418    char * encoding; /* the document encoding, or NULL */
2419    int n_encoding;
2420    int options; /* a combination of htmlParserOption(s) */
2421    int n_options;
2422
2423    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2424    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2425    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2426        mem_base = xmlMemBlocks();
2427        filename = gen_filepath(n_filename, 0);
2428        encoding = gen_const_char_ptr(n_encoding, 1);
2429        options = gen_int(n_options, 2);
2430
2431        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2432        desret_htmlDocPtr(ret_val);
2433        call_tests++;
2434        des_filepath(n_filename, filename, 0);
2435        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2436        des_int(n_options, options, 2);
2437        xmlResetLastError();
2438        if (mem_base != xmlMemBlocks()) {
2439            printf("Leak of %d blocks found in htmlReadFile",
2440	           xmlMemBlocks() - mem_base);
2441	    test_ret++;
2442            printf(" %d", n_filename);
2443            printf(" %d", n_encoding);
2444            printf(" %d", n_options);
2445            printf("\n");
2446        }
2447    }
2448    }
2449    }
2450    function_tests++;
2451#endif
2452
2453    return(test_ret);
2454}
2455
2456
2457static int
2458test_htmlReadMemory(void) {
2459    int test_ret = 0;
2460
2461#ifdef LIBXML_HTML_ENABLED
2462    int mem_base;
2463    htmlDocPtr ret_val;
2464    char * buffer; /* a pointer to a char array */
2465    int n_buffer;
2466    int size; /* the size of the array */
2467    int n_size;
2468    const char * URL; /* the base URL to use for the document */
2469    int n_URL;
2470    char * encoding; /* the document encoding, or NULL */
2471    int n_encoding;
2472    int options; /* a combination of htmlParserOption(s) */
2473    int n_options;
2474
2475    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2476    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2477    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2478    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2479    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2480        mem_base = xmlMemBlocks();
2481        buffer = gen_const_char_ptr(n_buffer, 0);
2482        size = gen_int(n_size, 1);
2483        URL = gen_filepath(n_URL, 2);
2484        encoding = gen_const_char_ptr(n_encoding, 3);
2485        options = gen_int(n_options, 4);
2486
2487        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2488        desret_htmlDocPtr(ret_val);
2489        call_tests++;
2490        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2491        des_int(n_size, size, 1);
2492        des_filepath(n_URL, URL, 2);
2493        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2494        des_int(n_options, options, 4);
2495        xmlResetLastError();
2496        if (mem_base != xmlMemBlocks()) {
2497            printf("Leak of %d blocks found in htmlReadMemory",
2498	           xmlMemBlocks() - mem_base);
2499	    test_ret++;
2500            printf(" %d", n_buffer);
2501            printf(" %d", n_size);
2502            printf(" %d", n_URL);
2503            printf(" %d", n_encoding);
2504            printf(" %d", n_options);
2505            printf("\n");
2506        }
2507    }
2508    }
2509    }
2510    }
2511    }
2512    function_tests++;
2513#endif
2514
2515    return(test_ret);
2516}
2517
2518
2519static int
2520test_htmlSAXParseDoc(void) {
2521    int test_ret = 0;
2522
2523#ifdef LIBXML_HTML_ENABLED
2524    int mem_base;
2525    htmlDocPtr ret_val;
2526    xmlChar * cur; /* a pointer to an array of xmlChar */
2527    int n_cur;
2528    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2529    int n_encoding;
2530    htmlSAXHandlerPtr sax; /* the SAX handler block */
2531    int n_sax;
2532    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2533    int n_userData;
2534
2535    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2536    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2537    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2538    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2539        mem_base = xmlMemBlocks();
2540        cur = gen_xmlChar_ptr(n_cur, 0);
2541        encoding = gen_const_char_ptr(n_encoding, 1);
2542        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2543        userData = gen_userdata(n_userData, 3);
2544
2545        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2546        desret_htmlDocPtr(ret_val);
2547        call_tests++;
2548        des_xmlChar_ptr(n_cur, cur, 0);
2549        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2550        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2551        des_userdata(n_userData, userData, 3);
2552        xmlResetLastError();
2553        if (mem_base != xmlMemBlocks()) {
2554            printf("Leak of %d blocks found in htmlSAXParseDoc",
2555	           xmlMemBlocks() - mem_base);
2556	    test_ret++;
2557            printf(" %d", n_cur);
2558            printf(" %d", n_encoding);
2559            printf(" %d", n_sax);
2560            printf(" %d", n_userData);
2561            printf("\n");
2562        }
2563    }
2564    }
2565    }
2566    }
2567    function_tests++;
2568#endif
2569
2570    return(test_ret);
2571}
2572
2573
2574static int
2575test_htmlSAXParseFile(void) {
2576    int test_ret = 0;
2577
2578#ifdef LIBXML_HTML_ENABLED
2579    int mem_base;
2580    htmlDocPtr ret_val;
2581    const char * filename; /* the filename */
2582    int n_filename;
2583    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2584    int n_encoding;
2585    htmlSAXHandlerPtr sax; /* the SAX handler block */
2586    int n_sax;
2587    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2588    int n_userData;
2589
2590    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2591    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2592    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2593    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2594        mem_base = xmlMemBlocks();
2595        filename = gen_filepath(n_filename, 0);
2596        encoding = gen_const_char_ptr(n_encoding, 1);
2597        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2598        userData = gen_userdata(n_userData, 3);
2599
2600        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2601        desret_htmlDocPtr(ret_val);
2602        call_tests++;
2603        des_filepath(n_filename, filename, 0);
2604        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2605        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2606        des_userdata(n_userData, userData, 3);
2607        xmlResetLastError();
2608        if (mem_base != xmlMemBlocks()) {
2609            printf("Leak of %d blocks found in htmlSAXParseFile",
2610	           xmlMemBlocks() - mem_base);
2611	    test_ret++;
2612            printf(" %d", n_filename);
2613            printf(" %d", n_encoding);
2614            printf(" %d", n_sax);
2615            printf(" %d", n_userData);
2616            printf("\n");
2617        }
2618    }
2619    }
2620    }
2621    }
2622    function_tests++;
2623#endif
2624
2625    return(test_ret);
2626}
2627
2628
2629static int
2630test_htmlTagLookup(void) {
2631    int test_ret = 0;
2632
2633
2634    /* missing type support */
2635    return(test_ret);
2636}
2637
2638static int
2639test_HTMLparser(void) {
2640    int test_ret = 0;
2641
2642    if (quiet == 0) printf("Testing HTMLparser : 31 of 37 functions ...\n");
2643    test_ret += test_UTF8ToHtml();
2644    test_ret += test_htmlAttrAllowed();
2645    test_ret += test_htmlAutoCloseTag();
2646    test_ret += test_htmlCreateMemoryParserCtxt();
2647    test_ret += test_htmlCreatePushParserCtxt();
2648    test_ret += test_htmlCtxtReadDoc();
2649    test_ret += test_htmlCtxtReadFile();
2650    test_ret += test_htmlCtxtReadMemory();
2651    test_ret += test_htmlCtxtReset();
2652    test_ret += test_htmlCtxtUseOptions();
2653    test_ret += test_htmlElementAllowedHere();
2654    test_ret += test_htmlElementStatusHere();
2655    test_ret += test_htmlEncodeEntities();
2656    test_ret += test_htmlEntityLookup();
2657    test_ret += test_htmlEntityValueLookup();
2658    test_ret += test_htmlHandleOmittedElem();
2659    test_ret += test_htmlIsAutoClosed();
2660    test_ret += test_htmlIsScriptAttribute();
2661    test_ret += test_htmlNodeStatus();
2662    test_ret += test_htmlParseCharRef();
2663    test_ret += test_htmlParseChunk();
2664    test_ret += test_htmlParseDoc();
2665    test_ret += test_htmlParseDocument();
2666    test_ret += test_htmlParseElement();
2667    test_ret += test_htmlParseEntityRef();
2668    test_ret += test_htmlParseFile();
2669    test_ret += test_htmlReadDoc();
2670    test_ret += test_htmlReadFile();
2671    test_ret += test_htmlReadMemory();
2672    test_ret += test_htmlSAXParseDoc();
2673    test_ret += test_htmlSAXParseFile();
2674    test_ret += test_htmlTagLookup();
2675
2676    if (test_ret != 0)
2677	printf("Module HTMLparser: %d errors\n", test_ret);
2678    return(test_ret);
2679}
2680
2681static int
2682test_htmlDocContentDumpFormatOutput(void) {
2683    int test_ret = 0;
2684
2685#ifdef LIBXML_HTML_ENABLED
2686#ifdef LIBXML_OUTPUT_ENABLED
2687    int mem_base;
2688    xmlOutputBufferPtr buf; /* the HTML buffer output */
2689    int n_buf;
2690    xmlDocPtr cur; /* the document */
2691    int n_cur;
2692    char * encoding; /* the encoding string */
2693    int n_encoding;
2694    int format; /* should formatting spaces been added */
2695    int n_format;
2696
2697    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2698    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2699    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2700    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2701        mem_base = xmlMemBlocks();
2702        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2703        cur = gen_xmlDocPtr(n_cur, 1);
2704        encoding = gen_const_char_ptr(n_encoding, 2);
2705        format = gen_int(n_format, 3);
2706
2707        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2708        call_tests++;
2709        des_xmlOutputBufferPtr(n_buf, buf, 0);
2710        des_xmlDocPtr(n_cur, cur, 1);
2711        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2712        des_int(n_format, format, 3);
2713        xmlResetLastError();
2714        if (mem_base != xmlMemBlocks()) {
2715            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2716	           xmlMemBlocks() - mem_base);
2717	    test_ret++;
2718            printf(" %d", n_buf);
2719            printf(" %d", n_cur);
2720            printf(" %d", n_encoding);
2721            printf(" %d", n_format);
2722            printf("\n");
2723        }
2724    }
2725    }
2726    }
2727    }
2728    function_tests++;
2729#endif
2730#endif
2731
2732    return(test_ret);
2733}
2734
2735
2736static int
2737test_htmlDocContentDumpOutput(void) {
2738    int test_ret = 0;
2739
2740#ifdef LIBXML_HTML_ENABLED
2741#ifdef LIBXML_OUTPUT_ENABLED
2742    int mem_base;
2743    xmlOutputBufferPtr buf; /* the HTML buffer output */
2744    int n_buf;
2745    xmlDocPtr cur; /* the document */
2746    int n_cur;
2747    char * encoding; /* the encoding string */
2748    int n_encoding;
2749
2750    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2751    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2752    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2753        mem_base = xmlMemBlocks();
2754        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2755        cur = gen_xmlDocPtr(n_cur, 1);
2756        encoding = gen_const_char_ptr(n_encoding, 2);
2757
2758        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2759        call_tests++;
2760        des_xmlOutputBufferPtr(n_buf, buf, 0);
2761        des_xmlDocPtr(n_cur, cur, 1);
2762        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2763        xmlResetLastError();
2764        if (mem_base != xmlMemBlocks()) {
2765            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2766	           xmlMemBlocks() - mem_base);
2767	    test_ret++;
2768            printf(" %d", n_buf);
2769            printf(" %d", n_cur);
2770            printf(" %d", n_encoding);
2771            printf("\n");
2772        }
2773    }
2774    }
2775    }
2776    function_tests++;
2777#endif
2778#endif
2779
2780    return(test_ret);
2781}
2782
2783
2784static int
2785test_htmlDocDump(void) {
2786    int test_ret = 0;
2787
2788#ifdef LIBXML_HTML_ENABLED
2789#ifdef LIBXML_OUTPUT_ENABLED
2790    int mem_base;
2791    int ret_val;
2792    FILE * f; /* the FILE* */
2793    int n_f;
2794    xmlDocPtr cur; /* the document */
2795    int n_cur;
2796
2797    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2798    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2799        mem_base = xmlMemBlocks();
2800        f = gen_FILE_ptr(n_f, 0);
2801        cur = gen_xmlDocPtr(n_cur, 1);
2802
2803        ret_val = htmlDocDump(f, cur);
2804        desret_int(ret_val);
2805        call_tests++;
2806        des_FILE_ptr(n_f, f, 0);
2807        des_xmlDocPtr(n_cur, cur, 1);
2808        xmlResetLastError();
2809        if (mem_base != xmlMemBlocks()) {
2810            printf("Leak of %d blocks found in htmlDocDump",
2811	           xmlMemBlocks() - mem_base);
2812	    test_ret++;
2813            printf(" %d", n_f);
2814            printf(" %d", n_cur);
2815            printf("\n");
2816        }
2817    }
2818    }
2819    function_tests++;
2820#endif
2821#endif
2822
2823    return(test_ret);
2824}
2825
2826
2827#define gen_nb_xmlChar_ptr_ptr 1
2828static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2829    return(NULL);
2830}
2831static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2832}
2833
2834static int
2835test_htmlDocDumpMemory(void) {
2836    int test_ret = 0;
2837
2838#ifdef LIBXML_HTML_ENABLED
2839#ifdef LIBXML_OUTPUT_ENABLED
2840    int mem_base;
2841    xmlDocPtr cur; /* the document */
2842    int n_cur;
2843    xmlChar ** mem; /* OUT: the memory pointer */
2844    int n_mem;
2845    int * size; /* OUT: the memory length */
2846    int n_size;
2847
2848    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2849    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2850    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2851        mem_base = xmlMemBlocks();
2852        cur = gen_xmlDocPtr(n_cur, 0);
2853        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2854        size = gen_int_ptr(n_size, 2);
2855
2856        htmlDocDumpMemory(cur, mem, size);
2857        call_tests++;
2858        des_xmlDocPtr(n_cur, cur, 0);
2859        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2860        des_int_ptr(n_size, size, 2);
2861        xmlResetLastError();
2862        if (mem_base != xmlMemBlocks()) {
2863            printf("Leak of %d blocks found in htmlDocDumpMemory",
2864	           xmlMemBlocks() - mem_base);
2865	    test_ret++;
2866            printf(" %d", n_cur);
2867            printf(" %d", n_mem);
2868            printf(" %d", n_size);
2869            printf("\n");
2870        }
2871    }
2872    }
2873    }
2874    function_tests++;
2875#endif
2876#endif
2877
2878    return(test_ret);
2879}
2880
2881
2882static int
2883test_htmlGetMetaEncoding(void) {
2884    int test_ret = 0;
2885
2886#ifdef LIBXML_HTML_ENABLED
2887    int mem_base;
2888    const xmlChar * ret_val;
2889    htmlDocPtr doc; /* the document */
2890    int n_doc;
2891
2892    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2893        mem_base = xmlMemBlocks();
2894        doc = gen_htmlDocPtr(n_doc, 0);
2895
2896        ret_val = htmlGetMetaEncoding(doc);
2897        desret_const_xmlChar_ptr(ret_val);
2898        call_tests++;
2899        des_htmlDocPtr(n_doc, doc, 0);
2900        xmlResetLastError();
2901        if (mem_base != xmlMemBlocks()) {
2902            printf("Leak of %d blocks found in htmlGetMetaEncoding",
2903	           xmlMemBlocks() - mem_base);
2904	    test_ret++;
2905            printf(" %d", n_doc);
2906            printf("\n");
2907        }
2908    }
2909    function_tests++;
2910#endif
2911
2912    return(test_ret);
2913}
2914
2915
2916static int
2917test_htmlIsBooleanAttr(void) {
2918    int test_ret = 0;
2919
2920#ifdef LIBXML_HTML_ENABLED
2921    int mem_base;
2922    int ret_val;
2923    xmlChar * name; /* the name of the attribute to check */
2924    int n_name;
2925
2926    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2927        mem_base = xmlMemBlocks();
2928        name = gen_const_xmlChar_ptr(n_name, 0);
2929
2930        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
2931        desret_int(ret_val);
2932        call_tests++;
2933        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2934        xmlResetLastError();
2935        if (mem_base != xmlMemBlocks()) {
2936            printf("Leak of %d blocks found in htmlIsBooleanAttr",
2937	           xmlMemBlocks() - mem_base);
2938	    test_ret++;
2939            printf(" %d", n_name);
2940            printf("\n");
2941        }
2942    }
2943    function_tests++;
2944#endif
2945
2946    return(test_ret);
2947}
2948
2949
2950static int
2951test_htmlNewDoc(void) {
2952    int test_ret = 0;
2953
2954#ifdef LIBXML_HTML_ENABLED
2955    int mem_base;
2956    htmlDocPtr ret_val;
2957    xmlChar * URI; /* URI for the dtd, or NULL */
2958    int n_URI;
2959    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
2960    int n_ExternalID;
2961
2962    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
2963    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
2964        mem_base = xmlMemBlocks();
2965        URI = gen_const_xmlChar_ptr(n_URI, 0);
2966        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
2967
2968        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
2969        desret_htmlDocPtr(ret_val);
2970        call_tests++;
2971        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
2972        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
2973        xmlResetLastError();
2974        if (mem_base != xmlMemBlocks()) {
2975            printf("Leak of %d blocks found in htmlNewDoc",
2976	           xmlMemBlocks() - mem_base);
2977	    test_ret++;
2978            printf(" %d", n_URI);
2979            printf(" %d", n_ExternalID);
2980            printf("\n");
2981        }
2982    }
2983    }
2984    function_tests++;
2985#endif
2986
2987    return(test_ret);
2988}
2989
2990
2991static int
2992test_htmlNewDocNoDtD(void) {
2993    int test_ret = 0;
2994
2995#ifdef LIBXML_HTML_ENABLED
2996    int mem_base;
2997    htmlDocPtr ret_val;
2998    xmlChar * URI; /* URI for the dtd, or NULL */
2999    int n_URI;
3000    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3001    int n_ExternalID;
3002
3003    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3004    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3005        mem_base = xmlMemBlocks();
3006        URI = gen_const_xmlChar_ptr(n_URI, 0);
3007        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3008
3009        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3010        desret_htmlDocPtr(ret_val);
3011        call_tests++;
3012        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3013        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3014        xmlResetLastError();
3015        if (mem_base != xmlMemBlocks()) {
3016            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3017	           xmlMemBlocks() - mem_base);
3018	    test_ret++;
3019            printf(" %d", n_URI);
3020            printf(" %d", n_ExternalID);
3021            printf("\n");
3022        }
3023    }
3024    }
3025    function_tests++;
3026#endif
3027
3028    return(test_ret);
3029}
3030
3031
3032static int
3033test_htmlNodeDump(void) {
3034    int test_ret = 0;
3035
3036#ifdef LIBXML_HTML_ENABLED
3037#ifdef LIBXML_OUTPUT_ENABLED
3038    int mem_base;
3039    int ret_val;
3040    xmlBufferPtr buf; /* the HTML buffer output */
3041    int n_buf;
3042    xmlDocPtr doc; /* the document */
3043    int n_doc;
3044    xmlNodePtr cur; /* the current node */
3045    int n_cur;
3046
3047    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3048    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3049    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3050        mem_base = xmlMemBlocks();
3051        buf = gen_xmlBufferPtr(n_buf, 0);
3052        doc = gen_xmlDocPtr(n_doc, 1);
3053        cur = gen_xmlNodePtr(n_cur, 2);
3054
3055        ret_val = htmlNodeDump(buf, doc, cur);
3056        desret_int(ret_val);
3057        call_tests++;
3058        des_xmlBufferPtr(n_buf, buf, 0);
3059        des_xmlDocPtr(n_doc, doc, 1);
3060        des_xmlNodePtr(n_cur, cur, 2);
3061        xmlResetLastError();
3062        if (mem_base != xmlMemBlocks()) {
3063            printf("Leak of %d blocks found in htmlNodeDump",
3064	           xmlMemBlocks() - mem_base);
3065	    test_ret++;
3066            printf(" %d", n_buf);
3067            printf(" %d", n_doc);
3068            printf(" %d", n_cur);
3069            printf("\n");
3070        }
3071    }
3072    }
3073    }
3074    function_tests++;
3075#endif
3076#endif
3077
3078    return(test_ret);
3079}
3080
3081
3082static int
3083test_htmlNodeDumpFile(void) {
3084    int test_ret = 0;
3085
3086#ifdef LIBXML_HTML_ENABLED
3087#ifdef LIBXML_OUTPUT_ENABLED
3088    int mem_base;
3089    FILE * out; /* the FILE pointer */
3090    int n_out;
3091    xmlDocPtr doc; /* the document */
3092    int n_doc;
3093    xmlNodePtr cur; /* the current node */
3094    int n_cur;
3095
3096    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3097    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3098    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3099        mem_base = xmlMemBlocks();
3100        out = gen_FILE_ptr(n_out, 0);
3101        doc = gen_xmlDocPtr(n_doc, 1);
3102        cur = gen_xmlNodePtr(n_cur, 2);
3103
3104        htmlNodeDumpFile(out, doc, cur);
3105        call_tests++;
3106        des_FILE_ptr(n_out, out, 0);
3107        des_xmlDocPtr(n_doc, doc, 1);
3108        des_xmlNodePtr(n_cur, cur, 2);
3109        xmlResetLastError();
3110        if (mem_base != xmlMemBlocks()) {
3111            printf("Leak of %d blocks found in htmlNodeDumpFile",
3112	           xmlMemBlocks() - mem_base);
3113	    test_ret++;
3114            printf(" %d", n_out);
3115            printf(" %d", n_doc);
3116            printf(" %d", n_cur);
3117            printf("\n");
3118        }
3119    }
3120    }
3121    }
3122    function_tests++;
3123#endif
3124#endif
3125
3126    return(test_ret);
3127}
3128
3129
3130static int
3131test_htmlNodeDumpFileFormat(void) {
3132    int test_ret = 0;
3133
3134#ifdef LIBXML_HTML_ENABLED
3135#ifdef LIBXML_OUTPUT_ENABLED
3136    int mem_base;
3137    int ret_val;
3138    FILE * out; /* the FILE pointer */
3139    int n_out;
3140    xmlDocPtr doc; /* the document */
3141    int n_doc;
3142    xmlNodePtr cur; /* the current node */
3143    int n_cur;
3144    char * encoding; /* the document encoding */
3145    int n_encoding;
3146    int format; /* should formatting spaces been added */
3147    int n_format;
3148
3149    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3150    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3151    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3152    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3153    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3154        mem_base = xmlMemBlocks();
3155        out = gen_FILE_ptr(n_out, 0);
3156        doc = gen_xmlDocPtr(n_doc, 1);
3157        cur = gen_xmlNodePtr(n_cur, 2);
3158        encoding = gen_const_char_ptr(n_encoding, 3);
3159        format = gen_int(n_format, 4);
3160
3161        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3162        desret_int(ret_val);
3163        call_tests++;
3164        des_FILE_ptr(n_out, out, 0);
3165        des_xmlDocPtr(n_doc, doc, 1);
3166        des_xmlNodePtr(n_cur, cur, 2);
3167        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3168        des_int(n_format, format, 4);
3169        xmlResetLastError();
3170        if (mem_base != xmlMemBlocks()) {
3171            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3172	           xmlMemBlocks() - mem_base);
3173	    test_ret++;
3174            printf(" %d", n_out);
3175            printf(" %d", n_doc);
3176            printf(" %d", n_cur);
3177            printf(" %d", n_encoding);
3178            printf(" %d", n_format);
3179            printf("\n");
3180        }
3181    }
3182    }
3183    }
3184    }
3185    }
3186    function_tests++;
3187#endif
3188#endif
3189
3190    return(test_ret);
3191}
3192
3193
3194static int
3195test_htmlNodeDumpFormatOutput(void) {
3196    int test_ret = 0;
3197
3198#ifdef LIBXML_HTML_ENABLED
3199#ifdef LIBXML_OUTPUT_ENABLED
3200    int mem_base;
3201    xmlOutputBufferPtr buf; /* the HTML buffer output */
3202    int n_buf;
3203    xmlDocPtr doc; /* the document */
3204    int n_doc;
3205    xmlNodePtr cur; /* the current node */
3206    int n_cur;
3207    char * encoding; /* the encoding string */
3208    int n_encoding;
3209    int format; /* should formatting spaces been added */
3210    int n_format;
3211
3212    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3213    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3214    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3215    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3216    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3217        mem_base = xmlMemBlocks();
3218        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3219        doc = gen_xmlDocPtr(n_doc, 1);
3220        cur = gen_xmlNodePtr(n_cur, 2);
3221        encoding = gen_const_char_ptr(n_encoding, 3);
3222        format = gen_int(n_format, 4);
3223
3224        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3225        call_tests++;
3226        des_xmlOutputBufferPtr(n_buf, buf, 0);
3227        des_xmlDocPtr(n_doc, doc, 1);
3228        des_xmlNodePtr(n_cur, cur, 2);
3229        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3230        des_int(n_format, format, 4);
3231        xmlResetLastError();
3232        if (mem_base != xmlMemBlocks()) {
3233            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3234	           xmlMemBlocks() - mem_base);
3235	    test_ret++;
3236            printf(" %d", n_buf);
3237            printf(" %d", n_doc);
3238            printf(" %d", n_cur);
3239            printf(" %d", n_encoding);
3240            printf(" %d", n_format);
3241            printf("\n");
3242        }
3243    }
3244    }
3245    }
3246    }
3247    }
3248    function_tests++;
3249#endif
3250#endif
3251
3252    return(test_ret);
3253}
3254
3255
3256static int
3257test_htmlNodeDumpOutput(void) {
3258    int test_ret = 0;
3259
3260#ifdef LIBXML_HTML_ENABLED
3261#ifdef LIBXML_OUTPUT_ENABLED
3262    int mem_base;
3263    xmlOutputBufferPtr buf; /* the HTML buffer output */
3264    int n_buf;
3265    xmlDocPtr doc; /* the document */
3266    int n_doc;
3267    xmlNodePtr cur; /* the current node */
3268    int n_cur;
3269    char * encoding; /* the encoding string */
3270    int n_encoding;
3271
3272    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3273    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3274    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3275    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3276        mem_base = xmlMemBlocks();
3277        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3278        doc = gen_xmlDocPtr(n_doc, 1);
3279        cur = gen_xmlNodePtr(n_cur, 2);
3280        encoding = gen_const_char_ptr(n_encoding, 3);
3281
3282        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3283        call_tests++;
3284        des_xmlOutputBufferPtr(n_buf, buf, 0);
3285        des_xmlDocPtr(n_doc, doc, 1);
3286        des_xmlNodePtr(n_cur, cur, 2);
3287        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3288        xmlResetLastError();
3289        if (mem_base != xmlMemBlocks()) {
3290            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3291	           xmlMemBlocks() - mem_base);
3292	    test_ret++;
3293            printf(" %d", n_buf);
3294            printf(" %d", n_doc);
3295            printf(" %d", n_cur);
3296            printf(" %d", n_encoding);
3297            printf("\n");
3298        }
3299    }
3300    }
3301    }
3302    }
3303    function_tests++;
3304#endif
3305#endif
3306
3307    return(test_ret);
3308}
3309
3310
3311static int
3312test_htmlSaveFile(void) {
3313    int test_ret = 0;
3314
3315#ifdef LIBXML_HTML_ENABLED
3316#ifdef LIBXML_OUTPUT_ENABLED
3317    int mem_base;
3318    int ret_val;
3319    const char * filename; /* the filename (or URL) */
3320    int n_filename;
3321    xmlDocPtr cur; /* the document */
3322    int n_cur;
3323
3324    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3325    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3326        mem_base = xmlMemBlocks();
3327        filename = gen_fileoutput(n_filename, 0);
3328        cur = gen_xmlDocPtr(n_cur, 1);
3329
3330        ret_val = htmlSaveFile(filename, cur);
3331        desret_int(ret_val);
3332        call_tests++;
3333        des_fileoutput(n_filename, filename, 0);
3334        des_xmlDocPtr(n_cur, cur, 1);
3335        xmlResetLastError();
3336        if (mem_base != xmlMemBlocks()) {
3337            printf("Leak of %d blocks found in htmlSaveFile",
3338	           xmlMemBlocks() - mem_base);
3339	    test_ret++;
3340            printf(" %d", n_filename);
3341            printf(" %d", n_cur);
3342            printf("\n");
3343        }
3344    }
3345    }
3346    function_tests++;
3347#endif
3348#endif
3349
3350    return(test_ret);
3351}
3352
3353
3354static int
3355test_htmlSaveFileEnc(void) {
3356    int test_ret = 0;
3357
3358#ifdef LIBXML_HTML_ENABLED
3359#ifdef LIBXML_OUTPUT_ENABLED
3360    int mem_base;
3361    int ret_val;
3362    const char * filename; /* the filename */
3363    int n_filename;
3364    xmlDocPtr cur; /* the document */
3365    int n_cur;
3366    char * encoding; /* the document encoding */
3367    int n_encoding;
3368
3369    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3370    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3371    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3372        mem_base = xmlMemBlocks();
3373        filename = gen_fileoutput(n_filename, 0);
3374        cur = gen_xmlDocPtr(n_cur, 1);
3375        encoding = gen_const_char_ptr(n_encoding, 2);
3376
3377        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3378        desret_int(ret_val);
3379        call_tests++;
3380        des_fileoutput(n_filename, filename, 0);
3381        des_xmlDocPtr(n_cur, cur, 1);
3382        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3383        xmlResetLastError();
3384        if (mem_base != xmlMemBlocks()) {
3385            printf("Leak of %d blocks found in htmlSaveFileEnc",
3386	           xmlMemBlocks() - mem_base);
3387	    test_ret++;
3388            printf(" %d", n_filename);
3389            printf(" %d", n_cur);
3390            printf(" %d", n_encoding);
3391            printf("\n");
3392        }
3393    }
3394    }
3395    }
3396    function_tests++;
3397#endif
3398#endif
3399
3400    return(test_ret);
3401}
3402
3403
3404static int
3405test_htmlSaveFileFormat(void) {
3406    int test_ret = 0;
3407
3408#ifdef LIBXML_HTML_ENABLED
3409#ifdef LIBXML_OUTPUT_ENABLED
3410    int mem_base;
3411    int ret_val;
3412    const char * filename; /* the filename */
3413    int n_filename;
3414    xmlDocPtr cur; /* the document */
3415    int n_cur;
3416    char * encoding; /* the document encoding */
3417    int n_encoding;
3418    int format; /* should formatting spaces been added */
3419    int n_format;
3420
3421    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3422    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3423    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3424    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3425        mem_base = xmlMemBlocks();
3426        filename = gen_fileoutput(n_filename, 0);
3427        cur = gen_xmlDocPtr(n_cur, 1);
3428        encoding = gen_const_char_ptr(n_encoding, 2);
3429        format = gen_int(n_format, 3);
3430
3431        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3432        desret_int(ret_val);
3433        call_tests++;
3434        des_fileoutput(n_filename, filename, 0);
3435        des_xmlDocPtr(n_cur, cur, 1);
3436        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3437        des_int(n_format, format, 3);
3438        xmlResetLastError();
3439        if (mem_base != xmlMemBlocks()) {
3440            printf("Leak of %d blocks found in htmlSaveFileFormat",
3441	           xmlMemBlocks() - mem_base);
3442	    test_ret++;
3443            printf(" %d", n_filename);
3444            printf(" %d", n_cur);
3445            printf(" %d", n_encoding);
3446            printf(" %d", n_format);
3447            printf("\n");
3448        }
3449    }
3450    }
3451    }
3452    }
3453    function_tests++;
3454#endif
3455#endif
3456
3457    return(test_ret);
3458}
3459
3460
3461static int
3462test_htmlSetMetaEncoding(void) {
3463    int test_ret = 0;
3464
3465#ifdef LIBXML_HTML_ENABLED
3466    int mem_base;
3467    int ret_val;
3468    htmlDocPtr doc; /* the document */
3469    int n_doc;
3470    xmlChar * encoding; /* the encoding string */
3471    int n_encoding;
3472
3473    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3474    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3475        mem_base = xmlMemBlocks();
3476        doc = gen_htmlDocPtr(n_doc, 0);
3477        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3478
3479        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3480        desret_int(ret_val);
3481        call_tests++;
3482        des_htmlDocPtr(n_doc, doc, 0);
3483        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3484        xmlResetLastError();
3485        if (mem_base != xmlMemBlocks()) {
3486            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3487	           xmlMemBlocks() - mem_base);
3488	    test_ret++;
3489            printf(" %d", n_doc);
3490            printf(" %d", n_encoding);
3491            printf("\n");
3492        }
3493    }
3494    }
3495    function_tests++;
3496#endif
3497
3498    return(test_ret);
3499}
3500
3501static int
3502test_HTMLtree(void) {
3503    int test_ret = 0;
3504
3505    if (quiet == 0) printf("Testing HTMLtree : 17 of 17 functions ...\n");
3506    test_ret += test_htmlDocContentDumpFormatOutput();
3507    test_ret += test_htmlDocContentDumpOutput();
3508    test_ret += test_htmlDocDump();
3509    test_ret += test_htmlDocDumpMemory();
3510    test_ret += test_htmlGetMetaEncoding();
3511    test_ret += test_htmlIsBooleanAttr();
3512    test_ret += test_htmlNewDoc();
3513    test_ret += test_htmlNewDocNoDtD();
3514    test_ret += test_htmlNodeDump();
3515    test_ret += test_htmlNodeDumpFile();
3516    test_ret += test_htmlNodeDumpFileFormat();
3517    test_ret += test_htmlNodeDumpFormatOutput();
3518    test_ret += test_htmlNodeDumpOutput();
3519    test_ret += test_htmlSaveFile();
3520    test_ret += test_htmlSaveFileEnc();
3521    test_ret += test_htmlSaveFileFormat();
3522    test_ret += test_htmlSetMetaEncoding();
3523
3524    if (test_ret != 0)
3525	printf("Module HTMLtree: %d errors\n", test_ret);
3526    return(test_ret);
3527}
3528
3529static int
3530test_docbDefaultSAXHandlerInit(void) {
3531    int test_ret = 0;
3532
3533#ifdef LIBXML_DOCB_ENABLED
3534    int mem_base;
3535
3536        mem_base = xmlMemBlocks();
3537
3538        docbDefaultSAXHandlerInit();
3539        call_tests++;
3540        xmlResetLastError();
3541        if (mem_base != xmlMemBlocks()) {
3542            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3543	           xmlMemBlocks() - mem_base);
3544	    test_ret++;
3545            printf("\n");
3546        }
3547    function_tests++;
3548#endif
3549
3550    return(test_ret);
3551}
3552
3553
3554static int
3555test_htmlDefaultSAXHandlerInit(void) {
3556    int test_ret = 0;
3557
3558#ifdef LIBXML_HTML_ENABLED
3559    int mem_base;
3560
3561        mem_base = xmlMemBlocks();
3562
3563        htmlDefaultSAXHandlerInit();
3564        call_tests++;
3565        xmlResetLastError();
3566        if (mem_base != xmlMemBlocks()) {
3567            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3568	           xmlMemBlocks() - mem_base);
3569	    test_ret++;
3570            printf("\n");
3571        }
3572    function_tests++;
3573#endif
3574
3575    return(test_ret);
3576}
3577
3578
3579static int
3580test_xmlDefaultSAXHandlerInit(void) {
3581    int test_ret = 0;
3582
3583    int mem_base;
3584
3585        mem_base = xmlMemBlocks();
3586
3587        xmlDefaultSAXHandlerInit();
3588        call_tests++;
3589        xmlResetLastError();
3590        if (mem_base != xmlMemBlocks()) {
3591            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3592	           xmlMemBlocks() - mem_base);
3593	    test_ret++;
3594            printf("\n");
3595        }
3596    function_tests++;
3597
3598    return(test_ret);
3599}
3600
3601
3602#define gen_nb_xmlEnumerationPtr 1
3603static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3604    return(NULL);
3605}
3606static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3607}
3608
3609static int
3610test_xmlSAX2AttributeDecl(void) {
3611    int test_ret = 0;
3612
3613    int mem_base;
3614    void * ctx; /* the user data (XML parser context) */
3615    int n_ctx;
3616    xmlChar * elem; /* the name of the element */
3617    int n_elem;
3618    xmlChar * fullname; /* the attribute name */
3619    int n_fullname;
3620    int type; /* the attribute type */
3621    int n_type;
3622    int def; /* the type of default value */
3623    int n_def;
3624    xmlChar * defaultValue; /* the attribute default value */
3625    int n_defaultValue;
3626    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3627    int n_tree;
3628
3629    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3630    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3631    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3632    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3633    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3634    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3635    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3636        mem_base = xmlMemBlocks();
3637        ctx = gen_void_ptr(n_ctx, 0);
3638        elem = gen_const_xmlChar_ptr(n_elem, 1);
3639        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3640        type = gen_int(n_type, 3);
3641        def = gen_int(n_def, 4);
3642        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3643        tree = gen_xmlEnumerationPtr(n_tree, 6);
3644
3645        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3646        call_tests++;
3647        des_void_ptr(n_ctx, ctx, 0);
3648        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3649        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3650        des_int(n_type, type, 3);
3651        des_int(n_def, def, 4);
3652        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3653        des_xmlEnumerationPtr(n_tree, tree, 6);
3654        xmlResetLastError();
3655        if (mem_base != xmlMemBlocks()) {
3656            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3657	           xmlMemBlocks() - mem_base);
3658	    test_ret++;
3659            printf(" %d", n_ctx);
3660            printf(" %d", n_elem);
3661            printf(" %d", n_fullname);
3662            printf(" %d", n_type);
3663            printf(" %d", n_def);
3664            printf(" %d", n_defaultValue);
3665            printf(" %d", n_tree);
3666            printf("\n");
3667        }
3668    }
3669    }
3670    }
3671    }
3672    }
3673    }
3674    }
3675    function_tests++;
3676
3677    return(test_ret);
3678}
3679
3680
3681static int
3682test_xmlSAX2CDataBlock(void) {
3683    int test_ret = 0;
3684
3685    int mem_base;
3686    void * ctx; /* the user data (XML parser context) */
3687    int n_ctx;
3688    xmlChar * value; /* The pcdata content */
3689    int n_value;
3690    int len; /* the block length */
3691    int n_len;
3692
3693    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3694    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3695    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3696        mem_base = xmlMemBlocks();
3697        ctx = gen_void_ptr(n_ctx, 0);
3698        value = gen_const_xmlChar_ptr(n_value, 1);
3699        len = gen_int(n_len, 2);
3700
3701        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3702        call_tests++;
3703        des_void_ptr(n_ctx, ctx, 0);
3704        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3705        des_int(n_len, len, 2);
3706        xmlResetLastError();
3707        if (mem_base != xmlMemBlocks()) {
3708            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3709	           xmlMemBlocks() - mem_base);
3710	    test_ret++;
3711            printf(" %d", n_ctx);
3712            printf(" %d", n_value);
3713            printf(" %d", n_len);
3714            printf("\n");
3715        }
3716    }
3717    }
3718    }
3719    function_tests++;
3720
3721    return(test_ret);
3722}
3723
3724
3725static int
3726test_xmlSAX2Characters(void) {
3727    int test_ret = 0;
3728
3729    int mem_base;
3730    void * ctx; /* the user data (XML parser context) */
3731    int n_ctx;
3732    xmlChar * ch; /* a xmlChar string */
3733    int n_ch;
3734    int len; /* the number of xmlChar */
3735    int n_len;
3736
3737    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3738    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3739    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3740        mem_base = xmlMemBlocks();
3741        ctx = gen_void_ptr(n_ctx, 0);
3742        ch = gen_const_xmlChar_ptr(n_ch, 1);
3743        len = gen_int(n_len, 2);
3744
3745        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3746        call_tests++;
3747        des_void_ptr(n_ctx, ctx, 0);
3748        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3749        des_int(n_len, len, 2);
3750        xmlResetLastError();
3751        if (mem_base != xmlMemBlocks()) {
3752            printf("Leak of %d blocks found in xmlSAX2Characters",
3753	           xmlMemBlocks() - mem_base);
3754	    test_ret++;
3755            printf(" %d", n_ctx);
3756            printf(" %d", n_ch);
3757            printf(" %d", n_len);
3758            printf("\n");
3759        }
3760    }
3761    }
3762    }
3763    function_tests++;
3764
3765    return(test_ret);
3766}
3767
3768
3769static int
3770test_xmlSAX2Comment(void) {
3771    int test_ret = 0;
3772
3773    int mem_base;
3774    void * ctx; /* the user data (XML parser context) */
3775    int n_ctx;
3776    xmlChar * value; /* the xmlSAX2Comment content */
3777    int n_value;
3778
3779    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3780    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3781        mem_base = xmlMemBlocks();
3782        ctx = gen_void_ptr(n_ctx, 0);
3783        value = gen_const_xmlChar_ptr(n_value, 1);
3784
3785        xmlSAX2Comment(ctx, (const xmlChar *)value);
3786        call_tests++;
3787        des_void_ptr(n_ctx, ctx, 0);
3788        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3789        xmlResetLastError();
3790        if (mem_base != xmlMemBlocks()) {
3791            printf("Leak of %d blocks found in xmlSAX2Comment",
3792	           xmlMemBlocks() - mem_base);
3793	    test_ret++;
3794            printf(" %d", n_ctx);
3795            printf(" %d", n_value);
3796            printf("\n");
3797        }
3798    }
3799    }
3800    function_tests++;
3801
3802    return(test_ret);
3803}
3804
3805
3806static int
3807test_xmlSAX2ElementDecl(void) {
3808    int test_ret = 0;
3809
3810    int mem_base;
3811    void * ctx; /* the user data (XML parser context) */
3812    int n_ctx;
3813    xmlChar * name; /* the element name */
3814    int n_name;
3815    int type; /* the element type */
3816    int n_type;
3817    xmlElementContentPtr content; /* the element value tree */
3818    int n_content;
3819
3820    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3821    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3822    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3823    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3824        mem_base = xmlMemBlocks();
3825        ctx = gen_void_ptr(n_ctx, 0);
3826        name = gen_const_xmlChar_ptr(n_name, 1);
3827        type = gen_int(n_type, 2);
3828        content = gen_xmlElementContentPtr(n_content, 3);
3829
3830        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3831        call_tests++;
3832        des_void_ptr(n_ctx, ctx, 0);
3833        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3834        des_int(n_type, type, 2);
3835        des_xmlElementContentPtr(n_content, content, 3);
3836        xmlResetLastError();
3837        if (mem_base != xmlMemBlocks()) {
3838            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
3839	           xmlMemBlocks() - mem_base);
3840	    test_ret++;
3841            printf(" %d", n_ctx);
3842            printf(" %d", n_name);
3843            printf(" %d", n_type);
3844            printf(" %d", n_content);
3845            printf("\n");
3846        }
3847    }
3848    }
3849    }
3850    }
3851    function_tests++;
3852
3853    return(test_ret);
3854}
3855
3856
3857static int
3858test_xmlSAX2EndDocument(void) {
3859    int test_ret = 0;
3860
3861    int mem_base;
3862    void * ctx; /* the user data (XML parser context) */
3863    int n_ctx;
3864
3865    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3866        mem_base = xmlMemBlocks();
3867        ctx = gen_void_ptr(n_ctx, 0);
3868
3869        xmlSAX2EndDocument(ctx);
3870        call_tests++;
3871        des_void_ptr(n_ctx, ctx, 0);
3872        xmlResetLastError();
3873        if (mem_base != xmlMemBlocks()) {
3874            printf("Leak of %d blocks found in xmlSAX2EndDocument",
3875	           xmlMemBlocks() - mem_base);
3876	    test_ret++;
3877            printf(" %d", n_ctx);
3878            printf("\n");
3879        }
3880    }
3881    function_tests++;
3882
3883    return(test_ret);
3884}
3885
3886
3887static int
3888test_xmlSAX2EndElement(void) {
3889    int test_ret = 0;
3890
3891#ifdef LIBXML_SAX1_ENABLED
3892    int mem_base;
3893    void * ctx; /* the user data (XML parser context) */
3894    int n_ctx;
3895    xmlChar * name; /* The element name */
3896    int n_name;
3897
3898    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3899    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3900        mem_base = xmlMemBlocks();
3901        ctx = gen_void_ptr(n_ctx, 0);
3902        name = gen_const_xmlChar_ptr(n_name, 1);
3903
3904        xmlSAX2EndElement(ctx, (const xmlChar *)name);
3905        call_tests++;
3906        des_void_ptr(n_ctx, ctx, 0);
3907        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3908        xmlResetLastError();
3909        if (mem_base != xmlMemBlocks()) {
3910            printf("Leak of %d blocks found in xmlSAX2EndElement",
3911	           xmlMemBlocks() - mem_base);
3912	    test_ret++;
3913            printf(" %d", n_ctx);
3914            printf(" %d", n_name);
3915            printf("\n");
3916        }
3917    }
3918    }
3919    function_tests++;
3920#endif
3921
3922    return(test_ret);
3923}
3924
3925
3926static int
3927test_xmlSAX2EndElementNs(void) {
3928    int test_ret = 0;
3929
3930    int mem_base;
3931    void * ctx; /* the user data (XML parser context) */
3932    int n_ctx;
3933    xmlChar * localname; /* the local name of the element */
3934    int n_localname;
3935    xmlChar * prefix; /* the element namespace prefix if available */
3936    int n_prefix;
3937    xmlChar * URI; /* the element namespace name if available */
3938    int n_URI;
3939
3940    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3941    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
3942    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
3943    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3944        mem_base = xmlMemBlocks();
3945        ctx = gen_void_ptr(n_ctx, 0);
3946        localname = gen_const_xmlChar_ptr(n_localname, 1);
3947        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
3948        URI = gen_const_xmlChar_ptr(n_URI, 3);
3949
3950        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
3951        call_tests++;
3952        des_void_ptr(n_ctx, ctx, 0);
3953        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
3954        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
3955        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
3956        xmlResetLastError();
3957        if (mem_base != xmlMemBlocks()) {
3958            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
3959	           xmlMemBlocks() - mem_base);
3960	    test_ret++;
3961            printf(" %d", n_ctx);
3962            printf(" %d", n_localname);
3963            printf(" %d", n_prefix);
3964            printf(" %d", n_URI);
3965            printf("\n");
3966        }
3967    }
3968    }
3969    }
3970    }
3971    function_tests++;
3972
3973    return(test_ret);
3974}
3975
3976
3977static int
3978test_xmlSAX2EntityDecl(void) {
3979    int test_ret = 0;
3980
3981    int mem_base;
3982    void * ctx; /* the user data (XML parser context) */
3983    int n_ctx;
3984    xmlChar * name; /* the entity name */
3985    int n_name;
3986    int type; /* the entity type */
3987    int n_type;
3988    xmlChar * publicId; /* The public ID of the entity */
3989    int n_publicId;
3990    xmlChar * systemId; /* The system ID of the entity */
3991    int n_systemId;
3992    xmlChar * content; /* the entity value (without processing). */
3993    int n_content;
3994
3995    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3996    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3997    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3998    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
3999    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4000    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4001        mem_base = xmlMemBlocks();
4002        ctx = gen_void_ptr(n_ctx, 0);
4003        name = gen_const_xmlChar_ptr(n_name, 1);
4004        type = gen_int(n_type, 2);
4005        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4006        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4007        content = gen_xmlChar_ptr(n_content, 5);
4008
4009        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4010        call_tests++;
4011        des_void_ptr(n_ctx, ctx, 0);
4012        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4013        des_int(n_type, type, 2);
4014        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4015        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4016        des_xmlChar_ptr(n_content, content, 5);
4017        xmlResetLastError();
4018        if (mem_base != xmlMemBlocks()) {
4019            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4020	           xmlMemBlocks() - mem_base);
4021	    test_ret++;
4022            printf(" %d", n_ctx);
4023            printf(" %d", n_name);
4024            printf(" %d", n_type);
4025            printf(" %d", n_publicId);
4026            printf(" %d", n_systemId);
4027            printf(" %d", n_content);
4028            printf("\n");
4029        }
4030    }
4031    }
4032    }
4033    }
4034    }
4035    }
4036    function_tests++;
4037
4038    return(test_ret);
4039}
4040
4041
4042static int
4043test_xmlSAX2ExternalSubset(void) {
4044    int test_ret = 0;
4045
4046    int mem_base;
4047    void * ctx; /* the user data (XML parser context) */
4048    int n_ctx;
4049    xmlChar * name; /* the root element name */
4050    int n_name;
4051    xmlChar * ExternalID; /* the external ID */
4052    int n_ExternalID;
4053    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4054    int n_SystemID;
4055
4056    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4057    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4058    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4059    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4060        mem_base = xmlMemBlocks();
4061        ctx = gen_void_ptr(n_ctx, 0);
4062        name = gen_const_xmlChar_ptr(n_name, 1);
4063        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4064        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4065
4066        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4067        call_tests++;
4068        des_void_ptr(n_ctx, ctx, 0);
4069        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4070        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4071        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4072        xmlResetLastError();
4073        if (mem_base != xmlMemBlocks()) {
4074            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4075	           xmlMemBlocks() - mem_base);
4076	    test_ret++;
4077            printf(" %d", n_ctx);
4078            printf(" %d", n_name);
4079            printf(" %d", n_ExternalID);
4080            printf(" %d", n_SystemID);
4081            printf("\n");
4082        }
4083    }
4084    }
4085    }
4086    }
4087    function_tests++;
4088
4089    return(test_ret);
4090}
4091
4092
4093static int
4094test_xmlSAX2GetColumnNumber(void) {
4095    int test_ret = 0;
4096
4097    int mem_base;
4098    int ret_val;
4099    void * ctx; /* the user data (XML parser context) */
4100    int n_ctx;
4101
4102    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4103        mem_base = xmlMemBlocks();
4104        ctx = gen_void_ptr(n_ctx, 0);
4105
4106        ret_val = xmlSAX2GetColumnNumber(ctx);
4107        desret_int(ret_val);
4108        call_tests++;
4109        des_void_ptr(n_ctx, ctx, 0);
4110        xmlResetLastError();
4111        if (mem_base != xmlMemBlocks()) {
4112            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4113	           xmlMemBlocks() - mem_base);
4114	    test_ret++;
4115            printf(" %d", n_ctx);
4116            printf("\n");
4117        }
4118    }
4119    function_tests++;
4120
4121    return(test_ret);
4122}
4123
4124
4125static int
4126test_xmlSAX2GetEntity(void) {
4127    int test_ret = 0;
4128
4129    int mem_base;
4130    xmlEntityPtr ret_val;
4131    void * ctx; /* the user data (XML parser context) */
4132    int n_ctx;
4133    xmlChar * name; /* The entity name */
4134    int n_name;
4135
4136    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4137    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4138        mem_base = xmlMemBlocks();
4139        ctx = gen_void_ptr(n_ctx, 0);
4140        name = gen_const_xmlChar_ptr(n_name, 1);
4141
4142        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4143        desret_xmlEntityPtr(ret_val);
4144        call_tests++;
4145        des_void_ptr(n_ctx, ctx, 0);
4146        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4147        xmlResetLastError();
4148        if (mem_base != xmlMemBlocks()) {
4149            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4150	           xmlMemBlocks() - mem_base);
4151	    test_ret++;
4152            printf(" %d", n_ctx);
4153            printf(" %d", n_name);
4154            printf("\n");
4155        }
4156    }
4157    }
4158    function_tests++;
4159
4160    return(test_ret);
4161}
4162
4163
4164static int
4165test_xmlSAX2GetLineNumber(void) {
4166    int test_ret = 0;
4167
4168    int mem_base;
4169    int ret_val;
4170    void * ctx; /* the user data (XML parser context) */
4171    int n_ctx;
4172
4173    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4174        mem_base = xmlMemBlocks();
4175        ctx = gen_void_ptr(n_ctx, 0);
4176
4177        ret_val = xmlSAX2GetLineNumber(ctx);
4178        desret_int(ret_val);
4179        call_tests++;
4180        des_void_ptr(n_ctx, ctx, 0);
4181        xmlResetLastError();
4182        if (mem_base != xmlMemBlocks()) {
4183            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4184	           xmlMemBlocks() - mem_base);
4185	    test_ret++;
4186            printf(" %d", n_ctx);
4187            printf("\n");
4188        }
4189    }
4190    function_tests++;
4191
4192    return(test_ret);
4193}
4194
4195
4196static int
4197test_xmlSAX2GetParameterEntity(void) {
4198    int test_ret = 0;
4199
4200    int mem_base;
4201    xmlEntityPtr ret_val;
4202    void * ctx; /* the user data (XML parser context) */
4203    int n_ctx;
4204    xmlChar * name; /* The entity name */
4205    int n_name;
4206
4207    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4208    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4209        mem_base = xmlMemBlocks();
4210        ctx = gen_void_ptr(n_ctx, 0);
4211        name = gen_const_xmlChar_ptr(n_name, 1);
4212
4213        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4214        desret_xmlEntityPtr(ret_val);
4215        call_tests++;
4216        des_void_ptr(n_ctx, ctx, 0);
4217        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4218        xmlResetLastError();
4219        if (mem_base != xmlMemBlocks()) {
4220            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4221	           xmlMemBlocks() - mem_base);
4222	    test_ret++;
4223            printf(" %d", n_ctx);
4224            printf(" %d", n_name);
4225            printf("\n");
4226        }
4227    }
4228    }
4229    function_tests++;
4230
4231    return(test_ret);
4232}
4233
4234
4235static int
4236test_xmlSAX2GetPublicId(void) {
4237    int test_ret = 0;
4238
4239    int mem_base;
4240    const xmlChar * ret_val;
4241    void * ctx; /* the user data (XML parser context) */
4242    int n_ctx;
4243
4244    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4245        mem_base = xmlMemBlocks();
4246        ctx = gen_void_ptr(n_ctx, 0);
4247
4248        ret_val = xmlSAX2GetPublicId(ctx);
4249        desret_const_xmlChar_ptr(ret_val);
4250        call_tests++;
4251        des_void_ptr(n_ctx, ctx, 0);
4252        xmlResetLastError();
4253        if (mem_base != xmlMemBlocks()) {
4254            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4255	           xmlMemBlocks() - mem_base);
4256	    test_ret++;
4257            printf(" %d", n_ctx);
4258            printf("\n");
4259        }
4260    }
4261    function_tests++;
4262
4263    return(test_ret);
4264}
4265
4266
4267static int
4268test_xmlSAX2GetSystemId(void) {
4269    int test_ret = 0;
4270
4271    int mem_base;
4272    const xmlChar * ret_val;
4273    void * ctx; /* the user data (XML parser context) */
4274    int n_ctx;
4275
4276    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4277        mem_base = xmlMemBlocks();
4278        ctx = gen_void_ptr(n_ctx, 0);
4279
4280        ret_val = xmlSAX2GetSystemId(ctx);
4281        desret_const_xmlChar_ptr(ret_val);
4282        call_tests++;
4283        des_void_ptr(n_ctx, ctx, 0);
4284        xmlResetLastError();
4285        if (mem_base != xmlMemBlocks()) {
4286            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4287	           xmlMemBlocks() - mem_base);
4288	    test_ret++;
4289            printf(" %d", n_ctx);
4290            printf("\n");
4291        }
4292    }
4293    function_tests++;
4294
4295    return(test_ret);
4296}
4297
4298
4299static int
4300test_xmlSAX2HasExternalSubset(void) {
4301    int test_ret = 0;
4302
4303    int mem_base;
4304    int ret_val;
4305    void * ctx; /* the user data (XML parser context) */
4306    int n_ctx;
4307
4308    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4309        mem_base = xmlMemBlocks();
4310        ctx = gen_void_ptr(n_ctx, 0);
4311
4312        ret_val = xmlSAX2HasExternalSubset(ctx);
4313        desret_int(ret_val);
4314        call_tests++;
4315        des_void_ptr(n_ctx, ctx, 0);
4316        xmlResetLastError();
4317        if (mem_base != xmlMemBlocks()) {
4318            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4319	           xmlMemBlocks() - mem_base);
4320	    test_ret++;
4321            printf(" %d", n_ctx);
4322            printf("\n");
4323        }
4324    }
4325    function_tests++;
4326
4327    return(test_ret);
4328}
4329
4330
4331static int
4332test_xmlSAX2HasInternalSubset(void) {
4333    int test_ret = 0;
4334
4335    int mem_base;
4336    int ret_val;
4337    void * ctx; /* the user data (XML parser context) */
4338    int n_ctx;
4339
4340    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4341        mem_base = xmlMemBlocks();
4342        ctx = gen_void_ptr(n_ctx, 0);
4343
4344        ret_val = xmlSAX2HasInternalSubset(ctx);
4345        desret_int(ret_val);
4346        call_tests++;
4347        des_void_ptr(n_ctx, ctx, 0);
4348        xmlResetLastError();
4349        if (mem_base != xmlMemBlocks()) {
4350            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4351	           xmlMemBlocks() - mem_base);
4352	    test_ret++;
4353            printf(" %d", n_ctx);
4354            printf("\n");
4355        }
4356    }
4357    function_tests++;
4358
4359    return(test_ret);
4360}
4361
4362
4363static int
4364test_xmlSAX2IgnorableWhitespace(void) {
4365    int test_ret = 0;
4366
4367    int mem_base;
4368    void * ctx; /* the user data (XML parser context) */
4369    int n_ctx;
4370    xmlChar * ch; /* a xmlChar string */
4371    int n_ch;
4372    int len; /* the number of xmlChar */
4373    int n_len;
4374
4375    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4376    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4377    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4378        mem_base = xmlMemBlocks();
4379        ctx = gen_void_ptr(n_ctx, 0);
4380        ch = gen_const_xmlChar_ptr(n_ch, 1);
4381        len = gen_int(n_len, 2);
4382
4383        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4384        call_tests++;
4385        des_void_ptr(n_ctx, ctx, 0);
4386        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4387        des_int(n_len, len, 2);
4388        xmlResetLastError();
4389        if (mem_base != xmlMemBlocks()) {
4390            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4391	           xmlMemBlocks() - mem_base);
4392	    test_ret++;
4393            printf(" %d", n_ctx);
4394            printf(" %d", n_ch);
4395            printf(" %d", n_len);
4396            printf("\n");
4397        }
4398    }
4399    }
4400    }
4401    function_tests++;
4402
4403    return(test_ret);
4404}
4405
4406
4407#define gen_nb_xmlSAXHandler_ptr 1
4408static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4409    return(NULL);
4410}
4411static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4412}
4413
4414static int
4415test_xmlSAX2InitDefaultSAXHandler(void) {
4416    int test_ret = 0;
4417
4418    int mem_base;
4419    xmlSAXHandler * hdlr; /* the SAX handler */
4420    int n_hdlr;
4421    int warning; /* flag if non-zero sets the handler warning procedure */
4422    int n_warning;
4423
4424    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4425    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4426        mem_base = xmlMemBlocks();
4427        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4428        warning = gen_int(n_warning, 1);
4429
4430        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4431        call_tests++;
4432        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4433        des_int(n_warning, warning, 1);
4434        xmlResetLastError();
4435        if (mem_base != xmlMemBlocks()) {
4436            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4437	           xmlMemBlocks() - mem_base);
4438	    test_ret++;
4439            printf(" %d", n_hdlr);
4440            printf(" %d", n_warning);
4441            printf("\n");
4442        }
4443    }
4444    }
4445    function_tests++;
4446
4447    return(test_ret);
4448}
4449
4450
4451static int
4452test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4453    int test_ret = 0;
4454
4455#ifdef LIBXML_DOCB_ENABLED
4456    int mem_base;
4457    xmlSAXHandler * hdlr; /* the SAX handler */
4458    int n_hdlr;
4459
4460    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4461        mem_base = xmlMemBlocks();
4462        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4463
4464        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4465        call_tests++;
4466        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4467        xmlResetLastError();
4468        if (mem_base != xmlMemBlocks()) {
4469            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4470	           xmlMemBlocks() - mem_base);
4471	    test_ret++;
4472            printf(" %d", n_hdlr);
4473            printf("\n");
4474        }
4475    }
4476    function_tests++;
4477#endif
4478
4479    return(test_ret);
4480}
4481
4482
4483static int
4484test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4485    int test_ret = 0;
4486
4487#ifdef LIBXML_HTML_ENABLED
4488    int mem_base;
4489    xmlSAXHandler * hdlr; /* the SAX handler */
4490    int n_hdlr;
4491
4492    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4493        mem_base = xmlMemBlocks();
4494        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4495
4496        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4497        call_tests++;
4498        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4499        xmlResetLastError();
4500        if (mem_base != xmlMemBlocks()) {
4501            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4502	           xmlMemBlocks() - mem_base);
4503	    test_ret++;
4504            printf(" %d", n_hdlr);
4505            printf("\n");
4506        }
4507    }
4508    function_tests++;
4509#endif
4510
4511    return(test_ret);
4512}
4513
4514
4515static int
4516test_xmlSAX2InternalSubset(void) {
4517    int test_ret = 0;
4518
4519    int mem_base;
4520    void * ctx; /* the user data (XML parser context) */
4521    int n_ctx;
4522    xmlChar * name; /* the root element name */
4523    int n_name;
4524    xmlChar * ExternalID; /* the external ID */
4525    int n_ExternalID;
4526    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4527    int n_SystemID;
4528
4529    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4530    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4531    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4532    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4533        mem_base = xmlMemBlocks();
4534        ctx = gen_void_ptr(n_ctx, 0);
4535        name = gen_const_xmlChar_ptr(n_name, 1);
4536        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4537        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4538
4539        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4540        call_tests++;
4541        des_void_ptr(n_ctx, ctx, 0);
4542        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4543        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4544        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4545        xmlResetLastError();
4546        if (mem_base != xmlMemBlocks()) {
4547            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4548	           xmlMemBlocks() - mem_base);
4549	    test_ret++;
4550            printf(" %d", n_ctx);
4551            printf(" %d", n_name);
4552            printf(" %d", n_ExternalID);
4553            printf(" %d", n_SystemID);
4554            printf("\n");
4555        }
4556    }
4557    }
4558    }
4559    }
4560    function_tests++;
4561
4562    return(test_ret);
4563}
4564
4565
4566static int
4567test_xmlSAX2IsStandalone(void) {
4568    int test_ret = 0;
4569
4570    int mem_base;
4571    int ret_val;
4572    void * ctx; /* the user data (XML parser context) */
4573    int n_ctx;
4574
4575    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4576        mem_base = xmlMemBlocks();
4577        ctx = gen_void_ptr(n_ctx, 0);
4578
4579        ret_val = xmlSAX2IsStandalone(ctx);
4580        desret_int(ret_val);
4581        call_tests++;
4582        des_void_ptr(n_ctx, ctx, 0);
4583        xmlResetLastError();
4584        if (mem_base != xmlMemBlocks()) {
4585            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4586	           xmlMemBlocks() - mem_base);
4587	    test_ret++;
4588            printf(" %d", n_ctx);
4589            printf("\n");
4590        }
4591    }
4592    function_tests++;
4593
4594    return(test_ret);
4595}
4596
4597
4598static int
4599test_xmlSAX2NotationDecl(void) {
4600    int test_ret = 0;
4601
4602    int mem_base;
4603    void * ctx; /* the user data (XML parser context) */
4604    int n_ctx;
4605    xmlChar * name; /* The name of the notation */
4606    int n_name;
4607    xmlChar * publicId; /* The public ID of the entity */
4608    int n_publicId;
4609    xmlChar * systemId; /* The system ID of the entity */
4610    int n_systemId;
4611
4612    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4613    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4614    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4615    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4616        mem_base = xmlMemBlocks();
4617        ctx = gen_void_ptr(n_ctx, 0);
4618        name = gen_const_xmlChar_ptr(n_name, 1);
4619        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4620        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4621
4622        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4623        call_tests++;
4624        des_void_ptr(n_ctx, ctx, 0);
4625        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4626        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4627        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4628        xmlResetLastError();
4629        if (mem_base != xmlMemBlocks()) {
4630            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4631	           xmlMemBlocks() - mem_base);
4632	    test_ret++;
4633            printf(" %d", n_ctx);
4634            printf(" %d", n_name);
4635            printf(" %d", n_publicId);
4636            printf(" %d", n_systemId);
4637            printf("\n");
4638        }
4639    }
4640    }
4641    }
4642    }
4643    function_tests++;
4644
4645    return(test_ret);
4646}
4647
4648
4649static int
4650test_xmlSAX2ProcessingInstruction(void) {
4651    int test_ret = 0;
4652
4653    int mem_base;
4654    void * ctx; /* the user data (XML parser context) */
4655    int n_ctx;
4656    xmlChar * target; /* the target name */
4657    int n_target;
4658    xmlChar * data; /* the PI data's */
4659    int n_data;
4660
4661    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4662    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4663    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4664        mem_base = xmlMemBlocks();
4665        ctx = gen_void_ptr(n_ctx, 0);
4666        target = gen_const_xmlChar_ptr(n_target, 1);
4667        data = gen_const_xmlChar_ptr(n_data, 2);
4668
4669        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4670        call_tests++;
4671        des_void_ptr(n_ctx, ctx, 0);
4672        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4673        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4674        xmlResetLastError();
4675        if (mem_base != xmlMemBlocks()) {
4676            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4677	           xmlMemBlocks() - mem_base);
4678	    test_ret++;
4679            printf(" %d", n_ctx);
4680            printf(" %d", n_target);
4681            printf(" %d", n_data);
4682            printf("\n");
4683        }
4684    }
4685    }
4686    }
4687    function_tests++;
4688
4689    return(test_ret);
4690}
4691
4692
4693static int
4694test_xmlSAX2Reference(void) {
4695    int test_ret = 0;
4696
4697    int mem_base;
4698    void * ctx; /* the user data (XML parser context) */
4699    int n_ctx;
4700    xmlChar * name; /* The entity name */
4701    int n_name;
4702
4703    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4704    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4705        mem_base = xmlMemBlocks();
4706        ctx = gen_void_ptr(n_ctx, 0);
4707        name = gen_const_xmlChar_ptr(n_name, 1);
4708
4709        xmlSAX2Reference(ctx, (const xmlChar *)name);
4710        call_tests++;
4711        des_void_ptr(n_ctx, ctx, 0);
4712        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4713        xmlResetLastError();
4714        if (mem_base != xmlMemBlocks()) {
4715            printf("Leak of %d blocks found in xmlSAX2Reference",
4716	           xmlMemBlocks() - mem_base);
4717	    test_ret++;
4718            printf(" %d", n_ctx);
4719            printf(" %d", n_name);
4720            printf("\n");
4721        }
4722    }
4723    }
4724    function_tests++;
4725
4726    return(test_ret);
4727}
4728
4729
4730static int
4731test_xmlSAX2ResolveEntity(void) {
4732    int test_ret = 0;
4733
4734    int mem_base;
4735    xmlParserInputPtr ret_val;
4736    void * ctx; /* the user data (XML parser context) */
4737    int n_ctx;
4738    xmlChar * publicId; /* The public ID of the entity */
4739    int n_publicId;
4740    xmlChar * systemId; /* The system ID of the entity */
4741    int n_systemId;
4742
4743    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4744    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4745    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4746        mem_base = xmlMemBlocks();
4747        ctx = gen_void_ptr(n_ctx, 0);
4748        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4749        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4750
4751        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4752        desret_xmlParserInputPtr(ret_val);
4753        call_tests++;
4754        des_void_ptr(n_ctx, ctx, 0);
4755        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4756        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4757        xmlResetLastError();
4758        if (mem_base != xmlMemBlocks()) {
4759            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4760	           xmlMemBlocks() - mem_base);
4761	    test_ret++;
4762            printf(" %d", n_ctx);
4763            printf(" %d", n_publicId);
4764            printf(" %d", n_systemId);
4765            printf("\n");
4766        }
4767    }
4768    }
4769    }
4770    function_tests++;
4771
4772    return(test_ret);
4773}
4774
4775
4776#define gen_nb_xmlSAXLocatorPtr 1
4777static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4778    return(NULL);
4779}
4780static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4781}
4782
4783static int
4784test_xmlSAX2SetDocumentLocator(void) {
4785    int test_ret = 0;
4786
4787    int mem_base;
4788    void * ctx; /* the user data (XML parser context) */
4789    int n_ctx;
4790    xmlSAXLocatorPtr loc; /* A SAX Locator */
4791    int n_loc;
4792
4793    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4794    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4795        mem_base = xmlMemBlocks();
4796        ctx = gen_void_ptr(n_ctx, 0);
4797        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4798
4799        xmlSAX2SetDocumentLocator(ctx, loc);
4800        call_tests++;
4801        des_void_ptr(n_ctx, ctx, 0);
4802        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4803        xmlResetLastError();
4804        if (mem_base != xmlMemBlocks()) {
4805            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4806	           xmlMemBlocks() - mem_base);
4807	    test_ret++;
4808            printf(" %d", n_ctx);
4809            printf(" %d", n_loc);
4810            printf("\n");
4811        }
4812    }
4813    }
4814    function_tests++;
4815
4816    return(test_ret);
4817}
4818
4819
4820static int
4821test_xmlSAX2StartDocument(void) {
4822    int test_ret = 0;
4823
4824    int mem_base;
4825    void * ctx; /* the user data (XML parser context) */
4826    int n_ctx;
4827
4828    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4829        mem_base = xmlMemBlocks();
4830        ctx = gen_void_ptr(n_ctx, 0);
4831
4832        xmlSAX2StartDocument(ctx);
4833        call_tests++;
4834        des_void_ptr(n_ctx, ctx, 0);
4835        xmlResetLastError();
4836        if (mem_base != xmlMemBlocks()) {
4837            printf("Leak of %d blocks found in xmlSAX2StartDocument",
4838	           xmlMemBlocks() - mem_base);
4839	    test_ret++;
4840            printf(" %d", n_ctx);
4841            printf("\n");
4842        }
4843    }
4844    function_tests++;
4845
4846    return(test_ret);
4847}
4848
4849
4850static int
4851test_xmlSAX2StartElement(void) {
4852    int test_ret = 0;
4853
4854#ifdef LIBXML_SAX1_ENABLED
4855    int mem_base;
4856    void * ctx; /* the user data (XML parser context) */
4857    int n_ctx;
4858    xmlChar * fullname; /* The element name, including namespace prefix */
4859    int n_fullname;
4860    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
4861    int n_atts;
4862
4863    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4864    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
4865    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
4866        mem_base = xmlMemBlocks();
4867        ctx = gen_void_ptr(n_ctx, 0);
4868        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
4869        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
4870
4871        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
4872        call_tests++;
4873        des_void_ptr(n_ctx, ctx, 0);
4874        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
4875        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
4876        xmlResetLastError();
4877        if (mem_base != xmlMemBlocks()) {
4878            printf("Leak of %d blocks found in xmlSAX2StartElement",
4879	           xmlMemBlocks() - mem_base);
4880	    test_ret++;
4881            printf(" %d", n_ctx);
4882            printf(" %d", n_fullname);
4883            printf(" %d", n_atts);
4884            printf("\n");
4885        }
4886    }
4887    }
4888    }
4889    function_tests++;
4890#endif
4891
4892    return(test_ret);
4893}
4894
4895
4896static int
4897test_xmlSAX2StartElementNs(void) {
4898    int test_ret = 0;
4899
4900    int mem_base;
4901    void * ctx; /* the user data (XML parser context) */
4902    int n_ctx;
4903    xmlChar * localname; /* the local name of the element */
4904    int n_localname;
4905    xmlChar * prefix; /* the element namespace prefix if available */
4906    int n_prefix;
4907    xmlChar * URI; /* the element namespace name if available */
4908    int n_URI;
4909    int nb_namespaces; /* number of namespace definitions on that node */
4910    int n_nb_namespaces;
4911    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
4912    int n_namespaces;
4913    int nb_attributes; /* the number of attributes on that node */
4914    int n_nb_attributes;
4915    int nb_defaulted; /* the number of defaulted attributes. */
4916    int n_nb_defaulted;
4917    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
4918    int n_attributes;
4919
4920    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4921    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4922    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4923    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4924    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
4925    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
4926    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
4927    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
4928    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
4929        mem_base = xmlMemBlocks();
4930        ctx = gen_void_ptr(n_ctx, 0);
4931        localname = gen_const_xmlChar_ptr(n_localname, 1);
4932        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4933        URI = gen_const_xmlChar_ptr(n_URI, 3);
4934        nb_namespaces = gen_int(n_nb_namespaces, 4);
4935        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
4936        nb_attributes = gen_int(n_nb_attributes, 6);
4937        nb_defaulted = gen_int(n_nb_defaulted, 7);
4938        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
4939
4940        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
4941        call_tests++;
4942        des_void_ptr(n_ctx, ctx, 0);
4943        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4944        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4945        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4946        des_int(n_nb_namespaces, nb_namespaces, 4);
4947        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
4948        des_int(n_nb_attributes, nb_attributes, 6);
4949        des_int(n_nb_defaulted, nb_defaulted, 7);
4950        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
4951        xmlResetLastError();
4952        if (mem_base != xmlMemBlocks()) {
4953            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
4954	           xmlMemBlocks() - mem_base);
4955	    test_ret++;
4956            printf(" %d", n_ctx);
4957            printf(" %d", n_localname);
4958            printf(" %d", n_prefix);
4959            printf(" %d", n_URI);
4960            printf(" %d", n_nb_namespaces);
4961            printf(" %d", n_namespaces);
4962            printf(" %d", n_nb_attributes);
4963            printf(" %d", n_nb_defaulted);
4964            printf(" %d", n_attributes);
4965            printf("\n");
4966        }
4967    }
4968    }
4969    }
4970    }
4971    }
4972    }
4973    }
4974    }
4975    }
4976    function_tests++;
4977
4978    return(test_ret);
4979}
4980
4981
4982static int
4983test_xmlSAX2UnparsedEntityDecl(void) {
4984    int test_ret = 0;
4985
4986    int mem_base;
4987    void * ctx; /* the user data (XML parser context) */
4988    int n_ctx;
4989    xmlChar * name; /* The name of the entity */
4990    int n_name;
4991    xmlChar * publicId; /* The public ID of the entity */
4992    int n_publicId;
4993    xmlChar * systemId; /* The system ID of the entity */
4994    int n_systemId;
4995    xmlChar * notationName; /* the name of the notation */
4996    int n_notationName;
4997
4998    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4999    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5000    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5001    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5002    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5003        mem_base = xmlMemBlocks();
5004        ctx = gen_void_ptr(n_ctx, 0);
5005        name = gen_const_xmlChar_ptr(n_name, 1);
5006        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5007        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5008        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5009
5010        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5011        call_tests++;
5012        des_void_ptr(n_ctx, ctx, 0);
5013        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5014        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5015        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5016        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5017        xmlResetLastError();
5018        if (mem_base != xmlMemBlocks()) {
5019            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5020	           xmlMemBlocks() - mem_base);
5021	    test_ret++;
5022            printf(" %d", n_ctx);
5023            printf(" %d", n_name);
5024            printf(" %d", n_publicId);
5025            printf(" %d", n_systemId);
5026            printf(" %d", n_notationName);
5027            printf("\n");
5028        }
5029    }
5030    }
5031    }
5032    }
5033    }
5034    function_tests++;
5035
5036    return(test_ret);
5037}
5038
5039
5040static int
5041test_xmlSAXDefaultVersion(void) {
5042    int test_ret = 0;
5043
5044#ifdef LIBXML_SAX1_ENABLED
5045    int mem_base;
5046    int ret_val;
5047    int version; /* the version, 1 or 2 */
5048    int n_version;
5049
5050    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5051        mem_base = xmlMemBlocks();
5052        version = gen_int(n_version, 0);
5053
5054        ret_val = xmlSAXDefaultVersion(version);
5055        desret_int(ret_val);
5056        call_tests++;
5057        des_int(n_version, version, 0);
5058        xmlResetLastError();
5059        if (mem_base != xmlMemBlocks()) {
5060            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5061	           xmlMemBlocks() - mem_base);
5062	    test_ret++;
5063            printf(" %d", n_version);
5064            printf("\n");
5065        }
5066    }
5067    function_tests++;
5068#endif
5069
5070    return(test_ret);
5071}
5072
5073
5074static int
5075test_xmlSAXVersion(void) {
5076    int test_ret = 0;
5077
5078    int mem_base;
5079    int ret_val;
5080    xmlSAXHandler * hdlr; /* the SAX handler */
5081    int n_hdlr;
5082    int version; /* the version, 1 or 2 */
5083    int n_version;
5084
5085    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5086    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5087        mem_base = xmlMemBlocks();
5088        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5089        version = gen_int(n_version, 1);
5090
5091        ret_val = xmlSAXVersion(hdlr, version);
5092        desret_int(ret_val);
5093        call_tests++;
5094        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5095        des_int(n_version, version, 1);
5096        xmlResetLastError();
5097        if (mem_base != xmlMemBlocks()) {
5098            printf("Leak of %d blocks found in xmlSAXVersion",
5099	           xmlMemBlocks() - mem_base);
5100	    test_ret++;
5101            printf(" %d", n_hdlr);
5102            printf(" %d", n_version);
5103            printf("\n");
5104        }
5105    }
5106    }
5107    function_tests++;
5108
5109    return(test_ret);
5110}
5111
5112static int
5113test_SAX2(void) {
5114    int test_ret = 0;
5115
5116    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5117    test_ret += test_docbDefaultSAXHandlerInit();
5118    test_ret += test_htmlDefaultSAXHandlerInit();
5119    test_ret += test_xmlDefaultSAXHandlerInit();
5120    test_ret += test_xmlSAX2AttributeDecl();
5121    test_ret += test_xmlSAX2CDataBlock();
5122    test_ret += test_xmlSAX2Characters();
5123    test_ret += test_xmlSAX2Comment();
5124    test_ret += test_xmlSAX2ElementDecl();
5125    test_ret += test_xmlSAX2EndDocument();
5126    test_ret += test_xmlSAX2EndElement();
5127    test_ret += test_xmlSAX2EndElementNs();
5128    test_ret += test_xmlSAX2EntityDecl();
5129    test_ret += test_xmlSAX2ExternalSubset();
5130    test_ret += test_xmlSAX2GetColumnNumber();
5131    test_ret += test_xmlSAX2GetEntity();
5132    test_ret += test_xmlSAX2GetLineNumber();
5133    test_ret += test_xmlSAX2GetParameterEntity();
5134    test_ret += test_xmlSAX2GetPublicId();
5135    test_ret += test_xmlSAX2GetSystemId();
5136    test_ret += test_xmlSAX2HasExternalSubset();
5137    test_ret += test_xmlSAX2HasInternalSubset();
5138    test_ret += test_xmlSAX2IgnorableWhitespace();
5139    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5140    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5141    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5142    test_ret += test_xmlSAX2InternalSubset();
5143    test_ret += test_xmlSAX2IsStandalone();
5144    test_ret += test_xmlSAX2NotationDecl();
5145    test_ret += test_xmlSAX2ProcessingInstruction();
5146    test_ret += test_xmlSAX2Reference();
5147    test_ret += test_xmlSAX2ResolveEntity();
5148    test_ret += test_xmlSAX2SetDocumentLocator();
5149    test_ret += test_xmlSAX2StartDocument();
5150    test_ret += test_xmlSAX2StartElement();
5151    test_ret += test_xmlSAX2StartElementNs();
5152    test_ret += test_xmlSAX2UnparsedEntityDecl();
5153    test_ret += test_xmlSAXDefaultVersion();
5154    test_ret += test_xmlSAXVersion();
5155
5156    if (test_ret != 0)
5157	printf("Module SAX2: %d errors\n", test_ret);
5158    return(test_ret);
5159}
5160
5161static int
5162test_xmlC14NDocDumpMemory(void) {
5163    int test_ret = 0;
5164
5165#ifdef LIBXML_C14N_ENABLED
5166#ifdef LIBXML_OUTPUT_ENABLED
5167    int mem_base;
5168    int ret_val;
5169    xmlDocPtr doc; /* the XML document for canonization */
5170    int n_doc;
5171    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5172    int n_nodes;
5173    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5174    int n_exclusive;
5175    xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5176    int n_inclusive_ns_prefixes;
5177    int with_comments; /* include comments in the result (!=0) or not (==0) */
5178    int n_with_comments;
5179    xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */
5180    int n_doc_txt_ptr;
5181
5182    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5183    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5184    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5185    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5186    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5187    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5188        mem_base = xmlMemBlocks();
5189        doc = gen_xmlDocPtr(n_doc, 0);
5190        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5191        exclusive = gen_int(n_exclusive, 2);
5192        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5193        with_comments = gen_int(n_with_comments, 4);
5194        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5195
5196        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5197        desret_int(ret_val);
5198        call_tests++;
5199        des_xmlDocPtr(n_doc, doc, 0);
5200        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5201        des_int(n_exclusive, exclusive, 2);
5202        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5203        des_int(n_with_comments, with_comments, 4);
5204        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5205        xmlResetLastError();
5206        if (mem_base != xmlMemBlocks()) {
5207            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5208	           xmlMemBlocks() - mem_base);
5209	    test_ret++;
5210            printf(" %d", n_doc);
5211            printf(" %d", n_nodes);
5212            printf(" %d", n_exclusive);
5213            printf(" %d", n_inclusive_ns_prefixes);
5214            printf(" %d", n_with_comments);
5215            printf(" %d", n_doc_txt_ptr);
5216            printf("\n");
5217        }
5218    }
5219    }
5220    }
5221    }
5222    }
5223    }
5224    function_tests++;
5225#endif
5226#endif
5227
5228    return(test_ret);
5229}
5230
5231
5232static int
5233test_xmlC14NDocSave(void) {
5234    int test_ret = 0;
5235
5236#ifdef LIBXML_C14N_ENABLED
5237#ifdef LIBXML_OUTPUT_ENABLED
5238    int mem_base;
5239    int ret_val;
5240    xmlDocPtr doc; /* the XML document for canonization */
5241    int n_doc;
5242    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5243    int n_nodes;
5244    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5245    int n_exclusive;
5246    xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5247    int n_inclusive_ns_prefixes;
5248    int with_comments; /* include comments in the result (!=0) or not (==0) */
5249    int n_with_comments;
5250    const char * filename; /* the filename to store canonical XML image */
5251    int n_filename;
5252    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5253    int n_compression;
5254
5255    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5256    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5257    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5258    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5259    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5260    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5261    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5262        mem_base = xmlMemBlocks();
5263        doc = gen_xmlDocPtr(n_doc, 0);
5264        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5265        exclusive = gen_int(n_exclusive, 2);
5266        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5267        with_comments = gen_int(n_with_comments, 4);
5268        filename = gen_fileoutput(n_filename, 5);
5269        compression = gen_int(n_compression, 6);
5270
5271        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5272        desret_int(ret_val);
5273        call_tests++;
5274        des_xmlDocPtr(n_doc, doc, 0);
5275        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5276        des_int(n_exclusive, exclusive, 2);
5277        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5278        des_int(n_with_comments, with_comments, 4);
5279        des_fileoutput(n_filename, filename, 5);
5280        des_int(n_compression, compression, 6);
5281        xmlResetLastError();
5282        if (mem_base != xmlMemBlocks()) {
5283            printf("Leak of %d blocks found in xmlC14NDocSave",
5284	           xmlMemBlocks() - mem_base);
5285	    test_ret++;
5286            printf(" %d", n_doc);
5287            printf(" %d", n_nodes);
5288            printf(" %d", n_exclusive);
5289            printf(" %d", n_inclusive_ns_prefixes);
5290            printf(" %d", n_with_comments);
5291            printf(" %d", n_filename);
5292            printf(" %d", n_compression);
5293            printf("\n");
5294        }
5295    }
5296    }
5297    }
5298    }
5299    }
5300    }
5301    }
5302    function_tests++;
5303#endif
5304#endif
5305
5306    return(test_ret);
5307}
5308
5309
5310static int
5311test_xmlC14NDocSaveTo(void) {
5312    int test_ret = 0;
5313
5314#ifdef LIBXML_C14N_ENABLED
5315#ifdef LIBXML_OUTPUT_ENABLED
5316    int mem_base;
5317    int ret_val;
5318    xmlDocPtr doc; /* the XML document for canonization */
5319    int n_doc;
5320    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5321    int n_nodes;
5322    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5323    int n_exclusive;
5324    xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5325    int n_inclusive_ns_prefixes;
5326    int with_comments; /* include comments in the result (!=0) or not (==0) */
5327    int n_with_comments;
5328    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5329    int n_buf;
5330
5331    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5332    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5333    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5334    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5335    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5336    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5337        mem_base = xmlMemBlocks();
5338        doc = gen_xmlDocPtr(n_doc, 0);
5339        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5340        exclusive = gen_int(n_exclusive, 2);
5341        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5342        with_comments = gen_int(n_with_comments, 4);
5343        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5344
5345        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5346        desret_int(ret_val);
5347        call_tests++;
5348        des_xmlDocPtr(n_doc, doc, 0);
5349        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5350        des_int(n_exclusive, exclusive, 2);
5351        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5352        des_int(n_with_comments, with_comments, 4);
5353        des_xmlOutputBufferPtr(n_buf, buf, 5);
5354        xmlResetLastError();
5355        if (mem_base != xmlMemBlocks()) {
5356            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5357	           xmlMemBlocks() - mem_base);
5358	    test_ret++;
5359            printf(" %d", n_doc);
5360            printf(" %d", n_nodes);
5361            printf(" %d", n_exclusive);
5362            printf(" %d", n_inclusive_ns_prefixes);
5363            printf(" %d", n_with_comments);
5364            printf(" %d", n_buf);
5365            printf("\n");
5366        }
5367    }
5368    }
5369    }
5370    }
5371    }
5372    }
5373    function_tests++;
5374#endif
5375#endif
5376
5377    return(test_ret);
5378}
5379
5380
5381static int
5382test_xmlC14NExecute(void) {
5383    int test_ret = 0;
5384
5385
5386    /* missing type support */
5387    return(test_ret);
5388}
5389
5390static int
5391test_c14n(void) {
5392    int test_ret = 0;
5393
5394    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5395    test_ret += test_xmlC14NDocDumpMemory();
5396    test_ret += test_xmlC14NDocSave();
5397    test_ret += test_xmlC14NDocSaveTo();
5398    test_ret += test_xmlC14NExecute();
5399
5400    if (test_ret != 0)
5401	printf("Module c14n: %d errors\n", test_ret);
5402    return(test_ret);
5403}
5404#ifdef LIBXML_CATALOG_ENABLED
5405
5406#define gen_nb_xmlCatalogPtr 1
5407static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5408    return(NULL);
5409}
5410static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5411}
5412#endif
5413
5414
5415static int
5416test_xmlACatalogAdd(void) {
5417    int test_ret = 0;
5418
5419#ifdef LIBXML_CATALOG_ENABLED
5420    int mem_base;
5421    int ret_val;
5422    xmlCatalogPtr catal; /* a Catalog */
5423    int n_catal;
5424    xmlChar * type; /* the type of record to add to the catalog */
5425    int n_type;
5426    xmlChar * orig; /* the system, public or prefix to match */
5427    int n_orig;
5428    xmlChar * replace; /* the replacement value for the match */
5429    int n_replace;
5430
5431    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5432    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5433    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5434    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5435        mem_base = xmlMemBlocks();
5436        catal = gen_xmlCatalogPtr(n_catal, 0);
5437        type = gen_const_xmlChar_ptr(n_type, 1);
5438        orig = gen_const_xmlChar_ptr(n_orig, 2);
5439        replace = gen_const_xmlChar_ptr(n_replace, 3);
5440
5441        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5442        desret_int(ret_val);
5443        call_tests++;
5444        des_xmlCatalogPtr(n_catal, catal, 0);
5445        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5446        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5447        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5448        xmlResetLastError();
5449        if (mem_base != xmlMemBlocks()) {
5450            printf("Leak of %d blocks found in xmlACatalogAdd",
5451	           xmlMemBlocks() - mem_base);
5452	    test_ret++;
5453            printf(" %d", n_catal);
5454            printf(" %d", n_type);
5455            printf(" %d", n_orig);
5456            printf(" %d", n_replace);
5457            printf("\n");
5458        }
5459    }
5460    }
5461    }
5462    }
5463    function_tests++;
5464#endif
5465
5466    return(test_ret);
5467}
5468
5469
5470static int
5471test_xmlACatalogDump(void) {
5472    int test_ret = 0;
5473
5474#ifdef LIBXML_CATALOG_ENABLED
5475#ifdef LIBXML_OUTPUT_ENABLED
5476    int mem_base;
5477    xmlCatalogPtr catal; /* a Catalog */
5478    int n_catal;
5479    FILE * out; /* the file. */
5480    int n_out;
5481
5482    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5483    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5484        mem_base = xmlMemBlocks();
5485        catal = gen_xmlCatalogPtr(n_catal, 0);
5486        out = gen_FILE_ptr(n_out, 1);
5487
5488        xmlACatalogDump(catal, out);
5489        call_tests++;
5490        des_xmlCatalogPtr(n_catal, catal, 0);
5491        des_FILE_ptr(n_out, out, 1);
5492        xmlResetLastError();
5493        if (mem_base != xmlMemBlocks()) {
5494            printf("Leak of %d blocks found in xmlACatalogDump",
5495	           xmlMemBlocks() - mem_base);
5496	    test_ret++;
5497            printf(" %d", n_catal);
5498            printf(" %d", n_out);
5499            printf("\n");
5500        }
5501    }
5502    }
5503    function_tests++;
5504#endif
5505#endif
5506
5507    return(test_ret);
5508}
5509
5510
5511static int
5512test_xmlACatalogRemove(void) {
5513    int test_ret = 0;
5514
5515#ifdef LIBXML_CATALOG_ENABLED
5516    int mem_base;
5517    int ret_val;
5518    xmlCatalogPtr catal; /* a Catalog */
5519    int n_catal;
5520    xmlChar * value; /* the value to remove */
5521    int n_value;
5522
5523    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5524    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5525        mem_base = xmlMemBlocks();
5526        catal = gen_xmlCatalogPtr(n_catal, 0);
5527        value = gen_const_xmlChar_ptr(n_value, 1);
5528
5529        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5530        desret_int(ret_val);
5531        call_tests++;
5532        des_xmlCatalogPtr(n_catal, catal, 0);
5533        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5534        xmlResetLastError();
5535        if (mem_base != xmlMemBlocks()) {
5536            printf("Leak of %d blocks found in xmlACatalogRemove",
5537	           xmlMemBlocks() - mem_base);
5538	    test_ret++;
5539            printf(" %d", n_catal);
5540            printf(" %d", n_value);
5541            printf("\n");
5542        }
5543    }
5544    }
5545    function_tests++;
5546#endif
5547
5548    return(test_ret);
5549}
5550
5551
5552static int
5553test_xmlACatalogResolve(void) {
5554    int test_ret = 0;
5555
5556#ifdef LIBXML_CATALOG_ENABLED
5557    int mem_base;
5558    xmlChar * ret_val;
5559    xmlCatalogPtr catal; /* a Catalog */
5560    int n_catal;
5561    xmlChar * pubID; /* the public ID string */
5562    int n_pubID;
5563    xmlChar * sysID; /* the system ID string */
5564    int n_sysID;
5565
5566    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5567    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5568    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5569        mem_base = xmlMemBlocks();
5570        catal = gen_xmlCatalogPtr(n_catal, 0);
5571        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5572        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5573
5574        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5575        desret_xmlChar_ptr(ret_val);
5576        call_tests++;
5577        des_xmlCatalogPtr(n_catal, catal, 0);
5578        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5579        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5580        xmlResetLastError();
5581        if (mem_base != xmlMemBlocks()) {
5582            printf("Leak of %d blocks found in xmlACatalogResolve",
5583	           xmlMemBlocks() - mem_base);
5584	    test_ret++;
5585            printf(" %d", n_catal);
5586            printf(" %d", n_pubID);
5587            printf(" %d", n_sysID);
5588            printf("\n");
5589        }
5590    }
5591    }
5592    }
5593    function_tests++;
5594#endif
5595
5596    return(test_ret);
5597}
5598
5599
5600static int
5601test_xmlACatalogResolvePublic(void) {
5602    int test_ret = 0;
5603
5604#ifdef LIBXML_CATALOG_ENABLED
5605    int mem_base;
5606    xmlChar * ret_val;
5607    xmlCatalogPtr catal; /* a Catalog */
5608    int n_catal;
5609    xmlChar * pubID; /* the public ID string */
5610    int n_pubID;
5611
5612    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5613    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5614        mem_base = xmlMemBlocks();
5615        catal = gen_xmlCatalogPtr(n_catal, 0);
5616        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5617
5618        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5619        desret_xmlChar_ptr(ret_val);
5620        call_tests++;
5621        des_xmlCatalogPtr(n_catal, catal, 0);
5622        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5623        xmlResetLastError();
5624        if (mem_base != xmlMemBlocks()) {
5625            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5626	           xmlMemBlocks() - mem_base);
5627	    test_ret++;
5628            printf(" %d", n_catal);
5629            printf(" %d", n_pubID);
5630            printf("\n");
5631        }
5632    }
5633    }
5634    function_tests++;
5635#endif
5636
5637    return(test_ret);
5638}
5639
5640
5641static int
5642test_xmlACatalogResolveSystem(void) {
5643    int test_ret = 0;
5644
5645#ifdef LIBXML_CATALOG_ENABLED
5646    int mem_base;
5647    xmlChar * ret_val;
5648    xmlCatalogPtr catal; /* a Catalog */
5649    int n_catal;
5650    xmlChar * sysID; /* the system ID string */
5651    int n_sysID;
5652
5653    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5654    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5655        mem_base = xmlMemBlocks();
5656        catal = gen_xmlCatalogPtr(n_catal, 0);
5657        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5658
5659        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5660        desret_xmlChar_ptr(ret_val);
5661        call_tests++;
5662        des_xmlCatalogPtr(n_catal, catal, 0);
5663        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5664        xmlResetLastError();
5665        if (mem_base != xmlMemBlocks()) {
5666            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5667	           xmlMemBlocks() - mem_base);
5668	    test_ret++;
5669            printf(" %d", n_catal);
5670            printf(" %d", n_sysID);
5671            printf("\n");
5672        }
5673    }
5674    }
5675    function_tests++;
5676#endif
5677
5678    return(test_ret);
5679}
5680
5681
5682static int
5683test_xmlACatalogResolveURI(void) {
5684    int test_ret = 0;
5685
5686#ifdef LIBXML_CATALOG_ENABLED
5687    int mem_base;
5688    xmlChar * ret_val;
5689    xmlCatalogPtr catal; /* a Catalog */
5690    int n_catal;
5691    xmlChar * URI; /* the URI */
5692    int n_URI;
5693
5694    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5695    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5696        mem_base = xmlMemBlocks();
5697        catal = gen_xmlCatalogPtr(n_catal, 0);
5698        URI = gen_const_xmlChar_ptr(n_URI, 1);
5699
5700        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5701        desret_xmlChar_ptr(ret_val);
5702        call_tests++;
5703        des_xmlCatalogPtr(n_catal, catal, 0);
5704        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5705        xmlResetLastError();
5706        if (mem_base != xmlMemBlocks()) {
5707            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5708	           xmlMemBlocks() - mem_base);
5709	    test_ret++;
5710            printf(" %d", n_catal);
5711            printf(" %d", n_URI);
5712            printf("\n");
5713        }
5714    }
5715    }
5716    function_tests++;
5717#endif
5718
5719    return(test_ret);
5720}
5721
5722
5723static int
5724test_xmlCatalogAdd(void) {
5725    int test_ret = 0;
5726
5727#ifdef LIBXML_CATALOG_ENABLED
5728    int mem_base;
5729    int ret_val;
5730    xmlChar * type; /* the type of record to add to the catalog */
5731    int n_type;
5732    xmlChar * orig; /* the system, public or prefix to match */
5733    int n_orig;
5734    xmlChar * replace; /* the replacement value for the match */
5735    int n_replace;
5736
5737    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5738    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5739    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5740        mem_base = xmlMemBlocks();
5741        type = gen_const_xmlChar_ptr(n_type, 0);
5742        orig = gen_const_xmlChar_ptr(n_orig, 1);
5743        replace = gen_const_xmlChar_ptr(n_replace, 2);
5744
5745        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5746        desret_int(ret_val);
5747        call_tests++;
5748        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5749        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5750        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5751        xmlResetLastError();
5752        if (mem_base != xmlMemBlocks()) {
5753            printf("Leak of %d blocks found in xmlCatalogAdd",
5754	           xmlMemBlocks() - mem_base);
5755	    test_ret++;
5756            printf(" %d", n_type);
5757            printf(" %d", n_orig);
5758            printf(" %d", n_replace);
5759            printf("\n");
5760        }
5761    }
5762    }
5763    }
5764    function_tests++;
5765#endif
5766
5767    return(test_ret);
5768}
5769
5770
5771static int
5772test_xmlCatalogCleanup(void) {
5773    int test_ret = 0;
5774
5775#ifdef LIBXML_CATALOG_ENABLED
5776
5777
5778        xmlCatalogCleanup();
5779        call_tests++;
5780        xmlResetLastError();
5781    function_tests++;
5782#endif
5783
5784    return(test_ret);
5785}
5786
5787
5788static int
5789test_xmlCatalogConvert(void) {
5790    int test_ret = 0;
5791
5792#ifdef LIBXML_CATALOG_ENABLED
5793    int ret_val;
5794
5795
5796        ret_val = xmlCatalogConvert();
5797        desret_int(ret_val);
5798        call_tests++;
5799        xmlResetLastError();
5800    function_tests++;
5801#endif
5802
5803    return(test_ret);
5804}
5805
5806
5807static int
5808test_xmlCatalogDump(void) {
5809    int test_ret = 0;
5810
5811#ifdef LIBXML_CATALOG_ENABLED
5812#ifdef LIBXML_OUTPUT_ENABLED
5813    int mem_base;
5814    FILE * out; /* the file. */
5815    int n_out;
5816
5817    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5818        mem_base = xmlMemBlocks();
5819        out = gen_FILE_ptr(n_out, 0);
5820
5821        xmlCatalogDump(out);
5822        call_tests++;
5823        des_FILE_ptr(n_out, out, 0);
5824        xmlResetLastError();
5825        if (mem_base != xmlMemBlocks()) {
5826            printf("Leak of %d blocks found in xmlCatalogDump",
5827	           xmlMemBlocks() - mem_base);
5828	    test_ret++;
5829            printf(" %d", n_out);
5830            printf("\n");
5831        }
5832    }
5833    function_tests++;
5834#endif
5835#endif
5836
5837    return(test_ret);
5838}
5839
5840
5841static int
5842test_xmlCatalogGetDefaults(void) {
5843    int test_ret = 0;
5844
5845#ifdef LIBXML_CATALOG_ENABLED
5846    int mem_base;
5847    xmlCatalogAllow ret_val;
5848
5849        mem_base = xmlMemBlocks();
5850
5851        ret_val = xmlCatalogGetDefaults();
5852        desret_xmlCatalogAllow(ret_val);
5853        call_tests++;
5854        xmlResetLastError();
5855        if (mem_base != xmlMemBlocks()) {
5856            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
5857	           xmlMemBlocks() - mem_base);
5858	    test_ret++;
5859            printf("\n");
5860        }
5861    function_tests++;
5862#endif
5863
5864    return(test_ret);
5865}
5866
5867
5868static int
5869test_xmlCatalogIsEmpty(void) {
5870    int test_ret = 0;
5871
5872#ifdef LIBXML_CATALOG_ENABLED
5873    int mem_base;
5874    int ret_val;
5875    xmlCatalogPtr catal; /* should this create an SGML catalog */
5876    int n_catal;
5877
5878    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5879        mem_base = xmlMemBlocks();
5880        catal = gen_xmlCatalogPtr(n_catal, 0);
5881
5882        ret_val = xmlCatalogIsEmpty(catal);
5883        desret_int(ret_val);
5884        call_tests++;
5885        des_xmlCatalogPtr(n_catal, catal, 0);
5886        xmlResetLastError();
5887        if (mem_base != xmlMemBlocks()) {
5888            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
5889	           xmlMemBlocks() - mem_base);
5890	    test_ret++;
5891            printf(" %d", n_catal);
5892            printf("\n");
5893        }
5894    }
5895    function_tests++;
5896#endif
5897
5898    return(test_ret);
5899}
5900
5901
5902static int
5903test_xmlCatalogLocalResolve(void) {
5904    int test_ret = 0;
5905
5906#ifdef LIBXML_CATALOG_ENABLED
5907    int mem_base;
5908    xmlChar * ret_val;
5909    void * catalogs; /* a document's list of catalogs */
5910    int n_catalogs;
5911    xmlChar * pubID; /* the public ID string */
5912    int n_pubID;
5913    xmlChar * sysID; /* the system ID string */
5914    int n_sysID;
5915
5916    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5917    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5918    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5919        mem_base = xmlMemBlocks();
5920        catalogs = gen_void_ptr(n_catalogs, 0);
5921        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5922        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5923
5924        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
5925        desret_xmlChar_ptr(ret_val);
5926        call_tests++;
5927        des_void_ptr(n_catalogs, catalogs, 0);
5928        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5929        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5930        xmlResetLastError();
5931        if (mem_base != xmlMemBlocks()) {
5932            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
5933	           xmlMemBlocks() - mem_base);
5934	    test_ret++;
5935            printf(" %d", n_catalogs);
5936            printf(" %d", n_pubID);
5937            printf(" %d", n_sysID);
5938            printf("\n");
5939        }
5940    }
5941    }
5942    }
5943    function_tests++;
5944#endif
5945
5946    return(test_ret);
5947}
5948
5949
5950static int
5951test_xmlCatalogLocalResolveURI(void) {
5952    int test_ret = 0;
5953
5954#ifdef LIBXML_CATALOG_ENABLED
5955    int mem_base;
5956    xmlChar * ret_val;
5957    void * catalogs; /* a document's list of catalogs */
5958    int n_catalogs;
5959    xmlChar * URI; /* the URI */
5960    int n_URI;
5961
5962    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
5963    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5964        mem_base = xmlMemBlocks();
5965        catalogs = gen_void_ptr(n_catalogs, 0);
5966        URI = gen_const_xmlChar_ptr(n_URI, 1);
5967
5968        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
5969        desret_xmlChar_ptr(ret_val);
5970        call_tests++;
5971        des_void_ptr(n_catalogs, catalogs, 0);
5972        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5973        xmlResetLastError();
5974        if (mem_base != xmlMemBlocks()) {
5975            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
5976	           xmlMemBlocks() - mem_base);
5977	    test_ret++;
5978            printf(" %d", n_catalogs);
5979            printf(" %d", n_URI);
5980            printf("\n");
5981        }
5982    }
5983    }
5984    function_tests++;
5985#endif
5986
5987    return(test_ret);
5988}
5989
5990
5991static int
5992test_xmlCatalogRemove(void) {
5993    int test_ret = 0;
5994
5995#ifdef LIBXML_CATALOG_ENABLED
5996    int ret_val;
5997    xmlChar * value; /* the value to remove */
5998    int n_value;
5999
6000    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6001        value = gen_const_xmlChar_ptr(n_value, 0);
6002
6003        ret_val = xmlCatalogRemove((const xmlChar *)value);
6004        desret_int(ret_val);
6005        call_tests++;
6006        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6007        xmlResetLastError();
6008    }
6009    function_tests++;
6010#endif
6011
6012    return(test_ret);
6013}
6014
6015
6016static int
6017test_xmlCatalogResolve(void) {
6018    int test_ret = 0;
6019
6020#ifdef LIBXML_CATALOG_ENABLED
6021    int mem_base;
6022    xmlChar * ret_val;
6023    xmlChar * pubID; /* the public ID string */
6024    int n_pubID;
6025    xmlChar * sysID; /* the system ID string */
6026    int n_sysID;
6027
6028    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6029    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6030        mem_base = xmlMemBlocks();
6031        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6032        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6033
6034        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6035        desret_xmlChar_ptr(ret_val);
6036        call_tests++;
6037        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6038        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6039        xmlResetLastError();
6040        if (mem_base != xmlMemBlocks()) {
6041            printf("Leak of %d blocks found in xmlCatalogResolve",
6042	           xmlMemBlocks() - mem_base);
6043	    test_ret++;
6044            printf(" %d", n_pubID);
6045            printf(" %d", n_sysID);
6046            printf("\n");
6047        }
6048    }
6049    }
6050    function_tests++;
6051#endif
6052
6053    return(test_ret);
6054}
6055
6056
6057static int
6058test_xmlCatalogResolvePublic(void) {
6059    int test_ret = 0;
6060
6061#ifdef LIBXML_CATALOG_ENABLED
6062    int mem_base;
6063    xmlChar * ret_val;
6064    xmlChar * pubID; /* the public ID string */
6065    int n_pubID;
6066
6067    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6068        mem_base = xmlMemBlocks();
6069        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6070
6071        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6072        desret_xmlChar_ptr(ret_val);
6073        call_tests++;
6074        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6075        xmlResetLastError();
6076        if (mem_base != xmlMemBlocks()) {
6077            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6078	           xmlMemBlocks() - mem_base);
6079	    test_ret++;
6080            printf(" %d", n_pubID);
6081            printf("\n");
6082        }
6083    }
6084    function_tests++;
6085#endif
6086
6087    return(test_ret);
6088}
6089
6090
6091static int
6092test_xmlCatalogResolveSystem(void) {
6093    int test_ret = 0;
6094
6095#ifdef LIBXML_CATALOG_ENABLED
6096    int mem_base;
6097    xmlChar * ret_val;
6098    xmlChar * sysID; /* the system ID string */
6099    int n_sysID;
6100
6101    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6102        mem_base = xmlMemBlocks();
6103        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6104
6105        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6106        desret_xmlChar_ptr(ret_val);
6107        call_tests++;
6108        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6109        xmlResetLastError();
6110        if (mem_base != xmlMemBlocks()) {
6111            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6112	           xmlMemBlocks() - mem_base);
6113	    test_ret++;
6114            printf(" %d", n_sysID);
6115            printf("\n");
6116        }
6117    }
6118    function_tests++;
6119#endif
6120
6121    return(test_ret);
6122}
6123
6124
6125static int
6126test_xmlCatalogResolveURI(void) {
6127    int test_ret = 0;
6128
6129#ifdef LIBXML_CATALOG_ENABLED
6130    int mem_base;
6131    xmlChar * ret_val;
6132    xmlChar * URI; /* the URI */
6133    int n_URI;
6134
6135    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6136        mem_base = xmlMemBlocks();
6137        URI = gen_const_xmlChar_ptr(n_URI, 0);
6138
6139        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6140        desret_xmlChar_ptr(ret_val);
6141        call_tests++;
6142        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6143        xmlResetLastError();
6144        if (mem_base != xmlMemBlocks()) {
6145            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6146	           xmlMemBlocks() - mem_base);
6147	    test_ret++;
6148            printf(" %d", n_URI);
6149            printf("\n");
6150        }
6151    }
6152    function_tests++;
6153#endif
6154
6155    return(test_ret);
6156}
6157
6158
6159static int
6160test_xmlCatalogSetDefaultPrefer(void) {
6161    int test_ret = 0;
6162
6163#ifdef LIBXML_CATALOG_ENABLED
6164    int mem_base;
6165    xmlCatalogPrefer ret_val;
6166    xmlCatalogPrefer prefer; /* the default preference for delegation */
6167    int n_prefer;
6168
6169    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6170        mem_base = xmlMemBlocks();
6171        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6172
6173        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6174        desret_xmlCatalogPrefer(ret_val);
6175        call_tests++;
6176        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6177        xmlResetLastError();
6178        if (mem_base != xmlMemBlocks()) {
6179            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6180	           xmlMemBlocks() - mem_base);
6181	    test_ret++;
6182            printf(" %d", n_prefer);
6183            printf("\n");
6184        }
6185    }
6186    function_tests++;
6187#endif
6188
6189    return(test_ret);
6190}
6191
6192
6193static int
6194test_xmlCatalogSetDefaults(void) {
6195    int test_ret = 0;
6196
6197#ifdef LIBXML_CATALOG_ENABLED
6198    int mem_base;
6199    xmlCatalogAllow allow; /* what catalogs should be accepted */
6200    int n_allow;
6201
6202    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6203        mem_base = xmlMemBlocks();
6204        allow = gen_xmlCatalogAllow(n_allow, 0);
6205
6206        xmlCatalogSetDefaults(allow);
6207        call_tests++;
6208        des_xmlCatalogAllow(n_allow, allow, 0);
6209        xmlResetLastError();
6210        if (mem_base != xmlMemBlocks()) {
6211            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6212	           xmlMemBlocks() - mem_base);
6213	    test_ret++;
6214            printf(" %d", n_allow);
6215            printf("\n");
6216        }
6217    }
6218    function_tests++;
6219#endif
6220
6221    return(test_ret);
6222}
6223
6224
6225static int
6226test_xmlConvertSGMLCatalog(void) {
6227    int test_ret = 0;
6228
6229#ifdef LIBXML_CATALOG_ENABLED
6230    int mem_base;
6231    int ret_val;
6232    xmlCatalogPtr catal; /* the catalog */
6233    int n_catal;
6234
6235    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6236        mem_base = xmlMemBlocks();
6237        catal = gen_xmlCatalogPtr(n_catal, 0);
6238
6239        ret_val = xmlConvertSGMLCatalog(catal);
6240        desret_int(ret_val);
6241        call_tests++;
6242        des_xmlCatalogPtr(n_catal, catal, 0);
6243        xmlResetLastError();
6244        if (mem_base != xmlMemBlocks()) {
6245            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6246	           xmlMemBlocks() - mem_base);
6247	    test_ret++;
6248            printf(" %d", n_catal);
6249            printf("\n");
6250        }
6251    }
6252    function_tests++;
6253#endif
6254
6255    return(test_ret);
6256}
6257
6258
6259static int
6260test_xmlInitializeCatalog(void) {
6261    int test_ret = 0;
6262
6263#ifdef LIBXML_CATALOG_ENABLED
6264    int mem_base;
6265
6266        mem_base = xmlMemBlocks();
6267
6268        xmlInitializeCatalog();
6269        call_tests++;
6270        xmlResetLastError();
6271        if (mem_base != xmlMemBlocks()) {
6272            printf("Leak of %d blocks found in xmlInitializeCatalog",
6273	           xmlMemBlocks() - mem_base);
6274	    test_ret++;
6275            printf("\n");
6276        }
6277    function_tests++;
6278#endif
6279
6280    return(test_ret);
6281}
6282
6283
6284static int
6285test_xmlLoadACatalog(void) {
6286    int test_ret = 0;
6287
6288
6289    /* missing type support */
6290    return(test_ret);
6291}
6292
6293
6294static int
6295test_xmlLoadCatalog(void) {
6296    int test_ret = 0;
6297
6298#ifdef LIBXML_CATALOG_ENABLED
6299    int ret_val;
6300    const char * filename; /* a file path */
6301    int n_filename;
6302
6303    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6304        filename = gen_filepath(n_filename, 0);
6305
6306        ret_val = xmlLoadCatalog(filename);
6307        desret_int(ret_val);
6308        call_tests++;
6309        des_filepath(n_filename, filename, 0);
6310        xmlResetLastError();
6311    }
6312    function_tests++;
6313#endif
6314
6315    return(test_ret);
6316}
6317
6318
6319static int
6320test_xmlLoadCatalogs(void) {
6321    int test_ret = 0;
6322
6323#ifdef LIBXML_CATALOG_ENABLED
6324    char * pathss; /* a list of directories separated by a colon or a space. */
6325    int n_pathss;
6326
6327    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6328        pathss = gen_const_char_ptr(n_pathss, 0);
6329
6330        xmlLoadCatalogs((const char *)pathss);
6331        call_tests++;
6332        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6333        xmlResetLastError();
6334    }
6335    function_tests++;
6336#endif
6337
6338    return(test_ret);
6339}
6340
6341
6342static int
6343test_xmlLoadSGMLSuperCatalog(void) {
6344    int test_ret = 0;
6345
6346
6347    /* missing type support */
6348    return(test_ret);
6349}
6350
6351
6352static int
6353test_xmlNewCatalog(void) {
6354    int test_ret = 0;
6355
6356
6357    /* missing type support */
6358    return(test_ret);
6359}
6360
6361
6362static int
6363test_xmlParseCatalogFile(void) {
6364    int test_ret = 0;
6365
6366#ifdef LIBXML_CATALOG_ENABLED
6367    int mem_base;
6368    xmlDocPtr ret_val;
6369    const char * filename; /* the filename */
6370    int n_filename;
6371
6372    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6373        mem_base = xmlMemBlocks();
6374        filename = gen_filepath(n_filename, 0);
6375
6376        ret_val = xmlParseCatalogFile(filename);
6377        desret_xmlDocPtr(ret_val);
6378        call_tests++;
6379        des_filepath(n_filename, filename, 0);
6380        xmlResetLastError();
6381        if (mem_base != xmlMemBlocks()) {
6382            printf("Leak of %d blocks found in xmlParseCatalogFile",
6383	           xmlMemBlocks() - mem_base);
6384	    test_ret++;
6385            printf(" %d", n_filename);
6386            printf("\n");
6387        }
6388    }
6389    function_tests++;
6390#endif
6391
6392    return(test_ret);
6393}
6394
6395static int
6396test_catalog(void) {
6397    int test_ret = 0;
6398
6399    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6400    test_ret += test_xmlACatalogAdd();
6401    test_ret += test_xmlACatalogDump();
6402    test_ret += test_xmlACatalogRemove();
6403    test_ret += test_xmlACatalogResolve();
6404    test_ret += test_xmlACatalogResolvePublic();
6405    test_ret += test_xmlACatalogResolveSystem();
6406    test_ret += test_xmlACatalogResolveURI();
6407    test_ret += test_xmlCatalogAdd();
6408    test_ret += test_xmlCatalogCleanup();
6409    test_ret += test_xmlCatalogConvert();
6410    test_ret += test_xmlCatalogDump();
6411    test_ret += test_xmlCatalogGetDefaults();
6412    test_ret += test_xmlCatalogIsEmpty();
6413    test_ret += test_xmlCatalogLocalResolve();
6414    test_ret += test_xmlCatalogLocalResolveURI();
6415    test_ret += test_xmlCatalogRemove();
6416    test_ret += test_xmlCatalogResolve();
6417    test_ret += test_xmlCatalogResolvePublic();
6418    test_ret += test_xmlCatalogResolveSystem();
6419    test_ret += test_xmlCatalogResolveURI();
6420    test_ret += test_xmlCatalogSetDefaultPrefer();
6421    test_ret += test_xmlCatalogSetDefaults();
6422    test_ret += test_xmlConvertSGMLCatalog();
6423    test_ret += test_xmlInitializeCatalog();
6424    test_ret += test_xmlLoadACatalog();
6425    test_ret += test_xmlLoadCatalog();
6426    test_ret += test_xmlLoadCatalogs();
6427    test_ret += test_xmlLoadSGMLSuperCatalog();
6428    test_ret += test_xmlNewCatalog();
6429    test_ret += test_xmlParseCatalogFile();
6430
6431    if (test_ret != 0)
6432	printf("Module catalog: %d errors\n", test_ret);
6433    return(test_ret);
6434}
6435
6436#define gen_nb_const_xmlChRangeGroupPtr 1
6437static xmlChRangeGroupPtr gen_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6438    return(NULL);
6439}
6440static void des_const_xmlChRangeGroupPtr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroupPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6441}
6442
6443static int
6444test_xmlCharInRange(void) {
6445    int test_ret = 0;
6446
6447    int mem_base;
6448    int ret_val;
6449    unsigned int val; /* character to be validated */
6450    int n_val;
6451    xmlChRangeGroupPtr rptr; /* pointer to range to be used to validate */
6452    int n_rptr;
6453
6454    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6455    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroupPtr;n_rptr++) {
6456        mem_base = xmlMemBlocks();
6457        val = gen_unsigned_int(n_val, 0);
6458        rptr = gen_const_xmlChRangeGroupPtr(n_rptr, 1);
6459
6460        ret_val = xmlCharInRange(val, (const xmlChRangeGroupPtr)rptr);
6461        desret_int(ret_val);
6462        call_tests++;
6463        des_unsigned_int(n_val, val, 0);
6464        des_const_xmlChRangeGroupPtr(n_rptr, (const xmlChRangeGroupPtr)rptr, 1);
6465        xmlResetLastError();
6466        if (mem_base != xmlMemBlocks()) {
6467            printf("Leak of %d blocks found in xmlCharInRange",
6468	           xmlMemBlocks() - mem_base);
6469	    test_ret++;
6470            printf(" %d", n_val);
6471            printf(" %d", n_rptr);
6472            printf("\n");
6473        }
6474    }
6475    }
6476    function_tests++;
6477
6478    return(test_ret);
6479}
6480
6481
6482static int
6483test_xmlIsBaseChar(void) {
6484    int test_ret = 0;
6485
6486    int mem_base;
6487    int ret_val;
6488    unsigned int ch; /* character to validate */
6489    int n_ch;
6490
6491    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6492        mem_base = xmlMemBlocks();
6493        ch = gen_unsigned_int(n_ch, 0);
6494
6495        ret_val = xmlIsBaseChar(ch);
6496        desret_int(ret_val);
6497        call_tests++;
6498        des_unsigned_int(n_ch, ch, 0);
6499        xmlResetLastError();
6500        if (mem_base != xmlMemBlocks()) {
6501            printf("Leak of %d blocks found in xmlIsBaseChar",
6502	           xmlMemBlocks() - mem_base);
6503	    test_ret++;
6504            printf(" %d", n_ch);
6505            printf("\n");
6506        }
6507    }
6508    function_tests++;
6509
6510    return(test_ret);
6511}
6512
6513
6514static int
6515test_xmlIsBlank(void) {
6516    int test_ret = 0;
6517
6518    int mem_base;
6519    int ret_val;
6520    unsigned int ch; /* character to validate */
6521    int n_ch;
6522
6523    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6524        mem_base = xmlMemBlocks();
6525        ch = gen_unsigned_int(n_ch, 0);
6526
6527        ret_val = xmlIsBlank(ch);
6528        desret_int(ret_val);
6529        call_tests++;
6530        des_unsigned_int(n_ch, ch, 0);
6531        xmlResetLastError();
6532        if (mem_base != xmlMemBlocks()) {
6533            printf("Leak of %d blocks found in xmlIsBlank",
6534	           xmlMemBlocks() - mem_base);
6535	    test_ret++;
6536            printf(" %d", n_ch);
6537            printf("\n");
6538        }
6539    }
6540    function_tests++;
6541
6542    return(test_ret);
6543}
6544
6545
6546static int
6547test_xmlIsChar(void) {
6548    int test_ret = 0;
6549
6550    int mem_base;
6551    int ret_val;
6552    unsigned int ch; /* character to validate */
6553    int n_ch;
6554
6555    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6556        mem_base = xmlMemBlocks();
6557        ch = gen_unsigned_int(n_ch, 0);
6558
6559        ret_val = xmlIsChar(ch);
6560        desret_int(ret_val);
6561        call_tests++;
6562        des_unsigned_int(n_ch, ch, 0);
6563        xmlResetLastError();
6564        if (mem_base != xmlMemBlocks()) {
6565            printf("Leak of %d blocks found in xmlIsChar",
6566	           xmlMemBlocks() - mem_base);
6567	    test_ret++;
6568            printf(" %d", n_ch);
6569            printf("\n");
6570        }
6571    }
6572    function_tests++;
6573
6574    return(test_ret);
6575}
6576
6577
6578static int
6579test_xmlIsCombining(void) {
6580    int test_ret = 0;
6581
6582    int mem_base;
6583    int ret_val;
6584    unsigned int ch; /* character to validate */
6585    int n_ch;
6586
6587    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6588        mem_base = xmlMemBlocks();
6589        ch = gen_unsigned_int(n_ch, 0);
6590
6591        ret_val = xmlIsCombining(ch);
6592        desret_int(ret_val);
6593        call_tests++;
6594        des_unsigned_int(n_ch, ch, 0);
6595        xmlResetLastError();
6596        if (mem_base != xmlMemBlocks()) {
6597            printf("Leak of %d blocks found in xmlIsCombining",
6598	           xmlMemBlocks() - mem_base);
6599	    test_ret++;
6600            printf(" %d", n_ch);
6601            printf("\n");
6602        }
6603    }
6604    function_tests++;
6605
6606    return(test_ret);
6607}
6608
6609
6610static int
6611test_xmlIsDigit(void) {
6612    int test_ret = 0;
6613
6614    int mem_base;
6615    int ret_val;
6616    unsigned int ch; /* character to validate */
6617    int n_ch;
6618
6619    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6620        mem_base = xmlMemBlocks();
6621        ch = gen_unsigned_int(n_ch, 0);
6622
6623        ret_val = xmlIsDigit(ch);
6624        desret_int(ret_val);
6625        call_tests++;
6626        des_unsigned_int(n_ch, ch, 0);
6627        xmlResetLastError();
6628        if (mem_base != xmlMemBlocks()) {
6629            printf("Leak of %d blocks found in xmlIsDigit",
6630	           xmlMemBlocks() - mem_base);
6631	    test_ret++;
6632            printf(" %d", n_ch);
6633            printf("\n");
6634        }
6635    }
6636    function_tests++;
6637
6638    return(test_ret);
6639}
6640
6641
6642static int
6643test_xmlIsExtender(void) {
6644    int test_ret = 0;
6645
6646    int mem_base;
6647    int ret_val;
6648    unsigned int ch; /* character to validate */
6649    int n_ch;
6650
6651    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6652        mem_base = xmlMemBlocks();
6653        ch = gen_unsigned_int(n_ch, 0);
6654
6655        ret_val = xmlIsExtender(ch);
6656        desret_int(ret_val);
6657        call_tests++;
6658        des_unsigned_int(n_ch, ch, 0);
6659        xmlResetLastError();
6660        if (mem_base != xmlMemBlocks()) {
6661            printf("Leak of %d blocks found in xmlIsExtender",
6662	           xmlMemBlocks() - mem_base);
6663	    test_ret++;
6664            printf(" %d", n_ch);
6665            printf("\n");
6666        }
6667    }
6668    function_tests++;
6669
6670    return(test_ret);
6671}
6672
6673
6674static int
6675test_xmlIsIdeographic(void) {
6676    int test_ret = 0;
6677
6678    int mem_base;
6679    int ret_val;
6680    unsigned int ch; /* character to validate */
6681    int n_ch;
6682
6683    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6684        mem_base = xmlMemBlocks();
6685        ch = gen_unsigned_int(n_ch, 0);
6686
6687        ret_val = xmlIsIdeographic(ch);
6688        desret_int(ret_val);
6689        call_tests++;
6690        des_unsigned_int(n_ch, ch, 0);
6691        xmlResetLastError();
6692        if (mem_base != xmlMemBlocks()) {
6693            printf("Leak of %d blocks found in xmlIsIdeographic",
6694	           xmlMemBlocks() - mem_base);
6695	    test_ret++;
6696            printf(" %d", n_ch);
6697            printf("\n");
6698        }
6699    }
6700    function_tests++;
6701
6702    return(test_ret);
6703}
6704
6705
6706static int
6707test_xmlIsPubidChar(void) {
6708    int test_ret = 0;
6709
6710    int mem_base;
6711    int ret_val;
6712    unsigned int ch; /* character to validate */
6713    int n_ch;
6714
6715    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6716        mem_base = xmlMemBlocks();
6717        ch = gen_unsigned_int(n_ch, 0);
6718
6719        ret_val = xmlIsPubidChar(ch);
6720        desret_int(ret_val);
6721        call_tests++;
6722        des_unsigned_int(n_ch, ch, 0);
6723        xmlResetLastError();
6724        if (mem_base != xmlMemBlocks()) {
6725            printf("Leak of %d blocks found in xmlIsPubidChar",
6726	           xmlMemBlocks() - mem_base);
6727	    test_ret++;
6728            printf(" %d", n_ch);
6729            printf("\n");
6730        }
6731    }
6732    function_tests++;
6733
6734    return(test_ret);
6735}
6736
6737static int
6738test_chvalid(void) {
6739    int test_ret = 0;
6740
6741    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6742    test_ret += test_xmlCharInRange();
6743    test_ret += test_xmlIsBaseChar();
6744    test_ret += test_xmlIsBlank();
6745    test_ret += test_xmlIsChar();
6746    test_ret += test_xmlIsCombining();
6747    test_ret += test_xmlIsDigit();
6748    test_ret += test_xmlIsExtender();
6749    test_ret += test_xmlIsIdeographic();
6750    test_ret += test_xmlIsPubidChar();
6751
6752    if (test_ret != 0)
6753	printf("Module chvalid: %d errors\n", test_ret);
6754    return(test_ret);
6755}
6756
6757static int
6758test_xmlBoolToText(void) {
6759    int test_ret = 0;
6760
6761#ifdef LIBXML_DEBUG_ENABLED
6762    int mem_base;
6763    const char * ret_val;
6764    int boolval; /* a bool to turn into text */
6765    int n_boolval;
6766
6767    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6768        mem_base = xmlMemBlocks();
6769        boolval = gen_int(n_boolval, 0);
6770
6771        ret_val = xmlBoolToText(boolval);
6772        desret_const_char_ptr(ret_val);
6773        call_tests++;
6774        des_int(n_boolval, boolval, 0);
6775        xmlResetLastError();
6776        if (mem_base != xmlMemBlocks()) {
6777            printf("Leak of %d blocks found in xmlBoolToText",
6778	           xmlMemBlocks() - mem_base);
6779	    test_ret++;
6780            printf(" %d", n_boolval);
6781            printf("\n");
6782        }
6783    }
6784    function_tests++;
6785#endif
6786
6787    return(test_ret);
6788}
6789
6790
6791static int
6792test_xmlDebugCheckDocument(void) {
6793    int test_ret = 0;
6794
6795#ifdef LIBXML_DEBUG_ENABLED
6796    int mem_base;
6797    int ret_val;
6798    FILE * output; /* the FILE * for the output */
6799    int n_output;
6800    xmlDocPtr doc; /* the document */
6801    int n_doc;
6802
6803    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6804    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6805        mem_base = xmlMemBlocks();
6806        output = gen_debug_FILE_ptr(n_output, 0);
6807        doc = gen_xmlDocPtr(n_doc, 1);
6808
6809        ret_val = xmlDebugCheckDocument(output, doc);
6810        desret_int(ret_val);
6811        call_tests++;
6812        des_debug_FILE_ptr(n_output, output, 0);
6813        des_xmlDocPtr(n_doc, doc, 1);
6814        xmlResetLastError();
6815        if (mem_base != xmlMemBlocks()) {
6816            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6817	           xmlMemBlocks() - mem_base);
6818	    test_ret++;
6819            printf(" %d", n_output);
6820            printf(" %d", n_doc);
6821            printf("\n");
6822        }
6823    }
6824    }
6825    function_tests++;
6826#endif
6827
6828    return(test_ret);
6829}
6830
6831
6832static int
6833test_xmlDebugDumpAttr(void) {
6834    int test_ret = 0;
6835
6836#ifdef LIBXML_DEBUG_ENABLED
6837    int mem_base;
6838    FILE * output; /* the FILE * for the output */
6839    int n_output;
6840    xmlAttrPtr attr; /* the attribute */
6841    int n_attr;
6842    int depth; /* the indentation level. */
6843    int n_depth;
6844
6845    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6846    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6847    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6848        mem_base = xmlMemBlocks();
6849        output = gen_debug_FILE_ptr(n_output, 0);
6850        attr = gen_xmlAttrPtr(n_attr, 1);
6851        depth = gen_int(n_depth, 2);
6852
6853        xmlDebugDumpAttr(output, attr, depth);
6854        call_tests++;
6855        des_debug_FILE_ptr(n_output, output, 0);
6856        des_xmlAttrPtr(n_attr, attr, 1);
6857        des_int(n_depth, depth, 2);
6858        xmlResetLastError();
6859        if (mem_base != xmlMemBlocks()) {
6860            printf("Leak of %d blocks found in xmlDebugDumpAttr",
6861	           xmlMemBlocks() - mem_base);
6862	    test_ret++;
6863            printf(" %d", n_output);
6864            printf(" %d", n_attr);
6865            printf(" %d", n_depth);
6866            printf("\n");
6867        }
6868    }
6869    }
6870    }
6871    function_tests++;
6872#endif
6873
6874    return(test_ret);
6875}
6876
6877
6878static int
6879test_xmlDebugDumpAttrList(void) {
6880    int test_ret = 0;
6881
6882#ifdef LIBXML_DEBUG_ENABLED
6883    int mem_base;
6884    FILE * output; /* the FILE * for the output */
6885    int n_output;
6886    xmlAttrPtr attr; /* the attribute list */
6887    int n_attr;
6888    int depth; /* the indentation level. */
6889    int n_depth;
6890
6891    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6892    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6893    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6894        mem_base = xmlMemBlocks();
6895        output = gen_debug_FILE_ptr(n_output, 0);
6896        attr = gen_xmlAttrPtr(n_attr, 1);
6897        depth = gen_int(n_depth, 2);
6898
6899        xmlDebugDumpAttrList(output, attr, depth);
6900        call_tests++;
6901        des_debug_FILE_ptr(n_output, output, 0);
6902        des_xmlAttrPtr(n_attr, attr, 1);
6903        des_int(n_depth, depth, 2);
6904        xmlResetLastError();
6905        if (mem_base != xmlMemBlocks()) {
6906            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
6907	           xmlMemBlocks() - mem_base);
6908	    test_ret++;
6909            printf(" %d", n_output);
6910            printf(" %d", n_attr);
6911            printf(" %d", n_depth);
6912            printf("\n");
6913        }
6914    }
6915    }
6916    }
6917    function_tests++;
6918#endif
6919
6920    return(test_ret);
6921}
6922
6923
6924static int
6925test_xmlDebugDumpDTD(void) {
6926    int test_ret = 0;
6927
6928#ifdef LIBXML_DEBUG_ENABLED
6929    int mem_base;
6930    FILE * output; /* the FILE * for the output */
6931    int n_output;
6932    xmlDtdPtr dtd; /* the DTD */
6933    int n_dtd;
6934
6935    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6936    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
6937        mem_base = xmlMemBlocks();
6938        output = gen_debug_FILE_ptr(n_output, 0);
6939        dtd = gen_xmlDtdPtr(n_dtd, 1);
6940
6941        xmlDebugDumpDTD(output, dtd);
6942        call_tests++;
6943        des_debug_FILE_ptr(n_output, output, 0);
6944        des_xmlDtdPtr(n_dtd, dtd, 1);
6945        xmlResetLastError();
6946        if (mem_base != xmlMemBlocks()) {
6947            printf("Leak of %d blocks found in xmlDebugDumpDTD",
6948	           xmlMemBlocks() - mem_base);
6949	    test_ret++;
6950            printf(" %d", n_output);
6951            printf(" %d", n_dtd);
6952            printf("\n");
6953        }
6954    }
6955    }
6956    function_tests++;
6957#endif
6958
6959    return(test_ret);
6960}
6961
6962
6963static int
6964test_xmlDebugDumpDocument(void) {
6965    int test_ret = 0;
6966
6967#ifdef LIBXML_DEBUG_ENABLED
6968    int mem_base;
6969    FILE * output; /* the FILE * for the output */
6970    int n_output;
6971    xmlDocPtr doc; /* the document */
6972    int n_doc;
6973
6974    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6975    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6976        mem_base = xmlMemBlocks();
6977        output = gen_debug_FILE_ptr(n_output, 0);
6978        doc = gen_xmlDocPtr(n_doc, 1);
6979
6980        xmlDebugDumpDocument(output, doc);
6981        call_tests++;
6982        des_debug_FILE_ptr(n_output, output, 0);
6983        des_xmlDocPtr(n_doc, doc, 1);
6984        xmlResetLastError();
6985        if (mem_base != xmlMemBlocks()) {
6986            printf("Leak of %d blocks found in xmlDebugDumpDocument",
6987	           xmlMemBlocks() - mem_base);
6988	    test_ret++;
6989            printf(" %d", n_output);
6990            printf(" %d", n_doc);
6991            printf("\n");
6992        }
6993    }
6994    }
6995    function_tests++;
6996#endif
6997
6998    return(test_ret);
6999}
7000
7001
7002static int
7003test_xmlDebugDumpDocumentHead(void) {
7004    int test_ret = 0;
7005
7006#ifdef LIBXML_DEBUG_ENABLED
7007    int mem_base;
7008    FILE * output; /* the FILE * for the output */
7009    int n_output;
7010    xmlDocPtr doc; /* the document */
7011    int n_doc;
7012
7013    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7014    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7015        mem_base = xmlMemBlocks();
7016        output = gen_debug_FILE_ptr(n_output, 0);
7017        doc = gen_xmlDocPtr(n_doc, 1);
7018
7019        xmlDebugDumpDocumentHead(output, doc);
7020        call_tests++;
7021        des_debug_FILE_ptr(n_output, output, 0);
7022        des_xmlDocPtr(n_doc, doc, 1);
7023        xmlResetLastError();
7024        if (mem_base != xmlMemBlocks()) {
7025            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7026	           xmlMemBlocks() - mem_base);
7027	    test_ret++;
7028            printf(" %d", n_output);
7029            printf(" %d", n_doc);
7030            printf("\n");
7031        }
7032    }
7033    }
7034    function_tests++;
7035#endif
7036
7037    return(test_ret);
7038}
7039
7040
7041static int
7042test_xmlDebugDumpEntities(void) {
7043    int test_ret = 0;
7044
7045#ifdef LIBXML_DEBUG_ENABLED
7046    int mem_base;
7047    FILE * output; /* the FILE * for the output */
7048    int n_output;
7049    xmlDocPtr doc; /* the document */
7050    int n_doc;
7051
7052    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7053    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7054        mem_base = xmlMemBlocks();
7055        output = gen_debug_FILE_ptr(n_output, 0);
7056        doc = gen_xmlDocPtr(n_doc, 1);
7057
7058        xmlDebugDumpEntities(output, doc);
7059        call_tests++;
7060        des_debug_FILE_ptr(n_output, output, 0);
7061        des_xmlDocPtr(n_doc, doc, 1);
7062        xmlResetLastError();
7063        if (mem_base != xmlMemBlocks()) {
7064            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7065	           xmlMemBlocks() - mem_base);
7066	    test_ret++;
7067            printf(" %d", n_output);
7068            printf(" %d", n_doc);
7069            printf("\n");
7070        }
7071    }
7072    }
7073    function_tests++;
7074#endif
7075
7076    return(test_ret);
7077}
7078
7079
7080static int
7081test_xmlDebugDumpNode(void) {
7082    int test_ret = 0;
7083
7084#ifdef LIBXML_DEBUG_ENABLED
7085    int mem_base;
7086    FILE * output; /* the FILE * for the output */
7087    int n_output;
7088    xmlNodePtr node; /* the node */
7089    int n_node;
7090    int depth; /* the indentation level. */
7091    int n_depth;
7092
7093    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7094    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7095    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7096        mem_base = xmlMemBlocks();
7097        output = gen_debug_FILE_ptr(n_output, 0);
7098        node = gen_xmlNodePtr(n_node, 1);
7099        depth = gen_int(n_depth, 2);
7100
7101        xmlDebugDumpNode(output, node, depth);
7102        call_tests++;
7103        des_debug_FILE_ptr(n_output, output, 0);
7104        des_xmlNodePtr(n_node, node, 1);
7105        des_int(n_depth, depth, 2);
7106        xmlResetLastError();
7107        if (mem_base != xmlMemBlocks()) {
7108            printf("Leak of %d blocks found in xmlDebugDumpNode",
7109	           xmlMemBlocks() - mem_base);
7110	    test_ret++;
7111            printf(" %d", n_output);
7112            printf(" %d", n_node);
7113            printf(" %d", n_depth);
7114            printf("\n");
7115        }
7116    }
7117    }
7118    }
7119    function_tests++;
7120#endif
7121
7122    return(test_ret);
7123}
7124
7125
7126static int
7127test_xmlDebugDumpNodeList(void) {
7128    int test_ret = 0;
7129
7130#ifdef LIBXML_DEBUG_ENABLED
7131    int mem_base;
7132    FILE * output; /* the FILE * for the output */
7133    int n_output;
7134    xmlNodePtr node; /* the node list */
7135    int n_node;
7136    int depth; /* the indentation level. */
7137    int n_depth;
7138
7139    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7140    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7141    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7142        mem_base = xmlMemBlocks();
7143        output = gen_debug_FILE_ptr(n_output, 0);
7144        node = gen_xmlNodePtr(n_node, 1);
7145        depth = gen_int(n_depth, 2);
7146
7147        xmlDebugDumpNodeList(output, node, depth);
7148        call_tests++;
7149        des_debug_FILE_ptr(n_output, output, 0);
7150        des_xmlNodePtr(n_node, node, 1);
7151        des_int(n_depth, depth, 2);
7152        xmlResetLastError();
7153        if (mem_base != xmlMemBlocks()) {
7154            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7155	           xmlMemBlocks() - mem_base);
7156	    test_ret++;
7157            printf(" %d", n_output);
7158            printf(" %d", n_node);
7159            printf(" %d", n_depth);
7160            printf("\n");
7161        }
7162    }
7163    }
7164    }
7165    function_tests++;
7166#endif
7167
7168    return(test_ret);
7169}
7170
7171
7172static int
7173test_xmlDebugDumpOneNode(void) {
7174    int test_ret = 0;
7175
7176#ifdef LIBXML_DEBUG_ENABLED
7177    int mem_base;
7178    FILE * output; /* the FILE * for the output */
7179    int n_output;
7180    xmlNodePtr node; /* the node */
7181    int n_node;
7182    int depth; /* the indentation level. */
7183    int n_depth;
7184
7185    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7186    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7187    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7188        mem_base = xmlMemBlocks();
7189        output = gen_debug_FILE_ptr(n_output, 0);
7190        node = gen_xmlNodePtr(n_node, 1);
7191        depth = gen_int(n_depth, 2);
7192
7193        xmlDebugDumpOneNode(output, node, depth);
7194        call_tests++;
7195        des_debug_FILE_ptr(n_output, output, 0);
7196        des_xmlNodePtr(n_node, node, 1);
7197        des_int(n_depth, depth, 2);
7198        xmlResetLastError();
7199        if (mem_base != xmlMemBlocks()) {
7200            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7201	           xmlMemBlocks() - mem_base);
7202	    test_ret++;
7203            printf(" %d", n_output);
7204            printf(" %d", n_node);
7205            printf(" %d", n_depth);
7206            printf("\n");
7207        }
7208    }
7209    }
7210    }
7211    function_tests++;
7212#endif
7213
7214    return(test_ret);
7215}
7216
7217
7218static int
7219test_xmlDebugDumpString(void) {
7220    int test_ret = 0;
7221
7222#ifdef LIBXML_DEBUG_ENABLED
7223    int mem_base;
7224    FILE * output; /* the FILE * for the output */
7225    int n_output;
7226    xmlChar * str; /* the string */
7227    int n_str;
7228
7229    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7230    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7231        mem_base = xmlMemBlocks();
7232        output = gen_debug_FILE_ptr(n_output, 0);
7233        str = gen_const_xmlChar_ptr(n_str, 1);
7234
7235        xmlDebugDumpString(output, (const xmlChar *)str);
7236        call_tests++;
7237        des_debug_FILE_ptr(n_output, output, 0);
7238        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7239        xmlResetLastError();
7240        if (mem_base != xmlMemBlocks()) {
7241            printf("Leak of %d blocks found in xmlDebugDumpString",
7242	           xmlMemBlocks() - mem_base);
7243	    test_ret++;
7244            printf(" %d", n_output);
7245            printf(" %d", n_str);
7246            printf("\n");
7247        }
7248    }
7249    }
7250    function_tests++;
7251#endif
7252
7253    return(test_ret);
7254}
7255
7256
7257static int
7258test_xmlLsCountNode(void) {
7259    int test_ret = 0;
7260
7261#ifdef LIBXML_DEBUG_ENABLED
7262    int mem_base;
7263    int ret_val;
7264    xmlNodePtr node; /* the node to count */
7265    int n_node;
7266
7267    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7268        mem_base = xmlMemBlocks();
7269        node = gen_xmlNodePtr(n_node, 0);
7270
7271        ret_val = xmlLsCountNode(node);
7272        desret_int(ret_val);
7273        call_tests++;
7274        des_xmlNodePtr(n_node, node, 0);
7275        xmlResetLastError();
7276        if (mem_base != xmlMemBlocks()) {
7277            printf("Leak of %d blocks found in xmlLsCountNode",
7278	           xmlMemBlocks() - mem_base);
7279	    test_ret++;
7280            printf(" %d", n_node);
7281            printf("\n");
7282        }
7283    }
7284    function_tests++;
7285#endif
7286
7287    return(test_ret);
7288}
7289
7290
7291static int
7292test_xmlLsOneNode(void) {
7293    int test_ret = 0;
7294
7295#ifdef LIBXML_DEBUG_ENABLED
7296    int mem_base;
7297    FILE * output; /* the FILE * for the output */
7298    int n_output;
7299    xmlNodePtr node; /* the node to dump */
7300    int n_node;
7301
7302    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7303    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7304        mem_base = xmlMemBlocks();
7305        output = gen_debug_FILE_ptr(n_output, 0);
7306        node = gen_xmlNodePtr(n_node, 1);
7307
7308        xmlLsOneNode(output, node);
7309        call_tests++;
7310        des_debug_FILE_ptr(n_output, output, 0);
7311        des_xmlNodePtr(n_node, node, 1);
7312        xmlResetLastError();
7313        if (mem_base != xmlMemBlocks()) {
7314            printf("Leak of %d blocks found in xmlLsOneNode",
7315	           xmlMemBlocks() - mem_base);
7316	    test_ret++;
7317            printf(" %d", n_output);
7318            printf(" %d", n_node);
7319            printf("\n");
7320        }
7321    }
7322    }
7323    function_tests++;
7324#endif
7325
7326    return(test_ret);
7327}
7328
7329
7330#define gen_nb_char_ptr 1
7331static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7332    return(NULL);
7333}
7334static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7335}
7336
7337static int
7338test_xmlShell(void) {
7339    int test_ret = 0;
7340
7341
7342    /* missing type support */
7343    return(test_ret);
7344}
7345
7346
7347static int
7348test_xmlShellBase(void) {
7349    int test_ret = 0;
7350
7351#ifdef LIBXML_DEBUG_ENABLED
7352#ifdef LIBXML_XPATH_ENABLED
7353    int mem_base;
7354    int ret_val;
7355    xmlShellCtxtPtr ctxt; /* the shell context */
7356    int n_ctxt;
7357    char * arg; /* unused */
7358    int n_arg;
7359    xmlNodePtr node; /* a node */
7360    int n_node;
7361    xmlNodePtr node2; /* unused */
7362    int n_node2;
7363
7364    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7365    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7366    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7367    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7368        mem_base = xmlMemBlocks();
7369        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7370        arg = gen_char_ptr(n_arg, 1);
7371        node = gen_xmlNodePtr(n_node, 2);
7372        node2 = gen_xmlNodePtr(n_node2, 3);
7373
7374        ret_val = xmlShellBase(ctxt, arg, node, node2);
7375        desret_int(ret_val);
7376        call_tests++;
7377        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7378        des_char_ptr(n_arg, arg, 1);
7379        des_xmlNodePtr(n_node, node, 2);
7380        des_xmlNodePtr(n_node2, node2, 3);
7381        xmlResetLastError();
7382        if (mem_base != xmlMemBlocks()) {
7383            printf("Leak of %d blocks found in xmlShellBase",
7384	           xmlMemBlocks() - mem_base);
7385	    test_ret++;
7386            printf(" %d", n_ctxt);
7387            printf(" %d", n_arg);
7388            printf(" %d", n_node);
7389            printf(" %d", n_node2);
7390            printf("\n");
7391        }
7392    }
7393    }
7394    }
7395    }
7396    function_tests++;
7397#endif
7398#endif
7399
7400    return(test_ret);
7401}
7402
7403
7404static int
7405test_xmlShellCat(void) {
7406    int test_ret = 0;
7407
7408#ifdef LIBXML_DEBUG_ENABLED
7409#ifdef LIBXML_XPATH_ENABLED
7410    int mem_base;
7411    int ret_val;
7412    xmlShellCtxtPtr ctxt; /* the shell context */
7413    int n_ctxt;
7414    char * arg; /* unused */
7415    int n_arg;
7416    xmlNodePtr node; /* a node */
7417    int n_node;
7418    xmlNodePtr node2; /* unused */
7419    int n_node2;
7420
7421    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7422    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7423    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7424    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7425        mem_base = xmlMemBlocks();
7426        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7427        arg = gen_char_ptr(n_arg, 1);
7428        node = gen_xmlNodePtr(n_node, 2);
7429        node2 = gen_xmlNodePtr(n_node2, 3);
7430
7431        ret_val = xmlShellCat(ctxt, arg, node, node2);
7432        desret_int(ret_val);
7433        call_tests++;
7434        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7435        des_char_ptr(n_arg, arg, 1);
7436        des_xmlNodePtr(n_node, node, 2);
7437        des_xmlNodePtr(n_node2, node2, 3);
7438        xmlResetLastError();
7439        if (mem_base != xmlMemBlocks()) {
7440            printf("Leak of %d blocks found in xmlShellCat",
7441	           xmlMemBlocks() - mem_base);
7442	    test_ret++;
7443            printf(" %d", n_ctxt);
7444            printf(" %d", n_arg);
7445            printf(" %d", n_node);
7446            printf(" %d", n_node2);
7447            printf("\n");
7448        }
7449    }
7450    }
7451    }
7452    }
7453    function_tests++;
7454#endif
7455#endif
7456
7457    return(test_ret);
7458}
7459
7460
7461static int
7462test_xmlShellDir(void) {
7463    int test_ret = 0;
7464
7465#ifdef LIBXML_DEBUG_ENABLED
7466#ifdef LIBXML_XPATH_ENABLED
7467    int mem_base;
7468    int ret_val;
7469    xmlShellCtxtPtr ctxt; /* the shell context */
7470    int n_ctxt;
7471    char * arg; /* unused */
7472    int n_arg;
7473    xmlNodePtr node; /* a node */
7474    int n_node;
7475    xmlNodePtr node2; /* unused */
7476    int n_node2;
7477
7478    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7479    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7480    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7481    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7482        mem_base = xmlMemBlocks();
7483        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7484        arg = gen_char_ptr(n_arg, 1);
7485        node = gen_xmlNodePtr(n_node, 2);
7486        node2 = gen_xmlNodePtr(n_node2, 3);
7487
7488        ret_val = xmlShellDir(ctxt, arg, node, node2);
7489        desret_int(ret_val);
7490        call_tests++;
7491        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7492        des_char_ptr(n_arg, arg, 1);
7493        des_xmlNodePtr(n_node, node, 2);
7494        des_xmlNodePtr(n_node2, node2, 3);
7495        xmlResetLastError();
7496        if (mem_base != xmlMemBlocks()) {
7497            printf("Leak of %d blocks found in xmlShellDir",
7498	           xmlMemBlocks() - mem_base);
7499	    test_ret++;
7500            printf(" %d", n_ctxt);
7501            printf(" %d", n_arg);
7502            printf(" %d", n_node);
7503            printf(" %d", n_node2);
7504            printf("\n");
7505        }
7506    }
7507    }
7508    }
7509    }
7510    function_tests++;
7511#endif
7512#endif
7513
7514    return(test_ret);
7515}
7516
7517
7518static int
7519test_xmlShellDu(void) {
7520    int test_ret = 0;
7521
7522#ifdef LIBXML_DEBUG_ENABLED
7523#ifdef LIBXML_XPATH_ENABLED
7524    int mem_base;
7525    int ret_val;
7526    xmlShellCtxtPtr ctxt; /* the shell context */
7527    int n_ctxt;
7528    char * arg; /* unused */
7529    int n_arg;
7530    xmlNodePtr tree; /* a node defining a subtree */
7531    int n_tree;
7532    xmlNodePtr node2; /* unused */
7533    int n_node2;
7534
7535    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7536    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7537    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7538    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7539        mem_base = xmlMemBlocks();
7540        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7541        arg = gen_char_ptr(n_arg, 1);
7542        tree = gen_xmlNodePtr(n_tree, 2);
7543        node2 = gen_xmlNodePtr(n_node2, 3);
7544
7545        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7546        desret_int(ret_val);
7547        call_tests++;
7548        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7549        des_char_ptr(n_arg, arg, 1);
7550        des_xmlNodePtr(n_tree, tree, 2);
7551        des_xmlNodePtr(n_node2, node2, 3);
7552        xmlResetLastError();
7553        if (mem_base != xmlMemBlocks()) {
7554            printf("Leak of %d blocks found in xmlShellDu",
7555	           xmlMemBlocks() - mem_base);
7556	    test_ret++;
7557            printf(" %d", n_ctxt);
7558            printf(" %d", n_arg);
7559            printf(" %d", n_tree);
7560            printf(" %d", n_node2);
7561            printf("\n");
7562        }
7563    }
7564    }
7565    }
7566    }
7567    function_tests++;
7568#endif
7569#endif
7570
7571    return(test_ret);
7572}
7573
7574
7575static int
7576test_xmlShellList(void) {
7577    int test_ret = 0;
7578
7579#ifdef LIBXML_DEBUG_ENABLED
7580#ifdef LIBXML_XPATH_ENABLED
7581    int mem_base;
7582    int ret_val;
7583    xmlShellCtxtPtr ctxt; /* the shell context */
7584    int n_ctxt;
7585    char * arg; /* unused */
7586    int n_arg;
7587    xmlNodePtr node; /* a node */
7588    int n_node;
7589    xmlNodePtr node2; /* unused */
7590    int n_node2;
7591
7592    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7593    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7594    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7595    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7596        mem_base = xmlMemBlocks();
7597        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7598        arg = gen_char_ptr(n_arg, 1);
7599        node = gen_xmlNodePtr(n_node, 2);
7600        node2 = gen_xmlNodePtr(n_node2, 3);
7601
7602        ret_val = xmlShellList(ctxt, arg, node, node2);
7603        desret_int(ret_val);
7604        call_tests++;
7605        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7606        des_char_ptr(n_arg, arg, 1);
7607        des_xmlNodePtr(n_node, node, 2);
7608        des_xmlNodePtr(n_node2, node2, 3);
7609        xmlResetLastError();
7610        if (mem_base != xmlMemBlocks()) {
7611            printf("Leak of %d blocks found in xmlShellList",
7612	           xmlMemBlocks() - mem_base);
7613	    test_ret++;
7614            printf(" %d", n_ctxt);
7615            printf(" %d", n_arg);
7616            printf(" %d", n_node);
7617            printf(" %d", n_node2);
7618            printf("\n");
7619        }
7620    }
7621    }
7622    }
7623    }
7624    function_tests++;
7625#endif
7626#endif
7627
7628    return(test_ret);
7629}
7630
7631
7632static int
7633test_xmlShellLoad(void) {
7634    int test_ret = 0;
7635
7636#ifdef LIBXML_DEBUG_ENABLED
7637#ifdef LIBXML_XPATH_ENABLED
7638    int mem_base;
7639    int ret_val;
7640    xmlShellCtxtPtr ctxt; /* the shell context */
7641    int n_ctxt;
7642    char * filename; /* the file name */
7643    int n_filename;
7644    xmlNodePtr node; /* unused */
7645    int n_node;
7646    xmlNodePtr node2; /* unused */
7647    int n_node2;
7648
7649    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7650    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7651    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7652    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7653        mem_base = xmlMemBlocks();
7654        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7655        filename = gen_char_ptr(n_filename, 1);
7656        node = gen_xmlNodePtr(n_node, 2);
7657        node2 = gen_xmlNodePtr(n_node2, 3);
7658
7659        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7660        desret_int(ret_val);
7661        call_tests++;
7662        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7663        des_char_ptr(n_filename, filename, 1);
7664        des_xmlNodePtr(n_node, node, 2);
7665        des_xmlNodePtr(n_node2, node2, 3);
7666        xmlResetLastError();
7667        if (mem_base != xmlMemBlocks()) {
7668            printf("Leak of %d blocks found in xmlShellLoad",
7669	           xmlMemBlocks() - mem_base);
7670	    test_ret++;
7671            printf(" %d", n_ctxt);
7672            printf(" %d", n_filename);
7673            printf(" %d", n_node);
7674            printf(" %d", n_node2);
7675            printf("\n");
7676        }
7677    }
7678    }
7679    }
7680    }
7681    function_tests++;
7682#endif
7683#endif
7684
7685    return(test_ret);
7686}
7687
7688
7689static int
7690test_xmlShellPrintXPathResult(void) {
7691    int test_ret = 0;
7692
7693#ifdef LIBXML_DEBUG_ENABLED
7694#ifdef LIBXML_XPATH_ENABLED
7695    int mem_base;
7696    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7697    int n_list;
7698
7699    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7700        mem_base = xmlMemBlocks();
7701        list = gen_xmlXPathObjectPtr(n_list, 0);
7702
7703        xmlShellPrintXPathResult(list);
7704        call_tests++;
7705        des_xmlXPathObjectPtr(n_list, list, 0);
7706        xmlResetLastError();
7707        if (mem_base != xmlMemBlocks()) {
7708            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7709	           xmlMemBlocks() - mem_base);
7710	    test_ret++;
7711            printf(" %d", n_list);
7712            printf("\n");
7713        }
7714    }
7715    function_tests++;
7716#endif
7717#endif
7718
7719    return(test_ret);
7720}
7721
7722
7723static int
7724test_xmlShellPwd(void) {
7725    int test_ret = 0;
7726
7727#ifdef LIBXML_DEBUG_ENABLED
7728#ifdef LIBXML_XPATH_ENABLED
7729    int mem_base;
7730    int ret_val;
7731    xmlShellCtxtPtr ctxt; /* the shell context */
7732    int n_ctxt;
7733    char * buffer; /* the output buffer */
7734    int n_buffer;
7735    xmlNodePtr node; /* a node */
7736    int n_node;
7737    xmlNodePtr node2; /* unused */
7738    int n_node2;
7739
7740    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7741    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7742    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7743    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7744        mem_base = xmlMemBlocks();
7745        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7746        buffer = gen_char_ptr(n_buffer, 1);
7747        node = gen_xmlNodePtr(n_node, 2);
7748        node2 = gen_xmlNodePtr(n_node2, 3);
7749
7750        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7751        desret_int(ret_val);
7752        call_tests++;
7753        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7754        des_char_ptr(n_buffer, buffer, 1);
7755        des_xmlNodePtr(n_node, node, 2);
7756        des_xmlNodePtr(n_node2, node2, 3);
7757        xmlResetLastError();
7758        if (mem_base != xmlMemBlocks()) {
7759            printf("Leak of %d blocks found in xmlShellPwd",
7760	           xmlMemBlocks() - mem_base);
7761	    test_ret++;
7762            printf(" %d", n_ctxt);
7763            printf(" %d", n_buffer);
7764            printf(" %d", n_node);
7765            printf(" %d", n_node2);
7766            printf("\n");
7767        }
7768    }
7769    }
7770    }
7771    }
7772    function_tests++;
7773#endif
7774#endif
7775
7776    return(test_ret);
7777}
7778
7779
7780static int
7781test_xmlShellSave(void) {
7782    int test_ret = 0;
7783
7784#ifdef LIBXML_DEBUG_ENABLED
7785#ifdef LIBXML_XPATH_ENABLED
7786#ifdef LIBXML_OUTPUT_ENABLED
7787    int mem_base;
7788    int ret_val;
7789    xmlShellCtxtPtr ctxt; /* the shell context */
7790    int n_ctxt;
7791    char * filename; /* the file name (optional) */
7792    int n_filename;
7793    xmlNodePtr node; /* unused */
7794    int n_node;
7795    xmlNodePtr node2; /* unused */
7796    int n_node2;
7797
7798    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7799    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7800    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7801    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7802        mem_base = xmlMemBlocks();
7803        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7804        filename = gen_char_ptr(n_filename, 1);
7805        node = gen_xmlNodePtr(n_node, 2);
7806        node2 = gen_xmlNodePtr(n_node2, 3);
7807
7808        ret_val = xmlShellSave(ctxt, filename, node, node2);
7809        desret_int(ret_val);
7810        call_tests++;
7811        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7812        des_char_ptr(n_filename, filename, 1);
7813        des_xmlNodePtr(n_node, node, 2);
7814        des_xmlNodePtr(n_node2, node2, 3);
7815        xmlResetLastError();
7816        if (mem_base != xmlMemBlocks()) {
7817            printf("Leak of %d blocks found in xmlShellSave",
7818	           xmlMemBlocks() - mem_base);
7819	    test_ret++;
7820            printf(" %d", n_ctxt);
7821            printf(" %d", n_filename);
7822            printf(" %d", n_node);
7823            printf(" %d", n_node2);
7824            printf("\n");
7825        }
7826    }
7827    }
7828    }
7829    }
7830    function_tests++;
7831#endif
7832#endif
7833#endif
7834
7835    return(test_ret);
7836}
7837
7838
7839static int
7840test_xmlShellValidate(void) {
7841    int test_ret = 0;
7842
7843#ifdef LIBXML_DEBUG_ENABLED
7844#ifdef LIBXML_XPATH_ENABLED
7845    int mem_base;
7846    int ret_val;
7847    xmlShellCtxtPtr ctxt; /* the shell context */
7848    int n_ctxt;
7849    char * dtd; /* the DTD URI (optional) */
7850    int n_dtd;
7851    xmlNodePtr node; /* unused */
7852    int n_node;
7853    xmlNodePtr node2; /* unused */
7854    int n_node2;
7855
7856    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7857    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7858    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7859    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7860        mem_base = xmlMemBlocks();
7861        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7862        dtd = gen_char_ptr(n_dtd, 1);
7863        node = gen_xmlNodePtr(n_node, 2);
7864        node2 = gen_xmlNodePtr(n_node2, 3);
7865
7866        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
7867        desret_int(ret_val);
7868        call_tests++;
7869        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7870        des_char_ptr(n_dtd, dtd, 1);
7871        des_xmlNodePtr(n_node, node, 2);
7872        des_xmlNodePtr(n_node2, node2, 3);
7873        xmlResetLastError();
7874        if (mem_base != xmlMemBlocks()) {
7875            printf("Leak of %d blocks found in xmlShellValidate",
7876	           xmlMemBlocks() - mem_base);
7877	    test_ret++;
7878            printf(" %d", n_ctxt);
7879            printf(" %d", n_dtd);
7880            printf(" %d", n_node);
7881            printf(" %d", n_node2);
7882            printf("\n");
7883        }
7884    }
7885    }
7886    }
7887    }
7888    function_tests++;
7889#endif
7890#endif
7891
7892    return(test_ret);
7893}
7894
7895
7896static int
7897test_xmlShellWrite(void) {
7898    int test_ret = 0;
7899
7900#ifdef LIBXML_DEBUG_ENABLED
7901#ifdef LIBXML_XPATH_ENABLED
7902#ifdef LIBXML_OUTPUT_ENABLED
7903    int mem_base;
7904    int ret_val;
7905    xmlShellCtxtPtr ctxt; /* the shell context */
7906    int n_ctxt;
7907    char * filename; /* the file name */
7908    int n_filename;
7909    xmlNodePtr node; /* a node in the tree */
7910    int n_node;
7911    xmlNodePtr node2; /* unused */
7912    int n_node2;
7913
7914    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7915    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7916    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7917    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7918        mem_base = xmlMemBlocks();
7919        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7920        filename = gen_char_ptr(n_filename, 1);
7921        node = gen_xmlNodePtr(n_node, 2);
7922        node2 = gen_xmlNodePtr(n_node2, 3);
7923
7924        ret_val = xmlShellWrite(ctxt, filename, node, node2);
7925        desret_int(ret_val);
7926        call_tests++;
7927        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7928        des_char_ptr(n_filename, filename, 1);
7929        des_xmlNodePtr(n_node, node, 2);
7930        des_xmlNodePtr(n_node2, node2, 3);
7931        xmlResetLastError();
7932        if (mem_base != xmlMemBlocks()) {
7933            printf("Leak of %d blocks found in xmlShellWrite",
7934	           xmlMemBlocks() - mem_base);
7935	    test_ret++;
7936            printf(" %d", n_ctxt);
7937            printf(" %d", n_filename);
7938            printf(" %d", n_node);
7939            printf(" %d", n_node2);
7940            printf("\n");
7941        }
7942    }
7943    }
7944    }
7945    }
7946    function_tests++;
7947#endif
7948#endif
7949#endif
7950
7951    return(test_ret);
7952}
7953
7954static int
7955test_debugXML(void) {
7956    int test_ret = 0;
7957
7958    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
7959    test_ret += test_xmlBoolToText();
7960    test_ret += test_xmlDebugCheckDocument();
7961    test_ret += test_xmlDebugDumpAttr();
7962    test_ret += test_xmlDebugDumpAttrList();
7963    test_ret += test_xmlDebugDumpDTD();
7964    test_ret += test_xmlDebugDumpDocument();
7965    test_ret += test_xmlDebugDumpDocumentHead();
7966    test_ret += test_xmlDebugDumpEntities();
7967    test_ret += test_xmlDebugDumpNode();
7968    test_ret += test_xmlDebugDumpNodeList();
7969    test_ret += test_xmlDebugDumpOneNode();
7970    test_ret += test_xmlDebugDumpString();
7971    test_ret += test_xmlLsCountNode();
7972    test_ret += test_xmlLsOneNode();
7973    test_ret += test_xmlShell();
7974    test_ret += test_xmlShellBase();
7975    test_ret += test_xmlShellCat();
7976    test_ret += test_xmlShellDir();
7977    test_ret += test_xmlShellDu();
7978    test_ret += test_xmlShellList();
7979    test_ret += test_xmlShellLoad();
7980    test_ret += test_xmlShellPrintXPathResult();
7981    test_ret += test_xmlShellPwd();
7982    test_ret += test_xmlShellSave();
7983    test_ret += test_xmlShellValidate();
7984    test_ret += test_xmlShellWrite();
7985
7986    if (test_ret != 0)
7987	printf("Module debugXML: %d errors\n", test_ret);
7988    return(test_ret);
7989}
7990
7991static int
7992test_xmlDictCreate(void) {
7993    int test_ret = 0;
7994
7995    int mem_base;
7996    xmlDictPtr ret_val;
7997
7998        mem_base = xmlMemBlocks();
7999
8000        ret_val = xmlDictCreate();
8001        desret_xmlDictPtr(ret_val);
8002        call_tests++;
8003        xmlResetLastError();
8004        if (mem_base != xmlMemBlocks()) {
8005            printf("Leak of %d blocks found in xmlDictCreate",
8006	           xmlMemBlocks() - mem_base);
8007	    test_ret++;
8008            printf("\n");
8009        }
8010    function_tests++;
8011
8012    return(test_ret);
8013}
8014
8015
8016static int
8017test_xmlDictCreateSub(void) {
8018    int test_ret = 0;
8019
8020    int mem_base;
8021    xmlDictPtr ret_val;
8022    xmlDictPtr sub; /* an existing dictionnary */
8023    int n_sub;
8024
8025    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8026        mem_base = xmlMemBlocks();
8027        sub = gen_xmlDictPtr(n_sub, 0);
8028
8029        ret_val = xmlDictCreateSub(sub);
8030        desret_xmlDictPtr(ret_val);
8031        call_tests++;
8032        des_xmlDictPtr(n_sub, sub, 0);
8033        xmlResetLastError();
8034        if (mem_base != xmlMemBlocks()) {
8035            printf("Leak of %d blocks found in xmlDictCreateSub",
8036	           xmlMemBlocks() - mem_base);
8037	    test_ret++;
8038            printf(" %d", n_sub);
8039            printf("\n");
8040        }
8041    }
8042    function_tests++;
8043
8044    return(test_ret);
8045}
8046
8047
8048static int
8049test_xmlDictExists(void) {
8050    int test_ret = 0;
8051
8052    int mem_base;
8053    const xmlChar * ret_val;
8054    xmlDictPtr dict; /* the dictionnary */
8055    int n_dict;
8056    xmlChar * name; /* the name of the userdata */
8057    int n_name;
8058    int len; /* the length of the name, if -1 it is recomputed */
8059    int n_len;
8060
8061    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8062    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8063    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8064        mem_base = xmlMemBlocks();
8065        dict = gen_xmlDictPtr(n_dict, 0);
8066        name = gen_const_xmlChar_ptr(n_name, 1);
8067        len = gen_int(n_len, 2);
8068
8069        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8070        desret_const_xmlChar_ptr(ret_val);
8071        call_tests++;
8072        des_xmlDictPtr(n_dict, dict, 0);
8073        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8074        des_int(n_len, len, 2);
8075        xmlResetLastError();
8076        if (mem_base != xmlMemBlocks()) {
8077            printf("Leak of %d blocks found in xmlDictExists",
8078	           xmlMemBlocks() - mem_base);
8079	    test_ret++;
8080            printf(" %d", n_dict);
8081            printf(" %d", n_name);
8082            printf(" %d", n_len);
8083            printf("\n");
8084        }
8085    }
8086    }
8087    }
8088    function_tests++;
8089
8090    return(test_ret);
8091}
8092
8093
8094static int
8095test_xmlDictLookup(void) {
8096    int test_ret = 0;
8097
8098    int mem_base;
8099    const xmlChar * ret_val;
8100    xmlDictPtr dict; /* the dictionnary */
8101    int n_dict;
8102    xmlChar * name; /* the name of the userdata */
8103    int n_name;
8104    int len; /* the length of the name, if -1 it is recomputed */
8105    int n_len;
8106
8107    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8108    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8109    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8110        mem_base = xmlMemBlocks();
8111        dict = gen_xmlDictPtr(n_dict, 0);
8112        name = gen_const_xmlChar_ptr(n_name, 1);
8113        len = gen_int(n_len, 2);
8114
8115        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8116        desret_const_xmlChar_ptr(ret_val);
8117        call_tests++;
8118        des_xmlDictPtr(n_dict, dict, 0);
8119        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8120        des_int(n_len, len, 2);
8121        xmlResetLastError();
8122        if (mem_base != xmlMemBlocks()) {
8123            printf("Leak of %d blocks found in xmlDictLookup",
8124	           xmlMemBlocks() - mem_base);
8125	    test_ret++;
8126            printf(" %d", n_dict);
8127            printf(" %d", n_name);
8128            printf(" %d", n_len);
8129            printf("\n");
8130        }
8131    }
8132    }
8133    }
8134    function_tests++;
8135
8136    return(test_ret);
8137}
8138
8139
8140static int
8141test_xmlDictOwns(void) {
8142    int test_ret = 0;
8143
8144    int mem_base;
8145    int ret_val;
8146    xmlDictPtr dict; /* the dictionnary */
8147    int n_dict;
8148    xmlChar * str; /* the string */
8149    int n_str;
8150
8151    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8152    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8153        mem_base = xmlMemBlocks();
8154        dict = gen_xmlDictPtr(n_dict, 0);
8155        str = gen_const_xmlChar_ptr(n_str, 1);
8156
8157        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8158        desret_int(ret_val);
8159        call_tests++;
8160        des_xmlDictPtr(n_dict, dict, 0);
8161        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8162        xmlResetLastError();
8163        if (mem_base != xmlMemBlocks()) {
8164            printf("Leak of %d blocks found in xmlDictOwns",
8165	           xmlMemBlocks() - mem_base);
8166	    test_ret++;
8167            printf(" %d", n_dict);
8168            printf(" %d", n_str);
8169            printf("\n");
8170        }
8171    }
8172    }
8173    function_tests++;
8174
8175    return(test_ret);
8176}
8177
8178
8179static int
8180test_xmlDictQLookup(void) {
8181    int test_ret = 0;
8182
8183    int mem_base;
8184    const xmlChar * ret_val;
8185    xmlDictPtr dict; /* the dictionnary */
8186    int n_dict;
8187    xmlChar * prefix; /* the prefix */
8188    int n_prefix;
8189    xmlChar * name; /* the name */
8190    int n_name;
8191
8192    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8193    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8194    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8195        mem_base = xmlMemBlocks();
8196        dict = gen_xmlDictPtr(n_dict, 0);
8197        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8198        name = gen_const_xmlChar_ptr(n_name, 2);
8199
8200        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8201        desret_const_xmlChar_ptr(ret_val);
8202        call_tests++;
8203        des_xmlDictPtr(n_dict, dict, 0);
8204        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8205        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8206        xmlResetLastError();
8207        if (mem_base != xmlMemBlocks()) {
8208            printf("Leak of %d blocks found in xmlDictQLookup",
8209	           xmlMemBlocks() - mem_base);
8210	    test_ret++;
8211            printf(" %d", n_dict);
8212            printf(" %d", n_prefix);
8213            printf(" %d", n_name);
8214            printf("\n");
8215        }
8216    }
8217    }
8218    }
8219    function_tests++;
8220
8221    return(test_ret);
8222}
8223
8224
8225static int
8226test_xmlDictReference(void) {
8227    int test_ret = 0;
8228
8229    int mem_base;
8230    int ret_val;
8231    xmlDictPtr dict; /* the dictionnary */
8232    int n_dict;
8233
8234    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8235        mem_base = xmlMemBlocks();
8236        dict = gen_xmlDictPtr(n_dict, 0);
8237
8238        ret_val = xmlDictReference(dict);
8239        xmlDictFree(dict);
8240        desret_int(ret_val);
8241        call_tests++;
8242        des_xmlDictPtr(n_dict, dict, 0);
8243        xmlResetLastError();
8244        if (mem_base != xmlMemBlocks()) {
8245            printf("Leak of %d blocks found in xmlDictReference",
8246	           xmlMemBlocks() - mem_base);
8247	    test_ret++;
8248            printf(" %d", n_dict);
8249            printf("\n");
8250        }
8251    }
8252    function_tests++;
8253
8254    return(test_ret);
8255}
8256
8257
8258static int
8259test_xmlDictSize(void) {
8260    int test_ret = 0;
8261
8262    int mem_base;
8263    int ret_val;
8264    xmlDictPtr dict; /* the dictionnary */
8265    int n_dict;
8266
8267    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8268        mem_base = xmlMemBlocks();
8269        dict = gen_xmlDictPtr(n_dict, 0);
8270
8271        ret_val = xmlDictSize(dict);
8272        desret_int(ret_val);
8273        call_tests++;
8274        des_xmlDictPtr(n_dict, dict, 0);
8275        xmlResetLastError();
8276        if (mem_base != xmlMemBlocks()) {
8277            printf("Leak of %d blocks found in xmlDictSize",
8278	           xmlMemBlocks() - mem_base);
8279	    test_ret++;
8280            printf(" %d", n_dict);
8281            printf("\n");
8282        }
8283    }
8284    function_tests++;
8285
8286    return(test_ret);
8287}
8288
8289static int
8290test_dict(void) {
8291    int test_ret = 0;
8292
8293    if (quiet == 0) printf("Testing dict : 8 of 9 functions ...\n");
8294    test_ret += test_xmlDictCreate();
8295    test_ret += test_xmlDictCreateSub();
8296    test_ret += test_xmlDictExists();
8297    test_ret += test_xmlDictLookup();
8298    test_ret += test_xmlDictOwns();
8299    test_ret += test_xmlDictQLookup();
8300    test_ret += test_xmlDictReference();
8301    test_ret += test_xmlDictSize();
8302
8303    if (test_ret != 0)
8304	printf("Module dict: %d errors\n", test_ret);
8305    return(test_ret);
8306}
8307
8308static int
8309test_UTF8Toisolat1(void) {
8310    int test_ret = 0;
8311
8312#ifdef LIBXML_OUTPUT_ENABLED
8313    int mem_base;
8314    int ret_val;
8315    unsigned char * out; /* a pointer to an array of bytes to store the result */
8316    int n_out;
8317    int * outlen; /* the length of @out */
8318    int n_outlen;
8319    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8320    int n_in;
8321    int * inlen; /* the length of @in */
8322    int n_inlen;
8323
8324    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8325    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8326    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8327    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8328        mem_base = xmlMemBlocks();
8329        out = gen_unsigned_char_ptr(n_out, 0);
8330        outlen = gen_int_ptr(n_outlen, 1);
8331        in = gen_const_unsigned_char_ptr(n_in, 2);
8332        inlen = gen_int_ptr(n_inlen, 3);
8333
8334        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8335        desret_int(ret_val);
8336        call_tests++;
8337        des_unsigned_char_ptr(n_out, out, 0);
8338        des_int_ptr(n_outlen, outlen, 1);
8339        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8340        des_int_ptr(n_inlen, inlen, 3);
8341        xmlResetLastError();
8342        if (mem_base != xmlMemBlocks()) {
8343            printf("Leak of %d blocks found in UTF8Toisolat1",
8344	           xmlMemBlocks() - mem_base);
8345	    test_ret++;
8346            printf(" %d", n_out);
8347            printf(" %d", n_outlen);
8348            printf(" %d", n_in);
8349            printf(" %d", n_inlen);
8350            printf("\n");
8351        }
8352    }
8353    }
8354    }
8355    }
8356    function_tests++;
8357#endif
8358
8359    return(test_ret);
8360}
8361
8362
8363static int
8364test_isolat1ToUTF8(void) {
8365    int test_ret = 0;
8366
8367    int mem_base;
8368    int ret_val;
8369    unsigned char * out; /* a pointer to an array of bytes to store the result */
8370    int n_out;
8371    int * outlen; /* the length of @out */
8372    int n_outlen;
8373    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8374    int n_in;
8375    int * inlen; /* the length of @in */
8376    int n_inlen;
8377
8378    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8379    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8380    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8381    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8382        mem_base = xmlMemBlocks();
8383        out = gen_unsigned_char_ptr(n_out, 0);
8384        outlen = gen_int_ptr(n_outlen, 1);
8385        in = gen_const_unsigned_char_ptr(n_in, 2);
8386        inlen = gen_int_ptr(n_inlen, 3);
8387
8388        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8389        desret_int(ret_val);
8390        call_tests++;
8391        des_unsigned_char_ptr(n_out, out, 0);
8392        des_int_ptr(n_outlen, outlen, 1);
8393        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8394        des_int_ptr(n_inlen, inlen, 3);
8395        xmlResetLastError();
8396        if (mem_base != xmlMemBlocks()) {
8397            printf("Leak of %d blocks found in isolat1ToUTF8",
8398	           xmlMemBlocks() - mem_base);
8399	    test_ret++;
8400            printf(" %d", n_out);
8401            printf(" %d", n_outlen);
8402            printf(" %d", n_in);
8403            printf(" %d", n_inlen);
8404            printf("\n");
8405        }
8406    }
8407    }
8408    }
8409    }
8410    function_tests++;
8411
8412    return(test_ret);
8413}
8414
8415
8416static int
8417test_xmlAddEncodingAlias(void) {
8418    int test_ret = 0;
8419
8420    int ret_val;
8421    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8422    int n_name;
8423    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8424    int n_alias;
8425
8426    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8427    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8428        name = gen_const_char_ptr(n_name, 0);
8429        alias = gen_const_char_ptr(n_alias, 1);
8430
8431        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8432        desret_int(ret_val);
8433        call_tests++;
8434        des_const_char_ptr(n_name, (const char *)name, 0);
8435        des_const_char_ptr(n_alias, (const char *)alias, 1);
8436        xmlResetLastError();
8437    }
8438    }
8439    function_tests++;
8440
8441    return(test_ret);
8442}
8443
8444
8445#define gen_nb_xmlCharEncodingHandler_ptr 1
8446static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8447    return(NULL);
8448}
8449static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8450}
8451
8452static int
8453test_xmlCharEncCloseFunc(void) {
8454    int test_ret = 0;
8455
8456    int mem_base;
8457    int ret_val;
8458    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8459    int n_handler;
8460
8461    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8462        mem_base = xmlMemBlocks();
8463        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8464
8465        ret_val = xmlCharEncCloseFunc(handler);
8466        desret_int(ret_val);
8467        call_tests++;
8468        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8469        xmlResetLastError();
8470        if (mem_base != xmlMemBlocks()) {
8471            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8472	           xmlMemBlocks() - mem_base);
8473	    test_ret++;
8474            printf(" %d", n_handler);
8475            printf("\n");
8476        }
8477    }
8478    function_tests++;
8479
8480    return(test_ret);
8481}
8482
8483
8484static int
8485test_xmlCharEncFirstLine(void) {
8486    int test_ret = 0;
8487
8488    int mem_base;
8489    int ret_val;
8490    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8491    int n_handler;
8492    xmlBufferPtr out; /* an xmlBuffer for the output. */
8493    int n_out;
8494    xmlBufferPtr in; /* an xmlBuffer for the input */
8495    int n_in;
8496
8497    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8498    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8499    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8500        mem_base = xmlMemBlocks();
8501        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8502        out = gen_xmlBufferPtr(n_out, 1);
8503        in = gen_xmlBufferPtr(n_in, 2);
8504
8505        ret_val = xmlCharEncFirstLine(handler, out, in);
8506        desret_int(ret_val);
8507        call_tests++;
8508        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8509        des_xmlBufferPtr(n_out, out, 1);
8510        des_xmlBufferPtr(n_in, in, 2);
8511        xmlResetLastError();
8512        if (mem_base != xmlMemBlocks()) {
8513            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8514	           xmlMemBlocks() - mem_base);
8515	    test_ret++;
8516            printf(" %d", n_handler);
8517            printf(" %d", n_out);
8518            printf(" %d", n_in);
8519            printf("\n");
8520        }
8521    }
8522    }
8523    }
8524    function_tests++;
8525
8526    return(test_ret);
8527}
8528
8529
8530static int
8531test_xmlCharEncInFunc(void) {
8532    int test_ret = 0;
8533
8534    int mem_base;
8535    int ret_val;
8536    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8537    int n_handler;
8538    xmlBufferPtr out; /* an xmlBuffer for the output. */
8539    int n_out;
8540    xmlBufferPtr in; /* an xmlBuffer for the input */
8541    int n_in;
8542
8543    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8544    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8545    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8546        mem_base = xmlMemBlocks();
8547        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8548        out = gen_xmlBufferPtr(n_out, 1);
8549        in = gen_xmlBufferPtr(n_in, 2);
8550
8551        ret_val = xmlCharEncInFunc(handler, out, in);
8552        desret_int(ret_val);
8553        call_tests++;
8554        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8555        des_xmlBufferPtr(n_out, out, 1);
8556        des_xmlBufferPtr(n_in, in, 2);
8557        xmlResetLastError();
8558        if (mem_base != xmlMemBlocks()) {
8559            printf("Leak of %d blocks found in xmlCharEncInFunc",
8560	           xmlMemBlocks() - mem_base);
8561	    test_ret++;
8562            printf(" %d", n_handler);
8563            printf(" %d", n_out);
8564            printf(" %d", n_in);
8565            printf("\n");
8566        }
8567    }
8568    }
8569    }
8570    function_tests++;
8571
8572    return(test_ret);
8573}
8574
8575
8576static int
8577test_xmlCharEncOutFunc(void) {
8578    int test_ret = 0;
8579
8580    int mem_base;
8581    int ret_val;
8582    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8583    int n_handler;
8584    xmlBufferPtr out; /* an xmlBuffer for the output. */
8585    int n_out;
8586    xmlBufferPtr in; /* an xmlBuffer for the input */
8587    int n_in;
8588
8589    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8590    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8591    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8592        mem_base = xmlMemBlocks();
8593        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8594        out = gen_xmlBufferPtr(n_out, 1);
8595        in = gen_xmlBufferPtr(n_in, 2);
8596
8597        ret_val = xmlCharEncOutFunc(handler, out, in);
8598        desret_int(ret_val);
8599        call_tests++;
8600        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8601        des_xmlBufferPtr(n_out, out, 1);
8602        des_xmlBufferPtr(n_in, in, 2);
8603        xmlResetLastError();
8604        if (mem_base != xmlMemBlocks()) {
8605            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8606	           xmlMemBlocks() - mem_base);
8607	    test_ret++;
8608            printf(" %d", n_handler);
8609            printf(" %d", n_out);
8610            printf(" %d", n_in);
8611            printf("\n");
8612        }
8613    }
8614    }
8615    }
8616    function_tests++;
8617
8618    return(test_ret);
8619}
8620
8621
8622static int
8623test_xmlCleanupCharEncodingHandlers(void) {
8624    int test_ret = 0;
8625
8626
8627
8628        xmlCleanupCharEncodingHandlers();
8629        call_tests++;
8630        xmlResetLastError();
8631    function_tests++;
8632
8633    return(test_ret);
8634}
8635
8636
8637static int
8638test_xmlCleanupEncodingAliases(void) {
8639    int test_ret = 0;
8640
8641    int mem_base;
8642
8643        mem_base = xmlMemBlocks();
8644
8645        xmlCleanupEncodingAliases();
8646        call_tests++;
8647        xmlResetLastError();
8648        if (mem_base != xmlMemBlocks()) {
8649            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8650	           xmlMemBlocks() - mem_base);
8651	    test_ret++;
8652            printf("\n");
8653        }
8654    function_tests++;
8655
8656    return(test_ret);
8657}
8658
8659
8660static int
8661test_xmlDelEncodingAlias(void) {
8662    int test_ret = 0;
8663
8664    int mem_base;
8665    int ret_val;
8666    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8667    int n_alias;
8668
8669    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8670        mem_base = xmlMemBlocks();
8671        alias = gen_const_char_ptr(n_alias, 0);
8672
8673        ret_val = xmlDelEncodingAlias((const char *)alias);
8674        desret_int(ret_val);
8675        call_tests++;
8676        des_const_char_ptr(n_alias, (const char *)alias, 0);
8677        xmlResetLastError();
8678        if (mem_base != xmlMemBlocks()) {
8679            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8680	           xmlMemBlocks() - mem_base);
8681	    test_ret++;
8682            printf(" %d", n_alias);
8683            printf("\n");
8684        }
8685    }
8686    function_tests++;
8687
8688    return(test_ret);
8689}
8690
8691
8692static int
8693test_xmlDetectCharEncoding(void) {
8694    int test_ret = 0;
8695
8696    int mem_base;
8697    xmlCharEncoding ret_val;
8698    unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
8699    int n_in;
8700    int len; /* pointer to the length of the buffer */
8701    int n_len;
8702
8703    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8704    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8705        mem_base = xmlMemBlocks();
8706        in = gen_const_unsigned_char_ptr(n_in, 0);
8707        len = gen_int(n_len, 1);
8708
8709        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8710        desret_xmlCharEncoding(ret_val);
8711        call_tests++;
8712        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8713        des_int(n_len, len, 1);
8714        xmlResetLastError();
8715        if (mem_base != xmlMemBlocks()) {
8716            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8717	           xmlMemBlocks() - mem_base);
8718	    test_ret++;
8719            printf(" %d", n_in);
8720            printf(" %d", n_len);
8721            printf("\n");
8722        }
8723    }
8724    }
8725    function_tests++;
8726
8727    return(test_ret);
8728}
8729
8730
8731static int
8732test_xmlFindCharEncodingHandler(void) {
8733    int test_ret = 0;
8734
8735
8736    /* missing type support */
8737    return(test_ret);
8738}
8739
8740
8741static int
8742test_xmlGetCharEncodingHandler(void) {
8743    int test_ret = 0;
8744
8745
8746    /* missing type support */
8747    return(test_ret);
8748}
8749
8750
8751static int
8752test_xmlGetCharEncodingName(void) {
8753    int test_ret = 0;
8754
8755    int mem_base;
8756    const char * ret_val;
8757    xmlCharEncoding enc; /* the encoding */
8758    int n_enc;
8759
8760    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8761        mem_base = xmlMemBlocks();
8762        enc = gen_xmlCharEncoding(n_enc, 0);
8763
8764        ret_val = xmlGetCharEncodingName(enc);
8765        desret_const_char_ptr(ret_val);
8766        call_tests++;
8767        des_xmlCharEncoding(n_enc, enc, 0);
8768        xmlResetLastError();
8769        if (mem_base != xmlMemBlocks()) {
8770            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8771	           xmlMemBlocks() - mem_base);
8772	    test_ret++;
8773            printf(" %d", n_enc);
8774            printf("\n");
8775        }
8776    }
8777    function_tests++;
8778
8779    return(test_ret);
8780}
8781
8782
8783static int
8784test_xmlGetEncodingAlias(void) {
8785    int test_ret = 0;
8786
8787    int mem_base;
8788    const char * ret_val;
8789    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8790    int n_alias;
8791
8792    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8793        mem_base = xmlMemBlocks();
8794        alias = gen_const_char_ptr(n_alias, 0);
8795
8796        ret_val = xmlGetEncodingAlias((const char *)alias);
8797        desret_const_char_ptr(ret_val);
8798        call_tests++;
8799        des_const_char_ptr(n_alias, (const char *)alias, 0);
8800        xmlResetLastError();
8801        if (mem_base != xmlMemBlocks()) {
8802            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8803	           xmlMemBlocks() - mem_base);
8804	    test_ret++;
8805            printf(" %d", n_alias);
8806            printf("\n");
8807        }
8808    }
8809    function_tests++;
8810
8811    return(test_ret);
8812}
8813
8814
8815static int
8816test_xmlInitCharEncodingHandlers(void) {
8817    int test_ret = 0;
8818
8819
8820
8821        xmlInitCharEncodingHandlers();
8822        call_tests++;
8823        xmlResetLastError();
8824    function_tests++;
8825
8826    return(test_ret);
8827}
8828
8829
8830static int
8831test_xmlNewCharEncodingHandler(void) {
8832    int test_ret = 0;
8833
8834
8835    /* missing type support */
8836    return(test_ret);
8837}
8838
8839
8840static int
8841test_xmlParseCharEncoding(void) {
8842    int test_ret = 0;
8843
8844    int mem_base;
8845    xmlCharEncoding ret_val;
8846    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8847    int n_name;
8848
8849    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8850        mem_base = xmlMemBlocks();
8851        name = gen_const_char_ptr(n_name, 0);
8852
8853        ret_val = xmlParseCharEncoding((const char *)name);
8854        desret_xmlCharEncoding(ret_val);
8855        call_tests++;
8856        des_const_char_ptr(n_name, (const char *)name, 0);
8857        xmlResetLastError();
8858        if (mem_base != xmlMemBlocks()) {
8859            printf("Leak of %d blocks found in xmlParseCharEncoding",
8860	           xmlMemBlocks() - mem_base);
8861	    test_ret++;
8862            printf(" %d", n_name);
8863            printf("\n");
8864        }
8865    }
8866    function_tests++;
8867
8868    return(test_ret);
8869}
8870
8871
8872#define gen_nb_xmlCharEncodingHandlerPtr 1
8873static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8874    return(NULL);
8875}
8876static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8877}
8878
8879static int
8880test_xmlRegisterCharEncodingHandler(void) {
8881    int test_ret = 0;
8882
8883    int mem_base;
8884    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
8885    int n_handler;
8886
8887    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
8888        mem_base = xmlMemBlocks();
8889        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
8890
8891        xmlRegisterCharEncodingHandler(handler);
8892        call_tests++;
8893        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
8894        xmlResetLastError();
8895        if (mem_base != xmlMemBlocks()) {
8896            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
8897	           xmlMemBlocks() - mem_base);
8898	    test_ret++;
8899            printf(" %d", n_handler);
8900            printf("\n");
8901        }
8902    }
8903    function_tests++;
8904
8905    return(test_ret);
8906}
8907
8908static int
8909test_encoding(void) {
8910    int test_ret = 0;
8911
8912    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
8913    test_ret += test_UTF8Toisolat1();
8914    test_ret += test_isolat1ToUTF8();
8915    test_ret += test_xmlAddEncodingAlias();
8916    test_ret += test_xmlCharEncCloseFunc();
8917    test_ret += test_xmlCharEncFirstLine();
8918    test_ret += test_xmlCharEncInFunc();
8919    test_ret += test_xmlCharEncOutFunc();
8920    test_ret += test_xmlCleanupCharEncodingHandlers();
8921    test_ret += test_xmlCleanupEncodingAliases();
8922    test_ret += test_xmlDelEncodingAlias();
8923    test_ret += test_xmlDetectCharEncoding();
8924    test_ret += test_xmlFindCharEncodingHandler();
8925    test_ret += test_xmlGetCharEncodingHandler();
8926    test_ret += test_xmlGetCharEncodingName();
8927    test_ret += test_xmlGetEncodingAlias();
8928    test_ret += test_xmlInitCharEncodingHandlers();
8929    test_ret += test_xmlNewCharEncodingHandler();
8930    test_ret += test_xmlParseCharEncoding();
8931    test_ret += test_xmlRegisterCharEncodingHandler();
8932
8933    if (test_ret != 0)
8934	printf("Module encoding: %d errors\n", test_ret);
8935    return(test_ret);
8936}
8937
8938static int
8939test_xmlAddDocEntity(void) {
8940    int test_ret = 0;
8941
8942    int mem_base;
8943    xmlEntityPtr ret_val;
8944    xmlDocPtr doc; /* the document */
8945    int n_doc;
8946    xmlChar * name; /* the entity name */
8947    int n_name;
8948    int type; /* the entity type XML_xxx_yyy_ENTITY */
8949    int n_type;
8950    xmlChar * ExternalID; /* the entity external ID if available */
8951    int n_ExternalID;
8952    xmlChar * SystemID; /* the entity system ID if available */
8953    int n_SystemID;
8954    xmlChar * content; /* the entity content */
8955    int n_content;
8956
8957    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
8958    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8959    for (n_type = 0;n_type < gen_nb_int;n_type++) {
8960    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
8961    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
8962    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
8963        mem_base = xmlMemBlocks();
8964        doc = gen_xmlDocPtr(n_doc, 0);
8965        name = gen_const_xmlChar_ptr(n_name, 1);
8966        type = gen_int(n_type, 2);
8967        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
8968        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
8969        content = gen_const_xmlChar_ptr(n_content, 5);
8970
8971        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
8972        desret_xmlEntityPtr(ret_val);
8973        call_tests++;
8974        des_xmlDocPtr(n_doc, doc, 0);
8975        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8976        des_int(n_type, type, 2);
8977        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
8978        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
8979        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
8980        xmlResetLastError();
8981        if (mem_base != xmlMemBlocks()) {
8982            printf("Leak of %d blocks found in xmlAddDocEntity",
8983	           xmlMemBlocks() - mem_base);
8984	    test_ret++;
8985            printf(" %d", n_doc);
8986            printf(" %d", n_name);
8987            printf(" %d", n_type);
8988            printf(" %d", n_ExternalID);
8989            printf(" %d", n_SystemID);
8990            printf(" %d", n_content);
8991            printf("\n");
8992        }
8993    }
8994    }
8995    }
8996    }
8997    }
8998    }
8999    function_tests++;
9000
9001    return(test_ret);
9002}
9003
9004
9005static int
9006test_xmlAddDtdEntity(void) {
9007    int test_ret = 0;
9008
9009    int mem_base;
9010    xmlEntityPtr ret_val;
9011    xmlDocPtr doc; /* the document */
9012    int n_doc;
9013    xmlChar * name; /* the entity name */
9014    int n_name;
9015    int type; /* the entity type XML_xxx_yyy_ENTITY */
9016    int n_type;
9017    xmlChar * ExternalID; /* the entity external ID if available */
9018    int n_ExternalID;
9019    xmlChar * SystemID; /* the entity system ID if available */
9020    int n_SystemID;
9021    xmlChar * content; /* the entity content */
9022    int n_content;
9023
9024    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9025    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9026    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9027    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9028    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9029    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9030        mem_base = xmlMemBlocks();
9031        doc = gen_xmlDocPtr(n_doc, 0);
9032        name = gen_const_xmlChar_ptr(n_name, 1);
9033        type = gen_int(n_type, 2);
9034        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9035        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9036        content = gen_const_xmlChar_ptr(n_content, 5);
9037
9038        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9039        desret_xmlEntityPtr(ret_val);
9040        call_tests++;
9041        des_xmlDocPtr(n_doc, doc, 0);
9042        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9043        des_int(n_type, type, 2);
9044        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9045        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9046        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9047        xmlResetLastError();
9048        if (mem_base != xmlMemBlocks()) {
9049            printf("Leak of %d blocks found in xmlAddDtdEntity",
9050	           xmlMemBlocks() - mem_base);
9051	    test_ret++;
9052            printf(" %d", n_doc);
9053            printf(" %d", n_name);
9054            printf(" %d", n_type);
9055            printf(" %d", n_ExternalID);
9056            printf(" %d", n_SystemID);
9057            printf(" %d", n_content);
9058            printf("\n");
9059        }
9060    }
9061    }
9062    }
9063    }
9064    }
9065    }
9066    function_tests++;
9067
9068    return(test_ret);
9069}
9070
9071
9072static int
9073test_xmlCleanupPredefinedEntities(void) {
9074    int test_ret = 0;
9075
9076#ifdef LIBXML_LEGACY_ENABLED
9077    int mem_base;
9078
9079        mem_base = xmlMemBlocks();
9080
9081        xmlCleanupPredefinedEntities();
9082        call_tests++;
9083        xmlResetLastError();
9084        if (mem_base != xmlMemBlocks()) {
9085            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9086	           xmlMemBlocks() - mem_base);
9087	    test_ret++;
9088            printf("\n");
9089        }
9090    function_tests++;
9091#endif
9092
9093    return(test_ret);
9094}
9095
9096
9097#define gen_nb_xmlEntitiesTablePtr 1
9098static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9099    return(NULL);
9100}
9101static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9102}
9103
9104static int
9105test_xmlCopyEntitiesTable(void) {
9106    int test_ret = 0;
9107
9108
9109    /* missing type support */
9110    return(test_ret);
9111}
9112
9113
9114static int
9115test_xmlCreateEntitiesTable(void) {
9116    int test_ret = 0;
9117
9118
9119    /* missing type support */
9120    return(test_ret);
9121}
9122
9123
9124static int
9125test_xmlDumpEntitiesTable(void) {
9126    int test_ret = 0;
9127
9128#ifdef LIBXML_OUTPUT_ENABLED
9129    int mem_base;
9130    xmlBufferPtr buf; /* An XML buffer. */
9131    int n_buf;
9132    xmlEntitiesTablePtr table; /* An entity table */
9133    int n_table;
9134
9135    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9136    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9137        mem_base = xmlMemBlocks();
9138        buf = gen_xmlBufferPtr(n_buf, 0);
9139        table = gen_xmlEntitiesTablePtr(n_table, 1);
9140
9141        xmlDumpEntitiesTable(buf, table);
9142        call_tests++;
9143        des_xmlBufferPtr(n_buf, buf, 0);
9144        des_xmlEntitiesTablePtr(n_table, table, 1);
9145        xmlResetLastError();
9146        if (mem_base != xmlMemBlocks()) {
9147            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9148	           xmlMemBlocks() - mem_base);
9149	    test_ret++;
9150            printf(" %d", n_buf);
9151            printf(" %d", n_table);
9152            printf("\n");
9153        }
9154    }
9155    }
9156    function_tests++;
9157#endif
9158
9159    return(test_ret);
9160}
9161
9162
9163#define gen_nb_xmlEntityPtr 1
9164static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9165    return(NULL);
9166}
9167static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9168}
9169
9170static int
9171test_xmlDumpEntityDecl(void) {
9172    int test_ret = 0;
9173
9174#ifdef LIBXML_OUTPUT_ENABLED
9175    int mem_base;
9176    xmlBufferPtr buf; /* An XML buffer. */
9177    int n_buf;
9178    xmlEntityPtr ent; /* An entity table */
9179    int n_ent;
9180
9181    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9182    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9183        mem_base = xmlMemBlocks();
9184        buf = gen_xmlBufferPtr(n_buf, 0);
9185        ent = gen_xmlEntityPtr(n_ent, 1);
9186
9187        xmlDumpEntityDecl(buf, ent);
9188        call_tests++;
9189        des_xmlBufferPtr(n_buf, buf, 0);
9190        des_xmlEntityPtr(n_ent, ent, 1);
9191        xmlResetLastError();
9192        if (mem_base != xmlMemBlocks()) {
9193            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9194	           xmlMemBlocks() - mem_base);
9195	    test_ret++;
9196            printf(" %d", n_buf);
9197            printf(" %d", n_ent);
9198            printf("\n");
9199        }
9200    }
9201    }
9202    function_tests++;
9203#endif
9204
9205    return(test_ret);
9206}
9207
9208
9209static int
9210test_xmlEncodeEntitiesReentrant(void) {
9211    int test_ret = 0;
9212
9213    int mem_base;
9214    xmlChar * ret_val;
9215    xmlDocPtr doc; /* the document containing the string */
9216    int n_doc;
9217    xmlChar * input; /* A string to convert to XML. */
9218    int n_input;
9219
9220    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9221    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9222        mem_base = xmlMemBlocks();
9223        doc = gen_xmlDocPtr(n_doc, 0);
9224        input = gen_const_xmlChar_ptr(n_input, 1);
9225
9226        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9227        desret_xmlChar_ptr(ret_val);
9228        call_tests++;
9229        des_xmlDocPtr(n_doc, doc, 0);
9230        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9231        xmlResetLastError();
9232        if (mem_base != xmlMemBlocks()) {
9233            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9234	           xmlMemBlocks() - mem_base);
9235	    test_ret++;
9236            printf(" %d", n_doc);
9237            printf(" %d", n_input);
9238            printf("\n");
9239        }
9240    }
9241    }
9242    function_tests++;
9243
9244    return(test_ret);
9245}
9246
9247
9248static int
9249test_xmlEncodeSpecialChars(void) {
9250    int test_ret = 0;
9251
9252    int mem_base;
9253    xmlChar * ret_val;
9254    xmlDocPtr doc; /* the document containing the string */
9255    int n_doc;
9256    xmlChar * input; /* A string to convert to XML. */
9257    int n_input;
9258
9259    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9260    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9261        mem_base = xmlMemBlocks();
9262        doc = gen_xmlDocPtr(n_doc, 0);
9263        input = gen_const_xmlChar_ptr(n_input, 1);
9264
9265        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9266        desret_xmlChar_ptr(ret_val);
9267        call_tests++;
9268        des_xmlDocPtr(n_doc, doc, 0);
9269        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9270        xmlResetLastError();
9271        if (mem_base != xmlMemBlocks()) {
9272            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9273	           xmlMemBlocks() - mem_base);
9274	    test_ret++;
9275            printf(" %d", n_doc);
9276            printf(" %d", n_input);
9277            printf("\n");
9278        }
9279    }
9280    }
9281    function_tests++;
9282
9283    return(test_ret);
9284}
9285
9286
9287static int
9288test_xmlGetDocEntity(void) {
9289    int test_ret = 0;
9290
9291    int mem_base;
9292    xmlEntityPtr ret_val;
9293    xmlDocPtr doc; /* the document referencing the entity */
9294    int n_doc;
9295    xmlChar * name; /* the entity name */
9296    int n_name;
9297
9298    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9299    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9300        mem_base = xmlMemBlocks();
9301        doc = gen_xmlDocPtr(n_doc, 0);
9302        name = gen_const_xmlChar_ptr(n_name, 1);
9303
9304        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9305        desret_xmlEntityPtr(ret_val);
9306        call_tests++;
9307        des_xmlDocPtr(n_doc, doc, 0);
9308        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9309        xmlResetLastError();
9310        if (mem_base != xmlMemBlocks()) {
9311            printf("Leak of %d blocks found in xmlGetDocEntity",
9312	           xmlMemBlocks() - mem_base);
9313	    test_ret++;
9314            printf(" %d", n_doc);
9315            printf(" %d", n_name);
9316            printf("\n");
9317        }
9318    }
9319    }
9320    function_tests++;
9321
9322    return(test_ret);
9323}
9324
9325
9326static int
9327test_xmlGetDtdEntity(void) {
9328    int test_ret = 0;
9329
9330    int mem_base;
9331    xmlEntityPtr ret_val;
9332    xmlDocPtr doc; /* the document referencing the entity */
9333    int n_doc;
9334    xmlChar * name; /* the entity name */
9335    int n_name;
9336
9337    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9338    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9339        mem_base = xmlMemBlocks();
9340        doc = gen_xmlDocPtr(n_doc, 0);
9341        name = gen_const_xmlChar_ptr(n_name, 1);
9342
9343        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9344        desret_xmlEntityPtr(ret_val);
9345        call_tests++;
9346        des_xmlDocPtr(n_doc, doc, 0);
9347        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9348        xmlResetLastError();
9349        if (mem_base != xmlMemBlocks()) {
9350            printf("Leak of %d blocks found in xmlGetDtdEntity",
9351	           xmlMemBlocks() - mem_base);
9352	    test_ret++;
9353            printf(" %d", n_doc);
9354            printf(" %d", n_name);
9355            printf("\n");
9356        }
9357    }
9358    }
9359    function_tests++;
9360
9361    return(test_ret);
9362}
9363
9364
9365static int
9366test_xmlGetParameterEntity(void) {
9367    int test_ret = 0;
9368
9369    int mem_base;
9370    xmlEntityPtr ret_val;
9371    xmlDocPtr doc; /* the document referencing the entity */
9372    int n_doc;
9373    xmlChar * name; /* the entity name */
9374    int n_name;
9375
9376    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9377    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9378        mem_base = xmlMemBlocks();
9379        doc = gen_xmlDocPtr(n_doc, 0);
9380        name = gen_const_xmlChar_ptr(n_name, 1);
9381
9382        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9383        desret_xmlEntityPtr(ret_val);
9384        call_tests++;
9385        des_xmlDocPtr(n_doc, doc, 0);
9386        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9387        xmlResetLastError();
9388        if (mem_base != xmlMemBlocks()) {
9389            printf("Leak of %d blocks found in xmlGetParameterEntity",
9390	           xmlMemBlocks() - mem_base);
9391	    test_ret++;
9392            printf(" %d", n_doc);
9393            printf(" %d", n_name);
9394            printf("\n");
9395        }
9396    }
9397    }
9398    function_tests++;
9399
9400    return(test_ret);
9401}
9402
9403
9404static int
9405test_xmlGetPredefinedEntity(void) {
9406    int test_ret = 0;
9407
9408    int mem_base;
9409    xmlEntityPtr ret_val;
9410    xmlChar * name; /* the entity name */
9411    int n_name;
9412
9413    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9414        mem_base = xmlMemBlocks();
9415        name = gen_const_xmlChar_ptr(n_name, 0);
9416
9417        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9418        desret_xmlEntityPtr(ret_val);
9419        call_tests++;
9420        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9421        xmlResetLastError();
9422        if (mem_base != xmlMemBlocks()) {
9423            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9424	           xmlMemBlocks() - mem_base);
9425	    test_ret++;
9426            printf(" %d", n_name);
9427            printf("\n");
9428        }
9429    }
9430    function_tests++;
9431
9432    return(test_ret);
9433}
9434
9435
9436static int
9437test_xmlInitializePredefinedEntities(void) {
9438    int test_ret = 0;
9439
9440#ifdef LIBXML_LEGACY_ENABLED
9441    int mem_base;
9442
9443        mem_base = xmlMemBlocks();
9444
9445        xmlInitializePredefinedEntities();
9446        call_tests++;
9447        xmlResetLastError();
9448        if (mem_base != xmlMemBlocks()) {
9449            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9450	           xmlMemBlocks() - mem_base);
9451	    test_ret++;
9452            printf("\n");
9453        }
9454    function_tests++;
9455#endif
9456
9457    return(test_ret);
9458}
9459
9460static int
9461test_entities(void) {
9462    int test_ret = 0;
9463
9464    if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
9465    test_ret += test_xmlAddDocEntity();
9466    test_ret += test_xmlAddDtdEntity();
9467    test_ret += test_xmlCleanupPredefinedEntities();
9468    test_ret += test_xmlCopyEntitiesTable();
9469    test_ret += test_xmlCreateEntitiesTable();
9470    test_ret += test_xmlDumpEntitiesTable();
9471    test_ret += test_xmlDumpEntityDecl();
9472    test_ret += test_xmlEncodeEntitiesReentrant();
9473    test_ret += test_xmlEncodeSpecialChars();
9474    test_ret += test_xmlGetDocEntity();
9475    test_ret += test_xmlGetDtdEntity();
9476    test_ret += test_xmlGetParameterEntity();
9477    test_ret += test_xmlGetPredefinedEntity();
9478    test_ret += test_xmlInitializePredefinedEntities();
9479
9480    if (test_ret != 0)
9481	printf("Module entities: %d errors\n", test_ret);
9482    return(test_ret);
9483}
9484
9485static int
9486test_xmlHashAddEntry(void) {
9487    int test_ret = 0;
9488
9489    int mem_base;
9490    int ret_val;
9491    xmlHashTablePtr table; /* the hash table */
9492    int n_table;
9493    xmlChar * name; /* the name of the userdata */
9494    int n_name;
9495    void * userdata; /* a pointer to the userdata */
9496    int n_userdata;
9497
9498    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9499    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9500    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9501        mem_base = xmlMemBlocks();
9502        table = gen_xmlHashTablePtr(n_table, 0);
9503        name = gen_const_xmlChar_ptr(n_name, 1);
9504        userdata = gen_userdata(n_userdata, 2);
9505
9506        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9507        desret_int(ret_val);
9508        call_tests++;
9509        des_xmlHashTablePtr(n_table, table, 0);
9510        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9511        des_userdata(n_userdata, userdata, 2);
9512        xmlResetLastError();
9513        if (mem_base != xmlMemBlocks()) {
9514            printf("Leak of %d blocks found in xmlHashAddEntry",
9515	           xmlMemBlocks() - mem_base);
9516	    test_ret++;
9517            printf(" %d", n_table);
9518            printf(" %d", n_name);
9519            printf(" %d", n_userdata);
9520            printf("\n");
9521        }
9522    }
9523    }
9524    }
9525    function_tests++;
9526
9527    return(test_ret);
9528}
9529
9530
9531static int
9532test_xmlHashAddEntry2(void) {
9533    int test_ret = 0;
9534
9535    int mem_base;
9536    int ret_val;
9537    xmlHashTablePtr table; /* the hash table */
9538    int n_table;
9539    xmlChar * name; /* the name of the userdata */
9540    int n_name;
9541    xmlChar * name2; /* a second name of the userdata */
9542    int n_name2;
9543    void * userdata; /* a pointer to the userdata */
9544    int n_userdata;
9545
9546    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9547    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9548    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9549    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9550        mem_base = xmlMemBlocks();
9551        table = gen_xmlHashTablePtr(n_table, 0);
9552        name = gen_const_xmlChar_ptr(n_name, 1);
9553        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9554        userdata = gen_userdata(n_userdata, 3);
9555
9556        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9557        desret_int(ret_val);
9558        call_tests++;
9559        des_xmlHashTablePtr(n_table, table, 0);
9560        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9561        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9562        des_userdata(n_userdata, userdata, 3);
9563        xmlResetLastError();
9564        if (mem_base != xmlMemBlocks()) {
9565            printf("Leak of %d blocks found in xmlHashAddEntry2",
9566	           xmlMemBlocks() - mem_base);
9567	    test_ret++;
9568            printf(" %d", n_table);
9569            printf(" %d", n_name);
9570            printf(" %d", n_name2);
9571            printf(" %d", n_userdata);
9572            printf("\n");
9573        }
9574    }
9575    }
9576    }
9577    }
9578    function_tests++;
9579
9580    return(test_ret);
9581}
9582
9583
9584static int
9585test_xmlHashAddEntry3(void) {
9586    int test_ret = 0;
9587
9588    int mem_base;
9589    int ret_val;
9590    xmlHashTablePtr table; /* the hash table */
9591    int n_table;
9592    xmlChar * name; /* the name of the userdata */
9593    int n_name;
9594    xmlChar * name2; /* a second name of the userdata */
9595    int n_name2;
9596    xmlChar * name3; /* a third name of the userdata */
9597    int n_name3;
9598    void * userdata; /* a pointer to the userdata */
9599    int n_userdata;
9600
9601    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9602    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9603    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9604    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9605    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9606        mem_base = xmlMemBlocks();
9607        table = gen_xmlHashTablePtr(n_table, 0);
9608        name = gen_const_xmlChar_ptr(n_name, 1);
9609        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9610        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9611        userdata = gen_userdata(n_userdata, 4);
9612
9613        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9614        desret_int(ret_val);
9615        call_tests++;
9616        des_xmlHashTablePtr(n_table, table, 0);
9617        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9618        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9619        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9620        des_userdata(n_userdata, userdata, 4);
9621        xmlResetLastError();
9622        if (mem_base != xmlMemBlocks()) {
9623            printf("Leak of %d blocks found in xmlHashAddEntry3",
9624	           xmlMemBlocks() - mem_base);
9625	    test_ret++;
9626            printf(" %d", n_table);
9627            printf(" %d", n_name);
9628            printf(" %d", n_name2);
9629            printf(" %d", n_name3);
9630            printf(" %d", n_userdata);
9631            printf("\n");
9632        }
9633    }
9634    }
9635    }
9636    }
9637    }
9638    function_tests++;
9639
9640    return(test_ret);
9641}
9642
9643
9644static int
9645test_xmlHashCopy(void) {
9646    int test_ret = 0;
9647
9648
9649    /* missing type support */
9650    return(test_ret);
9651}
9652
9653
9654static int
9655test_xmlHashCreate(void) {
9656    int test_ret = 0;
9657
9658
9659    /* missing type support */
9660    return(test_ret);
9661}
9662
9663
9664static int
9665test_xmlHashLookup(void) {
9666    int test_ret = 0;
9667
9668    int mem_base;
9669    void * ret_val;
9670    xmlHashTablePtr table; /* the hash table */
9671    int n_table;
9672    xmlChar * name; /* the name of the userdata */
9673    int n_name;
9674
9675    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9676    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9677        mem_base = xmlMemBlocks();
9678        table = gen_xmlHashTablePtr(n_table, 0);
9679        name = gen_const_xmlChar_ptr(n_name, 1);
9680
9681        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9682        desret_void_ptr(ret_val);
9683        call_tests++;
9684        des_xmlHashTablePtr(n_table, table, 0);
9685        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9686        xmlResetLastError();
9687        if (mem_base != xmlMemBlocks()) {
9688            printf("Leak of %d blocks found in xmlHashLookup",
9689	           xmlMemBlocks() - mem_base);
9690	    test_ret++;
9691            printf(" %d", n_table);
9692            printf(" %d", n_name);
9693            printf("\n");
9694        }
9695    }
9696    }
9697    function_tests++;
9698
9699    return(test_ret);
9700}
9701
9702
9703static int
9704test_xmlHashLookup2(void) {
9705    int test_ret = 0;
9706
9707    int mem_base;
9708    void * ret_val;
9709    xmlHashTablePtr table; /* the hash table */
9710    int n_table;
9711    xmlChar * name; /* the name of the userdata */
9712    int n_name;
9713    xmlChar * name2; /* a second name of the userdata */
9714    int n_name2;
9715
9716    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9717    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9718    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9719        mem_base = xmlMemBlocks();
9720        table = gen_xmlHashTablePtr(n_table, 0);
9721        name = gen_const_xmlChar_ptr(n_name, 1);
9722        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9723
9724        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9725        desret_void_ptr(ret_val);
9726        call_tests++;
9727        des_xmlHashTablePtr(n_table, table, 0);
9728        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9729        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9730        xmlResetLastError();
9731        if (mem_base != xmlMemBlocks()) {
9732            printf("Leak of %d blocks found in xmlHashLookup2",
9733	           xmlMemBlocks() - mem_base);
9734	    test_ret++;
9735            printf(" %d", n_table);
9736            printf(" %d", n_name);
9737            printf(" %d", n_name2);
9738            printf("\n");
9739        }
9740    }
9741    }
9742    }
9743    function_tests++;
9744
9745    return(test_ret);
9746}
9747
9748
9749static int
9750test_xmlHashLookup3(void) {
9751    int test_ret = 0;
9752
9753    int mem_base;
9754    void * ret_val;
9755    xmlHashTablePtr table; /* the hash table */
9756    int n_table;
9757    xmlChar * name; /* the name of the userdata */
9758    int n_name;
9759    xmlChar * name2; /* a second name of the userdata */
9760    int n_name2;
9761    xmlChar * name3; /* a third name of the userdata */
9762    int n_name3;
9763
9764    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9765    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9766    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9767    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9768        mem_base = xmlMemBlocks();
9769        table = gen_xmlHashTablePtr(n_table, 0);
9770        name = gen_const_xmlChar_ptr(n_name, 1);
9771        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9772        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9773
9774        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
9775        desret_void_ptr(ret_val);
9776        call_tests++;
9777        des_xmlHashTablePtr(n_table, table, 0);
9778        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9779        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9780        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9781        xmlResetLastError();
9782        if (mem_base != xmlMemBlocks()) {
9783            printf("Leak of %d blocks found in xmlHashLookup3",
9784	           xmlMemBlocks() - mem_base);
9785	    test_ret++;
9786            printf(" %d", n_table);
9787            printf(" %d", n_name);
9788            printf(" %d", n_name2);
9789            printf(" %d", n_name3);
9790            printf("\n");
9791        }
9792    }
9793    }
9794    }
9795    }
9796    function_tests++;
9797
9798    return(test_ret);
9799}
9800
9801
9802static int
9803test_xmlHashQLookup(void) {
9804    int test_ret = 0;
9805
9806    int mem_base;
9807    void * ret_val;
9808    xmlHashTablePtr table; /* the hash table */
9809    int n_table;
9810    xmlChar * prefix; /* the prefix of the userdata */
9811    int n_prefix;
9812    xmlChar * name; /* the name of the userdata */
9813    int n_name;
9814
9815    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9816    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9817    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9818        mem_base = xmlMemBlocks();
9819        table = gen_xmlHashTablePtr(n_table, 0);
9820        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9821        name = gen_const_xmlChar_ptr(n_name, 2);
9822
9823        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
9824        desret_void_ptr(ret_val);
9825        call_tests++;
9826        des_xmlHashTablePtr(n_table, table, 0);
9827        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9828        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9829        xmlResetLastError();
9830        if (mem_base != xmlMemBlocks()) {
9831            printf("Leak of %d blocks found in xmlHashQLookup",
9832	           xmlMemBlocks() - mem_base);
9833	    test_ret++;
9834            printf(" %d", n_table);
9835            printf(" %d", n_prefix);
9836            printf(" %d", n_name);
9837            printf("\n");
9838        }
9839    }
9840    }
9841    }
9842    function_tests++;
9843
9844    return(test_ret);
9845}
9846
9847
9848static int
9849test_xmlHashQLookup2(void) {
9850    int test_ret = 0;
9851
9852    int mem_base;
9853    void * ret_val;
9854    xmlHashTablePtr table; /* the hash table */
9855    int n_table;
9856    xmlChar * prefix; /* the prefix of the userdata */
9857    int n_prefix;
9858    xmlChar * name; /* the name of the userdata */
9859    int n_name;
9860    xmlChar * prefix2; /* the second prefix of the userdata */
9861    int n_prefix2;
9862    xmlChar * name2; /* a second name of the userdata */
9863    int n_name2;
9864
9865    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9866    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9867    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9868    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9869    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9870        mem_base = xmlMemBlocks();
9871        table = gen_xmlHashTablePtr(n_table, 0);
9872        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9873        name = gen_const_xmlChar_ptr(n_name, 2);
9874        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9875        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9876
9877        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
9878        desret_void_ptr(ret_val);
9879        call_tests++;
9880        des_xmlHashTablePtr(n_table, table, 0);
9881        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9882        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9883        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9884        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9885        xmlResetLastError();
9886        if (mem_base != xmlMemBlocks()) {
9887            printf("Leak of %d blocks found in xmlHashQLookup2",
9888	           xmlMemBlocks() - mem_base);
9889	    test_ret++;
9890            printf(" %d", n_table);
9891            printf(" %d", n_prefix);
9892            printf(" %d", n_name);
9893            printf(" %d", n_prefix2);
9894            printf(" %d", n_name2);
9895            printf("\n");
9896        }
9897    }
9898    }
9899    }
9900    }
9901    }
9902    function_tests++;
9903
9904    return(test_ret);
9905}
9906
9907
9908static int
9909test_xmlHashQLookup3(void) {
9910    int test_ret = 0;
9911
9912    int mem_base;
9913    void * ret_val;
9914    xmlHashTablePtr table; /* the hash table */
9915    int n_table;
9916    xmlChar * prefix; /* the prefix of the userdata */
9917    int n_prefix;
9918    xmlChar * name; /* the name of the userdata */
9919    int n_name;
9920    xmlChar * prefix2; /* the second prefix of the userdata */
9921    int n_prefix2;
9922    xmlChar * name2; /* a second name of the userdata */
9923    int n_name2;
9924    xmlChar * prefix3; /* the third prefix of the userdata */
9925    int n_prefix3;
9926    xmlChar * name3; /* a third name of the userdata */
9927    int n_name3;
9928
9929    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9930    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9931    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9932    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
9933    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9934    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
9935    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9936        mem_base = xmlMemBlocks();
9937        table = gen_xmlHashTablePtr(n_table, 0);
9938        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9939        name = gen_const_xmlChar_ptr(n_name, 2);
9940        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
9941        name2 = gen_const_xmlChar_ptr(n_name2, 4);
9942        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
9943        name3 = gen_const_xmlChar_ptr(n_name3, 6);
9944
9945        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
9946        desret_void_ptr(ret_val);
9947        call_tests++;
9948        des_xmlHashTablePtr(n_table, table, 0);
9949        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9950        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9951        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
9952        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
9953        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
9954        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
9955        xmlResetLastError();
9956        if (mem_base != xmlMemBlocks()) {
9957            printf("Leak of %d blocks found in xmlHashQLookup3",
9958	           xmlMemBlocks() - mem_base);
9959	    test_ret++;
9960            printf(" %d", n_table);
9961            printf(" %d", n_prefix);
9962            printf(" %d", n_name);
9963            printf(" %d", n_prefix2);
9964            printf(" %d", n_name2);
9965            printf(" %d", n_prefix3);
9966            printf(" %d", n_name3);
9967            printf("\n");
9968        }
9969    }
9970    }
9971    }
9972    }
9973    }
9974    }
9975    }
9976    function_tests++;
9977
9978    return(test_ret);
9979}
9980
9981
9982static int
9983test_xmlHashRemoveEntry(void) {
9984    int test_ret = 0;
9985
9986    int mem_base;
9987    int ret_val;
9988    xmlHashTablePtr table; /* the hash table */
9989    int n_table;
9990    xmlChar * name; /* the name of the userdata */
9991    int n_name;
9992    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
9993    int n_f;
9994
9995    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9996    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9997    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
9998        mem_base = xmlMemBlocks();
9999        table = gen_xmlHashTablePtr(n_table, 0);
10000        name = gen_const_xmlChar_ptr(n_name, 1);
10001        f = gen_xmlHashDeallocator(n_f, 2);
10002
10003        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10004        desret_int(ret_val);
10005        call_tests++;
10006        des_xmlHashTablePtr(n_table, table, 0);
10007        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10008        des_xmlHashDeallocator(n_f, f, 2);
10009        xmlResetLastError();
10010        if (mem_base != xmlMemBlocks()) {
10011            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10012	           xmlMemBlocks() - mem_base);
10013	    test_ret++;
10014            printf(" %d", n_table);
10015            printf(" %d", n_name);
10016            printf(" %d", n_f);
10017            printf("\n");
10018        }
10019    }
10020    }
10021    }
10022    function_tests++;
10023
10024    return(test_ret);
10025}
10026
10027
10028static int
10029test_xmlHashRemoveEntry2(void) {
10030    int test_ret = 0;
10031
10032    int mem_base;
10033    int ret_val;
10034    xmlHashTablePtr table; /* the hash table */
10035    int n_table;
10036    xmlChar * name; /* the name of the userdata */
10037    int n_name;
10038    xmlChar * name2; /* a second name of the userdata */
10039    int n_name2;
10040    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10041    int n_f;
10042
10043    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10044    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10045    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10046    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10047        mem_base = xmlMemBlocks();
10048        table = gen_xmlHashTablePtr(n_table, 0);
10049        name = gen_const_xmlChar_ptr(n_name, 1);
10050        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10051        f = gen_xmlHashDeallocator(n_f, 3);
10052
10053        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10054        desret_int(ret_val);
10055        call_tests++;
10056        des_xmlHashTablePtr(n_table, table, 0);
10057        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10058        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10059        des_xmlHashDeallocator(n_f, f, 3);
10060        xmlResetLastError();
10061        if (mem_base != xmlMemBlocks()) {
10062            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10063	           xmlMemBlocks() - mem_base);
10064	    test_ret++;
10065            printf(" %d", n_table);
10066            printf(" %d", n_name);
10067            printf(" %d", n_name2);
10068            printf(" %d", n_f);
10069            printf("\n");
10070        }
10071    }
10072    }
10073    }
10074    }
10075    function_tests++;
10076
10077    return(test_ret);
10078}
10079
10080
10081static int
10082test_xmlHashRemoveEntry3(void) {
10083    int test_ret = 0;
10084
10085    int mem_base;
10086    int ret_val;
10087    xmlHashTablePtr table; /* the hash table */
10088    int n_table;
10089    xmlChar * name; /* the name of the userdata */
10090    int n_name;
10091    xmlChar * name2; /* a second name of the userdata */
10092    int n_name2;
10093    xmlChar * name3; /* a third name of the userdata */
10094    int n_name3;
10095    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10096    int n_f;
10097
10098    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10099    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10100    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10101    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10102    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10103        mem_base = xmlMemBlocks();
10104        table = gen_xmlHashTablePtr(n_table, 0);
10105        name = gen_const_xmlChar_ptr(n_name, 1);
10106        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10107        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10108        f = gen_xmlHashDeallocator(n_f, 4);
10109
10110        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10111        desret_int(ret_val);
10112        call_tests++;
10113        des_xmlHashTablePtr(n_table, table, 0);
10114        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10115        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10116        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10117        des_xmlHashDeallocator(n_f, f, 4);
10118        xmlResetLastError();
10119        if (mem_base != xmlMemBlocks()) {
10120            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10121	           xmlMemBlocks() - mem_base);
10122	    test_ret++;
10123            printf(" %d", n_table);
10124            printf(" %d", n_name);
10125            printf(" %d", n_name2);
10126            printf(" %d", n_name3);
10127            printf(" %d", n_f);
10128            printf("\n");
10129        }
10130    }
10131    }
10132    }
10133    }
10134    }
10135    function_tests++;
10136
10137    return(test_ret);
10138}
10139
10140
10141static int
10142test_xmlHashScan(void) {
10143    int test_ret = 0;
10144
10145
10146    /* missing type support */
10147    return(test_ret);
10148}
10149
10150
10151static int
10152test_xmlHashScan3(void) {
10153    int test_ret = 0;
10154
10155
10156    /* missing type support */
10157    return(test_ret);
10158}
10159
10160
10161static int
10162test_xmlHashScanFull(void) {
10163    int test_ret = 0;
10164
10165
10166    /* missing type support */
10167    return(test_ret);
10168}
10169
10170
10171static int
10172test_xmlHashScanFull3(void) {
10173    int test_ret = 0;
10174
10175
10176    /* missing type support */
10177    return(test_ret);
10178}
10179
10180
10181static int
10182test_xmlHashSize(void) {
10183    int test_ret = 0;
10184
10185    int mem_base;
10186    int ret_val;
10187    xmlHashTablePtr table; /* the hash table */
10188    int n_table;
10189
10190    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10191        mem_base = xmlMemBlocks();
10192        table = gen_xmlHashTablePtr(n_table, 0);
10193
10194        ret_val = xmlHashSize(table);
10195        desret_int(ret_val);
10196        call_tests++;
10197        des_xmlHashTablePtr(n_table, table, 0);
10198        xmlResetLastError();
10199        if (mem_base != xmlMemBlocks()) {
10200            printf("Leak of %d blocks found in xmlHashSize",
10201	           xmlMemBlocks() - mem_base);
10202	    test_ret++;
10203            printf(" %d", n_table);
10204            printf("\n");
10205        }
10206    }
10207    function_tests++;
10208
10209    return(test_ret);
10210}
10211
10212
10213static int
10214test_xmlHashUpdateEntry(void) {
10215    int test_ret = 0;
10216
10217    int mem_base;
10218    int ret_val;
10219    xmlHashTablePtr table; /* the hash table */
10220    int n_table;
10221    xmlChar * name; /* the name of the userdata */
10222    int n_name;
10223    void * userdata; /* a pointer to the userdata */
10224    int n_userdata;
10225    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10226    int n_f;
10227
10228    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10229    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10230    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10231    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10232        mem_base = xmlMemBlocks();
10233        table = gen_xmlHashTablePtr(n_table, 0);
10234        name = gen_const_xmlChar_ptr(n_name, 1);
10235        userdata = gen_userdata(n_userdata, 2);
10236        f = gen_xmlHashDeallocator(n_f, 3);
10237
10238        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10239        desret_int(ret_val);
10240        call_tests++;
10241        des_xmlHashTablePtr(n_table, table, 0);
10242        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10243        des_userdata(n_userdata, userdata, 2);
10244        des_xmlHashDeallocator(n_f, f, 3);
10245        xmlResetLastError();
10246        if (mem_base != xmlMemBlocks()) {
10247            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10248	           xmlMemBlocks() - mem_base);
10249	    test_ret++;
10250            printf(" %d", n_table);
10251            printf(" %d", n_name);
10252            printf(" %d", n_userdata);
10253            printf(" %d", n_f);
10254            printf("\n");
10255        }
10256    }
10257    }
10258    }
10259    }
10260    function_tests++;
10261
10262    return(test_ret);
10263}
10264
10265
10266static int
10267test_xmlHashUpdateEntry2(void) {
10268    int test_ret = 0;
10269
10270    int mem_base;
10271    int ret_val;
10272    xmlHashTablePtr table; /* the hash table */
10273    int n_table;
10274    xmlChar * name; /* the name of the userdata */
10275    int n_name;
10276    xmlChar * name2; /* a second name of the userdata */
10277    int n_name2;
10278    void * userdata; /* a pointer to the userdata */
10279    int n_userdata;
10280    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10281    int n_f;
10282
10283    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10284    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10285    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10286    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10287    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10288        mem_base = xmlMemBlocks();
10289        table = gen_xmlHashTablePtr(n_table, 0);
10290        name = gen_const_xmlChar_ptr(n_name, 1);
10291        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10292        userdata = gen_userdata(n_userdata, 3);
10293        f = gen_xmlHashDeallocator(n_f, 4);
10294
10295        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10296        desret_int(ret_val);
10297        call_tests++;
10298        des_xmlHashTablePtr(n_table, table, 0);
10299        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10300        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10301        des_userdata(n_userdata, userdata, 3);
10302        des_xmlHashDeallocator(n_f, f, 4);
10303        xmlResetLastError();
10304        if (mem_base != xmlMemBlocks()) {
10305            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10306	           xmlMemBlocks() - mem_base);
10307	    test_ret++;
10308            printf(" %d", n_table);
10309            printf(" %d", n_name);
10310            printf(" %d", n_name2);
10311            printf(" %d", n_userdata);
10312            printf(" %d", n_f);
10313            printf("\n");
10314        }
10315    }
10316    }
10317    }
10318    }
10319    }
10320    function_tests++;
10321
10322    return(test_ret);
10323}
10324
10325
10326static int
10327test_xmlHashUpdateEntry3(void) {
10328    int test_ret = 0;
10329
10330    int mem_base;
10331    int ret_val;
10332    xmlHashTablePtr table; /* the hash table */
10333    int n_table;
10334    xmlChar * name; /* the name of the userdata */
10335    int n_name;
10336    xmlChar * name2; /* a second name of the userdata */
10337    int n_name2;
10338    xmlChar * name3; /* a third name of the userdata */
10339    int n_name3;
10340    void * userdata; /* a pointer to the userdata */
10341    int n_userdata;
10342    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10343    int n_f;
10344
10345    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10346    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10347    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10348    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10349    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10350    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10351        mem_base = xmlMemBlocks();
10352        table = gen_xmlHashTablePtr(n_table, 0);
10353        name = gen_const_xmlChar_ptr(n_name, 1);
10354        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10355        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10356        userdata = gen_userdata(n_userdata, 4);
10357        f = gen_xmlHashDeallocator(n_f, 5);
10358
10359        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10360        desret_int(ret_val);
10361        call_tests++;
10362        des_xmlHashTablePtr(n_table, table, 0);
10363        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10364        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10365        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10366        des_userdata(n_userdata, userdata, 4);
10367        des_xmlHashDeallocator(n_f, f, 5);
10368        xmlResetLastError();
10369        if (mem_base != xmlMemBlocks()) {
10370            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10371	           xmlMemBlocks() - mem_base);
10372	    test_ret++;
10373            printf(" %d", n_table);
10374            printf(" %d", n_name);
10375            printf(" %d", n_name2);
10376            printf(" %d", n_name3);
10377            printf(" %d", n_userdata);
10378            printf(" %d", n_f);
10379            printf("\n");
10380        }
10381    }
10382    }
10383    }
10384    }
10385    }
10386    }
10387    function_tests++;
10388
10389    return(test_ret);
10390}
10391
10392static int
10393test_hash(void) {
10394    int test_ret = 0;
10395
10396    if (quiet == 0) printf("Testing hash : 16 of 23 functions ...\n");
10397    test_ret += test_xmlHashAddEntry();
10398    test_ret += test_xmlHashAddEntry2();
10399    test_ret += test_xmlHashAddEntry3();
10400    test_ret += test_xmlHashCopy();
10401    test_ret += test_xmlHashCreate();
10402    test_ret += test_xmlHashLookup();
10403    test_ret += test_xmlHashLookup2();
10404    test_ret += test_xmlHashLookup3();
10405    test_ret += test_xmlHashQLookup();
10406    test_ret += test_xmlHashQLookup2();
10407    test_ret += test_xmlHashQLookup3();
10408    test_ret += test_xmlHashRemoveEntry();
10409    test_ret += test_xmlHashRemoveEntry2();
10410    test_ret += test_xmlHashRemoveEntry3();
10411    test_ret += test_xmlHashScan();
10412    test_ret += test_xmlHashScan3();
10413    test_ret += test_xmlHashScanFull();
10414    test_ret += test_xmlHashScanFull3();
10415    test_ret += test_xmlHashSize();
10416    test_ret += test_xmlHashUpdateEntry();
10417    test_ret += test_xmlHashUpdateEntry2();
10418    test_ret += test_xmlHashUpdateEntry3();
10419
10420    if (test_ret != 0)
10421	printf("Module hash: %d errors\n", test_ret);
10422    return(test_ret);
10423}
10424
10425#define gen_nb_xmlLinkPtr 1
10426static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10427    return(NULL);
10428}
10429static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10430}
10431
10432static int
10433test_xmlLinkGetData(void) {
10434    int test_ret = 0;
10435
10436    int mem_base;
10437    void * ret_val;
10438    xmlLinkPtr lk; /* a link */
10439    int n_lk;
10440
10441    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10442        mem_base = xmlMemBlocks();
10443        lk = gen_xmlLinkPtr(n_lk, 0);
10444
10445        ret_val = xmlLinkGetData(lk);
10446        desret_void_ptr(ret_val);
10447        call_tests++;
10448        des_xmlLinkPtr(n_lk, lk, 0);
10449        xmlResetLastError();
10450        if (mem_base != xmlMemBlocks()) {
10451            printf("Leak of %d blocks found in xmlLinkGetData",
10452	           xmlMemBlocks() - mem_base);
10453	    test_ret++;
10454            printf(" %d", n_lk);
10455            printf("\n");
10456        }
10457    }
10458    function_tests++;
10459
10460    return(test_ret);
10461}
10462
10463
10464static int
10465test_xmlListAppend(void) {
10466    int test_ret = 0;
10467
10468    int mem_base;
10469    int ret_val;
10470    xmlListPtr l; /* a list */
10471    int n_l;
10472    void * data; /* the data */
10473    int n_data;
10474
10475    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10476    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10477        mem_base = xmlMemBlocks();
10478        l = gen_xmlListPtr(n_l, 0);
10479        data = gen_userdata(n_data, 1);
10480
10481        ret_val = xmlListAppend(l, data);
10482        desret_int(ret_val);
10483        call_tests++;
10484        des_xmlListPtr(n_l, l, 0);
10485        des_userdata(n_data, data, 1);
10486        xmlResetLastError();
10487        if (mem_base != xmlMemBlocks()) {
10488            printf("Leak of %d blocks found in xmlListAppend",
10489	           xmlMemBlocks() - mem_base);
10490	    test_ret++;
10491            printf(" %d", n_l);
10492            printf(" %d", n_data);
10493            printf("\n");
10494        }
10495    }
10496    }
10497    function_tests++;
10498
10499    return(test_ret);
10500}
10501
10502
10503static int
10504test_xmlListClear(void) {
10505    int test_ret = 0;
10506
10507    int mem_base;
10508    xmlListPtr l; /* a list */
10509    int n_l;
10510
10511    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10512        mem_base = xmlMemBlocks();
10513        l = gen_xmlListPtr(n_l, 0);
10514
10515        xmlListClear(l);
10516        call_tests++;
10517        des_xmlListPtr(n_l, l, 0);
10518        xmlResetLastError();
10519        if (mem_base != xmlMemBlocks()) {
10520            printf("Leak of %d blocks found in xmlListClear",
10521	           xmlMemBlocks() - mem_base);
10522	    test_ret++;
10523            printf(" %d", n_l);
10524            printf("\n");
10525        }
10526    }
10527    function_tests++;
10528
10529    return(test_ret);
10530}
10531
10532
10533#define gen_nb_const_xmlListPtr 1
10534static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10535    return(NULL);
10536}
10537static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10538}
10539
10540static int
10541test_xmlListCopy(void) {
10542    int test_ret = 0;
10543
10544    int mem_base;
10545    int ret_val;
10546    xmlListPtr cur; /* the new list */
10547    int n_cur;
10548    xmlListPtr old; /* the old list */
10549    int n_old;
10550
10551    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10552    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10553        mem_base = xmlMemBlocks();
10554        cur = gen_xmlListPtr(n_cur, 0);
10555        old = gen_const_xmlListPtr(n_old, 1);
10556
10557        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10558        desret_int(ret_val);
10559        call_tests++;
10560        des_xmlListPtr(n_cur, cur, 0);
10561        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10562        xmlResetLastError();
10563        if (mem_base != xmlMemBlocks()) {
10564            printf("Leak of %d blocks found in xmlListCopy",
10565	           xmlMemBlocks() - mem_base);
10566	    test_ret++;
10567            printf(" %d", n_cur);
10568            printf(" %d", n_old);
10569            printf("\n");
10570        }
10571    }
10572    }
10573    function_tests++;
10574
10575    return(test_ret);
10576}
10577
10578
10579static int
10580test_xmlListCreate(void) {
10581    int test_ret = 0;
10582
10583
10584    /* missing type support */
10585    return(test_ret);
10586}
10587
10588
10589static int
10590test_xmlListDup(void) {
10591    int test_ret = 0;
10592
10593
10594    /* missing type support */
10595    return(test_ret);
10596}
10597
10598
10599static int
10600test_xmlListEmpty(void) {
10601    int test_ret = 0;
10602
10603    int mem_base;
10604    int ret_val;
10605    xmlListPtr l; /* a list */
10606    int n_l;
10607
10608    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10609        mem_base = xmlMemBlocks();
10610        l = gen_xmlListPtr(n_l, 0);
10611
10612        ret_val = xmlListEmpty(l);
10613        desret_int(ret_val);
10614        call_tests++;
10615        des_xmlListPtr(n_l, l, 0);
10616        xmlResetLastError();
10617        if (mem_base != xmlMemBlocks()) {
10618            printf("Leak of %d blocks found in xmlListEmpty",
10619	           xmlMemBlocks() - mem_base);
10620	    test_ret++;
10621            printf(" %d", n_l);
10622            printf("\n");
10623        }
10624    }
10625    function_tests++;
10626
10627    return(test_ret);
10628}
10629
10630
10631static int
10632test_xmlListEnd(void) {
10633    int test_ret = 0;
10634
10635
10636    /* missing type support */
10637    return(test_ret);
10638}
10639
10640
10641static int
10642test_xmlListFront(void) {
10643    int test_ret = 0;
10644
10645
10646    /* missing type support */
10647    return(test_ret);
10648}
10649
10650
10651static int
10652test_xmlListInsert(void) {
10653    int test_ret = 0;
10654
10655    int mem_base;
10656    int ret_val;
10657    xmlListPtr l; /* a list */
10658    int n_l;
10659    void * data; /* the data */
10660    int n_data;
10661
10662    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10663    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10664        mem_base = xmlMemBlocks();
10665        l = gen_xmlListPtr(n_l, 0);
10666        data = gen_userdata(n_data, 1);
10667
10668        ret_val = xmlListInsert(l, data);
10669        desret_int(ret_val);
10670        call_tests++;
10671        des_xmlListPtr(n_l, l, 0);
10672        des_userdata(n_data, data, 1);
10673        xmlResetLastError();
10674        if (mem_base != xmlMemBlocks()) {
10675            printf("Leak of %d blocks found in xmlListInsert",
10676	           xmlMemBlocks() - mem_base);
10677	    test_ret++;
10678            printf(" %d", n_l);
10679            printf(" %d", n_data);
10680            printf("\n");
10681        }
10682    }
10683    }
10684    function_tests++;
10685
10686    return(test_ret);
10687}
10688
10689
10690static int
10691test_xmlListMerge(void) {
10692    int test_ret = 0;
10693
10694    int mem_base;
10695    xmlListPtr l1; /* the original list */
10696    int n_l1;
10697    xmlListPtr l2; /* the new list */
10698    int n_l2;
10699
10700    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10701    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10702        mem_base = xmlMemBlocks();
10703        l1 = gen_xmlListPtr(n_l1, 0);
10704        l2 = gen_xmlListPtr(n_l2, 1);
10705
10706        xmlListMerge(l1, l2);
10707        call_tests++;
10708        des_xmlListPtr(n_l1, l1, 0);
10709        des_xmlListPtr(n_l2, l2, 1);
10710        xmlResetLastError();
10711        if (mem_base != xmlMemBlocks()) {
10712            printf("Leak of %d blocks found in xmlListMerge",
10713	           xmlMemBlocks() - mem_base);
10714	    test_ret++;
10715            printf(" %d", n_l1);
10716            printf(" %d", n_l2);
10717            printf("\n");
10718        }
10719    }
10720    }
10721    function_tests++;
10722
10723    return(test_ret);
10724}
10725
10726
10727static int
10728test_xmlListPopBack(void) {
10729    int test_ret = 0;
10730
10731    int mem_base;
10732    xmlListPtr l; /* a list */
10733    int n_l;
10734
10735    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10736        mem_base = xmlMemBlocks();
10737        l = gen_xmlListPtr(n_l, 0);
10738
10739        xmlListPopBack(l);
10740        call_tests++;
10741        des_xmlListPtr(n_l, l, 0);
10742        xmlResetLastError();
10743        if (mem_base != xmlMemBlocks()) {
10744            printf("Leak of %d blocks found in xmlListPopBack",
10745	           xmlMemBlocks() - mem_base);
10746	    test_ret++;
10747            printf(" %d", n_l);
10748            printf("\n");
10749        }
10750    }
10751    function_tests++;
10752
10753    return(test_ret);
10754}
10755
10756
10757static int
10758test_xmlListPopFront(void) {
10759    int test_ret = 0;
10760
10761    int mem_base;
10762    xmlListPtr l; /* a list */
10763    int n_l;
10764
10765    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10766        mem_base = xmlMemBlocks();
10767        l = gen_xmlListPtr(n_l, 0);
10768
10769        xmlListPopFront(l);
10770        call_tests++;
10771        des_xmlListPtr(n_l, l, 0);
10772        xmlResetLastError();
10773        if (mem_base != xmlMemBlocks()) {
10774            printf("Leak of %d blocks found in xmlListPopFront",
10775	           xmlMemBlocks() - mem_base);
10776	    test_ret++;
10777            printf(" %d", n_l);
10778            printf("\n");
10779        }
10780    }
10781    function_tests++;
10782
10783    return(test_ret);
10784}
10785
10786
10787static int
10788test_xmlListPushBack(void) {
10789    int test_ret = 0;
10790
10791    int mem_base;
10792    int ret_val;
10793    xmlListPtr l; /* a list */
10794    int n_l;
10795    void * data; /* new data */
10796    int n_data;
10797
10798    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10799    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10800        mem_base = xmlMemBlocks();
10801        l = gen_xmlListPtr(n_l, 0);
10802        data = gen_userdata(n_data, 1);
10803
10804        ret_val = xmlListPushBack(l, data);
10805        desret_int(ret_val);
10806        call_tests++;
10807        des_xmlListPtr(n_l, l, 0);
10808        des_userdata(n_data, data, 1);
10809        xmlResetLastError();
10810        if (mem_base != xmlMemBlocks()) {
10811            printf("Leak of %d blocks found in xmlListPushBack",
10812	           xmlMemBlocks() - mem_base);
10813	    test_ret++;
10814            printf(" %d", n_l);
10815            printf(" %d", n_data);
10816            printf("\n");
10817        }
10818    }
10819    }
10820    function_tests++;
10821
10822    return(test_ret);
10823}
10824
10825
10826static int
10827test_xmlListPushFront(void) {
10828    int test_ret = 0;
10829
10830    int mem_base;
10831    int ret_val;
10832    xmlListPtr l; /* a list */
10833    int n_l;
10834    void * data; /* new data */
10835    int n_data;
10836
10837    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10838    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10839        mem_base = xmlMemBlocks();
10840        l = gen_xmlListPtr(n_l, 0);
10841        data = gen_userdata(n_data, 1);
10842
10843        ret_val = xmlListPushFront(l, data);
10844        desret_int(ret_val);
10845        call_tests++;
10846        des_xmlListPtr(n_l, l, 0);
10847        des_userdata(n_data, data, 1);
10848        xmlResetLastError();
10849        if (mem_base != xmlMemBlocks()) {
10850            printf("Leak of %d blocks found in xmlListPushFront",
10851	           xmlMemBlocks() - mem_base);
10852	    test_ret++;
10853            printf(" %d", n_l);
10854            printf(" %d", n_data);
10855            printf("\n");
10856        }
10857    }
10858    }
10859    function_tests++;
10860
10861    return(test_ret);
10862}
10863
10864
10865static int
10866test_xmlListRemoveAll(void) {
10867    int test_ret = 0;
10868
10869    int mem_base;
10870    int ret_val;
10871    xmlListPtr l; /* a list */
10872    int n_l;
10873    void * data; /* list data */
10874    int n_data;
10875
10876    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10877    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10878        mem_base = xmlMemBlocks();
10879        l = gen_xmlListPtr(n_l, 0);
10880        data = gen_userdata(n_data, 1);
10881
10882        ret_val = xmlListRemoveAll(l, data);
10883        desret_int(ret_val);
10884        call_tests++;
10885        des_xmlListPtr(n_l, l, 0);
10886        des_userdata(n_data, data, 1);
10887        xmlResetLastError();
10888        if (mem_base != xmlMemBlocks()) {
10889            printf("Leak of %d blocks found in xmlListRemoveAll",
10890	           xmlMemBlocks() - mem_base);
10891	    test_ret++;
10892            printf(" %d", n_l);
10893            printf(" %d", n_data);
10894            printf("\n");
10895        }
10896    }
10897    }
10898    function_tests++;
10899
10900    return(test_ret);
10901}
10902
10903
10904static int
10905test_xmlListRemoveFirst(void) {
10906    int test_ret = 0;
10907
10908    int mem_base;
10909    int ret_val;
10910    xmlListPtr l; /* a list */
10911    int n_l;
10912    void * data; /* list data */
10913    int n_data;
10914
10915    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10916    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10917        mem_base = xmlMemBlocks();
10918        l = gen_xmlListPtr(n_l, 0);
10919        data = gen_userdata(n_data, 1);
10920
10921        ret_val = xmlListRemoveFirst(l, data);
10922        desret_int(ret_val);
10923        call_tests++;
10924        des_xmlListPtr(n_l, l, 0);
10925        des_userdata(n_data, data, 1);
10926        xmlResetLastError();
10927        if (mem_base != xmlMemBlocks()) {
10928            printf("Leak of %d blocks found in xmlListRemoveFirst",
10929	           xmlMemBlocks() - mem_base);
10930	    test_ret++;
10931            printf(" %d", n_l);
10932            printf(" %d", n_data);
10933            printf("\n");
10934        }
10935    }
10936    }
10937    function_tests++;
10938
10939    return(test_ret);
10940}
10941
10942
10943static int
10944test_xmlListRemoveLast(void) {
10945    int test_ret = 0;
10946
10947    int mem_base;
10948    int ret_val;
10949    xmlListPtr l; /* a list */
10950    int n_l;
10951    void * data; /* list data */
10952    int n_data;
10953
10954    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10955    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10956        mem_base = xmlMemBlocks();
10957        l = gen_xmlListPtr(n_l, 0);
10958        data = gen_userdata(n_data, 1);
10959
10960        ret_val = xmlListRemoveLast(l, data);
10961        desret_int(ret_val);
10962        call_tests++;
10963        des_xmlListPtr(n_l, l, 0);
10964        des_userdata(n_data, data, 1);
10965        xmlResetLastError();
10966        if (mem_base != xmlMemBlocks()) {
10967            printf("Leak of %d blocks found in xmlListRemoveLast",
10968	           xmlMemBlocks() - mem_base);
10969	    test_ret++;
10970            printf(" %d", n_l);
10971            printf(" %d", n_data);
10972            printf("\n");
10973        }
10974    }
10975    }
10976    function_tests++;
10977
10978    return(test_ret);
10979}
10980
10981
10982static int
10983test_xmlListReverse(void) {
10984    int test_ret = 0;
10985
10986    int mem_base;
10987    xmlListPtr l; /* a list */
10988    int n_l;
10989
10990    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10991        mem_base = xmlMemBlocks();
10992        l = gen_xmlListPtr(n_l, 0);
10993
10994        xmlListReverse(l);
10995        call_tests++;
10996        des_xmlListPtr(n_l, l, 0);
10997        xmlResetLastError();
10998        if (mem_base != xmlMemBlocks()) {
10999            printf("Leak of %d blocks found in xmlListReverse",
11000	           xmlMemBlocks() - mem_base);
11001	    test_ret++;
11002            printf(" %d", n_l);
11003            printf("\n");
11004        }
11005    }
11006    function_tests++;
11007
11008    return(test_ret);
11009}
11010
11011
11012static int
11013test_xmlListReverseSearch(void) {
11014    int test_ret = 0;
11015
11016    int mem_base;
11017    void * ret_val;
11018    xmlListPtr l; /* a list */
11019    int n_l;
11020    void * data; /* a search value */
11021    int n_data;
11022
11023    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11024    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11025        mem_base = xmlMemBlocks();
11026        l = gen_xmlListPtr(n_l, 0);
11027        data = gen_userdata(n_data, 1);
11028
11029        ret_val = xmlListReverseSearch(l, data);
11030        desret_void_ptr(ret_val);
11031        call_tests++;
11032        des_xmlListPtr(n_l, l, 0);
11033        des_userdata(n_data, data, 1);
11034        xmlResetLastError();
11035        if (mem_base != xmlMemBlocks()) {
11036            printf("Leak of %d blocks found in xmlListReverseSearch",
11037	           xmlMemBlocks() - mem_base);
11038	    test_ret++;
11039            printf(" %d", n_l);
11040            printf(" %d", n_data);
11041            printf("\n");
11042        }
11043    }
11044    }
11045    function_tests++;
11046
11047    return(test_ret);
11048}
11049
11050
11051static int
11052test_xmlListReverseWalk(void) {
11053    int test_ret = 0;
11054
11055
11056    /* missing type support */
11057    return(test_ret);
11058}
11059
11060
11061static int
11062test_xmlListSearch(void) {
11063    int test_ret = 0;
11064
11065    int mem_base;
11066    void * ret_val;
11067    xmlListPtr l; /* a list */
11068    int n_l;
11069    void * data; /* a search value */
11070    int n_data;
11071
11072    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11073    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11074        mem_base = xmlMemBlocks();
11075        l = gen_xmlListPtr(n_l, 0);
11076        data = gen_userdata(n_data, 1);
11077
11078        ret_val = xmlListSearch(l, data);
11079        desret_void_ptr(ret_val);
11080        call_tests++;
11081        des_xmlListPtr(n_l, l, 0);
11082        des_userdata(n_data, data, 1);
11083        xmlResetLastError();
11084        if (mem_base != xmlMemBlocks()) {
11085            printf("Leak of %d blocks found in xmlListSearch",
11086	           xmlMemBlocks() - mem_base);
11087	    test_ret++;
11088            printf(" %d", n_l);
11089            printf(" %d", n_data);
11090            printf("\n");
11091        }
11092    }
11093    }
11094    function_tests++;
11095
11096    return(test_ret);
11097}
11098
11099
11100static int
11101test_xmlListSize(void) {
11102    int test_ret = 0;
11103
11104    int mem_base;
11105    int ret_val;
11106    xmlListPtr l; /* a list */
11107    int n_l;
11108
11109    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11110        mem_base = xmlMemBlocks();
11111        l = gen_xmlListPtr(n_l, 0);
11112
11113        ret_val = xmlListSize(l);
11114        desret_int(ret_val);
11115        call_tests++;
11116        des_xmlListPtr(n_l, l, 0);
11117        xmlResetLastError();
11118        if (mem_base != xmlMemBlocks()) {
11119            printf("Leak of %d blocks found in xmlListSize",
11120	           xmlMemBlocks() - mem_base);
11121	    test_ret++;
11122            printf(" %d", n_l);
11123            printf("\n");
11124        }
11125    }
11126    function_tests++;
11127
11128    return(test_ret);
11129}
11130
11131
11132static int
11133test_xmlListSort(void) {
11134    int test_ret = 0;
11135
11136    int mem_base;
11137    xmlListPtr l; /* a list */
11138    int n_l;
11139
11140    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11141        mem_base = xmlMemBlocks();
11142        l = gen_xmlListPtr(n_l, 0);
11143
11144        xmlListSort(l);
11145        call_tests++;
11146        des_xmlListPtr(n_l, l, 0);
11147        xmlResetLastError();
11148        if (mem_base != xmlMemBlocks()) {
11149            printf("Leak of %d blocks found in xmlListSort",
11150	           xmlMemBlocks() - mem_base);
11151	    test_ret++;
11152            printf(" %d", n_l);
11153            printf("\n");
11154        }
11155    }
11156    function_tests++;
11157
11158    return(test_ret);
11159}
11160
11161
11162static int
11163test_xmlListWalk(void) {
11164    int test_ret = 0;
11165
11166
11167    /* missing type support */
11168    return(test_ret);
11169}
11170
11171static int
11172test_list(void) {
11173    int test_ret = 0;
11174
11175    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11176    test_ret += test_xmlLinkGetData();
11177    test_ret += test_xmlListAppend();
11178    test_ret += test_xmlListClear();
11179    test_ret += test_xmlListCopy();
11180    test_ret += test_xmlListCreate();
11181    test_ret += test_xmlListDup();
11182    test_ret += test_xmlListEmpty();
11183    test_ret += test_xmlListEnd();
11184    test_ret += test_xmlListFront();
11185    test_ret += test_xmlListInsert();
11186    test_ret += test_xmlListMerge();
11187    test_ret += test_xmlListPopBack();
11188    test_ret += test_xmlListPopFront();
11189    test_ret += test_xmlListPushBack();
11190    test_ret += test_xmlListPushFront();
11191    test_ret += test_xmlListRemoveAll();
11192    test_ret += test_xmlListRemoveFirst();
11193    test_ret += test_xmlListRemoveLast();
11194    test_ret += test_xmlListReverse();
11195    test_ret += test_xmlListReverseSearch();
11196    test_ret += test_xmlListReverseWalk();
11197    test_ret += test_xmlListSearch();
11198    test_ret += test_xmlListSize();
11199    test_ret += test_xmlListSort();
11200    test_ret += test_xmlListWalk();
11201
11202    if (test_ret != 0)
11203	printf("Module list: %d errors\n", test_ret);
11204    return(test_ret);
11205}
11206
11207static int
11208test_xmlNanoFTPCheckResponse(void) {
11209    int test_ret = 0;
11210
11211#ifdef LIBXML_FTP_ENABLED
11212    int mem_base;
11213    int ret_val;
11214    void * ctx; /* an FTP context */
11215    int n_ctx;
11216
11217    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11218        mem_base = xmlMemBlocks();
11219        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11220
11221        ret_val = xmlNanoFTPCheckResponse(ctx);
11222        desret_int(ret_val);
11223        call_tests++;
11224        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11225        xmlResetLastError();
11226        if (mem_base != xmlMemBlocks()) {
11227            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11228	           xmlMemBlocks() - mem_base);
11229	    test_ret++;
11230            printf(" %d", n_ctx);
11231            printf("\n");
11232        }
11233    }
11234    function_tests++;
11235#endif
11236
11237    return(test_ret);
11238}
11239
11240
11241static int
11242test_xmlNanoFTPCleanup(void) {
11243    int test_ret = 0;
11244
11245#ifdef LIBXML_FTP_ENABLED
11246    int mem_base;
11247
11248        mem_base = xmlMemBlocks();
11249
11250        xmlNanoFTPCleanup();
11251        call_tests++;
11252        xmlResetLastError();
11253        if (mem_base != xmlMemBlocks()) {
11254            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11255	           xmlMemBlocks() - mem_base);
11256	    test_ret++;
11257            printf("\n");
11258        }
11259    function_tests++;
11260#endif
11261
11262    return(test_ret);
11263}
11264
11265
11266static int
11267test_xmlNanoFTPCloseConnection(void) {
11268    int test_ret = 0;
11269
11270#ifdef LIBXML_FTP_ENABLED
11271    int mem_base;
11272    int ret_val;
11273    void * ctx; /* an FTP context */
11274    int n_ctx;
11275
11276    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11277        mem_base = xmlMemBlocks();
11278        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11279
11280        ret_val = xmlNanoFTPCloseConnection(ctx);
11281        desret_int(ret_val);
11282        call_tests++;
11283        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11284        xmlResetLastError();
11285        if (mem_base != xmlMemBlocks()) {
11286            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11287	           xmlMemBlocks() - mem_base);
11288	    test_ret++;
11289            printf(" %d", n_ctx);
11290            printf("\n");
11291        }
11292    }
11293    function_tests++;
11294#endif
11295
11296    return(test_ret);
11297}
11298
11299
11300static int
11301test_xmlNanoFTPCwd(void) {
11302    int test_ret = 0;
11303
11304#ifdef LIBXML_FTP_ENABLED
11305    int mem_base;
11306    int ret_val;
11307    void * ctx; /* an FTP context */
11308    int n_ctx;
11309    char * directory; /* a directory on the server */
11310    int n_directory;
11311
11312    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11313    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11314        mem_base = xmlMemBlocks();
11315        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11316        directory = gen_const_char_ptr(n_directory, 1);
11317
11318        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11319        desret_int(ret_val);
11320        call_tests++;
11321        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11322        des_const_char_ptr(n_directory, (const char *)directory, 1);
11323        xmlResetLastError();
11324        if (mem_base != xmlMemBlocks()) {
11325            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11326	           xmlMemBlocks() - mem_base);
11327	    test_ret++;
11328            printf(" %d", n_ctx);
11329            printf(" %d", n_directory);
11330            printf("\n");
11331        }
11332    }
11333    }
11334    function_tests++;
11335#endif
11336
11337    return(test_ret);
11338}
11339
11340
11341static int
11342test_xmlNanoFTPDele(void) {
11343    int test_ret = 0;
11344
11345#ifdef LIBXML_FTP_ENABLED
11346    int mem_base;
11347    int ret_val;
11348    void * ctx; /* an FTP context */
11349    int n_ctx;
11350    const char * file; /* a file or directory on the server */
11351    int n_file;
11352
11353    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11354    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11355        mem_base = xmlMemBlocks();
11356        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11357        file = gen_filepath(n_file, 1);
11358
11359        ret_val = xmlNanoFTPDele(ctx, file);
11360        desret_int(ret_val);
11361        call_tests++;
11362        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11363        des_filepath(n_file, file, 1);
11364        xmlResetLastError();
11365        if (mem_base != xmlMemBlocks()) {
11366            printf("Leak of %d blocks found in xmlNanoFTPDele",
11367	           xmlMemBlocks() - mem_base);
11368	    test_ret++;
11369            printf(" %d", n_ctx);
11370            printf(" %d", n_file);
11371            printf("\n");
11372        }
11373    }
11374    }
11375    function_tests++;
11376#endif
11377
11378    return(test_ret);
11379}
11380
11381
11382static int
11383test_xmlNanoFTPGet(void) {
11384    int test_ret = 0;
11385
11386
11387    /* missing type support */
11388    return(test_ret);
11389}
11390
11391
11392static int
11393test_xmlNanoFTPGetConnection(void) {
11394    int test_ret = 0;
11395
11396#ifdef LIBXML_FTP_ENABLED
11397    int mem_base;
11398    int ret_val;
11399    void * ctx; /* an FTP context */
11400    int n_ctx;
11401
11402    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11403        mem_base = xmlMemBlocks();
11404        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11405
11406        ret_val = xmlNanoFTPGetConnection(ctx);
11407        desret_int(ret_val);
11408        call_tests++;
11409        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11410        xmlResetLastError();
11411        if (mem_base != xmlMemBlocks()) {
11412            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11413	           xmlMemBlocks() - mem_base);
11414	    test_ret++;
11415            printf(" %d", n_ctx);
11416            printf("\n");
11417        }
11418    }
11419    function_tests++;
11420#endif
11421
11422    return(test_ret);
11423}
11424
11425
11426static int
11427test_xmlNanoFTPGetResponse(void) {
11428    int test_ret = 0;
11429
11430#ifdef LIBXML_FTP_ENABLED
11431    int mem_base;
11432    int ret_val;
11433    void * ctx; /* an FTP context */
11434    int n_ctx;
11435
11436    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11437        mem_base = xmlMemBlocks();
11438        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11439
11440        ret_val = xmlNanoFTPGetResponse(ctx);
11441        desret_int(ret_val);
11442        call_tests++;
11443        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11444        xmlResetLastError();
11445        if (mem_base != xmlMemBlocks()) {
11446            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11447	           xmlMemBlocks() - mem_base);
11448	    test_ret++;
11449            printf(" %d", n_ctx);
11450            printf("\n");
11451        }
11452    }
11453    function_tests++;
11454#endif
11455
11456    return(test_ret);
11457}
11458
11459
11460static int
11461test_xmlNanoFTPGetSocket(void) {
11462    int test_ret = 0;
11463
11464#ifdef LIBXML_FTP_ENABLED
11465    int mem_base;
11466    int ret_val;
11467    void * ctx; /* an FTP context */
11468    int n_ctx;
11469    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11470    int n_filename;
11471
11472    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11473    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11474        mem_base = xmlMemBlocks();
11475        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11476        filename = gen_filepath(n_filename, 1);
11477
11478        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11479        desret_int(ret_val);
11480        call_tests++;
11481        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11482        des_filepath(n_filename, filename, 1);
11483        xmlResetLastError();
11484        if (mem_base != xmlMemBlocks()) {
11485            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11486	           xmlMemBlocks() - mem_base);
11487	    test_ret++;
11488            printf(" %d", n_ctx);
11489            printf(" %d", n_filename);
11490            printf("\n");
11491        }
11492    }
11493    }
11494    function_tests++;
11495#endif
11496
11497    return(test_ret);
11498}
11499
11500
11501static int
11502test_xmlNanoFTPInit(void) {
11503    int test_ret = 0;
11504
11505#ifdef LIBXML_FTP_ENABLED
11506    int mem_base;
11507
11508        mem_base = xmlMemBlocks();
11509
11510        xmlNanoFTPInit();
11511        call_tests++;
11512        xmlResetLastError();
11513        if (mem_base != xmlMemBlocks()) {
11514            printf("Leak of %d blocks found in xmlNanoFTPInit",
11515	           xmlMemBlocks() - mem_base);
11516	    test_ret++;
11517            printf("\n");
11518        }
11519    function_tests++;
11520#endif
11521
11522    return(test_ret);
11523}
11524
11525
11526static int
11527test_xmlNanoFTPList(void) {
11528    int test_ret = 0;
11529
11530
11531    /* missing type support */
11532    return(test_ret);
11533}
11534
11535
11536static int
11537test_xmlNanoFTPNewCtxt(void) {
11538    int test_ret = 0;
11539
11540
11541    /* missing type support */
11542    return(test_ret);
11543}
11544
11545
11546static int
11547test_xmlNanoFTPOpen(void) {
11548    int test_ret = 0;
11549
11550#ifdef LIBXML_FTP_ENABLED
11551    int mem_base;
11552    void * ret_val;
11553    const char * URL; /* the URL to the resource */
11554    int n_URL;
11555
11556    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11557        mem_base = xmlMemBlocks();
11558        URL = gen_filepath(n_URL, 0);
11559
11560        ret_val = xmlNanoFTPOpen(URL);
11561        desret_void_ptr(ret_val);
11562        call_tests++;
11563        des_filepath(n_URL, URL, 0);
11564        xmlResetLastError();
11565        if (mem_base != xmlMemBlocks()) {
11566            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11567	           xmlMemBlocks() - mem_base);
11568	    test_ret++;
11569            printf(" %d", n_URL);
11570            printf("\n");
11571        }
11572    }
11573    function_tests++;
11574#endif
11575
11576    return(test_ret);
11577}
11578
11579
11580static int
11581test_xmlNanoFTPProxy(void) {
11582    int test_ret = 0;
11583
11584#ifdef LIBXML_FTP_ENABLED
11585    char * host; /* the proxy host name */
11586    int n_host;
11587    int port; /* the proxy port */
11588    int n_port;
11589    char * user; /* the proxy user name */
11590    int n_user;
11591    char * passwd; /* the proxy password */
11592    int n_passwd;
11593    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11594    int n_type;
11595
11596    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11597    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11598    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11599    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11600    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11601        host = gen_const_char_ptr(n_host, 0);
11602        port = gen_int(n_port, 1);
11603        user = gen_const_char_ptr(n_user, 2);
11604        passwd = gen_const_char_ptr(n_passwd, 3);
11605        type = gen_int(n_type, 4);
11606
11607        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11608        call_tests++;
11609        des_const_char_ptr(n_host, (const char *)host, 0);
11610        des_int(n_port, port, 1);
11611        des_const_char_ptr(n_user, (const char *)user, 2);
11612        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11613        des_int(n_type, type, 4);
11614        xmlResetLastError();
11615    }
11616    }
11617    }
11618    }
11619    }
11620    function_tests++;
11621#endif
11622
11623    return(test_ret);
11624}
11625
11626
11627static int
11628test_xmlNanoFTPQuit(void) {
11629    int test_ret = 0;
11630
11631#ifdef LIBXML_FTP_ENABLED
11632    int mem_base;
11633    int ret_val;
11634    void * ctx; /* an FTP context */
11635    int n_ctx;
11636
11637    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11638        mem_base = xmlMemBlocks();
11639        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11640
11641        ret_val = xmlNanoFTPQuit(ctx);
11642        desret_int(ret_val);
11643        call_tests++;
11644        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11645        xmlResetLastError();
11646        if (mem_base != xmlMemBlocks()) {
11647            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11648	           xmlMemBlocks() - mem_base);
11649	    test_ret++;
11650            printf(" %d", n_ctx);
11651            printf("\n");
11652        }
11653    }
11654    function_tests++;
11655#endif
11656
11657    return(test_ret);
11658}
11659
11660
11661static int
11662test_xmlNanoFTPRead(void) {
11663    int test_ret = 0;
11664
11665#ifdef LIBXML_FTP_ENABLED
11666    int mem_base;
11667    int ret_val;
11668    void * ctx; /* the FTP context */
11669    int n_ctx;
11670    void * dest; /* a buffer */
11671    int n_dest;
11672    int len; /* the buffer length */
11673    int n_len;
11674
11675    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11676    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11677    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11678        mem_base = xmlMemBlocks();
11679        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11680        dest = gen_void_ptr(n_dest, 1);
11681        len = gen_int(n_len, 2);
11682
11683        ret_val = xmlNanoFTPRead(ctx, dest, len);
11684        desret_int(ret_val);
11685        call_tests++;
11686        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11687        des_void_ptr(n_dest, dest, 1);
11688        des_int(n_len, len, 2);
11689        xmlResetLastError();
11690        if (mem_base != xmlMemBlocks()) {
11691            printf("Leak of %d blocks found in xmlNanoFTPRead",
11692	           xmlMemBlocks() - mem_base);
11693	    test_ret++;
11694            printf(" %d", n_ctx);
11695            printf(" %d", n_dest);
11696            printf(" %d", n_len);
11697            printf("\n");
11698        }
11699    }
11700    }
11701    }
11702    function_tests++;
11703#endif
11704
11705    return(test_ret);
11706}
11707
11708
11709static int
11710test_xmlNanoFTPScanProxy(void) {
11711    int test_ret = 0;
11712
11713#ifdef LIBXML_FTP_ENABLED
11714    const char * URL; /* The proxy URL used to initialize the proxy context */
11715    int n_URL;
11716
11717    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11718        URL = gen_filepath(n_URL, 0);
11719
11720        xmlNanoFTPScanProxy(URL);
11721        call_tests++;
11722        des_filepath(n_URL, URL, 0);
11723        xmlResetLastError();
11724    }
11725    function_tests++;
11726#endif
11727
11728    return(test_ret);
11729}
11730
11731
11732static int
11733test_xmlNanoFTPUpdateURL(void) {
11734    int test_ret = 0;
11735
11736#ifdef LIBXML_FTP_ENABLED
11737    int mem_base;
11738    int ret_val;
11739    void * ctx; /* an FTP context */
11740    int n_ctx;
11741    const char * URL; /* The URL used to update the context */
11742    int n_URL;
11743
11744    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11745    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11746        mem_base = xmlMemBlocks();
11747        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11748        URL = gen_filepath(n_URL, 1);
11749
11750        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11751        desret_int(ret_val);
11752        call_tests++;
11753        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11754        des_filepath(n_URL, URL, 1);
11755        xmlResetLastError();
11756        if (mem_base != xmlMemBlocks()) {
11757            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11758	           xmlMemBlocks() - mem_base);
11759	    test_ret++;
11760            printf(" %d", n_ctx);
11761            printf(" %d", n_URL);
11762            printf("\n");
11763        }
11764    }
11765    }
11766    function_tests++;
11767#endif
11768
11769    return(test_ret);
11770}
11771
11772static int
11773test_nanoftp(void) {
11774    int test_ret = 0;
11775
11776    if (quiet == 0) printf("Testing nanoftp : 15 of 22 functions ...\n");
11777    test_ret += test_xmlNanoFTPCheckResponse();
11778    test_ret += test_xmlNanoFTPCleanup();
11779    test_ret += test_xmlNanoFTPCloseConnection();
11780    test_ret += test_xmlNanoFTPCwd();
11781    test_ret += test_xmlNanoFTPDele();
11782    test_ret += test_xmlNanoFTPGet();
11783    test_ret += test_xmlNanoFTPGetConnection();
11784    test_ret += test_xmlNanoFTPGetResponse();
11785    test_ret += test_xmlNanoFTPGetSocket();
11786    test_ret += test_xmlNanoFTPInit();
11787    test_ret += test_xmlNanoFTPList();
11788    test_ret += test_xmlNanoFTPNewCtxt();
11789    test_ret += test_xmlNanoFTPOpen();
11790    test_ret += test_xmlNanoFTPProxy();
11791    test_ret += test_xmlNanoFTPQuit();
11792    test_ret += test_xmlNanoFTPRead();
11793    test_ret += test_xmlNanoFTPScanProxy();
11794    test_ret += test_xmlNanoFTPUpdateURL();
11795
11796    if (test_ret != 0)
11797	printf("Module nanoftp: %d errors\n", test_ret);
11798    return(test_ret);
11799}
11800
11801static int
11802test_xmlNanoHTTPAuthHeader(void) {
11803    int test_ret = 0;
11804
11805#ifdef LIBXML_HTTP_ENABLED
11806    int mem_base;
11807    const char * ret_val;
11808    void * ctx; /* the HTTP context */
11809    int n_ctx;
11810
11811    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11812        mem_base = xmlMemBlocks();
11813        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11814
11815        ret_val = xmlNanoHTTPAuthHeader(ctx);
11816        desret_const_char_ptr(ret_val);
11817        call_tests++;
11818        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11819        xmlResetLastError();
11820        if (mem_base != xmlMemBlocks()) {
11821            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
11822	           xmlMemBlocks() - mem_base);
11823	    test_ret++;
11824            printf(" %d", n_ctx);
11825            printf("\n");
11826        }
11827    }
11828    function_tests++;
11829#endif
11830
11831    return(test_ret);
11832}
11833
11834
11835static int
11836test_xmlNanoHTTPCleanup(void) {
11837    int test_ret = 0;
11838
11839#ifdef LIBXML_HTTP_ENABLED
11840    int mem_base;
11841
11842        mem_base = xmlMemBlocks();
11843
11844        xmlNanoHTTPCleanup();
11845        call_tests++;
11846        xmlResetLastError();
11847        if (mem_base != xmlMemBlocks()) {
11848            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
11849	           xmlMemBlocks() - mem_base);
11850	    test_ret++;
11851            printf("\n");
11852        }
11853    function_tests++;
11854#endif
11855
11856    return(test_ret);
11857}
11858
11859
11860static int
11861test_xmlNanoHTTPClose(void) {
11862    int test_ret = 0;
11863
11864#ifdef LIBXML_HTTP_ENABLED
11865    int mem_base;
11866    void * ctx; /* the HTTP context */
11867    int n_ctx;
11868
11869    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11870        mem_base = xmlMemBlocks();
11871        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11872
11873        xmlNanoHTTPClose(ctx);
11874        call_tests++;
11875        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11876        xmlResetLastError();
11877        if (mem_base != xmlMemBlocks()) {
11878            printf("Leak of %d blocks found in xmlNanoHTTPClose",
11879	           xmlMemBlocks() - mem_base);
11880	    test_ret++;
11881            printf(" %d", n_ctx);
11882            printf("\n");
11883        }
11884    }
11885    function_tests++;
11886#endif
11887
11888    return(test_ret);
11889}
11890
11891
11892static int
11893test_xmlNanoHTTPContentLength(void) {
11894    int test_ret = 0;
11895
11896#ifdef LIBXML_HTTP_ENABLED
11897    int mem_base;
11898    int ret_val;
11899    void * ctx; /* the HTTP context */
11900    int n_ctx;
11901
11902    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11903        mem_base = xmlMemBlocks();
11904        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11905
11906        ret_val = xmlNanoHTTPContentLength(ctx);
11907        desret_int(ret_val);
11908        call_tests++;
11909        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11910        xmlResetLastError();
11911        if (mem_base != xmlMemBlocks()) {
11912            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
11913	           xmlMemBlocks() - mem_base);
11914	    test_ret++;
11915            printf(" %d", n_ctx);
11916            printf("\n");
11917        }
11918    }
11919    function_tests++;
11920#endif
11921
11922    return(test_ret);
11923}
11924
11925
11926static int
11927test_xmlNanoHTTPEncoding(void) {
11928    int test_ret = 0;
11929
11930#ifdef LIBXML_HTTP_ENABLED
11931    int mem_base;
11932    const char * ret_val;
11933    void * ctx; /* the HTTP context */
11934    int n_ctx;
11935
11936    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11937        mem_base = xmlMemBlocks();
11938        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11939
11940        ret_val = xmlNanoHTTPEncoding(ctx);
11941        desret_const_char_ptr(ret_val);
11942        call_tests++;
11943        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
11944        xmlResetLastError();
11945        if (mem_base != xmlMemBlocks()) {
11946            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
11947	           xmlMemBlocks() - mem_base);
11948	    test_ret++;
11949            printf(" %d", n_ctx);
11950            printf("\n");
11951        }
11952    }
11953    function_tests++;
11954#endif
11955
11956    return(test_ret);
11957}
11958
11959
11960#define gen_nb_char_ptr_ptr 1
11961static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11962    return(NULL);
11963}
11964static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
11965}
11966
11967static int
11968test_xmlNanoHTTPFetch(void) {
11969    int test_ret = 0;
11970
11971#ifdef LIBXML_HTTP_ENABLED
11972    int mem_base;
11973    int ret_val;
11974    const char * URL; /* The URL to load */
11975    int n_URL;
11976    const char * filename; /* the filename where the content should be saved */
11977    int n_filename;
11978    char ** contentType; /* if available the Content-Type information will be returned at that location */
11979    int n_contentType;
11980
11981    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11982    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11983    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
11984        mem_base = xmlMemBlocks();
11985        URL = gen_filepath(n_URL, 0);
11986        filename = gen_filepath(n_filename, 1);
11987        contentType = gen_char_ptr_ptr(n_contentType, 2);
11988
11989        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
11990        desret_int(ret_val);
11991        call_tests++;
11992        des_filepath(n_URL, URL, 0);
11993        des_filepath(n_filename, filename, 1);
11994        des_char_ptr_ptr(n_contentType, contentType, 2);
11995        xmlResetLastError();
11996        if (mem_base != xmlMemBlocks()) {
11997            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
11998	           xmlMemBlocks() - mem_base);
11999	    test_ret++;
12000            printf(" %d", n_URL);
12001            printf(" %d", n_filename);
12002            printf(" %d", n_contentType);
12003            printf("\n");
12004        }
12005    }
12006    }
12007    }
12008    function_tests++;
12009#endif
12010
12011    return(test_ret);
12012}
12013
12014
12015static int
12016test_xmlNanoHTTPInit(void) {
12017    int test_ret = 0;
12018
12019#ifdef LIBXML_HTTP_ENABLED
12020    int mem_base;
12021
12022        mem_base = xmlMemBlocks();
12023
12024        xmlNanoHTTPInit();
12025        call_tests++;
12026        xmlResetLastError();
12027        if (mem_base != xmlMemBlocks()) {
12028            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12029	           xmlMemBlocks() - mem_base);
12030	    test_ret++;
12031            printf("\n");
12032        }
12033    function_tests++;
12034#endif
12035
12036    return(test_ret);
12037}
12038
12039
12040static int
12041test_xmlNanoHTTPMethod(void) {
12042    int test_ret = 0;
12043
12044#ifdef LIBXML_HTTP_ENABLED
12045    int mem_base;
12046    void * ret_val;
12047    const char * URL; /* The URL to load */
12048    int n_URL;
12049    char * method; /* the HTTP method to use */
12050    int n_method;
12051    char * input; /* the input string if any */
12052    int n_input;
12053    char ** contentType; /* the Content-Type information IN and OUT */
12054    int n_contentType;
12055    char * headers; /* the extra headers */
12056    int n_headers;
12057    int ilen; /* input length */
12058    int n_ilen;
12059
12060    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12061    for (n_method = 0;n_method < gen_nb_const_char_ptr;n_method++) {
12062    for (n_input = 0;n_input < gen_nb_const_char_ptr;n_input++) {
12063    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12064    for (n_headers = 0;n_headers < gen_nb_const_char_ptr;n_headers++) {
12065    for (n_ilen = 0;n_ilen < gen_nb_int;n_ilen++) {
12066        mem_base = xmlMemBlocks();
12067        URL = gen_filepath(n_URL, 0);
12068        method = gen_const_char_ptr(n_method, 1);
12069        input = gen_const_char_ptr(n_input, 2);
12070        contentType = gen_char_ptr_ptr(n_contentType, 3);
12071        headers = gen_const_char_ptr(n_headers, 4);
12072        ilen = gen_int(n_ilen, 5);
12073
12074        ret_val = xmlNanoHTTPMethod(URL, (const char *)method, (const char *)input, contentType, (const char *)headers, ilen);
12075        desret_void_ptr(ret_val);
12076        call_tests++;
12077        des_filepath(n_URL, URL, 0);
12078        des_const_char_ptr(n_method, (const char *)method, 1);
12079        des_const_char_ptr(n_input, (const char *)input, 2);
12080        des_char_ptr_ptr(n_contentType, contentType, 3);
12081        des_const_char_ptr(n_headers, (const char *)headers, 4);
12082        des_int(n_ilen, ilen, 5);
12083        xmlResetLastError();
12084        if (mem_base != xmlMemBlocks()) {
12085            printf("Leak of %d blocks found in xmlNanoHTTPMethod",
12086	           xmlMemBlocks() - mem_base);
12087	    test_ret++;
12088            printf(" %d", n_URL);
12089            printf(" %d", n_method);
12090            printf(" %d", n_input);
12091            printf(" %d", n_contentType);
12092            printf(" %d", n_headers);
12093            printf(" %d", n_ilen);
12094            printf("\n");
12095        }
12096    }
12097    }
12098    }
12099    }
12100    }
12101    }
12102    function_tests++;
12103#endif
12104
12105    return(test_ret);
12106}
12107
12108
12109static int
12110test_xmlNanoHTTPMethodRedir(void) {
12111    int test_ret = 0;
12112
12113#ifdef LIBXML_HTTP_ENABLED
12114    int mem_base;
12115    void * ret_val;
12116    const char * URL; /* The URL to load */
12117    int n_URL;
12118    char * method; /* the HTTP method to use */
12119    int n_method;
12120    char * input; /* the input string if any */
12121    int n_input;
12122    char ** contentType; /* the Content-Type information IN and OUT */
12123    int n_contentType;
12124    char ** redir; /* the redirected URL OUT */
12125    int n_redir;
12126    char * headers; /* the extra headers */
12127    int n_headers;
12128    int ilen; /* input length */
12129    int n_ilen;
12130
12131    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12132    for (n_method = 0;n_method < gen_nb_const_char_ptr;n_method++) {
12133    for (n_input = 0;n_input < gen_nb_const_char_ptr;n_input++) {
12134    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12135    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12136    for (n_headers = 0;n_headers < gen_nb_const_char_ptr;n_headers++) {
12137    for (n_ilen = 0;n_ilen < gen_nb_int;n_ilen++) {
12138        mem_base = xmlMemBlocks();
12139        URL = gen_filepath(n_URL, 0);
12140        method = gen_const_char_ptr(n_method, 1);
12141        input = gen_const_char_ptr(n_input, 2);
12142        contentType = gen_char_ptr_ptr(n_contentType, 3);
12143        redir = gen_char_ptr_ptr(n_redir, 4);
12144        headers = gen_const_char_ptr(n_headers, 5);
12145        ilen = gen_int(n_ilen, 6);
12146
12147        ret_val = xmlNanoHTTPMethodRedir(URL, (const char *)method, (const char *)input, contentType, redir, (const char *)headers, ilen);
12148        desret_void_ptr(ret_val);
12149        call_tests++;
12150        des_filepath(n_URL, URL, 0);
12151        des_const_char_ptr(n_method, (const char *)method, 1);
12152        des_const_char_ptr(n_input, (const char *)input, 2);
12153        des_char_ptr_ptr(n_contentType, contentType, 3);
12154        des_char_ptr_ptr(n_redir, redir, 4);
12155        des_const_char_ptr(n_headers, (const char *)headers, 5);
12156        des_int(n_ilen, ilen, 6);
12157        xmlResetLastError();
12158        if (mem_base != xmlMemBlocks()) {
12159            printf("Leak of %d blocks found in xmlNanoHTTPMethodRedir",
12160	           xmlMemBlocks() - mem_base);
12161	    test_ret++;
12162            printf(" %d", n_URL);
12163            printf(" %d", n_method);
12164            printf(" %d", n_input);
12165            printf(" %d", n_contentType);
12166            printf(" %d", n_redir);
12167            printf(" %d", n_headers);
12168            printf(" %d", n_ilen);
12169            printf("\n");
12170        }
12171    }
12172    }
12173    }
12174    }
12175    }
12176    }
12177    }
12178    function_tests++;
12179#endif
12180
12181    return(test_ret);
12182}
12183
12184
12185static int
12186test_xmlNanoHTTPMimeType(void) {
12187    int test_ret = 0;
12188
12189#ifdef LIBXML_HTTP_ENABLED
12190    int mem_base;
12191    const char * ret_val;
12192    void * ctx; /* the HTTP context */
12193    int n_ctx;
12194
12195    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12196        mem_base = xmlMemBlocks();
12197        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12198
12199        ret_val = xmlNanoHTTPMimeType(ctx);
12200        desret_const_char_ptr(ret_val);
12201        call_tests++;
12202        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12203        xmlResetLastError();
12204        if (mem_base != xmlMemBlocks()) {
12205            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12206	           xmlMemBlocks() - mem_base);
12207	    test_ret++;
12208            printf(" %d", n_ctx);
12209            printf("\n");
12210        }
12211    }
12212    function_tests++;
12213#endif
12214
12215    return(test_ret);
12216}
12217
12218
12219static int
12220test_xmlNanoHTTPOpen(void) {
12221    int test_ret = 0;
12222
12223#ifdef LIBXML_HTTP_ENABLED
12224    int mem_base;
12225    void * ret_val;
12226    const char * URL; /* The URL to load */
12227    int n_URL;
12228    char ** contentType; /* if available the Content-Type information will be returned at that location */
12229    int n_contentType;
12230
12231    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12232    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12233        mem_base = xmlMemBlocks();
12234        URL = gen_filepath(n_URL, 0);
12235        contentType = gen_char_ptr_ptr(n_contentType, 1);
12236
12237        ret_val = xmlNanoHTTPOpen(URL, contentType);
12238        desret_void_ptr(ret_val);
12239        call_tests++;
12240        des_filepath(n_URL, URL, 0);
12241        des_char_ptr_ptr(n_contentType, contentType, 1);
12242        xmlResetLastError();
12243        if (mem_base != xmlMemBlocks()) {
12244            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12245	           xmlMemBlocks() - mem_base);
12246	    test_ret++;
12247            printf(" %d", n_URL);
12248            printf(" %d", n_contentType);
12249            printf("\n");
12250        }
12251    }
12252    }
12253    function_tests++;
12254#endif
12255
12256    return(test_ret);
12257}
12258
12259
12260static int
12261test_xmlNanoHTTPOpenRedir(void) {
12262    int test_ret = 0;
12263
12264#ifdef LIBXML_HTTP_ENABLED
12265    int mem_base;
12266    void * ret_val;
12267    const char * URL; /* The URL to load */
12268    int n_URL;
12269    char ** contentType; /* if available the Content-Type information will be returned at that location */
12270    int n_contentType;
12271    char ** redir; /* if available the redirected URL will be returned */
12272    int n_redir;
12273
12274    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12275    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12276    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12277        mem_base = xmlMemBlocks();
12278        URL = gen_filepath(n_URL, 0);
12279        contentType = gen_char_ptr_ptr(n_contentType, 1);
12280        redir = gen_char_ptr_ptr(n_redir, 2);
12281
12282        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12283        desret_void_ptr(ret_val);
12284        call_tests++;
12285        des_filepath(n_URL, URL, 0);
12286        des_char_ptr_ptr(n_contentType, contentType, 1);
12287        des_char_ptr_ptr(n_redir, redir, 2);
12288        xmlResetLastError();
12289        if (mem_base != xmlMemBlocks()) {
12290            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12291	           xmlMemBlocks() - mem_base);
12292	    test_ret++;
12293            printf(" %d", n_URL);
12294            printf(" %d", n_contentType);
12295            printf(" %d", n_redir);
12296            printf("\n");
12297        }
12298    }
12299    }
12300    }
12301    function_tests++;
12302#endif
12303
12304    return(test_ret);
12305}
12306
12307
12308static int
12309test_xmlNanoHTTPRead(void) {
12310    int test_ret = 0;
12311
12312#ifdef LIBXML_HTTP_ENABLED
12313    int mem_base;
12314    int ret_val;
12315    void * ctx; /* the HTTP context */
12316    int n_ctx;
12317    void * dest; /* a buffer */
12318    int n_dest;
12319    int len; /* the buffer length */
12320    int n_len;
12321
12322    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12323    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12324    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12325        mem_base = xmlMemBlocks();
12326        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12327        dest = gen_void_ptr(n_dest, 1);
12328        len = gen_int(n_len, 2);
12329
12330        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12331        desret_int(ret_val);
12332        call_tests++;
12333        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12334        des_void_ptr(n_dest, dest, 1);
12335        des_int(n_len, len, 2);
12336        xmlResetLastError();
12337        if (mem_base != xmlMemBlocks()) {
12338            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12339	           xmlMemBlocks() - mem_base);
12340	    test_ret++;
12341            printf(" %d", n_ctx);
12342            printf(" %d", n_dest);
12343            printf(" %d", n_len);
12344            printf("\n");
12345        }
12346    }
12347    }
12348    }
12349    function_tests++;
12350#endif
12351
12352    return(test_ret);
12353}
12354
12355
12356static int
12357test_xmlNanoHTTPRedir(void) {
12358    int test_ret = 0;
12359
12360
12361    /* missing type support */
12362    return(test_ret);
12363}
12364
12365
12366static int
12367test_xmlNanoHTTPReturnCode(void) {
12368    int test_ret = 0;
12369
12370#ifdef LIBXML_HTTP_ENABLED
12371    int mem_base;
12372    int ret_val;
12373    void * ctx; /* the HTTP context */
12374    int n_ctx;
12375
12376    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12377        mem_base = xmlMemBlocks();
12378        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12379
12380        ret_val = xmlNanoHTTPReturnCode(ctx);
12381        desret_int(ret_val);
12382        call_tests++;
12383        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12384        xmlResetLastError();
12385        if (mem_base != xmlMemBlocks()) {
12386            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12387	           xmlMemBlocks() - mem_base);
12388	    test_ret++;
12389            printf(" %d", n_ctx);
12390            printf("\n");
12391        }
12392    }
12393    function_tests++;
12394#endif
12395
12396    return(test_ret);
12397}
12398
12399
12400static int
12401test_xmlNanoHTTPSave(void) {
12402    int test_ret = 0;
12403
12404#ifdef LIBXML_HTTP_ENABLED
12405#ifdef LIBXML_OUTPUT_ENABLED
12406    int mem_base;
12407    int ret_val;
12408    void * ctxt; /* the HTTP context */
12409    int n_ctxt;
12410    const char * filename; /* the filename where the content should be saved */
12411    int n_filename;
12412
12413    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12414    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12415        mem_base = xmlMemBlocks();
12416        ctxt = gen_void_ptr(n_ctxt, 0);
12417        filename = gen_fileoutput(n_filename, 1);
12418
12419        ret_val = xmlNanoHTTPSave(ctxt, filename);
12420        desret_int(ret_val);
12421        call_tests++;
12422        des_void_ptr(n_ctxt, ctxt, 0);
12423        des_fileoutput(n_filename, filename, 1);
12424        xmlResetLastError();
12425        if (mem_base != xmlMemBlocks()) {
12426            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12427	           xmlMemBlocks() - mem_base);
12428	    test_ret++;
12429            printf(" %d", n_ctxt);
12430            printf(" %d", n_filename);
12431            printf("\n");
12432        }
12433    }
12434    }
12435    function_tests++;
12436#endif
12437#endif
12438
12439    return(test_ret);
12440}
12441
12442
12443static int
12444test_xmlNanoHTTPScanProxy(void) {
12445    int test_ret = 0;
12446
12447#ifdef LIBXML_HTTP_ENABLED
12448    const char * URL; /* The proxy URL used to initialize the proxy context */
12449    int n_URL;
12450
12451    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12452        URL = gen_filepath(n_URL, 0);
12453
12454        xmlNanoHTTPScanProxy(URL);
12455        call_tests++;
12456        des_filepath(n_URL, URL, 0);
12457        xmlResetLastError();
12458    }
12459    function_tests++;
12460#endif
12461
12462    return(test_ret);
12463}
12464
12465static int
12466test_nanohttp(void) {
12467    int test_ret = 0;
12468
12469    if (quiet == 0) printf("Testing nanohttp : 16 of 17 functions ...\n");
12470    test_ret += test_xmlNanoHTTPAuthHeader();
12471    test_ret += test_xmlNanoHTTPCleanup();
12472    test_ret += test_xmlNanoHTTPClose();
12473    test_ret += test_xmlNanoHTTPContentLength();
12474    test_ret += test_xmlNanoHTTPEncoding();
12475    test_ret += test_xmlNanoHTTPFetch();
12476    test_ret += test_xmlNanoHTTPInit();
12477    test_ret += test_xmlNanoHTTPMethod();
12478    test_ret += test_xmlNanoHTTPMethodRedir();
12479    test_ret += test_xmlNanoHTTPMimeType();
12480    test_ret += test_xmlNanoHTTPOpen();
12481    test_ret += test_xmlNanoHTTPOpenRedir();
12482    test_ret += test_xmlNanoHTTPRead();
12483    test_ret += test_xmlNanoHTTPRedir();
12484    test_ret += test_xmlNanoHTTPReturnCode();
12485    test_ret += test_xmlNanoHTTPSave();
12486    test_ret += test_xmlNanoHTTPScanProxy();
12487
12488    if (test_ret != 0)
12489	printf("Module nanohttp: %d errors\n", test_ret);
12490    return(test_ret);
12491}
12492
12493static int
12494test_xmlByteConsumed(void) {
12495    int test_ret = 0;
12496
12497    int mem_base;
12498    long ret_val;
12499    xmlParserCtxtPtr ctxt; /* an XML parser context */
12500    int n_ctxt;
12501
12502    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12503        mem_base = xmlMemBlocks();
12504        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12505
12506        ret_val = xmlByteConsumed(ctxt);
12507        desret_long(ret_val);
12508        call_tests++;
12509        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12510        xmlResetLastError();
12511        if (mem_base != xmlMemBlocks()) {
12512            printf("Leak of %d blocks found in xmlByteConsumed",
12513	           xmlMemBlocks() - mem_base);
12514	    test_ret++;
12515            printf(" %d", n_ctxt);
12516            printf("\n");
12517        }
12518    }
12519    function_tests++;
12520
12521    return(test_ret);
12522}
12523
12524
12525static int
12526test_xmlClearNodeInfoSeq(void) {
12527    int test_ret = 0;
12528
12529    int mem_base;
12530    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12531    int n_seq;
12532
12533    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12534        mem_base = xmlMemBlocks();
12535        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12536
12537        xmlClearNodeInfoSeq(seq);
12538        call_tests++;
12539        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12540        xmlResetLastError();
12541        if (mem_base != xmlMemBlocks()) {
12542            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12543	           xmlMemBlocks() - mem_base);
12544	    test_ret++;
12545            printf(" %d", n_seq);
12546            printf("\n");
12547        }
12548    }
12549    function_tests++;
12550
12551    return(test_ret);
12552}
12553
12554
12555static int
12556test_xmlClearParserCtxt(void) {
12557    int test_ret = 0;
12558
12559    int mem_base;
12560    xmlParserCtxtPtr ctxt; /* an XML parser context */
12561    int n_ctxt;
12562
12563    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12564        mem_base = xmlMemBlocks();
12565        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12566
12567        xmlClearParserCtxt(ctxt);
12568        call_tests++;
12569        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12570        xmlResetLastError();
12571        if (mem_base != xmlMemBlocks()) {
12572            printf("Leak of %d blocks found in xmlClearParserCtxt",
12573	           xmlMemBlocks() - mem_base);
12574	    test_ret++;
12575            printf(" %d", n_ctxt);
12576            printf("\n");
12577        }
12578    }
12579    function_tests++;
12580
12581    return(test_ret);
12582}
12583
12584
12585static int
12586test_xmlCreateDocParserCtxt(void) {
12587    int test_ret = 0;
12588
12589    int mem_base;
12590    xmlParserCtxtPtr ret_val;
12591    xmlChar * cur; /* a pointer to an array of xmlChar */
12592    int n_cur;
12593
12594    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12595        mem_base = xmlMemBlocks();
12596        cur = gen_const_xmlChar_ptr(n_cur, 0);
12597
12598        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12599        desret_xmlParserCtxtPtr(ret_val);
12600        call_tests++;
12601        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12602        xmlResetLastError();
12603        if (mem_base != xmlMemBlocks()) {
12604            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12605	           xmlMemBlocks() - mem_base);
12606	    test_ret++;
12607            printf(" %d", n_cur);
12608            printf("\n");
12609        }
12610    }
12611    function_tests++;
12612
12613    return(test_ret);
12614}
12615
12616
12617static int
12618test_xmlCreatePushParserCtxt(void) {
12619    int test_ret = 0;
12620
12621#ifdef LIBXML_PUSH_ENABLED
12622    int mem_base;
12623    xmlParserCtxtPtr ret_val;
12624    xmlSAXHandlerPtr sax; /* a SAX handler */
12625    int n_sax;
12626    void * user_data; /* The user data returned on SAX callbacks */
12627    int n_user_data;
12628    char * chunk; /* a pointer to an array of chars */
12629    int n_chunk;
12630    int size; /* number of chars in the array */
12631    int n_size;
12632    const char * filename; /* an optional file name or URI */
12633    int n_filename;
12634
12635    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12636    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12637    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12638    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12639    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12640        mem_base = xmlMemBlocks();
12641        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12642        user_data = gen_userdata(n_user_data, 1);
12643        chunk = gen_const_char_ptr(n_chunk, 2);
12644        size = gen_int(n_size, 3);
12645        filename = gen_fileoutput(n_filename, 4);
12646
12647        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12648        desret_xmlParserCtxtPtr(ret_val);
12649        call_tests++;
12650        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12651        des_userdata(n_user_data, user_data, 1);
12652        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12653        des_int(n_size, size, 3);
12654        des_fileoutput(n_filename, filename, 4);
12655        xmlResetLastError();
12656        if (mem_base != xmlMemBlocks()) {
12657            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12658	           xmlMemBlocks() - mem_base);
12659	    test_ret++;
12660            printf(" %d", n_sax);
12661            printf(" %d", n_user_data);
12662            printf(" %d", n_chunk);
12663            printf(" %d", n_size);
12664            printf(" %d", n_filename);
12665            printf("\n");
12666        }
12667    }
12668    }
12669    }
12670    }
12671    }
12672    function_tests++;
12673#endif
12674
12675    return(test_ret);
12676}
12677
12678
12679static int
12680test_xmlCtxtReadDoc(void) {
12681    int test_ret = 0;
12682
12683    int mem_base;
12684    xmlDocPtr ret_val;
12685    xmlParserCtxtPtr ctxt; /* an XML parser context */
12686    int n_ctxt;
12687    xmlChar * cur; /* a pointer to a zero terminated string */
12688    int n_cur;
12689    const char * URL; /* the base URL to use for the document */
12690    int n_URL;
12691    char * encoding; /* the document encoding, or NULL */
12692    int n_encoding;
12693    int options; /* a combination of xmlParserOption */
12694    int n_options;
12695
12696    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12697    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12698    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12699    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12700    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12701        mem_base = xmlMemBlocks();
12702        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12703        cur = gen_const_xmlChar_ptr(n_cur, 1);
12704        URL = gen_filepath(n_URL, 2);
12705        encoding = gen_const_char_ptr(n_encoding, 3);
12706        options = gen_parseroptions(n_options, 4);
12707
12708        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12709        desret_xmlDocPtr(ret_val);
12710        call_tests++;
12711        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12712        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12713        des_filepath(n_URL, URL, 2);
12714        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12715        des_parseroptions(n_options, options, 4);
12716        xmlResetLastError();
12717        if (mem_base != xmlMemBlocks()) {
12718            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12719	           xmlMemBlocks() - mem_base);
12720	    test_ret++;
12721            printf(" %d", n_ctxt);
12722            printf(" %d", n_cur);
12723            printf(" %d", n_URL);
12724            printf(" %d", n_encoding);
12725            printf(" %d", n_options);
12726            printf("\n");
12727        }
12728    }
12729    }
12730    }
12731    }
12732    }
12733    function_tests++;
12734
12735    return(test_ret);
12736}
12737
12738
12739static int
12740test_xmlCtxtReadFile(void) {
12741    int test_ret = 0;
12742
12743    int mem_base;
12744    xmlDocPtr ret_val;
12745    xmlParserCtxtPtr ctxt; /* an XML parser context */
12746    int n_ctxt;
12747    const char * filename; /* a file or URL */
12748    int n_filename;
12749    char * encoding; /* the document encoding, or NULL */
12750    int n_encoding;
12751    int options; /* a combination of xmlParserOption */
12752    int n_options;
12753
12754    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12755    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12756    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12757    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12758        mem_base = xmlMemBlocks();
12759        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12760        filename = gen_filepath(n_filename, 1);
12761        encoding = gen_const_char_ptr(n_encoding, 2);
12762        options = gen_parseroptions(n_options, 3);
12763
12764        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12765        desret_xmlDocPtr(ret_val);
12766        call_tests++;
12767        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12768        des_filepath(n_filename, filename, 1);
12769        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12770        des_parseroptions(n_options, options, 3);
12771        xmlResetLastError();
12772        if (mem_base != xmlMemBlocks()) {
12773            printf("Leak of %d blocks found in xmlCtxtReadFile",
12774	           xmlMemBlocks() - mem_base);
12775	    test_ret++;
12776            printf(" %d", n_ctxt);
12777            printf(" %d", n_filename);
12778            printf(" %d", n_encoding);
12779            printf(" %d", n_options);
12780            printf("\n");
12781        }
12782    }
12783    }
12784    }
12785    }
12786    function_tests++;
12787
12788    return(test_ret);
12789}
12790
12791
12792static int
12793test_xmlCtxtReadMemory(void) {
12794    int test_ret = 0;
12795
12796    int mem_base;
12797    xmlDocPtr ret_val;
12798    xmlParserCtxtPtr ctxt; /* an XML parser context */
12799    int n_ctxt;
12800    char * buffer; /* a pointer to a char array */
12801    int n_buffer;
12802    int size; /* the size of the array */
12803    int n_size;
12804    const char * URL; /* the base URL to use for the document */
12805    int n_URL;
12806    char * encoding; /* the document encoding, or NULL */
12807    int n_encoding;
12808    int options; /* a combination of xmlParserOption */
12809    int n_options;
12810
12811    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12812    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12813    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12814    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12815    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12816    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12817        mem_base = xmlMemBlocks();
12818        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12819        buffer = gen_const_char_ptr(n_buffer, 1);
12820        size = gen_int(n_size, 2);
12821        URL = gen_filepath(n_URL, 3);
12822        encoding = gen_const_char_ptr(n_encoding, 4);
12823        options = gen_parseroptions(n_options, 5);
12824
12825        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12826        desret_xmlDocPtr(ret_val);
12827        call_tests++;
12828        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12829        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12830        des_int(n_size, size, 2);
12831        des_filepath(n_URL, URL, 3);
12832        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12833        des_parseroptions(n_options, options, 5);
12834        xmlResetLastError();
12835        if (mem_base != xmlMemBlocks()) {
12836            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12837	           xmlMemBlocks() - mem_base);
12838	    test_ret++;
12839            printf(" %d", n_ctxt);
12840            printf(" %d", n_buffer);
12841            printf(" %d", n_size);
12842            printf(" %d", n_URL);
12843            printf(" %d", n_encoding);
12844            printf(" %d", n_options);
12845            printf("\n");
12846        }
12847    }
12848    }
12849    }
12850    }
12851    }
12852    }
12853    function_tests++;
12854
12855    return(test_ret);
12856}
12857
12858
12859static int
12860test_xmlCtxtReset(void) {
12861    int test_ret = 0;
12862
12863    int mem_base;
12864    xmlParserCtxtPtr ctxt; /* an XML parser context */
12865    int n_ctxt;
12866
12867    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12868        mem_base = xmlMemBlocks();
12869        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12870
12871        xmlCtxtReset(ctxt);
12872        call_tests++;
12873        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12874        xmlResetLastError();
12875        if (mem_base != xmlMemBlocks()) {
12876            printf("Leak of %d blocks found in xmlCtxtReset",
12877	           xmlMemBlocks() - mem_base);
12878	    test_ret++;
12879            printf(" %d", n_ctxt);
12880            printf("\n");
12881        }
12882    }
12883    function_tests++;
12884
12885    return(test_ret);
12886}
12887
12888
12889static int
12890test_xmlCtxtResetPush(void) {
12891    int test_ret = 0;
12892
12893    int mem_base;
12894    int ret_val;
12895    xmlParserCtxtPtr ctxt; /* an XML parser context */
12896    int n_ctxt;
12897    char * chunk; /* a pointer to an array of chars */
12898    int n_chunk;
12899    int size; /* number of chars in the array */
12900    int n_size;
12901    const char * filename; /* an optional file name or URI */
12902    int n_filename;
12903    char * encoding; /* the document encoding, or NULL */
12904    int n_encoding;
12905
12906    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12907    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12908    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12909    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12910    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12911        mem_base = xmlMemBlocks();
12912        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12913        chunk = gen_const_char_ptr(n_chunk, 1);
12914        size = gen_int(n_size, 2);
12915        filename = gen_filepath(n_filename, 3);
12916        encoding = gen_const_char_ptr(n_encoding, 4);
12917
12918        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12919        desret_int(ret_val);
12920        call_tests++;
12921        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12922        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12923        des_int(n_size, size, 2);
12924        des_filepath(n_filename, filename, 3);
12925        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12926        xmlResetLastError();
12927        if (mem_base != xmlMemBlocks()) {
12928            printf("Leak of %d blocks found in xmlCtxtResetPush",
12929	           xmlMemBlocks() - mem_base);
12930	    test_ret++;
12931            printf(" %d", n_ctxt);
12932            printf(" %d", n_chunk);
12933            printf(" %d", n_size);
12934            printf(" %d", n_filename);
12935            printf(" %d", n_encoding);
12936            printf("\n");
12937        }
12938    }
12939    }
12940    }
12941    }
12942    }
12943    function_tests++;
12944
12945    return(test_ret);
12946}
12947
12948
12949static int
12950test_xmlCtxtUseOptions(void) {
12951    int test_ret = 0;
12952
12953    int mem_base;
12954    int ret_val;
12955    xmlParserCtxtPtr ctxt; /* an XML parser context */
12956    int n_ctxt;
12957    int options; /* a combination of xmlParserOption */
12958    int n_options;
12959
12960    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12961    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12962        mem_base = xmlMemBlocks();
12963        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12964        options = gen_parseroptions(n_options, 1);
12965
12966        ret_val = xmlCtxtUseOptions(ctxt, options);
12967        desret_int(ret_val);
12968        call_tests++;
12969        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12970        des_parseroptions(n_options, options, 1);
12971        xmlResetLastError();
12972        if (mem_base != xmlMemBlocks()) {
12973            printf("Leak of %d blocks found in xmlCtxtUseOptions",
12974	           xmlMemBlocks() - mem_base);
12975	    test_ret++;
12976            printf(" %d", n_ctxt);
12977            printf(" %d", n_options);
12978            printf("\n");
12979        }
12980    }
12981    }
12982    function_tests++;
12983
12984    return(test_ret);
12985}
12986
12987
12988static int
12989test_xmlGetExternalEntityLoader(void) {
12990    int test_ret = 0;
12991
12992
12993    /* missing type support */
12994    return(test_ret);
12995}
12996
12997
12998static int
12999test_xmlGetFeature(void) {
13000    int test_ret = 0;
13001
13002#ifdef LIBXML_LEGACY_ENABLED
13003    int mem_base;
13004    int ret_val;
13005    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13006    int n_ctxt;
13007    char * name; /* the feature name */
13008    int n_name;
13009    void * result; /* location to store the result */
13010    int n_result;
13011
13012    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13013    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13014    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13015        mem_base = xmlMemBlocks();
13016        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13017        name = gen_const_char_ptr(n_name, 1);
13018        result = gen_void_ptr(n_result, 2);
13019
13020        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13021        desret_int(ret_val);
13022        call_tests++;
13023        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13024        des_const_char_ptr(n_name, (const char *)name, 1);
13025        des_void_ptr(n_result, result, 2);
13026        xmlResetLastError();
13027        if (mem_base != xmlMemBlocks()) {
13028            printf("Leak of %d blocks found in xmlGetFeature",
13029	           xmlMemBlocks() - mem_base);
13030	    test_ret++;
13031            printf(" %d", n_ctxt);
13032            printf(" %d", n_name);
13033            printf(" %d", n_result);
13034            printf("\n");
13035        }
13036    }
13037    }
13038    }
13039    function_tests++;
13040#endif
13041
13042    return(test_ret);
13043}
13044
13045
13046#define gen_nb_const_char_ptr_ptr 1
13047static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13048    return(NULL);
13049}
13050static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13051}
13052
13053static int
13054test_xmlGetFeaturesList(void) {
13055    int test_ret = 0;
13056
13057#ifdef LIBXML_LEGACY_ENABLED
13058    int mem_base;
13059    int ret_val;
13060    int * len; /* the length of the features name array (input/output) */
13061    int n_len;
13062    char ** result; /* an array of string to be filled with the features name. */
13063    int n_result;
13064
13065    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13066    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13067        mem_base = xmlMemBlocks();
13068        len = gen_int_ptr(n_len, 0);
13069        result = gen_const_char_ptr_ptr(n_result, 1);
13070
13071        ret_val = xmlGetFeaturesList(len, (const char **)result);
13072        desret_int(ret_val);
13073        call_tests++;
13074        des_int_ptr(n_len, len, 0);
13075        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13076        xmlResetLastError();
13077        if (mem_base != xmlMemBlocks()) {
13078            printf("Leak of %d blocks found in xmlGetFeaturesList",
13079	           xmlMemBlocks() - mem_base);
13080	    test_ret++;
13081            printf(" %d", n_len);
13082            printf(" %d", n_result);
13083            printf("\n");
13084        }
13085    }
13086    }
13087    function_tests++;
13088#endif
13089
13090    return(test_ret);
13091}
13092
13093
13094static int
13095test_xmlIOParseDTD(void) {
13096    int test_ret = 0;
13097
13098#ifdef LIBXML_VALID_ENABLED
13099    int mem_base;
13100    xmlDtdPtr ret_val;
13101    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13102    int n_sax;
13103    xmlParserInputBufferPtr input; /* an Input Buffer */
13104    int n_input;
13105    xmlCharEncoding enc; /* the charset encoding if known */
13106    int n_enc;
13107
13108    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13109    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13110    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13111        mem_base = xmlMemBlocks();
13112        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13113        input = gen_xmlParserInputBufferPtr(n_input, 1);
13114        enc = gen_xmlCharEncoding(n_enc, 2);
13115
13116        ret_val = xmlIOParseDTD(sax, input, enc);
13117        input = NULL;
13118        desret_xmlDtdPtr(ret_val);
13119        call_tests++;
13120        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13121        des_xmlParserInputBufferPtr(n_input, input, 1);
13122        des_xmlCharEncoding(n_enc, enc, 2);
13123        xmlResetLastError();
13124        if (mem_base != xmlMemBlocks()) {
13125            printf("Leak of %d blocks found in xmlIOParseDTD",
13126	           xmlMemBlocks() - mem_base);
13127	    test_ret++;
13128            printf(" %d", n_sax);
13129            printf(" %d", n_input);
13130            printf(" %d", n_enc);
13131            printf("\n");
13132        }
13133    }
13134    }
13135    }
13136    function_tests++;
13137#endif
13138
13139    return(test_ret);
13140}
13141
13142
13143static int
13144test_xmlInitNodeInfoSeq(void) {
13145    int test_ret = 0;
13146
13147    int mem_base;
13148    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13149    int n_seq;
13150
13151    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13152        mem_base = xmlMemBlocks();
13153        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13154
13155        xmlInitNodeInfoSeq(seq);
13156        call_tests++;
13157        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13158        xmlResetLastError();
13159        if (mem_base != xmlMemBlocks()) {
13160            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13161	           xmlMemBlocks() - mem_base);
13162	    test_ret++;
13163            printf(" %d", n_seq);
13164            printf("\n");
13165        }
13166    }
13167    function_tests++;
13168
13169    return(test_ret);
13170}
13171
13172
13173static int
13174test_xmlInitParser(void) {
13175    int test_ret = 0;
13176
13177    int mem_base;
13178
13179        mem_base = xmlMemBlocks();
13180
13181        xmlInitParser();
13182        call_tests++;
13183        xmlResetLastError();
13184        if (mem_base != xmlMemBlocks()) {
13185            printf("Leak of %d blocks found in xmlInitParser",
13186	           xmlMemBlocks() - mem_base);
13187	    test_ret++;
13188            printf("\n");
13189        }
13190    function_tests++;
13191
13192    return(test_ret);
13193}
13194
13195
13196static int
13197test_xmlInitParserCtxt(void) {
13198    int test_ret = 0;
13199
13200    int mem_base;
13201    int ret_val;
13202    xmlParserCtxtPtr ctxt; /* an XML parser context */
13203    int n_ctxt;
13204
13205    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13206        mem_base = xmlMemBlocks();
13207        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13208
13209        ret_val = xmlInitParserCtxt(ctxt);
13210        desret_int(ret_val);
13211        call_tests++;
13212        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13213        xmlResetLastError();
13214        if (mem_base != xmlMemBlocks()) {
13215            printf("Leak of %d blocks found in xmlInitParserCtxt",
13216	           xmlMemBlocks() - mem_base);
13217	    test_ret++;
13218            printf(" %d", n_ctxt);
13219            printf("\n");
13220        }
13221    }
13222    function_tests++;
13223
13224    return(test_ret);
13225}
13226
13227
13228static int
13229test_xmlKeepBlanksDefault(void) {
13230    int test_ret = 0;
13231
13232    int mem_base;
13233    int ret_val;
13234    int val; /* int 0 or 1 */
13235    int n_val;
13236
13237    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13238        mem_base = xmlMemBlocks();
13239        val = gen_int(n_val, 0);
13240
13241        ret_val = xmlKeepBlanksDefault(val);
13242        desret_int(ret_val);
13243        call_tests++;
13244        des_int(n_val, val, 0);
13245        xmlResetLastError();
13246        if (mem_base != xmlMemBlocks()) {
13247            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13248	           xmlMemBlocks() - mem_base);
13249	    test_ret++;
13250            printf(" %d", n_val);
13251            printf("\n");
13252        }
13253    }
13254    function_tests++;
13255
13256    return(test_ret);
13257}
13258
13259
13260static int
13261test_xmlLineNumbersDefault(void) {
13262    int test_ret = 0;
13263
13264    int mem_base;
13265    int ret_val;
13266    int val; /* int 0 or 1 */
13267    int n_val;
13268
13269    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13270        mem_base = xmlMemBlocks();
13271        val = gen_int(n_val, 0);
13272
13273        ret_val = xmlLineNumbersDefault(val);
13274        desret_int(ret_val);
13275        call_tests++;
13276        des_int(n_val, val, 0);
13277        xmlResetLastError();
13278        if (mem_base != xmlMemBlocks()) {
13279            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13280	           xmlMemBlocks() - mem_base);
13281	    test_ret++;
13282            printf(" %d", n_val);
13283            printf("\n");
13284        }
13285    }
13286    function_tests++;
13287
13288    return(test_ret);
13289}
13290
13291
13292static int
13293test_xmlLoadExternalEntity(void) {
13294    int test_ret = 0;
13295
13296    int mem_base;
13297    xmlParserInputPtr ret_val;
13298    const char * URL; /* the URL for the entity to load */
13299    int n_URL;
13300    char * ID; /* the Public ID for the entity to load */
13301    int n_ID;
13302    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13303    int n_ctxt;
13304
13305    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13306    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13307    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13308        mem_base = xmlMemBlocks();
13309        URL = gen_filepath(n_URL, 0);
13310        ID = gen_const_char_ptr(n_ID, 1);
13311        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13312
13313        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13314        desret_xmlParserInputPtr(ret_val);
13315        call_tests++;
13316        des_filepath(n_URL, URL, 0);
13317        des_const_char_ptr(n_ID, (const char *)ID, 1);
13318        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13319        xmlResetLastError();
13320        if (mem_base != xmlMemBlocks()) {
13321            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13322	           xmlMemBlocks() - mem_base);
13323	    test_ret++;
13324            printf(" %d", n_URL);
13325            printf(" %d", n_ID);
13326            printf(" %d", n_ctxt);
13327            printf("\n");
13328        }
13329    }
13330    }
13331    }
13332    function_tests++;
13333
13334    return(test_ret);
13335}
13336
13337
13338static int
13339test_xmlNewIOInputStream(void) {
13340    int test_ret = 0;
13341
13342    int mem_base;
13343    xmlParserInputPtr ret_val;
13344    xmlParserCtxtPtr ctxt; /* an XML parser context */
13345    int n_ctxt;
13346    xmlParserInputBufferPtr input; /* an I/O Input */
13347    int n_input;
13348    xmlCharEncoding enc; /* the charset encoding if known */
13349    int n_enc;
13350
13351    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13352    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13353    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13354        mem_base = xmlMemBlocks();
13355        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13356        input = gen_xmlParserInputBufferPtr(n_input, 1);
13357        enc = gen_xmlCharEncoding(n_enc, 2);
13358
13359        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13360        if (ret_val != NULL) input = NULL;
13361        desret_xmlParserInputPtr(ret_val);
13362        call_tests++;
13363        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13364        des_xmlParserInputBufferPtr(n_input, input, 1);
13365        des_xmlCharEncoding(n_enc, enc, 2);
13366        xmlResetLastError();
13367        if (mem_base != xmlMemBlocks()) {
13368            printf("Leak of %d blocks found in xmlNewIOInputStream",
13369	           xmlMemBlocks() - mem_base);
13370	    test_ret++;
13371            printf(" %d", n_ctxt);
13372            printf(" %d", n_input);
13373            printf(" %d", n_enc);
13374            printf("\n");
13375        }
13376    }
13377    }
13378    }
13379    function_tests++;
13380
13381    return(test_ret);
13382}
13383
13384
13385static int
13386test_xmlNewParserCtxt(void) {
13387    int test_ret = 0;
13388
13389    int mem_base;
13390    xmlParserCtxtPtr ret_val;
13391
13392        mem_base = xmlMemBlocks();
13393
13394        ret_val = xmlNewParserCtxt();
13395        desret_xmlParserCtxtPtr(ret_val);
13396        call_tests++;
13397        xmlResetLastError();
13398        if (mem_base != xmlMemBlocks()) {
13399            printf("Leak of %d blocks found in xmlNewParserCtxt",
13400	           xmlMemBlocks() - mem_base);
13401	    test_ret++;
13402            printf("\n");
13403        }
13404    function_tests++;
13405
13406    return(test_ret);
13407}
13408
13409
13410#define gen_nb_xmlNodePtr_ptr 1
13411static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13412    return(NULL);
13413}
13414static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13415}
13416
13417static int
13418test_xmlParseBalancedChunkMemory(void) {
13419    int test_ret = 0;
13420
13421#ifdef LIBXML_SAX1_ENABLED
13422    int mem_base;
13423    int ret_val;
13424    xmlDocPtr doc; /* the document the chunk pertains to */
13425    int n_doc;
13426    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13427    int n_sax;
13428    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13429    int n_user_data;
13430    int depth; /* Used for loop detection, use 0 */
13431    int n_depth;
13432    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13433    int n_string;
13434    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13435    int n_lst;
13436
13437    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13438    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13439    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13440    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13441    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13442    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13443        mem_base = xmlMemBlocks();
13444        doc = gen_xmlDocPtr(n_doc, 0);
13445        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13446        user_data = gen_userdata(n_user_data, 2);
13447        depth = gen_int(n_depth, 3);
13448        string = gen_const_xmlChar_ptr(n_string, 4);
13449        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13450
13451#ifdef LIBXML_SAX1_ENABLED
13452        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13453#endif
13454
13455
13456        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13457        desret_int(ret_val);
13458        call_tests++;
13459        des_xmlDocPtr(n_doc, doc, 0);
13460        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13461        des_userdata(n_user_data, user_data, 2);
13462        des_int(n_depth, depth, 3);
13463        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13464        des_xmlNodePtr_ptr(n_lst, lst, 5);
13465        xmlResetLastError();
13466        if (mem_base != xmlMemBlocks()) {
13467            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13468	           xmlMemBlocks() - mem_base);
13469	    test_ret++;
13470            printf(" %d", n_doc);
13471            printf(" %d", n_sax);
13472            printf(" %d", n_user_data);
13473            printf(" %d", n_depth);
13474            printf(" %d", n_string);
13475            printf(" %d", n_lst);
13476            printf("\n");
13477        }
13478    }
13479    }
13480    }
13481    }
13482    }
13483    }
13484    function_tests++;
13485#endif
13486
13487    return(test_ret);
13488}
13489
13490
13491static int
13492test_xmlParseBalancedChunkMemoryRecover(void) {
13493    int test_ret = 0;
13494
13495#ifdef LIBXML_SAX1_ENABLED
13496    int mem_base;
13497    int ret_val;
13498    xmlDocPtr doc; /* the document the chunk pertains to */
13499    int n_doc;
13500    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13501    int n_sax;
13502    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13503    int n_user_data;
13504    int depth; /* Used for loop detection, use 0 */
13505    int n_depth;
13506    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13507    int n_string;
13508    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13509    int n_lst;
13510    int recover; /* return nodes even if the data is broken (use 0) */
13511    int n_recover;
13512
13513    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13514    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13515    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13516    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13517    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13518    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13519    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13520        mem_base = xmlMemBlocks();
13521        doc = gen_xmlDocPtr(n_doc, 0);
13522        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13523        user_data = gen_userdata(n_user_data, 2);
13524        depth = gen_int(n_depth, 3);
13525        string = gen_const_xmlChar_ptr(n_string, 4);
13526        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13527        recover = gen_int(n_recover, 6);
13528
13529#ifdef LIBXML_SAX1_ENABLED
13530        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13531#endif
13532
13533
13534        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13535        desret_int(ret_val);
13536        call_tests++;
13537        des_xmlDocPtr(n_doc, doc, 0);
13538        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13539        des_userdata(n_user_data, user_data, 2);
13540        des_int(n_depth, depth, 3);
13541        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13542        des_xmlNodePtr_ptr(n_lst, lst, 5);
13543        des_int(n_recover, recover, 6);
13544        xmlResetLastError();
13545        if (mem_base != xmlMemBlocks()) {
13546            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13547	           xmlMemBlocks() - mem_base);
13548	    test_ret++;
13549            printf(" %d", n_doc);
13550            printf(" %d", n_sax);
13551            printf(" %d", n_user_data);
13552            printf(" %d", n_depth);
13553            printf(" %d", n_string);
13554            printf(" %d", n_lst);
13555            printf(" %d", n_recover);
13556            printf("\n");
13557        }
13558    }
13559    }
13560    }
13561    }
13562    }
13563    }
13564    }
13565    function_tests++;
13566#endif
13567
13568    return(test_ret);
13569}
13570
13571
13572static int
13573test_xmlParseChunk(void) {
13574    int test_ret = 0;
13575
13576#ifdef LIBXML_PUSH_ENABLED
13577    int mem_base;
13578    int ret_val;
13579    xmlParserCtxtPtr ctxt; /* an XML parser context */
13580    int n_ctxt;
13581    char * chunk; /* an char array */
13582    int n_chunk;
13583    int size; /* the size in byte of the chunk */
13584    int n_size;
13585    int terminate; /* last chunk indicator */
13586    int n_terminate;
13587
13588    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13589    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13590    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13591    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13592        mem_base = xmlMemBlocks();
13593        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13594        chunk = gen_const_char_ptr(n_chunk, 1);
13595        size = gen_int(n_size, 2);
13596        terminate = gen_int(n_terminate, 3);
13597
13598        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13599        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13600        desret_int(ret_val);
13601        call_tests++;
13602        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13603        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13604        des_int(n_size, size, 2);
13605        des_int(n_terminate, terminate, 3);
13606        xmlResetLastError();
13607        if (mem_base != xmlMemBlocks()) {
13608            printf("Leak of %d blocks found in xmlParseChunk",
13609	           xmlMemBlocks() - mem_base);
13610	    test_ret++;
13611            printf(" %d", n_ctxt);
13612            printf(" %d", n_chunk);
13613            printf(" %d", n_size);
13614            printf(" %d", n_terminate);
13615            printf("\n");
13616        }
13617    }
13618    }
13619    }
13620    }
13621    function_tests++;
13622#endif
13623
13624    return(test_ret);
13625}
13626
13627
13628static int
13629test_xmlParseCtxtExternalEntity(void) {
13630    int test_ret = 0;
13631
13632    int mem_base;
13633    int ret_val;
13634    xmlParserCtxtPtr ctx; /* the existing parsing context */
13635    int n_ctx;
13636    xmlChar * URL; /* the URL for the entity to load */
13637    int n_URL;
13638    xmlChar * ID; /* the System ID for the entity to load */
13639    int n_ID;
13640    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13641    int n_lst;
13642
13643    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13644    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13645    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13646    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13647        mem_base = xmlMemBlocks();
13648        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13649        URL = gen_const_xmlChar_ptr(n_URL, 1);
13650        ID = gen_const_xmlChar_ptr(n_ID, 2);
13651        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13652
13653        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13654        desret_int(ret_val);
13655        call_tests++;
13656        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13657        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13658        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13659        des_xmlNodePtr_ptr(n_lst, lst, 3);
13660        xmlResetLastError();
13661        if (mem_base != xmlMemBlocks()) {
13662            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13663	           xmlMemBlocks() - mem_base);
13664	    test_ret++;
13665            printf(" %d", n_ctx);
13666            printf(" %d", n_URL);
13667            printf(" %d", n_ID);
13668            printf(" %d", n_lst);
13669            printf("\n");
13670        }
13671    }
13672    }
13673    }
13674    }
13675    function_tests++;
13676
13677    return(test_ret);
13678}
13679
13680
13681static int
13682test_xmlParseDTD(void) {
13683    int test_ret = 0;
13684
13685#ifdef LIBXML_VALID_ENABLED
13686    int mem_base;
13687    xmlDtdPtr ret_val;
13688    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13689    int n_ExternalID;
13690    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13691    int n_SystemID;
13692
13693    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13694    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13695        mem_base = xmlMemBlocks();
13696        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13697        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13698
13699        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13700        desret_xmlDtdPtr(ret_val);
13701        call_tests++;
13702        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13703        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13704        xmlResetLastError();
13705        if (mem_base != xmlMemBlocks()) {
13706            printf("Leak of %d blocks found in xmlParseDTD",
13707	           xmlMemBlocks() - mem_base);
13708	    test_ret++;
13709            printf(" %d", n_ExternalID);
13710            printf(" %d", n_SystemID);
13711            printf("\n");
13712        }
13713    }
13714    }
13715    function_tests++;
13716#endif
13717
13718    return(test_ret);
13719}
13720
13721
13722static int
13723test_xmlParseDoc(void) {
13724    int test_ret = 0;
13725
13726#ifdef LIBXML_SAX1_ENABLED
13727    int mem_base;
13728    xmlDocPtr ret_val;
13729    xmlChar * cur; /* a pointer to an array of xmlChar */
13730    int n_cur;
13731
13732    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
13733        mem_base = xmlMemBlocks();
13734        cur = gen_xmlChar_ptr(n_cur, 0);
13735
13736        ret_val = xmlParseDoc(cur);
13737        desret_xmlDocPtr(ret_val);
13738        call_tests++;
13739        des_xmlChar_ptr(n_cur, cur, 0);
13740        xmlResetLastError();
13741        if (mem_base != xmlMemBlocks()) {
13742            printf("Leak of %d blocks found in xmlParseDoc",
13743	           xmlMemBlocks() - mem_base);
13744	    test_ret++;
13745            printf(" %d", n_cur);
13746            printf("\n");
13747        }
13748    }
13749    function_tests++;
13750#endif
13751
13752    return(test_ret);
13753}
13754
13755
13756static int
13757test_xmlParseDocument(void) {
13758    int test_ret = 0;
13759
13760    int mem_base;
13761    int ret_val;
13762    xmlParserCtxtPtr ctxt; /* an XML parser context */
13763    int n_ctxt;
13764
13765    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13766        mem_base = xmlMemBlocks();
13767        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13768
13769        ret_val = xmlParseDocument(ctxt);
13770        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13771        desret_int(ret_val);
13772        call_tests++;
13773        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13774        xmlResetLastError();
13775        if (mem_base != xmlMemBlocks()) {
13776            printf("Leak of %d blocks found in xmlParseDocument",
13777	           xmlMemBlocks() - mem_base);
13778	    test_ret++;
13779            printf(" %d", n_ctxt);
13780            printf("\n");
13781        }
13782    }
13783    function_tests++;
13784
13785    return(test_ret);
13786}
13787
13788
13789static int
13790test_xmlParseEntity(void) {
13791    int test_ret = 0;
13792
13793#ifdef LIBXML_SAX1_ENABLED
13794    int mem_base;
13795    xmlDocPtr ret_val;
13796    const char * filename; /* the filename */
13797    int n_filename;
13798
13799    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13800        mem_base = xmlMemBlocks();
13801        filename = gen_filepath(n_filename, 0);
13802
13803        ret_val = xmlParseEntity(filename);
13804        desret_xmlDocPtr(ret_val);
13805        call_tests++;
13806        des_filepath(n_filename, filename, 0);
13807        xmlResetLastError();
13808        if (mem_base != xmlMemBlocks()) {
13809            printf("Leak of %d blocks found in xmlParseEntity",
13810	           xmlMemBlocks() - mem_base);
13811	    test_ret++;
13812            printf(" %d", n_filename);
13813            printf("\n");
13814        }
13815    }
13816    function_tests++;
13817#endif
13818
13819    return(test_ret);
13820}
13821
13822
13823static int
13824test_xmlParseExtParsedEnt(void) {
13825    int test_ret = 0;
13826
13827    int mem_base;
13828    int ret_val;
13829    xmlParserCtxtPtr ctxt; /* an XML parser context */
13830    int n_ctxt;
13831
13832    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13833        mem_base = xmlMemBlocks();
13834        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13835
13836        ret_val = xmlParseExtParsedEnt(ctxt);
13837        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13838        desret_int(ret_val);
13839        call_tests++;
13840        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13841        xmlResetLastError();
13842        if (mem_base != xmlMemBlocks()) {
13843            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13844	           xmlMemBlocks() - mem_base);
13845	    test_ret++;
13846            printf(" %d", n_ctxt);
13847            printf("\n");
13848        }
13849    }
13850    function_tests++;
13851
13852    return(test_ret);
13853}
13854
13855
13856static int
13857test_xmlParseExternalEntity(void) {
13858    int test_ret = 0;
13859
13860#ifdef LIBXML_SAX1_ENABLED
13861    int mem_base;
13862    int ret_val;
13863    xmlDocPtr doc; /* the document the chunk pertains to */
13864    int n_doc;
13865    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13866    int n_sax;
13867    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13868    int n_user_data;
13869    int depth; /* Used for loop detection, use 0 */
13870    int n_depth;
13871    xmlChar * URL; /* the URL for the entity to load */
13872    int n_URL;
13873    xmlChar * ID; /* the System ID for the entity to load */
13874    int n_ID;
13875    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13876    int n_lst;
13877
13878    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13879    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13880    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13881    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13882    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13883    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13884    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13885        mem_base = xmlMemBlocks();
13886        doc = gen_xmlDocPtr(n_doc, 0);
13887        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13888        user_data = gen_userdata(n_user_data, 2);
13889        depth = gen_int(n_depth, 3);
13890        URL = gen_const_xmlChar_ptr(n_URL, 4);
13891        ID = gen_const_xmlChar_ptr(n_ID, 5);
13892        lst = gen_xmlNodePtr_ptr(n_lst, 6);
13893
13894        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13895        desret_int(ret_val);
13896        call_tests++;
13897        des_xmlDocPtr(n_doc, doc, 0);
13898        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13899        des_userdata(n_user_data, user_data, 2);
13900        des_int(n_depth, depth, 3);
13901        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13902        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13903        des_xmlNodePtr_ptr(n_lst, lst, 6);
13904        xmlResetLastError();
13905        if (mem_base != xmlMemBlocks()) {
13906            printf("Leak of %d blocks found in xmlParseExternalEntity",
13907	           xmlMemBlocks() - mem_base);
13908	    test_ret++;
13909            printf(" %d", n_doc);
13910            printf(" %d", n_sax);
13911            printf(" %d", n_user_data);
13912            printf(" %d", n_depth);
13913            printf(" %d", n_URL);
13914            printf(" %d", n_ID);
13915            printf(" %d", n_lst);
13916            printf("\n");
13917        }
13918    }
13919    }
13920    }
13921    }
13922    }
13923    }
13924    }
13925    function_tests++;
13926#endif
13927
13928    return(test_ret);
13929}
13930
13931
13932static int
13933test_xmlParseFile(void) {
13934    int test_ret = 0;
13935
13936#ifdef LIBXML_SAX1_ENABLED
13937    int mem_base;
13938    xmlDocPtr ret_val;
13939    const char * filename; /* the filename */
13940    int n_filename;
13941
13942    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13943        mem_base = xmlMemBlocks();
13944        filename = gen_filepath(n_filename, 0);
13945
13946        ret_val = xmlParseFile(filename);
13947        desret_xmlDocPtr(ret_val);
13948        call_tests++;
13949        des_filepath(n_filename, filename, 0);
13950        xmlResetLastError();
13951        if (mem_base != xmlMemBlocks()) {
13952            printf("Leak of %d blocks found in xmlParseFile",
13953	           xmlMemBlocks() - mem_base);
13954	    test_ret++;
13955            printf(" %d", n_filename);
13956            printf("\n");
13957        }
13958    }
13959    function_tests++;
13960#endif
13961
13962    return(test_ret);
13963}
13964
13965
13966static int
13967test_xmlParseInNodeContext(void) {
13968    int test_ret = 0;
13969
13970    int mem_base;
13971    xmlParserErrors ret_val;
13972    xmlNodePtr node; /* the context node */
13973    int n_node;
13974    char * data; /* the input string */
13975    int n_data;
13976    int datalen; /* the input string length in bytes */
13977    int n_datalen;
13978    int options; /* a combination of xmlParserOption */
13979    int n_options;
13980    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13981    int n_lst;
13982
13983    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
13984    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
13985    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
13986    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13987    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13988        mem_base = xmlMemBlocks();
13989        node = gen_xmlNodePtr(n_node, 0);
13990        data = gen_const_char_ptr(n_data, 1);
13991        datalen = gen_int(n_datalen, 2);
13992        options = gen_parseroptions(n_options, 3);
13993        lst = gen_xmlNodePtr_ptr(n_lst, 4);
13994
13995        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
13996        desret_xmlParserErrors(ret_val);
13997        call_tests++;
13998        des_xmlNodePtr(n_node, node, 0);
13999        des_const_char_ptr(n_data, (const char *)data, 1);
14000        des_int(n_datalen, datalen, 2);
14001        des_parseroptions(n_options, options, 3);
14002        des_xmlNodePtr_ptr(n_lst, lst, 4);
14003        xmlResetLastError();
14004        if (mem_base != xmlMemBlocks()) {
14005            printf("Leak of %d blocks found in xmlParseInNodeContext",
14006	           xmlMemBlocks() - mem_base);
14007	    test_ret++;
14008            printf(" %d", n_node);
14009            printf(" %d", n_data);
14010            printf(" %d", n_datalen);
14011            printf(" %d", n_options);
14012            printf(" %d", n_lst);
14013            printf("\n");
14014        }
14015    }
14016    }
14017    }
14018    }
14019    }
14020    function_tests++;
14021
14022    return(test_ret);
14023}
14024
14025
14026static int
14027test_xmlParseMemory(void) {
14028    int test_ret = 0;
14029
14030#ifdef LIBXML_SAX1_ENABLED
14031    int mem_base;
14032    xmlDocPtr ret_val;
14033    char * buffer; /* an pointer to a char array */
14034    int n_buffer;
14035    int size; /* the size of the array */
14036    int n_size;
14037
14038    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14039    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14040        mem_base = xmlMemBlocks();
14041        buffer = gen_const_char_ptr(n_buffer, 0);
14042        size = gen_int(n_size, 1);
14043
14044        ret_val = xmlParseMemory((const char *)buffer, size);
14045        desret_xmlDocPtr(ret_val);
14046        call_tests++;
14047        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14048        des_int(n_size, size, 1);
14049        xmlResetLastError();
14050        if (mem_base != xmlMemBlocks()) {
14051            printf("Leak of %d blocks found in xmlParseMemory",
14052	           xmlMemBlocks() - mem_base);
14053	    test_ret++;
14054            printf(" %d", n_buffer);
14055            printf(" %d", n_size);
14056            printf("\n");
14057        }
14058    }
14059    }
14060    function_tests++;
14061#endif
14062
14063    return(test_ret);
14064}
14065
14066
14067#define gen_nb_const_xmlParserNodeInfoPtr 1
14068static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14069    return(NULL);
14070}
14071static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14072}
14073
14074static int
14075test_xmlParserAddNodeInfo(void) {
14076    int test_ret = 0;
14077
14078    int mem_base;
14079    xmlParserCtxtPtr ctxt; /* an XML parser context */
14080    int n_ctxt;
14081    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14082    int n_info;
14083
14084    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14085    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14086        mem_base = xmlMemBlocks();
14087        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14088        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14089
14090        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14091        call_tests++;
14092        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14093        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14094        xmlResetLastError();
14095        if (mem_base != xmlMemBlocks()) {
14096            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14097	           xmlMemBlocks() - mem_base);
14098	    test_ret++;
14099            printf(" %d", n_ctxt);
14100            printf(" %d", n_info);
14101            printf("\n");
14102        }
14103    }
14104    }
14105    function_tests++;
14106
14107    return(test_ret);
14108}
14109
14110
14111#define gen_nb_const_xmlParserCtxtPtr 1
14112static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14113    return(NULL);
14114}
14115static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14116}
14117
14118#define gen_nb_const_xmlNodePtr 1
14119static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14120    return(NULL);
14121}
14122static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14123}
14124
14125static int
14126test_xmlParserFindNodeInfo(void) {
14127    int test_ret = 0;
14128
14129    int mem_base;
14130    const xmlParserNodeInfo * ret_val;
14131    xmlParserCtxtPtr ctx; /* an XML parser context */
14132    int n_ctx;
14133    xmlNodePtr node; /* an XML node within the tree */
14134    int n_node;
14135
14136    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14137    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14138        mem_base = xmlMemBlocks();
14139        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14140        node = gen_const_xmlNodePtr(n_node, 1);
14141
14142        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14143        desret_const_xmlParserNodeInfo_ptr(ret_val);
14144        call_tests++;
14145        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14146        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14147        xmlResetLastError();
14148        if (mem_base != xmlMemBlocks()) {
14149            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14150	           xmlMemBlocks() - mem_base);
14151	    test_ret++;
14152            printf(" %d", n_ctx);
14153            printf(" %d", n_node);
14154            printf("\n");
14155        }
14156    }
14157    }
14158    function_tests++;
14159
14160    return(test_ret);
14161}
14162
14163
14164#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14165static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14166    return(NULL);
14167}
14168static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14169}
14170
14171static int
14172test_xmlParserFindNodeInfoIndex(void) {
14173    int test_ret = 0;
14174
14175    int mem_base;
14176    unsigned long ret_val;
14177    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14178    int n_seq;
14179    xmlNodePtr node; /* an XML node pointer */
14180    int n_node;
14181
14182    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14183    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14184        mem_base = xmlMemBlocks();
14185        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14186        node = gen_const_xmlNodePtr(n_node, 1);
14187
14188        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14189        desret_unsigned_long(ret_val);
14190        call_tests++;
14191        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14192        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14193        xmlResetLastError();
14194        if (mem_base != xmlMemBlocks()) {
14195            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14196	           xmlMemBlocks() - mem_base);
14197	    test_ret++;
14198            printf(" %d", n_seq);
14199            printf(" %d", n_node);
14200            printf("\n");
14201        }
14202    }
14203    }
14204    function_tests++;
14205
14206    return(test_ret);
14207}
14208
14209
14210#define gen_nb_xmlParserInputPtr 1
14211static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14212    return(NULL);
14213}
14214static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14215}
14216
14217static int
14218test_xmlParserInputGrow(void) {
14219    int test_ret = 0;
14220
14221    int mem_base;
14222    int ret_val;
14223    xmlParserInputPtr in; /* an XML parser input */
14224    int n_in;
14225    int len; /* an indicative size for the lookahead */
14226    int n_len;
14227
14228    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14229    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14230        mem_base = xmlMemBlocks();
14231        in = gen_xmlParserInputPtr(n_in, 0);
14232        len = gen_int(n_len, 1);
14233
14234        ret_val = xmlParserInputGrow(in, len);
14235        desret_int(ret_val);
14236        call_tests++;
14237        des_xmlParserInputPtr(n_in, in, 0);
14238        des_int(n_len, len, 1);
14239        xmlResetLastError();
14240        if (mem_base != xmlMemBlocks()) {
14241            printf("Leak of %d blocks found in xmlParserInputGrow",
14242	           xmlMemBlocks() - mem_base);
14243	    test_ret++;
14244            printf(" %d", n_in);
14245            printf(" %d", n_len);
14246            printf("\n");
14247        }
14248    }
14249    }
14250    function_tests++;
14251
14252    return(test_ret);
14253}
14254
14255
14256static int
14257test_xmlParserInputRead(void) {
14258    int test_ret = 0;
14259
14260    int mem_base;
14261    int ret_val;
14262    xmlParserInputPtr in; /* an XML parser input */
14263    int n_in;
14264    int len; /* an indicative size for the lookahead */
14265    int n_len;
14266
14267    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14268    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14269        mem_base = xmlMemBlocks();
14270        in = gen_xmlParserInputPtr(n_in, 0);
14271        len = gen_int(n_len, 1);
14272
14273        ret_val = xmlParserInputRead(in, len);
14274        desret_int(ret_val);
14275        call_tests++;
14276        des_xmlParserInputPtr(n_in, in, 0);
14277        des_int(n_len, len, 1);
14278        xmlResetLastError();
14279        if (mem_base != xmlMemBlocks()) {
14280            printf("Leak of %d blocks found in xmlParserInputRead",
14281	           xmlMemBlocks() - mem_base);
14282	    test_ret++;
14283            printf(" %d", n_in);
14284            printf(" %d", n_len);
14285            printf("\n");
14286        }
14287    }
14288    }
14289    function_tests++;
14290
14291    return(test_ret);
14292}
14293
14294
14295static int
14296test_xmlPedanticParserDefault(void) {
14297    int test_ret = 0;
14298
14299    int mem_base;
14300    int ret_val;
14301    int val; /* int 0 or 1 */
14302    int n_val;
14303
14304    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14305        mem_base = xmlMemBlocks();
14306        val = gen_int(n_val, 0);
14307
14308        ret_val = xmlPedanticParserDefault(val);
14309        desret_int(ret_val);
14310        call_tests++;
14311        des_int(n_val, val, 0);
14312        xmlResetLastError();
14313        if (mem_base != xmlMemBlocks()) {
14314            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14315	           xmlMemBlocks() - mem_base);
14316	    test_ret++;
14317            printf(" %d", n_val);
14318            printf("\n");
14319        }
14320    }
14321    function_tests++;
14322
14323    return(test_ret);
14324}
14325
14326
14327static int
14328test_xmlReadDoc(void) {
14329    int test_ret = 0;
14330
14331    int mem_base;
14332    xmlDocPtr ret_val;
14333    xmlChar * cur; /* a pointer to a zero terminated string */
14334    int n_cur;
14335    const char * URL; /* the base URL to use for the document */
14336    int n_URL;
14337    char * encoding; /* the document encoding, or NULL */
14338    int n_encoding;
14339    int options; /* a combination of xmlParserOption */
14340    int n_options;
14341
14342    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14343    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14344    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14345    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14346        mem_base = xmlMemBlocks();
14347        cur = gen_const_xmlChar_ptr(n_cur, 0);
14348        URL = gen_filepath(n_URL, 1);
14349        encoding = gen_const_char_ptr(n_encoding, 2);
14350        options = gen_parseroptions(n_options, 3);
14351
14352        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14353        desret_xmlDocPtr(ret_val);
14354        call_tests++;
14355        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14356        des_filepath(n_URL, URL, 1);
14357        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14358        des_parseroptions(n_options, options, 3);
14359        xmlResetLastError();
14360        if (mem_base != xmlMemBlocks()) {
14361            printf("Leak of %d blocks found in xmlReadDoc",
14362	           xmlMemBlocks() - mem_base);
14363	    test_ret++;
14364            printf(" %d", n_cur);
14365            printf(" %d", n_URL);
14366            printf(" %d", n_encoding);
14367            printf(" %d", n_options);
14368            printf("\n");
14369        }
14370    }
14371    }
14372    }
14373    }
14374    function_tests++;
14375
14376    return(test_ret);
14377}
14378
14379
14380static int
14381test_xmlReadFile(void) {
14382    int test_ret = 0;
14383
14384    int mem_base;
14385    xmlDocPtr ret_val;
14386    const char * filename; /* a file or URL */
14387    int n_filename;
14388    char * encoding; /* the document encoding, or NULL */
14389    int n_encoding;
14390    int options; /* a combination of xmlParserOption */
14391    int n_options;
14392
14393    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14394    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14395    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14396        mem_base = xmlMemBlocks();
14397        filename = gen_filepath(n_filename, 0);
14398        encoding = gen_const_char_ptr(n_encoding, 1);
14399        options = gen_parseroptions(n_options, 2);
14400
14401        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14402        desret_xmlDocPtr(ret_val);
14403        call_tests++;
14404        des_filepath(n_filename, filename, 0);
14405        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14406        des_parseroptions(n_options, options, 2);
14407        xmlResetLastError();
14408        if (mem_base != xmlMemBlocks()) {
14409            printf("Leak of %d blocks found in xmlReadFile",
14410	           xmlMemBlocks() - mem_base);
14411	    test_ret++;
14412            printf(" %d", n_filename);
14413            printf(" %d", n_encoding);
14414            printf(" %d", n_options);
14415            printf("\n");
14416        }
14417    }
14418    }
14419    }
14420    function_tests++;
14421
14422    return(test_ret);
14423}
14424
14425
14426static int
14427test_xmlReadMemory(void) {
14428    int test_ret = 0;
14429
14430    int mem_base;
14431    xmlDocPtr ret_val;
14432    char * buffer; /* a pointer to a char array */
14433    int n_buffer;
14434    int size; /* the size of the array */
14435    int n_size;
14436    const char * URL; /* the base URL to use for the document */
14437    int n_URL;
14438    char * encoding; /* the document encoding, or NULL */
14439    int n_encoding;
14440    int options; /* a combination of xmlParserOption */
14441    int n_options;
14442
14443    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14444    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14445    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14446    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14447    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14448        mem_base = xmlMemBlocks();
14449        buffer = gen_const_char_ptr(n_buffer, 0);
14450        size = gen_int(n_size, 1);
14451        URL = gen_filepath(n_URL, 2);
14452        encoding = gen_const_char_ptr(n_encoding, 3);
14453        options = gen_parseroptions(n_options, 4);
14454
14455        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14456        desret_xmlDocPtr(ret_val);
14457        call_tests++;
14458        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14459        des_int(n_size, size, 1);
14460        des_filepath(n_URL, URL, 2);
14461        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14462        des_parseroptions(n_options, options, 4);
14463        xmlResetLastError();
14464        if (mem_base != xmlMemBlocks()) {
14465            printf("Leak of %d blocks found in xmlReadMemory",
14466	           xmlMemBlocks() - mem_base);
14467	    test_ret++;
14468            printf(" %d", n_buffer);
14469            printf(" %d", n_size);
14470            printf(" %d", n_URL);
14471            printf(" %d", n_encoding);
14472            printf(" %d", n_options);
14473            printf("\n");
14474        }
14475    }
14476    }
14477    }
14478    }
14479    }
14480    function_tests++;
14481
14482    return(test_ret);
14483}
14484
14485
14486static int
14487test_xmlRecoverDoc(void) {
14488    int test_ret = 0;
14489
14490#ifdef LIBXML_SAX1_ENABLED
14491    int mem_base;
14492    xmlDocPtr ret_val;
14493    xmlChar * cur; /* a pointer to an array of xmlChar */
14494    int n_cur;
14495
14496    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14497        mem_base = xmlMemBlocks();
14498        cur = gen_xmlChar_ptr(n_cur, 0);
14499
14500        ret_val = xmlRecoverDoc(cur);
14501        desret_xmlDocPtr(ret_val);
14502        call_tests++;
14503        des_xmlChar_ptr(n_cur, cur, 0);
14504        xmlResetLastError();
14505        if (mem_base != xmlMemBlocks()) {
14506            printf("Leak of %d blocks found in xmlRecoverDoc",
14507	           xmlMemBlocks() - mem_base);
14508	    test_ret++;
14509            printf(" %d", n_cur);
14510            printf("\n");
14511        }
14512    }
14513    function_tests++;
14514#endif
14515
14516    return(test_ret);
14517}
14518
14519
14520static int
14521test_xmlRecoverFile(void) {
14522    int test_ret = 0;
14523
14524#ifdef LIBXML_SAX1_ENABLED
14525    int mem_base;
14526    xmlDocPtr ret_val;
14527    const char * filename; /* the filename */
14528    int n_filename;
14529
14530    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14531        mem_base = xmlMemBlocks();
14532        filename = gen_filepath(n_filename, 0);
14533
14534        ret_val = xmlRecoverFile(filename);
14535        desret_xmlDocPtr(ret_val);
14536        call_tests++;
14537        des_filepath(n_filename, filename, 0);
14538        xmlResetLastError();
14539        if (mem_base != xmlMemBlocks()) {
14540            printf("Leak of %d blocks found in xmlRecoverFile",
14541	           xmlMemBlocks() - mem_base);
14542	    test_ret++;
14543            printf(" %d", n_filename);
14544            printf("\n");
14545        }
14546    }
14547    function_tests++;
14548#endif
14549
14550    return(test_ret);
14551}
14552
14553
14554static int
14555test_xmlRecoverMemory(void) {
14556    int test_ret = 0;
14557
14558#ifdef LIBXML_SAX1_ENABLED
14559    int mem_base;
14560    xmlDocPtr ret_val;
14561    char * buffer; /* an pointer to a char array */
14562    int n_buffer;
14563    int size; /* the size of the array */
14564    int n_size;
14565
14566    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14567    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14568        mem_base = xmlMemBlocks();
14569        buffer = gen_const_char_ptr(n_buffer, 0);
14570        size = gen_int(n_size, 1);
14571
14572        ret_val = xmlRecoverMemory((const char *)buffer, size);
14573        desret_xmlDocPtr(ret_val);
14574        call_tests++;
14575        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14576        des_int(n_size, size, 1);
14577        xmlResetLastError();
14578        if (mem_base != xmlMemBlocks()) {
14579            printf("Leak of %d blocks found in xmlRecoverMemory",
14580	           xmlMemBlocks() - mem_base);
14581	    test_ret++;
14582            printf(" %d", n_buffer);
14583            printf(" %d", n_size);
14584            printf("\n");
14585        }
14586    }
14587    }
14588    function_tests++;
14589#endif
14590
14591    return(test_ret);
14592}
14593
14594
14595static int
14596test_xmlSAXParseDTD(void) {
14597    int test_ret = 0;
14598
14599#ifdef LIBXML_SAX1_ENABLED
14600    int mem_base;
14601    xmlDtdPtr ret_val;
14602    xmlSAXHandlerPtr sax; /* the SAX handler block */
14603    int n_sax;
14604    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14605    int n_ExternalID;
14606    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14607    int n_SystemID;
14608
14609    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14610    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14611    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14612        mem_base = xmlMemBlocks();
14613        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14614        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14615        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14616
14617        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14618        desret_xmlDtdPtr(ret_val);
14619        call_tests++;
14620        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14621        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14622        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14623        xmlResetLastError();
14624        if (mem_base != xmlMemBlocks()) {
14625            printf("Leak of %d blocks found in xmlSAXParseDTD",
14626	           xmlMemBlocks() - mem_base);
14627	    test_ret++;
14628            printf(" %d", n_sax);
14629            printf(" %d", n_ExternalID);
14630            printf(" %d", n_SystemID);
14631            printf("\n");
14632        }
14633    }
14634    }
14635    }
14636    function_tests++;
14637#endif
14638
14639    return(test_ret);
14640}
14641
14642
14643static int
14644test_xmlSAXParseDoc(void) {
14645    int test_ret = 0;
14646
14647#ifdef LIBXML_SAX1_ENABLED
14648    int mem_base;
14649    xmlDocPtr ret_val;
14650    xmlSAXHandlerPtr sax; /* the SAX handler block */
14651    int n_sax;
14652    xmlChar * cur; /* a pointer to an array of xmlChar */
14653    int n_cur;
14654    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14655    int n_recovery;
14656
14657    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14658    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14659    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14660        mem_base = xmlMemBlocks();
14661        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14662        cur = gen_xmlChar_ptr(n_cur, 1);
14663        recovery = gen_int(n_recovery, 2);
14664
14665        ret_val = xmlSAXParseDoc(sax, cur, recovery);
14666        desret_xmlDocPtr(ret_val);
14667        call_tests++;
14668        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14669        des_xmlChar_ptr(n_cur, cur, 1);
14670        des_int(n_recovery, recovery, 2);
14671        xmlResetLastError();
14672        if (mem_base != xmlMemBlocks()) {
14673            printf("Leak of %d blocks found in xmlSAXParseDoc",
14674	           xmlMemBlocks() - mem_base);
14675	    test_ret++;
14676            printf(" %d", n_sax);
14677            printf(" %d", n_cur);
14678            printf(" %d", n_recovery);
14679            printf("\n");
14680        }
14681    }
14682    }
14683    }
14684    function_tests++;
14685#endif
14686
14687    return(test_ret);
14688}
14689
14690
14691static int
14692test_xmlSAXParseEntity(void) {
14693    int test_ret = 0;
14694
14695#ifdef LIBXML_SAX1_ENABLED
14696    int mem_base;
14697    xmlDocPtr ret_val;
14698    xmlSAXHandlerPtr sax; /* the SAX handler block */
14699    int n_sax;
14700    const char * filename; /* the filename */
14701    int n_filename;
14702
14703    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14704    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14705        mem_base = xmlMemBlocks();
14706        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14707        filename = gen_filepath(n_filename, 1);
14708
14709        ret_val = xmlSAXParseEntity(sax, filename);
14710        desret_xmlDocPtr(ret_val);
14711        call_tests++;
14712        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14713        des_filepath(n_filename, filename, 1);
14714        xmlResetLastError();
14715        if (mem_base != xmlMemBlocks()) {
14716            printf("Leak of %d blocks found in xmlSAXParseEntity",
14717	           xmlMemBlocks() - mem_base);
14718	    test_ret++;
14719            printf(" %d", n_sax);
14720            printf(" %d", n_filename);
14721            printf("\n");
14722        }
14723    }
14724    }
14725    function_tests++;
14726#endif
14727
14728    return(test_ret);
14729}
14730
14731
14732static int
14733test_xmlSAXParseFile(void) {
14734    int test_ret = 0;
14735
14736#ifdef LIBXML_SAX1_ENABLED
14737    int mem_base;
14738    xmlDocPtr ret_val;
14739    xmlSAXHandlerPtr sax; /* the SAX handler block */
14740    int n_sax;
14741    const char * filename; /* the filename */
14742    int n_filename;
14743    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14744    int n_recovery;
14745
14746    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14747    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14748    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14749        mem_base = xmlMemBlocks();
14750        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14751        filename = gen_filepath(n_filename, 1);
14752        recovery = gen_int(n_recovery, 2);
14753
14754        ret_val = xmlSAXParseFile(sax, filename, recovery);
14755        desret_xmlDocPtr(ret_val);
14756        call_tests++;
14757        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14758        des_filepath(n_filename, filename, 1);
14759        des_int(n_recovery, recovery, 2);
14760        xmlResetLastError();
14761        if (mem_base != xmlMemBlocks()) {
14762            printf("Leak of %d blocks found in xmlSAXParseFile",
14763	           xmlMemBlocks() - mem_base);
14764	    test_ret++;
14765            printf(" %d", n_sax);
14766            printf(" %d", n_filename);
14767            printf(" %d", n_recovery);
14768            printf("\n");
14769        }
14770    }
14771    }
14772    }
14773    function_tests++;
14774#endif
14775
14776    return(test_ret);
14777}
14778
14779
14780static int
14781test_xmlSAXParseFileWithData(void) {
14782    int test_ret = 0;
14783
14784#ifdef LIBXML_SAX1_ENABLED
14785    int mem_base;
14786    xmlDocPtr ret_val;
14787    xmlSAXHandlerPtr sax; /* the SAX handler block */
14788    int n_sax;
14789    const char * filename; /* the filename */
14790    int n_filename;
14791    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14792    int n_recovery;
14793    void * data; /* the userdata */
14794    int n_data;
14795
14796    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14797    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14798    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14799    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14800        mem_base = xmlMemBlocks();
14801        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14802        filename = gen_filepath(n_filename, 1);
14803        recovery = gen_int(n_recovery, 2);
14804        data = gen_userdata(n_data, 3);
14805
14806        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14807        desret_xmlDocPtr(ret_val);
14808        call_tests++;
14809        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14810        des_filepath(n_filename, filename, 1);
14811        des_int(n_recovery, recovery, 2);
14812        des_userdata(n_data, data, 3);
14813        xmlResetLastError();
14814        if (mem_base != xmlMemBlocks()) {
14815            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14816	           xmlMemBlocks() - mem_base);
14817	    test_ret++;
14818            printf(" %d", n_sax);
14819            printf(" %d", n_filename);
14820            printf(" %d", n_recovery);
14821            printf(" %d", n_data);
14822            printf("\n");
14823        }
14824    }
14825    }
14826    }
14827    }
14828    function_tests++;
14829#endif
14830
14831    return(test_ret);
14832}
14833
14834
14835static int
14836test_xmlSAXParseMemory(void) {
14837    int test_ret = 0;
14838
14839#ifdef LIBXML_SAX1_ENABLED
14840    int mem_base;
14841    xmlDocPtr ret_val;
14842    xmlSAXHandlerPtr sax; /* the SAX handler block */
14843    int n_sax;
14844    char * buffer; /* an pointer to a char array */
14845    int n_buffer;
14846    int size; /* the size of the array */
14847    int n_size;
14848    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14849    int n_recovery;
14850
14851    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14852    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14853    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14854    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14855        mem_base = xmlMemBlocks();
14856        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14857        buffer = gen_const_char_ptr(n_buffer, 1);
14858        size = gen_int(n_size, 2);
14859        recovery = gen_int(n_recovery, 3);
14860
14861        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14862        desret_xmlDocPtr(ret_val);
14863        call_tests++;
14864        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14865        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14866        des_int(n_size, size, 2);
14867        des_int(n_recovery, recovery, 3);
14868        xmlResetLastError();
14869        if (mem_base != xmlMemBlocks()) {
14870            printf("Leak of %d blocks found in xmlSAXParseMemory",
14871	           xmlMemBlocks() - mem_base);
14872	    test_ret++;
14873            printf(" %d", n_sax);
14874            printf(" %d", n_buffer);
14875            printf(" %d", n_size);
14876            printf(" %d", n_recovery);
14877            printf("\n");
14878        }
14879    }
14880    }
14881    }
14882    }
14883    function_tests++;
14884#endif
14885
14886    return(test_ret);
14887}
14888
14889
14890static int
14891test_xmlSAXParseMemoryWithData(void) {
14892    int test_ret = 0;
14893
14894#ifdef LIBXML_SAX1_ENABLED
14895    int mem_base;
14896    xmlDocPtr ret_val;
14897    xmlSAXHandlerPtr sax; /* the SAX handler block */
14898    int n_sax;
14899    char * buffer; /* an pointer to a char array */
14900    int n_buffer;
14901    int size; /* the size of the array */
14902    int n_size;
14903    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14904    int n_recovery;
14905    void * data; /* the userdata */
14906    int n_data;
14907
14908    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14909    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14910    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14911    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14912    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14913        mem_base = xmlMemBlocks();
14914        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14915        buffer = gen_const_char_ptr(n_buffer, 1);
14916        size = gen_int(n_size, 2);
14917        recovery = gen_int(n_recovery, 3);
14918        data = gen_userdata(n_data, 4);
14919
14920        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
14921        desret_xmlDocPtr(ret_val);
14922        call_tests++;
14923        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14924        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14925        des_int(n_size, size, 2);
14926        des_int(n_recovery, recovery, 3);
14927        des_userdata(n_data, data, 4);
14928        xmlResetLastError();
14929        if (mem_base != xmlMemBlocks()) {
14930            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
14931	           xmlMemBlocks() - mem_base);
14932	    test_ret++;
14933            printf(" %d", n_sax);
14934            printf(" %d", n_buffer);
14935            printf(" %d", n_size);
14936            printf(" %d", n_recovery);
14937            printf(" %d", n_data);
14938            printf("\n");
14939        }
14940    }
14941    }
14942    }
14943    }
14944    }
14945    function_tests++;
14946#endif
14947
14948    return(test_ret);
14949}
14950
14951
14952static int
14953test_xmlSAXUserParseFile(void) {
14954    int test_ret = 0;
14955
14956#ifdef LIBXML_SAX1_ENABLED
14957    int mem_base;
14958    int ret_val;
14959    xmlSAXHandlerPtr sax; /* a SAX handler */
14960    int n_sax;
14961    void * user_data; /* The user data returned on SAX callbacks */
14962    int n_user_data;
14963    const char * filename; /* a file name */
14964    int n_filename;
14965
14966    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14967    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14968    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14969        mem_base = xmlMemBlocks();
14970        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14971        user_data = gen_userdata(n_user_data, 1);
14972        filename = gen_filepath(n_filename, 2);
14973
14974#ifdef LIBXML_SAX1_ENABLED
14975        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
14976#endif
14977
14978
14979        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
14980        desret_int(ret_val);
14981        call_tests++;
14982        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14983        des_userdata(n_user_data, user_data, 1);
14984        des_filepath(n_filename, filename, 2);
14985        xmlResetLastError();
14986        if (mem_base != xmlMemBlocks()) {
14987            printf("Leak of %d blocks found in xmlSAXUserParseFile",
14988	           xmlMemBlocks() - mem_base);
14989	    test_ret++;
14990            printf(" %d", n_sax);
14991            printf(" %d", n_user_data);
14992            printf(" %d", n_filename);
14993            printf("\n");
14994        }
14995    }
14996    }
14997    }
14998    function_tests++;
14999#endif
15000
15001    return(test_ret);
15002}
15003
15004
15005static int
15006test_xmlSAXUserParseMemory(void) {
15007    int test_ret = 0;
15008
15009#ifdef LIBXML_SAX1_ENABLED
15010    int mem_base;
15011    int ret_val;
15012    xmlSAXHandlerPtr sax; /* a SAX handler */
15013    int n_sax;
15014    void * user_data; /* The user data returned on SAX callbacks */
15015    int n_user_data;
15016    char * buffer; /* an in-memory XML document input */
15017    int n_buffer;
15018    int size; /* the length of the XML document in bytes */
15019    int n_size;
15020
15021    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15022    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15023    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15024    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15025        mem_base = xmlMemBlocks();
15026        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15027        user_data = gen_userdata(n_user_data, 1);
15028        buffer = gen_const_char_ptr(n_buffer, 2);
15029        size = gen_int(n_size, 3);
15030
15031#ifdef LIBXML_SAX1_ENABLED
15032        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15033#endif
15034
15035
15036        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15037        desret_int(ret_val);
15038        call_tests++;
15039        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15040        des_userdata(n_user_data, user_data, 1);
15041        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15042        des_int(n_size, size, 3);
15043        xmlResetLastError();
15044        if (mem_base != xmlMemBlocks()) {
15045            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15046	           xmlMemBlocks() - mem_base);
15047	    test_ret++;
15048            printf(" %d", n_sax);
15049            printf(" %d", n_user_data);
15050            printf(" %d", n_buffer);
15051            printf(" %d", n_size);
15052            printf("\n");
15053        }
15054    }
15055    }
15056    }
15057    }
15058    function_tests++;
15059#endif
15060
15061    return(test_ret);
15062}
15063
15064
15065static int
15066test_xmlSetExternalEntityLoader(void) {
15067    int test_ret = 0;
15068
15069
15070    /* missing type support */
15071    return(test_ret);
15072}
15073
15074
15075static int
15076test_xmlSetFeature(void) {
15077    int test_ret = 0;
15078
15079#ifdef LIBXML_LEGACY_ENABLED
15080    int mem_base;
15081    int ret_val;
15082    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15083    int n_ctxt;
15084    char * name; /* the feature name */
15085    int n_name;
15086    void * value; /* pointer to the location of the new value */
15087    int n_value;
15088
15089    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15090    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15091    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15092        mem_base = xmlMemBlocks();
15093        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15094        name = gen_const_char_ptr(n_name, 1);
15095        value = gen_void_ptr(n_value, 2);
15096
15097        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15098        desret_int(ret_val);
15099        call_tests++;
15100        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15101        des_const_char_ptr(n_name, (const char *)name, 1);
15102        des_void_ptr(n_value, value, 2);
15103        xmlResetLastError();
15104        if (mem_base != xmlMemBlocks()) {
15105            printf("Leak of %d blocks found in xmlSetFeature",
15106	           xmlMemBlocks() - mem_base);
15107	    test_ret++;
15108            printf(" %d", n_ctxt);
15109            printf(" %d", n_name);
15110            printf(" %d", n_value);
15111            printf("\n");
15112        }
15113    }
15114    }
15115    }
15116    function_tests++;
15117#endif
15118
15119    return(test_ret);
15120}
15121
15122
15123static int
15124test_xmlSetupParserForBuffer(void) {
15125    int test_ret = 0;
15126
15127#ifdef LIBXML_SAX1_ENABLED
15128    int mem_base;
15129    xmlParserCtxtPtr ctxt; /* an XML parser context */
15130    int n_ctxt;
15131    xmlChar * buffer; /* a xmlChar * buffer */
15132    int n_buffer;
15133    const char * filename; /* a file name */
15134    int n_filename;
15135
15136    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15137    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15138    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15139        mem_base = xmlMemBlocks();
15140        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15141        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15142        filename = gen_filepath(n_filename, 2);
15143
15144        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15145        call_tests++;
15146        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15147        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15148        des_filepath(n_filename, filename, 2);
15149        xmlResetLastError();
15150        if (mem_base != xmlMemBlocks()) {
15151            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15152	           xmlMemBlocks() - mem_base);
15153	    test_ret++;
15154            printf(" %d", n_ctxt);
15155            printf(" %d", n_buffer);
15156            printf(" %d", n_filename);
15157            printf("\n");
15158        }
15159    }
15160    }
15161    }
15162    function_tests++;
15163#endif
15164
15165    return(test_ret);
15166}
15167
15168
15169static int
15170test_xmlStopParser(void) {
15171    int test_ret = 0;
15172
15173#ifdef LIBXML_PUSH_ENABLED
15174    int mem_base;
15175    xmlParserCtxtPtr ctxt; /* an XML parser context */
15176    int n_ctxt;
15177
15178    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15179        mem_base = xmlMemBlocks();
15180        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15181
15182        xmlStopParser(ctxt);
15183        call_tests++;
15184        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15185        xmlResetLastError();
15186        if (mem_base != xmlMemBlocks()) {
15187            printf("Leak of %d blocks found in xmlStopParser",
15188	           xmlMemBlocks() - mem_base);
15189	    test_ret++;
15190            printf(" %d", n_ctxt);
15191            printf("\n");
15192        }
15193    }
15194    function_tests++;
15195#endif
15196
15197    return(test_ret);
15198}
15199
15200
15201static int
15202test_xmlSubstituteEntitiesDefault(void) {
15203    int test_ret = 0;
15204
15205    int mem_base;
15206    int ret_val;
15207    int val; /* int 0 or 1 */
15208    int n_val;
15209
15210    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15211        mem_base = xmlMemBlocks();
15212        val = gen_int(n_val, 0);
15213
15214        ret_val = xmlSubstituteEntitiesDefault(val);
15215        desret_int(ret_val);
15216        call_tests++;
15217        des_int(n_val, val, 0);
15218        xmlResetLastError();
15219        if (mem_base != xmlMemBlocks()) {
15220            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15221	           xmlMemBlocks() - mem_base);
15222	    test_ret++;
15223            printf(" %d", n_val);
15224            printf("\n");
15225        }
15226    }
15227    function_tests++;
15228
15229    return(test_ret);
15230}
15231
15232static int
15233test_parser(void) {
15234    int test_ret = 0;
15235
15236    if (quiet == 0) printf("Testing parser : 60 of 69 functions ...\n");
15237    test_ret += test_xmlByteConsumed();
15238    test_ret += test_xmlClearNodeInfoSeq();
15239    test_ret += test_xmlClearParserCtxt();
15240    test_ret += test_xmlCreateDocParserCtxt();
15241    test_ret += test_xmlCreatePushParserCtxt();
15242    test_ret += test_xmlCtxtReadDoc();
15243    test_ret += test_xmlCtxtReadFile();
15244    test_ret += test_xmlCtxtReadMemory();
15245    test_ret += test_xmlCtxtReset();
15246    test_ret += test_xmlCtxtResetPush();
15247    test_ret += test_xmlCtxtUseOptions();
15248    test_ret += test_xmlGetExternalEntityLoader();
15249    test_ret += test_xmlGetFeature();
15250    test_ret += test_xmlGetFeaturesList();
15251    test_ret += test_xmlIOParseDTD();
15252    test_ret += test_xmlInitNodeInfoSeq();
15253    test_ret += test_xmlInitParser();
15254    test_ret += test_xmlInitParserCtxt();
15255    test_ret += test_xmlKeepBlanksDefault();
15256    test_ret += test_xmlLineNumbersDefault();
15257    test_ret += test_xmlLoadExternalEntity();
15258    test_ret += test_xmlNewIOInputStream();
15259    test_ret += test_xmlNewParserCtxt();
15260    test_ret += test_xmlParseBalancedChunkMemory();
15261    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15262    test_ret += test_xmlParseChunk();
15263    test_ret += test_xmlParseCtxtExternalEntity();
15264    test_ret += test_xmlParseDTD();
15265    test_ret += test_xmlParseDoc();
15266    test_ret += test_xmlParseDocument();
15267    test_ret += test_xmlParseEntity();
15268    test_ret += test_xmlParseExtParsedEnt();
15269    test_ret += test_xmlParseExternalEntity();
15270    test_ret += test_xmlParseFile();
15271    test_ret += test_xmlParseInNodeContext();
15272    test_ret += test_xmlParseMemory();
15273    test_ret += test_xmlParserAddNodeInfo();
15274    test_ret += test_xmlParserFindNodeInfo();
15275    test_ret += test_xmlParserFindNodeInfoIndex();
15276    test_ret += test_xmlParserInputGrow();
15277    test_ret += test_xmlParserInputRead();
15278    test_ret += test_xmlPedanticParserDefault();
15279    test_ret += test_xmlReadDoc();
15280    test_ret += test_xmlReadFile();
15281    test_ret += test_xmlReadMemory();
15282    test_ret += test_xmlRecoverDoc();
15283    test_ret += test_xmlRecoverFile();
15284    test_ret += test_xmlRecoverMemory();
15285    test_ret += test_xmlSAXParseDTD();
15286    test_ret += test_xmlSAXParseDoc();
15287    test_ret += test_xmlSAXParseEntity();
15288    test_ret += test_xmlSAXParseFile();
15289    test_ret += test_xmlSAXParseFileWithData();
15290    test_ret += test_xmlSAXParseMemory();
15291    test_ret += test_xmlSAXParseMemoryWithData();
15292    test_ret += test_xmlSAXUserParseFile();
15293    test_ret += test_xmlSAXUserParseMemory();
15294    test_ret += test_xmlSetExternalEntityLoader();
15295    test_ret += test_xmlSetFeature();
15296    test_ret += test_xmlSetupParserForBuffer();
15297    test_ret += test_xmlStopParser();
15298    test_ret += test_xmlSubstituteEntitiesDefault();
15299
15300    if (test_ret != 0)
15301	printf("Module parser: %d errors\n", test_ret);
15302    return(test_ret);
15303}
15304
15305static int
15306test_htmlCreateFileParserCtxt(void) {
15307    int test_ret = 0;
15308
15309#ifdef LIBXML_HTML_ENABLED
15310    int mem_base;
15311    htmlParserCtxtPtr ret_val;
15312    const char * filename; /* the filename */
15313    int n_filename;
15314    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15315    int n_encoding;
15316
15317    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15318    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15319        mem_base = xmlMemBlocks();
15320        filename = gen_fileoutput(n_filename, 0);
15321        encoding = gen_const_char_ptr(n_encoding, 1);
15322
15323        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15324        desret_htmlParserCtxtPtr(ret_val);
15325        call_tests++;
15326        des_fileoutput(n_filename, filename, 0);
15327        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15328        xmlResetLastError();
15329        if (mem_base != xmlMemBlocks()) {
15330            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15331	           xmlMemBlocks() - mem_base);
15332	    test_ret++;
15333            printf(" %d", n_filename);
15334            printf(" %d", n_encoding);
15335            printf("\n");
15336        }
15337    }
15338    }
15339    function_tests++;
15340#endif
15341
15342    return(test_ret);
15343}
15344
15345
15346static int
15347test_htmlInitAutoClose(void) {
15348    int test_ret = 0;
15349
15350#ifdef LIBXML_HTML_ENABLED
15351    int mem_base;
15352
15353        mem_base = xmlMemBlocks();
15354
15355        htmlInitAutoClose();
15356        call_tests++;
15357        xmlResetLastError();
15358        if (mem_base != xmlMemBlocks()) {
15359            printf("Leak of %d blocks found in htmlInitAutoClose",
15360	           xmlMemBlocks() - mem_base);
15361	    test_ret++;
15362            printf("\n");
15363        }
15364    function_tests++;
15365#endif
15366
15367    return(test_ret);
15368}
15369
15370
15371static int
15372test_inputPop(void) {
15373    int test_ret = 0;
15374
15375    int mem_base;
15376    xmlParserInputPtr ret_val;
15377    xmlParserCtxtPtr ctxt; /* an XML parser context */
15378    int n_ctxt;
15379
15380    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15381        mem_base = xmlMemBlocks();
15382        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15383
15384        ret_val = inputPop(ctxt);
15385        desret_xmlParserInputPtr(ret_val);
15386        call_tests++;
15387        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15388        xmlResetLastError();
15389        if (mem_base != xmlMemBlocks()) {
15390            printf("Leak of %d blocks found in inputPop",
15391	           xmlMemBlocks() - mem_base);
15392	    test_ret++;
15393            printf(" %d", n_ctxt);
15394            printf("\n");
15395        }
15396    }
15397    function_tests++;
15398
15399    return(test_ret);
15400}
15401
15402
15403static int
15404test_inputPush(void) {
15405    int test_ret = 0;
15406
15407    int mem_base;
15408    int ret_val;
15409    xmlParserCtxtPtr ctxt; /* an XML parser context */
15410    int n_ctxt;
15411    xmlParserInputPtr value; /* the parser input */
15412    int n_value;
15413
15414    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15415    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15416        mem_base = xmlMemBlocks();
15417        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15418        value = gen_xmlParserInputPtr(n_value, 1);
15419
15420        ret_val = inputPush(ctxt, value);
15421        desret_int(ret_val);
15422        call_tests++;
15423        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15424        des_xmlParserInputPtr(n_value, value, 1);
15425        xmlResetLastError();
15426        if (mem_base != xmlMemBlocks()) {
15427            printf("Leak of %d blocks found in inputPush",
15428	           xmlMemBlocks() - mem_base);
15429	    test_ret++;
15430            printf(" %d", n_ctxt);
15431            printf(" %d", n_value);
15432            printf("\n");
15433        }
15434    }
15435    }
15436    function_tests++;
15437
15438    return(test_ret);
15439}
15440
15441
15442static int
15443test_namePop(void) {
15444    int test_ret = 0;
15445
15446    int mem_base;
15447    const xmlChar * ret_val;
15448    xmlParserCtxtPtr ctxt; /* an XML parser context */
15449    int n_ctxt;
15450
15451    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15452        mem_base = xmlMemBlocks();
15453        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15454
15455        ret_val = namePop(ctxt);
15456        desret_const_xmlChar_ptr(ret_val);
15457        call_tests++;
15458        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15459        xmlResetLastError();
15460        if (mem_base != xmlMemBlocks()) {
15461            printf("Leak of %d blocks found in namePop",
15462	           xmlMemBlocks() - mem_base);
15463	    test_ret++;
15464            printf(" %d", n_ctxt);
15465            printf("\n");
15466        }
15467    }
15468    function_tests++;
15469
15470    return(test_ret);
15471}
15472
15473
15474static int
15475test_namePush(void) {
15476    int test_ret = 0;
15477
15478    int mem_base;
15479    int ret_val;
15480    xmlParserCtxtPtr ctxt; /* an XML parser context */
15481    int n_ctxt;
15482    xmlChar * value; /* the element name */
15483    int n_value;
15484
15485    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15486    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15487        mem_base = xmlMemBlocks();
15488        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15489        value = gen_const_xmlChar_ptr(n_value, 1);
15490
15491        ret_val = namePush(ctxt, (const xmlChar *)value);
15492        desret_int(ret_val);
15493        call_tests++;
15494        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15495        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15496        xmlResetLastError();
15497        if (mem_base != xmlMemBlocks()) {
15498            printf("Leak of %d blocks found in namePush",
15499	           xmlMemBlocks() - mem_base);
15500	    test_ret++;
15501            printf(" %d", n_ctxt);
15502            printf(" %d", n_value);
15503            printf("\n");
15504        }
15505    }
15506    }
15507    function_tests++;
15508
15509    return(test_ret);
15510}
15511
15512
15513static int
15514test_nodePop(void) {
15515    int test_ret = 0;
15516
15517    int mem_base;
15518    xmlNodePtr ret_val;
15519    xmlParserCtxtPtr ctxt; /* an XML parser context */
15520    int n_ctxt;
15521
15522    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15523        mem_base = xmlMemBlocks();
15524        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15525
15526        ret_val = nodePop(ctxt);
15527        desret_xmlNodePtr(ret_val);
15528        call_tests++;
15529        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15530        xmlResetLastError();
15531        if (mem_base != xmlMemBlocks()) {
15532            printf("Leak of %d blocks found in nodePop",
15533	           xmlMemBlocks() - mem_base);
15534	    test_ret++;
15535            printf(" %d", n_ctxt);
15536            printf("\n");
15537        }
15538    }
15539    function_tests++;
15540
15541    return(test_ret);
15542}
15543
15544
15545static int
15546test_nodePush(void) {
15547    int test_ret = 0;
15548
15549    int mem_base;
15550    int ret_val;
15551    xmlParserCtxtPtr ctxt; /* an XML parser context */
15552    int n_ctxt;
15553    xmlNodePtr value; /* the element node */
15554    int n_value;
15555
15556    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15557    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15558        mem_base = xmlMemBlocks();
15559        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15560        value = gen_xmlNodePtr(n_value, 1);
15561
15562        ret_val = nodePush(ctxt, value);
15563        desret_int(ret_val);
15564        call_tests++;
15565        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15566        des_xmlNodePtr(n_value, value, 1);
15567        xmlResetLastError();
15568        if (mem_base != xmlMemBlocks()) {
15569            printf("Leak of %d blocks found in nodePush",
15570	           xmlMemBlocks() - mem_base);
15571	    test_ret++;
15572            printf(" %d", n_ctxt);
15573            printf(" %d", n_value);
15574            printf("\n");
15575        }
15576    }
15577    }
15578    function_tests++;
15579
15580    return(test_ret);
15581}
15582
15583
15584static int
15585test_xmlCheckLanguageID(void) {
15586    int test_ret = 0;
15587
15588    int mem_base;
15589    int ret_val;
15590    xmlChar * lang; /* pointer to the string value */
15591    int n_lang;
15592
15593    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15594        mem_base = xmlMemBlocks();
15595        lang = gen_const_xmlChar_ptr(n_lang, 0);
15596
15597        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15598        desret_int(ret_val);
15599        call_tests++;
15600        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15601        xmlResetLastError();
15602        if (mem_base != xmlMemBlocks()) {
15603            printf("Leak of %d blocks found in xmlCheckLanguageID",
15604	           xmlMemBlocks() - mem_base);
15605	    test_ret++;
15606            printf(" %d", n_lang);
15607            printf("\n");
15608        }
15609    }
15610    function_tests++;
15611
15612    return(test_ret);
15613}
15614
15615
15616static int
15617test_xmlCopyChar(void) {
15618    int test_ret = 0;
15619
15620    int mem_base;
15621    int ret_val;
15622    int len; /* Ignored, compatibility */
15623    int n_len;
15624    xmlChar * out; /* pointer to an array of xmlChar */
15625    int n_out;
15626    int val; /* the char value */
15627    int n_val;
15628
15629    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15630    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15631    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15632        mem_base = xmlMemBlocks();
15633        len = gen_int(n_len, 0);
15634        out = gen_xmlChar_ptr(n_out, 1);
15635        val = gen_int(n_val, 2);
15636
15637        ret_val = xmlCopyChar(len, out, val);
15638        desret_int(ret_val);
15639        call_tests++;
15640        des_int(n_len, len, 0);
15641        des_xmlChar_ptr(n_out, out, 1);
15642        des_int(n_val, val, 2);
15643        xmlResetLastError();
15644        if (mem_base != xmlMemBlocks()) {
15645            printf("Leak of %d blocks found in xmlCopyChar",
15646	           xmlMemBlocks() - mem_base);
15647	    test_ret++;
15648            printf(" %d", n_len);
15649            printf(" %d", n_out);
15650            printf(" %d", n_val);
15651            printf("\n");
15652        }
15653    }
15654    }
15655    }
15656    function_tests++;
15657
15658    return(test_ret);
15659}
15660
15661
15662static int
15663test_xmlCopyCharMultiByte(void) {
15664    int test_ret = 0;
15665
15666    int mem_base;
15667    int ret_val;
15668    xmlChar * out; /* pointer to an array of xmlChar */
15669    int n_out;
15670    int val; /* the char value */
15671    int n_val;
15672
15673    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15674    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15675        mem_base = xmlMemBlocks();
15676        out = gen_xmlChar_ptr(n_out, 0);
15677        val = gen_int(n_val, 1);
15678
15679        ret_val = xmlCopyCharMultiByte(out, val);
15680        desret_int(ret_val);
15681        call_tests++;
15682        des_xmlChar_ptr(n_out, out, 0);
15683        des_int(n_val, val, 1);
15684        xmlResetLastError();
15685        if (mem_base != xmlMemBlocks()) {
15686            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15687	           xmlMemBlocks() - mem_base);
15688	    test_ret++;
15689            printf(" %d", n_out);
15690            printf(" %d", n_val);
15691            printf("\n");
15692        }
15693    }
15694    }
15695    function_tests++;
15696
15697    return(test_ret);
15698}
15699
15700
15701static int
15702test_xmlCreateEntityParserCtxt(void) {
15703    int test_ret = 0;
15704
15705    int mem_base;
15706    xmlParserCtxtPtr ret_val;
15707    xmlChar * URL; /* the entity URL */
15708    int n_URL;
15709    xmlChar * ID; /* the entity PUBLIC ID */
15710    int n_ID;
15711    xmlChar * base; /* a possible base for the target URI */
15712    int n_base;
15713
15714    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15715    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15716    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15717        mem_base = xmlMemBlocks();
15718        URL = gen_const_xmlChar_ptr(n_URL, 0);
15719        ID = gen_const_xmlChar_ptr(n_ID, 1);
15720        base = gen_const_xmlChar_ptr(n_base, 2);
15721
15722        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15723        desret_xmlParserCtxtPtr(ret_val);
15724        call_tests++;
15725        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15726        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15727        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15728        xmlResetLastError();
15729        if (mem_base != xmlMemBlocks()) {
15730            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15731	           xmlMemBlocks() - mem_base);
15732	    test_ret++;
15733            printf(" %d", n_URL);
15734            printf(" %d", n_ID);
15735            printf(" %d", n_base);
15736            printf("\n");
15737        }
15738    }
15739    }
15740    }
15741    function_tests++;
15742
15743    return(test_ret);
15744}
15745
15746
15747static int
15748test_xmlCreateFileParserCtxt(void) {
15749    int test_ret = 0;
15750
15751    int mem_base;
15752    xmlParserCtxtPtr ret_val;
15753    const char * filename; /* the filename */
15754    int n_filename;
15755
15756    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15757        mem_base = xmlMemBlocks();
15758        filename = gen_fileoutput(n_filename, 0);
15759
15760        ret_val = xmlCreateFileParserCtxt(filename);
15761        desret_xmlParserCtxtPtr(ret_val);
15762        call_tests++;
15763        des_fileoutput(n_filename, filename, 0);
15764        xmlResetLastError();
15765        if (mem_base != xmlMemBlocks()) {
15766            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15767	           xmlMemBlocks() - mem_base);
15768	    test_ret++;
15769            printf(" %d", n_filename);
15770            printf("\n");
15771        }
15772    }
15773    function_tests++;
15774
15775    return(test_ret);
15776}
15777
15778
15779static int
15780test_xmlCreateMemoryParserCtxt(void) {
15781    int test_ret = 0;
15782
15783    int mem_base;
15784    xmlParserCtxtPtr ret_val;
15785    char * buffer; /* a pointer to a char array */
15786    int n_buffer;
15787    int size; /* the size of the array */
15788    int n_size;
15789
15790    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15791    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15792        mem_base = xmlMemBlocks();
15793        buffer = gen_const_char_ptr(n_buffer, 0);
15794        size = gen_int(n_size, 1);
15795
15796        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15797        desret_xmlParserCtxtPtr(ret_val);
15798        call_tests++;
15799        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15800        des_int(n_size, size, 1);
15801        xmlResetLastError();
15802        if (mem_base != xmlMemBlocks()) {
15803            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15804	           xmlMemBlocks() - mem_base);
15805	    test_ret++;
15806            printf(" %d", n_buffer);
15807            printf(" %d", n_size);
15808            printf("\n");
15809        }
15810    }
15811    }
15812    function_tests++;
15813
15814    return(test_ret);
15815}
15816
15817
15818static int
15819test_xmlCreateURLParserCtxt(void) {
15820    int test_ret = 0;
15821
15822    int mem_base;
15823    xmlParserCtxtPtr ret_val;
15824    const char * filename; /* the filename or URL */
15825    int n_filename;
15826    int options; /* a combination of xmlParserOption */
15827    int n_options;
15828
15829    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15830    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15831        mem_base = xmlMemBlocks();
15832        filename = gen_fileoutput(n_filename, 0);
15833        options = gen_int(n_options, 1);
15834
15835        ret_val = xmlCreateURLParserCtxt(filename, options);
15836        desret_xmlParserCtxtPtr(ret_val);
15837        call_tests++;
15838        des_fileoutput(n_filename, filename, 0);
15839        des_int(n_options, options, 1);
15840        xmlResetLastError();
15841        if (mem_base != xmlMemBlocks()) {
15842            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15843	           xmlMemBlocks() - mem_base);
15844	    test_ret++;
15845            printf(" %d", n_filename);
15846            printf(" %d", n_options);
15847            printf("\n");
15848        }
15849    }
15850    }
15851    function_tests++;
15852
15853    return(test_ret);
15854}
15855
15856
15857static int
15858test_xmlCurrentChar(void) {
15859    int test_ret = 0;
15860
15861    int mem_base;
15862    int ret_val;
15863    xmlParserCtxtPtr ctxt; /* the XML parser context */
15864    int n_ctxt;
15865    int * len; /* pointer to the length of the char read */
15866    int n_len;
15867
15868    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15869    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15870        mem_base = xmlMemBlocks();
15871        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15872        len = gen_int_ptr(n_len, 1);
15873
15874        ret_val = xmlCurrentChar(ctxt, len);
15875        desret_int(ret_val);
15876        call_tests++;
15877        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15878        des_int_ptr(n_len, len, 1);
15879        xmlResetLastError();
15880        if (mem_base != xmlMemBlocks()) {
15881            printf("Leak of %d blocks found in xmlCurrentChar",
15882	           xmlMemBlocks() - mem_base);
15883	    test_ret++;
15884            printf(" %d", n_ctxt);
15885            printf(" %d", n_len);
15886            printf("\n");
15887        }
15888    }
15889    }
15890    function_tests++;
15891
15892    return(test_ret);
15893}
15894
15895
15896static int
15897test_xmlErrMemory(void) {
15898    int test_ret = 0;
15899
15900    int mem_base;
15901    xmlParserCtxtPtr ctxt; /* an XML parser context */
15902    int n_ctxt;
15903    char * extra; /* extra informations */
15904    int n_extra;
15905
15906    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15907    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15908        mem_base = xmlMemBlocks();
15909        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15910        extra = gen_const_char_ptr(n_extra, 1);
15911
15912        xmlErrMemory(ctxt, (const char *)extra);
15913        call_tests++;
15914        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15915        des_const_char_ptr(n_extra, (const char *)extra, 1);
15916        xmlResetLastError();
15917        if (mem_base != xmlMemBlocks()) {
15918            printf("Leak of %d blocks found in xmlErrMemory",
15919	           xmlMemBlocks() - mem_base);
15920	    test_ret++;
15921            printf(" %d", n_ctxt);
15922            printf(" %d", n_extra);
15923            printf("\n");
15924        }
15925    }
15926    }
15927    function_tests++;
15928
15929    return(test_ret);
15930}
15931
15932
15933static int
15934test_xmlIsLetter(void) {
15935    int test_ret = 0;
15936
15937    int mem_base;
15938    int ret_val;
15939    int c; /* an unicode character (int) */
15940    int n_c;
15941
15942    for (n_c = 0;n_c < gen_nb_int;n_c++) {
15943        mem_base = xmlMemBlocks();
15944        c = gen_int(n_c, 0);
15945
15946        ret_val = xmlIsLetter(c);
15947        desret_int(ret_val);
15948        call_tests++;
15949        des_int(n_c, c, 0);
15950        xmlResetLastError();
15951        if (mem_base != xmlMemBlocks()) {
15952            printf("Leak of %d blocks found in xmlIsLetter",
15953	           xmlMemBlocks() - mem_base);
15954	    test_ret++;
15955            printf(" %d", n_c);
15956            printf("\n");
15957        }
15958    }
15959    function_tests++;
15960
15961    return(test_ret);
15962}
15963
15964
15965static int
15966test_xmlNewEntityInputStream(void) {
15967    int test_ret = 0;
15968
15969    int mem_base;
15970    xmlParserInputPtr ret_val;
15971    xmlParserCtxtPtr ctxt; /* an XML parser context */
15972    int n_ctxt;
15973    xmlEntityPtr entity; /* an Entity pointer */
15974    int n_entity;
15975
15976    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15977    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
15978        mem_base = xmlMemBlocks();
15979        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15980        entity = gen_xmlEntityPtr(n_entity, 1);
15981
15982        ret_val = xmlNewEntityInputStream(ctxt, entity);
15983        desret_xmlParserInputPtr(ret_val);
15984        call_tests++;
15985        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15986        des_xmlEntityPtr(n_entity, entity, 1);
15987        xmlResetLastError();
15988        if (mem_base != xmlMemBlocks()) {
15989            printf("Leak of %d blocks found in xmlNewEntityInputStream",
15990	           xmlMemBlocks() - mem_base);
15991	    test_ret++;
15992            printf(" %d", n_ctxt);
15993            printf(" %d", n_entity);
15994            printf("\n");
15995        }
15996    }
15997    }
15998    function_tests++;
15999
16000    return(test_ret);
16001}
16002
16003
16004static int
16005test_xmlNewInputFromFile(void) {
16006    int test_ret = 0;
16007
16008    int mem_base;
16009    xmlParserInputPtr ret_val;
16010    xmlParserCtxtPtr ctxt; /* an XML parser context */
16011    int n_ctxt;
16012    const char * filename; /* the filename to use as entity */
16013    int n_filename;
16014
16015    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16016    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16017        mem_base = xmlMemBlocks();
16018        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16019        filename = gen_filepath(n_filename, 1);
16020
16021        ret_val = xmlNewInputFromFile(ctxt, filename);
16022        desret_xmlParserInputPtr(ret_val);
16023        call_tests++;
16024        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16025        des_filepath(n_filename, filename, 1);
16026        xmlResetLastError();
16027        if (mem_base != xmlMemBlocks()) {
16028            printf("Leak of %d blocks found in xmlNewInputFromFile",
16029	           xmlMemBlocks() - mem_base);
16030	    test_ret++;
16031            printf(" %d", n_ctxt);
16032            printf(" %d", n_filename);
16033            printf("\n");
16034        }
16035    }
16036    }
16037    function_tests++;
16038
16039    return(test_ret);
16040}
16041
16042
16043static int
16044test_xmlNewInputStream(void) {
16045    int test_ret = 0;
16046
16047    int mem_base;
16048    xmlParserInputPtr ret_val;
16049    xmlParserCtxtPtr ctxt; /* an XML parser context */
16050    int n_ctxt;
16051
16052    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16053        mem_base = xmlMemBlocks();
16054        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16055
16056        ret_val = xmlNewInputStream(ctxt);
16057        desret_xmlParserInputPtr(ret_val);
16058        call_tests++;
16059        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16060        xmlResetLastError();
16061        if (mem_base != xmlMemBlocks()) {
16062            printf("Leak of %d blocks found in xmlNewInputStream",
16063	           xmlMemBlocks() - mem_base);
16064	    test_ret++;
16065            printf(" %d", n_ctxt);
16066            printf("\n");
16067        }
16068    }
16069    function_tests++;
16070
16071    return(test_ret);
16072}
16073
16074
16075static int
16076test_xmlNewStringInputStream(void) {
16077    int test_ret = 0;
16078
16079    int mem_base;
16080    xmlParserInputPtr ret_val;
16081    xmlParserCtxtPtr ctxt; /* an XML parser context */
16082    int n_ctxt;
16083    xmlChar * buffer; /* an memory buffer */
16084    int n_buffer;
16085
16086    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16087    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16088        mem_base = xmlMemBlocks();
16089        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16090        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16091
16092        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16093        desret_xmlParserInputPtr(ret_val);
16094        call_tests++;
16095        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16096        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16097        xmlResetLastError();
16098        if (mem_base != xmlMemBlocks()) {
16099            printf("Leak of %d blocks found in xmlNewStringInputStream",
16100	           xmlMemBlocks() - mem_base);
16101	    test_ret++;
16102            printf(" %d", n_ctxt);
16103            printf(" %d", n_buffer);
16104            printf("\n");
16105        }
16106    }
16107    }
16108    function_tests++;
16109
16110    return(test_ret);
16111}
16112
16113
16114static int
16115test_xmlNextChar(void) {
16116    int test_ret = 0;
16117
16118    int mem_base;
16119    xmlParserCtxtPtr ctxt; /* the XML parser context */
16120    int n_ctxt;
16121
16122    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16123        mem_base = xmlMemBlocks();
16124        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16125
16126        xmlNextChar(ctxt);
16127        call_tests++;
16128        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16129        xmlResetLastError();
16130        if (mem_base != xmlMemBlocks()) {
16131            printf("Leak of %d blocks found in xmlNextChar",
16132	           xmlMemBlocks() - mem_base);
16133	    test_ret++;
16134            printf(" %d", n_ctxt);
16135            printf("\n");
16136        }
16137    }
16138    function_tests++;
16139
16140    return(test_ret);
16141}
16142
16143
16144static int
16145test_xmlParserInputShrink(void) {
16146    int test_ret = 0;
16147
16148    int mem_base;
16149    xmlParserInputPtr in; /* an XML parser input */
16150    int n_in;
16151
16152    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16153        mem_base = xmlMemBlocks();
16154        in = gen_xmlParserInputPtr(n_in, 0);
16155
16156        xmlParserInputShrink(in);
16157        call_tests++;
16158        des_xmlParserInputPtr(n_in, in, 0);
16159        xmlResetLastError();
16160        if (mem_base != xmlMemBlocks()) {
16161            printf("Leak of %d blocks found in xmlParserInputShrink",
16162	           xmlMemBlocks() - mem_base);
16163	    test_ret++;
16164            printf(" %d", n_in);
16165            printf("\n");
16166        }
16167    }
16168    function_tests++;
16169
16170    return(test_ret);
16171}
16172
16173
16174static int
16175test_xmlPopInput(void) {
16176    int test_ret = 0;
16177
16178    int mem_base;
16179    xmlChar ret_val;
16180    xmlParserCtxtPtr ctxt; /* an XML parser context */
16181    int n_ctxt;
16182
16183    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16184        mem_base = xmlMemBlocks();
16185        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16186
16187        ret_val = xmlPopInput(ctxt);
16188        desret_xmlChar(ret_val);
16189        call_tests++;
16190        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16191        xmlResetLastError();
16192        if (mem_base != xmlMemBlocks()) {
16193            printf("Leak of %d blocks found in xmlPopInput",
16194	           xmlMemBlocks() - mem_base);
16195	    test_ret++;
16196            printf(" %d", n_ctxt);
16197            printf("\n");
16198        }
16199    }
16200    function_tests++;
16201
16202    return(test_ret);
16203}
16204
16205
16206static int
16207test_xmlPushInput(void) {
16208    int test_ret = 0;
16209
16210    int mem_base;
16211    xmlParserCtxtPtr ctxt; /* an XML parser context */
16212    int n_ctxt;
16213    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16214    int n_input;
16215
16216    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16217    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16218        mem_base = xmlMemBlocks();
16219        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16220        input = gen_xmlParserInputPtr(n_input, 1);
16221
16222        xmlPushInput(ctxt, input);
16223        call_tests++;
16224        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16225        des_xmlParserInputPtr(n_input, input, 1);
16226        xmlResetLastError();
16227        if (mem_base != xmlMemBlocks()) {
16228            printf("Leak of %d blocks found in xmlPushInput",
16229	           xmlMemBlocks() - mem_base);
16230	    test_ret++;
16231            printf(" %d", n_ctxt);
16232            printf(" %d", n_input);
16233            printf("\n");
16234        }
16235    }
16236    }
16237    function_tests++;
16238
16239    return(test_ret);
16240}
16241
16242
16243static int
16244test_xmlSetEntityReferenceFunc(void) {
16245    int test_ret = 0;
16246
16247
16248    /* missing type support */
16249    return(test_ret);
16250}
16251
16252
16253static int
16254test_xmlSplitQName(void) {
16255    int test_ret = 0;
16256
16257    int mem_base;
16258    xmlChar * ret_val;
16259    xmlParserCtxtPtr ctxt; /* an XML parser context */
16260    int n_ctxt;
16261    xmlChar * name; /* an XML parser context */
16262    int n_name;
16263    xmlChar ** prefix; /* a xmlChar ** */
16264    int n_prefix;
16265
16266    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16267    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16268    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16269        mem_base = xmlMemBlocks();
16270        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16271        name = gen_const_xmlChar_ptr(n_name, 1);
16272        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16273
16274        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16275        desret_xmlChar_ptr(ret_val);
16276        call_tests++;
16277        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16278        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16279        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16280        xmlResetLastError();
16281        if (mem_base != xmlMemBlocks()) {
16282            printf("Leak of %d blocks found in xmlSplitQName",
16283	           xmlMemBlocks() - mem_base);
16284	    test_ret++;
16285            printf(" %d", n_ctxt);
16286            printf(" %d", n_name);
16287            printf(" %d", n_prefix);
16288            printf("\n");
16289        }
16290    }
16291    }
16292    }
16293    function_tests++;
16294
16295    return(test_ret);
16296}
16297
16298
16299static int
16300test_xmlStringCurrentChar(void) {
16301    int test_ret = 0;
16302
16303    int mem_base;
16304    int ret_val;
16305    xmlParserCtxtPtr ctxt; /* the XML parser context */
16306    int n_ctxt;
16307    xmlChar * cur; /* pointer to the beginning of the char */
16308    int n_cur;
16309    int * len; /* pointer to the length of the char read */
16310    int n_len;
16311
16312    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16313    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16314    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16315        mem_base = xmlMemBlocks();
16316        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16317        cur = gen_const_xmlChar_ptr(n_cur, 1);
16318        len = gen_int_ptr(n_len, 2);
16319
16320        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16321        desret_int(ret_val);
16322        call_tests++;
16323        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16324        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16325        des_int_ptr(n_len, len, 2);
16326        xmlResetLastError();
16327        if (mem_base != xmlMemBlocks()) {
16328            printf("Leak of %d blocks found in xmlStringCurrentChar",
16329	           xmlMemBlocks() - mem_base);
16330	    test_ret++;
16331            printf(" %d", n_ctxt);
16332            printf(" %d", n_cur);
16333            printf(" %d", n_len);
16334            printf("\n");
16335        }
16336    }
16337    }
16338    }
16339    function_tests++;
16340
16341    return(test_ret);
16342}
16343
16344
16345static int
16346test_xmlStringDecodeEntities(void) {
16347    int test_ret = 0;
16348
16349    int mem_base;
16350    xmlChar * ret_val;
16351    xmlParserCtxtPtr ctxt; /* the parser context */
16352    int n_ctxt;
16353    xmlChar * str; /* the input string */
16354    int n_str;
16355    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16356    int n_what;
16357    xmlChar end; /* an end marker xmlChar, 0 if none */
16358    int n_end;
16359    xmlChar end2; /* an end marker xmlChar, 0 if none */
16360    int n_end2;
16361    xmlChar end3; /* an end marker xmlChar, 0 if none */
16362    int n_end3;
16363
16364    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16365    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16366    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16367    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16368    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16369    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16370        mem_base = xmlMemBlocks();
16371        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16372        str = gen_const_xmlChar_ptr(n_str, 1);
16373        what = gen_int(n_what, 2);
16374        end = gen_xmlChar(n_end, 3);
16375        end2 = gen_xmlChar(n_end2, 4);
16376        end3 = gen_xmlChar(n_end3, 5);
16377
16378        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16379        desret_xmlChar_ptr(ret_val);
16380        call_tests++;
16381        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16382        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16383        des_int(n_what, what, 2);
16384        des_xmlChar(n_end, end, 3);
16385        des_xmlChar(n_end2, end2, 4);
16386        des_xmlChar(n_end3, end3, 5);
16387        xmlResetLastError();
16388        if (mem_base != xmlMemBlocks()) {
16389            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16390	           xmlMemBlocks() - mem_base);
16391	    test_ret++;
16392            printf(" %d", n_ctxt);
16393            printf(" %d", n_str);
16394            printf(" %d", n_what);
16395            printf(" %d", n_end);
16396            printf(" %d", n_end2);
16397            printf(" %d", n_end3);
16398            printf("\n");
16399        }
16400    }
16401    }
16402    }
16403    }
16404    }
16405    }
16406    function_tests++;
16407
16408    return(test_ret);
16409}
16410
16411
16412static int
16413test_xmlStringLenDecodeEntities(void) {
16414    int test_ret = 0;
16415
16416    int mem_base;
16417    xmlChar * ret_val;
16418    xmlParserCtxtPtr ctxt; /* the parser context */
16419    int n_ctxt;
16420    xmlChar * str; /* the input string */
16421    int n_str;
16422    int len; /* the string length */
16423    int n_len;
16424    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16425    int n_what;
16426    xmlChar end; /* an end marker xmlChar, 0 if none */
16427    int n_end;
16428    xmlChar end2; /* an end marker xmlChar, 0 if none */
16429    int n_end2;
16430    xmlChar end3; /* an end marker xmlChar, 0 if none */
16431    int n_end3;
16432
16433    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16434    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16435    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16436    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16437    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16438    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16439    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16440        mem_base = xmlMemBlocks();
16441        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16442        str = gen_const_xmlChar_ptr(n_str, 1);
16443        len = gen_int(n_len, 2);
16444        what = gen_int(n_what, 3);
16445        end = gen_xmlChar(n_end, 4);
16446        end2 = gen_xmlChar(n_end2, 5);
16447        end3 = gen_xmlChar(n_end3, 6);
16448
16449        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16450        desret_xmlChar_ptr(ret_val);
16451        call_tests++;
16452        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16453        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16454        des_int(n_len, len, 2);
16455        des_int(n_what, what, 3);
16456        des_xmlChar(n_end, end, 4);
16457        des_xmlChar(n_end2, end2, 5);
16458        des_xmlChar(n_end3, end3, 6);
16459        xmlResetLastError();
16460        if (mem_base != xmlMemBlocks()) {
16461            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16462	           xmlMemBlocks() - mem_base);
16463	    test_ret++;
16464            printf(" %d", n_ctxt);
16465            printf(" %d", n_str);
16466            printf(" %d", n_len);
16467            printf(" %d", n_what);
16468            printf(" %d", n_end);
16469            printf(" %d", n_end2);
16470            printf(" %d", n_end3);
16471            printf("\n");
16472        }
16473    }
16474    }
16475    }
16476    }
16477    }
16478    }
16479    }
16480    function_tests++;
16481
16482    return(test_ret);
16483}
16484
16485
16486static int
16487test_xmlSwitchEncoding(void) {
16488    int test_ret = 0;
16489
16490    int mem_base;
16491    int ret_val;
16492    xmlParserCtxtPtr ctxt; /* the parser context */
16493    int n_ctxt;
16494    xmlCharEncoding enc; /* the encoding value (number) */
16495    int n_enc;
16496
16497    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16498    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16499        mem_base = xmlMemBlocks();
16500        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16501        enc = gen_xmlCharEncoding(n_enc, 1);
16502
16503        ret_val = xmlSwitchEncoding(ctxt, enc);
16504        desret_int(ret_val);
16505        call_tests++;
16506        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16507        des_xmlCharEncoding(n_enc, enc, 1);
16508        xmlResetLastError();
16509        if (mem_base != xmlMemBlocks()) {
16510            printf("Leak of %d blocks found in xmlSwitchEncoding",
16511	           xmlMemBlocks() - mem_base);
16512	    test_ret++;
16513            printf(" %d", n_ctxt);
16514            printf(" %d", n_enc);
16515            printf("\n");
16516        }
16517    }
16518    }
16519    function_tests++;
16520
16521    return(test_ret);
16522}
16523
16524
16525static int
16526test_xmlSwitchInputEncoding(void) {
16527    int test_ret = 0;
16528
16529    int mem_base;
16530    int ret_val;
16531    xmlParserCtxtPtr ctxt; /* the parser context */
16532    int n_ctxt;
16533    xmlParserInputPtr input; /* the input stream */
16534    int n_input;
16535    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16536    int n_handler;
16537
16538    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16539    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16540    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16541        mem_base = xmlMemBlocks();
16542        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16543        input = gen_xmlParserInputPtr(n_input, 1);
16544        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16545
16546        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16547        desret_int(ret_val);
16548        call_tests++;
16549        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16550        des_xmlParserInputPtr(n_input, input, 1);
16551        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16552        xmlResetLastError();
16553        if (mem_base != xmlMemBlocks()) {
16554            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16555	           xmlMemBlocks() - mem_base);
16556	    test_ret++;
16557            printf(" %d", n_ctxt);
16558            printf(" %d", n_input);
16559            printf(" %d", n_handler);
16560            printf("\n");
16561        }
16562    }
16563    }
16564    }
16565    function_tests++;
16566
16567    return(test_ret);
16568}
16569
16570
16571static int
16572test_xmlSwitchToEncoding(void) {
16573    int test_ret = 0;
16574
16575    int mem_base;
16576    int ret_val;
16577    xmlParserCtxtPtr ctxt; /* the parser context */
16578    int n_ctxt;
16579    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16580    int n_handler;
16581
16582    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16583    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16584        mem_base = xmlMemBlocks();
16585        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16586        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16587
16588        ret_val = xmlSwitchToEncoding(ctxt, handler);
16589        desret_int(ret_val);
16590        call_tests++;
16591        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16592        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16593        xmlResetLastError();
16594        if (mem_base != xmlMemBlocks()) {
16595            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16596	           xmlMemBlocks() - mem_base);
16597	    test_ret++;
16598            printf(" %d", n_ctxt);
16599            printf(" %d", n_handler);
16600            printf("\n");
16601        }
16602    }
16603    }
16604    function_tests++;
16605
16606    return(test_ret);
16607}
16608
16609static int
16610test_parserInternals(void) {
16611    int test_ret = 0;
16612
16613    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16614    test_ret += test_htmlCreateFileParserCtxt();
16615    test_ret += test_htmlInitAutoClose();
16616    test_ret += test_inputPop();
16617    test_ret += test_inputPush();
16618    test_ret += test_namePop();
16619    test_ret += test_namePush();
16620    test_ret += test_nodePop();
16621    test_ret += test_nodePush();
16622    test_ret += test_xmlCheckLanguageID();
16623    test_ret += test_xmlCopyChar();
16624    test_ret += test_xmlCopyCharMultiByte();
16625    test_ret += test_xmlCreateEntityParserCtxt();
16626    test_ret += test_xmlCreateFileParserCtxt();
16627    test_ret += test_xmlCreateMemoryParserCtxt();
16628    test_ret += test_xmlCreateURLParserCtxt();
16629    test_ret += test_xmlCurrentChar();
16630    test_ret += test_xmlErrMemory();
16631    test_ret += test_xmlIsLetter();
16632    test_ret += test_xmlNewEntityInputStream();
16633    test_ret += test_xmlNewInputFromFile();
16634    test_ret += test_xmlNewInputStream();
16635    test_ret += test_xmlNewStringInputStream();
16636    test_ret += test_xmlNextChar();
16637    test_ret += test_xmlParserInputShrink();
16638    test_ret += test_xmlPopInput();
16639    test_ret += test_xmlPushInput();
16640    test_ret += test_xmlSetEntityReferenceFunc();
16641    test_ret += test_xmlSplitQName();
16642    test_ret += test_xmlStringCurrentChar();
16643    test_ret += test_xmlStringDecodeEntities();
16644    test_ret += test_xmlStringLenDecodeEntities();
16645    test_ret += test_xmlSwitchEncoding();
16646    test_ret += test_xmlSwitchInputEncoding();
16647    test_ret += test_xmlSwitchToEncoding();
16648
16649    if (test_ret != 0)
16650	printf("Module parserInternals: %d errors\n", test_ret);
16651    return(test_ret);
16652}
16653
16654static int
16655test_xmlPatternMatch(void) {
16656    int test_ret = 0;
16657
16658#ifdef LIBXML_PATTERN_ENABLED
16659    int mem_base;
16660    int ret_val;
16661    xmlPatternPtr comp; /* the precompiled pattern */
16662    int n_comp;
16663    xmlNodePtr node; /* a node */
16664    int n_node;
16665
16666    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16667    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16668        mem_base = xmlMemBlocks();
16669        comp = gen_xmlPatternPtr(n_comp, 0);
16670        node = gen_xmlNodePtr(n_node, 1);
16671
16672        ret_val = xmlPatternMatch(comp, node);
16673        desret_int(ret_val);
16674        call_tests++;
16675        des_xmlPatternPtr(n_comp, comp, 0);
16676        des_xmlNodePtr(n_node, node, 1);
16677        xmlResetLastError();
16678        if (mem_base != xmlMemBlocks()) {
16679            printf("Leak of %d blocks found in xmlPatternMatch",
16680	           xmlMemBlocks() - mem_base);
16681	    test_ret++;
16682            printf(" %d", n_comp);
16683            printf(" %d", n_node);
16684            printf("\n");
16685        }
16686    }
16687    }
16688    function_tests++;
16689#endif
16690
16691    return(test_ret);
16692}
16693
16694
16695static int
16696test_xmlPatterncompile(void) {
16697    int test_ret = 0;
16698
16699
16700    /* missing type support */
16701    return(test_ret);
16702}
16703
16704static int
16705test_pattern(void) {
16706    int test_ret = 0;
16707
16708    if (quiet == 0) printf("Testing pattern : 1 of 4 functions ...\n");
16709    test_ret += test_xmlPatternMatch();
16710    test_ret += test_xmlPatterncompile();
16711
16712    if (test_ret != 0)
16713	printf("Module pattern: %d errors\n", test_ret);
16714    return(test_ret);
16715}
16716#ifdef LIBXML_SCHEMAS_ENABLED
16717
16718#define gen_nb_xmlRelaxNGPtr 1
16719static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16720    return(NULL);
16721}
16722static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16723}
16724#endif
16725
16726
16727static int
16728test_xmlRelaxNGDump(void) {
16729    int test_ret = 0;
16730
16731#ifdef LIBXML_SCHEMAS_ENABLED
16732#ifdef LIBXML_OUTPUT_ENABLED
16733    int mem_base;
16734    FILE * output; /* the file output */
16735    int n_output;
16736    xmlRelaxNGPtr schema; /* a schema structure */
16737    int n_schema;
16738
16739    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16740    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16741        mem_base = xmlMemBlocks();
16742        output = gen_FILE_ptr(n_output, 0);
16743        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16744
16745        xmlRelaxNGDump(output, schema);
16746        call_tests++;
16747        des_FILE_ptr(n_output, output, 0);
16748        des_xmlRelaxNGPtr(n_schema, schema, 1);
16749        xmlResetLastError();
16750        if (mem_base != xmlMemBlocks()) {
16751            printf("Leak of %d blocks found in xmlRelaxNGDump",
16752	           xmlMemBlocks() - mem_base);
16753	    test_ret++;
16754            printf(" %d", n_output);
16755            printf(" %d", n_schema);
16756            printf("\n");
16757        }
16758    }
16759    }
16760    function_tests++;
16761#endif
16762#endif
16763
16764    return(test_ret);
16765}
16766
16767
16768static int
16769test_xmlRelaxNGDumpTree(void) {
16770    int test_ret = 0;
16771
16772#ifdef LIBXML_SCHEMAS_ENABLED
16773#ifdef LIBXML_OUTPUT_ENABLED
16774    int mem_base;
16775    FILE * output; /* the file output */
16776    int n_output;
16777    xmlRelaxNGPtr schema; /* a schema structure */
16778    int n_schema;
16779
16780    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
16781    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
16782        mem_base = xmlMemBlocks();
16783        output = gen_FILE_ptr(n_output, 0);
16784        schema = gen_xmlRelaxNGPtr(n_schema, 1);
16785
16786        xmlRelaxNGDumpTree(output, schema);
16787        call_tests++;
16788        des_FILE_ptr(n_output, output, 0);
16789        des_xmlRelaxNGPtr(n_schema, schema, 1);
16790        xmlResetLastError();
16791        if (mem_base != xmlMemBlocks()) {
16792            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
16793	           xmlMemBlocks() - mem_base);
16794	    test_ret++;
16795            printf(" %d", n_output);
16796            printf(" %d", n_schema);
16797            printf("\n");
16798        }
16799    }
16800    }
16801    function_tests++;
16802#endif
16803#endif
16804
16805    return(test_ret);
16806}
16807
16808#ifdef LIBXML_SCHEMAS_ENABLED
16809
16810#define gen_nb_xmlRelaxNGParserCtxtPtr 1
16811static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16812    return(NULL);
16813}
16814static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16815}
16816#endif
16817
16818#ifdef LIBXML_SCHEMAS_ENABLED
16819
16820#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
16821static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16822    return(NULL);
16823}
16824static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16825}
16826#endif
16827
16828#ifdef LIBXML_SCHEMAS_ENABLED
16829
16830#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
16831static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16832    return(NULL);
16833}
16834static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16835}
16836#endif
16837
16838#ifdef LIBXML_SCHEMAS_ENABLED
16839
16840#define gen_nb_void_ptr_ptr 1
16841static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16842    return(NULL);
16843}
16844static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16845}
16846#endif
16847
16848
16849static int
16850test_xmlRelaxNGGetParserErrors(void) {
16851    int test_ret = 0;
16852
16853#ifdef LIBXML_SCHEMAS_ENABLED
16854    int mem_base;
16855    int ret_val;
16856    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
16857    int n_ctxt;
16858    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
16859    int n_err;
16860    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
16861    int n_warn;
16862    void ** ctx; /* contextual data for the callbacks result */
16863    int n_ctx;
16864
16865    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
16866    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
16867    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
16868    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
16869        mem_base = xmlMemBlocks();
16870        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
16871        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
16872        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
16873        ctx = gen_void_ptr_ptr(n_ctx, 3);
16874
16875        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
16876        desret_int(ret_val);
16877        call_tests++;
16878        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
16879        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
16880        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
16881        des_void_ptr_ptr(n_ctx, ctx, 3);
16882        xmlResetLastError();
16883        if (mem_base != xmlMemBlocks()) {
16884            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
16885	           xmlMemBlocks() - mem_base);
16886	    test_ret++;
16887            printf(" %d", n_ctxt);
16888            printf(" %d", n_err);
16889            printf(" %d", n_warn);
16890            printf(" %d", n_ctx);
16891            printf("\n");
16892        }
16893    }
16894    }
16895    }
16896    }
16897    function_tests++;
16898#endif
16899
16900    return(test_ret);
16901}
16902
16903#ifdef LIBXML_SCHEMAS_ENABLED
16904
16905#define gen_nb_xmlRelaxNGValidCtxtPtr 1
16906static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16907    return(NULL);
16908}
16909static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16910}
16911#endif
16912
16913
16914static int
16915test_xmlRelaxNGGetValidErrors(void) {
16916    int test_ret = 0;
16917
16918#ifdef LIBXML_SCHEMAS_ENABLED
16919    int mem_base;
16920    int ret_val;
16921    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
16922    int n_ctxt;
16923    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
16924    int n_err;
16925    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
16926    int n_warn;
16927    void ** ctx; /* the functions context result */
16928    int n_ctx;
16929
16930    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
16931    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
16932    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
16933    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
16934        mem_base = xmlMemBlocks();
16935        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
16936        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
16937        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
16938        ctx = gen_void_ptr_ptr(n_ctx, 3);
16939
16940        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
16941        desret_int(ret_val);
16942        call_tests++;
16943        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
16944        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
16945        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
16946        des_void_ptr_ptr(n_ctx, ctx, 3);
16947        xmlResetLastError();
16948        if (mem_base != xmlMemBlocks()) {
16949            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
16950	           xmlMemBlocks() - mem_base);
16951	    test_ret++;
16952            printf(" %d", n_ctxt);
16953            printf(" %d", n_err);
16954            printf(" %d", n_warn);
16955            printf(" %d", n_ctx);
16956            printf("\n");
16957        }
16958    }
16959    }
16960    }
16961    }
16962    function_tests++;
16963#endif
16964
16965    return(test_ret);
16966}
16967
16968
16969static int
16970test_xmlRelaxNGInitTypes(void) {
16971    int test_ret = 0;
16972
16973#ifdef LIBXML_SCHEMAS_ENABLED
16974    int mem_base;
16975    int ret_val;
16976
16977        mem_base = xmlMemBlocks();
16978
16979        ret_val = xmlRelaxNGInitTypes();
16980        desret_int(ret_val);
16981        call_tests++;
16982        xmlResetLastError();
16983        if (mem_base != xmlMemBlocks()) {
16984            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
16985	           xmlMemBlocks() - mem_base);
16986	    test_ret++;
16987            printf("\n");
16988        }
16989    function_tests++;
16990#endif
16991
16992    return(test_ret);
16993}
16994
16995
16996static int
16997test_xmlRelaxNGNewDocParserCtxt(void) {
16998    int test_ret = 0;
16999
17000#ifdef LIBXML_SCHEMAS_ENABLED
17001    int mem_base;
17002    xmlRelaxNGParserCtxtPtr ret_val;
17003    xmlDocPtr doc; /* a preparsed document tree */
17004    int n_doc;
17005
17006    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17007        mem_base = xmlMemBlocks();
17008        doc = gen_xmlDocPtr(n_doc, 0);
17009
17010        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17011        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17012        call_tests++;
17013        des_xmlDocPtr(n_doc, doc, 0);
17014        xmlResetLastError();
17015        if (mem_base != xmlMemBlocks()) {
17016            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17017	           xmlMemBlocks() - mem_base);
17018	    test_ret++;
17019            printf(" %d", n_doc);
17020            printf("\n");
17021        }
17022    }
17023    function_tests++;
17024#endif
17025
17026    return(test_ret);
17027}
17028
17029
17030static int
17031test_xmlRelaxNGNewMemParserCtxt(void) {
17032    int test_ret = 0;
17033
17034#ifdef LIBXML_SCHEMAS_ENABLED
17035    int mem_base;
17036    xmlRelaxNGParserCtxtPtr ret_val;
17037    char * buffer; /* a pointer to a char array containing the schemas */
17038    int n_buffer;
17039    int size; /* the size of the array */
17040    int n_size;
17041
17042    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17043    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17044        mem_base = xmlMemBlocks();
17045        buffer = gen_const_char_ptr(n_buffer, 0);
17046        size = gen_int(n_size, 1);
17047
17048        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17049        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17050        call_tests++;
17051        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17052        des_int(n_size, size, 1);
17053        xmlResetLastError();
17054        if (mem_base != xmlMemBlocks()) {
17055            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17056	           xmlMemBlocks() - mem_base);
17057	    test_ret++;
17058            printf(" %d", n_buffer);
17059            printf(" %d", n_size);
17060            printf("\n");
17061        }
17062    }
17063    }
17064    function_tests++;
17065#endif
17066
17067    return(test_ret);
17068}
17069
17070
17071static int
17072test_xmlRelaxNGNewParserCtxt(void) {
17073    int test_ret = 0;
17074
17075#ifdef LIBXML_SCHEMAS_ENABLED
17076    int mem_base;
17077    xmlRelaxNGParserCtxtPtr ret_val;
17078    char * URL; /* the location of the schema */
17079    int n_URL;
17080
17081    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17082        mem_base = xmlMemBlocks();
17083        URL = gen_const_char_ptr(n_URL, 0);
17084
17085        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17086        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17087        call_tests++;
17088        des_const_char_ptr(n_URL, (const char *)URL, 0);
17089        xmlResetLastError();
17090        if (mem_base != xmlMemBlocks()) {
17091            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17092	           xmlMemBlocks() - mem_base);
17093	    test_ret++;
17094            printf(" %d", n_URL);
17095            printf("\n");
17096        }
17097    }
17098    function_tests++;
17099#endif
17100
17101    return(test_ret);
17102}
17103
17104
17105static int
17106test_xmlRelaxNGNewValidCtxt(void) {
17107    int test_ret = 0;
17108
17109
17110    /* missing type support */
17111    return(test_ret);
17112}
17113
17114
17115static int
17116test_xmlRelaxNGParse(void) {
17117    int test_ret = 0;
17118
17119
17120    /* missing type support */
17121    return(test_ret);
17122}
17123
17124
17125static int
17126test_xmlRelaxNGSetParserErrors(void) {
17127    int test_ret = 0;
17128
17129
17130    /* missing type support */
17131    return(test_ret);
17132}
17133
17134
17135static int
17136test_xmlRelaxNGSetValidErrors(void) {
17137    int test_ret = 0;
17138
17139
17140    /* missing type support */
17141    return(test_ret);
17142}
17143
17144
17145static int
17146test_xmlRelaxNGValidateDoc(void) {
17147    int test_ret = 0;
17148
17149#ifdef LIBXML_SCHEMAS_ENABLED
17150    int mem_base;
17151    int ret_val;
17152    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17153    int n_ctxt;
17154    xmlDocPtr doc; /* a parsed document tree */
17155    int n_doc;
17156
17157    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17158    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17159        mem_base = xmlMemBlocks();
17160        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17161        doc = gen_xmlDocPtr(n_doc, 1);
17162
17163        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17164        desret_int(ret_val);
17165        call_tests++;
17166        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17167        des_xmlDocPtr(n_doc, doc, 1);
17168        xmlResetLastError();
17169        if (mem_base != xmlMemBlocks()) {
17170            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17171	           xmlMemBlocks() - mem_base);
17172	    test_ret++;
17173            printf(" %d", n_ctxt);
17174            printf(" %d", n_doc);
17175            printf("\n");
17176        }
17177    }
17178    }
17179    function_tests++;
17180#endif
17181
17182    return(test_ret);
17183}
17184
17185
17186static int
17187test_xmlRelaxNGValidateFullElement(void) {
17188    int test_ret = 0;
17189
17190#ifdef LIBXML_SCHEMAS_ENABLED
17191    int mem_base;
17192    int ret_val;
17193    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17194    int n_ctxt;
17195    xmlDocPtr doc; /* a document instance */
17196    int n_doc;
17197    xmlNodePtr elem; /* an element instance */
17198    int n_elem;
17199
17200    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17201    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17202    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17203        mem_base = xmlMemBlocks();
17204        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17205        doc = gen_xmlDocPtr(n_doc, 1);
17206        elem = gen_xmlNodePtr(n_elem, 2);
17207
17208        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17209        desret_int(ret_val);
17210        call_tests++;
17211        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17212        des_xmlDocPtr(n_doc, doc, 1);
17213        des_xmlNodePtr(n_elem, elem, 2);
17214        xmlResetLastError();
17215        if (mem_base != xmlMemBlocks()) {
17216            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17217	           xmlMemBlocks() - mem_base);
17218	    test_ret++;
17219            printf(" %d", n_ctxt);
17220            printf(" %d", n_doc);
17221            printf(" %d", n_elem);
17222            printf("\n");
17223        }
17224    }
17225    }
17226    }
17227    function_tests++;
17228#endif
17229
17230    return(test_ret);
17231}
17232
17233
17234static int
17235test_xmlRelaxNGValidatePopElement(void) {
17236    int test_ret = 0;
17237
17238#ifdef LIBXML_SCHEMAS_ENABLED
17239    int mem_base;
17240    int ret_val;
17241    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17242    int n_ctxt;
17243    xmlDocPtr doc; /* a document instance */
17244    int n_doc;
17245    xmlNodePtr elem; /* an element instance */
17246    int n_elem;
17247
17248    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17249    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17250    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17251        mem_base = xmlMemBlocks();
17252        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17253        doc = gen_xmlDocPtr(n_doc, 1);
17254        elem = gen_xmlNodePtr(n_elem, 2);
17255
17256        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17257        desret_int(ret_val);
17258        call_tests++;
17259        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17260        des_xmlDocPtr(n_doc, doc, 1);
17261        des_xmlNodePtr(n_elem, elem, 2);
17262        xmlResetLastError();
17263        if (mem_base != xmlMemBlocks()) {
17264            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17265	           xmlMemBlocks() - mem_base);
17266	    test_ret++;
17267            printf(" %d", n_ctxt);
17268            printf(" %d", n_doc);
17269            printf(" %d", n_elem);
17270            printf("\n");
17271        }
17272    }
17273    }
17274    }
17275    function_tests++;
17276#endif
17277
17278    return(test_ret);
17279}
17280
17281
17282static int
17283test_xmlRelaxNGValidatePushCData(void) {
17284    int test_ret = 0;
17285
17286#ifdef LIBXML_SCHEMAS_ENABLED
17287    int mem_base;
17288    int ret_val;
17289    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17290    int n_ctxt;
17291    xmlChar * data; /* some character data read */
17292    int n_data;
17293    int len; /* the lenght of the data */
17294    int n_len;
17295
17296    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17297    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17298    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17299        mem_base = xmlMemBlocks();
17300        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17301        data = gen_const_xmlChar_ptr(n_data, 1);
17302        len = gen_int(n_len, 2);
17303
17304        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17305        desret_int(ret_val);
17306        call_tests++;
17307        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17308        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17309        des_int(n_len, len, 2);
17310        xmlResetLastError();
17311        if (mem_base != xmlMemBlocks()) {
17312            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17313	           xmlMemBlocks() - mem_base);
17314	    test_ret++;
17315            printf(" %d", n_ctxt);
17316            printf(" %d", n_data);
17317            printf(" %d", n_len);
17318            printf("\n");
17319        }
17320    }
17321    }
17322    }
17323    function_tests++;
17324#endif
17325
17326    return(test_ret);
17327}
17328
17329
17330static int
17331test_xmlRelaxNGValidatePushElement(void) {
17332    int test_ret = 0;
17333
17334#ifdef LIBXML_SCHEMAS_ENABLED
17335    int mem_base;
17336    int ret_val;
17337    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17338    int n_ctxt;
17339    xmlDocPtr doc; /* a document instance */
17340    int n_doc;
17341    xmlNodePtr elem; /* an element instance */
17342    int n_elem;
17343
17344    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17345    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17346    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17347        mem_base = xmlMemBlocks();
17348        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17349        doc = gen_xmlDocPtr(n_doc, 1);
17350        elem = gen_xmlNodePtr(n_elem, 2);
17351
17352        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17353        desret_int(ret_val);
17354        call_tests++;
17355        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17356        des_xmlDocPtr(n_doc, doc, 1);
17357        des_xmlNodePtr(n_elem, elem, 2);
17358        xmlResetLastError();
17359        if (mem_base != xmlMemBlocks()) {
17360            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17361	           xmlMemBlocks() - mem_base);
17362	    test_ret++;
17363            printf(" %d", n_ctxt);
17364            printf(" %d", n_doc);
17365            printf(" %d", n_elem);
17366            printf("\n");
17367        }
17368    }
17369    }
17370    }
17371    function_tests++;
17372#endif
17373
17374    return(test_ret);
17375}
17376
17377
17378static int
17379test_xmlRelaxParserSetFlag(void) {
17380    int test_ret = 0;
17381
17382#ifdef LIBXML_SCHEMAS_ENABLED
17383    int mem_base;
17384    int ret_val;
17385    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17386    int n_ctxt;
17387    int flags; /* a set of flags values */
17388    int n_flags;
17389
17390    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17391    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17392        mem_base = xmlMemBlocks();
17393        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17394        flags = gen_int(n_flags, 1);
17395
17396        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17397        desret_int(ret_val);
17398        call_tests++;
17399        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17400        des_int(n_flags, flags, 1);
17401        xmlResetLastError();
17402        if (mem_base != xmlMemBlocks()) {
17403            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17404	           xmlMemBlocks() - mem_base);
17405	    test_ret++;
17406            printf(" %d", n_ctxt);
17407            printf(" %d", n_flags);
17408            printf("\n");
17409        }
17410    }
17411    }
17412    function_tests++;
17413#endif
17414
17415    return(test_ret);
17416}
17417
17418static int
17419test_relaxng(void) {
17420    int test_ret = 0;
17421
17422    if (quiet == 0) printf("Testing relaxng : 14 of 22 functions ...\n");
17423    test_ret += test_xmlRelaxNGDump();
17424    test_ret += test_xmlRelaxNGDumpTree();
17425    test_ret += test_xmlRelaxNGGetParserErrors();
17426    test_ret += test_xmlRelaxNGGetValidErrors();
17427    test_ret += test_xmlRelaxNGInitTypes();
17428    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17429    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17430    test_ret += test_xmlRelaxNGNewParserCtxt();
17431    test_ret += test_xmlRelaxNGNewValidCtxt();
17432    test_ret += test_xmlRelaxNGParse();
17433    test_ret += test_xmlRelaxNGSetParserErrors();
17434    test_ret += test_xmlRelaxNGSetValidErrors();
17435    test_ret += test_xmlRelaxNGValidateDoc();
17436    test_ret += test_xmlRelaxNGValidateFullElement();
17437    test_ret += test_xmlRelaxNGValidatePopElement();
17438    test_ret += test_xmlRelaxNGValidatePushCData();
17439    test_ret += test_xmlRelaxNGValidatePushElement();
17440    test_ret += test_xmlRelaxParserSetFlag();
17441
17442    if (test_ret != 0)
17443	printf("Module relaxng: %d errors\n", test_ret);
17444    return(test_ret);
17445}
17446static int
17447test_schemasInternals(void) {
17448    int test_ret = 0;
17449
17450    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17451
17452    if (test_ret != 0)
17453	printf("Module schemasInternals: %d errors\n", test_ret);
17454    return(test_ret);
17455}
17456
17457static int
17458test_xmlAddChild(void) {
17459    int test_ret = 0;
17460
17461    int mem_base;
17462    xmlNodePtr ret_val;
17463    xmlNodePtr parent; /* the parent node */
17464    int n_parent;
17465    xmlNodePtr cur; /* the child node */
17466    int n_cur;
17467
17468    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17469    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17470        mem_base = xmlMemBlocks();
17471        parent = gen_xmlNodePtr(n_parent, 0);
17472        cur = gen_xmlNodePtr_in(n_cur, 1);
17473
17474        ret_val = xmlAddChild(parent, cur);
17475        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
17476        desret_xmlNodePtr(ret_val);
17477        call_tests++;
17478        des_xmlNodePtr(n_parent, parent, 0);
17479        des_xmlNodePtr_in(n_cur, cur, 1);
17480        xmlResetLastError();
17481        if (mem_base != xmlMemBlocks()) {
17482            printf("Leak of %d blocks found in xmlAddChild",
17483	           xmlMemBlocks() - mem_base);
17484	    test_ret++;
17485            printf(" %d", n_parent);
17486            printf(" %d", n_cur);
17487            printf("\n");
17488        }
17489    }
17490    }
17491    function_tests++;
17492
17493    return(test_ret);
17494}
17495
17496
17497static int
17498test_xmlAddChildList(void) {
17499    int test_ret = 0;
17500
17501    int mem_base;
17502    xmlNodePtr ret_val;
17503    xmlNodePtr parent; /* the parent node */
17504    int n_parent;
17505    xmlNodePtr cur; /* the first node in the list */
17506    int n_cur;
17507
17508    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
17509    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
17510        mem_base = xmlMemBlocks();
17511        parent = gen_xmlNodePtr(n_parent, 0);
17512        cur = gen_xmlNodePtr_in(n_cur, 1);
17513
17514        ret_val = xmlAddChildList(parent, cur);
17515        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
17516        desret_xmlNodePtr(ret_val);
17517        call_tests++;
17518        des_xmlNodePtr(n_parent, parent, 0);
17519        des_xmlNodePtr_in(n_cur, cur, 1);
17520        xmlResetLastError();
17521        if (mem_base != xmlMemBlocks()) {
17522            printf("Leak of %d blocks found in xmlAddChildList",
17523	           xmlMemBlocks() - mem_base);
17524	    test_ret++;
17525            printf(" %d", n_parent);
17526            printf(" %d", n_cur);
17527            printf("\n");
17528        }
17529    }
17530    }
17531    function_tests++;
17532
17533    return(test_ret);
17534}
17535
17536
17537static int
17538test_xmlAddNextSibling(void) {
17539    int test_ret = 0;
17540
17541    int mem_base;
17542    xmlNodePtr ret_val;
17543    xmlNodePtr cur; /* the child node */
17544    int n_cur;
17545    xmlNodePtr elem; /* the new node */
17546    int n_elem;
17547
17548    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17549    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17550        mem_base = xmlMemBlocks();
17551        cur = gen_xmlNodePtr(n_cur, 0);
17552        elem = gen_xmlNodePtr_in(n_elem, 1);
17553
17554        ret_val = xmlAddNextSibling(cur, elem);
17555        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17556        desret_xmlNodePtr(ret_val);
17557        call_tests++;
17558        des_xmlNodePtr(n_cur, cur, 0);
17559        des_xmlNodePtr_in(n_elem, elem, 1);
17560        xmlResetLastError();
17561        if (mem_base != xmlMemBlocks()) {
17562            printf("Leak of %d blocks found in xmlAddNextSibling",
17563	           xmlMemBlocks() - mem_base);
17564	    test_ret++;
17565            printf(" %d", n_cur);
17566            printf(" %d", n_elem);
17567            printf("\n");
17568        }
17569    }
17570    }
17571    function_tests++;
17572
17573    return(test_ret);
17574}
17575
17576
17577static int
17578test_xmlAddPrevSibling(void) {
17579    int test_ret = 0;
17580
17581#ifdef LIBXML_TREE_ENABLED
17582    int mem_base;
17583    xmlNodePtr ret_val;
17584    xmlNodePtr cur; /* the child node */
17585    int n_cur;
17586    xmlNodePtr elem; /* the new node */
17587    int n_elem;
17588
17589    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17590    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17591        mem_base = xmlMemBlocks();
17592        cur = gen_xmlNodePtr(n_cur, 0);
17593        elem = gen_xmlNodePtr_in(n_elem, 1);
17594
17595        ret_val = xmlAddPrevSibling(cur, elem);
17596        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17597        desret_xmlNodePtr(ret_val);
17598        call_tests++;
17599        des_xmlNodePtr(n_cur, cur, 0);
17600        des_xmlNodePtr_in(n_elem, elem, 1);
17601        xmlResetLastError();
17602        if (mem_base != xmlMemBlocks()) {
17603            printf("Leak of %d blocks found in xmlAddPrevSibling",
17604	           xmlMemBlocks() - mem_base);
17605	    test_ret++;
17606            printf(" %d", n_cur);
17607            printf(" %d", n_elem);
17608            printf("\n");
17609        }
17610    }
17611    }
17612    function_tests++;
17613#endif
17614
17615    return(test_ret);
17616}
17617
17618
17619static int
17620test_xmlAddSibling(void) {
17621    int test_ret = 0;
17622
17623    int mem_base;
17624    xmlNodePtr ret_val;
17625    xmlNodePtr cur; /* the child node */
17626    int n_cur;
17627    xmlNodePtr elem; /* the new node */
17628    int n_elem;
17629
17630    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
17631    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
17632        mem_base = xmlMemBlocks();
17633        cur = gen_xmlNodePtr(n_cur, 0);
17634        elem = gen_xmlNodePtr_in(n_elem, 1);
17635
17636        ret_val = xmlAddSibling(cur, elem);
17637        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
17638        desret_xmlNodePtr(ret_val);
17639        call_tests++;
17640        des_xmlNodePtr(n_cur, cur, 0);
17641        des_xmlNodePtr_in(n_elem, elem, 1);
17642        xmlResetLastError();
17643        if (mem_base != xmlMemBlocks()) {
17644            printf("Leak of %d blocks found in xmlAddSibling",
17645	           xmlMemBlocks() - mem_base);
17646	    test_ret++;
17647            printf(" %d", n_cur);
17648            printf(" %d", n_elem);
17649            printf("\n");
17650        }
17651    }
17652    }
17653    function_tests++;
17654
17655    return(test_ret);
17656}
17657
17658
17659static int
17660test_xmlAttrSerializeTxtContent(void) {
17661    int test_ret = 0;
17662
17663#ifdef LIBXML_OUTPUT_ENABLED
17664    int mem_base;
17665    xmlBufferPtr buf; /* the XML buffer output */
17666    int n_buf;
17667    xmlDocPtr doc; /* the document */
17668    int n_doc;
17669    xmlAttrPtr attr; /* the attribute node */
17670    int n_attr;
17671    xmlChar * string; /* the text content */
17672    int n_string;
17673
17674    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17675    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17676    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
17677    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
17678        mem_base = xmlMemBlocks();
17679        buf = gen_xmlBufferPtr(n_buf, 0);
17680        doc = gen_xmlDocPtr(n_doc, 1);
17681        attr = gen_xmlAttrPtr(n_attr, 2);
17682        string = gen_const_xmlChar_ptr(n_string, 3);
17683
17684        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
17685        call_tests++;
17686        des_xmlBufferPtr(n_buf, buf, 0);
17687        des_xmlDocPtr(n_doc, doc, 1);
17688        des_xmlAttrPtr(n_attr, attr, 2);
17689        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
17690        xmlResetLastError();
17691        if (mem_base != xmlMemBlocks()) {
17692            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
17693	           xmlMemBlocks() - mem_base);
17694	    test_ret++;
17695            printf(" %d", n_buf);
17696            printf(" %d", n_doc);
17697            printf(" %d", n_attr);
17698            printf(" %d", n_string);
17699            printf("\n");
17700        }
17701    }
17702    }
17703    }
17704    }
17705    function_tests++;
17706#endif
17707
17708    return(test_ret);
17709}
17710
17711
17712static int
17713test_xmlBufferAdd(void) {
17714    int test_ret = 0;
17715
17716    int mem_base;
17717    int ret_val;
17718    xmlBufferPtr buf; /* the buffer to dump */
17719    int n_buf;
17720    xmlChar * str; /* the #xmlChar string */
17721    int n_str;
17722    int len; /* the number of #xmlChar to add */
17723    int n_len;
17724
17725    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17726    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17727    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17728        mem_base = xmlMemBlocks();
17729        buf = gen_xmlBufferPtr(n_buf, 0);
17730        str = gen_const_xmlChar_ptr(n_str, 1);
17731        len = gen_int(n_len, 2);
17732
17733        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
17734        desret_int(ret_val);
17735        call_tests++;
17736        des_xmlBufferPtr(n_buf, buf, 0);
17737        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17738        des_int(n_len, len, 2);
17739        xmlResetLastError();
17740        if (mem_base != xmlMemBlocks()) {
17741            printf("Leak of %d blocks found in xmlBufferAdd",
17742	           xmlMemBlocks() - mem_base);
17743	    test_ret++;
17744            printf(" %d", n_buf);
17745            printf(" %d", n_str);
17746            printf(" %d", n_len);
17747            printf("\n");
17748        }
17749    }
17750    }
17751    }
17752    function_tests++;
17753
17754    return(test_ret);
17755}
17756
17757
17758static int
17759test_xmlBufferAddHead(void) {
17760    int test_ret = 0;
17761
17762    int mem_base;
17763    int ret_val;
17764    xmlBufferPtr buf; /* the buffer */
17765    int n_buf;
17766    xmlChar * str; /* the #xmlChar string */
17767    int n_str;
17768    int len; /* the number of #xmlChar to add */
17769    int n_len;
17770
17771    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17772    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17773    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17774        mem_base = xmlMemBlocks();
17775        buf = gen_xmlBufferPtr(n_buf, 0);
17776        str = gen_const_xmlChar_ptr(n_str, 1);
17777        len = gen_int(n_len, 2);
17778
17779        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
17780        desret_int(ret_val);
17781        call_tests++;
17782        des_xmlBufferPtr(n_buf, buf, 0);
17783        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17784        des_int(n_len, len, 2);
17785        xmlResetLastError();
17786        if (mem_base != xmlMemBlocks()) {
17787            printf("Leak of %d blocks found in xmlBufferAddHead",
17788	           xmlMemBlocks() - mem_base);
17789	    test_ret++;
17790            printf(" %d", n_buf);
17791            printf(" %d", n_str);
17792            printf(" %d", n_len);
17793            printf("\n");
17794        }
17795    }
17796    }
17797    }
17798    function_tests++;
17799
17800    return(test_ret);
17801}
17802
17803
17804static int
17805test_xmlBufferCCat(void) {
17806    int test_ret = 0;
17807
17808    int mem_base;
17809    int ret_val;
17810    xmlBufferPtr buf; /* the buffer to dump */
17811    int n_buf;
17812    char * str; /* the C char string */
17813    int n_str;
17814
17815    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17816    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
17817        mem_base = xmlMemBlocks();
17818        buf = gen_xmlBufferPtr(n_buf, 0);
17819        str = gen_const_char_ptr(n_str, 1);
17820
17821        ret_val = xmlBufferCCat(buf, (const char *)str);
17822        desret_int(ret_val);
17823        call_tests++;
17824        des_xmlBufferPtr(n_buf, buf, 0);
17825        des_const_char_ptr(n_str, (const char *)str, 1);
17826        xmlResetLastError();
17827        if (mem_base != xmlMemBlocks()) {
17828            printf("Leak of %d blocks found in xmlBufferCCat",
17829	           xmlMemBlocks() - mem_base);
17830	    test_ret++;
17831            printf(" %d", n_buf);
17832            printf(" %d", n_str);
17833            printf("\n");
17834        }
17835    }
17836    }
17837    function_tests++;
17838
17839    return(test_ret);
17840}
17841
17842
17843static int
17844test_xmlBufferCat(void) {
17845    int test_ret = 0;
17846
17847    int mem_base;
17848    int ret_val;
17849    xmlBufferPtr buf; /* the buffer to add to */
17850    int n_buf;
17851    xmlChar * str; /* the #xmlChar string */
17852    int n_str;
17853
17854    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17855    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
17856        mem_base = xmlMemBlocks();
17857        buf = gen_xmlBufferPtr(n_buf, 0);
17858        str = gen_const_xmlChar_ptr(n_str, 1);
17859
17860        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
17861        desret_int(ret_val);
17862        call_tests++;
17863        des_xmlBufferPtr(n_buf, buf, 0);
17864        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
17865        xmlResetLastError();
17866        if (mem_base != xmlMemBlocks()) {
17867            printf("Leak of %d blocks found in xmlBufferCat",
17868	           xmlMemBlocks() - mem_base);
17869	    test_ret++;
17870            printf(" %d", n_buf);
17871            printf(" %d", n_str);
17872            printf("\n");
17873        }
17874    }
17875    }
17876    function_tests++;
17877
17878    return(test_ret);
17879}
17880
17881
17882#define gen_nb_const_xmlBufferPtr 1
17883static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17884    return(NULL);
17885}
17886static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17887}
17888
17889static int
17890test_xmlBufferContent(void) {
17891    int test_ret = 0;
17892
17893    int mem_base;
17894    const xmlChar * ret_val;
17895    xmlBufferPtr buf; /* the buffer */
17896    int n_buf;
17897
17898    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
17899        mem_base = xmlMemBlocks();
17900        buf = gen_const_xmlBufferPtr(n_buf, 0);
17901
17902        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
17903        desret_const_xmlChar_ptr(ret_val);
17904        call_tests++;
17905        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
17906        xmlResetLastError();
17907        if (mem_base != xmlMemBlocks()) {
17908            printf("Leak of %d blocks found in xmlBufferContent",
17909	           xmlMemBlocks() - mem_base);
17910	    test_ret++;
17911            printf(" %d", n_buf);
17912            printf("\n");
17913        }
17914    }
17915    function_tests++;
17916
17917    return(test_ret);
17918}
17919
17920
17921static int
17922test_xmlBufferCreate(void) {
17923    int test_ret = 0;
17924
17925    int mem_base;
17926    xmlBufferPtr ret_val;
17927
17928        mem_base = xmlMemBlocks();
17929
17930        ret_val = xmlBufferCreate();
17931        desret_xmlBufferPtr(ret_val);
17932        call_tests++;
17933        xmlResetLastError();
17934        if (mem_base != xmlMemBlocks()) {
17935            printf("Leak of %d blocks found in xmlBufferCreate",
17936	           xmlMemBlocks() - mem_base);
17937	    test_ret++;
17938            printf("\n");
17939        }
17940    function_tests++;
17941
17942    return(test_ret);
17943}
17944
17945
17946static int
17947test_xmlBufferCreateSize(void) {
17948    int test_ret = 0;
17949
17950
17951    /* missing type support */
17952    return(test_ret);
17953}
17954
17955
17956static int
17957test_xmlBufferCreateStatic(void) {
17958    int test_ret = 0;
17959
17960
17961    /* missing type support */
17962    return(test_ret);
17963}
17964
17965
17966static int
17967test_xmlBufferEmpty(void) {
17968    int test_ret = 0;
17969
17970    int mem_base;
17971    xmlBufferPtr buf; /* the buffer */
17972    int n_buf;
17973
17974    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
17975        mem_base = xmlMemBlocks();
17976        buf = gen_xmlBufferPtr(n_buf, 0);
17977
17978        xmlBufferEmpty(buf);
17979        call_tests++;
17980        des_xmlBufferPtr(n_buf, buf, 0);
17981        xmlResetLastError();
17982        if (mem_base != xmlMemBlocks()) {
17983            printf("Leak of %d blocks found in xmlBufferEmpty",
17984	           xmlMemBlocks() - mem_base);
17985	    test_ret++;
17986            printf(" %d", n_buf);
17987            printf("\n");
17988        }
17989    }
17990    function_tests++;
17991
17992    return(test_ret);
17993}
17994
17995
17996static int
17997test_xmlBufferGrow(void) {
17998    int test_ret = 0;
17999
18000    int mem_base;
18001    int ret_val;
18002    xmlBufferPtr buf; /* the buffer */
18003    int n_buf;
18004    unsigned int len; /* the minimum free size to allocate */
18005    int n_len;
18006
18007    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18008    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18009        mem_base = xmlMemBlocks();
18010        buf = gen_xmlBufferPtr(n_buf, 0);
18011        len = gen_unsigned_int(n_len, 1);
18012
18013        ret_val = xmlBufferGrow(buf, len);
18014        desret_int(ret_val);
18015        call_tests++;
18016        des_xmlBufferPtr(n_buf, buf, 0);
18017        des_unsigned_int(n_len, len, 1);
18018        xmlResetLastError();
18019        if (mem_base != xmlMemBlocks()) {
18020            printf("Leak of %d blocks found in xmlBufferGrow",
18021	           xmlMemBlocks() - mem_base);
18022	    test_ret++;
18023            printf(" %d", n_buf);
18024            printf(" %d", n_len);
18025            printf("\n");
18026        }
18027    }
18028    }
18029    function_tests++;
18030
18031    return(test_ret);
18032}
18033
18034
18035static int
18036test_xmlBufferLength(void) {
18037    int test_ret = 0;
18038
18039    int mem_base;
18040    int ret_val;
18041    xmlBufferPtr buf; /* the buffer */
18042    int n_buf;
18043
18044    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18045        mem_base = xmlMemBlocks();
18046        buf = gen_const_xmlBufferPtr(n_buf, 0);
18047
18048        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18049        desret_int(ret_val);
18050        call_tests++;
18051        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18052        xmlResetLastError();
18053        if (mem_base != xmlMemBlocks()) {
18054            printf("Leak of %d blocks found in xmlBufferLength",
18055	           xmlMemBlocks() - mem_base);
18056	    test_ret++;
18057            printf(" %d", n_buf);
18058            printf("\n");
18059        }
18060    }
18061    function_tests++;
18062
18063    return(test_ret);
18064}
18065
18066
18067static int
18068test_xmlBufferResize(void) {
18069    int test_ret = 0;
18070
18071    int mem_base;
18072    int ret_val;
18073    xmlBufferPtr buf; /* the buffer to resize */
18074    int n_buf;
18075    unsigned int size; /* the desired size */
18076    int n_size;
18077
18078    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18079    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18080        mem_base = xmlMemBlocks();
18081        buf = gen_xmlBufferPtr(n_buf, 0);
18082        size = gen_unsigned_int(n_size, 1);
18083
18084        ret_val = xmlBufferResize(buf, size);
18085        desret_int(ret_val);
18086        call_tests++;
18087        des_xmlBufferPtr(n_buf, buf, 0);
18088        des_unsigned_int(n_size, size, 1);
18089        xmlResetLastError();
18090        if (mem_base != xmlMemBlocks()) {
18091            printf("Leak of %d blocks found in xmlBufferResize",
18092	           xmlMemBlocks() - mem_base);
18093	    test_ret++;
18094            printf(" %d", n_buf);
18095            printf(" %d", n_size);
18096            printf("\n");
18097        }
18098    }
18099    }
18100    function_tests++;
18101
18102    return(test_ret);
18103}
18104
18105
18106static int
18107test_xmlBufferSetAllocationScheme(void) {
18108    int test_ret = 0;
18109
18110    int mem_base;
18111    xmlBufferPtr buf; /* the buffer to tune */
18112    int n_buf;
18113    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18114    int n_scheme;
18115
18116    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18117    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18118        mem_base = xmlMemBlocks();
18119        buf = gen_xmlBufferPtr(n_buf, 0);
18120        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18121
18122        xmlBufferSetAllocationScheme(buf, scheme);
18123        call_tests++;
18124        des_xmlBufferPtr(n_buf, buf, 0);
18125        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18126        xmlResetLastError();
18127        if (mem_base != xmlMemBlocks()) {
18128            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18129	           xmlMemBlocks() - mem_base);
18130	    test_ret++;
18131            printf(" %d", n_buf);
18132            printf(" %d", n_scheme);
18133            printf("\n");
18134        }
18135    }
18136    }
18137    function_tests++;
18138
18139    return(test_ret);
18140}
18141
18142
18143static int
18144test_xmlBufferShrink(void) {
18145    int test_ret = 0;
18146
18147    int mem_base;
18148    int ret_val;
18149    xmlBufferPtr buf; /* the buffer to dump */
18150    int n_buf;
18151    unsigned int len; /* the number of xmlChar to remove */
18152    int n_len;
18153
18154    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18155    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18156        mem_base = xmlMemBlocks();
18157        buf = gen_xmlBufferPtr(n_buf, 0);
18158        len = gen_unsigned_int(n_len, 1);
18159
18160        ret_val = xmlBufferShrink(buf, len);
18161        desret_int(ret_val);
18162        call_tests++;
18163        des_xmlBufferPtr(n_buf, buf, 0);
18164        des_unsigned_int(n_len, len, 1);
18165        xmlResetLastError();
18166        if (mem_base != xmlMemBlocks()) {
18167            printf("Leak of %d blocks found in xmlBufferShrink",
18168	           xmlMemBlocks() - mem_base);
18169	    test_ret++;
18170            printf(" %d", n_buf);
18171            printf(" %d", n_len);
18172            printf("\n");
18173        }
18174    }
18175    }
18176    function_tests++;
18177
18178    return(test_ret);
18179}
18180
18181
18182static int
18183test_xmlBufferWriteCHAR(void) {
18184    int test_ret = 0;
18185
18186    int mem_base;
18187    xmlBufferPtr buf; /* the XML buffer */
18188    int n_buf;
18189    xmlChar * string; /* the string to add */
18190    int n_string;
18191
18192    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18193    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18194        mem_base = xmlMemBlocks();
18195        buf = gen_xmlBufferPtr(n_buf, 0);
18196        string = gen_const_xmlChar_ptr(n_string, 1);
18197
18198        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18199        call_tests++;
18200        des_xmlBufferPtr(n_buf, buf, 0);
18201        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18202        xmlResetLastError();
18203        if (mem_base != xmlMemBlocks()) {
18204            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18205	           xmlMemBlocks() - mem_base);
18206	    test_ret++;
18207            printf(" %d", n_buf);
18208            printf(" %d", n_string);
18209            printf("\n");
18210        }
18211    }
18212    }
18213    function_tests++;
18214
18215    return(test_ret);
18216}
18217
18218
18219static int
18220test_xmlBufferWriteChar(void) {
18221    int test_ret = 0;
18222
18223    int mem_base;
18224    xmlBufferPtr buf; /* the XML buffer output */
18225    int n_buf;
18226    char * string; /* the string to add */
18227    int n_string;
18228
18229    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18230    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18231        mem_base = xmlMemBlocks();
18232        buf = gen_xmlBufferPtr(n_buf, 0);
18233        string = gen_const_char_ptr(n_string, 1);
18234
18235        xmlBufferWriteChar(buf, (const char *)string);
18236        call_tests++;
18237        des_xmlBufferPtr(n_buf, buf, 0);
18238        des_const_char_ptr(n_string, (const char *)string, 1);
18239        xmlResetLastError();
18240        if (mem_base != xmlMemBlocks()) {
18241            printf("Leak of %d blocks found in xmlBufferWriteChar",
18242	           xmlMemBlocks() - mem_base);
18243	    test_ret++;
18244            printf(" %d", n_buf);
18245            printf(" %d", n_string);
18246            printf("\n");
18247        }
18248    }
18249    }
18250    function_tests++;
18251
18252    return(test_ret);
18253}
18254
18255
18256static int
18257test_xmlBufferWriteQuotedString(void) {
18258    int test_ret = 0;
18259
18260    int mem_base;
18261    xmlBufferPtr buf; /* the XML buffer output */
18262    int n_buf;
18263    xmlChar * string; /* the string to add */
18264    int n_string;
18265
18266    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18267    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18268        mem_base = xmlMemBlocks();
18269        buf = gen_xmlBufferPtr(n_buf, 0);
18270        string = gen_const_xmlChar_ptr(n_string, 1);
18271
18272        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18273        call_tests++;
18274        des_xmlBufferPtr(n_buf, buf, 0);
18275        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18276        xmlResetLastError();
18277        if (mem_base != xmlMemBlocks()) {
18278            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18279	           xmlMemBlocks() - mem_base);
18280	    test_ret++;
18281            printf(" %d", n_buf);
18282            printf(" %d", n_string);
18283            printf("\n");
18284        }
18285    }
18286    }
18287    function_tests++;
18288
18289    return(test_ret);
18290}
18291
18292
18293static int
18294test_xmlBuildQName(void) {
18295    int test_ret = 0;
18296
18297    int mem_base;
18298    xmlChar * ret_val;
18299    xmlChar * ncname; /* the Name */
18300    int n_ncname;
18301    xmlChar * prefix; /* the prefix */
18302    int n_prefix;
18303    xmlChar * memory; /* preallocated memory */
18304    int n_memory;
18305    int len; /* preallocated memory length */
18306    int n_len;
18307
18308    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18309    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18310    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18311    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18312        mem_base = xmlMemBlocks();
18313        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18314        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18315        memory = gen_xmlChar_ptr(n_memory, 2);
18316        len = gen_int(n_len, 3);
18317
18318        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18319        if ((ret_val != NULL) && (ret_val != ncname) &&
18320              (ret_val != prefix) && (ret_val != memory))
18321              xmlFree(ret_val);
18322	  ret_val = NULL;
18323        desret_xmlChar_ptr(ret_val);
18324        call_tests++;
18325        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18326        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18327        des_xmlChar_ptr(n_memory, memory, 2);
18328        des_int(n_len, len, 3);
18329        xmlResetLastError();
18330        if (mem_base != xmlMemBlocks()) {
18331            printf("Leak of %d blocks found in xmlBuildQName",
18332	           xmlMemBlocks() - mem_base);
18333	    test_ret++;
18334            printf(" %d", n_ncname);
18335            printf(" %d", n_prefix);
18336            printf(" %d", n_memory);
18337            printf(" %d", n_len);
18338            printf("\n");
18339        }
18340    }
18341    }
18342    }
18343    }
18344    function_tests++;
18345
18346    return(test_ret);
18347}
18348
18349
18350static int
18351test_xmlCopyDoc(void) {
18352    int test_ret = 0;
18353
18354#ifdef LIBXML_TREE_ENABLED
18355    int mem_base;
18356    xmlDocPtr ret_val;
18357    xmlDocPtr doc; /* the document */
18358    int n_doc;
18359    int recursive; /* if not zero do a recursive copy. */
18360    int n_recursive;
18361
18362    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18363    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
18364        mem_base = xmlMemBlocks();
18365        doc = gen_xmlDocPtr(n_doc, 0);
18366        recursive = gen_int(n_recursive, 1);
18367
18368        ret_val = xmlCopyDoc(doc, recursive);
18369        desret_xmlDocPtr(ret_val);
18370        call_tests++;
18371        des_xmlDocPtr(n_doc, doc, 0);
18372        des_int(n_recursive, recursive, 1);
18373        xmlResetLastError();
18374        if (mem_base != xmlMemBlocks()) {
18375            printf("Leak of %d blocks found in xmlCopyDoc",
18376	           xmlMemBlocks() - mem_base);
18377	    test_ret++;
18378            printf(" %d", n_doc);
18379            printf(" %d", n_recursive);
18380            printf("\n");
18381        }
18382    }
18383    }
18384    function_tests++;
18385#endif
18386
18387    return(test_ret);
18388}
18389
18390
18391static int
18392test_xmlCopyDtd(void) {
18393    int test_ret = 0;
18394
18395#ifdef LIBXML_TREE_ENABLED
18396    int mem_base;
18397    xmlDtdPtr ret_val;
18398    xmlDtdPtr dtd; /* the dtd */
18399    int n_dtd;
18400
18401    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
18402        mem_base = xmlMemBlocks();
18403        dtd = gen_xmlDtdPtr(n_dtd, 0);
18404
18405        ret_val = xmlCopyDtd(dtd);
18406        desret_xmlDtdPtr(ret_val);
18407        call_tests++;
18408        des_xmlDtdPtr(n_dtd, dtd, 0);
18409        xmlResetLastError();
18410        if (mem_base != xmlMemBlocks()) {
18411            printf("Leak of %d blocks found in xmlCopyDtd",
18412	           xmlMemBlocks() - mem_base);
18413	    test_ret++;
18414            printf(" %d", n_dtd);
18415            printf("\n");
18416        }
18417    }
18418    function_tests++;
18419#endif
18420
18421    return(test_ret);
18422}
18423
18424
18425static int
18426test_xmlCopyNamespace(void) {
18427    int test_ret = 0;
18428
18429    int mem_base;
18430    xmlNsPtr ret_val;
18431    xmlNsPtr cur; /* the namespace */
18432    int n_cur;
18433
18434    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18435        mem_base = xmlMemBlocks();
18436        cur = gen_xmlNsPtr(n_cur, 0);
18437
18438        ret_val = xmlCopyNamespace(cur);
18439        if (ret_val != NULL) xmlFreeNs(ret_val);
18440        desret_xmlNsPtr(ret_val);
18441        call_tests++;
18442        des_xmlNsPtr(n_cur, cur, 0);
18443        xmlResetLastError();
18444        if (mem_base != xmlMemBlocks()) {
18445            printf("Leak of %d blocks found in xmlCopyNamespace",
18446	           xmlMemBlocks() - mem_base);
18447	    test_ret++;
18448            printf(" %d", n_cur);
18449            printf("\n");
18450        }
18451    }
18452    function_tests++;
18453
18454    return(test_ret);
18455}
18456
18457
18458static int
18459test_xmlCopyNamespaceList(void) {
18460    int test_ret = 0;
18461
18462    int mem_base;
18463    xmlNsPtr ret_val;
18464    xmlNsPtr cur; /* the first namespace */
18465    int n_cur;
18466
18467    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
18468        mem_base = xmlMemBlocks();
18469        cur = gen_xmlNsPtr(n_cur, 0);
18470
18471        ret_val = xmlCopyNamespaceList(cur);
18472        if (ret_val != NULL) xmlFreeNsList(ret_val);
18473        desret_xmlNsPtr(ret_val);
18474        call_tests++;
18475        des_xmlNsPtr(n_cur, cur, 0);
18476        xmlResetLastError();
18477        if (mem_base != xmlMemBlocks()) {
18478            printf("Leak of %d blocks found in xmlCopyNamespaceList",
18479	           xmlMemBlocks() - mem_base);
18480	    test_ret++;
18481            printf(" %d", n_cur);
18482            printf("\n");
18483        }
18484    }
18485    function_tests++;
18486
18487    return(test_ret);
18488}
18489
18490
18491static int
18492test_xmlCopyNode(void) {
18493    int test_ret = 0;
18494
18495    int mem_base;
18496    xmlNodePtr ret_val;
18497    xmlNodePtr node; /* the node */
18498    int n_node;
18499    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18500    int n_extended;
18501
18502    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18503    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18504        mem_base = xmlMemBlocks();
18505        node = gen_const_xmlNodePtr(n_node, 0);
18506        extended = gen_int(n_extended, 1);
18507
18508        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
18509        desret_xmlNodePtr(ret_val);
18510        call_tests++;
18511        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18512        des_int(n_extended, extended, 1);
18513        xmlResetLastError();
18514        if (mem_base != xmlMemBlocks()) {
18515            printf("Leak of %d blocks found in xmlCopyNode",
18516	           xmlMemBlocks() - mem_base);
18517	    test_ret++;
18518            printf(" %d", n_node);
18519            printf(" %d", n_extended);
18520            printf("\n");
18521        }
18522    }
18523    }
18524    function_tests++;
18525
18526    return(test_ret);
18527}
18528
18529
18530static int
18531test_xmlCopyNodeList(void) {
18532    int test_ret = 0;
18533
18534    int mem_base;
18535    xmlNodePtr ret_val;
18536    xmlNodePtr node; /* the first node in the list. */
18537    int n_node;
18538
18539    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18540        mem_base = xmlMemBlocks();
18541        node = gen_const_xmlNodePtr(n_node, 0);
18542
18543        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
18544        desret_xmlNodePtr(ret_val);
18545        call_tests++;
18546        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18547        xmlResetLastError();
18548        if (mem_base != xmlMemBlocks()) {
18549            printf("Leak of %d blocks found in xmlCopyNodeList",
18550	           xmlMemBlocks() - mem_base);
18551	    test_ret++;
18552            printf(" %d", n_node);
18553            printf("\n");
18554        }
18555    }
18556    function_tests++;
18557
18558    return(test_ret);
18559}
18560
18561
18562static int
18563test_xmlCopyProp(void) {
18564    int test_ret = 0;
18565
18566    int mem_base;
18567    xmlAttrPtr ret_val;
18568    xmlNodePtr target; /* the element where the attribute will be grafted */
18569    int n_target;
18570    xmlAttrPtr cur; /* the attribute */
18571    int n_cur;
18572
18573    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18574    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18575        mem_base = xmlMemBlocks();
18576        target = gen_xmlNodePtr(n_target, 0);
18577        cur = gen_xmlAttrPtr(n_cur, 1);
18578
18579        ret_val = xmlCopyProp(target, cur);
18580        desret_xmlAttrPtr(ret_val);
18581        call_tests++;
18582        des_xmlNodePtr(n_target, target, 0);
18583        des_xmlAttrPtr(n_cur, cur, 1);
18584        xmlResetLastError();
18585        if (mem_base != xmlMemBlocks()) {
18586            printf("Leak of %d blocks found in xmlCopyProp",
18587	           xmlMemBlocks() - mem_base);
18588	    test_ret++;
18589            printf(" %d", n_target);
18590            printf(" %d", n_cur);
18591            printf("\n");
18592        }
18593    }
18594    }
18595    function_tests++;
18596
18597    return(test_ret);
18598}
18599
18600
18601static int
18602test_xmlCopyPropList(void) {
18603    int test_ret = 0;
18604
18605    int mem_base;
18606    xmlAttrPtr ret_val;
18607    xmlNodePtr target; /* the element where the attributes will be grafted */
18608    int n_target;
18609    xmlAttrPtr cur; /* the first attribute */
18610    int n_cur;
18611
18612    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
18613    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
18614        mem_base = xmlMemBlocks();
18615        target = gen_xmlNodePtr(n_target, 0);
18616        cur = gen_xmlAttrPtr(n_cur, 1);
18617
18618        ret_val = xmlCopyPropList(target, cur);
18619        desret_xmlAttrPtr(ret_val);
18620        call_tests++;
18621        des_xmlNodePtr(n_target, target, 0);
18622        des_xmlAttrPtr(n_cur, cur, 1);
18623        xmlResetLastError();
18624        if (mem_base != xmlMemBlocks()) {
18625            printf("Leak of %d blocks found in xmlCopyPropList",
18626	           xmlMemBlocks() - mem_base);
18627	    test_ret++;
18628            printf(" %d", n_target);
18629            printf(" %d", n_cur);
18630            printf("\n");
18631        }
18632    }
18633    }
18634    function_tests++;
18635
18636    return(test_ret);
18637}
18638
18639
18640static int
18641test_xmlCreateIntSubset(void) {
18642    int test_ret = 0;
18643
18644    int mem_base;
18645    xmlDtdPtr ret_val;
18646    xmlDocPtr doc; /* the document pointer */
18647    int n_doc;
18648    xmlChar * name; /* the DTD name */
18649    int n_name;
18650    xmlChar * ExternalID; /* the external (PUBLIC) ID */
18651    int n_ExternalID;
18652    xmlChar * SystemID; /* the system ID */
18653    int n_SystemID;
18654
18655    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18656    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
18657    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
18658    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
18659        mem_base = xmlMemBlocks();
18660        doc = gen_xmlDocPtr(n_doc, 0);
18661        name = gen_const_xmlChar_ptr(n_name, 1);
18662        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
18663        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
18664
18665        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
18666        desret_xmlDtdPtr(ret_val);
18667        call_tests++;
18668        des_xmlDocPtr(n_doc, doc, 0);
18669        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
18670        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
18671        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
18672        xmlResetLastError();
18673        if (mem_base != xmlMemBlocks()) {
18674            printf("Leak of %d blocks found in xmlCreateIntSubset",
18675	           xmlMemBlocks() - mem_base);
18676	    test_ret++;
18677            printf(" %d", n_doc);
18678            printf(" %d", n_name);
18679            printf(" %d", n_ExternalID);
18680            printf(" %d", n_SystemID);
18681            printf("\n");
18682        }
18683    }
18684    }
18685    }
18686    }
18687    function_tests++;
18688
18689    return(test_ret);
18690}
18691
18692
18693static int
18694test_xmlDocCopyNode(void) {
18695    int test_ret = 0;
18696
18697    int mem_base;
18698    xmlNodePtr ret_val;
18699    xmlNodePtr node; /* the node */
18700    int n_node;
18701    xmlDocPtr doc; /* the document */
18702    int n_doc;
18703    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
18704    int n_extended;
18705
18706    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18707    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18708    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
18709        mem_base = xmlMemBlocks();
18710        node = gen_const_xmlNodePtr(n_node, 0);
18711        doc = gen_xmlDocPtr(n_doc, 1);
18712        extended = gen_int(n_extended, 2);
18713
18714        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
18715        desret_xmlNodePtr(ret_val);
18716        call_tests++;
18717        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
18718        des_xmlDocPtr(n_doc, doc, 1);
18719        des_int(n_extended, extended, 2);
18720        xmlResetLastError();
18721        if (mem_base != xmlMemBlocks()) {
18722            printf("Leak of %d blocks found in xmlDocCopyNode",
18723	           xmlMemBlocks() - mem_base);
18724	    test_ret++;
18725            printf(" %d", n_node);
18726            printf(" %d", n_doc);
18727            printf(" %d", n_extended);
18728            printf("\n");
18729        }
18730    }
18731    }
18732    }
18733    function_tests++;
18734
18735    return(test_ret);
18736}
18737
18738
18739static int
18740test_xmlDocCopyNodeList(void) {
18741    int test_ret = 0;
18742
18743    int mem_base;
18744    xmlNodePtr ret_val;
18745    xmlDocPtr doc; /* the target document */
18746    int n_doc;
18747    xmlNodePtr node; /* the first node in the list. */
18748    int n_node;
18749
18750    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18751    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
18752        mem_base = xmlMemBlocks();
18753        doc = gen_xmlDocPtr(n_doc, 0);
18754        node = gen_const_xmlNodePtr(n_node, 1);
18755
18756        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
18757        desret_xmlNodePtr(ret_val);
18758        call_tests++;
18759        des_xmlDocPtr(n_doc, doc, 0);
18760        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
18761        xmlResetLastError();
18762        if (mem_base != xmlMemBlocks()) {
18763            printf("Leak of %d blocks found in xmlDocCopyNodeList",
18764	           xmlMemBlocks() - mem_base);
18765	    test_ret++;
18766            printf(" %d", n_doc);
18767            printf(" %d", n_node);
18768            printf("\n");
18769        }
18770    }
18771    }
18772    function_tests++;
18773
18774    return(test_ret);
18775}
18776
18777
18778static int
18779test_xmlDocDump(void) {
18780    int test_ret = 0;
18781
18782#ifdef LIBXML_OUTPUT_ENABLED
18783    int mem_base;
18784    int ret_val;
18785    FILE * f; /* the FILE* */
18786    int n_f;
18787    xmlDocPtr cur; /* the document */
18788    int n_cur;
18789
18790    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
18791    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18792        mem_base = xmlMemBlocks();
18793        f = gen_FILE_ptr(n_f, 0);
18794        cur = gen_xmlDocPtr(n_cur, 1);
18795
18796        ret_val = xmlDocDump(f, cur);
18797        desret_int(ret_val);
18798        call_tests++;
18799        des_FILE_ptr(n_f, f, 0);
18800        des_xmlDocPtr(n_cur, cur, 1);
18801        xmlResetLastError();
18802        if (mem_base != xmlMemBlocks()) {
18803            printf("Leak of %d blocks found in xmlDocDump",
18804	           xmlMemBlocks() - mem_base);
18805	    test_ret++;
18806            printf(" %d", n_f);
18807            printf(" %d", n_cur);
18808            printf("\n");
18809        }
18810    }
18811    }
18812    function_tests++;
18813#endif
18814
18815    return(test_ret);
18816}
18817
18818
18819static int
18820test_xmlDocDumpFormatMemory(void) {
18821    int test_ret = 0;
18822
18823#ifdef LIBXML_OUTPUT_ENABLED
18824    int mem_base;
18825    xmlDocPtr cur; /* the document */
18826    int n_cur;
18827    xmlChar ** mem; /* OUT: the memory pointer */
18828    int n_mem;
18829    int * size; /* OUT: the memory length */
18830    int n_size;
18831    int format; /* should formatting spaces been added */
18832    int n_format;
18833
18834    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18835    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
18836    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
18837    for (n_format = 0;n_format < gen_nb_int;n_format++) {
18838        mem_base = xmlMemBlocks();
18839        cur = gen_xmlDocPtr(n_cur, 0);
18840        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
18841        size = gen_int_ptr(n_size, 2);
18842        format = gen_int(n_format, 3);
18843
18844        xmlDocDumpFormatMemory(cur, mem, size, format);
18845        call_tests++;
18846        des_xmlDocPtr(n_cur, cur, 0);
18847        des_xmlChar_ptr_ptr(n_mem, mem, 1);
18848        des_int_ptr(n_size, size, 2);
18849        des_int(n_format, format, 3);
18850        xmlResetLastError();
18851        if (mem_base != xmlMemBlocks()) {
18852            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
18853	           xmlMemBlocks() - mem_base);
18854	    test_ret++;
18855            printf(" %d", n_cur);
18856            printf(" %d", n_mem);
18857            printf(" %d", n_size);
18858            printf(" %d", n_format);
18859            printf("\n");
18860        }
18861    }
18862    }
18863    }
18864    }
18865    function_tests++;
18866#endif
18867
18868    return(test_ret);
18869}
18870
18871
18872static int
18873test_xmlDocDumpFormatMemoryEnc(void) {
18874    int test_ret = 0;
18875
18876#ifdef LIBXML_OUTPUT_ENABLED
18877    int mem_base;
18878    xmlDocPtr out_doc; /* Document to generate XML text from */
18879    int n_out_doc;
18880    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
18881    int n_doc_txt_ptr;
18882    int * doc_txt_len; /* Length of the generated XML text */
18883    int n_doc_txt_len;
18884    char * txt_encoding; /* Character encoding to use when generating XML text */
18885    int n_txt_encoding;
18886    int format; /* should formatting spaces been added */
18887    int n_format;
18888
18889    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
18890    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
18891    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
18892    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
18893    for (n_format = 0;n_format < gen_nb_int;n_format++) {
18894        mem_base = xmlMemBlocks();
18895        out_doc = gen_xmlDocPtr(n_out_doc, 0);
18896        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
18897        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
18898        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
18899        format = gen_int(n_format, 4);
18900
18901        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
18902        call_tests++;
18903        des_xmlDocPtr(n_out_doc, out_doc, 0);
18904        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
18905        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
18906        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
18907        des_int(n_format, format, 4);
18908        xmlResetLastError();
18909        if (mem_base != xmlMemBlocks()) {
18910            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
18911	           xmlMemBlocks() - mem_base);
18912	    test_ret++;
18913            printf(" %d", n_out_doc);
18914            printf(" %d", n_doc_txt_ptr);
18915            printf(" %d", n_doc_txt_len);
18916            printf(" %d", n_txt_encoding);
18917            printf(" %d", n_format);
18918            printf("\n");
18919        }
18920    }
18921    }
18922    }
18923    }
18924    }
18925    function_tests++;
18926#endif
18927
18928    return(test_ret);
18929}
18930
18931
18932static int
18933test_xmlDocDumpMemory(void) {
18934    int test_ret = 0;
18935
18936#ifdef LIBXML_OUTPUT_ENABLED
18937    int mem_base;
18938    xmlDocPtr cur; /* the document */
18939    int n_cur;
18940    xmlChar ** mem; /* OUT: the memory pointer */
18941    int n_mem;
18942    int * size; /* OUT: the memory length */
18943    int n_size;
18944
18945    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
18946    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
18947    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
18948        mem_base = xmlMemBlocks();
18949        cur = gen_xmlDocPtr(n_cur, 0);
18950        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
18951        size = gen_int_ptr(n_size, 2);
18952
18953        xmlDocDumpMemory(cur, mem, size);
18954        call_tests++;
18955        des_xmlDocPtr(n_cur, cur, 0);
18956        des_xmlChar_ptr_ptr(n_mem, mem, 1);
18957        des_int_ptr(n_size, size, 2);
18958        xmlResetLastError();
18959        if (mem_base != xmlMemBlocks()) {
18960            printf("Leak of %d blocks found in xmlDocDumpMemory",
18961	           xmlMemBlocks() - mem_base);
18962	    test_ret++;
18963            printf(" %d", n_cur);
18964            printf(" %d", n_mem);
18965            printf(" %d", n_size);
18966            printf("\n");
18967        }
18968    }
18969    }
18970    }
18971    function_tests++;
18972#endif
18973
18974    return(test_ret);
18975}
18976
18977
18978static int
18979test_xmlDocDumpMemoryEnc(void) {
18980    int test_ret = 0;
18981
18982#ifdef LIBXML_OUTPUT_ENABLED
18983    int mem_base;
18984    xmlDocPtr out_doc; /* Document to generate XML text from */
18985    int n_out_doc;
18986    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
18987    int n_doc_txt_ptr;
18988    int * doc_txt_len; /* Length of the generated XML text */
18989    int n_doc_txt_len;
18990    char * txt_encoding; /* Character encoding to use when generating XML text */
18991    int n_txt_encoding;
18992
18993    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
18994    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
18995    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
18996    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
18997        mem_base = xmlMemBlocks();
18998        out_doc = gen_xmlDocPtr(n_out_doc, 0);
18999        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19000        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19001        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19002
19003        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19004        call_tests++;
19005        des_xmlDocPtr(n_out_doc, out_doc, 0);
19006        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19007        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19008        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19009        xmlResetLastError();
19010        if (mem_base != xmlMemBlocks()) {
19011            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19012	           xmlMemBlocks() - mem_base);
19013	    test_ret++;
19014            printf(" %d", n_out_doc);
19015            printf(" %d", n_doc_txt_ptr);
19016            printf(" %d", n_doc_txt_len);
19017            printf(" %d", n_txt_encoding);
19018            printf("\n");
19019        }
19020    }
19021    }
19022    }
19023    }
19024    function_tests++;
19025#endif
19026
19027    return(test_ret);
19028}
19029
19030
19031static int
19032test_xmlDocFormatDump(void) {
19033    int test_ret = 0;
19034
19035#ifdef LIBXML_OUTPUT_ENABLED
19036    int mem_base;
19037    int ret_val;
19038    FILE * f; /* the FILE* */
19039    int n_f;
19040    xmlDocPtr cur; /* the document */
19041    int n_cur;
19042    int format; /* should formatting spaces been added */
19043    int n_format;
19044
19045    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19046    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19047    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19048        mem_base = xmlMemBlocks();
19049        f = gen_FILE_ptr(n_f, 0);
19050        cur = gen_xmlDocPtr(n_cur, 1);
19051        format = gen_int(n_format, 2);
19052
19053        ret_val = xmlDocFormatDump(f, cur, format);
19054        desret_int(ret_val);
19055        call_tests++;
19056        des_FILE_ptr(n_f, f, 0);
19057        des_xmlDocPtr(n_cur, cur, 1);
19058        des_int(n_format, format, 2);
19059        xmlResetLastError();
19060        if (mem_base != xmlMemBlocks()) {
19061            printf("Leak of %d blocks found in xmlDocFormatDump",
19062	           xmlMemBlocks() - mem_base);
19063	    test_ret++;
19064            printf(" %d", n_f);
19065            printf(" %d", n_cur);
19066            printf(" %d", n_format);
19067            printf("\n");
19068        }
19069    }
19070    }
19071    }
19072    function_tests++;
19073#endif
19074
19075    return(test_ret);
19076}
19077
19078
19079static int
19080test_xmlDocGetRootElement(void) {
19081    int test_ret = 0;
19082
19083    int mem_base;
19084    xmlNodePtr ret_val;
19085    xmlDocPtr doc; /* the document */
19086    int n_doc;
19087
19088    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19089        mem_base = xmlMemBlocks();
19090        doc = gen_xmlDocPtr(n_doc, 0);
19091
19092        ret_val = xmlDocGetRootElement(doc);
19093        desret_xmlNodePtr(ret_val);
19094        call_tests++;
19095        des_xmlDocPtr(n_doc, doc, 0);
19096        xmlResetLastError();
19097        if (mem_base != xmlMemBlocks()) {
19098            printf("Leak of %d blocks found in xmlDocGetRootElement",
19099	           xmlMemBlocks() - mem_base);
19100	    test_ret++;
19101            printf(" %d", n_doc);
19102            printf("\n");
19103        }
19104    }
19105    function_tests++;
19106
19107    return(test_ret);
19108}
19109
19110
19111static int
19112test_xmlDocSetRootElement(void) {
19113    int test_ret = 0;
19114
19115#ifdef LIBXML_TREE_ENABLED
19116    int mem_base;
19117    xmlNodePtr ret_val;
19118    xmlDocPtr doc; /* the document */
19119    int n_doc;
19120    xmlNodePtr root; /* the new document root element */
19121    int n_root;
19122
19123    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19124    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
19125        mem_base = xmlMemBlocks();
19126        doc = gen_xmlDocPtr(n_doc, 0);
19127        root = gen_xmlNodePtr_in(n_root, 1);
19128
19129        ret_val = xmlDocSetRootElement(doc, root);
19130        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
19131        desret_xmlNodePtr(ret_val);
19132        call_tests++;
19133        des_xmlDocPtr(n_doc, doc, 0);
19134        des_xmlNodePtr_in(n_root, root, 1);
19135        xmlResetLastError();
19136        if (mem_base != xmlMemBlocks()) {
19137            printf("Leak of %d blocks found in xmlDocSetRootElement",
19138	           xmlMemBlocks() - mem_base);
19139	    test_ret++;
19140            printf(" %d", n_doc);
19141            printf(" %d", n_root);
19142            printf("\n");
19143        }
19144    }
19145    }
19146    function_tests++;
19147#endif
19148
19149    return(test_ret);
19150}
19151
19152
19153static int
19154test_xmlElemDump(void) {
19155    int test_ret = 0;
19156
19157#ifdef LIBXML_OUTPUT_ENABLED
19158    int mem_base;
19159    FILE * f; /* the FILE * for the output */
19160    int n_f;
19161    xmlDocPtr doc; /* the document */
19162    int n_doc;
19163    xmlNodePtr cur; /* the current node */
19164    int n_cur;
19165
19166    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19167    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19168    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
19169        mem_base = xmlMemBlocks();
19170        f = gen_FILE_ptr(n_f, 0);
19171        doc = gen_xmlDocPtr(n_doc, 1);
19172        cur = gen_xmlNodePtr(n_cur, 2);
19173
19174        xmlElemDump(f, doc, cur);
19175        call_tests++;
19176        des_FILE_ptr(n_f, f, 0);
19177        des_xmlDocPtr(n_doc, doc, 1);
19178        des_xmlNodePtr(n_cur, cur, 2);
19179        xmlResetLastError();
19180        if (mem_base != xmlMemBlocks()) {
19181            printf("Leak of %d blocks found in xmlElemDump",
19182	           xmlMemBlocks() - mem_base);
19183	    test_ret++;
19184            printf(" %d", n_f);
19185            printf(" %d", n_doc);
19186            printf(" %d", n_cur);
19187            printf("\n");
19188        }
19189    }
19190    }
19191    }
19192    function_tests++;
19193#endif
19194
19195    return(test_ret);
19196}
19197
19198
19199static int
19200test_xmlGetBufferAllocationScheme(void) {
19201    int test_ret = 0;
19202
19203    int mem_base;
19204    xmlBufferAllocationScheme ret_val;
19205
19206        mem_base = xmlMemBlocks();
19207
19208        ret_val = xmlGetBufferAllocationScheme();
19209        desret_xmlBufferAllocationScheme(ret_val);
19210        call_tests++;
19211        xmlResetLastError();
19212        if (mem_base != xmlMemBlocks()) {
19213            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
19214	           xmlMemBlocks() - mem_base);
19215	    test_ret++;
19216            printf("\n");
19217        }
19218    function_tests++;
19219
19220    return(test_ret);
19221}
19222
19223
19224static int
19225test_xmlGetCompressMode(void) {
19226    int test_ret = 0;
19227
19228    int mem_base;
19229    int ret_val;
19230
19231        mem_base = xmlMemBlocks();
19232
19233        ret_val = xmlGetCompressMode();
19234        desret_int(ret_val);
19235        call_tests++;
19236        xmlResetLastError();
19237        if (mem_base != xmlMemBlocks()) {
19238            printf("Leak of %d blocks found in xmlGetCompressMode",
19239	           xmlMemBlocks() - mem_base);
19240	    test_ret++;
19241            printf("\n");
19242        }
19243    function_tests++;
19244
19245    return(test_ret);
19246}
19247
19248
19249static int
19250test_xmlGetDocCompressMode(void) {
19251    int test_ret = 0;
19252
19253    int mem_base;
19254    int ret_val;
19255    xmlDocPtr doc; /* the document */
19256    int n_doc;
19257
19258    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19259        mem_base = xmlMemBlocks();
19260        doc = gen_xmlDocPtr(n_doc, 0);
19261
19262        ret_val = xmlGetDocCompressMode(doc);
19263        desret_int(ret_val);
19264        call_tests++;
19265        des_xmlDocPtr(n_doc, doc, 0);
19266        xmlResetLastError();
19267        if (mem_base != xmlMemBlocks()) {
19268            printf("Leak of %d blocks found in xmlGetDocCompressMode",
19269	           xmlMemBlocks() - mem_base);
19270	    test_ret++;
19271            printf(" %d", n_doc);
19272            printf("\n");
19273        }
19274    }
19275    function_tests++;
19276
19277    return(test_ret);
19278}
19279
19280
19281static int
19282test_xmlGetIntSubset(void) {
19283    int test_ret = 0;
19284
19285    int mem_base;
19286    xmlDtdPtr ret_val;
19287    xmlDocPtr doc; /* the document pointer */
19288    int n_doc;
19289
19290    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19291        mem_base = xmlMemBlocks();
19292        doc = gen_xmlDocPtr(n_doc, 0);
19293
19294        ret_val = xmlGetIntSubset(doc);
19295        desret_xmlDtdPtr(ret_val);
19296        call_tests++;
19297        des_xmlDocPtr(n_doc, doc, 0);
19298        xmlResetLastError();
19299        if (mem_base != xmlMemBlocks()) {
19300            printf("Leak of %d blocks found in xmlGetIntSubset",
19301	           xmlMemBlocks() - mem_base);
19302	    test_ret++;
19303            printf(" %d", n_doc);
19304            printf("\n");
19305        }
19306    }
19307    function_tests++;
19308
19309    return(test_ret);
19310}
19311
19312
19313static int
19314test_xmlGetLastChild(void) {
19315    int test_ret = 0;
19316
19317    int mem_base;
19318    xmlNodePtr ret_val;
19319    xmlNodePtr parent; /* the parent node */
19320    int n_parent;
19321
19322    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19323        mem_base = xmlMemBlocks();
19324        parent = gen_xmlNodePtr(n_parent, 0);
19325
19326        ret_val = xmlGetLastChild(parent);
19327        desret_xmlNodePtr(ret_val);
19328        call_tests++;
19329        des_xmlNodePtr(n_parent, parent, 0);
19330        xmlResetLastError();
19331        if (mem_base != xmlMemBlocks()) {
19332            printf("Leak of %d blocks found in xmlGetLastChild",
19333	           xmlMemBlocks() - mem_base);
19334	    test_ret++;
19335            printf(" %d", n_parent);
19336            printf("\n");
19337        }
19338    }
19339    function_tests++;
19340
19341    return(test_ret);
19342}
19343
19344
19345static int
19346test_xmlGetLineNo(void) {
19347    int test_ret = 0;
19348
19349    int mem_base;
19350    long ret_val;
19351    xmlNodePtr node; /* valid node */
19352    int n_node;
19353
19354    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19355        mem_base = xmlMemBlocks();
19356        node = gen_xmlNodePtr(n_node, 0);
19357
19358        ret_val = xmlGetLineNo(node);
19359        desret_long(ret_val);
19360        call_tests++;
19361        des_xmlNodePtr(n_node, node, 0);
19362        xmlResetLastError();
19363        if (mem_base != xmlMemBlocks()) {
19364            printf("Leak of %d blocks found in xmlGetLineNo",
19365	           xmlMemBlocks() - mem_base);
19366	    test_ret++;
19367            printf(" %d", n_node);
19368            printf("\n");
19369        }
19370    }
19371    function_tests++;
19372
19373    return(test_ret);
19374}
19375
19376
19377static int
19378test_xmlGetNoNsProp(void) {
19379    int test_ret = 0;
19380
19381    int mem_base;
19382    xmlChar * ret_val;
19383    xmlNodePtr node; /* the node */
19384    int n_node;
19385    xmlChar * name; /* the attribute name */
19386    int n_name;
19387
19388    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19389    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19390        mem_base = xmlMemBlocks();
19391        node = gen_xmlNodePtr(n_node, 0);
19392        name = gen_const_xmlChar_ptr(n_name, 1);
19393
19394        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
19395        desret_xmlChar_ptr(ret_val);
19396        call_tests++;
19397        des_xmlNodePtr(n_node, node, 0);
19398        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19399        xmlResetLastError();
19400        if (mem_base != xmlMemBlocks()) {
19401            printf("Leak of %d blocks found in xmlGetNoNsProp",
19402	           xmlMemBlocks() - mem_base);
19403	    test_ret++;
19404            printf(" %d", n_node);
19405            printf(" %d", n_name);
19406            printf("\n");
19407        }
19408    }
19409    }
19410    function_tests++;
19411
19412    return(test_ret);
19413}
19414
19415
19416static int
19417test_xmlGetNodePath(void) {
19418    int test_ret = 0;
19419
19420#ifdef LIBXML_TREE_ENABLED
19421    int mem_base;
19422    xmlChar * ret_val;
19423    xmlNodePtr node; /* a node */
19424    int n_node;
19425
19426    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19427        mem_base = xmlMemBlocks();
19428        node = gen_xmlNodePtr(n_node, 0);
19429
19430        ret_val = xmlGetNodePath(node);
19431        desret_xmlChar_ptr(ret_val);
19432        call_tests++;
19433        des_xmlNodePtr(n_node, node, 0);
19434        xmlResetLastError();
19435        if (mem_base != xmlMemBlocks()) {
19436            printf("Leak of %d blocks found in xmlGetNodePath",
19437	           xmlMemBlocks() - mem_base);
19438	    test_ret++;
19439            printf(" %d", n_node);
19440            printf("\n");
19441        }
19442    }
19443    function_tests++;
19444#endif
19445
19446    return(test_ret);
19447}
19448
19449
19450static int
19451test_xmlGetNsList(void) {
19452    int test_ret = 0;
19453
19454
19455    /* missing type support */
19456    return(test_ret);
19457}
19458
19459
19460static int
19461test_xmlGetNsProp(void) {
19462    int test_ret = 0;
19463
19464    int mem_base;
19465    xmlChar * ret_val;
19466    xmlNodePtr node; /* the node */
19467    int n_node;
19468    xmlChar * name; /* the attribute name */
19469    int n_name;
19470    xmlChar * nameSpace; /* the URI of the namespace */
19471    int n_nameSpace;
19472
19473    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19474    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19475    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19476        mem_base = xmlMemBlocks();
19477        node = gen_xmlNodePtr(n_node, 0);
19478        name = gen_const_xmlChar_ptr(n_name, 1);
19479        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
19480
19481        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
19482        desret_xmlChar_ptr(ret_val);
19483        call_tests++;
19484        des_xmlNodePtr(n_node, node, 0);
19485        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19486        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
19487        xmlResetLastError();
19488        if (mem_base != xmlMemBlocks()) {
19489            printf("Leak of %d blocks found in xmlGetNsProp",
19490	           xmlMemBlocks() - mem_base);
19491	    test_ret++;
19492            printf(" %d", n_node);
19493            printf(" %d", n_name);
19494            printf(" %d", n_nameSpace);
19495            printf("\n");
19496        }
19497    }
19498    }
19499    }
19500    function_tests++;
19501
19502    return(test_ret);
19503}
19504
19505
19506static int
19507test_xmlGetProp(void) {
19508    int test_ret = 0;
19509
19510    int mem_base;
19511    xmlChar * ret_val;
19512    xmlNodePtr node; /* the node */
19513    int n_node;
19514    xmlChar * name; /* the attribute name */
19515    int n_name;
19516
19517    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19518    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19519        mem_base = xmlMemBlocks();
19520        node = gen_xmlNodePtr(n_node, 0);
19521        name = gen_const_xmlChar_ptr(n_name, 1);
19522
19523        ret_val = xmlGetProp(node, (const xmlChar *)name);
19524        desret_xmlChar_ptr(ret_val);
19525        call_tests++;
19526        des_xmlNodePtr(n_node, node, 0);
19527        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19528        xmlResetLastError();
19529        if (mem_base != xmlMemBlocks()) {
19530            printf("Leak of %d blocks found in xmlGetProp",
19531	           xmlMemBlocks() - mem_base);
19532	    test_ret++;
19533            printf(" %d", n_node);
19534            printf(" %d", n_name);
19535            printf("\n");
19536        }
19537    }
19538    }
19539    function_tests++;
19540
19541    return(test_ret);
19542}
19543
19544
19545static int
19546test_xmlHasNsProp(void) {
19547    int test_ret = 0;
19548
19549    int mem_base;
19550    xmlAttrPtr ret_val;
19551    xmlNodePtr node; /* the node */
19552    int n_node;
19553    xmlChar * name; /* the attribute name */
19554    int n_name;
19555    xmlChar * nameSpace; /* the URI of the namespace */
19556    int n_nameSpace;
19557
19558    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19559    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19560    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
19561        mem_base = xmlMemBlocks();
19562        node = gen_xmlNodePtr(n_node, 0);
19563        name = gen_const_xmlChar_ptr(n_name, 1);
19564        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
19565
19566        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
19567        desret_xmlAttrPtr(ret_val);
19568        call_tests++;
19569        des_xmlNodePtr(n_node, node, 0);
19570        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19571        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
19572        xmlResetLastError();
19573        if (mem_base != xmlMemBlocks()) {
19574            printf("Leak of %d blocks found in xmlHasNsProp",
19575	           xmlMemBlocks() - mem_base);
19576	    test_ret++;
19577            printf(" %d", n_node);
19578            printf(" %d", n_name);
19579            printf(" %d", n_nameSpace);
19580            printf("\n");
19581        }
19582    }
19583    }
19584    }
19585    function_tests++;
19586
19587    return(test_ret);
19588}
19589
19590
19591static int
19592test_xmlHasProp(void) {
19593    int test_ret = 0;
19594
19595    int mem_base;
19596    xmlAttrPtr ret_val;
19597    xmlNodePtr node; /* the node */
19598    int n_node;
19599    xmlChar * name; /* the attribute name */
19600    int n_name;
19601
19602    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19603    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19604        mem_base = xmlMemBlocks();
19605        node = gen_xmlNodePtr(n_node, 0);
19606        name = gen_const_xmlChar_ptr(n_name, 1);
19607
19608        ret_val = xmlHasProp(node, (const xmlChar *)name);
19609        desret_xmlAttrPtr(ret_val);
19610        call_tests++;
19611        des_xmlNodePtr(n_node, node, 0);
19612        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19613        xmlResetLastError();
19614        if (mem_base != xmlMemBlocks()) {
19615            printf("Leak of %d blocks found in xmlHasProp",
19616	           xmlMemBlocks() - mem_base);
19617	    test_ret++;
19618            printf(" %d", n_node);
19619            printf(" %d", n_name);
19620            printf("\n");
19621        }
19622    }
19623    }
19624    function_tests++;
19625
19626    return(test_ret);
19627}
19628
19629
19630static int
19631test_xmlIsBlankNode(void) {
19632    int test_ret = 0;
19633
19634    int mem_base;
19635    int ret_val;
19636    xmlNodePtr node; /* the node */
19637    int n_node;
19638
19639    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19640        mem_base = xmlMemBlocks();
19641        node = gen_xmlNodePtr(n_node, 0);
19642
19643        ret_val = xmlIsBlankNode(node);
19644        desret_int(ret_val);
19645        call_tests++;
19646        des_xmlNodePtr(n_node, node, 0);
19647        xmlResetLastError();
19648        if (mem_base != xmlMemBlocks()) {
19649            printf("Leak of %d blocks found in xmlIsBlankNode",
19650	           xmlMemBlocks() - mem_base);
19651	    test_ret++;
19652            printf(" %d", n_node);
19653            printf("\n");
19654        }
19655    }
19656    function_tests++;
19657
19658    return(test_ret);
19659}
19660
19661
19662static int
19663test_xmlIsXHTML(void) {
19664    int test_ret = 0;
19665
19666    int mem_base;
19667    int ret_val;
19668    xmlChar * systemID; /* the system identifier */
19669    int n_systemID;
19670    xmlChar * publicID; /* the public identifier */
19671    int n_publicID;
19672
19673    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
19674    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
19675        mem_base = xmlMemBlocks();
19676        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
19677        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
19678
19679        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
19680        desret_int(ret_val);
19681        call_tests++;
19682        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
19683        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
19684        xmlResetLastError();
19685        if (mem_base != xmlMemBlocks()) {
19686            printf("Leak of %d blocks found in xmlIsXHTML",
19687	           xmlMemBlocks() - mem_base);
19688	    test_ret++;
19689            printf(" %d", n_systemID);
19690            printf(" %d", n_publicID);
19691            printf("\n");
19692        }
19693    }
19694    }
19695    function_tests++;
19696
19697    return(test_ret);
19698}
19699
19700
19701static int
19702test_xmlNewCDataBlock(void) {
19703    int test_ret = 0;
19704
19705    int mem_base;
19706    xmlNodePtr ret_val;
19707    xmlDocPtr doc; /* the document */
19708    int n_doc;
19709    xmlChar * content; /* the CDATA block content content */
19710    int n_content;
19711    int len; /* the length of the block */
19712    int n_len;
19713
19714    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19715    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19716    for (n_len = 0;n_len < gen_nb_int;n_len++) {
19717        mem_base = xmlMemBlocks();
19718        doc = gen_xmlDocPtr(n_doc, 0);
19719        content = gen_const_xmlChar_ptr(n_content, 1);
19720        len = gen_int(n_len, 2);
19721
19722        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
19723        desret_xmlNodePtr(ret_val);
19724        call_tests++;
19725        des_xmlDocPtr(n_doc, doc, 0);
19726        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
19727        des_int(n_len, len, 2);
19728        xmlResetLastError();
19729        if (mem_base != xmlMemBlocks()) {
19730            printf("Leak of %d blocks found in xmlNewCDataBlock",
19731	           xmlMemBlocks() - mem_base);
19732	    test_ret++;
19733            printf(" %d", n_doc);
19734            printf(" %d", n_content);
19735            printf(" %d", n_len);
19736            printf("\n");
19737        }
19738    }
19739    }
19740    }
19741    function_tests++;
19742
19743    return(test_ret);
19744}
19745
19746
19747static int
19748test_xmlNewCharRef(void) {
19749    int test_ret = 0;
19750
19751    int mem_base;
19752    xmlNodePtr ret_val;
19753    xmlDocPtr doc; /* the document */
19754    int n_doc;
19755    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
19756    int n_name;
19757
19758    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19759    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19760        mem_base = xmlMemBlocks();
19761        doc = gen_xmlDocPtr(n_doc, 0);
19762        name = gen_const_xmlChar_ptr(n_name, 1);
19763
19764        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
19765        desret_xmlNodePtr(ret_val);
19766        call_tests++;
19767        des_xmlDocPtr(n_doc, doc, 0);
19768        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19769        xmlResetLastError();
19770        if (mem_base != xmlMemBlocks()) {
19771            printf("Leak of %d blocks found in xmlNewCharRef",
19772	           xmlMemBlocks() - mem_base);
19773	    test_ret++;
19774            printf(" %d", n_doc);
19775            printf(" %d", n_name);
19776            printf("\n");
19777        }
19778    }
19779    }
19780    function_tests++;
19781
19782    return(test_ret);
19783}
19784
19785
19786static int
19787test_xmlNewChild(void) {
19788    int test_ret = 0;
19789
19790#ifdef LIBXML_TREE_ENABLED
19791    int mem_base;
19792    xmlNodePtr ret_val;
19793    xmlNodePtr parent; /* the parent node */
19794    int n_parent;
19795    xmlNsPtr ns; /* a namespace if any */
19796    int n_ns;
19797    xmlChar * name; /* the name of the child */
19798    int n_name;
19799    xmlChar * content; /* the XML content of the child if any. */
19800    int n_content;
19801
19802    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19803    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
19804    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19805    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19806        mem_base = xmlMemBlocks();
19807        parent = gen_xmlNodePtr(n_parent, 0);
19808        ns = gen_xmlNsPtr(n_ns, 1);
19809        name = gen_const_xmlChar_ptr(n_name, 2);
19810        content = gen_const_xmlChar_ptr(n_content, 3);
19811
19812        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
19813        desret_xmlNodePtr(ret_val);
19814        call_tests++;
19815        des_xmlNodePtr(n_parent, parent, 0);
19816        des_xmlNsPtr(n_ns, ns, 1);
19817        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
19818        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
19819        xmlResetLastError();
19820        if (mem_base != xmlMemBlocks()) {
19821            printf("Leak of %d blocks found in xmlNewChild",
19822	           xmlMemBlocks() - mem_base);
19823	    test_ret++;
19824            printf(" %d", n_parent);
19825            printf(" %d", n_ns);
19826            printf(" %d", n_name);
19827            printf(" %d", n_content);
19828            printf("\n");
19829        }
19830    }
19831    }
19832    }
19833    }
19834    function_tests++;
19835#endif
19836
19837    return(test_ret);
19838}
19839
19840
19841static int
19842test_xmlNewComment(void) {
19843    int test_ret = 0;
19844
19845    int mem_base;
19846    xmlNodePtr ret_val;
19847    xmlChar * content; /* the comment content */
19848    int n_content;
19849
19850    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19851        mem_base = xmlMemBlocks();
19852        content = gen_const_xmlChar_ptr(n_content, 0);
19853
19854        ret_val = xmlNewComment((const xmlChar *)content);
19855        desret_xmlNodePtr(ret_val);
19856        call_tests++;
19857        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
19858        xmlResetLastError();
19859        if (mem_base != xmlMemBlocks()) {
19860            printf("Leak of %d blocks found in xmlNewComment",
19861	           xmlMemBlocks() - mem_base);
19862	    test_ret++;
19863            printf(" %d", n_content);
19864            printf("\n");
19865        }
19866    }
19867    function_tests++;
19868
19869    return(test_ret);
19870}
19871
19872
19873static int
19874test_xmlNewDoc(void) {
19875    int test_ret = 0;
19876
19877    int mem_base;
19878    xmlDocPtr ret_val;
19879    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
19880    int n_version;
19881
19882    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
19883        mem_base = xmlMemBlocks();
19884        version = gen_const_xmlChar_ptr(n_version, 0);
19885
19886        ret_val = xmlNewDoc((const xmlChar *)version);
19887        desret_xmlDocPtr(ret_val);
19888        call_tests++;
19889        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
19890        xmlResetLastError();
19891        if (mem_base != xmlMemBlocks()) {
19892            printf("Leak of %d blocks found in xmlNewDoc",
19893	           xmlMemBlocks() - mem_base);
19894	    test_ret++;
19895            printf(" %d", n_version);
19896            printf("\n");
19897        }
19898    }
19899    function_tests++;
19900
19901    return(test_ret);
19902}
19903
19904
19905static int
19906test_xmlNewDocComment(void) {
19907    int test_ret = 0;
19908
19909    int mem_base;
19910    xmlNodePtr ret_val;
19911    xmlDocPtr doc; /* the document */
19912    int n_doc;
19913    xmlChar * content; /* the comment content */
19914    int n_content;
19915
19916    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19917    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19918        mem_base = xmlMemBlocks();
19919        doc = gen_xmlDocPtr(n_doc, 0);
19920        content = gen_const_xmlChar_ptr(n_content, 1);
19921
19922        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
19923        desret_xmlNodePtr(ret_val);
19924        call_tests++;
19925        des_xmlDocPtr(n_doc, doc, 0);
19926        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
19927        xmlResetLastError();
19928        if (mem_base != xmlMemBlocks()) {
19929            printf("Leak of %d blocks found in xmlNewDocComment",
19930	           xmlMemBlocks() - mem_base);
19931	    test_ret++;
19932            printf(" %d", n_doc);
19933            printf(" %d", n_content);
19934            printf("\n");
19935        }
19936    }
19937    }
19938    function_tests++;
19939
19940    return(test_ret);
19941}
19942
19943
19944static int
19945test_xmlNewDocFragment(void) {
19946    int test_ret = 0;
19947
19948#ifdef LIBXML_TREE_ENABLED
19949    int mem_base;
19950    xmlNodePtr ret_val;
19951    xmlDocPtr doc; /* the document owning the fragment */
19952    int n_doc;
19953
19954    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19955        mem_base = xmlMemBlocks();
19956        doc = gen_xmlDocPtr(n_doc, 0);
19957
19958        ret_val = xmlNewDocFragment(doc);
19959        desret_xmlNodePtr(ret_val);
19960        call_tests++;
19961        des_xmlDocPtr(n_doc, doc, 0);
19962        xmlResetLastError();
19963        if (mem_base != xmlMemBlocks()) {
19964            printf("Leak of %d blocks found in xmlNewDocFragment",
19965	           xmlMemBlocks() - mem_base);
19966	    test_ret++;
19967            printf(" %d", n_doc);
19968            printf("\n");
19969        }
19970    }
19971    function_tests++;
19972#endif
19973
19974    return(test_ret);
19975}
19976
19977
19978static int
19979test_xmlNewDocNode(void) {
19980    int test_ret = 0;
19981
19982    int mem_base;
19983    xmlNodePtr ret_val;
19984    xmlDocPtr doc; /* the document */
19985    int n_doc;
19986    xmlNsPtr ns; /* namespace if any */
19987    int n_ns;
19988    xmlChar * name; /* the node name */
19989    int n_name;
19990    xmlChar * content; /* the XML text content if any */
19991    int n_content;
19992
19993    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19994    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
19995    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19996    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
19997        mem_base = xmlMemBlocks();
19998        doc = gen_xmlDocPtr(n_doc, 0);
19999        ns = gen_xmlNsPtr(n_ns, 1);
20000        name = gen_const_xmlChar_ptr(n_name, 2);
20001        content = gen_const_xmlChar_ptr(n_content, 3);
20002
20003        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20004        desret_xmlNodePtr(ret_val);
20005        call_tests++;
20006        des_xmlDocPtr(n_doc, doc, 0);
20007        des_xmlNsPtr(n_ns, ns, 1);
20008        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20009        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20010        xmlResetLastError();
20011        if (mem_base != xmlMemBlocks()) {
20012            printf("Leak of %d blocks found in xmlNewDocNode",
20013	           xmlMemBlocks() - mem_base);
20014	    test_ret++;
20015            printf(" %d", n_doc);
20016            printf(" %d", n_ns);
20017            printf(" %d", n_name);
20018            printf(" %d", n_content);
20019            printf("\n");
20020        }
20021    }
20022    }
20023    }
20024    }
20025    function_tests++;
20026
20027    return(test_ret);
20028}
20029
20030
20031static int
20032test_xmlNewDocNodeEatName(void) {
20033    int test_ret = 0;
20034
20035    int mem_base;
20036    xmlNodePtr ret_val;
20037    xmlDocPtr doc; /* the document */
20038    int n_doc;
20039    xmlNsPtr ns; /* namespace if any */
20040    int n_ns;
20041    xmlChar * name; /* the node name */
20042    int n_name;
20043    xmlChar * content; /* the XML text content if any */
20044    int n_content;
20045
20046    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20047    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20048    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20049    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20050        mem_base = xmlMemBlocks();
20051        doc = gen_xmlDocPtr(n_doc, 0);
20052        ns = gen_xmlNsPtr(n_ns, 1);
20053        name = gen_eaten_name(n_name, 2);
20054        content = gen_const_xmlChar_ptr(n_content, 3);
20055
20056        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
20057        desret_xmlNodePtr(ret_val);
20058        call_tests++;
20059        des_xmlDocPtr(n_doc, doc, 0);
20060        des_xmlNsPtr(n_ns, ns, 1);
20061        des_eaten_name(n_name, name, 2);
20062        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20063        xmlResetLastError();
20064        if (mem_base != xmlMemBlocks()) {
20065            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20066	           xmlMemBlocks() - mem_base);
20067	    test_ret++;
20068            printf(" %d", n_doc);
20069            printf(" %d", n_ns);
20070            printf(" %d", n_name);
20071            printf(" %d", n_content);
20072            printf("\n");
20073        }
20074    }
20075    }
20076    }
20077    }
20078    function_tests++;
20079
20080    return(test_ret);
20081}
20082
20083
20084static int
20085test_xmlNewDocPI(void) {
20086    int test_ret = 0;
20087
20088    int mem_base;
20089    xmlNodePtr ret_val;
20090    xmlDocPtr doc; /* the target document */
20091    int n_doc;
20092    xmlChar * name; /* the processing instruction name */
20093    int n_name;
20094    xmlChar * content; /* the PI content */
20095    int n_content;
20096
20097    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20098    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20099    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20100        mem_base = xmlMemBlocks();
20101        doc = gen_xmlDocPtr(n_doc, 0);
20102        name = gen_const_xmlChar_ptr(n_name, 1);
20103        content = gen_const_xmlChar_ptr(n_content, 2);
20104
20105        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
20106        desret_xmlNodePtr(ret_val);
20107        call_tests++;
20108        des_xmlDocPtr(n_doc, doc, 0);
20109        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20110        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
20111        xmlResetLastError();
20112        if (mem_base != xmlMemBlocks()) {
20113            printf("Leak of %d blocks found in xmlNewDocPI",
20114	           xmlMemBlocks() - mem_base);
20115	    test_ret++;
20116            printf(" %d", n_doc);
20117            printf(" %d", n_name);
20118            printf(" %d", n_content);
20119            printf("\n");
20120        }
20121    }
20122    }
20123    }
20124    function_tests++;
20125
20126    return(test_ret);
20127}
20128
20129
20130static int
20131test_xmlNewDocProp(void) {
20132    int test_ret = 0;
20133
20134    int mem_base;
20135    xmlAttrPtr ret_val;
20136    xmlDocPtr doc; /* the document */
20137    int n_doc;
20138    xmlChar * name; /* the name of the attribute */
20139    int n_name;
20140    xmlChar * value; /* the value of the attribute */
20141    int n_value;
20142
20143    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20144    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20145    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20146        mem_base = xmlMemBlocks();
20147        doc = gen_xmlDocPtr(n_doc, 0);
20148        name = gen_const_xmlChar_ptr(n_name, 1);
20149        value = gen_const_xmlChar_ptr(n_value, 2);
20150
20151        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
20152        desret_xmlAttrPtr(ret_val);
20153        call_tests++;
20154        des_xmlDocPtr(n_doc, doc, 0);
20155        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20156        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20157        xmlResetLastError();
20158        if (mem_base != xmlMemBlocks()) {
20159            printf("Leak of %d blocks found in xmlNewDocProp",
20160	           xmlMemBlocks() - mem_base);
20161	    test_ret++;
20162            printf(" %d", n_doc);
20163            printf(" %d", n_name);
20164            printf(" %d", n_value);
20165            printf("\n");
20166        }
20167    }
20168    }
20169    }
20170    function_tests++;
20171
20172    return(test_ret);
20173}
20174
20175
20176static int
20177test_xmlNewDocRawNode(void) {
20178    int test_ret = 0;
20179
20180#ifdef LIBXML_TREE_ENABLED
20181    int mem_base;
20182    xmlNodePtr ret_val;
20183    xmlDocPtr doc; /* the document */
20184    int n_doc;
20185    xmlNsPtr ns; /* namespace if any */
20186    int n_ns;
20187    xmlChar * name; /* the node name */
20188    int n_name;
20189    xmlChar * content; /* the text content if any */
20190    int n_content;
20191
20192    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20193    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20194    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20195    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20196        mem_base = xmlMemBlocks();
20197        doc = gen_xmlDocPtr(n_doc, 0);
20198        ns = gen_xmlNsPtr(n_ns, 1);
20199        name = gen_const_xmlChar_ptr(n_name, 2);
20200        content = gen_const_xmlChar_ptr(n_content, 3);
20201
20202        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20203        desret_xmlNodePtr(ret_val);
20204        call_tests++;
20205        des_xmlDocPtr(n_doc, doc, 0);
20206        des_xmlNsPtr(n_ns, ns, 1);
20207        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20208        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20209        xmlResetLastError();
20210        if (mem_base != xmlMemBlocks()) {
20211            printf("Leak of %d blocks found in xmlNewDocRawNode",
20212	           xmlMemBlocks() - mem_base);
20213	    test_ret++;
20214            printf(" %d", n_doc);
20215            printf(" %d", n_ns);
20216            printf(" %d", n_name);
20217            printf(" %d", n_content);
20218            printf("\n");
20219        }
20220    }
20221    }
20222    }
20223    }
20224    function_tests++;
20225#endif
20226
20227    return(test_ret);
20228}
20229
20230
20231static int
20232test_xmlNewDocText(void) {
20233    int test_ret = 0;
20234
20235    int mem_base;
20236    xmlNodePtr ret_val;
20237    xmlDocPtr doc; /* the document */
20238    int n_doc;
20239    xmlChar * content; /* the text content */
20240    int n_content;
20241
20242    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20243    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20244        mem_base = xmlMemBlocks();
20245        doc = gen_xmlDocPtr(n_doc, 0);
20246        content = gen_const_xmlChar_ptr(n_content, 1);
20247
20248        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
20249        desret_xmlNodePtr(ret_val);
20250        call_tests++;
20251        des_xmlDocPtr(n_doc, doc, 0);
20252        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20253        xmlResetLastError();
20254        if (mem_base != xmlMemBlocks()) {
20255            printf("Leak of %d blocks found in xmlNewDocText",
20256	           xmlMemBlocks() - mem_base);
20257	    test_ret++;
20258            printf(" %d", n_doc);
20259            printf(" %d", n_content);
20260            printf("\n");
20261        }
20262    }
20263    }
20264    function_tests++;
20265
20266    return(test_ret);
20267}
20268
20269
20270static int
20271test_xmlNewDocTextLen(void) {
20272    int test_ret = 0;
20273
20274    int mem_base;
20275    xmlNodePtr ret_val;
20276    xmlDocPtr doc; /* the document */
20277    int n_doc;
20278    xmlChar * content; /* the text content */
20279    int n_content;
20280    int len; /* the text len. */
20281    int n_len;
20282
20283    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20284    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20285    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20286        mem_base = xmlMemBlocks();
20287        doc = gen_xmlDocPtr(n_doc, 0);
20288        content = gen_const_xmlChar_ptr(n_content, 1);
20289        len = gen_int(n_len, 2);
20290
20291        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
20292        desret_xmlNodePtr(ret_val);
20293        call_tests++;
20294        des_xmlDocPtr(n_doc, doc, 0);
20295        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20296        des_int(n_len, len, 2);
20297        xmlResetLastError();
20298        if (mem_base != xmlMemBlocks()) {
20299            printf("Leak of %d blocks found in xmlNewDocTextLen",
20300	           xmlMemBlocks() - mem_base);
20301	    test_ret++;
20302            printf(" %d", n_doc);
20303            printf(" %d", n_content);
20304            printf(" %d", n_len);
20305            printf("\n");
20306        }
20307    }
20308    }
20309    }
20310    function_tests++;
20311
20312    return(test_ret);
20313}
20314
20315
20316static int
20317test_xmlNewDtd(void) {
20318    int test_ret = 0;
20319
20320    int mem_base;
20321    xmlDtdPtr ret_val;
20322    xmlDocPtr doc; /* the document pointer */
20323    int n_doc;
20324    xmlChar * name; /* the DTD name */
20325    int n_name;
20326    xmlChar * ExternalID; /* the external ID */
20327    int n_ExternalID;
20328    xmlChar * SystemID; /* the system ID */
20329    int n_SystemID;
20330
20331    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20332    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20333    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
20334    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
20335        mem_base = xmlMemBlocks();
20336        doc = gen_xmlDocPtr(n_doc, 0);
20337        name = gen_const_xmlChar_ptr(n_name, 1);
20338        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
20339        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
20340
20341        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
20342        desret_xmlDtdPtr(ret_val);
20343        call_tests++;
20344        des_xmlDocPtr(n_doc, doc, 0);
20345        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20346        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
20347        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
20348        xmlResetLastError();
20349        if (mem_base != xmlMemBlocks()) {
20350            printf("Leak of %d blocks found in xmlNewDtd",
20351	           xmlMemBlocks() - mem_base);
20352	    test_ret++;
20353            printf(" %d", n_doc);
20354            printf(" %d", n_name);
20355            printf(" %d", n_ExternalID);
20356            printf(" %d", n_SystemID);
20357            printf("\n");
20358        }
20359    }
20360    }
20361    }
20362    }
20363    function_tests++;
20364
20365    return(test_ret);
20366}
20367
20368
20369static int
20370test_xmlNewNode(void) {
20371    int test_ret = 0;
20372
20373    int mem_base;
20374    xmlNodePtr ret_val;
20375    xmlNsPtr ns; /* namespace if any */
20376    int n_ns;
20377    xmlChar * name; /* the node name */
20378    int n_name;
20379
20380    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20381    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20382        mem_base = xmlMemBlocks();
20383        ns = gen_xmlNsPtr(n_ns, 0);
20384        name = gen_const_xmlChar_ptr(n_name, 1);
20385
20386        ret_val = xmlNewNode(ns, (const xmlChar *)name);
20387        desret_xmlNodePtr(ret_val);
20388        call_tests++;
20389        des_xmlNsPtr(n_ns, ns, 0);
20390        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20391        xmlResetLastError();
20392        if (mem_base != xmlMemBlocks()) {
20393            printf("Leak of %d blocks found in xmlNewNode",
20394	           xmlMemBlocks() - mem_base);
20395	    test_ret++;
20396            printf(" %d", n_ns);
20397            printf(" %d", n_name);
20398            printf("\n");
20399        }
20400    }
20401    }
20402    function_tests++;
20403
20404    return(test_ret);
20405}
20406
20407
20408static int
20409test_xmlNewNodeEatName(void) {
20410    int test_ret = 0;
20411
20412    int mem_base;
20413    xmlNodePtr ret_val;
20414    xmlNsPtr ns; /* namespace if any */
20415    int n_ns;
20416    xmlChar * name; /* the node name */
20417    int n_name;
20418
20419    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20420    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20421        mem_base = xmlMemBlocks();
20422        ns = gen_xmlNsPtr(n_ns, 0);
20423        name = gen_eaten_name(n_name, 1);
20424
20425        ret_val = xmlNewNodeEatName(ns, name);
20426        desret_xmlNodePtr(ret_val);
20427        call_tests++;
20428        des_xmlNsPtr(n_ns, ns, 0);
20429        des_eaten_name(n_name, name, 1);
20430        xmlResetLastError();
20431        if (mem_base != xmlMemBlocks()) {
20432            printf("Leak of %d blocks found in xmlNewNodeEatName",
20433	           xmlMemBlocks() - mem_base);
20434	    test_ret++;
20435            printf(" %d", n_ns);
20436            printf(" %d", n_name);
20437            printf("\n");
20438        }
20439    }
20440    }
20441    function_tests++;
20442
20443    return(test_ret);
20444}
20445
20446
20447static int
20448test_xmlNewNs(void) {
20449    int test_ret = 0;
20450
20451    int mem_base;
20452    xmlNsPtr ret_val;
20453    xmlNodePtr node; /* the element carrying the namespace */
20454    int n_node;
20455    xmlChar * href; /* the URI associated */
20456    int n_href;
20457    xmlChar * prefix; /* the prefix for the namespace */
20458    int n_prefix;
20459
20460    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20461    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
20462    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
20463        mem_base = xmlMemBlocks();
20464        node = gen_xmlNodePtr(n_node, 0);
20465        href = gen_const_xmlChar_ptr(n_href, 1);
20466        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
20467
20468        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
20469        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
20470        desret_xmlNsPtr(ret_val);
20471        call_tests++;
20472        des_xmlNodePtr(n_node, node, 0);
20473        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
20474        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
20475        xmlResetLastError();
20476        if (mem_base != xmlMemBlocks()) {
20477            printf("Leak of %d blocks found in xmlNewNs",
20478	           xmlMemBlocks() - mem_base);
20479	    test_ret++;
20480            printf(" %d", n_node);
20481            printf(" %d", n_href);
20482            printf(" %d", n_prefix);
20483            printf("\n");
20484        }
20485    }
20486    }
20487    }
20488    function_tests++;
20489
20490    return(test_ret);
20491}
20492
20493
20494static int
20495test_xmlNewNsProp(void) {
20496    int test_ret = 0;
20497
20498    int mem_base;
20499    xmlAttrPtr ret_val;
20500    xmlNodePtr node; /* the holding node */
20501    int n_node;
20502    xmlNsPtr ns; /* the namespace */
20503    int n_ns;
20504    xmlChar * name; /* the name of the attribute */
20505    int n_name;
20506    xmlChar * value; /* the value of the attribute */
20507    int n_value;
20508
20509    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20510    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20511    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20512    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20513        mem_base = xmlMemBlocks();
20514        node = gen_xmlNodePtr(n_node, 0);
20515        ns = gen_xmlNsPtr(n_ns, 1);
20516        name = gen_const_xmlChar_ptr(n_name, 2);
20517        value = gen_const_xmlChar_ptr(n_value, 3);
20518
20519        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
20520        desret_xmlAttrPtr(ret_val);
20521        call_tests++;
20522        des_xmlNodePtr(n_node, node, 0);
20523        des_xmlNsPtr(n_ns, ns, 1);
20524        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20525        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
20526        xmlResetLastError();
20527        if (mem_base != xmlMemBlocks()) {
20528            printf("Leak of %d blocks found in xmlNewNsProp",
20529	           xmlMemBlocks() - mem_base);
20530	    test_ret++;
20531            printf(" %d", n_node);
20532            printf(" %d", n_ns);
20533            printf(" %d", n_name);
20534            printf(" %d", n_value);
20535            printf("\n");
20536        }
20537    }
20538    }
20539    }
20540    }
20541    function_tests++;
20542
20543    return(test_ret);
20544}
20545
20546
20547static int
20548test_xmlNewNsPropEatName(void) {
20549    int test_ret = 0;
20550
20551    int mem_base;
20552    xmlAttrPtr ret_val;
20553    xmlNodePtr node; /* the holding node */
20554    int n_node;
20555    xmlNsPtr ns; /* the namespace */
20556    int n_ns;
20557    xmlChar * name; /* the name of the attribute */
20558    int n_name;
20559    xmlChar * value; /* the value of the attribute */
20560    int n_value;
20561
20562    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20563    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20564    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20565    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20566        mem_base = xmlMemBlocks();
20567        node = gen_xmlNodePtr(n_node, 0);
20568        ns = gen_xmlNsPtr(n_ns, 1);
20569        name = gen_eaten_name(n_name, 2);
20570        value = gen_const_xmlChar_ptr(n_value, 3);
20571
20572        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
20573        desret_xmlAttrPtr(ret_val);
20574        call_tests++;
20575        des_xmlNodePtr(n_node, node, 0);
20576        des_xmlNsPtr(n_ns, ns, 1);
20577        des_eaten_name(n_name, name, 2);
20578        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
20579        xmlResetLastError();
20580        if (mem_base != xmlMemBlocks()) {
20581            printf("Leak of %d blocks found in xmlNewNsPropEatName",
20582	           xmlMemBlocks() - mem_base);
20583	    test_ret++;
20584            printf(" %d", n_node);
20585            printf(" %d", n_ns);
20586            printf(" %d", n_name);
20587            printf(" %d", n_value);
20588            printf("\n");
20589        }
20590    }
20591    }
20592    }
20593    }
20594    function_tests++;
20595
20596    return(test_ret);
20597}
20598
20599
20600static int
20601test_xmlNewPI(void) {
20602    int test_ret = 0;
20603
20604    int mem_base;
20605    xmlNodePtr ret_val;
20606    xmlChar * name; /* the processing instruction name */
20607    int n_name;
20608    xmlChar * content; /* the PI content */
20609    int n_content;
20610
20611    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20612    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20613        mem_base = xmlMemBlocks();
20614        name = gen_const_xmlChar_ptr(n_name, 0);
20615        content = gen_const_xmlChar_ptr(n_content, 1);
20616
20617        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
20618        desret_xmlNodePtr(ret_val);
20619        call_tests++;
20620        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
20621        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20622        xmlResetLastError();
20623        if (mem_base != xmlMemBlocks()) {
20624            printf("Leak of %d blocks found in xmlNewPI",
20625	           xmlMemBlocks() - mem_base);
20626	    test_ret++;
20627            printf(" %d", n_name);
20628            printf(" %d", n_content);
20629            printf("\n");
20630        }
20631    }
20632    }
20633    function_tests++;
20634
20635    return(test_ret);
20636}
20637
20638
20639static int
20640test_xmlNewProp(void) {
20641    int test_ret = 0;
20642
20643#ifdef LIBXML_TREE_ENABLED
20644    int mem_base;
20645    xmlAttrPtr ret_val;
20646    xmlNodePtr node; /* the holding node */
20647    int n_node;
20648    xmlChar * name; /* the name of the attribute */
20649    int n_name;
20650    xmlChar * value; /* the value of the attribute */
20651    int n_value;
20652
20653    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20654    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20655    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
20656        mem_base = xmlMemBlocks();
20657        node = gen_xmlNodePtr(n_node, 0);
20658        name = gen_const_xmlChar_ptr(n_name, 1);
20659        value = gen_const_xmlChar_ptr(n_value, 2);
20660
20661        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
20662        desret_xmlAttrPtr(ret_val);
20663        call_tests++;
20664        des_xmlNodePtr(n_node, node, 0);
20665        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20666        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
20667        xmlResetLastError();
20668        if (mem_base != xmlMemBlocks()) {
20669            printf("Leak of %d blocks found in xmlNewProp",
20670	           xmlMemBlocks() - mem_base);
20671	    test_ret++;
20672            printf(" %d", n_node);
20673            printf(" %d", n_name);
20674            printf(" %d", n_value);
20675            printf("\n");
20676        }
20677    }
20678    }
20679    }
20680    function_tests++;
20681#endif
20682
20683    return(test_ret);
20684}
20685
20686
20687static int
20688test_xmlNewReference(void) {
20689    int test_ret = 0;
20690
20691    int mem_base;
20692    xmlNodePtr ret_val;
20693    xmlDocPtr doc; /* the document */
20694    int n_doc;
20695    xmlChar * name; /* the reference name, or the reference string with & and ; */
20696    int n_name;
20697
20698    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20699    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20700        mem_base = xmlMemBlocks();
20701        doc = gen_xmlDocPtr(n_doc, 0);
20702        name = gen_const_xmlChar_ptr(n_name, 1);
20703
20704        ret_val = xmlNewReference(doc, (const xmlChar *)name);
20705        desret_xmlNodePtr(ret_val);
20706        call_tests++;
20707        des_xmlDocPtr(n_doc, doc, 0);
20708        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20709        xmlResetLastError();
20710        if (mem_base != xmlMemBlocks()) {
20711            printf("Leak of %d blocks found in xmlNewReference",
20712	           xmlMemBlocks() - mem_base);
20713	    test_ret++;
20714            printf(" %d", n_doc);
20715            printf(" %d", n_name);
20716            printf("\n");
20717        }
20718    }
20719    }
20720    function_tests++;
20721
20722    return(test_ret);
20723}
20724
20725
20726static int
20727test_xmlNewText(void) {
20728    int test_ret = 0;
20729
20730    int mem_base;
20731    xmlNodePtr ret_val;
20732    xmlChar * content; /* the text content */
20733    int n_content;
20734
20735    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20736        mem_base = xmlMemBlocks();
20737        content = gen_const_xmlChar_ptr(n_content, 0);
20738
20739        ret_val = xmlNewText((const xmlChar *)content);
20740        desret_xmlNodePtr(ret_val);
20741        call_tests++;
20742        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20743        xmlResetLastError();
20744        if (mem_base != xmlMemBlocks()) {
20745            printf("Leak of %d blocks found in xmlNewText",
20746	           xmlMemBlocks() - mem_base);
20747	    test_ret++;
20748            printf(" %d", n_content);
20749            printf("\n");
20750        }
20751    }
20752    function_tests++;
20753
20754    return(test_ret);
20755}
20756
20757
20758static int
20759test_xmlNewTextChild(void) {
20760    int test_ret = 0;
20761
20762#ifdef LIBXML_TREE_ENABLED
20763    int mem_base;
20764    xmlNodePtr ret_val;
20765    xmlNodePtr parent; /* the parent node */
20766    int n_parent;
20767    xmlNsPtr ns; /* a namespace if any */
20768    int n_ns;
20769    xmlChar * name; /* the name of the child */
20770    int n_name;
20771    xmlChar * content; /* the text content of the child if any. */
20772    int n_content;
20773
20774    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20775    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20776    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20777    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20778        mem_base = xmlMemBlocks();
20779        parent = gen_xmlNodePtr(n_parent, 0);
20780        ns = gen_xmlNsPtr(n_ns, 1);
20781        name = gen_const_xmlChar_ptr(n_name, 2);
20782        content = gen_const_xmlChar_ptr(n_content, 3);
20783
20784        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20785        desret_xmlNodePtr(ret_val);
20786        call_tests++;
20787        des_xmlNodePtr(n_parent, parent, 0);
20788        des_xmlNsPtr(n_ns, ns, 1);
20789        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20790        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20791        xmlResetLastError();
20792        if (mem_base != xmlMemBlocks()) {
20793            printf("Leak of %d blocks found in xmlNewTextChild",
20794	           xmlMemBlocks() - mem_base);
20795	    test_ret++;
20796            printf(" %d", n_parent);
20797            printf(" %d", n_ns);
20798            printf(" %d", n_name);
20799            printf(" %d", n_content);
20800            printf("\n");
20801        }
20802    }
20803    }
20804    }
20805    }
20806    function_tests++;
20807#endif
20808
20809    return(test_ret);
20810}
20811
20812
20813static int
20814test_xmlNewTextLen(void) {
20815    int test_ret = 0;
20816
20817    int mem_base;
20818    xmlNodePtr ret_val;
20819    xmlChar * content; /* the text content */
20820    int n_content;
20821    int len; /* the text len. */
20822    int n_len;
20823
20824    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20825    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20826        mem_base = xmlMemBlocks();
20827        content = gen_const_xmlChar_ptr(n_content, 0);
20828        len = gen_int(n_len, 1);
20829
20830        ret_val = xmlNewTextLen((const xmlChar *)content, len);
20831        desret_xmlNodePtr(ret_val);
20832        call_tests++;
20833        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20834        des_int(n_len, len, 1);
20835        xmlResetLastError();
20836        if (mem_base != xmlMemBlocks()) {
20837            printf("Leak of %d blocks found in xmlNewTextLen",
20838	           xmlMemBlocks() - mem_base);
20839	    test_ret++;
20840            printf(" %d", n_content);
20841            printf(" %d", n_len);
20842            printf("\n");
20843        }
20844    }
20845    }
20846    function_tests++;
20847
20848    return(test_ret);
20849}
20850
20851
20852static int
20853test_xmlNodeAddContent(void) {
20854    int test_ret = 0;
20855
20856    int mem_base;
20857    xmlNodePtr cur; /* the node being modified */
20858    int n_cur;
20859    xmlChar * content; /* extra content */
20860    int n_content;
20861
20862    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20863    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20864        mem_base = xmlMemBlocks();
20865        cur = gen_xmlNodePtr(n_cur, 0);
20866        content = gen_const_xmlChar_ptr(n_content, 1);
20867
20868        xmlNodeAddContent(cur, (const xmlChar *)content);
20869        call_tests++;
20870        des_xmlNodePtr(n_cur, cur, 0);
20871        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20872        xmlResetLastError();
20873        if (mem_base != xmlMemBlocks()) {
20874            printf("Leak of %d blocks found in xmlNodeAddContent",
20875	           xmlMemBlocks() - mem_base);
20876	    test_ret++;
20877            printf(" %d", n_cur);
20878            printf(" %d", n_content);
20879            printf("\n");
20880        }
20881    }
20882    }
20883    function_tests++;
20884
20885    return(test_ret);
20886}
20887
20888
20889static int
20890test_xmlNodeAddContentLen(void) {
20891    int test_ret = 0;
20892
20893    int mem_base;
20894    xmlNodePtr cur; /* the node being modified */
20895    int n_cur;
20896    xmlChar * content; /* extra content */
20897    int n_content;
20898    int len; /* the size of @content */
20899    int n_len;
20900
20901    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20902    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20903    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20904        mem_base = xmlMemBlocks();
20905        cur = gen_xmlNodePtr(n_cur, 0);
20906        content = gen_const_xmlChar_ptr(n_content, 1);
20907        len = gen_int(n_len, 2);
20908
20909        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
20910        call_tests++;
20911        des_xmlNodePtr(n_cur, cur, 0);
20912        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20913        des_int(n_len, len, 2);
20914        xmlResetLastError();
20915        if (mem_base != xmlMemBlocks()) {
20916            printf("Leak of %d blocks found in xmlNodeAddContentLen",
20917	           xmlMemBlocks() - mem_base);
20918	    test_ret++;
20919            printf(" %d", n_cur);
20920            printf(" %d", n_content);
20921            printf(" %d", n_len);
20922            printf("\n");
20923        }
20924    }
20925    }
20926    }
20927    function_tests++;
20928
20929    return(test_ret);
20930}
20931
20932
20933static int
20934test_xmlNodeBufGetContent(void) {
20935    int test_ret = 0;
20936
20937    int mem_base;
20938    int ret_val;
20939    xmlBufferPtr buffer; /* a buffer */
20940    int n_buffer;
20941    xmlNodePtr cur; /* the node being read */
20942    int n_cur;
20943
20944    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
20945    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20946        mem_base = xmlMemBlocks();
20947        buffer = gen_xmlBufferPtr(n_buffer, 0);
20948        cur = gen_xmlNodePtr(n_cur, 1);
20949
20950        ret_val = xmlNodeBufGetContent(buffer, cur);
20951        desret_int(ret_val);
20952        call_tests++;
20953        des_xmlBufferPtr(n_buffer, buffer, 0);
20954        des_xmlNodePtr(n_cur, cur, 1);
20955        xmlResetLastError();
20956        if (mem_base != xmlMemBlocks()) {
20957            printf("Leak of %d blocks found in xmlNodeBufGetContent",
20958	           xmlMemBlocks() - mem_base);
20959	    test_ret++;
20960            printf(" %d", n_buffer);
20961            printf(" %d", n_cur);
20962            printf("\n");
20963        }
20964    }
20965    }
20966    function_tests++;
20967
20968    return(test_ret);
20969}
20970
20971
20972static int
20973test_xmlNodeDump(void) {
20974    int test_ret = 0;
20975
20976#ifdef LIBXML_OUTPUT_ENABLED
20977    int mem_base;
20978    int ret_val;
20979    xmlBufferPtr buf; /* the XML buffer output */
20980    int n_buf;
20981    xmlDocPtr doc; /* the document */
20982    int n_doc;
20983    xmlNodePtr cur; /* the current node */
20984    int n_cur;
20985    int level; /* the imbrication level for indenting */
20986    int n_level;
20987    int format; /* is formatting allowed */
20988    int n_format;
20989
20990    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
20991    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20992    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20993    for (n_level = 0;n_level < gen_nb_int;n_level++) {
20994    for (n_format = 0;n_format < gen_nb_int;n_format++) {
20995        mem_base = xmlMemBlocks();
20996        buf = gen_xmlBufferPtr(n_buf, 0);
20997        doc = gen_xmlDocPtr(n_doc, 1);
20998        cur = gen_xmlNodePtr(n_cur, 2);
20999        level = gen_int(n_level, 3);
21000        format = gen_int(n_format, 4);
21001
21002        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21003        desret_int(ret_val);
21004        call_tests++;
21005        des_xmlBufferPtr(n_buf, buf, 0);
21006        des_xmlDocPtr(n_doc, doc, 1);
21007        des_xmlNodePtr(n_cur, cur, 2);
21008        des_int(n_level, level, 3);
21009        des_int(n_format, format, 4);
21010        xmlResetLastError();
21011        if (mem_base != xmlMemBlocks()) {
21012            printf("Leak of %d blocks found in xmlNodeDump",
21013	           xmlMemBlocks() - mem_base);
21014	    test_ret++;
21015            printf(" %d", n_buf);
21016            printf(" %d", n_doc);
21017            printf(" %d", n_cur);
21018            printf(" %d", n_level);
21019            printf(" %d", n_format);
21020            printf("\n");
21021        }
21022    }
21023    }
21024    }
21025    }
21026    }
21027    function_tests++;
21028#endif
21029
21030    return(test_ret);
21031}
21032
21033
21034static int
21035test_xmlNodeDumpOutput(void) {
21036    int test_ret = 0;
21037
21038#ifdef LIBXML_OUTPUT_ENABLED
21039    int mem_base;
21040    xmlOutputBufferPtr buf; /* the XML buffer output */
21041    int n_buf;
21042    xmlDocPtr doc; /* the document */
21043    int n_doc;
21044    xmlNodePtr cur; /* the current node */
21045    int n_cur;
21046    int level; /* the imbrication level for indenting */
21047    int n_level;
21048    int format; /* is formatting allowed */
21049    int n_format;
21050    char * encoding; /* an optional encoding string */
21051    int n_encoding;
21052
21053    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21054    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21055    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21056    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21057    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21058    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21059        mem_base = xmlMemBlocks();
21060        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21061        doc = gen_xmlDocPtr(n_doc, 1);
21062        cur = gen_xmlNodePtr(n_cur, 2);
21063        level = gen_int(n_level, 3);
21064        format = gen_int(n_format, 4);
21065        encoding = gen_const_char_ptr(n_encoding, 5);
21066
21067        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
21068        call_tests++;
21069        des_xmlOutputBufferPtr(n_buf, buf, 0);
21070        des_xmlDocPtr(n_doc, doc, 1);
21071        des_xmlNodePtr(n_cur, cur, 2);
21072        des_int(n_level, level, 3);
21073        des_int(n_format, format, 4);
21074        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
21075        xmlResetLastError();
21076        if (mem_base != xmlMemBlocks()) {
21077            printf("Leak of %d blocks found in xmlNodeDumpOutput",
21078	           xmlMemBlocks() - mem_base);
21079	    test_ret++;
21080            printf(" %d", n_buf);
21081            printf(" %d", n_doc);
21082            printf(" %d", n_cur);
21083            printf(" %d", n_level);
21084            printf(" %d", n_format);
21085            printf(" %d", n_encoding);
21086            printf("\n");
21087        }
21088    }
21089    }
21090    }
21091    }
21092    }
21093    }
21094    function_tests++;
21095#endif
21096
21097    return(test_ret);
21098}
21099
21100
21101static int
21102test_xmlNodeGetBase(void) {
21103    int test_ret = 0;
21104
21105    int mem_base;
21106    xmlChar * ret_val;
21107    xmlDocPtr doc; /* the document the node pertains to */
21108    int n_doc;
21109    xmlNodePtr cur; /* the node being checked */
21110    int n_cur;
21111
21112    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21113    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21114        mem_base = xmlMemBlocks();
21115        doc = gen_xmlDocPtr(n_doc, 0);
21116        cur = gen_xmlNodePtr(n_cur, 1);
21117
21118        ret_val = xmlNodeGetBase(doc, cur);
21119        desret_xmlChar_ptr(ret_val);
21120        call_tests++;
21121        des_xmlDocPtr(n_doc, doc, 0);
21122        des_xmlNodePtr(n_cur, cur, 1);
21123        xmlResetLastError();
21124        if (mem_base != xmlMemBlocks()) {
21125            printf("Leak of %d blocks found in xmlNodeGetBase",
21126	           xmlMemBlocks() - mem_base);
21127	    test_ret++;
21128            printf(" %d", n_doc);
21129            printf(" %d", n_cur);
21130            printf("\n");
21131        }
21132    }
21133    }
21134    function_tests++;
21135
21136    return(test_ret);
21137}
21138
21139
21140static int
21141test_xmlNodeGetContent(void) {
21142    int test_ret = 0;
21143
21144    int mem_base;
21145    xmlChar * ret_val;
21146    xmlNodePtr cur; /* the node being read */
21147    int n_cur;
21148
21149    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21150        mem_base = xmlMemBlocks();
21151        cur = gen_xmlNodePtr(n_cur, 0);
21152
21153        ret_val = xmlNodeGetContent(cur);
21154        desret_xmlChar_ptr(ret_val);
21155        call_tests++;
21156        des_xmlNodePtr(n_cur, cur, 0);
21157        xmlResetLastError();
21158        if (mem_base != xmlMemBlocks()) {
21159            printf("Leak of %d blocks found in xmlNodeGetContent",
21160	           xmlMemBlocks() - mem_base);
21161	    test_ret++;
21162            printf(" %d", n_cur);
21163            printf("\n");
21164        }
21165    }
21166    function_tests++;
21167
21168    return(test_ret);
21169}
21170
21171
21172static int
21173test_xmlNodeGetLang(void) {
21174    int test_ret = 0;
21175
21176    int mem_base;
21177    xmlChar * ret_val;
21178    xmlNodePtr cur; /* the node being checked */
21179    int n_cur;
21180
21181    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21182        mem_base = xmlMemBlocks();
21183        cur = gen_xmlNodePtr(n_cur, 0);
21184
21185        ret_val = xmlNodeGetLang(cur);
21186        desret_xmlChar_ptr(ret_val);
21187        call_tests++;
21188        des_xmlNodePtr(n_cur, cur, 0);
21189        xmlResetLastError();
21190        if (mem_base != xmlMemBlocks()) {
21191            printf("Leak of %d blocks found in xmlNodeGetLang",
21192	           xmlMemBlocks() - mem_base);
21193	    test_ret++;
21194            printf(" %d", n_cur);
21195            printf("\n");
21196        }
21197    }
21198    function_tests++;
21199
21200    return(test_ret);
21201}
21202
21203
21204static int
21205test_xmlNodeGetSpacePreserve(void) {
21206    int test_ret = 0;
21207
21208    int mem_base;
21209    int ret_val;
21210    xmlNodePtr cur; /* the node being checked */
21211    int n_cur;
21212
21213    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21214        mem_base = xmlMemBlocks();
21215        cur = gen_xmlNodePtr(n_cur, 0);
21216
21217        ret_val = xmlNodeGetSpacePreserve(cur);
21218        desret_int(ret_val);
21219        call_tests++;
21220        des_xmlNodePtr(n_cur, cur, 0);
21221        xmlResetLastError();
21222        if (mem_base != xmlMemBlocks()) {
21223            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
21224	           xmlMemBlocks() - mem_base);
21225	    test_ret++;
21226            printf(" %d", n_cur);
21227            printf("\n");
21228        }
21229    }
21230    function_tests++;
21231
21232    return(test_ret);
21233}
21234
21235
21236static int
21237test_xmlNodeIsText(void) {
21238    int test_ret = 0;
21239
21240    int mem_base;
21241    int ret_val;
21242    xmlNodePtr node; /* the node */
21243    int n_node;
21244
21245    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21246        mem_base = xmlMemBlocks();
21247        node = gen_xmlNodePtr(n_node, 0);
21248
21249        ret_val = xmlNodeIsText(node);
21250        desret_int(ret_val);
21251        call_tests++;
21252        des_xmlNodePtr(n_node, node, 0);
21253        xmlResetLastError();
21254        if (mem_base != xmlMemBlocks()) {
21255            printf("Leak of %d blocks found in xmlNodeIsText",
21256	           xmlMemBlocks() - mem_base);
21257	    test_ret++;
21258            printf(" %d", n_node);
21259            printf("\n");
21260        }
21261    }
21262    function_tests++;
21263
21264    return(test_ret);
21265}
21266
21267
21268static int
21269test_xmlNodeListGetRawString(void) {
21270    int test_ret = 0;
21271
21272#ifdef LIBXML_TREE_ENABLED
21273    int mem_base;
21274    xmlChar * ret_val;
21275    xmlDocPtr doc; /* the document */
21276    int n_doc;
21277    xmlNodePtr list; /* a Node list */
21278    int n_list;
21279    int inLine; /* should we replace entity contents or show their external form */
21280    int n_inLine;
21281
21282    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21283    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21284    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21285        mem_base = xmlMemBlocks();
21286        doc = gen_xmlDocPtr(n_doc, 0);
21287        list = gen_xmlNodePtr(n_list, 1);
21288        inLine = gen_int(n_inLine, 2);
21289
21290        ret_val = xmlNodeListGetRawString(doc, list, inLine);
21291        desret_xmlChar_ptr(ret_val);
21292        call_tests++;
21293        des_xmlDocPtr(n_doc, doc, 0);
21294        des_xmlNodePtr(n_list, list, 1);
21295        des_int(n_inLine, inLine, 2);
21296        xmlResetLastError();
21297        if (mem_base != xmlMemBlocks()) {
21298            printf("Leak of %d blocks found in xmlNodeListGetRawString",
21299	           xmlMemBlocks() - mem_base);
21300	    test_ret++;
21301            printf(" %d", n_doc);
21302            printf(" %d", n_list);
21303            printf(" %d", n_inLine);
21304            printf("\n");
21305        }
21306    }
21307    }
21308    }
21309    function_tests++;
21310#endif
21311
21312    return(test_ret);
21313}
21314
21315
21316static int
21317test_xmlNodeListGetString(void) {
21318    int test_ret = 0;
21319
21320    int mem_base;
21321    xmlChar * ret_val;
21322    xmlDocPtr doc; /* the document */
21323    int n_doc;
21324    xmlNodePtr list; /* a Node list */
21325    int n_list;
21326    int inLine; /* should we replace entity contents or show their external form */
21327    int n_inLine;
21328
21329    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21330    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
21331    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
21332        mem_base = xmlMemBlocks();
21333        doc = gen_xmlDocPtr(n_doc, 0);
21334        list = gen_xmlNodePtr(n_list, 1);
21335        inLine = gen_int(n_inLine, 2);
21336
21337        ret_val = xmlNodeListGetString(doc, list, inLine);
21338        desret_xmlChar_ptr(ret_val);
21339        call_tests++;
21340        des_xmlDocPtr(n_doc, doc, 0);
21341        des_xmlNodePtr(n_list, list, 1);
21342        des_int(n_inLine, inLine, 2);
21343        xmlResetLastError();
21344        if (mem_base != xmlMemBlocks()) {
21345            printf("Leak of %d blocks found in xmlNodeListGetString",
21346	           xmlMemBlocks() - mem_base);
21347	    test_ret++;
21348            printf(" %d", n_doc);
21349            printf(" %d", n_list);
21350            printf(" %d", n_inLine);
21351            printf("\n");
21352        }
21353    }
21354    }
21355    }
21356    function_tests++;
21357
21358    return(test_ret);
21359}
21360
21361
21362static int
21363test_xmlNodeSetBase(void) {
21364    int test_ret = 0;
21365
21366#ifdef LIBXML_TREE_ENABLED
21367    int mem_base;
21368    xmlNodePtr cur; /* the node being changed */
21369    int n_cur;
21370    xmlChar * uri; /* the new base URI */
21371    int n_uri;
21372
21373    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21374    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
21375        mem_base = xmlMemBlocks();
21376        cur = gen_xmlNodePtr(n_cur, 0);
21377        uri = gen_const_xmlChar_ptr(n_uri, 1);
21378
21379        xmlNodeSetBase(cur, (const xmlChar *)uri);
21380        call_tests++;
21381        des_xmlNodePtr(n_cur, cur, 0);
21382        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
21383        xmlResetLastError();
21384        if (mem_base != xmlMemBlocks()) {
21385            printf("Leak of %d blocks found in xmlNodeSetBase",
21386	           xmlMemBlocks() - mem_base);
21387	    test_ret++;
21388            printf(" %d", n_cur);
21389            printf(" %d", n_uri);
21390            printf("\n");
21391        }
21392    }
21393    }
21394    function_tests++;
21395#endif
21396
21397    return(test_ret);
21398}
21399
21400
21401static int
21402test_xmlNodeSetContent(void) {
21403    int test_ret = 0;
21404
21405    int mem_base;
21406    xmlNodePtr cur; /* the node being modified */
21407    int n_cur;
21408    xmlChar * content; /* the new value of the content */
21409    int n_content;
21410
21411    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21412    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21413        mem_base = xmlMemBlocks();
21414        cur = gen_xmlNodePtr(n_cur, 0);
21415        content = gen_const_xmlChar_ptr(n_content, 1);
21416
21417        xmlNodeSetContent(cur, (const xmlChar *)content);
21418        call_tests++;
21419        des_xmlNodePtr(n_cur, cur, 0);
21420        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21421        xmlResetLastError();
21422        if (mem_base != xmlMemBlocks()) {
21423            printf("Leak of %d blocks found in xmlNodeSetContent",
21424	           xmlMemBlocks() - mem_base);
21425	    test_ret++;
21426            printf(" %d", n_cur);
21427            printf(" %d", n_content);
21428            printf("\n");
21429        }
21430    }
21431    }
21432    function_tests++;
21433
21434    return(test_ret);
21435}
21436
21437
21438static int
21439test_xmlNodeSetContentLen(void) {
21440    int test_ret = 0;
21441
21442#ifdef LIBXML_TREE_ENABLED
21443    int mem_base;
21444    xmlNodePtr cur; /* the node being modified */
21445    int n_cur;
21446    xmlChar * content; /* the new value of the content */
21447    int n_content;
21448    int len; /* the size of @content */
21449    int n_len;
21450
21451    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21452    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21453    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21454        mem_base = xmlMemBlocks();
21455        cur = gen_xmlNodePtr(n_cur, 0);
21456        content = gen_const_xmlChar_ptr(n_content, 1);
21457        len = gen_int(n_len, 2);
21458
21459        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
21460        call_tests++;
21461        des_xmlNodePtr(n_cur, cur, 0);
21462        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21463        des_int(n_len, len, 2);
21464        xmlResetLastError();
21465        if (mem_base != xmlMemBlocks()) {
21466            printf("Leak of %d blocks found in xmlNodeSetContentLen",
21467	           xmlMemBlocks() - mem_base);
21468	    test_ret++;
21469            printf(" %d", n_cur);
21470            printf(" %d", n_content);
21471            printf(" %d", n_len);
21472            printf("\n");
21473        }
21474    }
21475    }
21476    }
21477    function_tests++;
21478#endif
21479
21480    return(test_ret);
21481}
21482
21483
21484static int
21485test_xmlNodeSetLang(void) {
21486    int test_ret = 0;
21487
21488#ifdef LIBXML_TREE_ENABLED
21489    int mem_base;
21490    xmlNodePtr cur; /* the node being changed */
21491    int n_cur;
21492    xmlChar * lang; /* the language description */
21493    int n_lang;
21494
21495    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21496    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
21497        mem_base = xmlMemBlocks();
21498        cur = gen_xmlNodePtr(n_cur, 0);
21499        lang = gen_const_xmlChar_ptr(n_lang, 1);
21500
21501        xmlNodeSetLang(cur, (const xmlChar *)lang);
21502        call_tests++;
21503        des_xmlNodePtr(n_cur, cur, 0);
21504        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
21505        xmlResetLastError();
21506        if (mem_base != xmlMemBlocks()) {
21507            printf("Leak of %d blocks found in xmlNodeSetLang",
21508	           xmlMemBlocks() - mem_base);
21509	    test_ret++;
21510            printf(" %d", n_cur);
21511            printf(" %d", n_lang);
21512            printf("\n");
21513        }
21514    }
21515    }
21516    function_tests++;
21517#endif
21518
21519    return(test_ret);
21520}
21521
21522
21523static int
21524test_xmlNodeSetName(void) {
21525    int test_ret = 0;
21526
21527#ifdef LIBXML_TREE_ENABLED
21528    int mem_base;
21529    xmlNodePtr cur; /* the node being changed */
21530    int n_cur;
21531    xmlChar * name; /* the new tag name */
21532    int n_name;
21533
21534    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21535    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21536        mem_base = xmlMemBlocks();
21537        cur = gen_xmlNodePtr(n_cur, 0);
21538        name = gen_const_xmlChar_ptr(n_name, 1);
21539
21540        xmlNodeSetName(cur, (const xmlChar *)name);
21541        call_tests++;
21542        des_xmlNodePtr(n_cur, cur, 0);
21543        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21544        xmlResetLastError();
21545        if (mem_base != xmlMemBlocks()) {
21546            printf("Leak of %d blocks found in xmlNodeSetName",
21547	           xmlMemBlocks() - mem_base);
21548	    test_ret++;
21549            printf(" %d", n_cur);
21550            printf(" %d", n_name);
21551            printf("\n");
21552        }
21553    }
21554    }
21555    function_tests++;
21556#endif
21557
21558    return(test_ret);
21559}
21560
21561
21562static int
21563test_xmlNodeSetSpacePreserve(void) {
21564    int test_ret = 0;
21565
21566#ifdef LIBXML_TREE_ENABLED
21567    int mem_base;
21568    xmlNodePtr cur; /* the node being changed */
21569    int n_cur;
21570    int val; /* the xml:space value ("0": default, 1: "preserve") */
21571    int n_val;
21572
21573    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21574    for (n_val = 0;n_val < gen_nb_int;n_val++) {
21575        mem_base = xmlMemBlocks();
21576        cur = gen_xmlNodePtr(n_cur, 0);
21577        val = gen_int(n_val, 1);
21578
21579        xmlNodeSetSpacePreserve(cur, val);
21580        call_tests++;
21581        des_xmlNodePtr(n_cur, cur, 0);
21582        des_int(n_val, val, 1);
21583        xmlResetLastError();
21584        if (mem_base != xmlMemBlocks()) {
21585            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
21586	           xmlMemBlocks() - mem_base);
21587	    test_ret++;
21588            printf(" %d", n_cur);
21589            printf(" %d", n_val);
21590            printf("\n");
21591        }
21592    }
21593    }
21594    function_tests++;
21595#endif
21596
21597    return(test_ret);
21598}
21599
21600
21601static int
21602test_xmlReconciliateNs(void) {
21603    int test_ret = 0;
21604
21605#ifdef LIBXML_TREE_ENABLED
21606    int mem_base;
21607    int ret_val;
21608    xmlDocPtr doc; /* the document */
21609    int n_doc;
21610    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
21611    int n_tree;
21612
21613    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21614    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
21615        mem_base = xmlMemBlocks();
21616        doc = gen_xmlDocPtr(n_doc, 0);
21617        tree = gen_xmlNodePtr(n_tree, 1);
21618
21619        ret_val = xmlReconciliateNs(doc, tree);
21620        desret_int(ret_val);
21621        call_tests++;
21622        des_xmlDocPtr(n_doc, doc, 0);
21623        des_xmlNodePtr(n_tree, tree, 1);
21624        xmlResetLastError();
21625        if (mem_base != xmlMemBlocks()) {
21626            printf("Leak of %d blocks found in xmlReconciliateNs",
21627	           xmlMemBlocks() - mem_base);
21628	    test_ret++;
21629            printf(" %d", n_doc);
21630            printf(" %d", n_tree);
21631            printf("\n");
21632        }
21633    }
21634    }
21635    function_tests++;
21636#endif
21637
21638    return(test_ret);
21639}
21640
21641
21642static int
21643test_xmlRemoveProp(void) {
21644    int test_ret = 0;
21645
21646#ifdef LIBXML_TREE_ENABLED
21647    int mem_base;
21648    int ret_val;
21649    xmlAttrPtr cur; /* an attribute */
21650    int n_cur;
21651
21652    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
21653        mem_base = xmlMemBlocks();
21654        cur = gen_xmlAttrPtr(n_cur, 0);
21655
21656        ret_val = xmlRemoveProp(cur);
21657        cur = NULL;
21658        desret_int(ret_val);
21659        call_tests++;
21660        des_xmlAttrPtr(n_cur, cur, 0);
21661        xmlResetLastError();
21662        if (mem_base != xmlMemBlocks()) {
21663            printf("Leak of %d blocks found in xmlRemoveProp",
21664	           xmlMemBlocks() - mem_base);
21665	    test_ret++;
21666            printf(" %d", n_cur);
21667            printf("\n");
21668        }
21669    }
21670    function_tests++;
21671#endif
21672
21673    return(test_ret);
21674}
21675
21676
21677static int
21678test_xmlReplaceNode(void) {
21679    int test_ret = 0;
21680
21681#ifdef LIBXML_TREE_ENABLED
21682    int mem_base;
21683    xmlNodePtr ret_val;
21684    xmlNodePtr old; /* the old node */
21685    int n_old;
21686    xmlNodePtr cur; /* the node */
21687    int n_cur;
21688
21689    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
21690    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
21691        mem_base = xmlMemBlocks();
21692        old = gen_xmlNodePtr(n_old, 0);
21693        cur = gen_xmlNodePtr_in(n_cur, 1);
21694
21695        ret_val = xmlReplaceNode(old, cur);
21696        if (cur != NULL) {
21697              xmlUnlinkNode(cur);
21698              xmlFreeNode(cur) ; cur = NULL ; }
21699          if (old != NULL) {
21700              xmlUnlinkNode(old);
21701              xmlFreeNode(old) ; old = NULL ; }
21702	  ret_val = NULL;
21703        desret_xmlNodePtr(ret_val);
21704        call_tests++;
21705        des_xmlNodePtr(n_old, old, 0);
21706        des_xmlNodePtr_in(n_cur, cur, 1);
21707        xmlResetLastError();
21708        if (mem_base != xmlMemBlocks()) {
21709            printf("Leak of %d blocks found in xmlReplaceNode",
21710	           xmlMemBlocks() - mem_base);
21711	    test_ret++;
21712            printf(" %d", n_old);
21713            printf(" %d", n_cur);
21714            printf("\n");
21715        }
21716    }
21717    }
21718    function_tests++;
21719#endif
21720
21721    return(test_ret);
21722}
21723
21724
21725static int
21726test_xmlSaveFile(void) {
21727    int test_ret = 0;
21728
21729#ifdef LIBXML_OUTPUT_ENABLED
21730    int mem_base;
21731    int ret_val;
21732    const char * filename; /* the filename (or URL) */
21733    int n_filename;
21734    xmlDocPtr cur; /* the document */
21735    int n_cur;
21736
21737    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21738    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21739        mem_base = xmlMemBlocks();
21740        filename = gen_fileoutput(n_filename, 0);
21741        cur = gen_xmlDocPtr(n_cur, 1);
21742
21743        ret_val = xmlSaveFile(filename, cur);
21744        desret_int(ret_val);
21745        call_tests++;
21746        des_fileoutput(n_filename, filename, 0);
21747        des_xmlDocPtr(n_cur, cur, 1);
21748        xmlResetLastError();
21749        if (mem_base != xmlMemBlocks()) {
21750            printf("Leak of %d blocks found in xmlSaveFile",
21751	           xmlMemBlocks() - mem_base);
21752	    test_ret++;
21753            printf(" %d", n_filename);
21754            printf(" %d", n_cur);
21755            printf("\n");
21756        }
21757    }
21758    }
21759    function_tests++;
21760#endif
21761
21762    return(test_ret);
21763}
21764
21765
21766static int
21767test_xmlSaveFileEnc(void) {
21768    int test_ret = 0;
21769
21770#ifdef LIBXML_OUTPUT_ENABLED
21771    int mem_base;
21772    int ret_val;
21773    const char * filename; /* the filename (or URL) */
21774    int n_filename;
21775    xmlDocPtr cur; /* the document */
21776    int n_cur;
21777    char * encoding; /* the name of an encoding (or NULL) */
21778    int n_encoding;
21779
21780    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21781    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21782    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21783        mem_base = xmlMemBlocks();
21784        filename = gen_fileoutput(n_filename, 0);
21785        cur = gen_xmlDocPtr(n_cur, 1);
21786        encoding = gen_const_char_ptr(n_encoding, 2);
21787
21788        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
21789        desret_int(ret_val);
21790        call_tests++;
21791        des_fileoutput(n_filename, filename, 0);
21792        des_xmlDocPtr(n_cur, cur, 1);
21793        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
21794        xmlResetLastError();
21795        if (mem_base != xmlMemBlocks()) {
21796            printf("Leak of %d blocks found in xmlSaveFileEnc",
21797	           xmlMemBlocks() - mem_base);
21798	    test_ret++;
21799            printf(" %d", n_filename);
21800            printf(" %d", n_cur);
21801            printf(" %d", n_encoding);
21802            printf("\n");
21803        }
21804    }
21805    }
21806    }
21807    function_tests++;
21808#endif
21809
21810    return(test_ret);
21811}
21812
21813
21814static int
21815test_xmlSaveFileTo(void) {
21816    int test_ret = 0;
21817
21818#ifdef LIBXML_OUTPUT_ENABLED
21819    int mem_base;
21820    int ret_val;
21821    xmlOutputBufferPtr buf; /* an output I/O buffer */
21822    int n_buf;
21823    xmlDocPtr cur; /* the document */
21824    int n_cur;
21825    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
21826    int n_encoding;
21827
21828    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21829    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21830    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21831        mem_base = xmlMemBlocks();
21832        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21833        cur = gen_xmlDocPtr(n_cur, 1);
21834        encoding = gen_const_char_ptr(n_encoding, 2);
21835
21836        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
21837        buf = NULL;
21838        desret_int(ret_val);
21839        call_tests++;
21840        des_xmlOutputBufferPtr(n_buf, buf, 0);
21841        des_xmlDocPtr(n_cur, cur, 1);
21842        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
21843        xmlResetLastError();
21844        if (mem_base != xmlMemBlocks()) {
21845            printf("Leak of %d blocks found in xmlSaveFileTo",
21846	           xmlMemBlocks() - mem_base);
21847	    test_ret++;
21848            printf(" %d", n_buf);
21849            printf(" %d", n_cur);
21850            printf(" %d", n_encoding);
21851            printf("\n");
21852        }
21853    }
21854    }
21855    }
21856    function_tests++;
21857#endif
21858
21859    return(test_ret);
21860}
21861
21862
21863static int
21864test_xmlSaveFormatFile(void) {
21865    int test_ret = 0;
21866
21867#ifdef LIBXML_OUTPUT_ENABLED
21868    int mem_base;
21869    int ret_val;
21870    const char * filename; /* the filename (or URL) */
21871    int n_filename;
21872    xmlDocPtr cur; /* the document */
21873    int n_cur;
21874    int format; /* should formatting spaces been added */
21875    int n_format;
21876
21877    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21878    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21879    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21880        mem_base = xmlMemBlocks();
21881        filename = gen_fileoutput(n_filename, 0);
21882        cur = gen_xmlDocPtr(n_cur, 1);
21883        format = gen_int(n_format, 2);
21884
21885        ret_val = xmlSaveFormatFile(filename, cur, format);
21886        desret_int(ret_val);
21887        call_tests++;
21888        des_fileoutput(n_filename, filename, 0);
21889        des_xmlDocPtr(n_cur, cur, 1);
21890        des_int(n_format, format, 2);
21891        xmlResetLastError();
21892        if (mem_base != xmlMemBlocks()) {
21893            printf("Leak of %d blocks found in xmlSaveFormatFile",
21894	           xmlMemBlocks() - mem_base);
21895	    test_ret++;
21896            printf(" %d", n_filename);
21897            printf(" %d", n_cur);
21898            printf(" %d", n_format);
21899            printf("\n");
21900        }
21901    }
21902    }
21903    }
21904    function_tests++;
21905#endif
21906
21907    return(test_ret);
21908}
21909
21910
21911static int
21912test_xmlSaveFormatFileEnc(void) {
21913    int test_ret = 0;
21914
21915#ifdef LIBXML_OUTPUT_ENABLED
21916    int mem_base;
21917    int ret_val;
21918    const char * filename; /* the filename or URL to output */
21919    int n_filename;
21920    xmlDocPtr cur; /* the document being saved */
21921    int n_cur;
21922    char * encoding; /* the name of the encoding to use or NULL. */
21923    int n_encoding;
21924    int format; /* should formatting spaces be added. */
21925    int n_format;
21926
21927    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
21928    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21929    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21930    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21931        mem_base = xmlMemBlocks();
21932        filename = gen_fileoutput(n_filename, 0);
21933        cur = gen_xmlDocPtr(n_cur, 1);
21934        encoding = gen_const_char_ptr(n_encoding, 2);
21935        format = gen_int(n_format, 3);
21936
21937        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
21938        desret_int(ret_val);
21939        call_tests++;
21940        des_fileoutput(n_filename, filename, 0);
21941        des_xmlDocPtr(n_cur, cur, 1);
21942        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
21943        des_int(n_format, format, 3);
21944        xmlResetLastError();
21945        if (mem_base != xmlMemBlocks()) {
21946            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
21947	           xmlMemBlocks() - mem_base);
21948	    test_ret++;
21949            printf(" %d", n_filename);
21950            printf(" %d", n_cur);
21951            printf(" %d", n_encoding);
21952            printf(" %d", n_format);
21953            printf("\n");
21954        }
21955    }
21956    }
21957    }
21958    }
21959    function_tests++;
21960#endif
21961
21962    return(test_ret);
21963}
21964
21965
21966static int
21967test_xmlSaveFormatFileTo(void) {
21968    int test_ret = 0;
21969
21970#ifdef LIBXML_OUTPUT_ENABLED
21971    int mem_base;
21972    int ret_val;
21973    xmlOutputBufferPtr buf; /* an output I/O buffer */
21974    int n_buf;
21975    xmlDocPtr cur; /* the document */
21976    int n_cur;
21977    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
21978    int n_encoding;
21979    int format; /* should formatting spaces been added */
21980    int n_format;
21981
21982    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21983    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
21984    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21985    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21986        mem_base = xmlMemBlocks();
21987        buf = gen_xmlOutputBufferPtr(n_buf, 0);
21988        cur = gen_xmlDocPtr(n_cur, 1);
21989        encoding = gen_const_char_ptr(n_encoding, 2);
21990        format = gen_int(n_format, 3);
21991
21992        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
21993        buf = NULL;
21994        desret_int(ret_val);
21995        call_tests++;
21996        des_xmlOutputBufferPtr(n_buf, buf, 0);
21997        des_xmlDocPtr(n_cur, cur, 1);
21998        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
21999        des_int(n_format, format, 3);
22000        xmlResetLastError();
22001        if (mem_base != xmlMemBlocks()) {
22002            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22003	           xmlMemBlocks() - mem_base);
22004	    test_ret++;
22005            printf(" %d", n_buf);
22006            printf(" %d", n_cur);
22007            printf(" %d", n_encoding);
22008            printf(" %d", n_format);
22009            printf("\n");
22010        }
22011    }
22012    }
22013    }
22014    }
22015    function_tests++;
22016#endif
22017
22018    return(test_ret);
22019}
22020
22021
22022static int
22023test_xmlSearchNs(void) {
22024    int test_ret = 0;
22025
22026    int mem_base;
22027    xmlNsPtr ret_val;
22028    xmlDocPtr doc; /* the document */
22029    int n_doc;
22030    xmlNodePtr node; /* the current node */
22031    int n_node;
22032    xmlChar * nameSpace; /* the namespace prefix */
22033    int n_nameSpace;
22034
22035    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22036    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22037    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22038        mem_base = xmlMemBlocks();
22039        doc = gen_xmlDocPtr(n_doc, 0);
22040        node = gen_xmlNodePtr(n_node, 1);
22041        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22042
22043        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
22044        desret_xmlNsPtr(ret_val);
22045        call_tests++;
22046        des_xmlDocPtr(n_doc, doc, 0);
22047        des_xmlNodePtr(n_node, node, 1);
22048        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
22049        xmlResetLastError();
22050        if (mem_base != xmlMemBlocks()) {
22051            printf("Leak of %d blocks found in xmlSearchNs",
22052	           xmlMemBlocks() - mem_base);
22053	    test_ret++;
22054            printf(" %d", n_doc);
22055            printf(" %d", n_node);
22056            printf(" %d", n_nameSpace);
22057            printf("\n");
22058        }
22059    }
22060    }
22061    }
22062    function_tests++;
22063
22064    return(test_ret);
22065}
22066
22067
22068static int
22069test_xmlSearchNsByHref(void) {
22070    int test_ret = 0;
22071
22072    int mem_base;
22073    xmlNsPtr ret_val;
22074    xmlDocPtr doc; /* the document */
22075    int n_doc;
22076    xmlNodePtr node; /* the current node */
22077    int n_node;
22078    xmlChar * href; /* the namespace value */
22079    int n_href;
22080
22081    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22082    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22083    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22084        mem_base = xmlMemBlocks();
22085        doc = gen_xmlDocPtr(n_doc, 0);
22086        node = gen_xmlNodePtr(n_node, 1);
22087        href = gen_const_xmlChar_ptr(n_href, 2);
22088
22089        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
22090        desret_xmlNsPtr(ret_val);
22091        call_tests++;
22092        des_xmlDocPtr(n_doc, doc, 0);
22093        des_xmlNodePtr(n_node, node, 1);
22094        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
22095        xmlResetLastError();
22096        if (mem_base != xmlMemBlocks()) {
22097            printf("Leak of %d blocks found in xmlSearchNsByHref",
22098	           xmlMemBlocks() - mem_base);
22099	    test_ret++;
22100            printf(" %d", n_doc);
22101            printf(" %d", n_node);
22102            printf(" %d", n_href);
22103            printf("\n");
22104        }
22105    }
22106    }
22107    }
22108    function_tests++;
22109
22110    return(test_ret);
22111}
22112
22113
22114static int
22115test_xmlSetBufferAllocationScheme(void) {
22116    int test_ret = 0;
22117
22118    int mem_base;
22119    xmlBufferAllocationScheme scheme; /* allocation method to use */
22120    int n_scheme;
22121
22122    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
22123        mem_base = xmlMemBlocks();
22124        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
22125
22126        xmlSetBufferAllocationScheme(scheme);
22127        call_tests++;
22128        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
22129        xmlResetLastError();
22130        if (mem_base != xmlMemBlocks()) {
22131            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
22132	           xmlMemBlocks() - mem_base);
22133	    test_ret++;
22134            printf(" %d", n_scheme);
22135            printf("\n");
22136        }
22137    }
22138    function_tests++;
22139
22140    return(test_ret);
22141}
22142
22143
22144static int
22145test_xmlSetCompressMode(void) {
22146    int test_ret = 0;
22147
22148    int mem_base;
22149    int mode; /* the compression ratio */
22150    int n_mode;
22151
22152    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22153        mem_base = xmlMemBlocks();
22154        mode = gen_int(n_mode, 0);
22155
22156        xmlSetCompressMode(mode);
22157        call_tests++;
22158        des_int(n_mode, mode, 0);
22159        xmlResetLastError();
22160        if (mem_base != xmlMemBlocks()) {
22161            printf("Leak of %d blocks found in xmlSetCompressMode",
22162	           xmlMemBlocks() - mem_base);
22163	    test_ret++;
22164            printf(" %d", n_mode);
22165            printf("\n");
22166        }
22167    }
22168    function_tests++;
22169
22170    return(test_ret);
22171}
22172
22173
22174static int
22175test_xmlSetDocCompressMode(void) {
22176    int test_ret = 0;
22177
22178    int mem_base;
22179    xmlDocPtr doc; /* the document */
22180    int n_doc;
22181    int mode; /* the compression ratio */
22182    int n_mode;
22183
22184    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22185    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
22186        mem_base = xmlMemBlocks();
22187        doc = gen_xmlDocPtr(n_doc, 0);
22188        mode = gen_int(n_mode, 1);
22189
22190        xmlSetDocCompressMode(doc, mode);
22191        call_tests++;
22192        des_xmlDocPtr(n_doc, doc, 0);
22193        des_int(n_mode, mode, 1);
22194        xmlResetLastError();
22195        if (mem_base != xmlMemBlocks()) {
22196            printf("Leak of %d blocks found in xmlSetDocCompressMode",
22197	           xmlMemBlocks() - mem_base);
22198	    test_ret++;
22199            printf(" %d", n_doc);
22200            printf(" %d", n_mode);
22201            printf("\n");
22202        }
22203    }
22204    }
22205    function_tests++;
22206
22207    return(test_ret);
22208}
22209
22210
22211static int
22212test_xmlSetNs(void) {
22213    int test_ret = 0;
22214
22215    int mem_base;
22216    xmlNodePtr node; /* a node in the document */
22217    int n_node;
22218    xmlNsPtr ns; /* a namespace pointer */
22219    int n_ns;
22220
22221    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22222    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22223        mem_base = xmlMemBlocks();
22224        node = gen_xmlNodePtr(n_node, 0);
22225        ns = gen_xmlNsPtr(n_ns, 1);
22226
22227        xmlSetNs(node, ns);
22228        call_tests++;
22229        des_xmlNodePtr(n_node, node, 0);
22230        des_xmlNsPtr(n_ns, ns, 1);
22231        xmlResetLastError();
22232        if (mem_base != xmlMemBlocks()) {
22233            printf("Leak of %d blocks found in xmlSetNs",
22234	           xmlMemBlocks() - mem_base);
22235	    test_ret++;
22236            printf(" %d", n_node);
22237            printf(" %d", n_ns);
22238            printf("\n");
22239        }
22240    }
22241    }
22242    function_tests++;
22243
22244    return(test_ret);
22245}
22246
22247
22248static int
22249test_xmlSetNsProp(void) {
22250    int test_ret = 0;
22251
22252#ifdef LIBXML_TREE_ENABLED
22253    int mem_base;
22254    xmlAttrPtr ret_val;
22255    xmlNodePtr node; /* the node */
22256    int n_node;
22257    xmlNsPtr ns; /* the namespace definition */
22258    int n_ns;
22259    xmlChar * name; /* the attribute name */
22260    int n_name;
22261    xmlChar * value; /* the attribute value */
22262    int n_value;
22263
22264    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22265    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22266    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22267    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22268        mem_base = xmlMemBlocks();
22269        node = gen_xmlNodePtr(n_node, 0);
22270        ns = gen_xmlNsPtr(n_ns, 1);
22271        name = gen_const_xmlChar_ptr(n_name, 2);
22272        value = gen_const_xmlChar_ptr(n_value, 3);
22273
22274        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
22275        desret_xmlAttrPtr(ret_val);
22276        call_tests++;
22277        des_xmlNodePtr(n_node, node, 0);
22278        des_xmlNsPtr(n_ns, ns, 1);
22279        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22280        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
22281        xmlResetLastError();
22282        if (mem_base != xmlMemBlocks()) {
22283            printf("Leak of %d blocks found in xmlSetNsProp",
22284	           xmlMemBlocks() - mem_base);
22285	    test_ret++;
22286            printf(" %d", n_node);
22287            printf(" %d", n_ns);
22288            printf(" %d", n_name);
22289            printf(" %d", n_value);
22290            printf("\n");
22291        }
22292    }
22293    }
22294    }
22295    }
22296    function_tests++;
22297#endif
22298
22299    return(test_ret);
22300}
22301
22302
22303static int
22304test_xmlSetProp(void) {
22305    int test_ret = 0;
22306
22307#ifdef LIBXML_TREE_ENABLED
22308    int mem_base;
22309    xmlAttrPtr ret_val;
22310    xmlNodePtr node; /* the node */
22311    int n_node;
22312    xmlChar * name; /* the attribute name */
22313    int n_name;
22314    xmlChar * value; /* the attribute value */
22315    int n_value;
22316
22317    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22318    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22319    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22320        mem_base = xmlMemBlocks();
22321        node = gen_xmlNodePtr(n_node, 0);
22322        name = gen_const_xmlChar_ptr(n_name, 1);
22323        value = gen_const_xmlChar_ptr(n_value, 2);
22324
22325        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
22326        desret_xmlAttrPtr(ret_val);
22327        call_tests++;
22328        des_xmlNodePtr(n_node, node, 0);
22329        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22330        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
22331        xmlResetLastError();
22332        if (mem_base != xmlMemBlocks()) {
22333            printf("Leak of %d blocks found in xmlSetProp",
22334	           xmlMemBlocks() - mem_base);
22335	    test_ret++;
22336            printf(" %d", n_node);
22337            printf(" %d", n_name);
22338            printf(" %d", n_value);
22339            printf("\n");
22340        }
22341    }
22342    }
22343    }
22344    function_tests++;
22345#endif
22346
22347    return(test_ret);
22348}
22349
22350
22351static int
22352test_xmlSplitQName2(void) {
22353    int test_ret = 0;
22354
22355    int mem_base;
22356    xmlChar * ret_val;
22357    xmlChar * name; /* the full QName */
22358    int n_name;
22359    xmlChar ** prefix; /* a xmlChar ** */
22360    int n_prefix;
22361
22362    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22363    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
22364        mem_base = xmlMemBlocks();
22365        name = gen_const_xmlChar_ptr(n_name, 0);
22366        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
22367
22368        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
22369        desret_xmlChar_ptr(ret_val);
22370        call_tests++;
22371        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22372        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
22373        xmlResetLastError();
22374        if (mem_base != xmlMemBlocks()) {
22375            printf("Leak of %d blocks found in xmlSplitQName2",
22376	           xmlMemBlocks() - mem_base);
22377	    test_ret++;
22378            printf(" %d", n_name);
22379            printf(" %d", n_prefix);
22380            printf("\n");
22381        }
22382    }
22383    }
22384    function_tests++;
22385
22386    return(test_ret);
22387}
22388
22389
22390static int
22391test_xmlSplitQName3(void) {
22392    int test_ret = 0;
22393
22394    int mem_base;
22395    const xmlChar * ret_val;
22396    xmlChar * name; /* the full QName */
22397    int n_name;
22398    int * len; /* an int * */
22399    int n_len;
22400
22401    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22402    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
22403        mem_base = xmlMemBlocks();
22404        name = gen_const_xmlChar_ptr(n_name, 0);
22405        len = gen_int_ptr(n_len, 1);
22406
22407        ret_val = xmlSplitQName3((const xmlChar *)name, len);
22408        desret_const_xmlChar_ptr(ret_val);
22409        call_tests++;
22410        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
22411        des_int_ptr(n_len, len, 1);
22412        xmlResetLastError();
22413        if (mem_base != xmlMemBlocks()) {
22414            printf("Leak of %d blocks found in xmlSplitQName3",
22415	           xmlMemBlocks() - mem_base);
22416	    test_ret++;
22417            printf(" %d", n_name);
22418            printf(" %d", n_len);
22419            printf("\n");
22420        }
22421    }
22422    }
22423    function_tests++;
22424
22425    return(test_ret);
22426}
22427
22428
22429static int
22430test_xmlStringGetNodeList(void) {
22431    int test_ret = 0;
22432
22433    int mem_base;
22434    xmlNodePtr ret_val;
22435    xmlDocPtr doc; /* the document */
22436    int n_doc;
22437    xmlChar * value; /* the value of the attribute */
22438    int n_value;
22439
22440    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22441    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22442        mem_base = xmlMemBlocks();
22443        doc = gen_xmlDocPtr(n_doc, 0);
22444        value = gen_const_xmlChar_ptr(n_value, 1);
22445
22446        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
22447        desret_xmlNodePtr(ret_val);
22448        call_tests++;
22449        des_xmlDocPtr(n_doc, doc, 0);
22450        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
22451        xmlResetLastError();
22452        if (mem_base != xmlMemBlocks()) {
22453            printf("Leak of %d blocks found in xmlStringGetNodeList",
22454	           xmlMemBlocks() - mem_base);
22455	    test_ret++;
22456            printf(" %d", n_doc);
22457            printf(" %d", n_value);
22458            printf("\n");
22459        }
22460    }
22461    }
22462    function_tests++;
22463
22464    return(test_ret);
22465}
22466
22467
22468static int
22469test_xmlStringLenGetNodeList(void) {
22470    int test_ret = 0;
22471
22472    int mem_base;
22473    xmlNodePtr ret_val;
22474    xmlDocPtr doc; /* the document */
22475    int n_doc;
22476    xmlChar * value; /* the value of the text */
22477    int n_value;
22478    int len; /* the length of the string value */
22479    int n_len;
22480
22481    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22482    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22483    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22484        mem_base = xmlMemBlocks();
22485        doc = gen_xmlDocPtr(n_doc, 0);
22486        value = gen_const_xmlChar_ptr(n_value, 1);
22487        len = gen_int(n_len, 2);
22488
22489        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
22490        desret_xmlNodePtr(ret_val);
22491        call_tests++;
22492        des_xmlDocPtr(n_doc, doc, 0);
22493        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
22494        des_int(n_len, len, 2);
22495        xmlResetLastError();
22496        if (mem_base != xmlMemBlocks()) {
22497            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
22498	           xmlMemBlocks() - mem_base);
22499	    test_ret++;
22500            printf(" %d", n_doc);
22501            printf(" %d", n_value);
22502            printf(" %d", n_len);
22503            printf("\n");
22504        }
22505    }
22506    }
22507    }
22508    function_tests++;
22509
22510    return(test_ret);
22511}
22512
22513
22514static int
22515test_xmlTextConcat(void) {
22516    int test_ret = 0;
22517
22518    int mem_base;
22519    int ret_val;
22520    xmlNodePtr node; /* the node */
22521    int n_node;
22522    xmlChar * content; /* the content */
22523    int n_content;
22524    int len; /* @content length */
22525    int n_len;
22526
22527    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22528    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22529    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22530        mem_base = xmlMemBlocks();
22531        node = gen_xmlNodePtr(n_node, 0);
22532        content = gen_const_xmlChar_ptr(n_content, 1);
22533        len = gen_int(n_len, 2);
22534
22535        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
22536        desret_int(ret_val);
22537        call_tests++;
22538        des_xmlNodePtr(n_node, node, 0);
22539        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22540        des_int(n_len, len, 2);
22541        xmlResetLastError();
22542        if (mem_base != xmlMemBlocks()) {
22543            printf("Leak of %d blocks found in xmlTextConcat",
22544	           xmlMemBlocks() - mem_base);
22545	    test_ret++;
22546            printf(" %d", n_node);
22547            printf(" %d", n_content);
22548            printf(" %d", n_len);
22549            printf("\n");
22550        }
22551    }
22552    }
22553    }
22554    function_tests++;
22555
22556    return(test_ret);
22557}
22558
22559
22560static int
22561test_xmlTextMerge(void) {
22562    int test_ret = 0;
22563
22564    int mem_base;
22565    xmlNodePtr ret_val;
22566    xmlNodePtr first; /* the first text node */
22567    int n_first;
22568    xmlNodePtr second; /* the second text node being merged */
22569    int n_second;
22570
22571    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
22572    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
22573        mem_base = xmlMemBlocks();
22574        first = gen_xmlNodePtr_in(n_first, 0);
22575        second = gen_xmlNodePtr_in(n_second, 1);
22576
22577        ret_val = xmlTextMerge(first, second);
22578        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
22579              xmlUnlinkNode(second);
22580              xmlFreeNode(second) ; second = NULL ; }
22581        desret_xmlNodePtr(ret_val);
22582        call_tests++;
22583        des_xmlNodePtr_in(n_first, first, 0);
22584        des_xmlNodePtr_in(n_second, second, 1);
22585        xmlResetLastError();
22586        if (mem_base != xmlMemBlocks()) {
22587            printf("Leak of %d blocks found in xmlTextMerge",
22588	           xmlMemBlocks() - mem_base);
22589	    test_ret++;
22590            printf(" %d", n_first);
22591            printf(" %d", n_second);
22592            printf("\n");
22593        }
22594    }
22595    }
22596    function_tests++;
22597
22598    return(test_ret);
22599}
22600
22601
22602static int
22603test_xmlUnsetNsProp(void) {
22604    int test_ret = 0;
22605
22606#ifdef LIBXML_TREE_ENABLED
22607    int mem_base;
22608    int ret_val;
22609    xmlNodePtr node; /* the node */
22610    int n_node;
22611    xmlNsPtr ns; /* the namespace definition */
22612    int n_ns;
22613    xmlChar * name; /* the attribute name */
22614    int n_name;
22615
22616    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22617    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
22618    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22619        mem_base = xmlMemBlocks();
22620        node = gen_xmlNodePtr(n_node, 0);
22621        ns = gen_xmlNsPtr(n_ns, 1);
22622        name = gen_const_xmlChar_ptr(n_name, 2);
22623
22624        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
22625        desret_int(ret_val);
22626        call_tests++;
22627        des_xmlNodePtr(n_node, node, 0);
22628        des_xmlNsPtr(n_ns, ns, 1);
22629        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
22630        xmlResetLastError();
22631        if (mem_base != xmlMemBlocks()) {
22632            printf("Leak of %d blocks found in xmlUnsetNsProp",
22633	           xmlMemBlocks() - mem_base);
22634	    test_ret++;
22635            printf(" %d", n_node);
22636            printf(" %d", n_ns);
22637            printf(" %d", n_name);
22638            printf("\n");
22639        }
22640    }
22641    }
22642    }
22643    function_tests++;
22644#endif
22645
22646    return(test_ret);
22647}
22648
22649
22650static int
22651test_xmlUnsetProp(void) {
22652    int test_ret = 0;
22653
22654#ifdef LIBXML_TREE_ENABLED
22655    int mem_base;
22656    int ret_val;
22657    xmlNodePtr node; /* the node */
22658    int n_node;
22659    xmlChar * name; /* the attribute name */
22660    int n_name;
22661
22662    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22663    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22664        mem_base = xmlMemBlocks();
22665        node = gen_xmlNodePtr(n_node, 0);
22666        name = gen_const_xmlChar_ptr(n_name, 1);
22667
22668        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
22669        desret_int(ret_val);
22670        call_tests++;
22671        des_xmlNodePtr(n_node, node, 0);
22672        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22673        xmlResetLastError();
22674        if (mem_base != xmlMemBlocks()) {
22675            printf("Leak of %d blocks found in xmlUnsetProp",
22676	           xmlMemBlocks() - mem_base);
22677	    test_ret++;
22678            printf(" %d", n_node);
22679            printf(" %d", n_name);
22680            printf("\n");
22681        }
22682    }
22683    }
22684    function_tests++;
22685#endif
22686
22687    return(test_ret);
22688}
22689
22690
22691static int
22692test_xmlValidateNCName(void) {
22693    int test_ret = 0;
22694
22695#ifdef LIBXML_TREE_ENABLED
22696    int mem_base;
22697    int ret_val;
22698    xmlChar * value; /* the value to check */
22699    int n_value;
22700    int space; /* allow spaces in front and end of the string */
22701    int n_space;
22702
22703    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22704    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22705        mem_base = xmlMemBlocks();
22706        value = gen_const_xmlChar_ptr(n_value, 0);
22707        space = gen_int(n_space, 1);
22708
22709        ret_val = xmlValidateNCName((const xmlChar *)value, space);
22710        desret_int(ret_val);
22711        call_tests++;
22712        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22713        des_int(n_space, space, 1);
22714        xmlResetLastError();
22715        if (mem_base != xmlMemBlocks()) {
22716            printf("Leak of %d blocks found in xmlValidateNCName",
22717	           xmlMemBlocks() - mem_base);
22718	    test_ret++;
22719            printf(" %d", n_value);
22720            printf(" %d", n_space);
22721            printf("\n");
22722        }
22723    }
22724    }
22725    function_tests++;
22726#endif
22727
22728    return(test_ret);
22729}
22730
22731
22732static int
22733test_xmlValidateNMToken(void) {
22734    int test_ret = 0;
22735
22736#ifdef LIBXML_TREE_ENABLED
22737    int mem_base;
22738    int ret_val;
22739    xmlChar * value; /* the value to check */
22740    int n_value;
22741    int space; /* allow spaces in front and end of the string */
22742    int n_space;
22743
22744    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22745    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22746        mem_base = xmlMemBlocks();
22747        value = gen_const_xmlChar_ptr(n_value, 0);
22748        space = gen_int(n_space, 1);
22749
22750        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
22751        desret_int(ret_val);
22752        call_tests++;
22753        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22754        des_int(n_space, space, 1);
22755        xmlResetLastError();
22756        if (mem_base != xmlMemBlocks()) {
22757            printf("Leak of %d blocks found in xmlValidateNMToken",
22758	           xmlMemBlocks() - mem_base);
22759	    test_ret++;
22760            printf(" %d", n_value);
22761            printf(" %d", n_space);
22762            printf("\n");
22763        }
22764    }
22765    }
22766    function_tests++;
22767#endif
22768
22769    return(test_ret);
22770}
22771
22772
22773static int
22774test_xmlValidateName(void) {
22775    int test_ret = 0;
22776
22777#ifdef LIBXML_TREE_ENABLED
22778    int mem_base;
22779    int ret_val;
22780    xmlChar * value; /* the value to check */
22781    int n_value;
22782    int space; /* allow spaces in front and end of the string */
22783    int n_space;
22784
22785    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22786    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22787        mem_base = xmlMemBlocks();
22788        value = gen_const_xmlChar_ptr(n_value, 0);
22789        space = gen_int(n_space, 1);
22790
22791        ret_val = xmlValidateName((const xmlChar *)value, space);
22792        desret_int(ret_val);
22793        call_tests++;
22794        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22795        des_int(n_space, space, 1);
22796        xmlResetLastError();
22797        if (mem_base != xmlMemBlocks()) {
22798            printf("Leak of %d blocks found in xmlValidateName",
22799	           xmlMemBlocks() - mem_base);
22800	    test_ret++;
22801            printf(" %d", n_value);
22802            printf(" %d", n_space);
22803            printf("\n");
22804        }
22805    }
22806    }
22807    function_tests++;
22808#endif
22809
22810    return(test_ret);
22811}
22812
22813
22814static int
22815test_xmlValidateQName(void) {
22816    int test_ret = 0;
22817
22818#ifdef LIBXML_TREE_ENABLED
22819    int mem_base;
22820    int ret_val;
22821    xmlChar * value; /* the value to check */
22822    int n_value;
22823    int space; /* allow spaces in front and end of the string */
22824    int n_space;
22825
22826    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
22827    for (n_space = 0;n_space < gen_nb_int;n_space++) {
22828        mem_base = xmlMemBlocks();
22829        value = gen_const_xmlChar_ptr(n_value, 0);
22830        space = gen_int(n_space, 1);
22831
22832        ret_val = xmlValidateQName((const xmlChar *)value, space);
22833        desret_int(ret_val);
22834        call_tests++;
22835        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
22836        des_int(n_space, space, 1);
22837        xmlResetLastError();
22838        if (mem_base != xmlMemBlocks()) {
22839            printf("Leak of %d blocks found in xmlValidateQName",
22840	           xmlMemBlocks() - mem_base);
22841	    test_ret++;
22842            printf(" %d", n_value);
22843            printf(" %d", n_space);
22844            printf("\n");
22845        }
22846    }
22847    }
22848    function_tests++;
22849#endif
22850
22851    return(test_ret);
22852}
22853
22854static int
22855test_tree(void) {
22856    int test_ret = 0;
22857
22858    if (quiet == 0) printf("Testing tree : 129 of 146 functions ...\n");
22859    test_ret += test_xmlAddChild();
22860    test_ret += test_xmlAddChildList();
22861    test_ret += test_xmlAddNextSibling();
22862    test_ret += test_xmlAddPrevSibling();
22863    test_ret += test_xmlAddSibling();
22864    test_ret += test_xmlAttrSerializeTxtContent();
22865    test_ret += test_xmlBufferAdd();
22866    test_ret += test_xmlBufferAddHead();
22867    test_ret += test_xmlBufferCCat();
22868    test_ret += test_xmlBufferCat();
22869    test_ret += test_xmlBufferContent();
22870    test_ret += test_xmlBufferCreate();
22871    test_ret += test_xmlBufferCreateSize();
22872    test_ret += test_xmlBufferCreateStatic();
22873    test_ret += test_xmlBufferEmpty();
22874    test_ret += test_xmlBufferGrow();
22875    test_ret += test_xmlBufferLength();
22876    test_ret += test_xmlBufferResize();
22877    test_ret += test_xmlBufferSetAllocationScheme();
22878    test_ret += test_xmlBufferShrink();
22879    test_ret += test_xmlBufferWriteCHAR();
22880    test_ret += test_xmlBufferWriteChar();
22881    test_ret += test_xmlBufferWriteQuotedString();
22882    test_ret += test_xmlBuildQName();
22883    test_ret += test_xmlCopyDoc();
22884    test_ret += test_xmlCopyDtd();
22885    test_ret += test_xmlCopyNamespace();
22886    test_ret += test_xmlCopyNamespaceList();
22887    test_ret += test_xmlCopyNode();
22888    test_ret += test_xmlCopyNodeList();
22889    test_ret += test_xmlCopyProp();
22890    test_ret += test_xmlCopyPropList();
22891    test_ret += test_xmlCreateIntSubset();
22892    test_ret += test_xmlDocCopyNode();
22893    test_ret += test_xmlDocCopyNodeList();
22894    test_ret += test_xmlDocDump();
22895    test_ret += test_xmlDocDumpFormatMemory();
22896    test_ret += test_xmlDocDumpFormatMemoryEnc();
22897    test_ret += test_xmlDocDumpMemory();
22898    test_ret += test_xmlDocDumpMemoryEnc();
22899    test_ret += test_xmlDocFormatDump();
22900    test_ret += test_xmlDocGetRootElement();
22901    test_ret += test_xmlDocSetRootElement();
22902    test_ret += test_xmlElemDump();
22903    test_ret += test_xmlGetBufferAllocationScheme();
22904    test_ret += test_xmlGetCompressMode();
22905    test_ret += test_xmlGetDocCompressMode();
22906    test_ret += test_xmlGetIntSubset();
22907    test_ret += test_xmlGetLastChild();
22908    test_ret += test_xmlGetLineNo();
22909    test_ret += test_xmlGetNoNsProp();
22910    test_ret += test_xmlGetNodePath();
22911    test_ret += test_xmlGetNsList();
22912    test_ret += test_xmlGetNsProp();
22913    test_ret += test_xmlGetProp();
22914    test_ret += test_xmlHasNsProp();
22915    test_ret += test_xmlHasProp();
22916    test_ret += test_xmlIsBlankNode();
22917    test_ret += test_xmlIsXHTML();
22918    test_ret += test_xmlNewCDataBlock();
22919    test_ret += test_xmlNewCharRef();
22920    test_ret += test_xmlNewChild();
22921    test_ret += test_xmlNewComment();
22922    test_ret += test_xmlNewDoc();
22923    test_ret += test_xmlNewDocComment();
22924    test_ret += test_xmlNewDocFragment();
22925    test_ret += test_xmlNewDocNode();
22926    test_ret += test_xmlNewDocNodeEatName();
22927    test_ret += test_xmlNewDocPI();
22928    test_ret += test_xmlNewDocProp();
22929    test_ret += test_xmlNewDocRawNode();
22930    test_ret += test_xmlNewDocText();
22931    test_ret += test_xmlNewDocTextLen();
22932    test_ret += test_xmlNewDtd();
22933    test_ret += test_xmlNewNode();
22934    test_ret += test_xmlNewNodeEatName();
22935    test_ret += test_xmlNewNs();
22936    test_ret += test_xmlNewNsProp();
22937    test_ret += test_xmlNewNsPropEatName();
22938    test_ret += test_xmlNewPI();
22939    test_ret += test_xmlNewProp();
22940    test_ret += test_xmlNewReference();
22941    test_ret += test_xmlNewText();
22942    test_ret += test_xmlNewTextChild();
22943    test_ret += test_xmlNewTextLen();
22944    test_ret += test_xmlNodeAddContent();
22945    test_ret += test_xmlNodeAddContentLen();
22946    test_ret += test_xmlNodeBufGetContent();
22947    test_ret += test_xmlNodeDump();
22948    test_ret += test_xmlNodeDumpOutput();
22949    test_ret += test_xmlNodeGetBase();
22950    test_ret += test_xmlNodeGetContent();
22951    test_ret += test_xmlNodeGetLang();
22952    test_ret += test_xmlNodeGetSpacePreserve();
22953    test_ret += test_xmlNodeIsText();
22954    test_ret += test_xmlNodeListGetRawString();
22955    test_ret += test_xmlNodeListGetString();
22956    test_ret += test_xmlNodeSetBase();
22957    test_ret += test_xmlNodeSetContent();
22958    test_ret += test_xmlNodeSetContentLen();
22959    test_ret += test_xmlNodeSetLang();
22960    test_ret += test_xmlNodeSetName();
22961    test_ret += test_xmlNodeSetSpacePreserve();
22962    test_ret += test_xmlReconciliateNs();
22963    test_ret += test_xmlRemoveProp();
22964    test_ret += test_xmlReplaceNode();
22965    test_ret += test_xmlSaveFile();
22966    test_ret += test_xmlSaveFileEnc();
22967    test_ret += test_xmlSaveFileTo();
22968    test_ret += test_xmlSaveFormatFile();
22969    test_ret += test_xmlSaveFormatFileEnc();
22970    test_ret += test_xmlSaveFormatFileTo();
22971    test_ret += test_xmlSearchNs();
22972    test_ret += test_xmlSearchNsByHref();
22973    test_ret += test_xmlSetBufferAllocationScheme();
22974    test_ret += test_xmlSetCompressMode();
22975    test_ret += test_xmlSetDocCompressMode();
22976    test_ret += test_xmlSetNs();
22977    test_ret += test_xmlSetNsProp();
22978    test_ret += test_xmlSetProp();
22979    test_ret += test_xmlSplitQName2();
22980    test_ret += test_xmlSplitQName3();
22981    test_ret += test_xmlStringGetNodeList();
22982    test_ret += test_xmlStringLenGetNodeList();
22983    test_ret += test_xmlTextConcat();
22984    test_ret += test_xmlTextMerge();
22985    test_ret += test_xmlUnsetNsProp();
22986    test_ret += test_xmlUnsetProp();
22987    test_ret += test_xmlValidateNCName();
22988    test_ret += test_xmlValidateNMToken();
22989    test_ret += test_xmlValidateName();
22990    test_ret += test_xmlValidateQName();
22991
22992    if (test_ret != 0)
22993	printf("Module tree: %d errors\n", test_ret);
22994    return(test_ret);
22995}
22996
22997static int
22998test_xmlBuildRelativeURI(void) {
22999    int test_ret = 0;
23000
23001    int mem_base;
23002    xmlChar * ret_val;
23003    xmlChar * URI; /* the URI reference under consideration */
23004    int n_URI;
23005    xmlChar * base; /* the base value */
23006    int n_base;
23007
23008    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23009    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23010        mem_base = xmlMemBlocks();
23011        URI = gen_const_xmlChar_ptr(n_URI, 0);
23012        base = gen_const_xmlChar_ptr(n_base, 1);
23013
23014        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
23015        desret_xmlChar_ptr(ret_val);
23016        call_tests++;
23017        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23018        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23019        xmlResetLastError();
23020        if (mem_base != xmlMemBlocks()) {
23021            printf("Leak of %d blocks found in xmlBuildRelativeURI",
23022	           xmlMemBlocks() - mem_base);
23023	    test_ret++;
23024            printf(" %d", n_URI);
23025            printf(" %d", n_base);
23026            printf("\n");
23027        }
23028    }
23029    }
23030    function_tests++;
23031
23032    return(test_ret);
23033}
23034
23035
23036static int
23037test_xmlBuildURI(void) {
23038    int test_ret = 0;
23039
23040    int mem_base;
23041    xmlChar * ret_val;
23042    xmlChar * URI; /* the URI instance found in the document */
23043    int n_URI;
23044    xmlChar * base; /* the base value */
23045    int n_base;
23046
23047    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23048    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23049        mem_base = xmlMemBlocks();
23050        URI = gen_const_xmlChar_ptr(n_URI, 0);
23051        base = gen_const_xmlChar_ptr(n_base, 1);
23052
23053        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
23054        desret_xmlChar_ptr(ret_val);
23055        call_tests++;
23056        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23057        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23058        xmlResetLastError();
23059        if (mem_base != xmlMemBlocks()) {
23060            printf("Leak of %d blocks found in xmlBuildURI",
23061	           xmlMemBlocks() - mem_base);
23062	    test_ret++;
23063            printf(" %d", n_URI);
23064            printf(" %d", n_base);
23065            printf("\n");
23066        }
23067    }
23068    }
23069    function_tests++;
23070
23071    return(test_ret);
23072}
23073
23074
23075static int
23076test_xmlCanonicPath(void) {
23077    int test_ret = 0;
23078
23079    int mem_base;
23080    xmlChar * ret_val;
23081    xmlChar * path; /* the resource locator in a filesystem notation */
23082    int n_path;
23083
23084    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
23085        mem_base = xmlMemBlocks();
23086        path = gen_const_xmlChar_ptr(n_path, 0);
23087
23088        ret_val = xmlCanonicPath((const xmlChar *)path);
23089        desret_xmlChar_ptr(ret_val);
23090        call_tests++;
23091        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
23092        xmlResetLastError();
23093        if (mem_base != xmlMemBlocks()) {
23094            printf("Leak of %d blocks found in xmlCanonicPath",
23095	           xmlMemBlocks() - mem_base);
23096	    test_ret++;
23097            printf(" %d", n_path);
23098            printf("\n");
23099        }
23100    }
23101    function_tests++;
23102
23103    return(test_ret);
23104}
23105
23106
23107static int
23108test_xmlCreateURI(void) {
23109    int test_ret = 0;
23110
23111
23112    /* missing type support */
23113    return(test_ret);
23114}
23115
23116
23117static int
23118test_xmlNormalizeURIPath(void) {
23119    int test_ret = 0;
23120
23121    int mem_base;
23122    int ret_val;
23123    char * path; /* pointer to the path string */
23124    int n_path;
23125
23126    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
23127        mem_base = xmlMemBlocks();
23128        path = gen_char_ptr(n_path, 0);
23129
23130        ret_val = xmlNormalizeURIPath(path);
23131        desret_int(ret_val);
23132        call_tests++;
23133        des_char_ptr(n_path, path, 0);
23134        xmlResetLastError();
23135        if (mem_base != xmlMemBlocks()) {
23136            printf("Leak of %d blocks found in xmlNormalizeURIPath",
23137	           xmlMemBlocks() - mem_base);
23138	    test_ret++;
23139            printf(" %d", n_path);
23140            printf("\n");
23141        }
23142    }
23143    function_tests++;
23144
23145    return(test_ret);
23146}
23147
23148
23149static int
23150test_xmlParseURI(void) {
23151    int test_ret = 0;
23152
23153
23154    /* missing type support */
23155    return(test_ret);
23156}
23157
23158
23159#define gen_nb_xmlURIPtr 1
23160static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23161    return(NULL);
23162}
23163static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23164}
23165
23166static int
23167test_xmlParseURIReference(void) {
23168    int test_ret = 0;
23169
23170    int mem_base;
23171    int ret_val;
23172    xmlURIPtr uri; /* pointer to an URI structure */
23173    int n_uri;
23174    char * str; /* the string to analyze */
23175    int n_str;
23176
23177    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23178    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
23179        mem_base = xmlMemBlocks();
23180        uri = gen_xmlURIPtr(n_uri, 0);
23181        str = gen_const_char_ptr(n_str, 1);
23182
23183        ret_val = xmlParseURIReference(uri, (const char *)str);
23184        desret_int(ret_val);
23185        call_tests++;
23186        des_xmlURIPtr(n_uri, uri, 0);
23187        des_const_char_ptr(n_str, (const char *)str, 1);
23188        xmlResetLastError();
23189        if (mem_base != xmlMemBlocks()) {
23190            printf("Leak of %d blocks found in xmlParseURIReference",
23191	           xmlMemBlocks() - mem_base);
23192	    test_ret++;
23193            printf(" %d", n_uri);
23194            printf(" %d", n_str);
23195            printf("\n");
23196        }
23197    }
23198    }
23199    function_tests++;
23200
23201    return(test_ret);
23202}
23203
23204
23205static int
23206test_xmlPrintURI(void) {
23207    int test_ret = 0;
23208
23209    int mem_base;
23210    FILE * stream; /* a FILE* for the output */
23211    int n_stream;
23212    xmlURIPtr uri; /* pointer to an xmlURI */
23213    int n_uri;
23214
23215    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
23216    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23217        mem_base = xmlMemBlocks();
23218        stream = gen_FILE_ptr(n_stream, 0);
23219        uri = gen_xmlURIPtr(n_uri, 1);
23220
23221        xmlPrintURI(stream, uri);
23222        call_tests++;
23223        des_FILE_ptr(n_stream, stream, 0);
23224        des_xmlURIPtr(n_uri, uri, 1);
23225        xmlResetLastError();
23226        if (mem_base != xmlMemBlocks()) {
23227            printf("Leak of %d blocks found in xmlPrintURI",
23228	           xmlMemBlocks() - mem_base);
23229	    test_ret++;
23230            printf(" %d", n_stream);
23231            printf(" %d", n_uri);
23232            printf("\n");
23233        }
23234    }
23235    }
23236    function_tests++;
23237
23238    return(test_ret);
23239}
23240
23241
23242static int
23243test_xmlSaveUri(void) {
23244    int test_ret = 0;
23245
23246    int mem_base;
23247    xmlChar * ret_val;
23248    xmlURIPtr uri; /* pointer to an xmlURI */
23249    int n_uri;
23250
23251    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
23252        mem_base = xmlMemBlocks();
23253        uri = gen_xmlURIPtr(n_uri, 0);
23254
23255        ret_val = xmlSaveUri(uri);
23256        desret_xmlChar_ptr(ret_val);
23257        call_tests++;
23258        des_xmlURIPtr(n_uri, uri, 0);
23259        xmlResetLastError();
23260        if (mem_base != xmlMemBlocks()) {
23261            printf("Leak of %d blocks found in xmlSaveUri",
23262	           xmlMemBlocks() - mem_base);
23263	    test_ret++;
23264            printf(" %d", n_uri);
23265            printf("\n");
23266        }
23267    }
23268    function_tests++;
23269
23270    return(test_ret);
23271}
23272
23273
23274static int
23275test_xmlURIEscape(void) {
23276    int test_ret = 0;
23277
23278    int mem_base;
23279    xmlChar * ret_val;
23280    xmlChar * str; /* the string of the URI to escape */
23281    int n_str;
23282
23283    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23284        mem_base = xmlMemBlocks();
23285        str = gen_const_xmlChar_ptr(n_str, 0);
23286
23287        ret_val = xmlURIEscape((const xmlChar *)str);
23288        desret_xmlChar_ptr(ret_val);
23289        call_tests++;
23290        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23291        xmlResetLastError();
23292        if (mem_base != xmlMemBlocks()) {
23293            printf("Leak of %d blocks found in xmlURIEscape",
23294	           xmlMemBlocks() - mem_base);
23295	    test_ret++;
23296            printf(" %d", n_str);
23297            printf("\n");
23298        }
23299    }
23300    function_tests++;
23301
23302    return(test_ret);
23303}
23304
23305
23306static int
23307test_xmlURIEscapeStr(void) {
23308    int test_ret = 0;
23309
23310    int mem_base;
23311    xmlChar * ret_val;
23312    xmlChar * str; /* string to escape */
23313    int n_str;
23314    xmlChar * list; /* exception list string of chars not to escape */
23315    int n_list;
23316
23317    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
23318    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
23319        mem_base = xmlMemBlocks();
23320        str = gen_const_xmlChar_ptr(n_str, 0);
23321        list = gen_const_xmlChar_ptr(n_list, 1);
23322
23323        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
23324        desret_xmlChar_ptr(ret_val);
23325        call_tests++;
23326        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
23327        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
23328        xmlResetLastError();
23329        if (mem_base != xmlMemBlocks()) {
23330            printf("Leak of %d blocks found in xmlURIEscapeStr",
23331	           xmlMemBlocks() - mem_base);
23332	    test_ret++;
23333            printf(" %d", n_str);
23334            printf(" %d", n_list);
23335            printf("\n");
23336        }
23337    }
23338    }
23339    function_tests++;
23340
23341    return(test_ret);
23342}
23343
23344
23345static int
23346test_xmlURIUnescapeString(void) {
23347    int test_ret = 0;
23348
23349
23350    /* missing type support */
23351    return(test_ret);
23352}
23353
23354static int
23355test_uri(void) {
23356    int test_ret = 0;
23357
23358    if (quiet == 0) printf("Testing uri : 9 of 13 functions ...\n");
23359    test_ret += test_xmlBuildRelativeURI();
23360    test_ret += test_xmlBuildURI();
23361    test_ret += test_xmlCanonicPath();
23362    test_ret += test_xmlCreateURI();
23363    test_ret += test_xmlNormalizeURIPath();
23364    test_ret += test_xmlParseURI();
23365    test_ret += test_xmlParseURIReference();
23366    test_ret += test_xmlPrintURI();
23367    test_ret += test_xmlSaveUri();
23368    test_ret += test_xmlURIEscape();
23369    test_ret += test_xmlURIEscapeStr();
23370    test_ret += test_xmlURIUnescapeString();
23371
23372    if (test_ret != 0)
23373	printf("Module uri: %d errors\n", test_ret);
23374    return(test_ret);
23375}
23376
23377static int
23378test_xmlAddAttributeDecl(void) {
23379    int test_ret = 0;
23380
23381    int mem_base;
23382    xmlAttributePtr ret_val;
23383    xmlValidCtxtPtr ctxt; /* the validation context */
23384    int n_ctxt;
23385    xmlDtdPtr dtd; /* pointer to the DTD */
23386    int n_dtd;
23387    xmlChar * elem; /* the element name */
23388    int n_elem;
23389    xmlChar * name; /* the attribute name */
23390    int n_name;
23391    xmlChar * ns; /* the attribute namespace prefix */
23392    int n_ns;
23393    xmlAttributeType type; /* the attribute type */
23394    int n_type;
23395    xmlAttributeDefault def; /* the attribute default type */
23396    int n_def;
23397    xmlChar * defaultValue; /* the attribute default value */
23398    int n_defaultValue;
23399    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
23400    int n_tree;
23401
23402    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23403    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23404    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23405    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23406    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
23407    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
23408    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
23409    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
23410    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
23411        mem_base = xmlMemBlocks();
23412        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23413        dtd = gen_xmlDtdPtr(n_dtd, 1);
23414        elem = gen_const_xmlChar_ptr(n_elem, 2);
23415        name = gen_const_xmlChar_ptr(n_name, 3);
23416        ns = gen_const_xmlChar_ptr(n_ns, 4);
23417        type = gen_xmlAttributeType(n_type, 5);
23418        def = gen_xmlAttributeDefault(n_def, 6);
23419        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
23420        tree = gen_xmlEnumerationPtr(n_tree, 8);
23421
23422        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
23423        desret_xmlAttributePtr(ret_val);
23424        call_tests++;
23425        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23426        des_xmlDtdPtr(n_dtd, dtd, 1);
23427        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
23428        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
23429        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
23430        des_xmlAttributeType(n_type, type, 5);
23431        des_xmlAttributeDefault(n_def, def, 6);
23432        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
23433        des_xmlEnumerationPtr(n_tree, tree, 8);
23434        xmlResetLastError();
23435        if (mem_base != xmlMemBlocks()) {
23436            printf("Leak of %d blocks found in xmlAddAttributeDecl",
23437	           xmlMemBlocks() - mem_base);
23438	    test_ret++;
23439            printf(" %d", n_ctxt);
23440            printf(" %d", n_dtd);
23441            printf(" %d", n_elem);
23442            printf(" %d", n_name);
23443            printf(" %d", n_ns);
23444            printf(" %d", n_type);
23445            printf(" %d", n_def);
23446            printf(" %d", n_defaultValue);
23447            printf(" %d", n_tree);
23448            printf("\n");
23449        }
23450    }
23451    }
23452    }
23453    }
23454    }
23455    }
23456    }
23457    }
23458    }
23459    function_tests++;
23460
23461    return(test_ret);
23462}
23463
23464
23465static int
23466test_xmlAddElementDecl(void) {
23467    int test_ret = 0;
23468
23469    int mem_base;
23470    xmlElementPtr ret_val;
23471    xmlValidCtxtPtr ctxt; /* the validation context */
23472    int n_ctxt;
23473    xmlDtdPtr dtd; /* pointer to the DTD */
23474    int n_dtd;
23475    xmlChar * name; /* the entity name */
23476    int n_name;
23477    xmlElementTypeVal type; /* the element type */
23478    int n_type;
23479    xmlElementContentPtr content; /* the element content tree or NULL */
23480    int n_content;
23481
23482    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
23483    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23484    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23485    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
23486    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
23487        mem_base = xmlMemBlocks();
23488        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
23489        dtd = gen_xmlDtdPtr(n_dtd, 1);
23490        name = gen_const_xmlChar_ptr(n_name, 2);
23491        type = gen_xmlElementTypeVal(n_type, 3);
23492        content = gen_xmlElementContentPtr(n_content, 4);
23493
23494        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
23495        desret_xmlElementPtr(ret_val);
23496        call_tests++;
23497        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
23498        des_xmlDtdPtr(n_dtd, dtd, 1);
23499        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23500        des_xmlElementTypeVal(n_type, type, 3);
23501        des_xmlElementContentPtr(n_content, content, 4);
23502        xmlResetLastError();
23503        if (mem_base != xmlMemBlocks()) {
23504            printf("Leak of %d blocks found in xmlAddElementDecl",
23505	           xmlMemBlocks() - mem_base);
23506	    test_ret++;
23507            printf(" %d", n_ctxt);
23508            printf(" %d", n_dtd);
23509            printf(" %d", n_name);
23510            printf(" %d", n_type);
23511            printf(" %d", n_content);
23512            printf("\n");
23513        }
23514    }
23515    }
23516    }
23517    }
23518    }
23519    function_tests++;
23520
23521    return(test_ret);
23522}
23523
23524
23525static int
23526test_xmlAddID(void) {
23527    int test_ret = 0;
23528
23529
23530    /* missing type support */
23531    return(test_ret);
23532}
23533
23534
23535static int
23536test_xmlAddNotationDecl(void) {
23537    int test_ret = 0;
23538
23539
23540    /* missing type support */
23541    return(test_ret);
23542}
23543
23544
23545static int
23546test_xmlAddRef(void) {
23547    int test_ret = 0;
23548
23549
23550    /* missing type support */
23551    return(test_ret);
23552}
23553
23554
23555#define gen_nb_xmlAttributeTablePtr 1
23556static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23557    return(NULL);
23558}
23559static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23560}
23561
23562static int
23563test_xmlCopyAttributeTable(void) {
23564    int test_ret = 0;
23565
23566
23567    /* missing type support */
23568    return(test_ret);
23569}
23570
23571
23572static int
23573test_xmlCopyElementContent(void) {
23574    int test_ret = 0;
23575
23576    int mem_base;
23577    xmlElementContentPtr ret_val;
23578    xmlElementContentPtr cur; /* An element content pointer. */
23579    int n_cur;
23580
23581    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
23582        mem_base = xmlMemBlocks();
23583        cur = gen_xmlElementContentPtr(n_cur, 0);
23584
23585        ret_val = xmlCopyElementContent(cur);
23586        desret_xmlElementContentPtr(ret_val);
23587        call_tests++;
23588        des_xmlElementContentPtr(n_cur, cur, 0);
23589        xmlResetLastError();
23590        if (mem_base != xmlMemBlocks()) {
23591            printf("Leak of %d blocks found in xmlCopyElementContent",
23592	           xmlMemBlocks() - mem_base);
23593	    test_ret++;
23594            printf(" %d", n_cur);
23595            printf("\n");
23596        }
23597    }
23598    function_tests++;
23599
23600    return(test_ret);
23601}
23602
23603
23604#define gen_nb_xmlElementTablePtr 1
23605static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23606    return(NULL);
23607}
23608static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23609}
23610
23611static int
23612test_xmlCopyElementTable(void) {
23613    int test_ret = 0;
23614
23615
23616    /* missing type support */
23617    return(test_ret);
23618}
23619
23620
23621static int
23622test_xmlCopyEnumeration(void) {
23623    int test_ret = 0;
23624
23625
23626    /* missing type support */
23627    return(test_ret);
23628}
23629
23630
23631#define gen_nb_xmlNotationTablePtr 1
23632static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23633    return(NULL);
23634}
23635static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23636}
23637
23638static int
23639test_xmlCopyNotationTable(void) {
23640    int test_ret = 0;
23641
23642
23643    /* missing type support */
23644    return(test_ret);
23645}
23646
23647
23648static int
23649test_xmlCreateEnumeration(void) {
23650    int test_ret = 0;
23651
23652
23653    /* missing type support */
23654    return(test_ret);
23655}
23656
23657
23658#define gen_nb_xmlAttributePtr 1
23659static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23660    return(NULL);
23661}
23662static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23663}
23664
23665static int
23666test_xmlDumpAttributeDecl(void) {
23667    int test_ret = 0;
23668
23669#ifdef LIBXML_OUTPUT_ENABLED
23670    int mem_base;
23671    xmlBufferPtr buf; /* the XML buffer output */
23672    int n_buf;
23673    xmlAttributePtr attr; /* An attribute declaration */
23674    int n_attr;
23675
23676    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23677    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
23678        mem_base = xmlMemBlocks();
23679        buf = gen_xmlBufferPtr(n_buf, 0);
23680        attr = gen_xmlAttributePtr(n_attr, 1);
23681
23682        xmlDumpAttributeDecl(buf, attr);
23683        call_tests++;
23684        des_xmlBufferPtr(n_buf, buf, 0);
23685        des_xmlAttributePtr(n_attr, attr, 1);
23686        xmlResetLastError();
23687        if (mem_base != xmlMemBlocks()) {
23688            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
23689	           xmlMemBlocks() - mem_base);
23690	    test_ret++;
23691            printf(" %d", n_buf);
23692            printf(" %d", n_attr);
23693            printf("\n");
23694        }
23695    }
23696    }
23697    function_tests++;
23698#endif
23699
23700    return(test_ret);
23701}
23702
23703
23704static int
23705test_xmlDumpAttributeTable(void) {
23706    int test_ret = 0;
23707
23708#ifdef LIBXML_OUTPUT_ENABLED
23709    int mem_base;
23710    xmlBufferPtr buf; /* the XML buffer output */
23711    int n_buf;
23712    xmlAttributeTablePtr table; /* An attribute table */
23713    int n_table;
23714
23715    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23716    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
23717        mem_base = xmlMemBlocks();
23718        buf = gen_xmlBufferPtr(n_buf, 0);
23719        table = gen_xmlAttributeTablePtr(n_table, 1);
23720
23721        xmlDumpAttributeTable(buf, table);
23722        call_tests++;
23723        des_xmlBufferPtr(n_buf, buf, 0);
23724        des_xmlAttributeTablePtr(n_table, table, 1);
23725        xmlResetLastError();
23726        if (mem_base != xmlMemBlocks()) {
23727            printf("Leak of %d blocks found in xmlDumpAttributeTable",
23728	           xmlMemBlocks() - mem_base);
23729	    test_ret++;
23730            printf(" %d", n_buf);
23731            printf(" %d", n_table);
23732            printf("\n");
23733        }
23734    }
23735    }
23736    function_tests++;
23737#endif
23738
23739    return(test_ret);
23740}
23741
23742
23743#define gen_nb_xmlElementPtr 1
23744static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23745    return(NULL);
23746}
23747static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23748}
23749
23750static int
23751test_xmlDumpElementDecl(void) {
23752    int test_ret = 0;
23753
23754#ifdef LIBXML_OUTPUT_ENABLED
23755    int mem_base;
23756    xmlBufferPtr buf; /* the XML buffer output */
23757    int n_buf;
23758    xmlElementPtr elem; /* An element table */
23759    int n_elem;
23760
23761    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23762    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
23763        mem_base = xmlMemBlocks();
23764        buf = gen_xmlBufferPtr(n_buf, 0);
23765        elem = gen_xmlElementPtr(n_elem, 1);
23766
23767        xmlDumpElementDecl(buf, elem);
23768        call_tests++;
23769        des_xmlBufferPtr(n_buf, buf, 0);
23770        des_xmlElementPtr(n_elem, elem, 1);
23771        xmlResetLastError();
23772        if (mem_base != xmlMemBlocks()) {
23773            printf("Leak of %d blocks found in xmlDumpElementDecl",
23774	           xmlMemBlocks() - mem_base);
23775	    test_ret++;
23776            printf(" %d", n_buf);
23777            printf(" %d", n_elem);
23778            printf("\n");
23779        }
23780    }
23781    }
23782    function_tests++;
23783#endif
23784
23785    return(test_ret);
23786}
23787
23788
23789static int
23790test_xmlDumpElementTable(void) {
23791    int test_ret = 0;
23792
23793#ifdef LIBXML_OUTPUT_ENABLED
23794    int mem_base;
23795    xmlBufferPtr buf; /* the XML buffer output */
23796    int n_buf;
23797    xmlElementTablePtr table; /* An element table */
23798    int n_table;
23799
23800    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23801    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
23802        mem_base = xmlMemBlocks();
23803        buf = gen_xmlBufferPtr(n_buf, 0);
23804        table = gen_xmlElementTablePtr(n_table, 1);
23805
23806        xmlDumpElementTable(buf, table);
23807        call_tests++;
23808        des_xmlBufferPtr(n_buf, buf, 0);
23809        des_xmlElementTablePtr(n_table, table, 1);
23810        xmlResetLastError();
23811        if (mem_base != xmlMemBlocks()) {
23812            printf("Leak of %d blocks found in xmlDumpElementTable",
23813	           xmlMemBlocks() - mem_base);
23814	    test_ret++;
23815            printf(" %d", n_buf);
23816            printf(" %d", n_table);
23817            printf("\n");
23818        }
23819    }
23820    }
23821    function_tests++;
23822#endif
23823
23824    return(test_ret);
23825}
23826
23827
23828#define gen_nb_xmlNotationPtr 1
23829static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23830    return(NULL);
23831}
23832static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
23833}
23834
23835static int
23836test_xmlDumpNotationDecl(void) {
23837    int test_ret = 0;
23838
23839#ifdef LIBXML_OUTPUT_ENABLED
23840    int mem_base;
23841    xmlBufferPtr buf; /* the XML buffer output */
23842    int n_buf;
23843    xmlNotationPtr nota; /* A notation declaration */
23844    int n_nota;
23845
23846    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23847    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
23848        mem_base = xmlMemBlocks();
23849        buf = gen_xmlBufferPtr(n_buf, 0);
23850        nota = gen_xmlNotationPtr(n_nota, 1);
23851
23852        xmlDumpNotationDecl(buf, nota);
23853        call_tests++;
23854        des_xmlBufferPtr(n_buf, buf, 0);
23855        des_xmlNotationPtr(n_nota, nota, 1);
23856        xmlResetLastError();
23857        if (mem_base != xmlMemBlocks()) {
23858            printf("Leak of %d blocks found in xmlDumpNotationDecl",
23859	           xmlMemBlocks() - mem_base);
23860	    test_ret++;
23861            printf(" %d", n_buf);
23862            printf(" %d", n_nota);
23863            printf("\n");
23864        }
23865    }
23866    }
23867    function_tests++;
23868#endif
23869
23870    return(test_ret);
23871}
23872
23873
23874static int
23875test_xmlDumpNotationTable(void) {
23876    int test_ret = 0;
23877
23878#ifdef LIBXML_OUTPUT_ENABLED
23879    int mem_base;
23880    xmlBufferPtr buf; /* the XML buffer output */
23881    int n_buf;
23882    xmlNotationTablePtr table; /* A notation table */
23883    int n_table;
23884
23885    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
23886    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
23887        mem_base = xmlMemBlocks();
23888        buf = gen_xmlBufferPtr(n_buf, 0);
23889        table = gen_xmlNotationTablePtr(n_table, 1);
23890
23891        xmlDumpNotationTable(buf, table);
23892        call_tests++;
23893        des_xmlBufferPtr(n_buf, buf, 0);
23894        des_xmlNotationTablePtr(n_table, table, 1);
23895        xmlResetLastError();
23896        if (mem_base != xmlMemBlocks()) {
23897            printf("Leak of %d blocks found in xmlDumpNotationTable",
23898	           xmlMemBlocks() - mem_base);
23899	    test_ret++;
23900            printf(" %d", n_buf);
23901            printf(" %d", n_table);
23902            printf("\n");
23903        }
23904    }
23905    }
23906    function_tests++;
23907#endif
23908
23909    return(test_ret);
23910}
23911
23912
23913static int
23914test_xmlGetDtdAttrDesc(void) {
23915    int test_ret = 0;
23916
23917    int mem_base;
23918    xmlAttributePtr ret_val;
23919    xmlDtdPtr dtd; /* a pointer to the DtD to search */
23920    int n_dtd;
23921    xmlChar * elem; /* the element name */
23922    int n_elem;
23923    xmlChar * name; /* the attribute name */
23924    int n_name;
23925
23926    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23927    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
23928    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23929        mem_base = xmlMemBlocks();
23930        dtd = gen_xmlDtdPtr(n_dtd, 0);
23931        elem = gen_const_xmlChar_ptr(n_elem, 1);
23932        name = gen_const_xmlChar_ptr(n_name, 2);
23933
23934        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
23935        desret_xmlAttributePtr(ret_val);
23936        call_tests++;
23937        des_xmlDtdPtr(n_dtd, dtd, 0);
23938        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
23939        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23940        xmlResetLastError();
23941        if (mem_base != xmlMemBlocks()) {
23942            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
23943	           xmlMemBlocks() - mem_base);
23944	    test_ret++;
23945            printf(" %d", n_dtd);
23946            printf(" %d", n_elem);
23947            printf(" %d", n_name);
23948            printf("\n");
23949        }
23950    }
23951    }
23952    }
23953    function_tests++;
23954
23955    return(test_ret);
23956}
23957
23958
23959static int
23960test_xmlGetDtdElementDesc(void) {
23961    int test_ret = 0;
23962
23963    int mem_base;
23964    xmlElementPtr ret_val;
23965    xmlDtdPtr dtd; /* a pointer to the DtD to search */
23966    int n_dtd;
23967    xmlChar * name; /* the element name */
23968    int n_name;
23969
23970    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
23971    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23972        mem_base = xmlMemBlocks();
23973        dtd = gen_xmlDtdPtr(n_dtd, 0);
23974        name = gen_const_xmlChar_ptr(n_name, 1);
23975
23976        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
23977        desret_xmlElementPtr(ret_val);
23978        call_tests++;
23979        des_xmlDtdPtr(n_dtd, dtd, 0);
23980        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23981        xmlResetLastError();
23982        if (mem_base != xmlMemBlocks()) {
23983            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
23984	           xmlMemBlocks() - mem_base);
23985	    test_ret++;
23986            printf(" %d", n_dtd);
23987            printf(" %d", n_name);
23988            printf("\n");
23989        }
23990    }
23991    }
23992    function_tests++;
23993
23994    return(test_ret);
23995}
23996
23997
23998static int
23999test_xmlGetDtdNotationDesc(void) {
24000    int test_ret = 0;
24001
24002
24003    /* missing type support */
24004    return(test_ret);
24005}
24006
24007
24008static int
24009test_xmlGetDtdQAttrDesc(void) {
24010    int test_ret = 0;
24011
24012    int mem_base;
24013    xmlAttributePtr ret_val;
24014    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24015    int n_dtd;
24016    xmlChar * elem; /* the element name */
24017    int n_elem;
24018    xmlChar * name; /* the attribute name */
24019    int n_name;
24020    xmlChar * prefix; /* the attribute namespace prefix */
24021    int n_prefix;
24022
24023    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24024    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24025    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24026    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24027        mem_base = xmlMemBlocks();
24028        dtd = gen_xmlDtdPtr(n_dtd, 0);
24029        elem = gen_const_xmlChar_ptr(n_elem, 1);
24030        name = gen_const_xmlChar_ptr(n_name, 2);
24031        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
24032
24033        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
24034        desret_xmlAttributePtr(ret_val);
24035        call_tests++;
24036        des_xmlDtdPtr(n_dtd, dtd, 0);
24037        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24038        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24039        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
24040        xmlResetLastError();
24041        if (mem_base != xmlMemBlocks()) {
24042            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
24043	           xmlMemBlocks() - mem_base);
24044	    test_ret++;
24045            printf(" %d", n_dtd);
24046            printf(" %d", n_elem);
24047            printf(" %d", n_name);
24048            printf(" %d", n_prefix);
24049            printf("\n");
24050        }
24051    }
24052    }
24053    }
24054    }
24055    function_tests++;
24056
24057    return(test_ret);
24058}
24059
24060
24061static int
24062test_xmlGetDtdQElementDesc(void) {
24063    int test_ret = 0;
24064
24065    int mem_base;
24066    xmlElementPtr ret_val;
24067    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24068    int n_dtd;
24069    xmlChar * name; /* the element name */
24070    int n_name;
24071    xmlChar * prefix; /* the element namespace prefix */
24072    int n_prefix;
24073
24074    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24075    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24076    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
24077        mem_base = xmlMemBlocks();
24078        dtd = gen_xmlDtdPtr(n_dtd, 0);
24079        name = gen_const_xmlChar_ptr(n_name, 1);
24080        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
24081
24082        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
24083        desret_xmlElementPtr(ret_val);
24084        call_tests++;
24085        des_xmlDtdPtr(n_dtd, dtd, 0);
24086        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24087        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
24088        xmlResetLastError();
24089        if (mem_base != xmlMemBlocks()) {
24090            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
24091	           xmlMemBlocks() - mem_base);
24092	    test_ret++;
24093            printf(" %d", n_dtd);
24094            printf(" %d", n_name);
24095            printf(" %d", n_prefix);
24096            printf("\n");
24097        }
24098    }
24099    }
24100    }
24101    function_tests++;
24102
24103    return(test_ret);
24104}
24105
24106
24107static int
24108test_xmlGetID(void) {
24109    int test_ret = 0;
24110
24111    int mem_base;
24112    xmlAttrPtr ret_val;
24113    xmlDocPtr doc; /* pointer to the document */
24114    int n_doc;
24115    xmlChar * ID; /* the ID value */
24116    int n_ID;
24117
24118    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24119    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
24120        mem_base = xmlMemBlocks();
24121        doc = gen_xmlDocPtr(n_doc, 0);
24122        ID = gen_const_xmlChar_ptr(n_ID, 1);
24123
24124        ret_val = xmlGetID(doc, (const xmlChar *)ID);
24125        desret_xmlAttrPtr(ret_val);
24126        call_tests++;
24127        des_xmlDocPtr(n_doc, doc, 0);
24128        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
24129        xmlResetLastError();
24130        if (mem_base != xmlMemBlocks()) {
24131            printf("Leak of %d blocks found in xmlGetID",
24132	           xmlMemBlocks() - mem_base);
24133	    test_ret++;
24134            printf(" %d", n_doc);
24135            printf(" %d", n_ID);
24136            printf("\n");
24137        }
24138    }
24139    }
24140    function_tests++;
24141
24142    return(test_ret);
24143}
24144
24145
24146static int
24147test_xmlGetRefs(void) {
24148    int test_ret = 0;
24149
24150
24151    /* missing type support */
24152    return(test_ret);
24153}
24154
24155
24156static int
24157test_xmlIsID(void) {
24158    int test_ret = 0;
24159
24160    int mem_base;
24161    int ret_val;
24162    xmlDocPtr doc; /* the document */
24163    int n_doc;
24164    xmlNodePtr elem; /* the element carrying the attribute */
24165    int n_elem;
24166    xmlAttrPtr attr; /* the attribute */
24167    int n_attr;
24168
24169    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24170    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24171    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24172        mem_base = xmlMemBlocks();
24173        doc = gen_xmlDocPtr(n_doc, 0);
24174        elem = gen_xmlNodePtr(n_elem, 1);
24175        attr = gen_xmlAttrPtr(n_attr, 2);
24176
24177        ret_val = xmlIsID(doc, elem, attr);
24178        desret_int(ret_val);
24179        call_tests++;
24180        des_xmlDocPtr(n_doc, doc, 0);
24181        des_xmlNodePtr(n_elem, elem, 1);
24182        des_xmlAttrPtr(n_attr, attr, 2);
24183        xmlResetLastError();
24184        if (mem_base != xmlMemBlocks()) {
24185            printf("Leak of %d blocks found in xmlIsID",
24186	           xmlMemBlocks() - mem_base);
24187	    test_ret++;
24188            printf(" %d", n_doc);
24189            printf(" %d", n_elem);
24190            printf(" %d", n_attr);
24191            printf("\n");
24192        }
24193    }
24194    }
24195    }
24196    function_tests++;
24197
24198    return(test_ret);
24199}
24200
24201
24202static int
24203test_xmlIsMixedElement(void) {
24204    int test_ret = 0;
24205
24206    int mem_base;
24207    int ret_val;
24208    xmlDocPtr doc; /* the document */
24209    int n_doc;
24210    xmlChar * name; /* the element name */
24211    int n_name;
24212
24213    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24214    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24215        mem_base = xmlMemBlocks();
24216        doc = gen_xmlDocPtr(n_doc, 0);
24217        name = gen_const_xmlChar_ptr(n_name, 1);
24218
24219        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
24220        desret_int(ret_val);
24221        call_tests++;
24222        des_xmlDocPtr(n_doc, doc, 0);
24223        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24224        xmlResetLastError();
24225        if (mem_base != xmlMemBlocks()) {
24226            printf("Leak of %d blocks found in xmlIsMixedElement",
24227	           xmlMemBlocks() - mem_base);
24228	    test_ret++;
24229            printf(" %d", n_doc);
24230            printf(" %d", n_name);
24231            printf("\n");
24232        }
24233    }
24234    }
24235    function_tests++;
24236
24237    return(test_ret);
24238}
24239
24240
24241static int
24242test_xmlIsRef(void) {
24243    int test_ret = 0;
24244
24245    int mem_base;
24246    int ret_val;
24247    xmlDocPtr doc; /* the document */
24248    int n_doc;
24249    xmlNodePtr elem; /* the element carrying the attribute */
24250    int n_elem;
24251    xmlAttrPtr attr; /* the attribute */
24252    int n_attr;
24253
24254    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24255    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24256    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24257        mem_base = xmlMemBlocks();
24258        doc = gen_xmlDocPtr(n_doc, 0);
24259        elem = gen_xmlNodePtr(n_elem, 1);
24260        attr = gen_xmlAttrPtr(n_attr, 2);
24261
24262        ret_val = xmlIsRef(doc, elem, attr);
24263        desret_int(ret_val);
24264        call_tests++;
24265        des_xmlDocPtr(n_doc, doc, 0);
24266        des_xmlNodePtr(n_elem, elem, 1);
24267        des_xmlAttrPtr(n_attr, attr, 2);
24268        xmlResetLastError();
24269        if (mem_base != xmlMemBlocks()) {
24270            printf("Leak of %d blocks found in xmlIsRef",
24271	           xmlMemBlocks() - mem_base);
24272	    test_ret++;
24273            printf(" %d", n_doc);
24274            printf(" %d", n_elem);
24275            printf(" %d", n_attr);
24276            printf("\n");
24277        }
24278    }
24279    }
24280    }
24281    function_tests++;
24282
24283    return(test_ret);
24284}
24285
24286
24287static int
24288test_xmlNewElementContent(void) {
24289    int test_ret = 0;
24290
24291    int mem_base;
24292    xmlElementContentPtr ret_val;
24293    xmlChar * name; /* the subelement name or NULL */
24294    int n_name;
24295    xmlElementContentType type; /* the type of element content decl */
24296    int n_type;
24297
24298    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24299    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
24300        mem_base = xmlMemBlocks();
24301        name = gen_const_xmlChar_ptr(n_name, 0);
24302        type = gen_xmlElementContentType(n_type, 1);
24303
24304        ret_val = xmlNewElementContent((const xmlChar *)name, type);
24305        desret_xmlElementContentPtr(ret_val);
24306        call_tests++;
24307        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
24308        des_xmlElementContentType(n_type, type, 1);
24309        xmlResetLastError();
24310        if (mem_base != xmlMemBlocks()) {
24311            printf("Leak of %d blocks found in xmlNewElementContent",
24312	           xmlMemBlocks() - mem_base);
24313	    test_ret++;
24314            printf(" %d", n_name);
24315            printf(" %d", n_type);
24316            printf("\n");
24317        }
24318    }
24319    }
24320    function_tests++;
24321
24322    return(test_ret);
24323}
24324
24325
24326static int
24327test_xmlNewValidCtxt(void) {
24328    int test_ret = 0;
24329
24330
24331    /* missing type support */
24332    return(test_ret);
24333}
24334
24335
24336static int
24337test_xmlRemoveID(void) {
24338    int test_ret = 0;
24339
24340    int mem_base;
24341    int ret_val;
24342    xmlDocPtr doc; /* the document */
24343    int n_doc;
24344    xmlAttrPtr attr; /* the attribute */
24345    int n_attr;
24346
24347    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24348    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24349        mem_base = xmlMemBlocks();
24350        doc = gen_xmlDocPtr(n_doc, 0);
24351        attr = gen_xmlAttrPtr(n_attr, 1);
24352
24353        ret_val = xmlRemoveID(doc, attr);
24354        desret_int(ret_val);
24355        call_tests++;
24356        des_xmlDocPtr(n_doc, doc, 0);
24357        des_xmlAttrPtr(n_attr, attr, 1);
24358        xmlResetLastError();
24359        if (mem_base != xmlMemBlocks()) {
24360            printf("Leak of %d blocks found in xmlRemoveID",
24361	           xmlMemBlocks() - mem_base);
24362	    test_ret++;
24363            printf(" %d", n_doc);
24364            printf(" %d", n_attr);
24365            printf("\n");
24366        }
24367    }
24368    }
24369    function_tests++;
24370
24371    return(test_ret);
24372}
24373
24374
24375static int
24376test_xmlRemoveRef(void) {
24377    int test_ret = 0;
24378
24379    int mem_base;
24380    int ret_val;
24381    xmlDocPtr doc; /* the document */
24382    int n_doc;
24383    xmlAttrPtr attr; /* the attribute */
24384    int n_attr;
24385
24386    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24387    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
24388        mem_base = xmlMemBlocks();
24389        doc = gen_xmlDocPtr(n_doc, 0);
24390        attr = gen_xmlAttrPtr(n_attr, 1);
24391
24392        ret_val = xmlRemoveRef(doc, attr);
24393        desret_int(ret_val);
24394        call_tests++;
24395        des_xmlDocPtr(n_doc, doc, 0);
24396        des_xmlAttrPtr(n_attr, attr, 1);
24397        xmlResetLastError();
24398        if (mem_base != xmlMemBlocks()) {
24399            printf("Leak of %d blocks found in xmlRemoveRef",
24400	           xmlMemBlocks() - mem_base);
24401	    test_ret++;
24402            printf(" %d", n_doc);
24403            printf(" %d", n_attr);
24404            printf("\n");
24405        }
24406    }
24407    }
24408    function_tests++;
24409
24410    return(test_ret);
24411}
24412
24413
24414static int
24415test_xmlSnprintfElementContent(void) {
24416    int test_ret = 0;
24417
24418    int mem_base;
24419    char * buf; /* an output buffer */
24420    int n_buf;
24421    int size; /* the buffer size */
24422    int n_size;
24423    xmlElementContentPtr content; /* An element table */
24424    int n_content;
24425    int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24426    int n_glob;
24427
24428    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24429    for (n_size = 0;n_size < gen_nb_int;n_size++) {
24430    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24431    for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24432        mem_base = xmlMemBlocks();
24433        buf = gen_char_ptr(n_buf, 0);
24434        size = gen_int(n_size, 1);
24435        content = gen_xmlElementContentPtr(n_content, 2);
24436        glob = gen_int(n_glob, 3);
24437
24438        xmlSnprintfElementContent(buf, size, content, glob);
24439        call_tests++;
24440        des_char_ptr(n_buf, buf, 0);
24441        des_int(n_size, size, 1);
24442        des_xmlElementContentPtr(n_content, content, 2);
24443        des_int(n_glob, glob, 3);
24444        xmlResetLastError();
24445        if (mem_base != xmlMemBlocks()) {
24446            printf("Leak of %d blocks found in xmlSnprintfElementContent",
24447	           xmlMemBlocks() - mem_base);
24448	    test_ret++;
24449            printf(" %d", n_buf);
24450            printf(" %d", n_size);
24451            printf(" %d", n_content);
24452            printf(" %d", n_glob);
24453            printf("\n");
24454        }
24455    }
24456    }
24457    }
24458    }
24459    function_tests++;
24460
24461    return(test_ret);
24462}
24463
24464
24465static int
24466test_xmlSprintfElementContent(void) {
24467    int test_ret = 0;
24468
24469#ifdef LIBXML_OUTPUT_ENABLED
24470    int mem_base;
24471    char * buf; /* an output buffer */
24472    int n_buf;
24473    xmlElementContentPtr content; /* An element table */
24474    int n_content;
24475    int glob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
24476    int n_glob;
24477
24478    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
24479    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24480    for (n_glob = 0;n_glob < gen_nb_int;n_glob++) {
24481        mem_base = xmlMemBlocks();
24482        buf = gen_char_ptr(n_buf, 0);
24483        content = gen_xmlElementContentPtr(n_content, 1);
24484        glob = gen_int(n_glob, 2);
24485
24486        xmlSprintfElementContent(buf, content, glob);
24487        call_tests++;
24488        des_char_ptr(n_buf, buf, 0);
24489        des_xmlElementContentPtr(n_content, content, 1);
24490        des_int(n_glob, glob, 2);
24491        xmlResetLastError();
24492        if (mem_base != xmlMemBlocks()) {
24493            printf("Leak of %d blocks found in xmlSprintfElementContent",
24494	           xmlMemBlocks() - mem_base);
24495	    test_ret++;
24496            printf(" %d", n_buf);
24497            printf(" %d", n_content);
24498            printf(" %d", n_glob);
24499            printf("\n");
24500        }
24501    }
24502    }
24503    }
24504    function_tests++;
24505#endif
24506
24507    return(test_ret);
24508}
24509
24510
24511static int
24512test_xmlValidBuildContentModel(void) {
24513    int test_ret = 0;
24514
24515#ifdef LIBXML_REGEXP_ENABLED
24516    int mem_base;
24517    int ret_val;
24518    xmlValidCtxtPtr ctxt; /* a validation context */
24519    int n_ctxt;
24520    xmlElementPtr elem; /* an element declaration node */
24521    int n_elem;
24522
24523    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24524    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24525        mem_base = xmlMemBlocks();
24526        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24527        elem = gen_xmlElementPtr(n_elem, 1);
24528
24529        ret_val = xmlValidBuildContentModel(ctxt, elem);
24530        desret_int(ret_val);
24531        call_tests++;
24532        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24533        des_xmlElementPtr(n_elem, elem, 1);
24534        xmlResetLastError();
24535        if (mem_base != xmlMemBlocks()) {
24536            printf("Leak of %d blocks found in xmlValidBuildContentModel",
24537	           xmlMemBlocks() - mem_base);
24538	    test_ret++;
24539            printf(" %d", n_ctxt);
24540            printf(" %d", n_elem);
24541            printf("\n");
24542        }
24543    }
24544    }
24545    function_tests++;
24546#endif
24547
24548    return(test_ret);
24549}
24550
24551
24552static int
24553test_xmlValidCtxtNormalizeAttributeValue(void) {
24554    int test_ret = 0;
24555
24556#ifdef LIBXML_VALID_ENABLED
24557    int mem_base;
24558    xmlChar * ret_val;
24559    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
24560    int n_ctxt;
24561    xmlDocPtr doc; /* the document */
24562    int n_doc;
24563    xmlNodePtr elem; /* the parent */
24564    int n_elem;
24565    xmlChar * name; /* the attribute name */
24566    int n_name;
24567    xmlChar * value; /* the attribute value */
24568    int n_value;
24569
24570    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24571    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24572    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24573    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24574    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24575        mem_base = xmlMemBlocks();
24576        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24577        doc = gen_xmlDocPtr(n_doc, 1);
24578        elem = gen_xmlNodePtr(n_elem, 2);
24579        name = gen_const_xmlChar_ptr(n_name, 3);
24580        value = gen_const_xmlChar_ptr(n_value, 4);
24581
24582        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
24583        desret_xmlChar_ptr(ret_val);
24584        call_tests++;
24585        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24586        des_xmlDocPtr(n_doc, doc, 1);
24587        des_xmlNodePtr(n_elem, elem, 2);
24588        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24589        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
24590        xmlResetLastError();
24591        if (mem_base != xmlMemBlocks()) {
24592            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
24593	           xmlMemBlocks() - mem_base);
24594	    test_ret++;
24595            printf(" %d", n_ctxt);
24596            printf(" %d", n_doc);
24597            printf(" %d", n_elem);
24598            printf(" %d", n_name);
24599            printf(" %d", n_value);
24600            printf("\n");
24601        }
24602    }
24603    }
24604    }
24605    }
24606    }
24607    function_tests++;
24608#endif
24609
24610    return(test_ret);
24611}
24612
24613
24614#define gen_nb_xmlElementContent_ptr 1
24615static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24616    return(NULL);
24617}
24618static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24619}
24620
24621static int
24622test_xmlValidGetPotentialChildren(void) {
24623    int test_ret = 0;
24624
24625#ifdef LIBXML_VALID_ENABLED
24626    int mem_base;
24627    int ret_val;
24628    xmlElementContent * ctree; /* an element content tree */
24629    int n_ctree;
24630    xmlChar ** list; /* an array to store the list of child names */
24631    int n_list;
24632    int * len; /* a pointer to the number of element in the list */
24633    int n_len;
24634    int max; /* the size of the array */
24635    int n_max;
24636
24637    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
24638    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) {
24639    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
24640    for (n_max = 0;n_max < gen_nb_int;n_max++) {
24641        mem_base = xmlMemBlocks();
24642        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
24643        list = gen_const_xmlChar_ptr_ptr(n_list, 1);
24644        len = gen_int_ptr(n_len, 2);
24645        max = gen_int(n_max, 3);
24646
24647        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)list, len, max);
24648        desret_int(ret_val);
24649        call_tests++;
24650        des_xmlElementContent_ptr(n_ctree, ctree, 0);
24651        des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 1);
24652        des_int_ptr(n_len, len, 2);
24653        des_int(n_max, max, 3);
24654        xmlResetLastError();
24655        if (mem_base != xmlMemBlocks()) {
24656            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
24657	           xmlMemBlocks() - mem_base);
24658	    test_ret++;
24659            printf(" %d", n_ctree);
24660            printf(" %d", n_list);
24661            printf(" %d", n_len);
24662            printf(" %d", n_max);
24663            printf("\n");
24664        }
24665    }
24666    }
24667    }
24668    }
24669    function_tests++;
24670#endif
24671
24672    return(test_ret);
24673}
24674
24675
24676static int
24677test_xmlValidGetValidElements(void) {
24678    int test_ret = 0;
24679
24680#ifdef LIBXML_VALID_ENABLED
24681    int mem_base;
24682    int ret_val;
24683    xmlNode * prev; /* an element to insert after */
24684    int n_prev;
24685    xmlNode * next; /* an element to insert next */
24686    int n_next;
24687    xmlChar ** names; /* an array to store the list of child names */
24688    int n_names;
24689    int max; /* the size of the array */
24690    int n_max;
24691
24692    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
24693    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
24694    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
24695    for (n_max = 0;n_max < gen_nb_int;n_max++) {
24696        mem_base = xmlMemBlocks();
24697        prev = gen_xmlNodePtr(n_prev, 0);
24698        next = gen_xmlNodePtr(n_next, 1);
24699        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
24700        max = gen_int(n_max, 3);
24701
24702        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
24703        desret_int(ret_val);
24704        call_tests++;
24705        des_xmlNodePtr(n_prev, prev, 0);
24706        des_xmlNodePtr(n_next, next, 1);
24707        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
24708        des_int(n_max, max, 3);
24709        xmlResetLastError();
24710        if (mem_base != xmlMemBlocks()) {
24711            printf("Leak of %d blocks found in xmlValidGetValidElements",
24712	           xmlMemBlocks() - mem_base);
24713	    test_ret++;
24714            printf(" %d", n_prev);
24715            printf(" %d", n_next);
24716            printf(" %d", n_names);
24717            printf(" %d", n_max);
24718            printf("\n");
24719        }
24720    }
24721    }
24722    }
24723    }
24724    function_tests++;
24725#endif
24726
24727    return(test_ret);
24728}
24729
24730
24731static int
24732test_xmlValidNormalizeAttributeValue(void) {
24733    int test_ret = 0;
24734
24735#ifdef LIBXML_VALID_ENABLED
24736    int mem_base;
24737    xmlChar * ret_val;
24738    xmlDocPtr doc; /* the document */
24739    int n_doc;
24740    xmlNodePtr elem; /* the parent */
24741    int n_elem;
24742    xmlChar * name; /* the attribute name */
24743    int n_name;
24744    xmlChar * value; /* the attribute value */
24745    int n_value;
24746
24747    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24748    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
24749    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24750    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24751        mem_base = xmlMemBlocks();
24752        doc = gen_xmlDocPtr(n_doc, 0);
24753        elem = gen_xmlNodePtr(n_elem, 1);
24754        name = gen_const_xmlChar_ptr(n_name, 2);
24755        value = gen_const_xmlChar_ptr(n_value, 3);
24756
24757        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
24758        desret_xmlChar_ptr(ret_val);
24759        call_tests++;
24760        des_xmlDocPtr(n_doc, doc, 0);
24761        des_xmlNodePtr(n_elem, elem, 1);
24762        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24763        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
24764        xmlResetLastError();
24765        if (mem_base != xmlMemBlocks()) {
24766            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
24767	           xmlMemBlocks() - mem_base);
24768	    test_ret++;
24769            printf(" %d", n_doc);
24770            printf(" %d", n_elem);
24771            printf(" %d", n_name);
24772            printf(" %d", n_value);
24773            printf("\n");
24774        }
24775    }
24776    }
24777    }
24778    }
24779    function_tests++;
24780#endif
24781
24782    return(test_ret);
24783}
24784
24785
24786static int
24787test_xmlValidateAttributeDecl(void) {
24788    int test_ret = 0;
24789
24790#ifdef LIBXML_VALID_ENABLED
24791    int mem_base;
24792    int ret_val;
24793    xmlValidCtxtPtr ctxt; /* the validation context */
24794    int n_ctxt;
24795    xmlDocPtr doc; /* a document instance */
24796    int n_doc;
24797    xmlAttributePtr attr; /* an attribute definition */
24798    int n_attr;
24799
24800    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24801    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24802    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24803        mem_base = xmlMemBlocks();
24804        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24805        doc = gen_xmlDocPtr(n_doc, 1);
24806        attr = gen_xmlAttributePtr(n_attr, 2);
24807
24808        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
24809        desret_int(ret_val);
24810        call_tests++;
24811        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24812        des_xmlDocPtr(n_doc, doc, 1);
24813        des_xmlAttributePtr(n_attr, attr, 2);
24814        xmlResetLastError();
24815        if (mem_base != xmlMemBlocks()) {
24816            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
24817	           xmlMemBlocks() - mem_base);
24818	    test_ret++;
24819            printf(" %d", n_ctxt);
24820            printf(" %d", n_doc);
24821            printf(" %d", n_attr);
24822            printf("\n");
24823        }
24824    }
24825    }
24826    }
24827    function_tests++;
24828#endif
24829
24830    return(test_ret);
24831}
24832
24833
24834static int
24835test_xmlValidateAttributeValue(void) {
24836    int test_ret = 0;
24837
24838#ifdef LIBXML_VALID_ENABLED
24839    int mem_base;
24840    int ret_val;
24841    xmlAttributeType type; /* an attribute type */
24842    int n_type;
24843    xmlChar * value; /* an attribute value */
24844    int n_value;
24845
24846    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24847    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
24848        mem_base = xmlMemBlocks();
24849        type = gen_xmlAttributeType(n_type, 0);
24850        value = gen_const_xmlChar_ptr(n_value, 1);
24851
24852        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
24853        desret_int(ret_val);
24854        call_tests++;
24855        des_xmlAttributeType(n_type, type, 0);
24856        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
24857        xmlResetLastError();
24858        if (mem_base != xmlMemBlocks()) {
24859            printf("Leak of %d blocks found in xmlValidateAttributeValue",
24860	           xmlMemBlocks() - mem_base);
24861	    test_ret++;
24862            printf(" %d", n_type);
24863            printf(" %d", n_value);
24864            printf("\n");
24865        }
24866    }
24867    }
24868    function_tests++;
24869#endif
24870
24871    return(test_ret);
24872}
24873
24874
24875static int
24876test_xmlValidateDocument(void) {
24877    int test_ret = 0;
24878
24879#ifdef LIBXML_VALID_ENABLED
24880    int mem_base;
24881    int ret_val;
24882    xmlValidCtxtPtr ctxt; /* the validation context */
24883    int n_ctxt;
24884    xmlDocPtr doc; /* a document instance */
24885    int n_doc;
24886
24887    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24888    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24889        mem_base = xmlMemBlocks();
24890        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24891        doc = gen_xmlDocPtr(n_doc, 1);
24892
24893        ret_val = xmlValidateDocument(ctxt, doc);
24894        desret_int(ret_val);
24895        call_tests++;
24896        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24897        des_xmlDocPtr(n_doc, doc, 1);
24898        xmlResetLastError();
24899        if (mem_base != xmlMemBlocks()) {
24900            printf("Leak of %d blocks found in xmlValidateDocument",
24901	           xmlMemBlocks() - mem_base);
24902	    test_ret++;
24903            printf(" %d", n_ctxt);
24904            printf(" %d", n_doc);
24905            printf("\n");
24906        }
24907    }
24908    }
24909    function_tests++;
24910#endif
24911
24912    return(test_ret);
24913}
24914
24915
24916static int
24917test_xmlValidateDocumentFinal(void) {
24918    int test_ret = 0;
24919
24920#ifdef LIBXML_VALID_ENABLED
24921    int mem_base;
24922    int ret_val;
24923    xmlValidCtxtPtr ctxt; /* the validation context */
24924    int n_ctxt;
24925    xmlDocPtr doc; /* a document instance */
24926    int n_doc;
24927
24928    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24929    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24930        mem_base = xmlMemBlocks();
24931        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24932        doc = gen_xmlDocPtr(n_doc, 1);
24933
24934        ret_val = xmlValidateDocumentFinal(ctxt, doc);
24935        desret_int(ret_val);
24936        call_tests++;
24937        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24938        des_xmlDocPtr(n_doc, doc, 1);
24939        xmlResetLastError();
24940        if (mem_base != xmlMemBlocks()) {
24941            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
24942	           xmlMemBlocks() - mem_base);
24943	    test_ret++;
24944            printf(" %d", n_ctxt);
24945            printf(" %d", n_doc);
24946            printf("\n");
24947        }
24948    }
24949    }
24950    function_tests++;
24951#endif
24952
24953    return(test_ret);
24954}
24955
24956
24957static int
24958test_xmlValidateDtd(void) {
24959    int test_ret = 0;
24960
24961#ifdef LIBXML_VALID_ENABLED
24962    int mem_base;
24963    int ret_val;
24964    xmlValidCtxtPtr ctxt; /* the validation context */
24965    int n_ctxt;
24966    xmlDocPtr doc; /* a document instance */
24967    int n_doc;
24968    xmlDtdPtr dtd; /* a dtd instance */
24969    int n_dtd;
24970
24971    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24972    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24973    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24974        mem_base = xmlMemBlocks();
24975        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24976        doc = gen_xmlDocPtr(n_doc, 1);
24977        dtd = gen_xmlDtdPtr(n_dtd, 2);
24978
24979        ret_val = xmlValidateDtd(ctxt, doc, dtd);
24980        desret_int(ret_val);
24981        call_tests++;
24982        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24983        des_xmlDocPtr(n_doc, doc, 1);
24984        des_xmlDtdPtr(n_dtd, dtd, 2);
24985        xmlResetLastError();
24986        if (mem_base != xmlMemBlocks()) {
24987            printf("Leak of %d blocks found in xmlValidateDtd",
24988	           xmlMemBlocks() - mem_base);
24989	    test_ret++;
24990            printf(" %d", n_ctxt);
24991            printf(" %d", n_doc);
24992            printf(" %d", n_dtd);
24993            printf("\n");
24994        }
24995    }
24996    }
24997    }
24998    function_tests++;
24999#endif
25000
25001    return(test_ret);
25002}
25003
25004
25005static int
25006test_xmlValidateDtdFinal(void) {
25007    int test_ret = 0;
25008
25009#ifdef LIBXML_VALID_ENABLED
25010    int mem_base;
25011    int ret_val;
25012    xmlValidCtxtPtr ctxt; /* the validation context */
25013    int n_ctxt;
25014    xmlDocPtr doc; /* a document instance */
25015    int n_doc;
25016
25017    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25018    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25019        mem_base = xmlMemBlocks();
25020        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25021        doc = gen_xmlDocPtr(n_doc, 1);
25022
25023        ret_val = xmlValidateDtdFinal(ctxt, doc);
25024        desret_int(ret_val);
25025        call_tests++;
25026        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25027        des_xmlDocPtr(n_doc, doc, 1);
25028        xmlResetLastError();
25029        if (mem_base != xmlMemBlocks()) {
25030            printf("Leak of %d blocks found in xmlValidateDtdFinal",
25031	           xmlMemBlocks() - mem_base);
25032	    test_ret++;
25033            printf(" %d", n_ctxt);
25034            printf(" %d", n_doc);
25035            printf("\n");
25036        }
25037    }
25038    }
25039    function_tests++;
25040#endif
25041
25042    return(test_ret);
25043}
25044
25045
25046static int
25047test_xmlValidateElement(void) {
25048    int test_ret = 0;
25049
25050#ifdef LIBXML_VALID_ENABLED
25051    int mem_base;
25052    int ret_val;
25053    xmlValidCtxtPtr ctxt; /* the validation context */
25054    int n_ctxt;
25055    xmlDocPtr doc; /* a document instance */
25056    int n_doc;
25057    xmlNodePtr elem; /* an element instance */
25058    int n_elem;
25059
25060    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25061    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25062    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25063        mem_base = xmlMemBlocks();
25064        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25065        doc = gen_xmlDocPtr(n_doc, 1);
25066        elem = gen_xmlNodePtr(n_elem, 2);
25067
25068        ret_val = xmlValidateElement(ctxt, doc, elem);
25069        desret_int(ret_val);
25070        call_tests++;
25071        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25072        des_xmlDocPtr(n_doc, doc, 1);
25073        des_xmlNodePtr(n_elem, elem, 2);
25074        xmlResetLastError();
25075        if (mem_base != xmlMemBlocks()) {
25076            printf("Leak of %d blocks found in xmlValidateElement",
25077	           xmlMemBlocks() - mem_base);
25078	    test_ret++;
25079            printf(" %d", n_ctxt);
25080            printf(" %d", n_doc);
25081            printf(" %d", n_elem);
25082            printf("\n");
25083        }
25084    }
25085    }
25086    }
25087    function_tests++;
25088#endif
25089
25090    return(test_ret);
25091}
25092
25093
25094static int
25095test_xmlValidateElementDecl(void) {
25096    int test_ret = 0;
25097
25098#ifdef LIBXML_VALID_ENABLED
25099    int mem_base;
25100    int ret_val;
25101    xmlValidCtxtPtr ctxt; /* the validation context */
25102    int n_ctxt;
25103    xmlDocPtr doc; /* a document instance */
25104    int n_doc;
25105    xmlElementPtr elem; /* an element definition */
25106    int n_elem;
25107
25108    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25109    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25110    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25111        mem_base = xmlMemBlocks();
25112        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25113        doc = gen_xmlDocPtr(n_doc, 1);
25114        elem = gen_xmlElementPtr(n_elem, 2);
25115
25116        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
25117        desret_int(ret_val);
25118        call_tests++;
25119        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25120        des_xmlDocPtr(n_doc, doc, 1);
25121        des_xmlElementPtr(n_elem, elem, 2);
25122        xmlResetLastError();
25123        if (mem_base != xmlMemBlocks()) {
25124            printf("Leak of %d blocks found in xmlValidateElementDecl",
25125	           xmlMemBlocks() - mem_base);
25126	    test_ret++;
25127            printf(" %d", n_ctxt);
25128            printf(" %d", n_doc);
25129            printf(" %d", n_elem);
25130            printf("\n");
25131        }
25132    }
25133    }
25134    }
25135    function_tests++;
25136#endif
25137
25138    return(test_ret);
25139}
25140
25141
25142static int
25143test_xmlValidateNameValue(void) {
25144    int test_ret = 0;
25145
25146#ifdef LIBXML_VALID_ENABLED
25147    int mem_base;
25148    int ret_val;
25149    xmlChar * value; /* an Name value */
25150    int n_value;
25151
25152    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25153        mem_base = xmlMemBlocks();
25154        value = gen_const_xmlChar_ptr(n_value, 0);
25155
25156        ret_val = xmlValidateNameValue((const xmlChar *)value);
25157        desret_int(ret_val);
25158        call_tests++;
25159        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25160        xmlResetLastError();
25161        if (mem_base != xmlMemBlocks()) {
25162            printf("Leak of %d blocks found in xmlValidateNameValue",
25163	           xmlMemBlocks() - mem_base);
25164	    test_ret++;
25165            printf(" %d", n_value);
25166            printf("\n");
25167        }
25168    }
25169    function_tests++;
25170#endif
25171
25172    return(test_ret);
25173}
25174
25175
25176static int
25177test_xmlValidateNamesValue(void) {
25178    int test_ret = 0;
25179
25180#ifdef LIBXML_VALID_ENABLED
25181    int mem_base;
25182    int ret_val;
25183    xmlChar * value; /* an Names value */
25184    int n_value;
25185
25186    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25187        mem_base = xmlMemBlocks();
25188        value = gen_const_xmlChar_ptr(n_value, 0);
25189
25190        ret_val = xmlValidateNamesValue((const xmlChar *)value);
25191        desret_int(ret_val);
25192        call_tests++;
25193        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25194        xmlResetLastError();
25195        if (mem_base != xmlMemBlocks()) {
25196            printf("Leak of %d blocks found in xmlValidateNamesValue",
25197	           xmlMemBlocks() - mem_base);
25198	    test_ret++;
25199            printf(" %d", n_value);
25200            printf("\n");
25201        }
25202    }
25203    function_tests++;
25204#endif
25205
25206    return(test_ret);
25207}
25208
25209
25210static int
25211test_xmlValidateNmtokenValue(void) {
25212    int test_ret = 0;
25213
25214#ifdef LIBXML_VALID_ENABLED
25215    int mem_base;
25216    int ret_val;
25217    xmlChar * value; /* an Nmtoken value */
25218    int n_value;
25219
25220    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25221        mem_base = xmlMemBlocks();
25222        value = gen_const_xmlChar_ptr(n_value, 0);
25223
25224        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
25225        desret_int(ret_val);
25226        call_tests++;
25227        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25228        xmlResetLastError();
25229        if (mem_base != xmlMemBlocks()) {
25230            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
25231	           xmlMemBlocks() - mem_base);
25232	    test_ret++;
25233            printf(" %d", n_value);
25234            printf("\n");
25235        }
25236    }
25237    function_tests++;
25238#endif
25239
25240    return(test_ret);
25241}
25242
25243
25244static int
25245test_xmlValidateNmtokensValue(void) {
25246    int test_ret = 0;
25247
25248#ifdef LIBXML_VALID_ENABLED
25249    int mem_base;
25250    int ret_val;
25251    xmlChar * value; /* an Nmtokens value */
25252    int n_value;
25253
25254    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25255        mem_base = xmlMemBlocks();
25256        value = gen_const_xmlChar_ptr(n_value, 0);
25257
25258        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
25259        desret_int(ret_val);
25260        call_tests++;
25261        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
25262        xmlResetLastError();
25263        if (mem_base != xmlMemBlocks()) {
25264            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
25265	           xmlMemBlocks() - mem_base);
25266	    test_ret++;
25267            printf(" %d", n_value);
25268            printf("\n");
25269        }
25270    }
25271    function_tests++;
25272#endif
25273
25274    return(test_ret);
25275}
25276
25277
25278static int
25279test_xmlValidateNotationDecl(void) {
25280    int test_ret = 0;
25281
25282#ifdef LIBXML_VALID_ENABLED
25283    int mem_base;
25284    int ret_val;
25285    xmlValidCtxtPtr ctxt; /* the validation context */
25286    int n_ctxt;
25287    xmlDocPtr doc; /* a document instance */
25288    int n_doc;
25289    xmlNotationPtr nota; /* a notation definition */
25290    int n_nota;
25291
25292    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25293    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25294    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25295        mem_base = xmlMemBlocks();
25296        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25297        doc = gen_xmlDocPtr(n_doc, 1);
25298        nota = gen_xmlNotationPtr(n_nota, 2);
25299
25300        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
25301        desret_int(ret_val);
25302        call_tests++;
25303        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25304        des_xmlDocPtr(n_doc, doc, 1);
25305        des_xmlNotationPtr(n_nota, nota, 2);
25306        xmlResetLastError();
25307        if (mem_base != xmlMemBlocks()) {
25308            printf("Leak of %d blocks found in xmlValidateNotationDecl",
25309	           xmlMemBlocks() - mem_base);
25310	    test_ret++;
25311            printf(" %d", n_ctxt);
25312            printf(" %d", n_doc);
25313            printf(" %d", n_nota);
25314            printf("\n");
25315        }
25316    }
25317    }
25318    }
25319    function_tests++;
25320#endif
25321
25322    return(test_ret);
25323}
25324
25325
25326static int
25327test_xmlValidateNotationUse(void) {
25328    int test_ret = 0;
25329
25330#ifdef LIBXML_VALID_ENABLED
25331    int mem_base;
25332    int ret_val;
25333    xmlValidCtxtPtr ctxt; /* the validation context */
25334    int n_ctxt;
25335    xmlDocPtr doc; /* the document */
25336    int n_doc;
25337    xmlChar * notationName; /* the notation name to check */
25338    int n_notationName;
25339
25340    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25341    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25342    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
25343        mem_base = xmlMemBlocks();
25344        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25345        doc = gen_xmlDocPtr(n_doc, 1);
25346        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
25347
25348        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
25349        desret_int(ret_val);
25350        call_tests++;
25351        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25352        des_xmlDocPtr(n_doc, doc, 1);
25353        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
25354        xmlResetLastError();
25355        if (mem_base != xmlMemBlocks()) {
25356            printf("Leak of %d blocks found in xmlValidateNotationUse",
25357	           xmlMemBlocks() - mem_base);
25358	    test_ret++;
25359            printf(" %d", n_ctxt);
25360            printf(" %d", n_doc);
25361            printf(" %d", n_notationName);
25362            printf("\n");
25363        }
25364    }
25365    }
25366    }
25367    function_tests++;
25368#endif
25369
25370    return(test_ret);
25371}
25372
25373
25374static int
25375test_xmlValidateOneAttribute(void) {
25376    int test_ret = 0;
25377
25378#ifdef LIBXML_VALID_ENABLED
25379    int mem_base;
25380    int ret_val;
25381    xmlValidCtxtPtr ctxt; /* the validation context */
25382    int n_ctxt;
25383    xmlDocPtr doc; /* a document instance */
25384    int n_doc;
25385    xmlNodePtr elem; /* an element instance */
25386    int n_elem;
25387    xmlAttrPtr attr; /* an attribute instance */
25388    int n_attr;
25389    xmlChar * value; /* the attribute value (without entities processing) */
25390    int n_value;
25391
25392    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25393    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25394    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25395    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25396    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25397        mem_base = xmlMemBlocks();
25398        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25399        doc = gen_xmlDocPtr(n_doc, 1);
25400        elem = gen_xmlNodePtr(n_elem, 2);
25401        attr = gen_xmlAttrPtr(n_attr, 3);
25402        value = gen_const_xmlChar_ptr(n_value, 4);
25403
25404        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
25405        desret_int(ret_val);
25406        call_tests++;
25407        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25408        des_xmlDocPtr(n_doc, doc, 1);
25409        des_xmlNodePtr(n_elem, elem, 2);
25410        des_xmlAttrPtr(n_attr, attr, 3);
25411        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25412        xmlResetLastError();
25413        if (mem_base != xmlMemBlocks()) {
25414            printf("Leak of %d blocks found in xmlValidateOneAttribute",
25415	           xmlMemBlocks() - mem_base);
25416	    test_ret++;
25417            printf(" %d", n_ctxt);
25418            printf(" %d", n_doc);
25419            printf(" %d", n_elem);
25420            printf(" %d", n_attr);
25421            printf(" %d", n_value);
25422            printf("\n");
25423        }
25424    }
25425    }
25426    }
25427    }
25428    }
25429    function_tests++;
25430#endif
25431
25432    return(test_ret);
25433}
25434
25435
25436static int
25437test_xmlValidateOneElement(void) {
25438    int test_ret = 0;
25439
25440#ifdef LIBXML_VALID_ENABLED
25441    int mem_base;
25442    int ret_val;
25443    xmlValidCtxtPtr ctxt; /* the validation context */
25444    int n_ctxt;
25445    xmlDocPtr doc; /* a document instance */
25446    int n_doc;
25447    xmlNodePtr elem; /* an element instance */
25448    int n_elem;
25449
25450    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25451    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25452    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25453        mem_base = xmlMemBlocks();
25454        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25455        doc = gen_xmlDocPtr(n_doc, 1);
25456        elem = gen_xmlNodePtr(n_elem, 2);
25457
25458        ret_val = xmlValidateOneElement(ctxt, doc, elem);
25459        desret_int(ret_val);
25460        call_tests++;
25461        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25462        des_xmlDocPtr(n_doc, doc, 1);
25463        des_xmlNodePtr(n_elem, elem, 2);
25464        xmlResetLastError();
25465        if (mem_base != xmlMemBlocks()) {
25466            printf("Leak of %d blocks found in xmlValidateOneElement",
25467	           xmlMemBlocks() - mem_base);
25468	    test_ret++;
25469            printf(" %d", n_ctxt);
25470            printf(" %d", n_doc);
25471            printf(" %d", n_elem);
25472            printf("\n");
25473        }
25474    }
25475    }
25476    }
25477    function_tests++;
25478#endif
25479
25480    return(test_ret);
25481}
25482
25483
25484static int
25485test_xmlValidateOneNamespace(void) {
25486    int test_ret = 0;
25487
25488#ifdef LIBXML_VALID_ENABLED
25489    int mem_base;
25490    int ret_val;
25491    xmlValidCtxtPtr ctxt; /* the validation context */
25492    int n_ctxt;
25493    xmlDocPtr doc; /* a document instance */
25494    int n_doc;
25495    xmlNodePtr elem; /* an element instance */
25496    int n_elem;
25497    xmlChar * prefix; /* the namespace prefix */
25498    int n_prefix;
25499    xmlNsPtr ns; /* an namespace declaration instance */
25500    int n_ns;
25501    xmlChar * value; /* the attribute value (without entities processing) */
25502    int n_value;
25503
25504    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25505    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25506    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25507    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25508    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
25509    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25510        mem_base = xmlMemBlocks();
25511        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25512        doc = gen_xmlDocPtr(n_doc, 1);
25513        elem = gen_xmlNodePtr(n_elem, 2);
25514        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25515        ns = gen_xmlNsPtr(n_ns, 4);
25516        value = gen_const_xmlChar_ptr(n_value, 5);
25517
25518        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
25519        desret_int(ret_val);
25520        call_tests++;
25521        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25522        des_xmlDocPtr(n_doc, doc, 1);
25523        des_xmlNodePtr(n_elem, elem, 2);
25524        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25525        des_xmlNsPtr(n_ns, ns, 4);
25526        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
25527        xmlResetLastError();
25528        if (mem_base != xmlMemBlocks()) {
25529            printf("Leak of %d blocks found in xmlValidateOneNamespace",
25530	           xmlMemBlocks() - mem_base);
25531	    test_ret++;
25532            printf(" %d", n_ctxt);
25533            printf(" %d", n_doc);
25534            printf(" %d", n_elem);
25535            printf(" %d", n_prefix);
25536            printf(" %d", n_ns);
25537            printf(" %d", n_value);
25538            printf("\n");
25539        }
25540    }
25541    }
25542    }
25543    }
25544    }
25545    }
25546    function_tests++;
25547#endif
25548
25549    return(test_ret);
25550}
25551
25552
25553static int
25554test_xmlValidatePopElement(void) {
25555    int test_ret = 0;
25556
25557#ifdef LIBXML_REGEXP_ENABLED
25558    int mem_base;
25559    int ret_val;
25560    xmlValidCtxtPtr ctxt; /* the validation context */
25561    int n_ctxt;
25562    xmlDocPtr doc; /* a document instance */
25563    int n_doc;
25564    xmlNodePtr elem; /* an element instance */
25565    int n_elem;
25566    xmlChar * qname; /* the qualified name as appearing in the serialization */
25567    int n_qname;
25568
25569    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25570    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25571    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25572    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25573        mem_base = xmlMemBlocks();
25574        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25575        doc = gen_xmlDocPtr(n_doc, 1);
25576        elem = gen_xmlNodePtr(n_elem, 2);
25577        qname = gen_const_xmlChar_ptr(n_qname, 3);
25578
25579        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
25580        desret_int(ret_val);
25581        call_tests++;
25582        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25583        des_xmlDocPtr(n_doc, doc, 1);
25584        des_xmlNodePtr(n_elem, elem, 2);
25585        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
25586        xmlResetLastError();
25587        if (mem_base != xmlMemBlocks()) {
25588            printf("Leak of %d blocks found in xmlValidatePopElement",
25589	           xmlMemBlocks() - mem_base);
25590	    test_ret++;
25591            printf(" %d", n_ctxt);
25592            printf(" %d", n_doc);
25593            printf(" %d", n_elem);
25594            printf(" %d", n_qname);
25595            printf("\n");
25596        }
25597    }
25598    }
25599    }
25600    }
25601    function_tests++;
25602#endif
25603
25604    return(test_ret);
25605}
25606
25607
25608static int
25609test_xmlValidatePushCData(void) {
25610    int test_ret = 0;
25611
25612#ifdef LIBXML_REGEXP_ENABLED
25613    int mem_base;
25614    int ret_val;
25615    xmlValidCtxtPtr ctxt; /* the validation context */
25616    int n_ctxt;
25617    xmlChar * data; /* some character data read */
25618    int n_data;
25619    int len; /* the lenght of the data */
25620    int n_len;
25621
25622    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25623    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
25624    for (n_len = 0;n_len < gen_nb_int;n_len++) {
25625        mem_base = xmlMemBlocks();
25626        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25627        data = gen_const_xmlChar_ptr(n_data, 1);
25628        len = gen_int(n_len, 2);
25629
25630        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
25631        desret_int(ret_val);
25632        call_tests++;
25633        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25634        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
25635        des_int(n_len, len, 2);
25636        xmlResetLastError();
25637        if (mem_base != xmlMemBlocks()) {
25638            printf("Leak of %d blocks found in xmlValidatePushCData",
25639	           xmlMemBlocks() - mem_base);
25640	    test_ret++;
25641            printf(" %d", n_ctxt);
25642            printf(" %d", n_data);
25643            printf(" %d", n_len);
25644            printf("\n");
25645        }
25646    }
25647    }
25648    }
25649    function_tests++;
25650#endif
25651
25652    return(test_ret);
25653}
25654
25655
25656static int
25657test_xmlValidatePushElement(void) {
25658    int test_ret = 0;
25659
25660#ifdef LIBXML_REGEXP_ENABLED
25661    int mem_base;
25662    int ret_val;
25663    xmlValidCtxtPtr ctxt; /* the validation context */
25664    int n_ctxt;
25665    xmlDocPtr doc; /* a document instance */
25666    int n_doc;
25667    xmlNodePtr elem; /* an element instance */
25668    int n_elem;
25669    xmlChar * qname; /* the qualified name as appearing in the serialization */
25670    int n_qname;
25671
25672    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25673    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25674    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25675    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
25676        mem_base = xmlMemBlocks();
25677        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25678        doc = gen_xmlDocPtr(n_doc, 1);
25679        elem = gen_xmlNodePtr(n_elem, 2);
25680        qname = gen_const_xmlChar_ptr(n_qname, 3);
25681
25682        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
25683        desret_int(ret_val);
25684        call_tests++;
25685        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25686        des_xmlDocPtr(n_doc, doc, 1);
25687        des_xmlNodePtr(n_elem, elem, 2);
25688        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
25689        xmlResetLastError();
25690        if (mem_base != xmlMemBlocks()) {
25691            printf("Leak of %d blocks found in xmlValidatePushElement",
25692	           xmlMemBlocks() - mem_base);
25693	    test_ret++;
25694            printf(" %d", n_ctxt);
25695            printf(" %d", n_doc);
25696            printf(" %d", n_elem);
25697            printf(" %d", n_qname);
25698            printf("\n");
25699        }
25700    }
25701    }
25702    }
25703    }
25704    function_tests++;
25705#endif
25706
25707    return(test_ret);
25708}
25709
25710
25711static int
25712test_xmlValidateRoot(void) {
25713    int test_ret = 0;
25714
25715#ifdef LIBXML_VALID_ENABLED
25716    int mem_base;
25717    int ret_val;
25718    xmlValidCtxtPtr ctxt; /* the validation context */
25719    int n_ctxt;
25720    xmlDocPtr doc; /* a document instance */
25721    int n_doc;
25722
25723    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25724    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25725        mem_base = xmlMemBlocks();
25726        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25727        doc = gen_xmlDocPtr(n_doc, 1);
25728
25729        ret_val = xmlValidateRoot(ctxt, doc);
25730        desret_int(ret_val);
25731        call_tests++;
25732        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25733        des_xmlDocPtr(n_doc, doc, 1);
25734        xmlResetLastError();
25735        if (mem_base != xmlMemBlocks()) {
25736            printf("Leak of %d blocks found in xmlValidateRoot",
25737	           xmlMemBlocks() - mem_base);
25738	    test_ret++;
25739            printf(" %d", n_ctxt);
25740            printf(" %d", n_doc);
25741            printf("\n");
25742        }
25743    }
25744    }
25745    function_tests++;
25746#endif
25747
25748    return(test_ret);
25749}
25750
25751static int
25752test_valid(void) {
25753    int test_ret = 0;
25754
25755    if (quiet == 0) printf("Testing valid : 48 of 67 functions ...\n");
25756    test_ret += test_xmlAddAttributeDecl();
25757    test_ret += test_xmlAddElementDecl();
25758    test_ret += test_xmlAddID();
25759    test_ret += test_xmlAddNotationDecl();
25760    test_ret += test_xmlAddRef();
25761    test_ret += test_xmlCopyAttributeTable();
25762    test_ret += test_xmlCopyElementContent();
25763    test_ret += test_xmlCopyElementTable();
25764    test_ret += test_xmlCopyEnumeration();
25765    test_ret += test_xmlCopyNotationTable();
25766    test_ret += test_xmlCreateEnumeration();
25767    test_ret += test_xmlDumpAttributeDecl();
25768    test_ret += test_xmlDumpAttributeTable();
25769    test_ret += test_xmlDumpElementDecl();
25770    test_ret += test_xmlDumpElementTable();
25771    test_ret += test_xmlDumpNotationDecl();
25772    test_ret += test_xmlDumpNotationTable();
25773    test_ret += test_xmlGetDtdAttrDesc();
25774    test_ret += test_xmlGetDtdElementDesc();
25775    test_ret += test_xmlGetDtdNotationDesc();
25776    test_ret += test_xmlGetDtdQAttrDesc();
25777    test_ret += test_xmlGetDtdQElementDesc();
25778    test_ret += test_xmlGetID();
25779    test_ret += test_xmlGetRefs();
25780    test_ret += test_xmlIsID();
25781    test_ret += test_xmlIsMixedElement();
25782    test_ret += test_xmlIsRef();
25783    test_ret += test_xmlNewElementContent();
25784    test_ret += test_xmlNewValidCtxt();
25785    test_ret += test_xmlRemoveID();
25786    test_ret += test_xmlRemoveRef();
25787    test_ret += test_xmlSnprintfElementContent();
25788    test_ret += test_xmlSprintfElementContent();
25789    test_ret += test_xmlValidBuildContentModel();
25790    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
25791    test_ret += test_xmlValidGetPotentialChildren();
25792    test_ret += test_xmlValidGetValidElements();
25793    test_ret += test_xmlValidNormalizeAttributeValue();
25794    test_ret += test_xmlValidateAttributeDecl();
25795    test_ret += test_xmlValidateAttributeValue();
25796    test_ret += test_xmlValidateDocument();
25797    test_ret += test_xmlValidateDocumentFinal();
25798    test_ret += test_xmlValidateDtd();
25799    test_ret += test_xmlValidateDtdFinal();
25800    test_ret += test_xmlValidateElement();
25801    test_ret += test_xmlValidateElementDecl();
25802    test_ret += test_xmlValidateNameValue();
25803    test_ret += test_xmlValidateNamesValue();
25804    test_ret += test_xmlValidateNmtokenValue();
25805    test_ret += test_xmlValidateNmtokensValue();
25806    test_ret += test_xmlValidateNotationDecl();
25807    test_ret += test_xmlValidateNotationUse();
25808    test_ret += test_xmlValidateOneAttribute();
25809    test_ret += test_xmlValidateOneElement();
25810    test_ret += test_xmlValidateOneNamespace();
25811    test_ret += test_xmlValidatePopElement();
25812    test_ret += test_xmlValidatePushCData();
25813    test_ret += test_xmlValidatePushElement();
25814    test_ret += test_xmlValidateRoot();
25815
25816    if (test_ret != 0)
25817	printf("Module valid: %d errors\n", test_ret);
25818    return(test_ret);
25819}
25820
25821static int
25822test_xmlXIncludeNewContext(void) {
25823    int test_ret = 0;
25824
25825
25826    /* missing type support */
25827    return(test_ret);
25828}
25829
25830
25831static int
25832test_xmlXIncludeProcess(void) {
25833    int test_ret = 0;
25834
25835#ifdef LIBXML_XINCLUDE_ENABLED
25836    int mem_base;
25837    int ret_val;
25838    xmlDocPtr doc; /* an XML document */
25839    int n_doc;
25840
25841    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25842        mem_base = xmlMemBlocks();
25843        doc = gen_xmlDocPtr(n_doc, 0);
25844
25845        ret_val = xmlXIncludeProcess(doc);
25846        desret_int(ret_val);
25847        call_tests++;
25848        des_xmlDocPtr(n_doc, doc, 0);
25849        xmlResetLastError();
25850        if (mem_base != xmlMemBlocks()) {
25851            printf("Leak of %d blocks found in xmlXIncludeProcess",
25852	           xmlMemBlocks() - mem_base);
25853	    test_ret++;
25854            printf(" %d", n_doc);
25855            printf("\n");
25856        }
25857    }
25858    function_tests++;
25859#endif
25860
25861    return(test_ret);
25862}
25863
25864
25865static int
25866test_xmlXIncludeProcessFlags(void) {
25867    int test_ret = 0;
25868
25869#ifdef LIBXML_XINCLUDE_ENABLED
25870    int mem_base;
25871    int ret_val;
25872    xmlDocPtr doc; /* an XML document */
25873    int n_doc;
25874    int flags; /* a set of xmlParserOption used for parsing XML includes */
25875    int n_flags;
25876
25877    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25878    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
25879        mem_base = xmlMemBlocks();
25880        doc = gen_xmlDocPtr(n_doc, 0);
25881        flags = gen_int(n_flags, 1);
25882
25883        ret_val = xmlXIncludeProcessFlags(doc, flags);
25884        desret_int(ret_val);
25885        call_tests++;
25886        des_xmlDocPtr(n_doc, doc, 0);
25887        des_int(n_flags, flags, 1);
25888        xmlResetLastError();
25889        if (mem_base != xmlMemBlocks()) {
25890            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
25891	           xmlMemBlocks() - mem_base);
25892	    test_ret++;
25893            printf(" %d", n_doc);
25894            printf(" %d", n_flags);
25895            printf("\n");
25896        }
25897    }
25898    }
25899    function_tests++;
25900#endif
25901
25902    return(test_ret);
25903}
25904
25905#ifdef LIBXML_XINCLUDE_ENABLED
25906
25907#define gen_nb_xmlXIncludeCtxtPtr 1
25908static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25909    return(NULL);
25910}
25911static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25912}
25913#endif
25914
25915
25916static int
25917test_xmlXIncludeProcessNode(void) {
25918    int test_ret = 0;
25919
25920#ifdef LIBXML_XINCLUDE_ENABLED
25921    int mem_base;
25922    int ret_val;
25923    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
25924    int n_ctxt;
25925    xmlNodePtr node; /* a node in an XML document */
25926    int n_node;
25927
25928    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
25929    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
25930        mem_base = xmlMemBlocks();
25931        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
25932        node = gen_xmlNodePtr(n_node, 1);
25933
25934        ret_val = xmlXIncludeProcessNode(ctxt, node);
25935        desret_int(ret_val);
25936        call_tests++;
25937        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
25938        des_xmlNodePtr(n_node, node, 1);
25939        xmlResetLastError();
25940        if (mem_base != xmlMemBlocks()) {
25941            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
25942	           xmlMemBlocks() - mem_base);
25943	    test_ret++;
25944            printf(" %d", n_ctxt);
25945            printf(" %d", n_node);
25946            printf("\n");
25947        }
25948    }
25949    }
25950    function_tests++;
25951#endif
25952
25953    return(test_ret);
25954}
25955
25956
25957static int
25958test_xmlXIncludeProcessTree(void) {
25959    int test_ret = 0;
25960
25961#ifdef LIBXML_XINCLUDE_ENABLED
25962    int mem_base;
25963    int ret_val;
25964    xmlNodePtr tree; /* a node in an XML document */
25965    int n_tree;
25966
25967    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
25968        mem_base = xmlMemBlocks();
25969        tree = gen_xmlNodePtr(n_tree, 0);
25970
25971        ret_val = xmlXIncludeProcessTree(tree);
25972        desret_int(ret_val);
25973        call_tests++;
25974        des_xmlNodePtr(n_tree, tree, 0);
25975        xmlResetLastError();
25976        if (mem_base != xmlMemBlocks()) {
25977            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
25978	           xmlMemBlocks() - mem_base);
25979	    test_ret++;
25980            printf(" %d", n_tree);
25981            printf("\n");
25982        }
25983    }
25984    function_tests++;
25985#endif
25986
25987    return(test_ret);
25988}
25989
25990
25991static int
25992test_xmlXIncludeProcessTreeFlags(void) {
25993    int test_ret = 0;
25994
25995#ifdef LIBXML_XINCLUDE_ENABLED
25996    int mem_base;
25997    int ret_val;
25998    xmlNodePtr tree; /* a node in an XML document */
25999    int n_tree;
26000    int flags; /* a set of xmlParserOption used for parsing XML includes */
26001    int n_flags;
26002
26003    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
26004    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26005        mem_base = xmlMemBlocks();
26006        tree = gen_xmlNodePtr(n_tree, 0);
26007        flags = gen_int(n_flags, 1);
26008
26009        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
26010        desret_int(ret_val);
26011        call_tests++;
26012        des_xmlNodePtr(n_tree, tree, 0);
26013        des_int(n_flags, flags, 1);
26014        xmlResetLastError();
26015        if (mem_base != xmlMemBlocks()) {
26016            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
26017	           xmlMemBlocks() - mem_base);
26018	    test_ret++;
26019            printf(" %d", n_tree);
26020            printf(" %d", n_flags);
26021            printf("\n");
26022        }
26023    }
26024    }
26025    function_tests++;
26026#endif
26027
26028    return(test_ret);
26029}
26030
26031
26032static int
26033test_xmlXIncludeSetFlags(void) {
26034    int test_ret = 0;
26035
26036#ifdef LIBXML_XINCLUDE_ENABLED
26037    int mem_base;
26038    int ret_val;
26039    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
26040    int n_ctxt;
26041    int flags; /* a set of xmlParserOption used for parsing XML includes */
26042    int n_flags;
26043
26044    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
26045    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26046        mem_base = xmlMemBlocks();
26047        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
26048        flags = gen_int(n_flags, 1);
26049
26050        ret_val = xmlXIncludeSetFlags(ctxt, flags);
26051        desret_int(ret_val);
26052        call_tests++;
26053        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
26054        des_int(n_flags, flags, 1);
26055        xmlResetLastError();
26056        if (mem_base != xmlMemBlocks()) {
26057            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
26058	           xmlMemBlocks() - mem_base);
26059	    test_ret++;
26060            printf(" %d", n_ctxt);
26061            printf(" %d", n_flags);
26062            printf("\n");
26063        }
26064    }
26065    }
26066    function_tests++;
26067#endif
26068
26069    return(test_ret);
26070}
26071
26072static int
26073test_xinclude(void) {
26074    int test_ret = 0;
26075
26076    if (quiet == 0) printf("Testing xinclude : 6 of 8 functions ...\n");
26077    test_ret += test_xmlXIncludeNewContext();
26078    test_ret += test_xmlXIncludeProcess();
26079    test_ret += test_xmlXIncludeProcessFlags();
26080    test_ret += test_xmlXIncludeProcessNode();
26081    test_ret += test_xmlXIncludeProcessTree();
26082    test_ret += test_xmlXIncludeProcessTreeFlags();
26083    test_ret += test_xmlXIncludeSetFlags();
26084
26085    if (test_ret != 0)
26086	printf("Module xinclude: %d errors\n", test_ret);
26087    return(test_ret);
26088}
26089
26090static int
26091test_xmlAllocOutputBuffer(void) {
26092    int test_ret = 0;
26093
26094#ifdef LIBXML_OUTPUT_ENABLED
26095    int mem_base;
26096    xmlOutputBufferPtr ret_val;
26097    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26098    int n_encoder;
26099
26100    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26101        mem_base = xmlMemBlocks();
26102        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
26103
26104        ret_val = xmlAllocOutputBuffer(encoder);
26105        desret_xmlOutputBufferPtr(ret_val);
26106        call_tests++;
26107        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
26108        xmlResetLastError();
26109        if (mem_base != xmlMemBlocks()) {
26110            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
26111	           xmlMemBlocks() - mem_base);
26112	    test_ret++;
26113            printf(" %d", n_encoder);
26114            printf("\n");
26115        }
26116    }
26117    function_tests++;
26118#endif
26119
26120    return(test_ret);
26121}
26122
26123
26124static int
26125test_xmlAllocParserInputBuffer(void) {
26126    int test_ret = 0;
26127
26128    int mem_base;
26129    xmlParserInputBufferPtr ret_val;
26130    xmlCharEncoding enc; /* the charset encoding if known */
26131    int n_enc;
26132
26133    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
26134        mem_base = xmlMemBlocks();
26135        enc = gen_xmlCharEncoding(n_enc, 0);
26136
26137        ret_val = xmlAllocParserInputBuffer(enc);
26138        desret_xmlParserInputBufferPtr(ret_val);
26139        call_tests++;
26140        des_xmlCharEncoding(n_enc, enc, 0);
26141        xmlResetLastError();
26142        if (mem_base != xmlMemBlocks()) {
26143            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
26144	           xmlMemBlocks() - mem_base);
26145	    test_ret++;
26146            printf(" %d", n_enc);
26147            printf("\n");
26148        }
26149    }
26150    function_tests++;
26151
26152    return(test_ret);
26153}
26154
26155
26156static int
26157test_xmlCheckFilename(void) {
26158    int test_ret = 0;
26159
26160    int mem_base;
26161    int ret_val;
26162    char * path; /* the path to check */
26163    int n_path;
26164
26165    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
26166        mem_base = xmlMemBlocks();
26167        path = gen_const_char_ptr(n_path, 0);
26168
26169        ret_val = xmlCheckFilename((const char *)path);
26170        desret_int(ret_val);
26171        call_tests++;
26172        des_const_char_ptr(n_path, (const char *)path, 0);
26173        xmlResetLastError();
26174        if (mem_base != xmlMemBlocks()) {
26175            printf("Leak of %d blocks found in xmlCheckFilename",
26176	           xmlMemBlocks() - mem_base);
26177	    test_ret++;
26178            printf(" %d", n_path);
26179            printf("\n");
26180        }
26181    }
26182    function_tests++;
26183
26184    return(test_ret);
26185}
26186
26187
26188static int
26189test_xmlCheckHTTPInput(void) {
26190    int test_ret = 0;
26191
26192    int mem_base;
26193    xmlParserInputPtr ret_val;
26194    xmlParserCtxtPtr ctxt; /* an XML parser context */
26195    int n_ctxt;
26196    xmlParserInputPtr ret; /* an XML parser input */
26197    int n_ret;
26198
26199    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
26200    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
26201        mem_base = xmlMemBlocks();
26202        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
26203        ret = gen_xmlParserInputPtr(n_ret, 1);
26204
26205        ret_val = xmlCheckHTTPInput(ctxt, ret);
26206        desret_xmlParserInputPtr(ret_val);
26207        call_tests++;
26208        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
26209        des_xmlParserInputPtr(n_ret, ret, 1);
26210        xmlResetLastError();
26211        if (mem_base != xmlMemBlocks()) {
26212            printf("Leak of %d blocks found in xmlCheckHTTPInput",
26213	           xmlMemBlocks() - mem_base);
26214	    test_ret++;
26215            printf(" %d", n_ctxt);
26216            printf(" %d", n_ret);
26217            printf("\n");
26218        }
26219    }
26220    }
26221    function_tests++;
26222
26223    return(test_ret);
26224}
26225
26226
26227static int
26228test_xmlCleanupInputCallbacks(void) {
26229    int test_ret = 0;
26230
26231    int mem_base;
26232
26233        mem_base = xmlMemBlocks();
26234
26235        xmlCleanupInputCallbacks();
26236        call_tests++;
26237        xmlResetLastError();
26238        if (mem_base != xmlMemBlocks()) {
26239            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
26240	           xmlMemBlocks() - mem_base);
26241	    test_ret++;
26242            printf("\n");
26243        }
26244    function_tests++;
26245
26246    return(test_ret);
26247}
26248
26249
26250static int
26251test_xmlCleanupOutputCallbacks(void) {
26252    int test_ret = 0;
26253
26254#ifdef LIBXML_OUTPUT_ENABLED
26255    int mem_base;
26256
26257        mem_base = xmlMemBlocks();
26258
26259        xmlCleanupOutputCallbacks();
26260        call_tests++;
26261        xmlResetLastError();
26262        if (mem_base != xmlMemBlocks()) {
26263            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
26264	           xmlMemBlocks() - mem_base);
26265	    test_ret++;
26266            printf("\n");
26267        }
26268    function_tests++;
26269#endif
26270
26271    return(test_ret);
26272}
26273
26274
26275static int
26276test_xmlFileClose(void) {
26277    int test_ret = 0;
26278
26279    int mem_base;
26280    int ret_val;
26281    void * context; /* the I/O context */
26282    int n_context;
26283
26284    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26285        mem_base = xmlMemBlocks();
26286        context = gen_void_ptr(n_context, 0);
26287
26288        ret_val = xmlFileClose(context);
26289        desret_int(ret_val);
26290        call_tests++;
26291        des_void_ptr(n_context, context, 0);
26292        xmlResetLastError();
26293        if (mem_base != xmlMemBlocks()) {
26294            printf("Leak of %d blocks found in xmlFileClose",
26295	           xmlMemBlocks() - mem_base);
26296	    test_ret++;
26297            printf(" %d", n_context);
26298            printf("\n");
26299        }
26300    }
26301    function_tests++;
26302
26303    return(test_ret);
26304}
26305
26306
26307static int
26308test_xmlFileMatch(void) {
26309    int test_ret = 0;
26310
26311    int mem_base;
26312    int ret_val;
26313    const char * filename; /* the URI for matching */
26314    int n_filename;
26315
26316    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26317        mem_base = xmlMemBlocks();
26318        filename = gen_filepath(n_filename, 0);
26319
26320        ret_val = xmlFileMatch(filename);
26321        desret_int(ret_val);
26322        call_tests++;
26323        des_filepath(n_filename, filename, 0);
26324        xmlResetLastError();
26325        if (mem_base != xmlMemBlocks()) {
26326            printf("Leak of %d blocks found in xmlFileMatch",
26327	           xmlMemBlocks() - mem_base);
26328	    test_ret++;
26329            printf(" %d", n_filename);
26330            printf("\n");
26331        }
26332    }
26333    function_tests++;
26334
26335    return(test_ret);
26336}
26337
26338
26339static int
26340test_xmlFileOpen(void) {
26341    int test_ret = 0;
26342
26343    int mem_base;
26344    void * ret_val;
26345    const char * filename; /* the URI for matching */
26346    int n_filename;
26347
26348    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26349        mem_base = xmlMemBlocks();
26350        filename = gen_filepath(n_filename, 0);
26351
26352        ret_val = xmlFileOpen(filename);
26353        desret_void_ptr(ret_val);
26354        call_tests++;
26355        des_filepath(n_filename, filename, 0);
26356        xmlResetLastError();
26357        if (mem_base != xmlMemBlocks()) {
26358            printf("Leak of %d blocks found in xmlFileOpen",
26359	           xmlMemBlocks() - mem_base);
26360	    test_ret++;
26361            printf(" %d", n_filename);
26362            printf("\n");
26363        }
26364    }
26365    function_tests++;
26366
26367    return(test_ret);
26368}
26369
26370
26371static int
26372test_xmlFileRead(void) {
26373    int test_ret = 0;
26374
26375    int mem_base;
26376    int ret_val;
26377    void * context; /* the I/O context */
26378    int n_context;
26379    char * buffer; /* where to drop data */
26380    int n_buffer;
26381    int len; /* number of bytes to write */
26382    int n_len;
26383
26384    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26385    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26386    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26387        mem_base = xmlMemBlocks();
26388        context = gen_void_ptr(n_context, 0);
26389        buffer = gen_char_ptr(n_buffer, 1);
26390        len = gen_int(n_len, 2);
26391
26392        ret_val = xmlFileRead(context, buffer, len);
26393        desret_int(ret_val);
26394        call_tests++;
26395        des_void_ptr(n_context, context, 0);
26396        des_char_ptr(n_buffer, buffer, 1);
26397        des_int(n_len, len, 2);
26398        xmlResetLastError();
26399        if (mem_base != xmlMemBlocks()) {
26400            printf("Leak of %d blocks found in xmlFileRead",
26401	           xmlMemBlocks() - mem_base);
26402	    test_ret++;
26403            printf(" %d", n_context);
26404            printf(" %d", n_buffer);
26405            printf(" %d", n_len);
26406            printf("\n");
26407        }
26408    }
26409    }
26410    }
26411    function_tests++;
26412
26413    return(test_ret);
26414}
26415
26416
26417static int
26418test_xmlIOFTPClose(void) {
26419    int test_ret = 0;
26420
26421#ifdef LIBXML_FTP_ENABLED
26422    int mem_base;
26423    int ret_val;
26424    void * context; /* the I/O context */
26425    int n_context;
26426
26427    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26428        mem_base = xmlMemBlocks();
26429        context = gen_void_ptr(n_context, 0);
26430
26431        ret_val = xmlIOFTPClose(context);
26432        desret_int(ret_val);
26433        call_tests++;
26434        des_void_ptr(n_context, context, 0);
26435        xmlResetLastError();
26436        if (mem_base != xmlMemBlocks()) {
26437            printf("Leak of %d blocks found in xmlIOFTPClose",
26438	           xmlMemBlocks() - mem_base);
26439	    test_ret++;
26440            printf(" %d", n_context);
26441            printf("\n");
26442        }
26443    }
26444    function_tests++;
26445#endif
26446
26447    return(test_ret);
26448}
26449
26450
26451static int
26452test_xmlIOFTPMatch(void) {
26453    int test_ret = 0;
26454
26455#ifdef LIBXML_FTP_ENABLED
26456    int mem_base;
26457    int ret_val;
26458    const char * filename; /* the URI for matching */
26459    int n_filename;
26460
26461    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26462        mem_base = xmlMemBlocks();
26463        filename = gen_filepath(n_filename, 0);
26464
26465        ret_val = xmlIOFTPMatch(filename);
26466        desret_int(ret_val);
26467        call_tests++;
26468        des_filepath(n_filename, filename, 0);
26469        xmlResetLastError();
26470        if (mem_base != xmlMemBlocks()) {
26471            printf("Leak of %d blocks found in xmlIOFTPMatch",
26472	           xmlMemBlocks() - mem_base);
26473	    test_ret++;
26474            printf(" %d", n_filename);
26475            printf("\n");
26476        }
26477    }
26478    function_tests++;
26479#endif
26480
26481    return(test_ret);
26482}
26483
26484
26485static int
26486test_xmlIOFTPOpen(void) {
26487    int test_ret = 0;
26488
26489#ifdef LIBXML_FTP_ENABLED
26490    int mem_base;
26491    void * ret_val;
26492    const char * filename; /* the URI for matching */
26493    int n_filename;
26494
26495    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26496        mem_base = xmlMemBlocks();
26497        filename = gen_filepath(n_filename, 0);
26498
26499        ret_val = xmlIOFTPOpen(filename);
26500        desret_void_ptr(ret_val);
26501        call_tests++;
26502        des_filepath(n_filename, filename, 0);
26503        xmlResetLastError();
26504        if (mem_base != xmlMemBlocks()) {
26505            printf("Leak of %d blocks found in xmlIOFTPOpen",
26506	           xmlMemBlocks() - mem_base);
26507	    test_ret++;
26508            printf(" %d", n_filename);
26509            printf("\n");
26510        }
26511    }
26512    function_tests++;
26513#endif
26514
26515    return(test_ret);
26516}
26517
26518
26519static int
26520test_xmlIOFTPRead(void) {
26521    int test_ret = 0;
26522
26523#ifdef LIBXML_FTP_ENABLED
26524    int mem_base;
26525    int ret_val;
26526    void * context; /* the I/O context */
26527    int n_context;
26528    char * buffer; /* where to drop data */
26529    int n_buffer;
26530    int len; /* number of bytes to write */
26531    int n_len;
26532
26533    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26534    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26535    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26536        mem_base = xmlMemBlocks();
26537        context = gen_void_ptr(n_context, 0);
26538        buffer = gen_char_ptr(n_buffer, 1);
26539        len = gen_int(n_len, 2);
26540
26541        ret_val = xmlIOFTPRead(context, buffer, len);
26542        desret_int(ret_val);
26543        call_tests++;
26544        des_void_ptr(n_context, context, 0);
26545        des_char_ptr(n_buffer, buffer, 1);
26546        des_int(n_len, len, 2);
26547        xmlResetLastError();
26548        if (mem_base != xmlMemBlocks()) {
26549            printf("Leak of %d blocks found in xmlIOFTPRead",
26550	           xmlMemBlocks() - mem_base);
26551	    test_ret++;
26552            printf(" %d", n_context);
26553            printf(" %d", n_buffer);
26554            printf(" %d", n_len);
26555            printf("\n");
26556        }
26557    }
26558    }
26559    }
26560    function_tests++;
26561#endif
26562
26563    return(test_ret);
26564}
26565
26566
26567static int
26568test_xmlIOHTTPClose(void) {
26569    int test_ret = 0;
26570
26571#ifdef LIBXML_HTTP_ENABLED
26572    int mem_base;
26573    int ret_val;
26574    void * context; /* the I/O context */
26575    int n_context;
26576
26577    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26578        mem_base = xmlMemBlocks();
26579        context = gen_void_ptr(n_context, 0);
26580
26581        ret_val = xmlIOHTTPClose(context);
26582        desret_int(ret_val);
26583        call_tests++;
26584        des_void_ptr(n_context, context, 0);
26585        xmlResetLastError();
26586        if (mem_base != xmlMemBlocks()) {
26587            printf("Leak of %d blocks found in xmlIOHTTPClose",
26588	           xmlMemBlocks() - mem_base);
26589	    test_ret++;
26590            printf(" %d", n_context);
26591            printf("\n");
26592        }
26593    }
26594    function_tests++;
26595#endif
26596
26597    return(test_ret);
26598}
26599
26600
26601static int
26602test_xmlIOHTTPMatch(void) {
26603    int test_ret = 0;
26604
26605#ifdef LIBXML_HTTP_ENABLED
26606    int mem_base;
26607    int ret_val;
26608    const char * filename; /* the URI for matching */
26609    int n_filename;
26610
26611    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26612        mem_base = xmlMemBlocks();
26613        filename = gen_filepath(n_filename, 0);
26614
26615        ret_val = xmlIOHTTPMatch(filename);
26616        desret_int(ret_val);
26617        call_tests++;
26618        des_filepath(n_filename, filename, 0);
26619        xmlResetLastError();
26620        if (mem_base != xmlMemBlocks()) {
26621            printf("Leak of %d blocks found in xmlIOHTTPMatch",
26622	           xmlMemBlocks() - mem_base);
26623	    test_ret++;
26624            printf(" %d", n_filename);
26625            printf("\n");
26626        }
26627    }
26628    function_tests++;
26629#endif
26630
26631    return(test_ret);
26632}
26633
26634
26635static int
26636test_xmlIOHTTPOpen(void) {
26637    int test_ret = 0;
26638
26639#ifdef LIBXML_HTTP_ENABLED
26640    int mem_base;
26641    void * ret_val;
26642    const char * filename; /* the URI for matching */
26643    int n_filename;
26644
26645    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
26646        mem_base = xmlMemBlocks();
26647        filename = gen_filepath(n_filename, 0);
26648
26649        ret_val = xmlIOHTTPOpen(filename);
26650        desret_void_ptr(ret_val);
26651        call_tests++;
26652        des_filepath(n_filename, filename, 0);
26653        xmlResetLastError();
26654        if (mem_base != xmlMemBlocks()) {
26655            printf("Leak of %d blocks found in xmlIOHTTPOpen",
26656	           xmlMemBlocks() - mem_base);
26657	    test_ret++;
26658            printf(" %d", n_filename);
26659            printf("\n");
26660        }
26661    }
26662    function_tests++;
26663#endif
26664
26665    return(test_ret);
26666}
26667
26668
26669static int
26670test_xmlIOHTTPOpenW(void) {
26671    int test_ret = 0;
26672
26673
26674    /* missing type support */
26675    return(test_ret);
26676}
26677
26678
26679static int
26680test_xmlIOHTTPRead(void) {
26681    int test_ret = 0;
26682
26683#ifdef LIBXML_HTTP_ENABLED
26684    int mem_base;
26685    int ret_val;
26686    void * context; /* the I/O context */
26687    int n_context;
26688    char * buffer; /* where to drop data */
26689    int n_buffer;
26690    int len; /* number of bytes to write */
26691    int n_len;
26692
26693    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
26694    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
26695    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26696        mem_base = xmlMemBlocks();
26697        context = gen_void_ptr(n_context, 0);
26698        buffer = gen_char_ptr(n_buffer, 1);
26699        len = gen_int(n_len, 2);
26700
26701        ret_val = xmlIOHTTPRead(context, buffer, len);
26702        desret_int(ret_val);
26703        call_tests++;
26704        des_void_ptr(n_context, context, 0);
26705        des_char_ptr(n_buffer, buffer, 1);
26706        des_int(n_len, len, 2);
26707        xmlResetLastError();
26708        if (mem_base != xmlMemBlocks()) {
26709            printf("Leak of %d blocks found in xmlIOHTTPRead",
26710	           xmlMemBlocks() - mem_base);
26711	    test_ret++;
26712            printf(" %d", n_context);
26713            printf(" %d", n_buffer);
26714            printf(" %d", n_len);
26715            printf("\n");
26716        }
26717    }
26718    }
26719    }
26720    function_tests++;
26721#endif
26722
26723    return(test_ret);
26724}
26725
26726
26727static int
26728test_xmlNoNetExternalEntityLoader(void) {
26729    int test_ret = 0;
26730
26731    int mem_base;
26732    xmlParserInputPtr ret_val;
26733    const char * URL; /* the URL for the entity to load */
26734    int n_URL;
26735    char * ID; /* the System ID for the entity to load */
26736    int n_ID;
26737    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
26738    int n_ctxt;
26739
26740    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
26741    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
26742    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
26743        mem_base = xmlMemBlocks();
26744        URL = gen_filepath(n_URL, 0);
26745        ID = gen_const_char_ptr(n_ID, 1);
26746        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
26747
26748        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
26749        desret_xmlParserInputPtr(ret_val);
26750        call_tests++;
26751        des_filepath(n_URL, URL, 0);
26752        des_const_char_ptr(n_ID, (const char *)ID, 1);
26753        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
26754        xmlResetLastError();
26755        if (mem_base != xmlMemBlocks()) {
26756            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
26757	           xmlMemBlocks() - mem_base);
26758	    test_ret++;
26759            printf(" %d", n_URL);
26760            printf(" %d", n_ID);
26761            printf(" %d", n_ctxt);
26762            printf("\n");
26763        }
26764    }
26765    }
26766    }
26767    function_tests++;
26768
26769    return(test_ret);
26770}
26771
26772
26773static int
26774test_xmlNormalizeWindowsPath(void) {
26775    int test_ret = 0;
26776
26777    int mem_base;
26778    xmlChar * ret_val;
26779    xmlChar * path; /* the input file path */
26780    int n_path;
26781
26782    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
26783        mem_base = xmlMemBlocks();
26784        path = gen_const_xmlChar_ptr(n_path, 0);
26785
26786        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
26787        desret_xmlChar_ptr(ret_val);
26788        call_tests++;
26789        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
26790        xmlResetLastError();
26791        if (mem_base != xmlMemBlocks()) {
26792            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
26793	           xmlMemBlocks() - mem_base);
26794	    test_ret++;
26795            printf(" %d", n_path);
26796            printf("\n");
26797        }
26798    }
26799    function_tests++;
26800
26801    return(test_ret);
26802}
26803
26804
26805static int
26806test_xmlOutputBufferCreateFd(void) {
26807    int test_ret = 0;
26808
26809#ifdef LIBXML_OUTPUT_ENABLED
26810    int mem_base;
26811    xmlOutputBufferPtr ret_val;
26812    int fd; /* a file descriptor number */
26813    int n_fd;
26814    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26815    int n_encoder;
26816
26817    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
26818    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26819        mem_base = xmlMemBlocks();
26820        fd = gen_int(n_fd, 0);
26821        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
26822
26823        ret_val = xmlOutputBufferCreateFd(fd, encoder);
26824        desret_xmlOutputBufferPtr(ret_val);
26825        call_tests++;
26826        des_int(n_fd, fd, 0);
26827        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
26828        xmlResetLastError();
26829        if (mem_base != xmlMemBlocks()) {
26830            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
26831	           xmlMemBlocks() - mem_base);
26832	    test_ret++;
26833            printf(" %d", n_fd);
26834            printf(" %d", n_encoder);
26835            printf("\n");
26836        }
26837    }
26838    }
26839    function_tests++;
26840#endif
26841
26842    return(test_ret);
26843}
26844
26845
26846static int
26847test_xmlOutputBufferCreateFile(void) {
26848    int test_ret = 0;
26849
26850#ifdef LIBXML_OUTPUT_ENABLED
26851    int mem_base;
26852    xmlOutputBufferPtr ret_val;
26853    FILE * file; /* a FILE* */
26854    int n_file;
26855    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26856    int n_encoder;
26857
26858    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
26859    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26860        mem_base = xmlMemBlocks();
26861        file = gen_FILE_ptr(n_file, 0);
26862        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
26863
26864        ret_val = xmlOutputBufferCreateFile(file, encoder);
26865        desret_xmlOutputBufferPtr(ret_val);
26866        call_tests++;
26867        des_FILE_ptr(n_file, file, 0);
26868        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
26869        xmlResetLastError();
26870        if (mem_base != xmlMemBlocks()) {
26871            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
26872	           xmlMemBlocks() - mem_base);
26873	    test_ret++;
26874            printf(" %d", n_file);
26875            printf(" %d", n_encoder);
26876            printf("\n");
26877        }
26878    }
26879    }
26880    function_tests++;
26881#endif
26882
26883    return(test_ret);
26884}
26885
26886
26887static int
26888test_xmlOutputBufferCreateFilename(void) {
26889    int test_ret = 0;
26890
26891#ifdef LIBXML_OUTPUT_ENABLED
26892    int mem_base;
26893    xmlOutputBufferPtr ret_val;
26894    const char * URI; /* a C string containing the URI or filename */
26895    int n_URI;
26896    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
26897    int n_encoder;
26898    int compression; /* the compression ration (0 none, 9 max). */
26899    int n_compression;
26900
26901    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
26902    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
26903    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
26904        mem_base = xmlMemBlocks();
26905        URI = gen_fileoutput(n_URI, 0);
26906        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
26907        compression = gen_int(n_compression, 2);
26908
26909        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
26910        desret_xmlOutputBufferPtr(ret_val);
26911        call_tests++;
26912        des_fileoutput(n_URI, URI, 0);
26913        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
26914        des_int(n_compression, compression, 2);
26915        xmlResetLastError();
26916        if (mem_base != xmlMemBlocks()) {
26917            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
26918	           xmlMemBlocks() - mem_base);
26919	    test_ret++;
26920            printf(" %d", n_URI);
26921            printf(" %d", n_encoder);
26922            printf(" %d", n_compression);
26923            printf("\n");
26924        }
26925    }
26926    }
26927    }
26928    function_tests++;
26929#endif
26930
26931    return(test_ret);
26932}
26933
26934
26935static int
26936test_xmlOutputBufferFlush(void) {
26937    int test_ret = 0;
26938
26939#ifdef LIBXML_OUTPUT_ENABLED
26940    int mem_base;
26941    int ret_val;
26942    xmlOutputBufferPtr out; /* a buffered output */
26943    int n_out;
26944
26945    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
26946        mem_base = xmlMemBlocks();
26947        out = gen_xmlOutputBufferPtr(n_out, 0);
26948
26949        ret_val = xmlOutputBufferFlush(out);
26950        desret_int(ret_val);
26951        call_tests++;
26952        des_xmlOutputBufferPtr(n_out, out, 0);
26953        xmlResetLastError();
26954        if (mem_base != xmlMemBlocks()) {
26955            printf("Leak of %d blocks found in xmlOutputBufferFlush",
26956	           xmlMemBlocks() - mem_base);
26957	    test_ret++;
26958            printf(" %d", n_out);
26959            printf("\n");
26960        }
26961    }
26962    function_tests++;
26963#endif
26964
26965    return(test_ret);
26966}
26967
26968
26969static int
26970test_xmlOutputBufferWrite(void) {
26971    int test_ret = 0;
26972
26973#ifdef LIBXML_OUTPUT_ENABLED
26974    int mem_base;
26975    int ret_val;
26976    xmlOutputBufferPtr out; /* a buffered parser output */
26977    int n_out;
26978    int len; /* the size in bytes of the array. */
26979    int n_len;
26980    char * buf; /* an char array */
26981    int n_buf;
26982
26983    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
26984    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26985    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
26986        mem_base = xmlMemBlocks();
26987        out = gen_xmlOutputBufferPtr(n_out, 0);
26988        len = gen_int(n_len, 1);
26989        buf = gen_const_char_ptr(n_buf, 2);
26990
26991        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
26992        desret_int(ret_val);
26993        call_tests++;
26994        des_xmlOutputBufferPtr(n_out, out, 0);
26995        des_int(n_len, len, 1);
26996        des_const_char_ptr(n_buf, (const char *)buf, 2);
26997        xmlResetLastError();
26998        if (mem_base != xmlMemBlocks()) {
26999            printf("Leak of %d blocks found in xmlOutputBufferWrite",
27000	           xmlMemBlocks() - mem_base);
27001	    test_ret++;
27002            printf(" %d", n_out);
27003            printf(" %d", n_len);
27004            printf(" %d", n_buf);
27005            printf("\n");
27006        }
27007    }
27008    }
27009    }
27010    function_tests++;
27011#endif
27012
27013    return(test_ret);
27014}
27015
27016
27017static int
27018test_xmlOutputBufferWriteEscape(void) {
27019    int test_ret = 0;
27020
27021
27022    /* missing type support */
27023    return(test_ret);
27024}
27025
27026
27027static int
27028test_xmlOutputBufferWriteString(void) {
27029    int test_ret = 0;
27030
27031#ifdef LIBXML_OUTPUT_ENABLED
27032    int mem_base;
27033    int ret_val;
27034    xmlOutputBufferPtr out; /* a buffered parser output */
27035    int n_out;
27036    char * str; /* a zero terminated C string */
27037    int n_str;
27038
27039    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
27040    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
27041        mem_base = xmlMemBlocks();
27042        out = gen_xmlOutputBufferPtr(n_out, 0);
27043        str = gen_const_char_ptr(n_str, 1);
27044
27045        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
27046        desret_int(ret_val);
27047        call_tests++;
27048        des_xmlOutputBufferPtr(n_out, out, 0);
27049        des_const_char_ptr(n_str, (const char *)str, 1);
27050        xmlResetLastError();
27051        if (mem_base != xmlMemBlocks()) {
27052            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
27053	           xmlMemBlocks() - mem_base);
27054	    test_ret++;
27055            printf(" %d", n_out);
27056            printf(" %d", n_str);
27057            printf("\n");
27058        }
27059    }
27060    }
27061    function_tests++;
27062#endif
27063
27064    return(test_ret);
27065}
27066
27067
27068static int
27069test_xmlParserGetDirectory(void) {
27070    int test_ret = 0;
27071
27072
27073    /* missing type support */
27074    return(test_ret);
27075}
27076
27077
27078static int
27079test_xmlParserInputBufferCreateFd(void) {
27080    int test_ret = 0;
27081
27082    int mem_base;
27083    xmlParserInputBufferPtr ret_val;
27084    int fd; /* a file descriptor number */
27085    int n_fd;
27086    xmlCharEncoding enc; /* the charset encoding if known */
27087    int n_enc;
27088
27089    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27090    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27091        mem_base = xmlMemBlocks();
27092        fd = gen_int(n_fd, 0);
27093        enc = gen_xmlCharEncoding(n_enc, 1);
27094        if (fd >= 0) fd = -1;
27095
27096        ret_val = xmlParserInputBufferCreateFd(fd, enc);
27097        desret_xmlParserInputBufferPtr(ret_val);
27098        call_tests++;
27099        des_int(n_fd, fd, 0);
27100        des_xmlCharEncoding(n_enc, enc, 1);
27101        xmlResetLastError();
27102        if (mem_base != xmlMemBlocks()) {
27103            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
27104	           xmlMemBlocks() - mem_base);
27105	    test_ret++;
27106            printf(" %d", n_fd);
27107            printf(" %d", n_enc);
27108            printf("\n");
27109        }
27110    }
27111    }
27112    function_tests++;
27113
27114    return(test_ret);
27115}
27116
27117
27118static int
27119test_xmlParserInputBufferCreateFile(void) {
27120    int test_ret = 0;
27121
27122    int mem_base;
27123    xmlParserInputBufferPtr ret_val;
27124    FILE * file; /* a FILE* */
27125    int n_file;
27126    xmlCharEncoding enc; /* the charset encoding if known */
27127    int n_enc;
27128
27129    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
27130    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27131        mem_base = xmlMemBlocks();
27132        file = gen_FILE_ptr(n_file, 0);
27133        enc = gen_xmlCharEncoding(n_enc, 1);
27134
27135        ret_val = xmlParserInputBufferCreateFile(file, enc);
27136        desret_xmlParserInputBufferPtr(ret_val);
27137        call_tests++;
27138        des_FILE_ptr(n_file, file, 0);
27139        des_xmlCharEncoding(n_enc, enc, 1);
27140        xmlResetLastError();
27141        if (mem_base != xmlMemBlocks()) {
27142            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
27143	           xmlMemBlocks() - mem_base);
27144	    test_ret++;
27145            printf(" %d", n_file);
27146            printf(" %d", n_enc);
27147            printf("\n");
27148        }
27149    }
27150    }
27151    function_tests++;
27152
27153    return(test_ret);
27154}
27155
27156
27157static int
27158test_xmlParserInputBufferCreateFilename(void) {
27159    int test_ret = 0;
27160
27161    int mem_base;
27162    xmlParserInputBufferPtr ret_val;
27163    const char * URI; /* a C string containing the URI or filename */
27164    int n_URI;
27165    xmlCharEncoding enc; /* the charset encoding if known */
27166    int n_enc;
27167
27168    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
27169    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27170        mem_base = xmlMemBlocks();
27171        URI = gen_fileoutput(n_URI, 0);
27172        enc = gen_xmlCharEncoding(n_enc, 1);
27173
27174        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
27175        desret_xmlParserInputBufferPtr(ret_val);
27176        call_tests++;
27177        des_fileoutput(n_URI, URI, 0);
27178        des_xmlCharEncoding(n_enc, enc, 1);
27179        xmlResetLastError();
27180        if (mem_base != xmlMemBlocks()) {
27181            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
27182	           xmlMemBlocks() - mem_base);
27183	    test_ret++;
27184            printf(" %d", n_URI);
27185            printf(" %d", n_enc);
27186            printf("\n");
27187        }
27188    }
27189    }
27190    function_tests++;
27191
27192    return(test_ret);
27193}
27194
27195
27196static int
27197test_xmlParserInputBufferCreateMem(void) {
27198    int test_ret = 0;
27199
27200    int mem_base;
27201    xmlParserInputBufferPtr ret_val;
27202    char * mem; /* the memory input */
27203    int n_mem;
27204    int size; /* the length of the memory block */
27205    int n_size;
27206    xmlCharEncoding enc; /* the charset encoding if known */
27207    int n_enc;
27208
27209    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27210    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27211    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27212        mem_base = xmlMemBlocks();
27213        mem = gen_const_char_ptr(n_mem, 0);
27214        size = gen_int(n_size, 1);
27215        enc = gen_xmlCharEncoding(n_enc, 2);
27216
27217        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
27218        desret_xmlParserInputBufferPtr(ret_val);
27219        call_tests++;
27220        des_const_char_ptr(n_mem, (const char *)mem, 0);
27221        des_int(n_size, size, 1);
27222        des_xmlCharEncoding(n_enc, enc, 2);
27223        xmlResetLastError();
27224        if (mem_base != xmlMemBlocks()) {
27225            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
27226	           xmlMemBlocks() - mem_base);
27227	    test_ret++;
27228            printf(" %d", n_mem);
27229            printf(" %d", n_size);
27230            printf(" %d", n_enc);
27231            printf("\n");
27232        }
27233    }
27234    }
27235    }
27236    function_tests++;
27237
27238    return(test_ret);
27239}
27240
27241
27242static int
27243test_xmlParserInputBufferCreateStatic(void) {
27244    int test_ret = 0;
27245
27246    int mem_base;
27247    xmlParserInputBufferPtr ret_val;
27248    char * mem; /* the memory input */
27249    int n_mem;
27250    int size; /* the length of the memory block */
27251    int n_size;
27252    xmlCharEncoding enc; /* the charset encoding if known */
27253    int n_enc;
27254
27255    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
27256    for (n_size = 0;n_size < gen_nb_int;n_size++) {
27257    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27258        mem_base = xmlMemBlocks();
27259        mem = gen_const_char_ptr(n_mem, 0);
27260        size = gen_int(n_size, 1);
27261        enc = gen_xmlCharEncoding(n_enc, 2);
27262
27263        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
27264        desret_xmlParserInputBufferPtr(ret_val);
27265        call_tests++;
27266        des_const_char_ptr(n_mem, (const char *)mem, 0);
27267        des_int(n_size, size, 1);
27268        des_xmlCharEncoding(n_enc, enc, 2);
27269        xmlResetLastError();
27270        if (mem_base != xmlMemBlocks()) {
27271            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
27272	           xmlMemBlocks() - mem_base);
27273	    test_ret++;
27274            printf(" %d", n_mem);
27275            printf(" %d", n_size);
27276            printf(" %d", n_enc);
27277            printf("\n");
27278        }
27279    }
27280    }
27281    }
27282    function_tests++;
27283
27284    return(test_ret);
27285}
27286
27287
27288static int
27289test_xmlParserInputBufferGrow(void) {
27290    int test_ret = 0;
27291
27292    int mem_base;
27293    int ret_val;
27294    xmlParserInputBufferPtr in; /* a buffered parser input */
27295    int n_in;
27296    int len; /* indicative value of the amount of chars to read */
27297    int n_len;
27298
27299    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27300    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27301        mem_base = xmlMemBlocks();
27302        in = gen_xmlParserInputBufferPtr(n_in, 0);
27303        len = gen_int(n_len, 1);
27304
27305        ret_val = xmlParserInputBufferGrow(in, len);
27306        desret_int(ret_val);
27307        call_tests++;
27308        des_xmlParserInputBufferPtr(n_in, in, 0);
27309        des_int(n_len, len, 1);
27310        xmlResetLastError();
27311        if (mem_base != xmlMemBlocks()) {
27312            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
27313	           xmlMemBlocks() - mem_base);
27314	    test_ret++;
27315            printf(" %d", n_in);
27316            printf(" %d", n_len);
27317            printf("\n");
27318        }
27319    }
27320    }
27321    function_tests++;
27322
27323    return(test_ret);
27324}
27325
27326
27327static int
27328test_xmlParserInputBufferPush(void) {
27329    int test_ret = 0;
27330
27331    int mem_base;
27332    int ret_val;
27333    xmlParserInputBufferPtr in; /* a buffered parser input */
27334    int n_in;
27335    int len; /* the size in bytes of the array. */
27336    int n_len;
27337    char * buf; /* an char array */
27338    int n_buf;
27339
27340    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27341    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27342    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
27343        mem_base = xmlMemBlocks();
27344        in = gen_xmlParserInputBufferPtr(n_in, 0);
27345        len = gen_int(n_len, 1);
27346        buf = gen_const_char_ptr(n_buf, 2);
27347
27348        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
27349        desret_int(ret_val);
27350        call_tests++;
27351        des_xmlParserInputBufferPtr(n_in, in, 0);
27352        des_int(n_len, len, 1);
27353        des_const_char_ptr(n_buf, (const char *)buf, 2);
27354        xmlResetLastError();
27355        if (mem_base != xmlMemBlocks()) {
27356            printf("Leak of %d blocks found in xmlParserInputBufferPush",
27357	           xmlMemBlocks() - mem_base);
27358	    test_ret++;
27359            printf(" %d", n_in);
27360            printf(" %d", n_len);
27361            printf(" %d", n_buf);
27362            printf("\n");
27363        }
27364    }
27365    }
27366    }
27367    function_tests++;
27368
27369    return(test_ret);
27370}
27371
27372
27373static int
27374test_xmlParserInputBufferRead(void) {
27375    int test_ret = 0;
27376
27377    int mem_base;
27378    int ret_val;
27379    xmlParserInputBufferPtr in; /* a buffered parser input */
27380    int n_in;
27381    int len; /* indicative value of the amount of chars to read */
27382    int n_len;
27383
27384    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
27385    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27386        mem_base = xmlMemBlocks();
27387        in = gen_xmlParserInputBufferPtr(n_in, 0);
27388        len = gen_int(n_len, 1);
27389
27390        ret_val = xmlParserInputBufferRead(in, len);
27391        desret_int(ret_val);
27392        call_tests++;
27393        des_xmlParserInputBufferPtr(n_in, in, 0);
27394        des_int(n_len, len, 1);
27395        xmlResetLastError();
27396        if (mem_base != xmlMemBlocks()) {
27397            printf("Leak of %d blocks found in xmlParserInputBufferRead",
27398	           xmlMemBlocks() - mem_base);
27399	    test_ret++;
27400            printf(" %d", n_in);
27401            printf(" %d", n_len);
27402            printf("\n");
27403        }
27404    }
27405    }
27406    function_tests++;
27407
27408    return(test_ret);
27409}
27410
27411
27412static int
27413test_xmlPopInputCallbacks(void) {
27414    int test_ret = 0;
27415
27416    int mem_base;
27417    int ret_val;
27418
27419        mem_base = xmlMemBlocks();
27420
27421        ret_val = xmlPopInputCallbacks();
27422        desret_int(ret_val);
27423        call_tests++;
27424        xmlResetLastError();
27425        if (mem_base != xmlMemBlocks()) {
27426            printf("Leak of %d blocks found in xmlPopInputCallbacks",
27427	           xmlMemBlocks() - mem_base);
27428	    test_ret++;
27429            printf("\n");
27430        }
27431    function_tests++;
27432
27433    return(test_ret);
27434}
27435
27436
27437static int
27438test_xmlRegisterDefaultInputCallbacks(void) {
27439    int test_ret = 0;
27440
27441    int mem_base;
27442
27443        mem_base = xmlMemBlocks();
27444
27445        xmlRegisterDefaultInputCallbacks();
27446        call_tests++;
27447        xmlResetLastError();
27448        if (mem_base != xmlMemBlocks()) {
27449            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
27450	           xmlMemBlocks() - mem_base);
27451	    test_ret++;
27452            printf("\n");
27453        }
27454    function_tests++;
27455
27456    return(test_ret);
27457}
27458
27459
27460static int
27461test_xmlRegisterDefaultOutputCallbacks(void) {
27462    int test_ret = 0;
27463
27464#ifdef LIBXML_OUTPUT_ENABLED
27465    int mem_base;
27466
27467        mem_base = xmlMemBlocks();
27468
27469        xmlRegisterDefaultOutputCallbacks();
27470        call_tests++;
27471        xmlResetLastError();
27472        if (mem_base != xmlMemBlocks()) {
27473            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
27474	           xmlMemBlocks() - mem_base);
27475	    test_ret++;
27476            printf("\n");
27477        }
27478    function_tests++;
27479#endif
27480
27481    return(test_ret);
27482}
27483
27484
27485static int
27486test_xmlRegisterHTTPPostCallbacks(void) {
27487    int test_ret = 0;
27488
27489#ifdef LIBXML_HTTP_ENABLED
27490    int mem_base;
27491
27492        mem_base = xmlMemBlocks();
27493
27494        xmlRegisterHTTPPostCallbacks();
27495        call_tests++;
27496        xmlResetLastError();
27497        if (mem_base != xmlMemBlocks()) {
27498            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
27499	           xmlMemBlocks() - mem_base);
27500	    test_ret++;
27501            printf("\n");
27502        }
27503    function_tests++;
27504#endif
27505
27506    return(test_ret);
27507}
27508
27509static int
27510test_xmlIO(void) {
27511    int test_ret = 0;
27512
27513    if (quiet == 0) printf("Testing xmlIO : 38 of 47 functions ...\n");
27514    test_ret += test_xmlAllocOutputBuffer();
27515    test_ret += test_xmlAllocParserInputBuffer();
27516    test_ret += test_xmlCheckFilename();
27517    test_ret += test_xmlCheckHTTPInput();
27518    test_ret += test_xmlCleanupInputCallbacks();
27519    test_ret += test_xmlCleanupOutputCallbacks();
27520    test_ret += test_xmlFileClose();
27521    test_ret += test_xmlFileMatch();
27522    test_ret += test_xmlFileOpen();
27523    test_ret += test_xmlFileRead();
27524    test_ret += test_xmlIOFTPClose();
27525    test_ret += test_xmlIOFTPMatch();
27526    test_ret += test_xmlIOFTPOpen();
27527    test_ret += test_xmlIOFTPRead();
27528    test_ret += test_xmlIOHTTPClose();
27529    test_ret += test_xmlIOHTTPMatch();
27530    test_ret += test_xmlIOHTTPOpen();
27531    test_ret += test_xmlIOHTTPOpenW();
27532    test_ret += test_xmlIOHTTPRead();
27533    test_ret += test_xmlNoNetExternalEntityLoader();
27534    test_ret += test_xmlNormalizeWindowsPath();
27535    test_ret += test_xmlOutputBufferCreateFd();
27536    test_ret += test_xmlOutputBufferCreateFile();
27537    test_ret += test_xmlOutputBufferCreateFilename();
27538    test_ret += test_xmlOutputBufferFlush();
27539    test_ret += test_xmlOutputBufferWrite();
27540    test_ret += test_xmlOutputBufferWriteEscape();
27541    test_ret += test_xmlOutputBufferWriteString();
27542    test_ret += test_xmlParserGetDirectory();
27543    test_ret += test_xmlParserInputBufferCreateFd();
27544    test_ret += test_xmlParserInputBufferCreateFile();
27545    test_ret += test_xmlParserInputBufferCreateFilename();
27546    test_ret += test_xmlParserInputBufferCreateMem();
27547    test_ret += test_xmlParserInputBufferCreateStatic();
27548    test_ret += test_xmlParserInputBufferGrow();
27549    test_ret += test_xmlParserInputBufferPush();
27550    test_ret += test_xmlParserInputBufferRead();
27551    test_ret += test_xmlPopInputCallbacks();
27552    test_ret += test_xmlRegisterDefaultInputCallbacks();
27553    test_ret += test_xmlRegisterDefaultOutputCallbacks();
27554    test_ret += test_xmlRegisterHTTPPostCallbacks();
27555
27556    if (test_ret != 0)
27557	printf("Module xmlIO: %d errors\n", test_ret);
27558    return(test_ret);
27559}
27560#ifdef LIBXML_AUTOMATA_ENABLED
27561
27562#define gen_nb_xmlAutomataPtr 1
27563static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27564    return(NULL);
27565}
27566static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27567}
27568#endif
27569
27570
27571static int
27572test_xmlAutomataCompile(void) {
27573    int test_ret = 0;
27574
27575
27576    /* missing type support */
27577    return(test_ret);
27578}
27579
27580
27581static int
27582test_xmlAutomataGetInitState(void) {
27583    int test_ret = 0;
27584
27585
27586    /* missing type support */
27587    return(test_ret);
27588}
27589
27590
27591static int
27592test_xmlAutomataIsDeterminist(void) {
27593    int test_ret = 0;
27594
27595#ifdef LIBXML_AUTOMATA_ENABLED
27596    int mem_base;
27597    int ret_val;
27598    xmlAutomataPtr am; /* an automata */
27599    int n_am;
27600
27601    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27602        mem_base = xmlMemBlocks();
27603        am = gen_xmlAutomataPtr(n_am, 0);
27604
27605        ret_val = xmlAutomataIsDeterminist(am);
27606        desret_int(ret_val);
27607        call_tests++;
27608        des_xmlAutomataPtr(n_am, am, 0);
27609        xmlResetLastError();
27610        if (mem_base != xmlMemBlocks()) {
27611            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
27612	           xmlMemBlocks() - mem_base);
27613	    test_ret++;
27614            printf(" %d", n_am);
27615            printf("\n");
27616        }
27617    }
27618    function_tests++;
27619#endif
27620
27621    return(test_ret);
27622}
27623
27624#ifdef LIBXML_AUTOMATA_ENABLED
27625
27626#define gen_nb_xmlAutomataStatePtr 1
27627static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27628    return(NULL);
27629}
27630static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27631}
27632#endif
27633
27634
27635static int
27636test_xmlAutomataNewAllTrans(void) {
27637    int test_ret = 0;
27638
27639
27640    /* missing type support */
27641    return(test_ret);
27642}
27643
27644
27645static int
27646test_xmlAutomataNewCountTrans(void) {
27647    int test_ret = 0;
27648
27649
27650    /* missing type support */
27651    return(test_ret);
27652}
27653
27654
27655static int
27656test_xmlAutomataNewCountTrans2(void) {
27657    int test_ret = 0;
27658
27659
27660    /* missing type support */
27661    return(test_ret);
27662}
27663
27664
27665static int
27666test_xmlAutomataNewCountedTrans(void) {
27667    int test_ret = 0;
27668
27669
27670    /* missing type support */
27671    return(test_ret);
27672}
27673
27674
27675static int
27676test_xmlAutomataNewCounter(void) {
27677    int test_ret = 0;
27678
27679#ifdef LIBXML_AUTOMATA_ENABLED
27680    int mem_base;
27681    int ret_val;
27682    xmlAutomataPtr am; /* an automata */
27683    int n_am;
27684    int min; /* the minimal value on the counter */
27685    int n_min;
27686    int max; /* the maximal value on the counter */
27687    int n_max;
27688
27689    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27690    for (n_min = 0;n_min < gen_nb_int;n_min++) {
27691    for (n_max = 0;n_max < gen_nb_int;n_max++) {
27692        mem_base = xmlMemBlocks();
27693        am = gen_xmlAutomataPtr(n_am, 0);
27694        min = gen_int(n_min, 1);
27695        max = gen_int(n_max, 2);
27696
27697        ret_val = xmlAutomataNewCounter(am, min, max);
27698        desret_int(ret_val);
27699        call_tests++;
27700        des_xmlAutomataPtr(n_am, am, 0);
27701        des_int(n_min, min, 1);
27702        des_int(n_max, max, 2);
27703        xmlResetLastError();
27704        if (mem_base != xmlMemBlocks()) {
27705            printf("Leak of %d blocks found in xmlAutomataNewCounter",
27706	           xmlMemBlocks() - mem_base);
27707	    test_ret++;
27708            printf(" %d", n_am);
27709            printf(" %d", n_min);
27710            printf(" %d", n_max);
27711            printf("\n");
27712        }
27713    }
27714    }
27715    }
27716    function_tests++;
27717#endif
27718
27719    return(test_ret);
27720}
27721
27722
27723static int
27724test_xmlAutomataNewCounterTrans(void) {
27725    int test_ret = 0;
27726
27727
27728    /* missing type support */
27729    return(test_ret);
27730}
27731
27732
27733static int
27734test_xmlAutomataNewEpsilon(void) {
27735    int test_ret = 0;
27736
27737
27738    /* missing type support */
27739    return(test_ret);
27740}
27741
27742
27743static int
27744test_xmlAutomataNewOnceTrans(void) {
27745    int test_ret = 0;
27746
27747
27748    /* missing type support */
27749    return(test_ret);
27750}
27751
27752
27753static int
27754test_xmlAutomataNewOnceTrans2(void) {
27755    int test_ret = 0;
27756
27757
27758    /* missing type support */
27759    return(test_ret);
27760}
27761
27762
27763static int
27764test_xmlAutomataNewState(void) {
27765    int test_ret = 0;
27766
27767
27768    /* missing type support */
27769    return(test_ret);
27770}
27771
27772
27773static int
27774test_xmlAutomataNewTransition(void) {
27775    int test_ret = 0;
27776
27777
27778    /* missing type support */
27779    return(test_ret);
27780}
27781
27782
27783static int
27784test_xmlAutomataNewTransition2(void) {
27785    int test_ret = 0;
27786
27787
27788    /* missing type support */
27789    return(test_ret);
27790}
27791
27792
27793static int
27794test_xmlAutomataSetFinalState(void) {
27795    int test_ret = 0;
27796
27797#ifdef LIBXML_AUTOMATA_ENABLED
27798    int mem_base;
27799    int ret_val;
27800    xmlAutomataPtr am; /* an automata */
27801    int n_am;
27802    xmlAutomataStatePtr state; /* a state in this automata */
27803    int n_state;
27804
27805    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
27806    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
27807        mem_base = xmlMemBlocks();
27808        am = gen_xmlAutomataPtr(n_am, 0);
27809        state = gen_xmlAutomataStatePtr(n_state, 1);
27810
27811        ret_val = xmlAutomataSetFinalState(am, state);
27812        desret_int(ret_val);
27813        call_tests++;
27814        des_xmlAutomataPtr(n_am, am, 0);
27815        des_xmlAutomataStatePtr(n_state, state, 1);
27816        xmlResetLastError();
27817        if (mem_base != xmlMemBlocks()) {
27818            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
27819	           xmlMemBlocks() - mem_base);
27820	    test_ret++;
27821            printf(" %d", n_am);
27822            printf(" %d", n_state);
27823            printf("\n");
27824        }
27825    }
27826    }
27827    function_tests++;
27828#endif
27829
27830    return(test_ret);
27831}
27832
27833
27834static int
27835test_xmlNewAutomata(void) {
27836    int test_ret = 0;
27837
27838
27839    /* missing type support */
27840    return(test_ret);
27841}
27842
27843static int
27844test_xmlautomata(void) {
27845    int test_ret = 0;
27846
27847    if (quiet == 0) printf("Testing xmlautomata : 3 of 18 functions ...\n");
27848    test_ret += test_xmlAutomataCompile();
27849    test_ret += test_xmlAutomataGetInitState();
27850    test_ret += test_xmlAutomataIsDeterminist();
27851    test_ret += test_xmlAutomataNewAllTrans();
27852    test_ret += test_xmlAutomataNewCountTrans();
27853    test_ret += test_xmlAutomataNewCountTrans2();
27854    test_ret += test_xmlAutomataNewCountedTrans();
27855    test_ret += test_xmlAutomataNewCounter();
27856    test_ret += test_xmlAutomataNewCounterTrans();
27857    test_ret += test_xmlAutomataNewEpsilon();
27858    test_ret += test_xmlAutomataNewOnceTrans();
27859    test_ret += test_xmlAutomataNewOnceTrans2();
27860    test_ret += test_xmlAutomataNewState();
27861    test_ret += test_xmlAutomataNewTransition();
27862    test_ret += test_xmlAutomataNewTransition2();
27863    test_ret += test_xmlAutomataSetFinalState();
27864    test_ret += test_xmlNewAutomata();
27865
27866    if (test_ret != 0)
27867	printf("Module xmlautomata: %d errors\n", test_ret);
27868    return(test_ret);
27869}
27870
27871#define gen_nb_xmlGenericErrorFunc_ptr 1
27872static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27873    return(NULL);
27874}
27875static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27876}
27877
27878static int
27879test_initGenericErrorDefaultFunc(void) {
27880    int test_ret = 0;
27881
27882    int mem_base;
27883    xmlGenericErrorFunc * handler; /* the handler */
27884    int n_handler;
27885
27886    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
27887        mem_base = xmlMemBlocks();
27888        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
27889
27890        initGenericErrorDefaultFunc(handler);
27891        call_tests++;
27892        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
27893        xmlResetLastError();
27894        if (mem_base != xmlMemBlocks()) {
27895            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
27896	           xmlMemBlocks() - mem_base);
27897	    test_ret++;
27898            printf(" %d", n_handler);
27899            printf("\n");
27900        }
27901    }
27902    function_tests++;
27903
27904    return(test_ret);
27905}
27906
27907
27908#define gen_nb_xmlErrorPtr 1
27909static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27910    return(NULL);
27911}
27912static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27913}
27914
27915static int
27916test_xmlCopyError(void) {
27917    int test_ret = 0;
27918
27919    int mem_base;
27920    int ret_val;
27921    xmlErrorPtr from; /* a source error */
27922    int n_from;
27923    xmlErrorPtr to; /* a target error */
27924    int n_to;
27925
27926    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
27927    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
27928        mem_base = xmlMemBlocks();
27929        from = gen_xmlErrorPtr(n_from, 0);
27930        to = gen_xmlErrorPtr(n_to, 1);
27931
27932        ret_val = xmlCopyError(from, to);
27933        desret_int(ret_val);
27934        call_tests++;
27935        des_xmlErrorPtr(n_from, from, 0);
27936        des_xmlErrorPtr(n_to, to, 1);
27937        xmlResetLastError();
27938        if (mem_base != xmlMemBlocks()) {
27939            printf("Leak of %d blocks found in xmlCopyError",
27940	           xmlMemBlocks() - mem_base);
27941	    test_ret++;
27942            printf(" %d", n_from);
27943            printf(" %d", n_to);
27944            printf("\n");
27945        }
27946    }
27947    }
27948    function_tests++;
27949
27950    return(test_ret);
27951}
27952
27953
27954static int
27955test_xmlCtxtGetLastError(void) {
27956    int test_ret = 0;
27957
27958
27959    /* missing type support */
27960    return(test_ret);
27961}
27962
27963
27964static int
27965test_xmlCtxtResetLastError(void) {
27966    int test_ret = 0;
27967
27968    int mem_base;
27969    void * ctx; /* an XML parser context */
27970    int n_ctx;
27971
27972    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
27973        mem_base = xmlMemBlocks();
27974        ctx = gen_void_ptr(n_ctx, 0);
27975
27976        xmlCtxtResetLastError(ctx);
27977        call_tests++;
27978        des_void_ptr(n_ctx, ctx, 0);
27979        xmlResetLastError();
27980        if (mem_base != xmlMemBlocks()) {
27981            printf("Leak of %d blocks found in xmlCtxtResetLastError",
27982	           xmlMemBlocks() - mem_base);
27983	    test_ret++;
27984            printf(" %d", n_ctx);
27985            printf("\n");
27986        }
27987    }
27988    function_tests++;
27989
27990    return(test_ret);
27991}
27992
27993
27994static int
27995test_xmlGetLastError(void) {
27996    int test_ret = 0;
27997
27998
27999    /* missing type support */
28000    return(test_ret);
28001}
28002
28003
28004static int
28005test_xmlParserError(void) {
28006    int test_ret = 0;
28007
28008
28009    /* missing type support */
28010    return(test_ret);
28011}
28012
28013
28014static int
28015test_xmlParserPrintFileContext(void) {
28016    int test_ret = 0;
28017
28018    int mem_base;
28019    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28020    int n_input;
28021
28022    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28023        mem_base = xmlMemBlocks();
28024        input = gen_xmlParserInputPtr(n_input, 0);
28025
28026        xmlParserPrintFileContext(input);
28027        call_tests++;
28028        des_xmlParserInputPtr(n_input, input, 0);
28029        xmlResetLastError();
28030        if (mem_base != xmlMemBlocks()) {
28031            printf("Leak of %d blocks found in xmlParserPrintFileContext",
28032	           xmlMemBlocks() - mem_base);
28033	    test_ret++;
28034            printf(" %d", n_input);
28035            printf("\n");
28036        }
28037    }
28038    function_tests++;
28039
28040    return(test_ret);
28041}
28042
28043
28044static int
28045test_xmlParserPrintFileInfo(void) {
28046    int test_ret = 0;
28047
28048    int mem_base;
28049    xmlParserInputPtr input; /* an xmlParserInputPtr input */
28050    int n_input;
28051
28052    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
28053        mem_base = xmlMemBlocks();
28054        input = gen_xmlParserInputPtr(n_input, 0);
28055
28056        xmlParserPrintFileInfo(input);
28057        call_tests++;
28058        des_xmlParserInputPtr(n_input, input, 0);
28059        xmlResetLastError();
28060        if (mem_base != xmlMemBlocks()) {
28061            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
28062	           xmlMemBlocks() - mem_base);
28063	    test_ret++;
28064            printf(" %d", n_input);
28065            printf("\n");
28066        }
28067    }
28068    function_tests++;
28069
28070    return(test_ret);
28071}
28072
28073
28074static int
28075test_xmlParserValidityError(void) {
28076    int test_ret = 0;
28077
28078
28079    /* missing type support */
28080    return(test_ret);
28081}
28082
28083
28084static int
28085test_xmlParserValidityWarning(void) {
28086    int test_ret = 0;
28087
28088
28089    /* missing type support */
28090    return(test_ret);
28091}
28092
28093
28094static int
28095test_xmlParserWarning(void) {
28096    int test_ret = 0;
28097
28098
28099    /* missing type support */
28100    return(test_ret);
28101}
28102
28103
28104static int
28105test_xmlResetError(void) {
28106    int test_ret = 0;
28107
28108    int mem_base;
28109    xmlErrorPtr err; /* pointer to the error. */
28110    int n_err;
28111
28112    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
28113        mem_base = xmlMemBlocks();
28114        err = gen_xmlErrorPtr(n_err, 0);
28115
28116        xmlResetError(err);
28117        call_tests++;
28118        des_xmlErrorPtr(n_err, err, 0);
28119        xmlResetLastError();
28120        if (mem_base != xmlMemBlocks()) {
28121            printf("Leak of %d blocks found in xmlResetError",
28122	           xmlMemBlocks() - mem_base);
28123	    test_ret++;
28124            printf(" %d", n_err);
28125            printf("\n");
28126        }
28127    }
28128    function_tests++;
28129
28130    return(test_ret);
28131}
28132
28133
28134static int
28135test_xmlResetLastError(void) {
28136    int test_ret = 0;
28137
28138
28139
28140        xmlResetLastError();
28141        call_tests++;
28142        xmlResetLastError();
28143    function_tests++;
28144
28145    return(test_ret);
28146}
28147
28148
28149static int
28150test_xmlSetGenericErrorFunc(void) {
28151    int test_ret = 0;
28152
28153
28154    /* missing type support */
28155    return(test_ret);
28156}
28157
28158
28159static int
28160test_xmlSetStructuredErrorFunc(void) {
28161    int test_ret = 0;
28162
28163
28164    /* missing type support */
28165    return(test_ret);
28166}
28167
28168static int
28169test_xmlerror(void) {
28170    int test_ret = 0;
28171
28172    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
28173    test_ret += test_initGenericErrorDefaultFunc();
28174    test_ret += test_xmlCopyError();
28175    test_ret += test_xmlCtxtGetLastError();
28176    test_ret += test_xmlCtxtResetLastError();
28177    test_ret += test_xmlGetLastError();
28178    test_ret += test_xmlParserError();
28179    test_ret += test_xmlParserPrintFileContext();
28180    test_ret += test_xmlParserPrintFileInfo();
28181    test_ret += test_xmlParserValidityError();
28182    test_ret += test_xmlParserValidityWarning();
28183    test_ret += test_xmlParserWarning();
28184    test_ret += test_xmlResetError();
28185    test_ret += test_xmlResetLastError();
28186    test_ret += test_xmlSetGenericErrorFunc();
28187    test_ret += test_xmlSetStructuredErrorFunc();
28188
28189    if (test_ret != 0)
28190	printf("Module xmlerror: %d errors\n", test_ret);
28191    return(test_ret);
28192}
28193
28194static int
28195test_xmlNewTextReader(void) {
28196    int test_ret = 0;
28197
28198#ifdef LIBXML_READER_ENABLED
28199    int mem_base;
28200    xmlTextReaderPtr ret_val;
28201    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
28202    int n_input;
28203    const char * URI; /* the URI information for the source if available */
28204    int n_URI;
28205
28206    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
28207    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
28208        mem_base = xmlMemBlocks();
28209        input = gen_xmlParserInputBufferPtr(n_input, 0);
28210        URI = gen_filepath(n_URI, 1);
28211
28212        ret_val = xmlNewTextReader(input, URI);
28213        desret_xmlTextReaderPtr(ret_val);
28214        call_tests++;
28215        des_xmlParserInputBufferPtr(n_input, input, 0);
28216        des_filepath(n_URI, URI, 1);
28217        xmlResetLastError();
28218        if (mem_base != xmlMemBlocks()) {
28219            printf("Leak of %d blocks found in xmlNewTextReader",
28220	           xmlMemBlocks() - mem_base);
28221	    test_ret++;
28222            printf(" %d", n_input);
28223            printf(" %d", n_URI);
28224            printf("\n");
28225        }
28226    }
28227    }
28228    function_tests++;
28229#endif
28230
28231    return(test_ret);
28232}
28233
28234
28235static int
28236test_xmlNewTextReaderFilename(void) {
28237    int test_ret = 0;
28238
28239#ifdef LIBXML_READER_ENABLED
28240    int mem_base;
28241    xmlTextReaderPtr ret_val;
28242    const char * URI; /* the URI of the resource to process */
28243    int n_URI;
28244
28245    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
28246        mem_base = xmlMemBlocks();
28247        URI = gen_filepath(n_URI, 0);
28248
28249        ret_val = xmlNewTextReaderFilename(URI);
28250        desret_xmlTextReaderPtr(ret_val);
28251        call_tests++;
28252        des_filepath(n_URI, URI, 0);
28253        xmlResetLastError();
28254        if (mem_base != xmlMemBlocks()) {
28255            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
28256	           xmlMemBlocks() - mem_base);
28257	    test_ret++;
28258            printf(" %d", n_URI);
28259            printf("\n");
28260        }
28261    }
28262    function_tests++;
28263#endif
28264
28265    return(test_ret);
28266}
28267
28268
28269static int
28270test_xmlReaderForDoc(void) {
28271    int test_ret = 0;
28272
28273#ifdef LIBXML_READER_ENABLED
28274    int mem_base;
28275    xmlTextReaderPtr ret_val;
28276    xmlChar * cur; /* a pointer to a zero terminated string */
28277    int n_cur;
28278    const char * URL; /* the base URL to use for the document */
28279    int n_URL;
28280    char * encoding; /* the document encoding, or NULL */
28281    int n_encoding;
28282    int options; /* a combination of xmlParserOption */
28283    int n_options;
28284
28285    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28286    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28287    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28288    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28289        mem_base = xmlMemBlocks();
28290        cur = gen_const_xmlChar_ptr(n_cur, 0);
28291        URL = gen_filepath(n_URL, 1);
28292        encoding = gen_const_char_ptr(n_encoding, 2);
28293        options = gen_parseroptions(n_options, 3);
28294
28295        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
28296        desret_xmlTextReaderPtr(ret_val);
28297        call_tests++;
28298        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
28299        des_filepath(n_URL, URL, 1);
28300        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
28301        des_parseroptions(n_options, options, 3);
28302        xmlResetLastError();
28303        if (mem_base != xmlMemBlocks()) {
28304            printf("Leak of %d blocks found in xmlReaderForDoc",
28305	           xmlMemBlocks() - mem_base);
28306	    test_ret++;
28307            printf(" %d", n_cur);
28308            printf(" %d", n_URL);
28309            printf(" %d", n_encoding);
28310            printf(" %d", n_options);
28311            printf("\n");
28312        }
28313    }
28314    }
28315    }
28316    }
28317    function_tests++;
28318#endif
28319
28320    return(test_ret);
28321}
28322
28323
28324static int
28325test_xmlReaderForFile(void) {
28326    int test_ret = 0;
28327
28328#ifdef LIBXML_READER_ENABLED
28329    int mem_base;
28330    xmlTextReaderPtr ret_val;
28331    const char * filename; /* a file or URL */
28332    int n_filename;
28333    char * encoding; /* the document encoding, or NULL */
28334    int n_encoding;
28335    int options; /* a combination of xmlParserOption */
28336    int n_options;
28337
28338    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28339    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28340    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28341        mem_base = xmlMemBlocks();
28342        filename = gen_filepath(n_filename, 0);
28343        encoding = gen_const_char_ptr(n_encoding, 1);
28344        options = gen_parseroptions(n_options, 2);
28345
28346        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
28347        desret_xmlTextReaderPtr(ret_val);
28348        call_tests++;
28349        des_filepath(n_filename, filename, 0);
28350        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
28351        des_parseroptions(n_options, options, 2);
28352        xmlResetLastError();
28353        if (mem_base != xmlMemBlocks()) {
28354            printf("Leak of %d blocks found in xmlReaderForFile",
28355	           xmlMemBlocks() - mem_base);
28356	    test_ret++;
28357            printf(" %d", n_filename);
28358            printf(" %d", n_encoding);
28359            printf(" %d", n_options);
28360            printf("\n");
28361        }
28362    }
28363    }
28364    }
28365    function_tests++;
28366#endif
28367
28368    return(test_ret);
28369}
28370
28371
28372static int
28373test_xmlReaderForMemory(void) {
28374    int test_ret = 0;
28375
28376#ifdef LIBXML_READER_ENABLED
28377    int mem_base;
28378    xmlTextReaderPtr ret_val;
28379    char * buffer; /* a pointer to a char array */
28380    int n_buffer;
28381    int size; /* the size of the array */
28382    int n_size;
28383    const char * URL; /* the base URL to use for the document */
28384    int n_URL;
28385    char * encoding; /* the document encoding, or NULL */
28386    int n_encoding;
28387    int options; /* a combination of xmlParserOption */
28388    int n_options;
28389
28390    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28391    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28392    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28393    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28394    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28395        mem_base = xmlMemBlocks();
28396        buffer = gen_const_char_ptr(n_buffer, 0);
28397        size = gen_int(n_size, 1);
28398        URL = gen_filepath(n_URL, 2);
28399        encoding = gen_const_char_ptr(n_encoding, 3);
28400        options = gen_parseroptions(n_options, 4);
28401
28402        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
28403        desret_xmlTextReaderPtr(ret_val);
28404        call_tests++;
28405        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
28406        des_int(n_size, size, 1);
28407        des_filepath(n_URL, URL, 2);
28408        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
28409        des_parseroptions(n_options, options, 4);
28410        xmlResetLastError();
28411        if (mem_base != xmlMemBlocks()) {
28412            printf("Leak of %d blocks found in xmlReaderForMemory",
28413	           xmlMemBlocks() - mem_base);
28414	    test_ret++;
28415            printf(" %d", n_buffer);
28416            printf(" %d", n_size);
28417            printf(" %d", n_URL);
28418            printf(" %d", n_encoding);
28419            printf(" %d", n_options);
28420            printf("\n");
28421        }
28422    }
28423    }
28424    }
28425    }
28426    }
28427    function_tests++;
28428#endif
28429
28430    return(test_ret);
28431}
28432
28433
28434static int
28435test_xmlReaderNewDoc(void) {
28436    int test_ret = 0;
28437
28438#ifdef LIBXML_READER_ENABLED
28439    int mem_base;
28440    int ret_val;
28441    xmlTextReaderPtr reader; /* an XML reader */
28442    int n_reader;
28443    xmlChar * cur; /* a pointer to a zero terminated string */
28444    int n_cur;
28445    const char * URL; /* the base URL to use for the document */
28446    int n_URL;
28447    char * encoding; /* the document encoding, or NULL */
28448    int n_encoding;
28449    int options; /* a combination of xmlParserOption */
28450    int n_options;
28451
28452    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28453    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
28454    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28455    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28456    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28457        mem_base = xmlMemBlocks();
28458        reader = gen_xmlTextReaderPtr(n_reader, 0);
28459        cur = gen_const_xmlChar_ptr(n_cur, 1);
28460        URL = gen_filepath(n_URL, 2);
28461        encoding = gen_const_char_ptr(n_encoding, 3);
28462        options = gen_parseroptions(n_options, 4);
28463
28464        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
28465        desret_int(ret_val);
28466        call_tests++;
28467        des_xmlTextReaderPtr(n_reader, reader, 0);
28468        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
28469        des_filepath(n_URL, URL, 2);
28470        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
28471        des_parseroptions(n_options, options, 4);
28472        xmlResetLastError();
28473        if (mem_base != xmlMemBlocks()) {
28474            printf("Leak of %d blocks found in xmlReaderNewDoc",
28475	           xmlMemBlocks() - mem_base);
28476	    test_ret++;
28477            printf(" %d", n_reader);
28478            printf(" %d", n_cur);
28479            printf(" %d", n_URL);
28480            printf(" %d", n_encoding);
28481            printf(" %d", n_options);
28482            printf("\n");
28483        }
28484    }
28485    }
28486    }
28487    }
28488    }
28489    function_tests++;
28490#endif
28491
28492    return(test_ret);
28493}
28494
28495
28496static int
28497test_xmlReaderNewFile(void) {
28498    int test_ret = 0;
28499
28500#ifdef LIBXML_READER_ENABLED
28501    int mem_base;
28502    int ret_val;
28503    xmlTextReaderPtr reader; /* an XML reader */
28504    int n_reader;
28505    const char * filename; /* a file or URL */
28506    int n_filename;
28507    char * encoding; /* the document encoding, or NULL */
28508    int n_encoding;
28509    int options; /* a combination of xmlParserOption */
28510    int n_options;
28511
28512    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28513    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28514    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28515    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28516        mem_base = xmlMemBlocks();
28517        reader = gen_xmlTextReaderPtr(n_reader, 0);
28518        filename = gen_filepath(n_filename, 1);
28519        encoding = gen_const_char_ptr(n_encoding, 2);
28520        options = gen_parseroptions(n_options, 3);
28521
28522        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
28523        desret_int(ret_val);
28524        call_tests++;
28525        des_xmlTextReaderPtr(n_reader, reader, 0);
28526        des_filepath(n_filename, filename, 1);
28527        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
28528        des_parseroptions(n_options, options, 3);
28529        xmlResetLastError();
28530        if (mem_base != xmlMemBlocks()) {
28531            printf("Leak of %d blocks found in xmlReaderNewFile",
28532	           xmlMemBlocks() - mem_base);
28533	    test_ret++;
28534            printf(" %d", n_reader);
28535            printf(" %d", n_filename);
28536            printf(" %d", n_encoding);
28537            printf(" %d", n_options);
28538            printf("\n");
28539        }
28540    }
28541    }
28542    }
28543    }
28544    function_tests++;
28545#endif
28546
28547    return(test_ret);
28548}
28549
28550
28551static int
28552test_xmlReaderNewMemory(void) {
28553    int test_ret = 0;
28554
28555#ifdef LIBXML_READER_ENABLED
28556    int mem_base;
28557    int ret_val;
28558    xmlTextReaderPtr reader; /* an XML reader */
28559    int n_reader;
28560    char * buffer; /* a pointer to a char array */
28561    int n_buffer;
28562    int size; /* the size of the array */
28563    int n_size;
28564    const char * URL; /* the base URL to use for the document */
28565    int n_URL;
28566    char * encoding; /* the document encoding, or NULL */
28567    int n_encoding;
28568    int options; /* a combination of xmlParserOption */
28569    int n_options;
28570
28571    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28572    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
28573    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28574    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28575    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
28576    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
28577        mem_base = xmlMemBlocks();
28578        reader = gen_xmlTextReaderPtr(n_reader, 0);
28579        buffer = gen_const_char_ptr(n_buffer, 1);
28580        size = gen_int(n_size, 2);
28581        URL = gen_filepath(n_URL, 3);
28582        encoding = gen_const_char_ptr(n_encoding, 4);
28583        options = gen_parseroptions(n_options, 5);
28584
28585        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
28586        desret_int(ret_val);
28587        call_tests++;
28588        des_xmlTextReaderPtr(n_reader, reader, 0);
28589        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
28590        des_int(n_size, size, 2);
28591        des_filepath(n_URL, URL, 3);
28592        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
28593        des_parseroptions(n_options, options, 5);
28594        xmlResetLastError();
28595        if (mem_base != xmlMemBlocks()) {
28596            printf("Leak of %d blocks found in xmlReaderNewMemory",
28597	           xmlMemBlocks() - mem_base);
28598	    test_ret++;
28599            printf(" %d", n_reader);
28600            printf(" %d", n_buffer);
28601            printf(" %d", n_size);
28602            printf(" %d", n_URL);
28603            printf(" %d", n_encoding);
28604            printf(" %d", n_options);
28605            printf("\n");
28606        }
28607    }
28608    }
28609    }
28610    }
28611    }
28612    }
28613    function_tests++;
28614#endif
28615
28616    return(test_ret);
28617}
28618
28619
28620static int
28621test_xmlReaderNewWalker(void) {
28622    int test_ret = 0;
28623
28624#ifdef LIBXML_READER_ENABLED
28625    int mem_base;
28626    int ret_val;
28627    xmlTextReaderPtr reader; /* an XML reader */
28628    int n_reader;
28629    xmlDocPtr doc; /* a preparsed document */
28630    int n_doc;
28631
28632    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28633    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28634        mem_base = xmlMemBlocks();
28635        reader = gen_xmlTextReaderPtr(n_reader, 0);
28636        doc = gen_xmlDocPtr(n_doc, 1);
28637
28638        ret_val = xmlReaderNewWalker(reader, doc);
28639        desret_int(ret_val);
28640        call_tests++;
28641        des_xmlTextReaderPtr(n_reader, reader, 0);
28642        des_xmlDocPtr(n_doc, doc, 1);
28643        xmlResetLastError();
28644        if (mem_base != xmlMemBlocks()) {
28645            printf("Leak of %d blocks found in xmlReaderNewWalker",
28646	           xmlMemBlocks() - mem_base);
28647	    test_ret++;
28648            printf(" %d", n_reader);
28649            printf(" %d", n_doc);
28650            printf("\n");
28651        }
28652    }
28653    }
28654    function_tests++;
28655#endif
28656
28657    return(test_ret);
28658}
28659
28660
28661static int
28662test_xmlReaderWalker(void) {
28663    int test_ret = 0;
28664
28665#ifdef LIBXML_READER_ENABLED
28666    int mem_base;
28667    xmlTextReaderPtr ret_val;
28668    xmlDocPtr doc; /* a preparsed document */
28669    int n_doc;
28670
28671    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
28672        mem_base = xmlMemBlocks();
28673        doc = gen_xmlDocPtr(n_doc, 0);
28674
28675        ret_val = xmlReaderWalker(doc);
28676        desret_xmlTextReaderPtr(ret_val);
28677        call_tests++;
28678        des_xmlDocPtr(n_doc, doc, 0);
28679        xmlResetLastError();
28680        if (mem_base != xmlMemBlocks()) {
28681            printf("Leak of %d blocks found in xmlReaderWalker",
28682	           xmlMemBlocks() - mem_base);
28683	    test_ret++;
28684            printf(" %d", n_doc);
28685            printf("\n");
28686        }
28687    }
28688    function_tests++;
28689#endif
28690
28691    return(test_ret);
28692}
28693
28694
28695static int
28696test_xmlTextReaderAttributeCount(void) {
28697    int test_ret = 0;
28698
28699#ifdef LIBXML_READER_ENABLED
28700    int mem_base;
28701    int ret_val;
28702    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28703    int n_reader;
28704
28705    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28706        mem_base = xmlMemBlocks();
28707        reader = gen_xmlTextReaderPtr(n_reader, 0);
28708
28709        ret_val = xmlTextReaderAttributeCount(reader);
28710        desret_int(ret_val);
28711        call_tests++;
28712        des_xmlTextReaderPtr(n_reader, reader, 0);
28713        xmlResetLastError();
28714        if (mem_base != xmlMemBlocks()) {
28715            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
28716	           xmlMemBlocks() - mem_base);
28717	    test_ret++;
28718            printf(" %d", n_reader);
28719            printf("\n");
28720        }
28721    }
28722    function_tests++;
28723#endif
28724
28725    return(test_ret);
28726}
28727
28728
28729static int
28730test_xmlTextReaderBaseUri(void) {
28731    int test_ret = 0;
28732
28733#ifdef LIBXML_READER_ENABLED
28734    int mem_base;
28735    xmlChar * ret_val;
28736    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28737    int n_reader;
28738
28739    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28740        mem_base = xmlMemBlocks();
28741        reader = gen_xmlTextReaderPtr(n_reader, 0);
28742
28743        ret_val = xmlTextReaderBaseUri(reader);
28744        desret_xmlChar_ptr(ret_val);
28745        call_tests++;
28746        des_xmlTextReaderPtr(n_reader, reader, 0);
28747        xmlResetLastError();
28748        if (mem_base != xmlMemBlocks()) {
28749            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
28750	           xmlMemBlocks() - mem_base);
28751	    test_ret++;
28752            printf(" %d", n_reader);
28753            printf("\n");
28754        }
28755    }
28756    function_tests++;
28757#endif
28758
28759    return(test_ret);
28760}
28761
28762
28763static int
28764test_xmlTextReaderClose(void) {
28765    int test_ret = 0;
28766
28767#ifdef LIBXML_READER_ENABLED
28768    int mem_base;
28769    int ret_val;
28770    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28771    int n_reader;
28772
28773    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28774        mem_base = xmlMemBlocks();
28775        reader = gen_xmlTextReaderPtr(n_reader, 0);
28776
28777        ret_val = xmlTextReaderClose(reader);
28778        desret_int(ret_val);
28779        call_tests++;
28780        des_xmlTextReaderPtr(n_reader, reader, 0);
28781        xmlResetLastError();
28782        if (mem_base != xmlMemBlocks()) {
28783            printf("Leak of %d blocks found in xmlTextReaderClose",
28784	           xmlMemBlocks() - mem_base);
28785	    test_ret++;
28786            printf(" %d", n_reader);
28787            printf("\n");
28788        }
28789    }
28790    function_tests++;
28791#endif
28792
28793    return(test_ret);
28794}
28795
28796
28797static int
28798test_xmlTextReaderConstBaseUri(void) {
28799    int test_ret = 0;
28800
28801#ifdef LIBXML_READER_ENABLED
28802    int mem_base;
28803    const xmlChar * ret_val;
28804    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28805    int n_reader;
28806
28807    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28808        mem_base = xmlMemBlocks();
28809        reader = gen_xmlTextReaderPtr(n_reader, 0);
28810
28811        ret_val = xmlTextReaderConstBaseUri(reader);
28812        desret_const_xmlChar_ptr(ret_val);
28813        call_tests++;
28814        des_xmlTextReaderPtr(n_reader, reader, 0);
28815        xmlResetLastError();
28816        if (mem_base != xmlMemBlocks()) {
28817            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
28818	           xmlMemBlocks() - mem_base);
28819	    test_ret++;
28820            printf(" %d", n_reader);
28821            printf("\n");
28822        }
28823    }
28824    function_tests++;
28825#endif
28826
28827    return(test_ret);
28828}
28829
28830
28831static int
28832test_xmlTextReaderConstEncoding(void) {
28833    int test_ret = 0;
28834
28835#ifdef LIBXML_READER_ENABLED
28836    int mem_base;
28837    const xmlChar * ret_val;
28838    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28839    int n_reader;
28840
28841    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28842        mem_base = xmlMemBlocks();
28843        reader = gen_xmlTextReaderPtr(n_reader, 0);
28844
28845        ret_val = xmlTextReaderConstEncoding(reader);
28846        desret_const_xmlChar_ptr(ret_val);
28847        call_tests++;
28848        des_xmlTextReaderPtr(n_reader, reader, 0);
28849        xmlResetLastError();
28850        if (mem_base != xmlMemBlocks()) {
28851            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
28852	           xmlMemBlocks() - mem_base);
28853	    test_ret++;
28854            printf(" %d", n_reader);
28855            printf("\n");
28856        }
28857    }
28858    function_tests++;
28859#endif
28860
28861    return(test_ret);
28862}
28863
28864
28865static int
28866test_xmlTextReaderConstLocalName(void) {
28867    int test_ret = 0;
28868
28869#ifdef LIBXML_READER_ENABLED
28870    int mem_base;
28871    const xmlChar * ret_val;
28872    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28873    int n_reader;
28874
28875    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28876        mem_base = xmlMemBlocks();
28877        reader = gen_xmlTextReaderPtr(n_reader, 0);
28878
28879        ret_val = xmlTextReaderConstLocalName(reader);
28880        desret_const_xmlChar_ptr(ret_val);
28881        call_tests++;
28882        des_xmlTextReaderPtr(n_reader, reader, 0);
28883        xmlResetLastError();
28884        if (mem_base != xmlMemBlocks()) {
28885            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
28886	           xmlMemBlocks() - mem_base);
28887	    test_ret++;
28888            printf(" %d", n_reader);
28889            printf("\n");
28890        }
28891    }
28892    function_tests++;
28893#endif
28894
28895    return(test_ret);
28896}
28897
28898
28899static int
28900test_xmlTextReaderConstName(void) {
28901    int test_ret = 0;
28902
28903#ifdef LIBXML_READER_ENABLED
28904    int mem_base;
28905    const xmlChar * ret_val;
28906    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28907    int n_reader;
28908
28909    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28910        mem_base = xmlMemBlocks();
28911        reader = gen_xmlTextReaderPtr(n_reader, 0);
28912
28913        ret_val = xmlTextReaderConstName(reader);
28914        desret_const_xmlChar_ptr(ret_val);
28915        call_tests++;
28916        des_xmlTextReaderPtr(n_reader, reader, 0);
28917        xmlResetLastError();
28918        if (mem_base != xmlMemBlocks()) {
28919            printf("Leak of %d blocks found in xmlTextReaderConstName",
28920	           xmlMemBlocks() - mem_base);
28921	    test_ret++;
28922            printf(" %d", n_reader);
28923            printf("\n");
28924        }
28925    }
28926    function_tests++;
28927#endif
28928
28929    return(test_ret);
28930}
28931
28932
28933static int
28934test_xmlTextReaderConstNamespaceUri(void) {
28935    int test_ret = 0;
28936
28937#ifdef LIBXML_READER_ENABLED
28938    int mem_base;
28939    const xmlChar * ret_val;
28940    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28941    int n_reader;
28942
28943    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28944        mem_base = xmlMemBlocks();
28945        reader = gen_xmlTextReaderPtr(n_reader, 0);
28946
28947        ret_val = xmlTextReaderConstNamespaceUri(reader);
28948        desret_const_xmlChar_ptr(ret_val);
28949        call_tests++;
28950        des_xmlTextReaderPtr(n_reader, reader, 0);
28951        xmlResetLastError();
28952        if (mem_base != xmlMemBlocks()) {
28953            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
28954	           xmlMemBlocks() - mem_base);
28955	    test_ret++;
28956            printf(" %d", n_reader);
28957            printf("\n");
28958        }
28959    }
28960    function_tests++;
28961#endif
28962
28963    return(test_ret);
28964}
28965
28966
28967static int
28968test_xmlTextReaderConstPrefix(void) {
28969    int test_ret = 0;
28970
28971#ifdef LIBXML_READER_ENABLED
28972    int mem_base;
28973    const xmlChar * ret_val;
28974    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
28975    int n_reader;
28976
28977    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
28978        mem_base = xmlMemBlocks();
28979        reader = gen_xmlTextReaderPtr(n_reader, 0);
28980
28981        ret_val = xmlTextReaderConstPrefix(reader);
28982        desret_const_xmlChar_ptr(ret_val);
28983        call_tests++;
28984        des_xmlTextReaderPtr(n_reader, reader, 0);
28985        xmlResetLastError();
28986        if (mem_base != xmlMemBlocks()) {
28987            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
28988	           xmlMemBlocks() - mem_base);
28989	    test_ret++;
28990            printf(" %d", n_reader);
28991            printf("\n");
28992        }
28993    }
28994    function_tests++;
28995#endif
28996
28997    return(test_ret);
28998}
28999
29000
29001static int
29002test_xmlTextReaderConstString(void) {
29003    int test_ret = 0;
29004
29005#ifdef LIBXML_READER_ENABLED
29006    int mem_base;
29007    const xmlChar * ret_val;
29008    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29009    int n_reader;
29010    xmlChar * str; /* the string to intern. */
29011    int n_str;
29012
29013    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29014    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
29015        mem_base = xmlMemBlocks();
29016        reader = gen_xmlTextReaderPtr(n_reader, 0);
29017        str = gen_const_xmlChar_ptr(n_str, 1);
29018
29019        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
29020        desret_const_xmlChar_ptr(ret_val);
29021        call_tests++;
29022        des_xmlTextReaderPtr(n_reader, reader, 0);
29023        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
29024        xmlResetLastError();
29025        if (mem_base != xmlMemBlocks()) {
29026            printf("Leak of %d blocks found in xmlTextReaderConstString",
29027	           xmlMemBlocks() - mem_base);
29028	    test_ret++;
29029            printf(" %d", n_reader);
29030            printf(" %d", n_str);
29031            printf("\n");
29032        }
29033    }
29034    }
29035    function_tests++;
29036#endif
29037
29038    return(test_ret);
29039}
29040
29041
29042static int
29043test_xmlTextReaderConstValue(void) {
29044    int test_ret = 0;
29045
29046#ifdef LIBXML_READER_ENABLED
29047    int mem_base;
29048    const xmlChar * ret_val;
29049    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29050    int n_reader;
29051
29052    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29053        mem_base = xmlMemBlocks();
29054        reader = gen_xmlTextReaderPtr(n_reader, 0);
29055
29056        ret_val = xmlTextReaderConstValue(reader);
29057        desret_const_xmlChar_ptr(ret_val);
29058        call_tests++;
29059        des_xmlTextReaderPtr(n_reader, reader, 0);
29060        xmlResetLastError();
29061        if (mem_base != xmlMemBlocks()) {
29062            printf("Leak of %d blocks found in xmlTextReaderConstValue",
29063	           xmlMemBlocks() - mem_base);
29064	    test_ret++;
29065            printf(" %d", n_reader);
29066            printf("\n");
29067        }
29068    }
29069    function_tests++;
29070#endif
29071
29072    return(test_ret);
29073}
29074
29075
29076static int
29077test_xmlTextReaderConstXmlLang(void) {
29078    int test_ret = 0;
29079
29080#ifdef LIBXML_READER_ENABLED
29081    int mem_base;
29082    const xmlChar * ret_val;
29083    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29084    int n_reader;
29085
29086    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29087        mem_base = xmlMemBlocks();
29088        reader = gen_xmlTextReaderPtr(n_reader, 0);
29089
29090        ret_val = xmlTextReaderConstXmlLang(reader);
29091        desret_const_xmlChar_ptr(ret_val);
29092        call_tests++;
29093        des_xmlTextReaderPtr(n_reader, reader, 0);
29094        xmlResetLastError();
29095        if (mem_base != xmlMemBlocks()) {
29096            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
29097	           xmlMemBlocks() - mem_base);
29098	    test_ret++;
29099            printf(" %d", n_reader);
29100            printf("\n");
29101        }
29102    }
29103    function_tests++;
29104#endif
29105
29106    return(test_ret);
29107}
29108
29109
29110static int
29111test_xmlTextReaderConstXmlVersion(void) {
29112    int test_ret = 0;
29113
29114#ifdef LIBXML_READER_ENABLED
29115    int mem_base;
29116    const xmlChar * ret_val;
29117    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29118    int n_reader;
29119
29120    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29121        mem_base = xmlMemBlocks();
29122        reader = gen_xmlTextReaderPtr(n_reader, 0);
29123
29124        ret_val = xmlTextReaderConstXmlVersion(reader);
29125        desret_const_xmlChar_ptr(ret_val);
29126        call_tests++;
29127        des_xmlTextReaderPtr(n_reader, reader, 0);
29128        xmlResetLastError();
29129        if (mem_base != xmlMemBlocks()) {
29130            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
29131	           xmlMemBlocks() - mem_base);
29132	    test_ret++;
29133            printf(" %d", n_reader);
29134            printf("\n");
29135        }
29136    }
29137    function_tests++;
29138#endif
29139
29140    return(test_ret);
29141}
29142
29143
29144static int
29145test_xmlTextReaderCurrentDoc(void) {
29146    int test_ret = 0;
29147
29148#ifdef LIBXML_READER_ENABLED
29149    int mem_base;
29150    xmlDocPtr ret_val;
29151    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29152    int n_reader;
29153
29154    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29155        mem_base = xmlMemBlocks();
29156        reader = gen_xmlTextReaderPtr(n_reader, 0);
29157
29158        ret_val = xmlTextReaderCurrentDoc(reader);
29159        desret_xmlDocPtr(ret_val);
29160        call_tests++;
29161        des_xmlTextReaderPtr(n_reader, reader, 0);
29162        xmlResetLastError();
29163        if (mem_base != xmlMemBlocks()) {
29164            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
29165	           xmlMemBlocks() - mem_base);
29166	    test_ret++;
29167            printf(" %d", n_reader);
29168            printf("\n");
29169        }
29170    }
29171    function_tests++;
29172#endif
29173
29174    return(test_ret);
29175}
29176
29177
29178static int
29179test_xmlTextReaderCurrentNode(void) {
29180    int test_ret = 0;
29181
29182#ifdef LIBXML_READER_ENABLED
29183    int mem_base;
29184    xmlNodePtr ret_val;
29185    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29186    int n_reader;
29187
29188    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29189        mem_base = xmlMemBlocks();
29190        reader = gen_xmlTextReaderPtr(n_reader, 0);
29191
29192        ret_val = xmlTextReaderCurrentNode(reader);
29193        desret_xmlNodePtr(ret_val);
29194        call_tests++;
29195        des_xmlTextReaderPtr(n_reader, reader, 0);
29196        xmlResetLastError();
29197        if (mem_base != xmlMemBlocks()) {
29198            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
29199	           xmlMemBlocks() - mem_base);
29200	    test_ret++;
29201            printf(" %d", n_reader);
29202            printf("\n");
29203        }
29204    }
29205    function_tests++;
29206#endif
29207
29208    return(test_ret);
29209}
29210
29211
29212static int
29213test_xmlTextReaderDepth(void) {
29214    int test_ret = 0;
29215
29216#ifdef LIBXML_READER_ENABLED
29217    int mem_base;
29218    int ret_val;
29219    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29220    int n_reader;
29221
29222    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29223        mem_base = xmlMemBlocks();
29224        reader = gen_xmlTextReaderPtr(n_reader, 0);
29225
29226        ret_val = xmlTextReaderDepth(reader);
29227        desret_int(ret_val);
29228        call_tests++;
29229        des_xmlTextReaderPtr(n_reader, reader, 0);
29230        xmlResetLastError();
29231        if (mem_base != xmlMemBlocks()) {
29232            printf("Leak of %d blocks found in xmlTextReaderDepth",
29233	           xmlMemBlocks() - mem_base);
29234	    test_ret++;
29235            printf(" %d", n_reader);
29236            printf("\n");
29237        }
29238    }
29239    function_tests++;
29240#endif
29241
29242    return(test_ret);
29243}
29244
29245
29246static int
29247test_xmlTextReaderExpand(void) {
29248    int test_ret = 0;
29249
29250#ifdef LIBXML_READER_ENABLED
29251    int mem_base;
29252    xmlNodePtr ret_val;
29253    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29254    int n_reader;
29255
29256    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29257        mem_base = xmlMemBlocks();
29258        reader = gen_xmlTextReaderPtr(n_reader, 0);
29259
29260        ret_val = xmlTextReaderExpand(reader);
29261        desret_xmlNodePtr(ret_val);
29262        call_tests++;
29263        des_xmlTextReaderPtr(n_reader, reader, 0);
29264        xmlResetLastError();
29265        if (mem_base != xmlMemBlocks()) {
29266            printf("Leak of %d blocks found in xmlTextReaderExpand",
29267	           xmlMemBlocks() - mem_base);
29268	    test_ret++;
29269            printf(" %d", n_reader);
29270            printf("\n");
29271        }
29272    }
29273    function_tests++;
29274#endif
29275
29276    return(test_ret);
29277}
29278
29279
29280static int
29281test_xmlTextReaderGetAttribute(void) {
29282    int test_ret = 0;
29283
29284#ifdef LIBXML_READER_ENABLED
29285    int mem_base;
29286    xmlChar * ret_val;
29287    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29288    int n_reader;
29289    xmlChar * name; /* the qualified name of the attribute. */
29290    int n_name;
29291
29292    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29293    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
29294        mem_base = xmlMemBlocks();
29295        reader = gen_xmlTextReaderPtr(n_reader, 0);
29296        name = gen_const_xmlChar_ptr(n_name, 1);
29297
29298        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
29299        desret_xmlChar_ptr(ret_val);
29300        call_tests++;
29301        des_xmlTextReaderPtr(n_reader, reader, 0);
29302        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
29303        xmlResetLastError();
29304        if (mem_base != xmlMemBlocks()) {
29305            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
29306	           xmlMemBlocks() - mem_base);
29307	    test_ret++;
29308            printf(" %d", n_reader);
29309            printf(" %d", n_name);
29310            printf("\n");
29311        }
29312    }
29313    }
29314    function_tests++;
29315#endif
29316
29317    return(test_ret);
29318}
29319
29320
29321static int
29322test_xmlTextReaderGetAttributeNo(void) {
29323    int test_ret = 0;
29324
29325#ifdef LIBXML_READER_ENABLED
29326    int mem_base;
29327    xmlChar * ret_val;
29328    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29329    int n_reader;
29330    int no; /* the zero-based index of the attribute relative to the containing element */
29331    int n_no;
29332
29333    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29334    for (n_no = 0;n_no < gen_nb_int;n_no++) {
29335        mem_base = xmlMemBlocks();
29336        reader = gen_xmlTextReaderPtr(n_reader, 0);
29337        no = gen_int(n_no, 1);
29338
29339        ret_val = xmlTextReaderGetAttributeNo(reader, no);
29340        desret_xmlChar_ptr(ret_val);
29341        call_tests++;
29342        des_xmlTextReaderPtr(n_reader, reader, 0);
29343        des_int(n_no, no, 1);
29344        xmlResetLastError();
29345        if (mem_base != xmlMemBlocks()) {
29346            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
29347	           xmlMemBlocks() - mem_base);
29348	    test_ret++;
29349            printf(" %d", n_reader);
29350            printf(" %d", n_no);
29351            printf("\n");
29352        }
29353    }
29354    }
29355    function_tests++;
29356#endif
29357
29358    return(test_ret);
29359}
29360
29361
29362static int
29363test_xmlTextReaderGetAttributeNs(void) {
29364    int test_ret = 0;
29365
29366#ifdef LIBXML_READER_ENABLED
29367    int mem_base;
29368    xmlChar * ret_val;
29369    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29370    int n_reader;
29371    xmlChar * localName; /* the local name of the attribute. */
29372    int n_localName;
29373    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
29374    int n_namespaceURI;
29375
29376    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29377    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
29378    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
29379        mem_base = xmlMemBlocks();
29380        reader = gen_xmlTextReaderPtr(n_reader, 0);
29381        localName = gen_const_xmlChar_ptr(n_localName, 1);
29382        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
29383
29384        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
29385        desret_xmlChar_ptr(ret_val);
29386        call_tests++;
29387        des_xmlTextReaderPtr(n_reader, reader, 0);
29388        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
29389        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
29390        xmlResetLastError();
29391        if (mem_base != xmlMemBlocks()) {
29392            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
29393	           xmlMemBlocks() - mem_base);
29394	    test_ret++;
29395            printf(" %d", n_reader);
29396            printf(" %d", n_localName);
29397            printf(" %d", n_namespaceURI);
29398            printf("\n");
29399        }
29400    }
29401    }
29402    }
29403    function_tests++;
29404#endif
29405
29406    return(test_ret);
29407}
29408
29409#ifdef LIBXML_READER_ENABLED
29410
29411#define gen_nb_xmlTextReaderErrorFunc_ptr 1
29412static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29413    return(NULL);
29414}
29415static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29416}
29417#endif
29418
29419
29420static int
29421test_xmlTextReaderGetErrorHandler(void) {
29422    int test_ret = 0;
29423
29424#ifdef LIBXML_READER_ENABLED
29425    int mem_base;
29426    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29427    int n_reader;
29428    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
29429    int n_f;
29430    void ** arg; /* a user argument */
29431    int n_arg;
29432
29433    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29434    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
29435    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
29436        mem_base = xmlMemBlocks();
29437        reader = gen_xmlTextReaderPtr(n_reader, 0);
29438        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
29439        arg = gen_void_ptr_ptr(n_arg, 2);
29440
29441        xmlTextReaderGetErrorHandler(reader, f, arg);
29442        call_tests++;
29443        des_xmlTextReaderPtr(n_reader, reader, 0);
29444        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
29445        des_void_ptr_ptr(n_arg, arg, 2);
29446        xmlResetLastError();
29447        if (mem_base != xmlMemBlocks()) {
29448            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
29449	           xmlMemBlocks() - mem_base);
29450	    test_ret++;
29451            printf(" %d", n_reader);
29452            printf(" %d", n_f);
29453            printf(" %d", n_arg);
29454            printf("\n");
29455        }
29456    }
29457    }
29458    }
29459    function_tests++;
29460#endif
29461
29462    return(test_ret);
29463}
29464
29465
29466static int
29467test_xmlTextReaderGetParserProp(void) {
29468    int test_ret = 0;
29469
29470#ifdef LIBXML_READER_ENABLED
29471    int mem_base;
29472    int ret_val;
29473    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29474    int n_reader;
29475    int prop; /* the xmlParserProperties to get */
29476    int n_prop;
29477
29478    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29479    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
29480        mem_base = xmlMemBlocks();
29481        reader = gen_xmlTextReaderPtr(n_reader, 0);
29482        prop = gen_int(n_prop, 1);
29483
29484        ret_val = xmlTextReaderGetParserProp(reader, prop);
29485        desret_int(ret_val);
29486        call_tests++;
29487        des_xmlTextReaderPtr(n_reader, reader, 0);
29488        des_int(n_prop, prop, 1);
29489        xmlResetLastError();
29490        if (mem_base != xmlMemBlocks()) {
29491            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
29492	           xmlMemBlocks() - mem_base);
29493	    test_ret++;
29494            printf(" %d", n_reader);
29495            printf(" %d", n_prop);
29496            printf("\n");
29497        }
29498    }
29499    }
29500    function_tests++;
29501#endif
29502
29503    return(test_ret);
29504}
29505
29506
29507static int
29508test_xmlTextReaderGetRemainder(void) {
29509    int test_ret = 0;
29510
29511#ifdef LIBXML_READER_ENABLED
29512    int mem_base;
29513    xmlParserInputBufferPtr ret_val;
29514    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29515    int n_reader;
29516
29517    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29518        mem_base = xmlMemBlocks();
29519        reader = gen_xmlTextReaderPtr(n_reader, 0);
29520
29521        ret_val = xmlTextReaderGetRemainder(reader);
29522        desret_xmlParserInputBufferPtr(ret_val);
29523        call_tests++;
29524        des_xmlTextReaderPtr(n_reader, reader, 0);
29525        xmlResetLastError();
29526        if (mem_base != xmlMemBlocks()) {
29527            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
29528	           xmlMemBlocks() - mem_base);
29529	    test_ret++;
29530            printf(" %d", n_reader);
29531            printf("\n");
29532        }
29533    }
29534    function_tests++;
29535#endif
29536
29537    return(test_ret);
29538}
29539
29540
29541static int
29542test_xmlTextReaderHasAttributes(void) {
29543    int test_ret = 0;
29544
29545#ifdef LIBXML_READER_ENABLED
29546    int mem_base;
29547    int ret_val;
29548    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29549    int n_reader;
29550
29551    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29552        mem_base = xmlMemBlocks();
29553        reader = gen_xmlTextReaderPtr(n_reader, 0);
29554
29555        ret_val = xmlTextReaderHasAttributes(reader);
29556        desret_int(ret_val);
29557        call_tests++;
29558        des_xmlTextReaderPtr(n_reader, reader, 0);
29559        xmlResetLastError();
29560        if (mem_base != xmlMemBlocks()) {
29561            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
29562	           xmlMemBlocks() - mem_base);
29563	    test_ret++;
29564            printf(" %d", n_reader);
29565            printf("\n");
29566        }
29567    }
29568    function_tests++;
29569#endif
29570
29571    return(test_ret);
29572}
29573
29574
29575static int
29576test_xmlTextReaderHasValue(void) {
29577    int test_ret = 0;
29578
29579#ifdef LIBXML_READER_ENABLED
29580    int mem_base;
29581    int ret_val;
29582    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29583    int n_reader;
29584
29585    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29586        mem_base = xmlMemBlocks();
29587        reader = gen_xmlTextReaderPtr(n_reader, 0);
29588
29589        ret_val = xmlTextReaderHasValue(reader);
29590        desret_int(ret_val);
29591        call_tests++;
29592        des_xmlTextReaderPtr(n_reader, reader, 0);
29593        xmlResetLastError();
29594        if (mem_base != xmlMemBlocks()) {
29595            printf("Leak of %d blocks found in xmlTextReaderHasValue",
29596	           xmlMemBlocks() - mem_base);
29597	    test_ret++;
29598            printf(" %d", n_reader);
29599            printf("\n");
29600        }
29601    }
29602    function_tests++;
29603#endif
29604
29605    return(test_ret);
29606}
29607
29608
29609static int
29610test_xmlTextReaderIsDefault(void) {
29611    int test_ret = 0;
29612
29613#ifdef LIBXML_READER_ENABLED
29614    int mem_base;
29615    int ret_val;
29616    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29617    int n_reader;
29618
29619    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29620        mem_base = xmlMemBlocks();
29621        reader = gen_xmlTextReaderPtr(n_reader, 0);
29622
29623        ret_val = xmlTextReaderIsDefault(reader);
29624        desret_int(ret_val);
29625        call_tests++;
29626        des_xmlTextReaderPtr(n_reader, reader, 0);
29627        xmlResetLastError();
29628        if (mem_base != xmlMemBlocks()) {
29629            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
29630	           xmlMemBlocks() - mem_base);
29631	    test_ret++;
29632            printf(" %d", n_reader);
29633            printf("\n");
29634        }
29635    }
29636    function_tests++;
29637#endif
29638
29639    return(test_ret);
29640}
29641
29642
29643static int
29644test_xmlTextReaderIsEmptyElement(void) {
29645    int test_ret = 0;
29646
29647#ifdef LIBXML_READER_ENABLED
29648    int mem_base;
29649    int ret_val;
29650    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29651    int n_reader;
29652
29653    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29654        mem_base = xmlMemBlocks();
29655        reader = gen_xmlTextReaderPtr(n_reader, 0);
29656
29657        ret_val = xmlTextReaderIsEmptyElement(reader);
29658        desret_int(ret_val);
29659        call_tests++;
29660        des_xmlTextReaderPtr(n_reader, reader, 0);
29661        xmlResetLastError();
29662        if (mem_base != xmlMemBlocks()) {
29663            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
29664	           xmlMemBlocks() - mem_base);
29665	    test_ret++;
29666            printf(" %d", n_reader);
29667            printf("\n");
29668        }
29669    }
29670    function_tests++;
29671#endif
29672
29673    return(test_ret);
29674}
29675
29676
29677static int
29678test_xmlTextReaderIsNamespaceDecl(void) {
29679    int test_ret = 0;
29680
29681#ifdef LIBXML_READER_ENABLED
29682    int mem_base;
29683    int ret_val;
29684    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29685    int n_reader;
29686
29687    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29688        mem_base = xmlMemBlocks();
29689        reader = gen_xmlTextReaderPtr(n_reader, 0);
29690
29691        ret_val = xmlTextReaderIsNamespaceDecl(reader);
29692        desret_int(ret_val);
29693        call_tests++;
29694        des_xmlTextReaderPtr(n_reader, reader, 0);
29695        xmlResetLastError();
29696        if (mem_base != xmlMemBlocks()) {
29697            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
29698	           xmlMemBlocks() - mem_base);
29699	    test_ret++;
29700            printf(" %d", n_reader);
29701            printf("\n");
29702        }
29703    }
29704    function_tests++;
29705#endif
29706
29707    return(test_ret);
29708}
29709
29710
29711static int
29712test_xmlTextReaderIsValid(void) {
29713    int test_ret = 0;
29714
29715#ifdef LIBXML_READER_ENABLED
29716    int mem_base;
29717    int ret_val;
29718    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29719    int n_reader;
29720
29721    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29722        mem_base = xmlMemBlocks();
29723        reader = gen_xmlTextReaderPtr(n_reader, 0);
29724
29725        ret_val = xmlTextReaderIsValid(reader);
29726        desret_int(ret_val);
29727        call_tests++;
29728        des_xmlTextReaderPtr(n_reader, reader, 0);
29729        xmlResetLastError();
29730        if (mem_base != xmlMemBlocks()) {
29731            printf("Leak of %d blocks found in xmlTextReaderIsValid",
29732	           xmlMemBlocks() - mem_base);
29733	    test_ret++;
29734            printf(" %d", n_reader);
29735            printf("\n");
29736        }
29737    }
29738    function_tests++;
29739#endif
29740
29741    return(test_ret);
29742}
29743
29744
29745static int
29746test_xmlTextReaderLocalName(void) {
29747    int test_ret = 0;
29748
29749#ifdef LIBXML_READER_ENABLED
29750    int mem_base;
29751    xmlChar * ret_val;
29752    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29753    int n_reader;
29754
29755    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29756        mem_base = xmlMemBlocks();
29757        reader = gen_xmlTextReaderPtr(n_reader, 0);
29758
29759        ret_val = xmlTextReaderLocalName(reader);
29760        desret_xmlChar_ptr(ret_val);
29761        call_tests++;
29762        des_xmlTextReaderPtr(n_reader, reader, 0);
29763        xmlResetLastError();
29764        if (mem_base != xmlMemBlocks()) {
29765            printf("Leak of %d blocks found in xmlTextReaderLocalName",
29766	           xmlMemBlocks() - mem_base);
29767	    test_ret++;
29768            printf(" %d", n_reader);
29769            printf("\n");
29770        }
29771    }
29772    function_tests++;
29773#endif
29774
29775    return(test_ret);
29776}
29777
29778#ifdef LIBXML_READER_ENABLED
29779
29780#define gen_nb_xmlTextReaderLocatorPtr 1
29781static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29782    return(NULL);
29783}
29784static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29785}
29786#endif
29787
29788
29789static int
29790test_xmlTextReaderLocatorBaseURI(void) {
29791    int test_ret = 0;
29792
29793#ifdef LIBXML_READER_ENABLED
29794    int mem_base;
29795    xmlChar * ret_val;
29796    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
29797    int n_locator;
29798
29799    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
29800        mem_base = xmlMemBlocks();
29801        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
29802
29803        ret_val = xmlTextReaderLocatorBaseURI(locator);
29804        desret_xmlChar_ptr(ret_val);
29805        call_tests++;
29806        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
29807        xmlResetLastError();
29808        if (mem_base != xmlMemBlocks()) {
29809            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
29810	           xmlMemBlocks() - mem_base);
29811	    test_ret++;
29812            printf(" %d", n_locator);
29813            printf("\n");
29814        }
29815    }
29816    function_tests++;
29817#endif
29818
29819    return(test_ret);
29820}
29821
29822
29823static int
29824test_xmlTextReaderLocatorLineNumber(void) {
29825    int test_ret = 0;
29826
29827#ifdef LIBXML_READER_ENABLED
29828    int mem_base;
29829    int ret_val;
29830    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
29831    int n_locator;
29832
29833    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
29834        mem_base = xmlMemBlocks();
29835        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
29836
29837        ret_val = xmlTextReaderLocatorLineNumber(locator);
29838        desret_int(ret_val);
29839        call_tests++;
29840        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
29841        xmlResetLastError();
29842        if (mem_base != xmlMemBlocks()) {
29843            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
29844	           xmlMemBlocks() - mem_base);
29845	    test_ret++;
29846            printf(" %d", n_locator);
29847            printf("\n");
29848        }
29849    }
29850    function_tests++;
29851#endif
29852
29853    return(test_ret);
29854}
29855
29856
29857static int
29858test_xmlTextReaderLookupNamespace(void) {
29859    int test_ret = 0;
29860
29861#ifdef LIBXML_READER_ENABLED
29862    int mem_base;
29863    xmlChar * ret_val;
29864    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29865    int n_reader;
29866    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
29867    int n_prefix;
29868
29869    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29870    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
29871        mem_base = xmlMemBlocks();
29872        reader = gen_xmlTextReaderPtr(n_reader, 0);
29873        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
29874
29875        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
29876        desret_xmlChar_ptr(ret_val);
29877        call_tests++;
29878        des_xmlTextReaderPtr(n_reader, reader, 0);
29879        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
29880        xmlResetLastError();
29881        if (mem_base != xmlMemBlocks()) {
29882            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
29883	           xmlMemBlocks() - mem_base);
29884	    test_ret++;
29885            printf(" %d", n_reader);
29886            printf(" %d", n_prefix);
29887            printf("\n");
29888        }
29889    }
29890    }
29891    function_tests++;
29892#endif
29893
29894    return(test_ret);
29895}
29896
29897
29898static int
29899test_xmlTextReaderMoveToAttribute(void) {
29900    int test_ret = 0;
29901
29902#ifdef LIBXML_READER_ENABLED
29903    int mem_base;
29904    int ret_val;
29905    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29906    int n_reader;
29907    xmlChar * name; /* the qualified name of the attribute. */
29908    int n_name;
29909
29910    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29911    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
29912        mem_base = xmlMemBlocks();
29913        reader = gen_xmlTextReaderPtr(n_reader, 0);
29914        name = gen_const_xmlChar_ptr(n_name, 1);
29915
29916        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
29917        desret_int(ret_val);
29918        call_tests++;
29919        des_xmlTextReaderPtr(n_reader, reader, 0);
29920        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
29921        xmlResetLastError();
29922        if (mem_base != xmlMemBlocks()) {
29923            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
29924	           xmlMemBlocks() - mem_base);
29925	    test_ret++;
29926            printf(" %d", n_reader);
29927            printf(" %d", n_name);
29928            printf("\n");
29929        }
29930    }
29931    }
29932    function_tests++;
29933#endif
29934
29935    return(test_ret);
29936}
29937
29938
29939static int
29940test_xmlTextReaderMoveToAttributeNo(void) {
29941    int test_ret = 0;
29942
29943#ifdef LIBXML_READER_ENABLED
29944    int mem_base;
29945    int ret_val;
29946    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29947    int n_reader;
29948    int no; /* the zero-based index of the attribute relative to the containing element. */
29949    int n_no;
29950
29951    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29952    for (n_no = 0;n_no < gen_nb_int;n_no++) {
29953        mem_base = xmlMemBlocks();
29954        reader = gen_xmlTextReaderPtr(n_reader, 0);
29955        no = gen_int(n_no, 1);
29956
29957        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
29958        desret_int(ret_val);
29959        call_tests++;
29960        des_xmlTextReaderPtr(n_reader, reader, 0);
29961        des_int(n_no, no, 1);
29962        xmlResetLastError();
29963        if (mem_base != xmlMemBlocks()) {
29964            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
29965	           xmlMemBlocks() - mem_base);
29966	    test_ret++;
29967            printf(" %d", n_reader);
29968            printf(" %d", n_no);
29969            printf("\n");
29970        }
29971    }
29972    }
29973    function_tests++;
29974#endif
29975
29976    return(test_ret);
29977}
29978
29979
29980static int
29981test_xmlTextReaderMoveToAttributeNs(void) {
29982    int test_ret = 0;
29983
29984#ifdef LIBXML_READER_ENABLED
29985    int mem_base;
29986    int ret_val;
29987    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29988    int n_reader;
29989    xmlChar * localName; /* the local name of the attribute. */
29990    int n_localName;
29991    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
29992    int n_namespaceURI;
29993
29994    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29995    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
29996    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
29997        mem_base = xmlMemBlocks();
29998        reader = gen_xmlTextReaderPtr(n_reader, 0);
29999        localName = gen_const_xmlChar_ptr(n_localName, 1);
30000        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30001
30002        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30003        desret_int(ret_val);
30004        call_tests++;
30005        des_xmlTextReaderPtr(n_reader, reader, 0);
30006        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30007        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30008        xmlResetLastError();
30009        if (mem_base != xmlMemBlocks()) {
30010            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
30011	           xmlMemBlocks() - mem_base);
30012	    test_ret++;
30013            printf(" %d", n_reader);
30014            printf(" %d", n_localName);
30015            printf(" %d", n_namespaceURI);
30016            printf("\n");
30017        }
30018    }
30019    }
30020    }
30021    function_tests++;
30022#endif
30023
30024    return(test_ret);
30025}
30026
30027
30028static int
30029test_xmlTextReaderMoveToElement(void) {
30030    int test_ret = 0;
30031
30032#ifdef LIBXML_READER_ENABLED
30033    int mem_base;
30034    int ret_val;
30035    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30036    int n_reader;
30037
30038    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30039        mem_base = xmlMemBlocks();
30040        reader = gen_xmlTextReaderPtr(n_reader, 0);
30041
30042        ret_val = xmlTextReaderMoveToElement(reader);
30043        desret_int(ret_val);
30044        call_tests++;
30045        des_xmlTextReaderPtr(n_reader, reader, 0);
30046        xmlResetLastError();
30047        if (mem_base != xmlMemBlocks()) {
30048            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
30049	           xmlMemBlocks() - mem_base);
30050	    test_ret++;
30051            printf(" %d", n_reader);
30052            printf("\n");
30053        }
30054    }
30055    function_tests++;
30056#endif
30057
30058    return(test_ret);
30059}
30060
30061
30062static int
30063test_xmlTextReaderMoveToFirstAttribute(void) {
30064    int test_ret = 0;
30065
30066#ifdef LIBXML_READER_ENABLED
30067    int mem_base;
30068    int ret_val;
30069    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30070    int n_reader;
30071
30072    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30073        mem_base = xmlMemBlocks();
30074        reader = gen_xmlTextReaderPtr(n_reader, 0);
30075
30076        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
30077        desret_int(ret_val);
30078        call_tests++;
30079        des_xmlTextReaderPtr(n_reader, reader, 0);
30080        xmlResetLastError();
30081        if (mem_base != xmlMemBlocks()) {
30082            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
30083	           xmlMemBlocks() - mem_base);
30084	    test_ret++;
30085            printf(" %d", n_reader);
30086            printf("\n");
30087        }
30088    }
30089    function_tests++;
30090#endif
30091
30092    return(test_ret);
30093}
30094
30095
30096static int
30097test_xmlTextReaderMoveToNextAttribute(void) {
30098    int test_ret = 0;
30099
30100#ifdef LIBXML_READER_ENABLED
30101    int mem_base;
30102    int ret_val;
30103    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30104    int n_reader;
30105
30106    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30107        mem_base = xmlMemBlocks();
30108        reader = gen_xmlTextReaderPtr(n_reader, 0);
30109
30110        ret_val = xmlTextReaderMoveToNextAttribute(reader);
30111        desret_int(ret_val);
30112        call_tests++;
30113        des_xmlTextReaderPtr(n_reader, reader, 0);
30114        xmlResetLastError();
30115        if (mem_base != xmlMemBlocks()) {
30116            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
30117	           xmlMemBlocks() - mem_base);
30118	    test_ret++;
30119            printf(" %d", n_reader);
30120            printf("\n");
30121        }
30122    }
30123    function_tests++;
30124#endif
30125
30126    return(test_ret);
30127}
30128
30129
30130static int
30131test_xmlTextReaderName(void) {
30132    int test_ret = 0;
30133
30134#ifdef LIBXML_READER_ENABLED
30135    int mem_base;
30136    xmlChar * ret_val;
30137    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30138    int n_reader;
30139
30140    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30141        mem_base = xmlMemBlocks();
30142        reader = gen_xmlTextReaderPtr(n_reader, 0);
30143
30144        ret_val = xmlTextReaderName(reader);
30145        desret_xmlChar_ptr(ret_val);
30146        call_tests++;
30147        des_xmlTextReaderPtr(n_reader, reader, 0);
30148        xmlResetLastError();
30149        if (mem_base != xmlMemBlocks()) {
30150            printf("Leak of %d blocks found in xmlTextReaderName",
30151	           xmlMemBlocks() - mem_base);
30152	    test_ret++;
30153            printf(" %d", n_reader);
30154            printf("\n");
30155        }
30156    }
30157    function_tests++;
30158#endif
30159
30160    return(test_ret);
30161}
30162
30163
30164static int
30165test_xmlTextReaderNamespaceUri(void) {
30166    int test_ret = 0;
30167
30168#ifdef LIBXML_READER_ENABLED
30169    int mem_base;
30170    xmlChar * ret_val;
30171    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30172    int n_reader;
30173
30174    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30175        mem_base = xmlMemBlocks();
30176        reader = gen_xmlTextReaderPtr(n_reader, 0);
30177
30178        ret_val = xmlTextReaderNamespaceUri(reader);
30179        desret_xmlChar_ptr(ret_val);
30180        call_tests++;
30181        des_xmlTextReaderPtr(n_reader, reader, 0);
30182        xmlResetLastError();
30183        if (mem_base != xmlMemBlocks()) {
30184            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
30185	           xmlMemBlocks() - mem_base);
30186	    test_ret++;
30187            printf(" %d", n_reader);
30188            printf("\n");
30189        }
30190    }
30191    function_tests++;
30192#endif
30193
30194    return(test_ret);
30195}
30196
30197
30198static int
30199test_xmlTextReaderNext(void) {
30200    int test_ret = 0;
30201
30202#ifdef LIBXML_READER_ENABLED
30203    int mem_base;
30204    int ret_val;
30205    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30206    int n_reader;
30207
30208    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30209        mem_base = xmlMemBlocks();
30210        reader = gen_xmlTextReaderPtr(n_reader, 0);
30211
30212        ret_val = xmlTextReaderNext(reader);
30213        desret_int(ret_val);
30214        call_tests++;
30215        des_xmlTextReaderPtr(n_reader, reader, 0);
30216        xmlResetLastError();
30217        if (mem_base != xmlMemBlocks()) {
30218            printf("Leak of %d blocks found in xmlTextReaderNext",
30219	           xmlMemBlocks() - mem_base);
30220	    test_ret++;
30221            printf(" %d", n_reader);
30222            printf("\n");
30223        }
30224    }
30225    function_tests++;
30226#endif
30227
30228    return(test_ret);
30229}
30230
30231
30232static int
30233test_xmlTextReaderNextSibling(void) {
30234    int test_ret = 0;
30235
30236#ifdef LIBXML_READER_ENABLED
30237    int mem_base;
30238    int ret_val;
30239    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30240    int n_reader;
30241
30242    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30243        mem_base = xmlMemBlocks();
30244        reader = gen_xmlTextReaderPtr(n_reader, 0);
30245
30246        ret_val = xmlTextReaderNextSibling(reader);
30247        desret_int(ret_val);
30248        call_tests++;
30249        des_xmlTextReaderPtr(n_reader, reader, 0);
30250        xmlResetLastError();
30251        if (mem_base != xmlMemBlocks()) {
30252            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
30253	           xmlMemBlocks() - mem_base);
30254	    test_ret++;
30255            printf(" %d", n_reader);
30256            printf("\n");
30257        }
30258    }
30259    function_tests++;
30260#endif
30261
30262    return(test_ret);
30263}
30264
30265
30266static int
30267test_xmlTextReaderNodeType(void) {
30268    int test_ret = 0;
30269
30270#ifdef LIBXML_READER_ENABLED
30271    int mem_base;
30272    int ret_val;
30273    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30274    int n_reader;
30275
30276    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30277        mem_base = xmlMemBlocks();
30278        reader = gen_xmlTextReaderPtr(n_reader, 0);
30279
30280        ret_val = xmlTextReaderNodeType(reader);
30281        desret_int(ret_val);
30282        call_tests++;
30283        des_xmlTextReaderPtr(n_reader, reader, 0);
30284        xmlResetLastError();
30285        if (mem_base != xmlMemBlocks()) {
30286            printf("Leak of %d blocks found in xmlTextReaderNodeType",
30287	           xmlMemBlocks() - mem_base);
30288	    test_ret++;
30289            printf(" %d", n_reader);
30290            printf("\n");
30291        }
30292    }
30293    function_tests++;
30294#endif
30295
30296    return(test_ret);
30297}
30298
30299
30300static int
30301test_xmlTextReaderNormalization(void) {
30302    int test_ret = 0;
30303
30304#ifdef LIBXML_READER_ENABLED
30305    int mem_base;
30306    int ret_val;
30307    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30308    int n_reader;
30309
30310    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30311        mem_base = xmlMemBlocks();
30312        reader = gen_xmlTextReaderPtr(n_reader, 0);
30313
30314        ret_val = xmlTextReaderNormalization(reader);
30315        desret_int(ret_val);
30316        call_tests++;
30317        des_xmlTextReaderPtr(n_reader, reader, 0);
30318        xmlResetLastError();
30319        if (mem_base != xmlMemBlocks()) {
30320            printf("Leak of %d blocks found in xmlTextReaderNormalization",
30321	           xmlMemBlocks() - mem_base);
30322	    test_ret++;
30323            printf(" %d", n_reader);
30324            printf("\n");
30325        }
30326    }
30327    function_tests++;
30328#endif
30329
30330    return(test_ret);
30331}
30332
30333
30334static int
30335test_xmlTextReaderPrefix(void) {
30336    int test_ret = 0;
30337
30338#ifdef LIBXML_READER_ENABLED
30339    int mem_base;
30340    xmlChar * ret_val;
30341    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30342    int n_reader;
30343
30344    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30345        mem_base = xmlMemBlocks();
30346        reader = gen_xmlTextReaderPtr(n_reader, 0);
30347
30348        ret_val = xmlTextReaderPrefix(reader);
30349        desret_xmlChar_ptr(ret_val);
30350        call_tests++;
30351        des_xmlTextReaderPtr(n_reader, reader, 0);
30352        xmlResetLastError();
30353        if (mem_base != xmlMemBlocks()) {
30354            printf("Leak of %d blocks found in xmlTextReaderPrefix",
30355	           xmlMemBlocks() - mem_base);
30356	    test_ret++;
30357            printf(" %d", n_reader);
30358            printf("\n");
30359        }
30360    }
30361    function_tests++;
30362#endif
30363
30364    return(test_ret);
30365}
30366
30367
30368static int
30369test_xmlTextReaderPreserve(void) {
30370    int test_ret = 0;
30371
30372#ifdef LIBXML_READER_ENABLED
30373    int mem_base;
30374    xmlNodePtr ret_val;
30375    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30376    int n_reader;
30377
30378    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30379        mem_base = xmlMemBlocks();
30380        reader = gen_xmlTextReaderPtr(n_reader, 0);
30381
30382        ret_val = xmlTextReaderPreserve(reader);
30383        desret_xmlNodePtr(ret_val);
30384        call_tests++;
30385        des_xmlTextReaderPtr(n_reader, reader, 0);
30386        xmlResetLastError();
30387        if (mem_base != xmlMemBlocks()) {
30388            printf("Leak of %d blocks found in xmlTextReaderPreserve",
30389	           xmlMemBlocks() - mem_base);
30390	    test_ret++;
30391            printf(" %d", n_reader);
30392            printf("\n");
30393        }
30394    }
30395    function_tests++;
30396#endif
30397
30398    return(test_ret);
30399}
30400
30401
30402static int
30403test_xmlTextReaderPreservePattern(void) {
30404    int test_ret = 0;
30405
30406#ifdef LIBXML_READER_ENABLED
30407#ifdef LIBXML_PATTERN_ENABLED
30408    int mem_base;
30409    int ret_val;
30410    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30411    int n_reader;
30412    xmlChar * pattern; /* an XPath subset pattern */
30413    int n_pattern;
30414    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
30415    int n_namespaces;
30416
30417    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30418    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
30419    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
30420        mem_base = xmlMemBlocks();
30421        reader = gen_xmlTextReaderPtr(n_reader, 0);
30422        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
30423        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
30424
30425        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
30426        desret_int(ret_val);
30427        call_tests++;
30428        des_xmlTextReaderPtr(n_reader, reader, 0);
30429        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
30430        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
30431        xmlResetLastError();
30432        if (mem_base != xmlMemBlocks()) {
30433            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
30434	           xmlMemBlocks() - mem_base);
30435	    test_ret++;
30436            printf(" %d", n_reader);
30437            printf(" %d", n_pattern);
30438            printf(" %d", n_namespaces);
30439            printf("\n");
30440        }
30441    }
30442    }
30443    }
30444    function_tests++;
30445#endif
30446#endif
30447
30448    return(test_ret);
30449}
30450
30451
30452static int
30453test_xmlTextReaderQuoteChar(void) {
30454    int test_ret = 0;
30455
30456#ifdef LIBXML_READER_ENABLED
30457    int mem_base;
30458    int ret_val;
30459    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30460    int n_reader;
30461
30462    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30463        mem_base = xmlMemBlocks();
30464        reader = gen_xmlTextReaderPtr(n_reader, 0);
30465
30466        ret_val = xmlTextReaderQuoteChar(reader);
30467        desret_int(ret_val);
30468        call_tests++;
30469        des_xmlTextReaderPtr(n_reader, reader, 0);
30470        xmlResetLastError();
30471        if (mem_base != xmlMemBlocks()) {
30472            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
30473	           xmlMemBlocks() - mem_base);
30474	    test_ret++;
30475            printf(" %d", n_reader);
30476            printf("\n");
30477        }
30478    }
30479    function_tests++;
30480#endif
30481
30482    return(test_ret);
30483}
30484
30485
30486static int
30487test_xmlTextReaderRead(void) {
30488    int test_ret = 0;
30489
30490#ifdef LIBXML_READER_ENABLED
30491    int mem_base;
30492    int ret_val;
30493    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30494    int n_reader;
30495
30496    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30497        mem_base = xmlMemBlocks();
30498        reader = gen_xmlTextReaderPtr(n_reader, 0);
30499
30500        ret_val = xmlTextReaderRead(reader);
30501        desret_int(ret_val);
30502        call_tests++;
30503        des_xmlTextReaderPtr(n_reader, reader, 0);
30504        xmlResetLastError();
30505        if (mem_base != xmlMemBlocks()) {
30506            printf("Leak of %d blocks found in xmlTextReaderRead",
30507	           xmlMemBlocks() - mem_base);
30508	    test_ret++;
30509            printf(" %d", n_reader);
30510            printf("\n");
30511        }
30512    }
30513    function_tests++;
30514#endif
30515
30516    return(test_ret);
30517}
30518
30519
30520static int
30521test_xmlTextReaderReadAttributeValue(void) {
30522    int test_ret = 0;
30523
30524#ifdef LIBXML_READER_ENABLED
30525    int mem_base;
30526    int ret_val;
30527    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30528    int n_reader;
30529
30530    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30531        mem_base = xmlMemBlocks();
30532        reader = gen_xmlTextReaderPtr(n_reader, 0);
30533
30534        ret_val = xmlTextReaderReadAttributeValue(reader);
30535        desret_int(ret_val);
30536        call_tests++;
30537        des_xmlTextReaderPtr(n_reader, reader, 0);
30538        xmlResetLastError();
30539        if (mem_base != xmlMemBlocks()) {
30540            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
30541	           xmlMemBlocks() - mem_base);
30542	    test_ret++;
30543            printf(" %d", n_reader);
30544            printf("\n");
30545        }
30546    }
30547    function_tests++;
30548#endif
30549
30550    return(test_ret);
30551}
30552
30553
30554static int
30555test_xmlTextReaderReadState(void) {
30556    int test_ret = 0;
30557
30558#ifdef LIBXML_READER_ENABLED
30559    int mem_base;
30560    int ret_val;
30561    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30562    int n_reader;
30563
30564    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30565        mem_base = xmlMemBlocks();
30566        reader = gen_xmlTextReaderPtr(n_reader, 0);
30567
30568        ret_val = xmlTextReaderReadState(reader);
30569        desret_int(ret_val);
30570        call_tests++;
30571        des_xmlTextReaderPtr(n_reader, reader, 0);
30572        xmlResetLastError();
30573        if (mem_base != xmlMemBlocks()) {
30574            printf("Leak of %d blocks found in xmlTextReaderReadState",
30575	           xmlMemBlocks() - mem_base);
30576	    test_ret++;
30577            printf(" %d", n_reader);
30578            printf("\n");
30579        }
30580    }
30581    function_tests++;
30582#endif
30583
30584    return(test_ret);
30585}
30586
30587
30588static int
30589test_xmlTextReaderRelaxNGSetSchema(void) {
30590    int test_ret = 0;
30591
30592#ifdef LIBXML_READER_ENABLED
30593#ifdef LIBXML_SCHEMAS_ENABLED
30594    int mem_base;
30595    int ret_val;
30596    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30597    int n_reader;
30598    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
30599    int n_schema;
30600
30601    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30602    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
30603        mem_base = xmlMemBlocks();
30604        reader = gen_xmlTextReaderPtr(n_reader, 0);
30605        schema = gen_xmlRelaxNGPtr(n_schema, 1);
30606
30607        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
30608        desret_int(ret_val);
30609        call_tests++;
30610        des_xmlTextReaderPtr(n_reader, reader, 0);
30611        des_xmlRelaxNGPtr(n_schema, schema, 1);
30612        xmlResetLastError();
30613        if (mem_base != xmlMemBlocks()) {
30614            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
30615	           xmlMemBlocks() - mem_base);
30616	    test_ret++;
30617            printf(" %d", n_reader);
30618            printf(" %d", n_schema);
30619            printf("\n");
30620        }
30621    }
30622    }
30623    function_tests++;
30624#endif
30625#endif
30626
30627    return(test_ret);
30628}
30629
30630
30631static int
30632test_xmlTextReaderRelaxNGValidate(void) {
30633    int test_ret = 0;
30634
30635#ifdef LIBXML_READER_ENABLED
30636#ifdef LIBXML_SCHEMAS_ENABLED
30637    int mem_base;
30638    int ret_val;
30639    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30640    int n_reader;
30641    char * rng; /* the path to a RelaxNG schema or NULL */
30642    int n_rng;
30643
30644    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30645    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
30646        mem_base = xmlMemBlocks();
30647        reader = gen_xmlTextReaderPtr(n_reader, 0);
30648        rng = gen_const_char_ptr(n_rng, 1);
30649
30650        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
30651        desret_int(ret_val);
30652        call_tests++;
30653        des_xmlTextReaderPtr(n_reader, reader, 0);
30654        des_const_char_ptr(n_rng, (const char *)rng, 1);
30655        xmlResetLastError();
30656        if (mem_base != xmlMemBlocks()) {
30657            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
30658	           xmlMemBlocks() - mem_base);
30659	    test_ret++;
30660            printf(" %d", n_reader);
30661            printf(" %d", n_rng);
30662            printf("\n");
30663        }
30664    }
30665    }
30666    function_tests++;
30667#endif
30668#endif
30669
30670    return(test_ret);
30671}
30672
30673
30674static int
30675test_xmlTextReaderSetErrorHandler(void) {
30676    int test_ret = 0;
30677
30678
30679    /* missing type support */
30680    return(test_ret);
30681}
30682
30683
30684static int
30685test_xmlTextReaderSetParserProp(void) {
30686    int test_ret = 0;
30687
30688#ifdef LIBXML_READER_ENABLED
30689    int mem_base;
30690    int ret_val;
30691    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30692    int n_reader;
30693    int prop; /* the xmlParserProperties to set */
30694    int n_prop;
30695    int value; /* usually 0 or 1 to (de)activate it */
30696    int n_value;
30697
30698    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30699    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30700    for (n_value = 0;n_value < gen_nb_int;n_value++) {
30701        mem_base = xmlMemBlocks();
30702        reader = gen_xmlTextReaderPtr(n_reader, 0);
30703        prop = gen_int(n_prop, 1);
30704        value = gen_int(n_value, 2);
30705
30706        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
30707        desret_int(ret_val);
30708        call_tests++;
30709        des_xmlTextReaderPtr(n_reader, reader, 0);
30710        des_int(n_prop, prop, 1);
30711        des_int(n_value, value, 2);
30712        xmlResetLastError();
30713        if (mem_base != xmlMemBlocks()) {
30714            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
30715	           xmlMemBlocks() - mem_base);
30716	    test_ret++;
30717            printf(" %d", n_reader);
30718            printf(" %d", n_prop);
30719            printf(" %d", n_value);
30720            printf("\n");
30721        }
30722    }
30723    }
30724    }
30725    function_tests++;
30726#endif
30727
30728    return(test_ret);
30729}
30730
30731
30732static int
30733test_xmlTextReaderSetStructuredErrorHandler(void) {
30734    int test_ret = 0;
30735
30736
30737    /* missing type support */
30738    return(test_ret);
30739}
30740
30741
30742static int
30743test_xmlTextReaderStandalone(void) {
30744    int test_ret = 0;
30745
30746#ifdef LIBXML_READER_ENABLED
30747    int mem_base;
30748    int ret_val;
30749    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30750    int n_reader;
30751
30752    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30753        mem_base = xmlMemBlocks();
30754        reader = gen_xmlTextReaderPtr(n_reader, 0);
30755
30756        ret_val = xmlTextReaderStandalone(reader);
30757        desret_int(ret_val);
30758        call_tests++;
30759        des_xmlTextReaderPtr(n_reader, reader, 0);
30760        xmlResetLastError();
30761        if (mem_base != xmlMemBlocks()) {
30762            printf("Leak of %d blocks found in xmlTextReaderStandalone",
30763	           xmlMemBlocks() - mem_base);
30764	    test_ret++;
30765            printf(" %d", n_reader);
30766            printf("\n");
30767        }
30768    }
30769    function_tests++;
30770#endif
30771
30772    return(test_ret);
30773}
30774
30775
30776static int
30777test_xmlTextReaderValue(void) {
30778    int test_ret = 0;
30779
30780#ifdef LIBXML_READER_ENABLED
30781    int mem_base;
30782    xmlChar * ret_val;
30783    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30784    int n_reader;
30785
30786    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30787        mem_base = xmlMemBlocks();
30788        reader = gen_xmlTextReaderPtr(n_reader, 0);
30789
30790        ret_val = xmlTextReaderValue(reader);
30791        desret_xmlChar_ptr(ret_val);
30792        call_tests++;
30793        des_xmlTextReaderPtr(n_reader, reader, 0);
30794        xmlResetLastError();
30795        if (mem_base != xmlMemBlocks()) {
30796            printf("Leak of %d blocks found in xmlTextReaderValue",
30797	           xmlMemBlocks() - mem_base);
30798	    test_ret++;
30799            printf(" %d", n_reader);
30800            printf("\n");
30801        }
30802    }
30803    function_tests++;
30804#endif
30805
30806    return(test_ret);
30807}
30808
30809
30810static int
30811test_xmlTextReaderXmlLang(void) {
30812    int test_ret = 0;
30813
30814#ifdef LIBXML_READER_ENABLED
30815    int mem_base;
30816    xmlChar * ret_val;
30817    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30818    int n_reader;
30819
30820    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30821        mem_base = xmlMemBlocks();
30822        reader = gen_xmlTextReaderPtr(n_reader, 0);
30823
30824        ret_val = xmlTextReaderXmlLang(reader);
30825        desret_xmlChar_ptr(ret_val);
30826        call_tests++;
30827        des_xmlTextReaderPtr(n_reader, reader, 0);
30828        xmlResetLastError();
30829        if (mem_base != xmlMemBlocks()) {
30830            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
30831	           xmlMemBlocks() - mem_base);
30832	    test_ret++;
30833            printf(" %d", n_reader);
30834            printf("\n");
30835        }
30836    }
30837    function_tests++;
30838#endif
30839
30840    return(test_ret);
30841}
30842
30843static int
30844test_xmlreader(void) {
30845    int test_ret = 0;
30846
30847    if (quiet == 0) printf("Testing xmlreader : 68 of 78 functions ...\n");
30848    test_ret += test_xmlNewTextReader();
30849    test_ret += test_xmlNewTextReaderFilename();
30850    test_ret += test_xmlReaderForDoc();
30851    test_ret += test_xmlReaderForFile();
30852    test_ret += test_xmlReaderForMemory();
30853    test_ret += test_xmlReaderNewDoc();
30854    test_ret += test_xmlReaderNewFile();
30855    test_ret += test_xmlReaderNewMemory();
30856    test_ret += test_xmlReaderNewWalker();
30857    test_ret += test_xmlReaderWalker();
30858    test_ret += test_xmlTextReaderAttributeCount();
30859    test_ret += test_xmlTextReaderBaseUri();
30860    test_ret += test_xmlTextReaderClose();
30861    test_ret += test_xmlTextReaderConstBaseUri();
30862    test_ret += test_xmlTextReaderConstEncoding();
30863    test_ret += test_xmlTextReaderConstLocalName();
30864    test_ret += test_xmlTextReaderConstName();
30865    test_ret += test_xmlTextReaderConstNamespaceUri();
30866    test_ret += test_xmlTextReaderConstPrefix();
30867    test_ret += test_xmlTextReaderConstString();
30868    test_ret += test_xmlTextReaderConstValue();
30869    test_ret += test_xmlTextReaderConstXmlLang();
30870    test_ret += test_xmlTextReaderConstXmlVersion();
30871    test_ret += test_xmlTextReaderCurrentDoc();
30872    test_ret += test_xmlTextReaderCurrentNode();
30873    test_ret += test_xmlTextReaderDepth();
30874    test_ret += test_xmlTextReaderExpand();
30875    test_ret += test_xmlTextReaderGetAttribute();
30876    test_ret += test_xmlTextReaderGetAttributeNo();
30877    test_ret += test_xmlTextReaderGetAttributeNs();
30878    test_ret += test_xmlTextReaderGetErrorHandler();
30879    test_ret += test_xmlTextReaderGetParserProp();
30880    test_ret += test_xmlTextReaderGetRemainder();
30881    test_ret += test_xmlTextReaderHasAttributes();
30882    test_ret += test_xmlTextReaderHasValue();
30883    test_ret += test_xmlTextReaderIsDefault();
30884    test_ret += test_xmlTextReaderIsEmptyElement();
30885    test_ret += test_xmlTextReaderIsNamespaceDecl();
30886    test_ret += test_xmlTextReaderIsValid();
30887    test_ret += test_xmlTextReaderLocalName();
30888    test_ret += test_xmlTextReaderLocatorBaseURI();
30889    test_ret += test_xmlTextReaderLocatorLineNumber();
30890    test_ret += test_xmlTextReaderLookupNamespace();
30891    test_ret += test_xmlTextReaderMoveToAttribute();
30892    test_ret += test_xmlTextReaderMoveToAttributeNo();
30893    test_ret += test_xmlTextReaderMoveToAttributeNs();
30894    test_ret += test_xmlTextReaderMoveToElement();
30895    test_ret += test_xmlTextReaderMoveToFirstAttribute();
30896    test_ret += test_xmlTextReaderMoveToNextAttribute();
30897    test_ret += test_xmlTextReaderName();
30898    test_ret += test_xmlTextReaderNamespaceUri();
30899    test_ret += test_xmlTextReaderNext();
30900    test_ret += test_xmlTextReaderNextSibling();
30901    test_ret += test_xmlTextReaderNodeType();
30902    test_ret += test_xmlTextReaderNormalization();
30903    test_ret += test_xmlTextReaderPrefix();
30904    test_ret += test_xmlTextReaderPreserve();
30905    test_ret += test_xmlTextReaderPreservePattern();
30906    test_ret += test_xmlTextReaderQuoteChar();
30907    test_ret += test_xmlTextReaderRead();
30908    test_ret += test_xmlTextReaderReadAttributeValue();
30909    test_ret += test_xmlTextReaderReadState();
30910    test_ret += test_xmlTextReaderRelaxNGSetSchema();
30911    test_ret += test_xmlTextReaderRelaxNGValidate();
30912    test_ret += test_xmlTextReaderSetErrorHandler();
30913    test_ret += test_xmlTextReaderSetParserProp();
30914    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
30915    test_ret += test_xmlTextReaderStandalone();
30916    test_ret += test_xmlTextReaderValue();
30917    test_ret += test_xmlTextReaderXmlLang();
30918
30919    if (test_ret != 0)
30920	printf("Module xmlreader: %d errors\n", test_ret);
30921    return(test_ret);
30922}
30923#ifdef LIBXML_REGEXP_ENABLED
30924
30925#define gen_nb_xmlRegExecCtxtPtr 1
30926static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30927    return(NULL);
30928}
30929static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30930}
30931#endif
30932
30933
30934static int
30935test_xmlRegExecPushString(void) {
30936    int test_ret = 0;
30937
30938#ifdef LIBXML_REGEXP_ENABLED
30939    int mem_base;
30940    int ret_val;
30941    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
30942    int n_exec;
30943    xmlChar * value; /* a string token input */
30944    int n_value;
30945    void * data; /* data associated to the token to reuse in callbacks */
30946    int n_data;
30947
30948    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
30949    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
30950    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
30951        mem_base = xmlMemBlocks();
30952        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
30953        value = gen_const_xmlChar_ptr(n_value, 1);
30954        data = gen_userdata(n_data, 2);
30955
30956        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
30957        desret_int(ret_val);
30958        call_tests++;
30959        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
30960        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
30961        des_userdata(n_data, data, 2);
30962        xmlResetLastError();
30963        if (mem_base != xmlMemBlocks()) {
30964            printf("Leak of %d blocks found in xmlRegExecPushString",
30965	           xmlMemBlocks() - mem_base);
30966	    test_ret++;
30967            printf(" %d", n_exec);
30968            printf(" %d", n_value);
30969            printf(" %d", n_data);
30970            printf("\n");
30971        }
30972    }
30973    }
30974    }
30975    function_tests++;
30976#endif
30977
30978    return(test_ret);
30979}
30980
30981
30982static int
30983test_xmlRegExecPushString2(void) {
30984    int test_ret = 0;
30985
30986#ifdef LIBXML_REGEXP_ENABLED
30987    int mem_base;
30988    int ret_val;
30989    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
30990    int n_exec;
30991    xmlChar * value; /* the first string token input */
30992    int n_value;
30993    xmlChar * value2; /* the second string token input */
30994    int n_value2;
30995    void * data; /* data associated to the token to reuse in callbacks */
30996    int n_data;
30997
30998    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
30999    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
31000    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
31001    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
31002        mem_base = xmlMemBlocks();
31003        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
31004        value = gen_const_xmlChar_ptr(n_value, 1);
31005        value2 = gen_const_xmlChar_ptr(n_value2, 2);
31006        data = gen_userdata(n_data, 3);
31007
31008        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
31009        desret_int(ret_val);
31010        call_tests++;
31011        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
31012        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
31013        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
31014        des_userdata(n_data, data, 3);
31015        xmlResetLastError();
31016        if (mem_base != xmlMemBlocks()) {
31017            printf("Leak of %d blocks found in xmlRegExecPushString2",
31018	           xmlMemBlocks() - mem_base);
31019	    test_ret++;
31020            printf(" %d", n_exec);
31021            printf(" %d", n_value);
31022            printf(" %d", n_value2);
31023            printf(" %d", n_data);
31024            printf("\n");
31025        }
31026    }
31027    }
31028    }
31029    }
31030    function_tests++;
31031#endif
31032
31033    return(test_ret);
31034}
31035
31036#ifdef LIBXML_REGEXP_ENABLED
31037
31038#define gen_nb_xmlRegexpPtr 1
31039static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31040    return(NULL);
31041}
31042static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31043}
31044#endif
31045
31046
31047static int
31048test_xmlRegNewExecCtxt(void) {
31049    int test_ret = 0;
31050
31051
31052    /* missing type support */
31053    return(test_ret);
31054}
31055
31056
31057static int
31058test_xmlRegexpCompile(void) {
31059    int test_ret = 0;
31060
31061
31062    /* missing type support */
31063    return(test_ret);
31064}
31065
31066
31067static int
31068test_xmlRegexpExec(void) {
31069    int test_ret = 0;
31070
31071#ifdef LIBXML_REGEXP_ENABLED
31072    int mem_base;
31073    int ret_val;
31074    xmlRegexpPtr comp; /* the compiled regular expression */
31075    int n_comp;
31076    xmlChar * content; /* the value to check against the regular expression */
31077    int n_content;
31078
31079    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
31080    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
31081        mem_base = xmlMemBlocks();
31082        comp = gen_xmlRegexpPtr(n_comp, 0);
31083        content = gen_const_xmlChar_ptr(n_content, 1);
31084
31085        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
31086        desret_int(ret_val);
31087        call_tests++;
31088        des_xmlRegexpPtr(n_comp, comp, 0);
31089        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
31090        xmlResetLastError();
31091        if (mem_base != xmlMemBlocks()) {
31092            printf("Leak of %d blocks found in xmlRegexpExec",
31093	           xmlMemBlocks() - mem_base);
31094	    test_ret++;
31095            printf(" %d", n_comp);
31096            printf(" %d", n_content);
31097            printf("\n");
31098        }
31099    }
31100    }
31101    function_tests++;
31102#endif
31103
31104    return(test_ret);
31105}
31106
31107
31108static int
31109test_xmlRegexpIsDeterminist(void) {
31110    int test_ret = 0;
31111
31112#ifdef LIBXML_REGEXP_ENABLED
31113    int mem_base;
31114    int ret_val;
31115    xmlRegexpPtr comp; /* the compiled regular expression */
31116    int n_comp;
31117
31118    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
31119        mem_base = xmlMemBlocks();
31120        comp = gen_xmlRegexpPtr(n_comp, 0);
31121
31122        ret_val = xmlRegexpIsDeterminist(comp);
31123        desret_int(ret_val);
31124        call_tests++;
31125        des_xmlRegexpPtr(n_comp, comp, 0);
31126        xmlResetLastError();
31127        if (mem_base != xmlMemBlocks()) {
31128            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
31129	           xmlMemBlocks() - mem_base);
31130	    test_ret++;
31131            printf(" %d", n_comp);
31132            printf("\n");
31133        }
31134    }
31135    function_tests++;
31136#endif
31137
31138    return(test_ret);
31139}
31140
31141
31142static int
31143test_xmlRegexpPrint(void) {
31144    int test_ret = 0;
31145
31146#ifdef LIBXML_REGEXP_ENABLED
31147    int mem_base;
31148    FILE * output; /* the file for the output debug */
31149    int n_output;
31150    xmlRegexpPtr regexp; /* the compiled regexp */
31151    int n_regexp;
31152
31153    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
31154    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
31155        mem_base = xmlMemBlocks();
31156        output = gen_FILE_ptr(n_output, 0);
31157        regexp = gen_xmlRegexpPtr(n_regexp, 1);
31158
31159        xmlRegexpPrint(output, regexp);
31160        call_tests++;
31161        des_FILE_ptr(n_output, output, 0);
31162        des_xmlRegexpPtr(n_regexp, regexp, 1);
31163        xmlResetLastError();
31164        if (mem_base != xmlMemBlocks()) {
31165            printf("Leak of %d blocks found in xmlRegexpPrint",
31166	           xmlMemBlocks() - mem_base);
31167	    test_ret++;
31168            printf(" %d", n_output);
31169            printf(" %d", n_regexp);
31170            printf("\n");
31171        }
31172    }
31173    }
31174    function_tests++;
31175#endif
31176
31177    return(test_ret);
31178}
31179
31180static int
31181test_xmlregexp(void) {
31182    int test_ret = 0;
31183
31184    if (quiet == 0) printf("Testing xmlregexp : 5 of 9 functions ...\n");
31185    test_ret += test_xmlRegExecPushString();
31186    test_ret += test_xmlRegExecPushString2();
31187    test_ret += test_xmlRegNewExecCtxt();
31188    test_ret += test_xmlRegexpCompile();
31189    test_ret += test_xmlRegexpExec();
31190    test_ret += test_xmlRegexpIsDeterminist();
31191    test_ret += test_xmlRegexpPrint();
31192
31193    if (test_ret != 0)
31194	printf("Module xmlregexp: %d errors\n", test_ret);
31195    return(test_ret);
31196}
31197#ifdef LIBXML_OUTPUT_ENABLED
31198
31199#define gen_nb_xmlSaveCtxtPtr 1
31200static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31201    return(NULL);
31202}
31203static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31204}
31205#endif
31206
31207
31208static int
31209test_xmlSaveClose(void) {
31210    int test_ret = 0;
31211
31212#ifdef LIBXML_OUTPUT_ENABLED
31213    int mem_base;
31214    int ret_val;
31215    xmlSaveCtxtPtr ctxt; /* a document saving context */
31216    int n_ctxt;
31217
31218    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31219        mem_base = xmlMemBlocks();
31220        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31221
31222        ret_val = xmlSaveClose(ctxt);
31223        desret_int(ret_val);
31224        call_tests++;
31225        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31226        xmlResetLastError();
31227        if (mem_base != xmlMemBlocks()) {
31228            printf("Leak of %d blocks found in xmlSaveClose",
31229	           xmlMemBlocks() - mem_base);
31230	    test_ret++;
31231            printf(" %d", n_ctxt);
31232            printf("\n");
31233        }
31234    }
31235    function_tests++;
31236#endif
31237
31238    return(test_ret);
31239}
31240
31241
31242static int
31243test_xmlSaveDoc(void) {
31244    int test_ret = 0;
31245
31246#ifdef LIBXML_OUTPUT_ENABLED
31247    int mem_base;
31248    long ret_val;
31249    xmlSaveCtxtPtr ctxt; /* a document saving context */
31250    int n_ctxt;
31251    xmlDocPtr doc; /* a document */
31252    int n_doc;
31253
31254    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31255    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31256        mem_base = xmlMemBlocks();
31257        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31258        doc = gen_xmlDocPtr(n_doc, 1);
31259
31260        ret_val = xmlSaveDoc(ctxt, doc);
31261        desret_long(ret_val);
31262        call_tests++;
31263        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31264        des_xmlDocPtr(n_doc, doc, 1);
31265        xmlResetLastError();
31266        if (mem_base != xmlMemBlocks()) {
31267            printf("Leak of %d blocks found in xmlSaveDoc",
31268	           xmlMemBlocks() - mem_base);
31269	    test_ret++;
31270            printf(" %d", n_ctxt);
31271            printf(" %d", n_doc);
31272            printf("\n");
31273        }
31274    }
31275    }
31276    function_tests++;
31277#endif
31278
31279    return(test_ret);
31280}
31281
31282
31283static int
31284test_xmlSaveFlush(void) {
31285    int test_ret = 0;
31286
31287#ifdef LIBXML_OUTPUT_ENABLED
31288    int mem_base;
31289    int ret_val;
31290    xmlSaveCtxtPtr ctxt; /* a document saving context */
31291    int n_ctxt;
31292
31293    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31294        mem_base = xmlMemBlocks();
31295        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31296
31297        ret_val = xmlSaveFlush(ctxt);
31298        desret_int(ret_val);
31299        call_tests++;
31300        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31301        xmlResetLastError();
31302        if (mem_base != xmlMemBlocks()) {
31303            printf("Leak of %d blocks found in xmlSaveFlush",
31304	           xmlMemBlocks() - mem_base);
31305	    test_ret++;
31306            printf(" %d", n_ctxt);
31307            printf("\n");
31308        }
31309    }
31310    function_tests++;
31311#endif
31312
31313    return(test_ret);
31314}
31315
31316
31317static int
31318test_xmlSaveSetAttrEscape(void) {
31319    int test_ret = 0;
31320
31321
31322    /* missing type support */
31323    return(test_ret);
31324}
31325
31326
31327static int
31328test_xmlSaveSetEscape(void) {
31329    int test_ret = 0;
31330
31331
31332    /* missing type support */
31333    return(test_ret);
31334}
31335
31336
31337static int
31338test_xmlSaveToFd(void) {
31339    int test_ret = 0;
31340
31341
31342    /* missing type support */
31343    return(test_ret);
31344}
31345
31346
31347static int
31348test_xmlSaveToFilename(void) {
31349    int test_ret = 0;
31350
31351
31352    /* missing type support */
31353    return(test_ret);
31354}
31355
31356
31357static int
31358test_xmlSaveTree(void) {
31359    int test_ret = 0;
31360
31361#ifdef LIBXML_OUTPUT_ENABLED
31362    int mem_base;
31363    long ret_val;
31364    xmlSaveCtxtPtr ctxt; /* a document saving context */
31365    int n_ctxt;
31366    xmlNodePtr node; /* a document */
31367    int n_node;
31368
31369    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
31370    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
31371        mem_base = xmlMemBlocks();
31372        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
31373        node = gen_xmlNodePtr(n_node, 1);
31374
31375        ret_val = xmlSaveTree(ctxt, node);
31376        desret_long(ret_val);
31377        call_tests++;
31378        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
31379        des_xmlNodePtr(n_node, node, 1);
31380        xmlResetLastError();
31381        if (mem_base != xmlMemBlocks()) {
31382            printf("Leak of %d blocks found in xmlSaveTree",
31383	           xmlMemBlocks() - mem_base);
31384	    test_ret++;
31385            printf(" %d", n_ctxt);
31386            printf(" %d", n_node);
31387            printf("\n");
31388        }
31389    }
31390    }
31391    function_tests++;
31392#endif
31393
31394    return(test_ret);
31395}
31396
31397static int
31398test_xmlsave(void) {
31399    int test_ret = 0;
31400
31401    if (quiet == 0) printf("Testing xmlsave : 4 of 9 functions ...\n");
31402    test_ret += test_xmlSaveClose();
31403    test_ret += test_xmlSaveDoc();
31404    test_ret += test_xmlSaveFlush();
31405    test_ret += test_xmlSaveSetAttrEscape();
31406    test_ret += test_xmlSaveSetEscape();
31407    test_ret += test_xmlSaveToFd();
31408    test_ret += test_xmlSaveToFilename();
31409    test_ret += test_xmlSaveTree();
31410
31411    if (test_ret != 0)
31412	printf("Module xmlsave: %d errors\n", test_ret);
31413    return(test_ret);
31414}
31415#ifdef LIBXML_SCHEMAS_ENABLED
31416
31417#define gen_nb_xmlSchemaPtr 1
31418static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31419    return(NULL);
31420}
31421static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31422}
31423#endif
31424
31425
31426static int
31427test_xmlSchemaDump(void) {
31428    int test_ret = 0;
31429
31430#ifdef LIBXML_SCHEMAS_ENABLED
31431#ifdef LIBXML_OUTPUT_ENABLED
31432    int mem_base;
31433    FILE * output; /* the file output */
31434    int n_output;
31435    xmlSchemaPtr schema; /* a schema structure */
31436    int n_schema;
31437
31438    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
31439    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
31440        mem_base = xmlMemBlocks();
31441        output = gen_FILE_ptr(n_output, 0);
31442        schema = gen_xmlSchemaPtr(n_schema, 1);
31443
31444        xmlSchemaDump(output, schema);
31445        call_tests++;
31446        des_FILE_ptr(n_output, output, 0);
31447        des_xmlSchemaPtr(n_schema, schema, 1);
31448        xmlResetLastError();
31449        if (mem_base != xmlMemBlocks()) {
31450            printf("Leak of %d blocks found in xmlSchemaDump",
31451	           xmlMemBlocks() - mem_base);
31452	    test_ret++;
31453            printf(" %d", n_output);
31454            printf(" %d", n_schema);
31455            printf("\n");
31456        }
31457    }
31458    }
31459    function_tests++;
31460#endif
31461#endif
31462
31463    return(test_ret);
31464}
31465
31466#ifdef LIBXML_SCHEMAS_ENABLED
31467
31468#define gen_nb_xmlSchemaParserCtxtPtr 1
31469static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31470    return(NULL);
31471}
31472static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31473}
31474#endif
31475
31476#ifdef LIBXML_SCHEMAS_ENABLED
31477
31478#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
31479static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31480    return(NULL);
31481}
31482static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31483}
31484#endif
31485
31486#ifdef LIBXML_SCHEMAS_ENABLED
31487
31488#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
31489static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31490    return(NULL);
31491}
31492static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31493}
31494#endif
31495
31496
31497static int
31498test_xmlSchemaGetParserErrors(void) {
31499    int test_ret = 0;
31500
31501#ifdef LIBXML_SCHEMAS_ENABLED
31502    int mem_base;
31503    int ret_val;
31504    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
31505    int n_ctxt;
31506    xmlSchemaValidityErrorFunc * err; /* the error callback result */
31507    int n_err;
31508    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
31509    int n_warn;
31510    void ** ctx; /* contextual data for the callbacks result */
31511    int n_ctx;
31512
31513    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
31514    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
31515    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
31516    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
31517        mem_base = xmlMemBlocks();
31518        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
31519        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
31520        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
31521        ctx = gen_void_ptr_ptr(n_ctx, 3);
31522
31523        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
31524        desret_int(ret_val);
31525        call_tests++;
31526        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
31527        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
31528        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
31529        des_void_ptr_ptr(n_ctx, ctx, 3);
31530        xmlResetLastError();
31531        if (mem_base != xmlMemBlocks()) {
31532            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
31533	           xmlMemBlocks() - mem_base);
31534	    test_ret++;
31535            printf(" %d", n_ctxt);
31536            printf(" %d", n_err);
31537            printf(" %d", n_warn);
31538            printf(" %d", n_ctx);
31539            printf("\n");
31540        }
31541    }
31542    }
31543    }
31544    }
31545    function_tests++;
31546#endif
31547
31548    return(test_ret);
31549}
31550
31551#ifdef LIBXML_SCHEMAS_ENABLED
31552
31553#define gen_nb_xmlSchemaValidCtxtPtr 1
31554static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31555    return(NULL);
31556}
31557static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31558}
31559#endif
31560
31561
31562static int
31563test_xmlSchemaGetValidErrors(void) {
31564    int test_ret = 0;
31565
31566#ifdef LIBXML_SCHEMAS_ENABLED
31567    int mem_base;
31568    int ret_val;
31569    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
31570    int n_ctxt;
31571    xmlSchemaValidityErrorFunc * err; /* the error function result */
31572    int n_err;
31573    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
31574    int n_warn;
31575    void ** ctx; /* the functions context result */
31576    int n_ctx;
31577
31578    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31579    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
31580    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
31581    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
31582        mem_base = xmlMemBlocks();
31583        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31584        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
31585        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
31586        ctx = gen_void_ptr_ptr(n_ctx, 3);
31587
31588        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
31589        desret_int(ret_val);
31590        call_tests++;
31591        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31592        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
31593        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
31594        des_void_ptr_ptr(n_ctx, ctx, 3);
31595        xmlResetLastError();
31596        if (mem_base != xmlMemBlocks()) {
31597            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
31598	           xmlMemBlocks() - mem_base);
31599	    test_ret++;
31600            printf(" %d", n_ctxt);
31601            printf(" %d", n_err);
31602            printf(" %d", n_warn);
31603            printf(" %d", n_ctx);
31604            printf("\n");
31605        }
31606    }
31607    }
31608    }
31609    }
31610    function_tests++;
31611#endif
31612
31613    return(test_ret);
31614}
31615
31616
31617static int
31618test_xmlSchemaNewDocParserCtxt(void) {
31619    int test_ret = 0;
31620
31621#ifdef LIBXML_SCHEMAS_ENABLED
31622    int mem_base;
31623    xmlSchemaParserCtxtPtr ret_val;
31624    xmlDocPtr doc; /* a preparsed document tree */
31625    int n_doc;
31626
31627    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31628        mem_base = xmlMemBlocks();
31629        doc = gen_xmlDocPtr(n_doc, 0);
31630
31631        ret_val = xmlSchemaNewDocParserCtxt(doc);
31632        desret_xmlSchemaParserCtxtPtr(ret_val);
31633        call_tests++;
31634        des_xmlDocPtr(n_doc, doc, 0);
31635        xmlResetLastError();
31636        if (mem_base != xmlMemBlocks()) {
31637            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
31638	           xmlMemBlocks() - mem_base);
31639	    test_ret++;
31640            printf(" %d", n_doc);
31641            printf("\n");
31642        }
31643    }
31644    function_tests++;
31645#endif
31646
31647    return(test_ret);
31648}
31649
31650
31651static int
31652test_xmlSchemaNewMemParserCtxt(void) {
31653    int test_ret = 0;
31654
31655#ifdef LIBXML_SCHEMAS_ENABLED
31656    int mem_base;
31657    xmlSchemaParserCtxtPtr ret_val;
31658    char * buffer; /* a pointer to a char array containing the schemas */
31659    int n_buffer;
31660    int size; /* the size of the array */
31661    int n_size;
31662
31663    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
31664    for (n_size = 0;n_size < gen_nb_int;n_size++) {
31665        mem_base = xmlMemBlocks();
31666        buffer = gen_const_char_ptr(n_buffer, 0);
31667        size = gen_int(n_size, 1);
31668
31669        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
31670        desret_xmlSchemaParserCtxtPtr(ret_val);
31671        call_tests++;
31672        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
31673        des_int(n_size, size, 1);
31674        xmlResetLastError();
31675        if (mem_base != xmlMemBlocks()) {
31676            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
31677	           xmlMemBlocks() - mem_base);
31678	    test_ret++;
31679            printf(" %d", n_buffer);
31680            printf(" %d", n_size);
31681            printf("\n");
31682        }
31683    }
31684    }
31685    function_tests++;
31686#endif
31687
31688    return(test_ret);
31689}
31690
31691
31692static int
31693test_xmlSchemaNewParserCtxt(void) {
31694    int test_ret = 0;
31695
31696#ifdef LIBXML_SCHEMAS_ENABLED
31697    int mem_base;
31698    xmlSchemaParserCtxtPtr ret_val;
31699    char * URL; /* the location of the schema */
31700    int n_URL;
31701
31702    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
31703        mem_base = xmlMemBlocks();
31704        URL = gen_const_char_ptr(n_URL, 0);
31705
31706        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
31707        desret_xmlSchemaParserCtxtPtr(ret_val);
31708        call_tests++;
31709        des_const_char_ptr(n_URL, (const char *)URL, 0);
31710        xmlResetLastError();
31711        if (mem_base != xmlMemBlocks()) {
31712            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
31713	           xmlMemBlocks() - mem_base);
31714	    test_ret++;
31715            printf(" %d", n_URL);
31716            printf("\n");
31717        }
31718    }
31719    function_tests++;
31720#endif
31721
31722    return(test_ret);
31723}
31724
31725
31726static int
31727test_xmlSchemaNewValidCtxt(void) {
31728    int test_ret = 0;
31729
31730
31731    /* missing type support */
31732    return(test_ret);
31733}
31734
31735
31736static int
31737test_xmlSchemaParse(void) {
31738    int test_ret = 0;
31739
31740
31741    /* missing type support */
31742    return(test_ret);
31743}
31744
31745
31746static int
31747test_xmlSchemaSetParserErrors(void) {
31748    int test_ret = 0;
31749
31750
31751    /* missing type support */
31752    return(test_ret);
31753}
31754
31755
31756static int
31757test_xmlSchemaSetValidErrors(void) {
31758    int test_ret = 0;
31759
31760
31761    /* missing type support */
31762    return(test_ret);
31763}
31764
31765
31766static int
31767test_xmlSchemaSetValidOptions(void) {
31768    int test_ret = 0;
31769
31770#ifdef LIBXML_SCHEMAS_ENABLED
31771    int mem_base;
31772    int ret_val;
31773    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31774    int n_ctxt;
31775    int options; /* a combination of xmlSchemaValidOption */
31776    int n_options;
31777
31778    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31779    for (n_options = 0;n_options < gen_nb_int;n_options++) {
31780        mem_base = xmlMemBlocks();
31781        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31782        options = gen_int(n_options, 1);
31783
31784        ret_val = xmlSchemaSetValidOptions(ctxt, options);
31785        desret_int(ret_val);
31786        call_tests++;
31787        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31788        des_int(n_options, options, 1);
31789        xmlResetLastError();
31790        if (mem_base != xmlMemBlocks()) {
31791            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
31792	           xmlMemBlocks() - mem_base);
31793	    test_ret++;
31794            printf(" %d", n_ctxt);
31795            printf(" %d", n_options);
31796            printf("\n");
31797        }
31798    }
31799    }
31800    function_tests++;
31801#endif
31802
31803    return(test_ret);
31804}
31805
31806
31807static int
31808test_xmlSchemaValidCtxtGetOptions(void) {
31809    int test_ret = 0;
31810
31811#ifdef LIBXML_SCHEMAS_ENABLED
31812    int mem_base;
31813    int ret_val;
31814    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31815    int n_ctxt;
31816
31817    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31818        mem_base = xmlMemBlocks();
31819        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31820
31821        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
31822        desret_int(ret_val);
31823        call_tests++;
31824        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31825        xmlResetLastError();
31826        if (mem_base != xmlMemBlocks()) {
31827            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
31828	           xmlMemBlocks() - mem_base);
31829	    test_ret++;
31830            printf(" %d", n_ctxt);
31831            printf("\n");
31832        }
31833    }
31834    function_tests++;
31835#endif
31836
31837    return(test_ret);
31838}
31839
31840
31841static int
31842test_xmlSchemaValidateDoc(void) {
31843    int test_ret = 0;
31844
31845#ifdef LIBXML_SCHEMAS_ENABLED
31846    int mem_base;
31847    int ret_val;
31848    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31849    int n_ctxt;
31850    xmlDocPtr doc; /* a parsed document tree */
31851    int n_doc;
31852
31853    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31854    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
31855        mem_base = xmlMemBlocks();
31856        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31857        doc = gen_xmlDocPtr(n_doc, 1);
31858
31859        ret_val = xmlSchemaValidateDoc(ctxt, doc);
31860        desret_int(ret_val);
31861        call_tests++;
31862        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31863        des_xmlDocPtr(n_doc, doc, 1);
31864        xmlResetLastError();
31865        if (mem_base != xmlMemBlocks()) {
31866            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
31867	           xmlMemBlocks() - mem_base);
31868	    test_ret++;
31869            printf(" %d", n_ctxt);
31870            printf(" %d", n_doc);
31871            printf("\n");
31872        }
31873    }
31874    }
31875    function_tests++;
31876#endif
31877
31878    return(test_ret);
31879}
31880
31881
31882static int
31883test_xmlSchemaValidateOneElement(void) {
31884    int test_ret = 0;
31885
31886#ifdef LIBXML_SCHEMAS_ENABLED
31887    int mem_base;
31888    int ret_val;
31889    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31890    int n_ctxt;
31891    xmlNodePtr elem; /* an element node */
31892    int n_elem;
31893
31894    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31895    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
31896        mem_base = xmlMemBlocks();
31897        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31898        elem = gen_xmlNodePtr(n_elem, 1);
31899
31900        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
31901        desret_int(ret_val);
31902        call_tests++;
31903        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31904        des_xmlNodePtr(n_elem, elem, 1);
31905        xmlResetLastError();
31906        if (mem_base != xmlMemBlocks()) {
31907            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
31908	           xmlMemBlocks() - mem_base);
31909	    test_ret++;
31910            printf(" %d", n_ctxt);
31911            printf(" %d", n_elem);
31912            printf("\n");
31913        }
31914    }
31915    }
31916    function_tests++;
31917#endif
31918
31919    return(test_ret);
31920}
31921
31922
31923static int
31924test_xmlSchemaValidateStream(void) {
31925    int test_ret = 0;
31926
31927#ifdef LIBXML_SCHEMAS_ENABLED
31928    int mem_base;
31929    int ret_val;
31930    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
31931    int n_ctxt;
31932    xmlParserInputBufferPtr input; /* the input to use for reading the data */
31933    int n_input;
31934    xmlCharEncoding enc; /* an optional encoding information */
31935    int n_enc;
31936    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
31937    int n_sax;
31938    void * user_data; /* the context to provide to the SAX handler. */
31939    int n_user_data;
31940
31941    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
31942    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
31943    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
31944    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
31945    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
31946        mem_base = xmlMemBlocks();
31947        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
31948        input = gen_xmlParserInputBufferPtr(n_input, 1);
31949        enc = gen_xmlCharEncoding(n_enc, 2);
31950        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
31951        user_data = gen_userdata(n_user_data, 4);
31952
31953        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
31954        desret_int(ret_val);
31955        call_tests++;
31956        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
31957        des_xmlParserInputBufferPtr(n_input, input, 1);
31958        des_xmlCharEncoding(n_enc, enc, 2);
31959        des_xmlSAXHandlerPtr(n_sax, sax, 3);
31960        des_userdata(n_user_data, user_data, 4);
31961        xmlResetLastError();
31962        if (mem_base != xmlMemBlocks()) {
31963            printf("Leak of %d blocks found in xmlSchemaValidateStream",
31964	           xmlMemBlocks() - mem_base);
31965	    test_ret++;
31966            printf(" %d", n_ctxt);
31967            printf(" %d", n_input);
31968            printf(" %d", n_enc);
31969            printf(" %d", n_sax);
31970            printf(" %d", n_user_data);
31971            printf("\n");
31972        }
31973    }
31974    }
31975    }
31976    }
31977    }
31978    function_tests++;
31979#endif
31980
31981    return(test_ret);
31982}
31983
31984static int
31985test_xmlschemas(void) {
31986    int test_ret = 0;
31987
31988    if (quiet == 0) printf("Testing xmlschemas : 11 of 18 functions ...\n");
31989    test_ret += test_xmlSchemaDump();
31990    test_ret += test_xmlSchemaGetParserErrors();
31991    test_ret += test_xmlSchemaGetValidErrors();
31992    test_ret += test_xmlSchemaNewDocParserCtxt();
31993    test_ret += test_xmlSchemaNewMemParserCtxt();
31994    test_ret += test_xmlSchemaNewParserCtxt();
31995    test_ret += test_xmlSchemaNewValidCtxt();
31996    test_ret += test_xmlSchemaParse();
31997    test_ret += test_xmlSchemaSetParserErrors();
31998    test_ret += test_xmlSchemaSetValidErrors();
31999    test_ret += test_xmlSchemaSetValidOptions();
32000    test_ret += test_xmlSchemaValidCtxtGetOptions();
32001    test_ret += test_xmlSchemaValidateDoc();
32002    test_ret += test_xmlSchemaValidateOneElement();
32003    test_ret += test_xmlSchemaValidateStream();
32004
32005    if (test_ret != 0)
32006	printf("Module xmlschemas: %d errors\n", test_ret);
32007    return(test_ret);
32008}
32009#ifdef LIBXML_SCHEMAS_ENABLED
32010
32011#define gen_nb_xmlSchemaFacetPtr 1
32012static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32013    return(NULL);
32014}
32015static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32016}
32017#endif
32018
32019#ifdef LIBXML_SCHEMAS_ENABLED
32020
32021#define gen_nb_xmlSchemaTypePtr 1
32022static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32023    return(NULL);
32024}
32025static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32026}
32027#endif
32028
32029
32030static int
32031test_xmlSchemaCheckFacet(void) {
32032    int test_ret = 0;
32033
32034#ifdef LIBXML_SCHEMAS_ENABLED
32035    int mem_base;
32036    int ret_val;
32037    xmlSchemaFacetPtr facet; /* the facet */
32038    int n_facet;
32039    xmlSchemaTypePtr typeDecl; /* the schema type definition */
32040    int n_typeDecl;
32041    xmlSchemaParserCtxtPtr ctxt; /* the schema parser context or NULL */
32042    int n_ctxt;
32043    xmlChar * name; /* name of the type */
32044    int n_name;
32045
32046    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32047    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
32048    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
32049    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32050        mem_base = xmlMemBlocks();
32051        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
32052        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
32053        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 2);
32054        name = gen_const_xmlChar_ptr(n_name, 3);
32055
32056        ret_val = xmlSchemaCheckFacet(facet, typeDecl, ctxt, (const xmlChar *)name);
32057        desret_int(ret_val);
32058        call_tests++;
32059        des_xmlSchemaFacetPtr(n_facet, facet, 0);
32060        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
32061        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 2);
32062        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
32063        xmlResetLastError();
32064        if (mem_base != xmlMemBlocks()) {
32065            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
32066	           xmlMemBlocks() - mem_base);
32067	    test_ret++;
32068            printf(" %d", n_facet);
32069            printf(" %d", n_typeDecl);
32070            printf(" %d", n_ctxt);
32071            printf(" %d", n_name);
32072            printf("\n");
32073        }
32074    }
32075    }
32076    }
32077    }
32078    function_tests++;
32079#endif
32080
32081    return(test_ret);
32082}
32083
32084
32085static int
32086test_xmlSchemaCleanupTypes(void) {
32087    int test_ret = 0;
32088
32089#ifdef LIBXML_SCHEMAS_ENABLED
32090    int mem_base;
32091
32092        mem_base = xmlMemBlocks();
32093
32094        xmlSchemaCleanupTypes();
32095        call_tests++;
32096        xmlResetLastError();
32097        if (mem_base != xmlMemBlocks()) {
32098            printf("Leak of %d blocks found in xmlSchemaCleanupTypes",
32099	           xmlMemBlocks() - mem_base);
32100	    test_ret++;
32101            printf("\n");
32102        }
32103    function_tests++;
32104#endif
32105
32106    return(test_ret);
32107}
32108
32109
32110static int
32111test_xmlSchemaCollapseString(void) {
32112    int test_ret = 0;
32113
32114#ifdef LIBXML_SCHEMAS_ENABLED
32115    int mem_base;
32116    xmlChar * ret_val;
32117    xmlChar * value; /* a value */
32118    int n_value;
32119
32120    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32121        mem_base = xmlMemBlocks();
32122        value = gen_const_xmlChar_ptr(n_value, 0);
32123
32124        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
32125        desret_xmlChar_ptr(ret_val);
32126        call_tests++;
32127        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
32128        xmlResetLastError();
32129        if (mem_base != xmlMemBlocks()) {
32130            printf("Leak of %d blocks found in xmlSchemaCollapseString",
32131	           xmlMemBlocks() - mem_base);
32132	    test_ret++;
32133            printf(" %d", n_value);
32134            printf("\n");
32135        }
32136    }
32137    function_tests++;
32138#endif
32139
32140    return(test_ret);
32141}
32142
32143#ifdef LIBXML_SCHEMAS_ENABLED
32144
32145#define gen_nb_xmlSchemaValPtr 1
32146static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32147    return(NULL);
32148}
32149static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32150}
32151#endif
32152
32153
32154static int
32155test_xmlSchemaCompareValues(void) {
32156    int test_ret = 0;
32157
32158#ifdef LIBXML_SCHEMAS_ENABLED
32159    int mem_base;
32160    int ret_val;
32161    xmlSchemaValPtr x; /* a first value */
32162    int n_x;
32163    xmlSchemaValPtr y; /* a second value */
32164    int n_y;
32165
32166    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
32167    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
32168        mem_base = xmlMemBlocks();
32169        x = gen_xmlSchemaValPtr(n_x, 0);
32170        y = gen_xmlSchemaValPtr(n_y, 1);
32171
32172        ret_val = xmlSchemaCompareValues(x, y);
32173        desret_int(ret_val);
32174        call_tests++;
32175        des_xmlSchemaValPtr(n_x, x, 0);
32176        des_xmlSchemaValPtr(n_y, y, 1);
32177        xmlResetLastError();
32178        if (mem_base != xmlMemBlocks()) {
32179            printf("Leak of %d blocks found in xmlSchemaCompareValues",
32180	           xmlMemBlocks() - mem_base);
32181	    test_ret++;
32182            printf(" %d", n_x);
32183            printf(" %d", n_y);
32184            printf("\n");
32185        }
32186    }
32187    }
32188    function_tests++;
32189#endif
32190
32191    return(test_ret);
32192}
32193
32194
32195static int
32196test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
32197    int test_ret = 0;
32198
32199#ifdef LIBXML_SCHEMAS_ENABLED
32200    int mem_base;
32201    xmlSchemaTypePtr ret_val;
32202    xmlSchemaTypePtr type; /* the built-in simple type. */
32203    int n_type;
32204
32205    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32206        mem_base = xmlMemBlocks();
32207        type = gen_xmlSchemaTypePtr(n_type, 0);
32208
32209        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
32210        desret_xmlSchemaTypePtr(ret_val);
32211        call_tests++;
32212        des_xmlSchemaTypePtr(n_type, type, 0);
32213        xmlResetLastError();
32214        if (mem_base != xmlMemBlocks()) {
32215            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
32216	           xmlMemBlocks() - mem_base);
32217	    test_ret++;
32218            printf(" %d", n_type);
32219            printf("\n");
32220        }
32221    }
32222    function_tests++;
32223#endif
32224
32225    return(test_ret);
32226}
32227
32228
32229static int
32230test_xmlSchemaGetBuiltInType(void) {
32231    int test_ret = 0;
32232
32233#ifdef LIBXML_SCHEMAS_ENABLED
32234    xmlSchemaTypePtr ret_val;
32235    xmlSchemaValType type; /* the type of the built in type */
32236    int n_type;
32237
32238    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
32239        type = gen_xmlSchemaValType(n_type, 0);
32240
32241        ret_val = xmlSchemaGetBuiltInType(type);
32242        desret_xmlSchemaTypePtr(ret_val);
32243        call_tests++;
32244        des_xmlSchemaValType(n_type, type, 0);
32245        xmlResetLastError();
32246    }
32247    function_tests++;
32248#endif
32249
32250    return(test_ret);
32251}
32252
32253
32254static int
32255test_xmlSchemaGetFacetValueAsULong(void) {
32256    int test_ret = 0;
32257
32258#ifdef LIBXML_SCHEMAS_ENABLED
32259    int mem_base;
32260    unsigned long ret_val;
32261    xmlSchemaFacetPtr facet; /* an schemas type facet */
32262    int n_facet;
32263
32264    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32265        mem_base = xmlMemBlocks();
32266        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
32267
32268        ret_val = xmlSchemaGetFacetValueAsULong(facet);
32269        desret_unsigned_long(ret_val);
32270        call_tests++;
32271        des_xmlSchemaFacetPtr(n_facet, facet, 0);
32272        xmlResetLastError();
32273        if (mem_base != xmlMemBlocks()) {
32274            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
32275	           xmlMemBlocks() - mem_base);
32276	    test_ret++;
32277            printf(" %d", n_facet);
32278            printf("\n");
32279        }
32280    }
32281    function_tests++;
32282#endif
32283
32284    return(test_ret);
32285}
32286
32287
32288static int
32289test_xmlSchemaGetPredefinedType(void) {
32290    int test_ret = 0;
32291
32292#ifdef LIBXML_SCHEMAS_ENABLED
32293    int mem_base;
32294    xmlSchemaTypePtr ret_val;
32295    xmlChar * name; /* the type name */
32296    int n_name;
32297    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
32298    int n_ns;
32299
32300    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
32301    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
32302        mem_base = xmlMemBlocks();
32303        name = gen_const_xmlChar_ptr(n_name, 0);
32304        ns = gen_const_xmlChar_ptr(n_ns, 1);
32305
32306        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
32307        desret_xmlSchemaTypePtr(ret_val);
32308        call_tests++;
32309        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
32310        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
32311        xmlResetLastError();
32312        if (mem_base != xmlMemBlocks()) {
32313            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
32314	           xmlMemBlocks() - mem_base);
32315	    test_ret++;
32316            printf(" %d", n_name);
32317            printf(" %d", n_ns);
32318            printf("\n");
32319        }
32320    }
32321    }
32322    function_tests++;
32323#endif
32324
32325    return(test_ret);
32326}
32327
32328
32329static int
32330test_xmlSchemaInitTypes(void) {
32331    int test_ret = 0;
32332
32333#ifdef LIBXML_SCHEMAS_ENABLED
32334
32335
32336        xmlSchemaInitTypes();
32337        call_tests++;
32338        xmlResetLastError();
32339    function_tests++;
32340#endif
32341
32342    return(test_ret);
32343}
32344
32345
32346static int
32347test_xmlSchemaIsBuiltInTypeFacet(void) {
32348    int test_ret = 0;
32349
32350#ifdef LIBXML_SCHEMAS_ENABLED
32351    int mem_base;
32352    int ret_val;
32353    xmlSchemaTypePtr type; /* the built-in type */
32354    int n_type;
32355    int facetType; /* the facet type */
32356    int n_facetType;
32357
32358    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32359    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
32360        mem_base = xmlMemBlocks();
32361        type = gen_xmlSchemaTypePtr(n_type, 0);
32362        facetType = gen_int(n_facetType, 1);
32363
32364        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
32365        desret_int(ret_val);
32366        call_tests++;
32367        des_xmlSchemaTypePtr(n_type, type, 0);
32368        des_int(n_facetType, facetType, 1);
32369        xmlResetLastError();
32370        if (mem_base != xmlMemBlocks()) {
32371            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
32372	           xmlMemBlocks() - mem_base);
32373	    test_ret++;
32374            printf(" %d", n_type);
32375            printf(" %d", n_facetType);
32376            printf("\n");
32377        }
32378    }
32379    }
32380    function_tests++;
32381#endif
32382
32383    return(test_ret);
32384}
32385
32386
32387static int
32388test_xmlSchemaNewFacet(void) {
32389    int test_ret = 0;
32390
32391
32392    /* missing type support */
32393    return(test_ret);
32394}
32395
32396#ifdef LIBXML_SCHEMAS_ENABLED
32397
32398#define gen_nb_xmlSchemaValPtr_ptr 1
32399static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32400    return(NULL);
32401}
32402static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32403}
32404#endif
32405
32406
32407static int
32408test_xmlSchemaValPredefTypeNode(void) {
32409    int test_ret = 0;
32410
32411#ifdef LIBXML_SCHEMAS_ENABLED
32412    int mem_base;
32413    int ret_val;
32414    xmlSchemaTypePtr type; /* the predefined type */
32415    int n_type;
32416    xmlChar * value; /* the value to check */
32417    int n_value;
32418    xmlSchemaValPtr * val; /* the return computed value */
32419    int n_val;
32420    xmlNodePtr node; /* the node containing the value */
32421    int n_node;
32422
32423    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32424    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32425    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
32426    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
32427        mem_base = xmlMemBlocks();
32428        type = gen_xmlSchemaTypePtr(n_type, 0);
32429        value = gen_const_xmlChar_ptr(n_value, 1);
32430        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
32431        node = gen_xmlNodePtr(n_node, 3);
32432
32433        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
32434        desret_int(ret_val);
32435        call_tests++;
32436        des_xmlSchemaTypePtr(n_type, type, 0);
32437        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32438        des_xmlSchemaValPtr_ptr(n_val, val, 2);
32439        des_xmlNodePtr(n_node, node, 3);
32440        xmlResetLastError();
32441        if (mem_base != xmlMemBlocks()) {
32442            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
32443	           xmlMemBlocks() - mem_base);
32444	    test_ret++;
32445            printf(" %d", n_type);
32446            printf(" %d", n_value);
32447            printf(" %d", n_val);
32448            printf(" %d", n_node);
32449            printf("\n");
32450        }
32451    }
32452    }
32453    }
32454    }
32455    function_tests++;
32456#endif
32457
32458    return(test_ret);
32459}
32460
32461
32462static int
32463test_xmlSchemaValPredefTypeNodeNoNorm(void) {
32464    int test_ret = 0;
32465
32466#ifdef LIBXML_SCHEMAS_ENABLED
32467    int mem_base;
32468    int ret_val;
32469    xmlSchemaTypePtr type; /* the predefined type */
32470    int n_type;
32471    xmlChar * value; /* the value to check */
32472    int n_value;
32473    xmlSchemaValPtr * val; /* the return computed value */
32474    int n_val;
32475    xmlNodePtr node; /* the node containing the value */
32476    int n_node;
32477
32478    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32479    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32480    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
32481    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
32482        mem_base = xmlMemBlocks();
32483        type = gen_xmlSchemaTypePtr(n_type, 0);
32484        value = gen_const_xmlChar_ptr(n_value, 1);
32485        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
32486        node = gen_xmlNodePtr(n_node, 3);
32487
32488        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
32489        desret_int(ret_val);
32490        call_tests++;
32491        des_xmlSchemaTypePtr(n_type, type, 0);
32492        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32493        des_xmlSchemaValPtr_ptr(n_val, val, 2);
32494        des_xmlNodePtr(n_node, node, 3);
32495        xmlResetLastError();
32496        if (mem_base != xmlMemBlocks()) {
32497            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
32498	           xmlMemBlocks() - mem_base);
32499	    test_ret++;
32500            printf(" %d", n_type);
32501            printf(" %d", n_value);
32502            printf(" %d", n_val);
32503            printf(" %d", n_node);
32504            printf("\n");
32505        }
32506    }
32507    }
32508    }
32509    }
32510    function_tests++;
32511#endif
32512
32513    return(test_ret);
32514}
32515
32516
32517static int
32518test_xmlSchemaValidateFacet(void) {
32519    int test_ret = 0;
32520
32521#ifdef LIBXML_SCHEMAS_ENABLED
32522    int mem_base;
32523    int ret_val;
32524    xmlSchemaTypePtr base; /* the base type */
32525    int n_base;
32526    xmlSchemaFacetPtr facet; /* the facet to check */
32527    int n_facet;
32528    xmlChar * value; /* the lexical repr of the value to validate */
32529    int n_value;
32530    xmlSchemaValPtr val; /* the precomputed value */
32531    int n_val;
32532
32533    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
32534    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32535    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32536    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
32537        mem_base = xmlMemBlocks();
32538        base = gen_xmlSchemaTypePtr(n_base, 0);
32539        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
32540        value = gen_const_xmlChar_ptr(n_value, 2);
32541        val = gen_xmlSchemaValPtr(n_val, 3);
32542
32543        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
32544        desret_int(ret_val);
32545        call_tests++;
32546        des_xmlSchemaTypePtr(n_base, base, 0);
32547        des_xmlSchemaFacetPtr(n_facet, facet, 1);
32548        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
32549        des_xmlSchemaValPtr(n_val, val, 3);
32550        xmlResetLastError();
32551        if (mem_base != xmlMemBlocks()) {
32552            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
32553	           xmlMemBlocks() - mem_base);
32554	    test_ret++;
32555            printf(" %d", n_base);
32556            printf(" %d", n_facet);
32557            printf(" %d", n_value);
32558            printf(" %d", n_val);
32559            printf("\n");
32560        }
32561    }
32562    }
32563    }
32564    }
32565    function_tests++;
32566#endif
32567
32568    return(test_ret);
32569}
32570
32571
32572static int
32573test_xmlSchemaValidateLengthFacet(void) {
32574    int test_ret = 0;
32575
32576#ifdef LIBXML_SCHEMAS_ENABLED
32577    int mem_base;
32578    int ret_val;
32579    xmlSchemaTypePtr type; /* the built-in type */
32580    int n_type;
32581    xmlSchemaFacetPtr facet; /* the facet to check */
32582    int n_facet;
32583    xmlChar * value; /* the lexical repr. of the value to be validated */
32584    int n_value;
32585    xmlSchemaValPtr val; /* the precomputed value */
32586    int n_val;
32587    unsigned long * length; /* the actual length of the value */
32588    int n_length;
32589
32590    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32591    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32592    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32593    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
32594    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
32595        mem_base = xmlMemBlocks();
32596        type = gen_xmlSchemaTypePtr(n_type, 0);
32597        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
32598        value = gen_const_xmlChar_ptr(n_value, 2);
32599        val = gen_xmlSchemaValPtr(n_val, 3);
32600        length = gen_unsigned_long_ptr(n_length, 4);
32601
32602        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
32603        desret_int(ret_val);
32604        call_tests++;
32605        des_xmlSchemaTypePtr(n_type, type, 0);
32606        des_xmlSchemaFacetPtr(n_facet, facet, 1);
32607        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
32608        des_xmlSchemaValPtr(n_val, val, 3);
32609        des_unsigned_long_ptr(n_length, length, 4);
32610        xmlResetLastError();
32611        if (mem_base != xmlMemBlocks()) {
32612            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
32613	           xmlMemBlocks() - mem_base);
32614	    test_ret++;
32615            printf(" %d", n_type);
32616            printf(" %d", n_facet);
32617            printf(" %d", n_value);
32618            printf(" %d", n_val);
32619            printf(" %d", n_length);
32620            printf("\n");
32621        }
32622    }
32623    }
32624    }
32625    }
32626    }
32627    function_tests++;
32628#endif
32629
32630    return(test_ret);
32631}
32632
32633
32634static int
32635test_xmlSchemaValidateListSimpleTypeFacet(void) {
32636    int test_ret = 0;
32637
32638#ifdef LIBXML_SCHEMAS_ENABLED
32639    int mem_base;
32640    int ret_val;
32641    xmlSchemaFacetPtr facet; /* the facet to check */
32642    int n_facet;
32643    xmlChar * value; /* the lexical repr of the value to validate */
32644    int n_value;
32645    unsigned long actualLen; /* the number of list items */
32646    int n_actualLen;
32647    unsigned long * expectedLen; /* the resulting expected number of list items */
32648    int n_expectedLen;
32649
32650    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
32651    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32652    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
32653    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
32654        mem_base = xmlMemBlocks();
32655        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
32656        value = gen_const_xmlChar_ptr(n_value, 1);
32657        actualLen = gen_unsigned_long(n_actualLen, 2);
32658        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
32659
32660        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
32661        desret_int(ret_val);
32662        call_tests++;
32663        des_xmlSchemaFacetPtr(n_facet, facet, 0);
32664        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32665        des_unsigned_long(n_actualLen, actualLen, 2);
32666        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
32667        xmlResetLastError();
32668        if (mem_base != xmlMemBlocks()) {
32669            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
32670	           xmlMemBlocks() - mem_base);
32671	    test_ret++;
32672            printf(" %d", n_facet);
32673            printf(" %d", n_value);
32674            printf(" %d", n_actualLen);
32675            printf(" %d", n_expectedLen);
32676            printf("\n");
32677        }
32678    }
32679    }
32680    }
32681    }
32682    function_tests++;
32683#endif
32684
32685    return(test_ret);
32686}
32687
32688
32689static int
32690test_xmlSchemaValidatePredefinedType(void) {
32691    int test_ret = 0;
32692
32693#ifdef LIBXML_SCHEMAS_ENABLED
32694    int mem_base;
32695    int ret_val;
32696    xmlSchemaTypePtr type; /* the predefined type */
32697    int n_type;
32698    xmlChar * value; /* the value to check */
32699    int n_value;
32700    xmlSchemaValPtr * val; /* the return computed value */
32701    int n_val;
32702
32703    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
32704    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32705    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
32706        mem_base = xmlMemBlocks();
32707        type = gen_xmlSchemaTypePtr(n_type, 0);
32708        value = gen_const_xmlChar_ptr(n_value, 1);
32709        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
32710
32711        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
32712        desret_int(ret_val);
32713        call_tests++;
32714        des_xmlSchemaTypePtr(n_type, type, 0);
32715        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
32716        des_xmlSchemaValPtr_ptr(n_val, val, 2);
32717        xmlResetLastError();
32718        if (mem_base != xmlMemBlocks()) {
32719            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
32720	           xmlMemBlocks() - mem_base);
32721	    test_ret++;
32722            printf(" %d", n_type);
32723            printf(" %d", n_value);
32724            printf(" %d", n_val);
32725            printf("\n");
32726        }
32727    }
32728    }
32729    }
32730    function_tests++;
32731#endif
32732
32733    return(test_ret);
32734}
32735
32736
32737static int
32738test_xmlSchemaWhiteSpaceReplace(void) {
32739    int test_ret = 0;
32740
32741#ifdef LIBXML_SCHEMAS_ENABLED
32742    int mem_base;
32743    xmlChar * ret_val;
32744    xmlChar * value; /* a value */
32745    int n_value;
32746
32747    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
32748        mem_base = xmlMemBlocks();
32749        value = gen_const_xmlChar_ptr(n_value, 0);
32750
32751        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
32752        desret_xmlChar_ptr(ret_val);
32753        call_tests++;
32754        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
32755        xmlResetLastError();
32756        if (mem_base != xmlMemBlocks()) {
32757            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
32758	           xmlMemBlocks() - mem_base);
32759	    test_ret++;
32760            printf(" %d", n_value);
32761            printf("\n");
32762        }
32763    }
32764    function_tests++;
32765#endif
32766
32767    return(test_ret);
32768}
32769
32770static int
32771test_xmlschemastypes(void) {
32772    int test_ret = 0;
32773
32774    if (quiet == 0) printf("Testing xmlschemastypes : 17 of 20 functions ...\n");
32775    test_ret += test_xmlSchemaCheckFacet();
32776    test_ret += test_xmlSchemaCleanupTypes();
32777    test_ret += test_xmlSchemaCollapseString();
32778    test_ret += test_xmlSchemaCompareValues();
32779    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
32780    test_ret += test_xmlSchemaGetBuiltInType();
32781    test_ret += test_xmlSchemaGetFacetValueAsULong();
32782    test_ret += test_xmlSchemaGetPredefinedType();
32783    test_ret += test_xmlSchemaInitTypes();
32784    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
32785    test_ret += test_xmlSchemaNewFacet();
32786    test_ret += test_xmlSchemaValPredefTypeNode();
32787    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
32788    test_ret += test_xmlSchemaValidateFacet();
32789    test_ret += test_xmlSchemaValidateLengthFacet();
32790    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
32791    test_ret += test_xmlSchemaValidatePredefinedType();
32792    test_ret += test_xmlSchemaWhiteSpaceReplace();
32793
32794    if (test_ret != 0)
32795	printf("Module xmlschemastypes: %d errors\n", test_ret);
32796    return(test_ret);
32797}
32798
32799static int
32800test_xmlCharStrdup(void) {
32801    int test_ret = 0;
32802
32803    int mem_base;
32804    xmlChar * ret_val;
32805    char * cur; /* the input char * */
32806    int n_cur;
32807
32808    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
32809        mem_base = xmlMemBlocks();
32810        cur = gen_const_char_ptr(n_cur, 0);
32811
32812        ret_val = xmlCharStrdup((const char *)cur);
32813        desret_xmlChar_ptr(ret_val);
32814        call_tests++;
32815        des_const_char_ptr(n_cur, (const char *)cur, 0);
32816        xmlResetLastError();
32817        if (mem_base != xmlMemBlocks()) {
32818            printf("Leak of %d blocks found in xmlCharStrdup",
32819	           xmlMemBlocks() - mem_base);
32820	    test_ret++;
32821            printf(" %d", n_cur);
32822            printf("\n");
32823        }
32824    }
32825    function_tests++;
32826
32827    return(test_ret);
32828}
32829
32830
32831static int
32832test_xmlCharStrndup(void) {
32833    int test_ret = 0;
32834
32835    int mem_base;
32836    xmlChar * ret_val;
32837    char * cur; /* the input char * */
32838    int n_cur;
32839    int len; /* the len of @cur */
32840    int n_len;
32841
32842    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
32843    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32844        mem_base = xmlMemBlocks();
32845        cur = gen_const_char_ptr(n_cur, 0);
32846        len = gen_int(n_len, 1);
32847
32848        ret_val = xmlCharStrndup((const char *)cur, len);
32849        desret_xmlChar_ptr(ret_val);
32850        call_tests++;
32851        des_const_char_ptr(n_cur, (const char *)cur, 0);
32852        des_int(n_len, len, 1);
32853        xmlResetLastError();
32854        if (mem_base != xmlMemBlocks()) {
32855            printf("Leak of %d blocks found in xmlCharStrndup",
32856	           xmlMemBlocks() - mem_base);
32857	    test_ret++;
32858            printf(" %d", n_cur);
32859            printf(" %d", n_len);
32860            printf("\n");
32861        }
32862    }
32863    }
32864    function_tests++;
32865
32866    return(test_ret);
32867}
32868
32869
32870static int
32871test_xmlCheckUTF8(void) {
32872    int test_ret = 0;
32873
32874    int mem_base;
32875    int ret_val;
32876    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
32877    int n_utf;
32878
32879    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
32880        mem_base = xmlMemBlocks();
32881        utf = gen_const_unsigned_char_ptr(n_utf, 0);
32882
32883        ret_val = xmlCheckUTF8((const unsigned char *)utf);
32884        desret_int(ret_val);
32885        call_tests++;
32886        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
32887        xmlResetLastError();
32888        if (mem_base != xmlMemBlocks()) {
32889            printf("Leak of %d blocks found in xmlCheckUTF8",
32890	           xmlMemBlocks() - mem_base);
32891	    test_ret++;
32892            printf(" %d", n_utf);
32893            printf("\n");
32894        }
32895    }
32896    function_tests++;
32897
32898    return(test_ret);
32899}
32900
32901
32902static int
32903test_xmlGetUTF8Char(void) {
32904    int test_ret = 0;
32905
32906    int mem_base;
32907    int ret_val;
32908    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
32909    int n_utf;
32910    int * len; /* a pointer to the minimum number of bytes present in the sequence.  This is used to assure the next character is completely contained within the sequence. */
32911    int n_len;
32912
32913    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
32914    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
32915        mem_base = xmlMemBlocks();
32916        utf = gen_const_unsigned_char_ptr(n_utf, 0);
32917        len = gen_int_ptr(n_len, 1);
32918
32919        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
32920        desret_int(ret_val);
32921        call_tests++;
32922        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
32923        des_int_ptr(n_len, len, 1);
32924        xmlResetLastError();
32925        if (mem_base != xmlMemBlocks()) {
32926            printf("Leak of %d blocks found in xmlGetUTF8Char",
32927	           xmlMemBlocks() - mem_base);
32928	    test_ret++;
32929            printf(" %d", n_utf);
32930            printf(" %d", n_len);
32931            printf("\n");
32932        }
32933    }
32934    }
32935    function_tests++;
32936
32937    return(test_ret);
32938}
32939
32940
32941static int
32942test_xmlStrEqual(void) {
32943    int test_ret = 0;
32944
32945    int mem_base;
32946    int ret_val;
32947    xmlChar * str1; /* the first xmlChar * */
32948    int n_str1;
32949    xmlChar * str2; /* the second xmlChar * */
32950    int n_str2;
32951
32952    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
32953    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
32954        mem_base = xmlMemBlocks();
32955        str1 = gen_const_xmlChar_ptr(n_str1, 0);
32956        str2 = gen_const_xmlChar_ptr(n_str2, 1);
32957
32958        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
32959        desret_int(ret_val);
32960        call_tests++;
32961        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
32962        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
32963        xmlResetLastError();
32964        if (mem_base != xmlMemBlocks()) {
32965            printf("Leak of %d blocks found in xmlStrEqual",
32966	           xmlMemBlocks() - mem_base);
32967	    test_ret++;
32968            printf(" %d", n_str1);
32969            printf(" %d", n_str2);
32970            printf("\n");
32971        }
32972    }
32973    }
32974    function_tests++;
32975
32976    return(test_ret);
32977}
32978
32979
32980static int
32981test_xmlStrPrintf(void) {
32982    int test_ret = 0;
32983
32984
32985    /* missing type support */
32986    return(test_ret);
32987}
32988
32989
32990static int
32991test_xmlStrQEqual(void) {
32992    int test_ret = 0;
32993
32994    int mem_base;
32995    int ret_val;
32996    xmlChar * pref; /* the prefix of the QName */
32997    int n_pref;
32998    xmlChar * name; /* the localname of the QName */
32999    int n_name;
33000    xmlChar * str; /* the second xmlChar * */
33001    int n_str;
33002
33003    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
33004    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
33005    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33006        mem_base = xmlMemBlocks();
33007        pref = gen_const_xmlChar_ptr(n_pref, 0);
33008        name = gen_const_xmlChar_ptr(n_name, 1);
33009        str = gen_const_xmlChar_ptr(n_str, 2);
33010
33011        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
33012        desret_int(ret_val);
33013        call_tests++;
33014        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
33015        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
33016        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
33017        xmlResetLastError();
33018        if (mem_base != xmlMemBlocks()) {
33019            printf("Leak of %d blocks found in xmlStrQEqual",
33020	           xmlMemBlocks() - mem_base);
33021	    test_ret++;
33022            printf(" %d", n_pref);
33023            printf(" %d", n_name);
33024            printf(" %d", n_str);
33025            printf("\n");
33026        }
33027    }
33028    }
33029    }
33030    function_tests++;
33031
33032    return(test_ret);
33033}
33034
33035
33036static int
33037test_xmlStrVPrintf(void) {
33038    int test_ret = 0;
33039
33040
33041    /* missing type support */
33042    return(test_ret);
33043}
33044
33045
33046static int
33047test_xmlStrcasecmp(void) {
33048    int test_ret = 0;
33049
33050    int mem_base;
33051    int ret_val;
33052    xmlChar * str1; /* the first xmlChar * */
33053    int n_str1;
33054    xmlChar * str2; /* the second xmlChar * */
33055    int n_str2;
33056
33057    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
33058    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
33059        mem_base = xmlMemBlocks();
33060        str1 = gen_const_xmlChar_ptr(n_str1, 0);
33061        str2 = gen_const_xmlChar_ptr(n_str2, 1);
33062
33063        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
33064        desret_int(ret_val);
33065        call_tests++;
33066        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
33067        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
33068        xmlResetLastError();
33069        if (mem_base != xmlMemBlocks()) {
33070            printf("Leak of %d blocks found in xmlStrcasecmp",
33071	           xmlMemBlocks() - mem_base);
33072	    test_ret++;
33073            printf(" %d", n_str1);
33074            printf(" %d", n_str2);
33075            printf("\n");
33076        }
33077    }
33078    }
33079    function_tests++;
33080
33081    return(test_ret);
33082}
33083
33084
33085static int
33086test_xmlStrcasestr(void) {
33087    int test_ret = 0;
33088
33089    int mem_base;
33090    const xmlChar * ret_val;
33091    xmlChar * str; /* the xmlChar * array (haystack) */
33092    int n_str;
33093    xmlChar * val; /* the xmlChar to search (needle) */
33094    int n_val;
33095
33096    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33097    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
33098        mem_base = xmlMemBlocks();
33099        str = gen_const_xmlChar_ptr(n_str, 0);
33100        val = gen_xmlChar_ptr(n_val, 1);
33101
33102        ret_val = xmlStrcasestr((const xmlChar *)str, val);
33103        desret_const_xmlChar_ptr(ret_val);
33104        call_tests++;
33105        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
33106        des_xmlChar_ptr(n_val, val, 1);
33107        xmlResetLastError();
33108        if (mem_base != xmlMemBlocks()) {
33109            printf("Leak of %d blocks found in xmlStrcasestr",
33110	           xmlMemBlocks() - mem_base);
33111	    test_ret++;
33112            printf(" %d", n_str);
33113            printf(" %d", n_val);
33114            printf("\n");
33115        }
33116    }
33117    }
33118    function_tests++;
33119
33120    return(test_ret);
33121}
33122
33123
33124static int
33125test_xmlStrchr(void) {
33126    int test_ret = 0;
33127
33128    int mem_base;
33129    const xmlChar * ret_val;
33130    xmlChar * str; /* the xmlChar * array */
33131    int n_str;
33132    xmlChar val; /* the xmlChar to search */
33133    int n_val;
33134
33135    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33136    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
33137        mem_base = xmlMemBlocks();
33138        str = gen_const_xmlChar_ptr(n_str, 0);
33139        val = gen_xmlChar(n_val, 1);
33140
33141        ret_val = xmlStrchr((const xmlChar *)str, val);
33142        desret_const_xmlChar_ptr(ret_val);
33143        call_tests++;
33144        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
33145        des_xmlChar(n_val, val, 1);
33146        xmlResetLastError();
33147        if (mem_base != xmlMemBlocks()) {
33148            printf("Leak of %d blocks found in xmlStrchr",
33149	           xmlMemBlocks() - mem_base);
33150	    test_ret++;
33151            printf(" %d", n_str);
33152            printf(" %d", n_val);
33153            printf("\n");
33154        }
33155    }
33156    }
33157    function_tests++;
33158
33159    return(test_ret);
33160}
33161
33162
33163static int
33164test_xmlStrcmp(void) {
33165    int test_ret = 0;
33166
33167    int mem_base;
33168    int ret_val;
33169    xmlChar * str1; /* the first xmlChar * */
33170    int n_str1;
33171    xmlChar * str2; /* the second xmlChar * */
33172    int n_str2;
33173
33174    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
33175    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
33176        mem_base = xmlMemBlocks();
33177        str1 = gen_const_xmlChar_ptr(n_str1, 0);
33178        str2 = gen_const_xmlChar_ptr(n_str2, 1);
33179
33180        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
33181        desret_int(ret_val);
33182        call_tests++;
33183        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
33184        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
33185        xmlResetLastError();
33186        if (mem_base != xmlMemBlocks()) {
33187            printf("Leak of %d blocks found in xmlStrcmp",
33188	           xmlMemBlocks() - mem_base);
33189	    test_ret++;
33190            printf(" %d", n_str1);
33191            printf(" %d", n_str2);
33192            printf("\n");
33193        }
33194    }
33195    }
33196    function_tests++;
33197
33198    return(test_ret);
33199}
33200
33201
33202static int
33203test_xmlStrdup(void) {
33204    int test_ret = 0;
33205
33206    int mem_base;
33207    xmlChar * ret_val;
33208    xmlChar * cur; /* the input xmlChar * */
33209    int n_cur;
33210
33211    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
33212        mem_base = xmlMemBlocks();
33213        cur = gen_const_xmlChar_ptr(n_cur, 0);
33214
33215        ret_val = xmlStrdup((const xmlChar *)cur);
33216        desret_xmlChar_ptr(ret_val);
33217        call_tests++;
33218        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
33219        xmlResetLastError();
33220        if (mem_base != xmlMemBlocks()) {
33221            printf("Leak of %d blocks found in xmlStrdup",
33222	           xmlMemBlocks() - mem_base);
33223	    test_ret++;
33224            printf(" %d", n_cur);
33225            printf("\n");
33226        }
33227    }
33228    function_tests++;
33229
33230    return(test_ret);
33231}
33232
33233
33234static int
33235test_xmlStrlen(void) {
33236    int test_ret = 0;
33237
33238    int mem_base;
33239    int ret_val;
33240    xmlChar * str; /* the xmlChar * array */
33241    int n_str;
33242
33243    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33244        mem_base = xmlMemBlocks();
33245        str = gen_const_xmlChar_ptr(n_str, 0);
33246
33247        ret_val = xmlStrlen((const xmlChar *)str);
33248        desret_int(ret_val);
33249        call_tests++;
33250        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
33251        xmlResetLastError();
33252        if (mem_base != xmlMemBlocks()) {
33253            printf("Leak of %d blocks found in xmlStrlen",
33254	           xmlMemBlocks() - mem_base);
33255	    test_ret++;
33256            printf(" %d", n_str);
33257            printf("\n");
33258        }
33259    }
33260    function_tests++;
33261
33262    return(test_ret);
33263}
33264
33265
33266static int
33267test_xmlStrncasecmp(void) {
33268    int test_ret = 0;
33269
33270    int mem_base;
33271    int ret_val;
33272    xmlChar * str1; /* the first xmlChar * */
33273    int n_str1;
33274    xmlChar * str2; /* the second xmlChar * */
33275    int n_str2;
33276    int len; /* the max comparison length */
33277    int n_len;
33278
33279    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
33280    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
33281    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33282        mem_base = xmlMemBlocks();
33283        str1 = gen_const_xmlChar_ptr(n_str1, 0);
33284        str2 = gen_const_xmlChar_ptr(n_str2, 1);
33285        len = gen_int(n_len, 2);
33286
33287        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
33288        desret_int(ret_val);
33289        call_tests++;
33290        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
33291        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
33292        des_int(n_len, len, 2);
33293        xmlResetLastError();
33294        if (mem_base != xmlMemBlocks()) {
33295            printf("Leak of %d blocks found in xmlStrncasecmp",
33296	           xmlMemBlocks() - mem_base);
33297	    test_ret++;
33298            printf(" %d", n_str1);
33299            printf(" %d", n_str2);
33300            printf(" %d", n_len);
33301            printf("\n");
33302        }
33303    }
33304    }
33305    }
33306    function_tests++;
33307
33308    return(test_ret);
33309}
33310
33311
33312static int
33313test_xmlStrncatNew(void) {
33314    int test_ret = 0;
33315
33316    int mem_base;
33317    xmlChar * ret_val;
33318    xmlChar * str1; /* first xmlChar string */
33319    int n_str1;
33320    xmlChar * str2; /* second xmlChar string */
33321    int n_str2;
33322    int len; /* the len of @str2 */
33323    int n_len;
33324
33325    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
33326    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
33327    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33328        mem_base = xmlMemBlocks();
33329        str1 = gen_const_xmlChar_ptr(n_str1, 0);
33330        str2 = gen_const_xmlChar_ptr(n_str2, 1);
33331        len = gen_int(n_len, 2);
33332
33333        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
33334        desret_xmlChar_ptr(ret_val);
33335        call_tests++;
33336        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
33337        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
33338        des_int(n_len, len, 2);
33339        xmlResetLastError();
33340        if (mem_base != xmlMemBlocks()) {
33341            printf("Leak of %d blocks found in xmlStrncatNew",
33342	           xmlMemBlocks() - mem_base);
33343	    test_ret++;
33344            printf(" %d", n_str1);
33345            printf(" %d", n_str2);
33346            printf(" %d", n_len);
33347            printf("\n");
33348        }
33349    }
33350    }
33351    }
33352    function_tests++;
33353
33354    return(test_ret);
33355}
33356
33357
33358static int
33359test_xmlStrncmp(void) {
33360    int test_ret = 0;
33361
33362    int mem_base;
33363    int ret_val;
33364    xmlChar * str1; /* the first xmlChar * */
33365    int n_str1;
33366    xmlChar * str2; /* the second xmlChar * */
33367    int n_str2;
33368    int len; /* the max comparison length */
33369    int n_len;
33370
33371    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
33372    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
33373    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33374        mem_base = xmlMemBlocks();
33375        str1 = gen_const_xmlChar_ptr(n_str1, 0);
33376        str2 = gen_const_xmlChar_ptr(n_str2, 1);
33377        len = gen_int(n_len, 2);
33378
33379        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
33380        desret_int(ret_val);
33381        call_tests++;
33382        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
33383        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
33384        des_int(n_len, len, 2);
33385        xmlResetLastError();
33386        if (mem_base != xmlMemBlocks()) {
33387            printf("Leak of %d blocks found in xmlStrncmp",
33388	           xmlMemBlocks() - mem_base);
33389	    test_ret++;
33390            printf(" %d", n_str1);
33391            printf(" %d", n_str2);
33392            printf(" %d", n_len);
33393            printf("\n");
33394        }
33395    }
33396    }
33397    }
33398    function_tests++;
33399
33400    return(test_ret);
33401}
33402
33403
33404static int
33405test_xmlStrndup(void) {
33406    int test_ret = 0;
33407
33408    int mem_base;
33409    xmlChar * ret_val;
33410    xmlChar * cur; /* the input xmlChar * */
33411    int n_cur;
33412    int len; /* the len of @cur */
33413    int n_len;
33414
33415    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
33416    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33417        mem_base = xmlMemBlocks();
33418        cur = gen_const_xmlChar_ptr(n_cur, 0);
33419        len = gen_int(n_len, 1);
33420
33421        ret_val = xmlStrndup((const xmlChar *)cur, len);
33422        desret_xmlChar_ptr(ret_val);
33423        call_tests++;
33424        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
33425        des_int(n_len, len, 1);
33426        xmlResetLastError();
33427        if (mem_base != xmlMemBlocks()) {
33428            printf("Leak of %d blocks found in xmlStrndup",
33429	           xmlMemBlocks() - mem_base);
33430	    test_ret++;
33431            printf(" %d", n_cur);
33432            printf(" %d", n_len);
33433            printf("\n");
33434        }
33435    }
33436    }
33437    function_tests++;
33438
33439    return(test_ret);
33440}
33441
33442
33443static int
33444test_xmlStrstr(void) {
33445    int test_ret = 0;
33446
33447    int mem_base;
33448    const xmlChar * ret_val;
33449    xmlChar * str; /* the xmlChar * array (haystack) */
33450    int n_str;
33451    xmlChar * val; /* the xmlChar to search (needle) */
33452    int n_val;
33453
33454    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33455    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
33456        mem_base = xmlMemBlocks();
33457        str = gen_const_xmlChar_ptr(n_str, 0);
33458        val = gen_const_xmlChar_ptr(n_val, 1);
33459
33460        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
33461        desret_const_xmlChar_ptr(ret_val);
33462        call_tests++;
33463        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
33464        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
33465        xmlResetLastError();
33466        if (mem_base != xmlMemBlocks()) {
33467            printf("Leak of %d blocks found in xmlStrstr",
33468	           xmlMemBlocks() - mem_base);
33469	    test_ret++;
33470            printf(" %d", n_str);
33471            printf(" %d", n_val);
33472            printf("\n");
33473        }
33474    }
33475    }
33476    function_tests++;
33477
33478    return(test_ret);
33479}
33480
33481
33482static int
33483test_xmlStrsub(void) {
33484    int test_ret = 0;
33485
33486    int mem_base;
33487    xmlChar * ret_val;
33488    xmlChar * str; /* the xmlChar * array (haystack) */
33489    int n_str;
33490    int start; /* the index of the first char (zero based) */
33491    int n_start;
33492    int len; /* the length of the substring */
33493    int n_len;
33494
33495    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
33496    for (n_start = 0;n_start < gen_nb_int;n_start++) {
33497    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33498        mem_base = xmlMemBlocks();
33499        str = gen_const_xmlChar_ptr(n_str, 0);
33500        start = gen_int(n_start, 1);
33501        len = gen_int(n_len, 2);
33502
33503        ret_val = xmlStrsub((const xmlChar *)str, start, len);
33504        desret_xmlChar_ptr(ret_val);
33505        call_tests++;
33506        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
33507        des_int(n_start, start, 1);
33508        des_int(n_len, len, 2);
33509        xmlResetLastError();
33510        if (mem_base != xmlMemBlocks()) {
33511            printf("Leak of %d blocks found in xmlStrsub",
33512	           xmlMemBlocks() - mem_base);
33513	    test_ret++;
33514            printf(" %d", n_str);
33515            printf(" %d", n_start);
33516            printf(" %d", n_len);
33517            printf("\n");
33518        }
33519    }
33520    }
33521    }
33522    function_tests++;
33523
33524    return(test_ret);
33525}
33526
33527
33528static int
33529test_xmlUTF8Charcmp(void) {
33530    int test_ret = 0;
33531
33532    int mem_base;
33533    int ret_val;
33534    xmlChar * utf1; /* pointer to first UTF8 char */
33535    int n_utf1;
33536    xmlChar * utf2; /* pointer to second UTF8 char */
33537    int n_utf2;
33538
33539    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
33540    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
33541        mem_base = xmlMemBlocks();
33542        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
33543        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
33544
33545        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
33546        desret_int(ret_val);
33547        call_tests++;
33548        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
33549        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
33550        xmlResetLastError();
33551        if (mem_base != xmlMemBlocks()) {
33552            printf("Leak of %d blocks found in xmlUTF8Charcmp",
33553	           xmlMemBlocks() - mem_base);
33554	    test_ret++;
33555            printf(" %d", n_utf1);
33556            printf(" %d", n_utf2);
33557            printf("\n");
33558        }
33559    }
33560    }
33561    function_tests++;
33562
33563    return(test_ret);
33564}
33565
33566
33567static int
33568test_xmlUTF8Size(void) {
33569    int test_ret = 0;
33570
33571    int mem_base;
33572    int ret_val;
33573    xmlChar * utf; /* pointer to the UTF8 character */
33574    int n_utf;
33575
33576    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33577        mem_base = xmlMemBlocks();
33578        utf = gen_const_xmlChar_ptr(n_utf, 0);
33579
33580        ret_val = xmlUTF8Size((const xmlChar *)utf);
33581        desret_int(ret_val);
33582        call_tests++;
33583        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
33584        xmlResetLastError();
33585        if (mem_base != xmlMemBlocks()) {
33586            printf("Leak of %d blocks found in xmlUTF8Size",
33587	           xmlMemBlocks() - mem_base);
33588	    test_ret++;
33589            printf(" %d", n_utf);
33590            printf("\n");
33591        }
33592    }
33593    function_tests++;
33594
33595    return(test_ret);
33596}
33597
33598
33599static int
33600test_xmlUTF8Strlen(void) {
33601    int test_ret = 0;
33602
33603    int mem_base;
33604    int ret_val;
33605    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
33606    int n_utf;
33607
33608    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33609        mem_base = xmlMemBlocks();
33610        utf = gen_const_xmlChar_ptr(n_utf, 0);
33611
33612        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
33613        desret_int(ret_val);
33614        call_tests++;
33615        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
33616        xmlResetLastError();
33617        if (mem_base != xmlMemBlocks()) {
33618            printf("Leak of %d blocks found in xmlUTF8Strlen",
33619	           xmlMemBlocks() - mem_base);
33620	    test_ret++;
33621            printf(" %d", n_utf);
33622            printf("\n");
33623        }
33624    }
33625    function_tests++;
33626
33627    return(test_ret);
33628}
33629
33630
33631static int
33632test_xmlUTF8Strloc(void) {
33633    int test_ret = 0;
33634
33635    int mem_base;
33636    int ret_val;
33637    xmlChar * utf; /* the input UTF8 * */
33638    int n_utf;
33639    xmlChar * utfchar; /* the UTF8 character to be found */
33640    int n_utfchar;
33641
33642    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33643    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
33644        mem_base = xmlMemBlocks();
33645        utf = gen_const_xmlChar_ptr(n_utf, 0);
33646        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
33647
33648        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
33649        desret_int(ret_val);
33650        call_tests++;
33651        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
33652        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
33653        xmlResetLastError();
33654        if (mem_base != xmlMemBlocks()) {
33655            printf("Leak of %d blocks found in xmlUTF8Strloc",
33656	           xmlMemBlocks() - mem_base);
33657	    test_ret++;
33658            printf(" %d", n_utf);
33659            printf(" %d", n_utfchar);
33660            printf("\n");
33661        }
33662    }
33663    }
33664    function_tests++;
33665
33666    return(test_ret);
33667}
33668
33669
33670static int
33671test_xmlUTF8Strndup(void) {
33672    int test_ret = 0;
33673
33674    int mem_base;
33675    xmlChar * ret_val;
33676    xmlChar * utf; /* the input UTF8 * */
33677    int n_utf;
33678    int len; /* the len of @utf (in chars) */
33679    int n_len;
33680
33681    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33682    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33683        mem_base = xmlMemBlocks();
33684        utf = gen_const_xmlChar_ptr(n_utf, 0);
33685        len = gen_int(n_len, 1);
33686
33687        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
33688        desret_xmlChar_ptr(ret_val);
33689        call_tests++;
33690        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
33691        des_int(n_len, len, 1);
33692        xmlResetLastError();
33693        if (mem_base != xmlMemBlocks()) {
33694            printf("Leak of %d blocks found in xmlUTF8Strndup",
33695	           xmlMemBlocks() - mem_base);
33696	    test_ret++;
33697            printf(" %d", n_utf);
33698            printf(" %d", n_len);
33699            printf("\n");
33700        }
33701    }
33702    }
33703    function_tests++;
33704
33705    return(test_ret);
33706}
33707
33708
33709static int
33710test_xmlUTF8Strpos(void) {
33711    int test_ret = 0;
33712
33713    int mem_base;
33714    const xmlChar * ret_val;
33715    xmlChar * utf; /* the input UTF8 * */
33716    int n_utf;
33717    int pos; /* the position of the desired UTF8 char (in chars) */
33718    int n_pos;
33719
33720    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33721    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
33722        mem_base = xmlMemBlocks();
33723        utf = gen_const_xmlChar_ptr(n_utf, 0);
33724        pos = gen_int(n_pos, 1);
33725
33726        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
33727        desret_const_xmlChar_ptr(ret_val);
33728        call_tests++;
33729        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
33730        des_int(n_pos, pos, 1);
33731        xmlResetLastError();
33732        if (mem_base != xmlMemBlocks()) {
33733            printf("Leak of %d blocks found in xmlUTF8Strpos",
33734	           xmlMemBlocks() - mem_base);
33735	    test_ret++;
33736            printf(" %d", n_utf);
33737            printf(" %d", n_pos);
33738            printf("\n");
33739        }
33740    }
33741    }
33742    function_tests++;
33743
33744    return(test_ret);
33745}
33746
33747
33748static int
33749test_xmlUTF8Strsize(void) {
33750    int test_ret = 0;
33751
33752    int mem_base;
33753    int ret_val;
33754    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
33755    int n_utf;
33756    int len; /* the number of characters in the array */
33757    int n_len;
33758
33759    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33760    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33761        mem_base = xmlMemBlocks();
33762        utf = gen_const_xmlChar_ptr(n_utf, 0);
33763        len = gen_int(n_len, 1);
33764
33765        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
33766        desret_int(ret_val);
33767        call_tests++;
33768        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
33769        des_int(n_len, len, 1);
33770        xmlResetLastError();
33771        if (mem_base != xmlMemBlocks()) {
33772            printf("Leak of %d blocks found in xmlUTF8Strsize",
33773	           xmlMemBlocks() - mem_base);
33774	    test_ret++;
33775            printf(" %d", n_utf);
33776            printf(" %d", n_len);
33777            printf("\n");
33778        }
33779    }
33780    }
33781    function_tests++;
33782
33783    return(test_ret);
33784}
33785
33786
33787static int
33788test_xmlUTF8Strsub(void) {
33789    int test_ret = 0;
33790
33791    int mem_base;
33792    xmlChar * ret_val;
33793    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
33794    int n_utf;
33795    int start; /* relative pos of first char */
33796    int n_start;
33797    int len; /* total number to copy */
33798    int n_len;
33799
33800    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
33801    for (n_start = 0;n_start < gen_nb_int;n_start++) {
33802    for (n_len = 0;n_len < gen_nb_int;n_len++) {
33803        mem_base = xmlMemBlocks();
33804        utf = gen_const_xmlChar_ptr(n_utf, 0);
33805        start = gen_int(n_start, 1);
33806        len = gen_int(n_len, 2);
33807
33808        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
33809        desret_xmlChar_ptr(ret_val);
33810        call_tests++;
33811        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
33812        des_int(n_start, start, 1);
33813        des_int(n_len, len, 2);
33814        xmlResetLastError();
33815        if (mem_base != xmlMemBlocks()) {
33816            printf("Leak of %d blocks found in xmlUTF8Strsub",
33817	           xmlMemBlocks() - mem_base);
33818	    test_ret++;
33819            printf(" %d", n_utf);
33820            printf(" %d", n_start);
33821            printf(" %d", n_len);
33822            printf("\n");
33823        }
33824    }
33825    }
33826    }
33827    function_tests++;
33828
33829    return(test_ret);
33830}
33831
33832static int
33833test_xmlstring(void) {
33834    int test_ret = 0;
33835
33836    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
33837    test_ret += test_xmlCharStrdup();
33838    test_ret += test_xmlCharStrndup();
33839    test_ret += test_xmlCheckUTF8();
33840    test_ret += test_xmlGetUTF8Char();
33841    test_ret += test_xmlStrEqual();
33842    test_ret += test_xmlStrPrintf();
33843    test_ret += test_xmlStrQEqual();
33844    test_ret += test_xmlStrVPrintf();
33845    test_ret += test_xmlStrcasecmp();
33846    test_ret += test_xmlStrcasestr();
33847    test_ret += test_xmlStrchr();
33848    test_ret += test_xmlStrcmp();
33849    test_ret += test_xmlStrdup();
33850    test_ret += test_xmlStrlen();
33851    test_ret += test_xmlStrncasecmp();
33852    test_ret += test_xmlStrncatNew();
33853    test_ret += test_xmlStrncmp();
33854    test_ret += test_xmlStrndup();
33855    test_ret += test_xmlStrstr();
33856    test_ret += test_xmlStrsub();
33857    test_ret += test_xmlUTF8Charcmp();
33858    test_ret += test_xmlUTF8Size();
33859    test_ret += test_xmlUTF8Strlen();
33860    test_ret += test_xmlUTF8Strloc();
33861    test_ret += test_xmlUTF8Strndup();
33862    test_ret += test_xmlUTF8Strpos();
33863    test_ret += test_xmlUTF8Strsize();
33864    test_ret += test_xmlUTF8Strsub();
33865
33866    if (test_ret != 0)
33867	printf("Module xmlstring: %d errors\n", test_ret);
33868    return(test_ret);
33869}
33870
33871static int
33872test_xmlUCSIsAegeanNumbers(void) {
33873    int test_ret = 0;
33874
33875#ifdef LIBXML_UNICODE_ENABLED
33876    int mem_base;
33877    int ret_val;
33878    int code; /* UCS code point */
33879    int n_code;
33880
33881    for (n_code = 0;n_code < gen_nb_int;n_code++) {
33882        mem_base = xmlMemBlocks();
33883        code = gen_int(n_code, 0);
33884
33885        ret_val = xmlUCSIsAegeanNumbers(code);
33886        desret_int(ret_val);
33887        call_tests++;
33888        des_int(n_code, code, 0);
33889        xmlResetLastError();
33890        if (mem_base != xmlMemBlocks()) {
33891            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
33892	           xmlMemBlocks() - mem_base);
33893	    test_ret++;
33894            printf(" %d", n_code);
33895            printf("\n");
33896        }
33897    }
33898    function_tests++;
33899#endif
33900
33901    return(test_ret);
33902}
33903
33904
33905static int
33906test_xmlUCSIsAlphabeticPresentationForms(void) {
33907    int test_ret = 0;
33908
33909#ifdef LIBXML_UNICODE_ENABLED
33910    int mem_base;
33911    int ret_val;
33912    int code; /* UCS code point */
33913    int n_code;
33914
33915    for (n_code = 0;n_code < gen_nb_int;n_code++) {
33916        mem_base = xmlMemBlocks();
33917        code = gen_int(n_code, 0);
33918
33919        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
33920        desret_int(ret_val);
33921        call_tests++;
33922        des_int(n_code, code, 0);
33923        xmlResetLastError();
33924        if (mem_base != xmlMemBlocks()) {
33925            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
33926	           xmlMemBlocks() - mem_base);
33927	    test_ret++;
33928            printf(" %d", n_code);
33929            printf("\n");
33930        }
33931    }
33932    function_tests++;
33933#endif
33934
33935    return(test_ret);
33936}
33937
33938
33939static int
33940test_xmlUCSIsArabic(void) {
33941    int test_ret = 0;
33942
33943#ifdef LIBXML_UNICODE_ENABLED
33944    int mem_base;
33945    int ret_val;
33946    int code; /* UCS code point */
33947    int n_code;
33948
33949    for (n_code = 0;n_code < gen_nb_int;n_code++) {
33950        mem_base = xmlMemBlocks();
33951        code = gen_int(n_code, 0);
33952
33953        ret_val = xmlUCSIsArabic(code);
33954        desret_int(ret_val);
33955        call_tests++;
33956        des_int(n_code, code, 0);
33957        xmlResetLastError();
33958        if (mem_base != xmlMemBlocks()) {
33959            printf("Leak of %d blocks found in xmlUCSIsArabic",
33960	           xmlMemBlocks() - mem_base);
33961	    test_ret++;
33962            printf(" %d", n_code);
33963            printf("\n");
33964        }
33965    }
33966    function_tests++;
33967#endif
33968
33969    return(test_ret);
33970}
33971
33972
33973static int
33974test_xmlUCSIsArabicPresentationFormsA(void) {
33975    int test_ret = 0;
33976
33977#ifdef LIBXML_UNICODE_ENABLED
33978    int mem_base;
33979    int ret_val;
33980    int code; /* UCS code point */
33981    int n_code;
33982
33983    for (n_code = 0;n_code < gen_nb_int;n_code++) {
33984        mem_base = xmlMemBlocks();
33985        code = gen_int(n_code, 0);
33986
33987        ret_val = xmlUCSIsArabicPresentationFormsA(code);
33988        desret_int(ret_val);
33989        call_tests++;
33990        des_int(n_code, code, 0);
33991        xmlResetLastError();
33992        if (mem_base != xmlMemBlocks()) {
33993            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
33994	           xmlMemBlocks() - mem_base);
33995	    test_ret++;
33996            printf(" %d", n_code);
33997            printf("\n");
33998        }
33999    }
34000    function_tests++;
34001#endif
34002
34003    return(test_ret);
34004}
34005
34006
34007static int
34008test_xmlUCSIsArabicPresentationFormsB(void) {
34009    int test_ret = 0;
34010
34011#ifdef LIBXML_UNICODE_ENABLED
34012    int mem_base;
34013    int ret_val;
34014    int code; /* UCS code point */
34015    int n_code;
34016
34017    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34018        mem_base = xmlMemBlocks();
34019        code = gen_int(n_code, 0);
34020
34021        ret_val = xmlUCSIsArabicPresentationFormsB(code);
34022        desret_int(ret_val);
34023        call_tests++;
34024        des_int(n_code, code, 0);
34025        xmlResetLastError();
34026        if (mem_base != xmlMemBlocks()) {
34027            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
34028	           xmlMemBlocks() - mem_base);
34029	    test_ret++;
34030            printf(" %d", n_code);
34031            printf("\n");
34032        }
34033    }
34034    function_tests++;
34035#endif
34036
34037    return(test_ret);
34038}
34039
34040
34041static int
34042test_xmlUCSIsArmenian(void) {
34043    int test_ret = 0;
34044
34045#ifdef LIBXML_UNICODE_ENABLED
34046    int mem_base;
34047    int ret_val;
34048    int code; /* UCS code point */
34049    int n_code;
34050
34051    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34052        mem_base = xmlMemBlocks();
34053        code = gen_int(n_code, 0);
34054
34055        ret_val = xmlUCSIsArmenian(code);
34056        desret_int(ret_val);
34057        call_tests++;
34058        des_int(n_code, code, 0);
34059        xmlResetLastError();
34060        if (mem_base != xmlMemBlocks()) {
34061            printf("Leak of %d blocks found in xmlUCSIsArmenian",
34062	           xmlMemBlocks() - mem_base);
34063	    test_ret++;
34064            printf(" %d", n_code);
34065            printf("\n");
34066        }
34067    }
34068    function_tests++;
34069#endif
34070
34071    return(test_ret);
34072}
34073
34074
34075static int
34076test_xmlUCSIsArrows(void) {
34077    int test_ret = 0;
34078
34079#ifdef LIBXML_UNICODE_ENABLED
34080    int mem_base;
34081    int ret_val;
34082    int code; /* UCS code point */
34083    int n_code;
34084
34085    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34086        mem_base = xmlMemBlocks();
34087        code = gen_int(n_code, 0);
34088
34089        ret_val = xmlUCSIsArrows(code);
34090        desret_int(ret_val);
34091        call_tests++;
34092        des_int(n_code, code, 0);
34093        xmlResetLastError();
34094        if (mem_base != xmlMemBlocks()) {
34095            printf("Leak of %d blocks found in xmlUCSIsArrows",
34096	           xmlMemBlocks() - mem_base);
34097	    test_ret++;
34098            printf(" %d", n_code);
34099            printf("\n");
34100        }
34101    }
34102    function_tests++;
34103#endif
34104
34105    return(test_ret);
34106}
34107
34108
34109static int
34110test_xmlUCSIsBasicLatin(void) {
34111    int test_ret = 0;
34112
34113#ifdef LIBXML_UNICODE_ENABLED
34114    int mem_base;
34115    int ret_val;
34116    int code; /* UCS code point */
34117    int n_code;
34118
34119    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34120        mem_base = xmlMemBlocks();
34121        code = gen_int(n_code, 0);
34122
34123        ret_val = xmlUCSIsBasicLatin(code);
34124        desret_int(ret_val);
34125        call_tests++;
34126        des_int(n_code, code, 0);
34127        xmlResetLastError();
34128        if (mem_base != xmlMemBlocks()) {
34129            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
34130	           xmlMemBlocks() - mem_base);
34131	    test_ret++;
34132            printf(" %d", n_code);
34133            printf("\n");
34134        }
34135    }
34136    function_tests++;
34137#endif
34138
34139    return(test_ret);
34140}
34141
34142
34143static int
34144test_xmlUCSIsBengali(void) {
34145    int test_ret = 0;
34146
34147#ifdef LIBXML_UNICODE_ENABLED
34148    int mem_base;
34149    int ret_val;
34150    int code; /* UCS code point */
34151    int n_code;
34152
34153    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34154        mem_base = xmlMemBlocks();
34155        code = gen_int(n_code, 0);
34156
34157        ret_val = xmlUCSIsBengali(code);
34158        desret_int(ret_val);
34159        call_tests++;
34160        des_int(n_code, code, 0);
34161        xmlResetLastError();
34162        if (mem_base != xmlMemBlocks()) {
34163            printf("Leak of %d blocks found in xmlUCSIsBengali",
34164	           xmlMemBlocks() - mem_base);
34165	    test_ret++;
34166            printf(" %d", n_code);
34167            printf("\n");
34168        }
34169    }
34170    function_tests++;
34171#endif
34172
34173    return(test_ret);
34174}
34175
34176
34177static int
34178test_xmlUCSIsBlock(void) {
34179    int test_ret = 0;
34180
34181#ifdef LIBXML_UNICODE_ENABLED
34182    int mem_base;
34183    int ret_val;
34184    int code; /* UCS code point */
34185    int n_code;
34186    char * block; /* UCS block name */
34187    int n_block;
34188
34189    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34190    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
34191        mem_base = xmlMemBlocks();
34192        code = gen_int(n_code, 0);
34193        block = gen_const_char_ptr(n_block, 1);
34194
34195        ret_val = xmlUCSIsBlock(code, (const char *)block);
34196        desret_int(ret_val);
34197        call_tests++;
34198        des_int(n_code, code, 0);
34199        des_const_char_ptr(n_block, (const char *)block, 1);
34200        xmlResetLastError();
34201        if (mem_base != xmlMemBlocks()) {
34202            printf("Leak of %d blocks found in xmlUCSIsBlock",
34203	           xmlMemBlocks() - mem_base);
34204	    test_ret++;
34205            printf(" %d", n_code);
34206            printf(" %d", n_block);
34207            printf("\n");
34208        }
34209    }
34210    }
34211    function_tests++;
34212#endif
34213
34214    return(test_ret);
34215}
34216
34217
34218static int
34219test_xmlUCSIsBlockElements(void) {
34220    int test_ret = 0;
34221
34222#ifdef LIBXML_UNICODE_ENABLED
34223    int mem_base;
34224    int ret_val;
34225    int code; /* UCS code point */
34226    int n_code;
34227
34228    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34229        mem_base = xmlMemBlocks();
34230        code = gen_int(n_code, 0);
34231
34232        ret_val = xmlUCSIsBlockElements(code);
34233        desret_int(ret_val);
34234        call_tests++;
34235        des_int(n_code, code, 0);
34236        xmlResetLastError();
34237        if (mem_base != xmlMemBlocks()) {
34238            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
34239	           xmlMemBlocks() - mem_base);
34240	    test_ret++;
34241            printf(" %d", n_code);
34242            printf("\n");
34243        }
34244    }
34245    function_tests++;
34246#endif
34247
34248    return(test_ret);
34249}
34250
34251
34252static int
34253test_xmlUCSIsBopomofo(void) {
34254    int test_ret = 0;
34255
34256#ifdef LIBXML_UNICODE_ENABLED
34257    int mem_base;
34258    int ret_val;
34259    int code; /* UCS code point */
34260    int n_code;
34261
34262    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34263        mem_base = xmlMemBlocks();
34264        code = gen_int(n_code, 0);
34265
34266        ret_val = xmlUCSIsBopomofo(code);
34267        desret_int(ret_val);
34268        call_tests++;
34269        des_int(n_code, code, 0);
34270        xmlResetLastError();
34271        if (mem_base != xmlMemBlocks()) {
34272            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
34273	           xmlMemBlocks() - mem_base);
34274	    test_ret++;
34275            printf(" %d", n_code);
34276            printf("\n");
34277        }
34278    }
34279    function_tests++;
34280#endif
34281
34282    return(test_ret);
34283}
34284
34285
34286static int
34287test_xmlUCSIsBopomofoExtended(void) {
34288    int test_ret = 0;
34289
34290#ifdef LIBXML_UNICODE_ENABLED
34291    int mem_base;
34292    int ret_val;
34293    int code; /* UCS code point */
34294    int n_code;
34295
34296    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34297        mem_base = xmlMemBlocks();
34298        code = gen_int(n_code, 0);
34299
34300        ret_val = xmlUCSIsBopomofoExtended(code);
34301        desret_int(ret_val);
34302        call_tests++;
34303        des_int(n_code, code, 0);
34304        xmlResetLastError();
34305        if (mem_base != xmlMemBlocks()) {
34306            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
34307	           xmlMemBlocks() - mem_base);
34308	    test_ret++;
34309            printf(" %d", n_code);
34310            printf("\n");
34311        }
34312    }
34313    function_tests++;
34314#endif
34315
34316    return(test_ret);
34317}
34318
34319
34320static int
34321test_xmlUCSIsBoxDrawing(void) {
34322    int test_ret = 0;
34323
34324#ifdef LIBXML_UNICODE_ENABLED
34325    int mem_base;
34326    int ret_val;
34327    int code; /* UCS code point */
34328    int n_code;
34329
34330    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34331        mem_base = xmlMemBlocks();
34332        code = gen_int(n_code, 0);
34333
34334        ret_val = xmlUCSIsBoxDrawing(code);
34335        desret_int(ret_val);
34336        call_tests++;
34337        des_int(n_code, code, 0);
34338        xmlResetLastError();
34339        if (mem_base != xmlMemBlocks()) {
34340            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
34341	           xmlMemBlocks() - mem_base);
34342	    test_ret++;
34343            printf(" %d", n_code);
34344            printf("\n");
34345        }
34346    }
34347    function_tests++;
34348#endif
34349
34350    return(test_ret);
34351}
34352
34353
34354static int
34355test_xmlUCSIsBraillePatterns(void) {
34356    int test_ret = 0;
34357
34358#ifdef LIBXML_UNICODE_ENABLED
34359    int mem_base;
34360    int ret_val;
34361    int code; /* UCS code point */
34362    int n_code;
34363
34364    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34365        mem_base = xmlMemBlocks();
34366        code = gen_int(n_code, 0);
34367
34368        ret_val = xmlUCSIsBraillePatterns(code);
34369        desret_int(ret_val);
34370        call_tests++;
34371        des_int(n_code, code, 0);
34372        xmlResetLastError();
34373        if (mem_base != xmlMemBlocks()) {
34374            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
34375	           xmlMemBlocks() - mem_base);
34376	    test_ret++;
34377            printf(" %d", n_code);
34378            printf("\n");
34379        }
34380    }
34381    function_tests++;
34382#endif
34383
34384    return(test_ret);
34385}
34386
34387
34388static int
34389test_xmlUCSIsBuhid(void) {
34390    int test_ret = 0;
34391
34392#ifdef LIBXML_UNICODE_ENABLED
34393    int mem_base;
34394    int ret_val;
34395    int code; /* UCS code point */
34396    int n_code;
34397
34398    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34399        mem_base = xmlMemBlocks();
34400        code = gen_int(n_code, 0);
34401
34402        ret_val = xmlUCSIsBuhid(code);
34403        desret_int(ret_val);
34404        call_tests++;
34405        des_int(n_code, code, 0);
34406        xmlResetLastError();
34407        if (mem_base != xmlMemBlocks()) {
34408            printf("Leak of %d blocks found in xmlUCSIsBuhid",
34409	           xmlMemBlocks() - mem_base);
34410	    test_ret++;
34411            printf(" %d", n_code);
34412            printf("\n");
34413        }
34414    }
34415    function_tests++;
34416#endif
34417
34418    return(test_ret);
34419}
34420
34421
34422static int
34423test_xmlUCSIsByzantineMusicalSymbols(void) {
34424    int test_ret = 0;
34425
34426#ifdef LIBXML_UNICODE_ENABLED
34427    int mem_base;
34428    int ret_val;
34429    int code; /* UCS code point */
34430    int n_code;
34431
34432    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34433        mem_base = xmlMemBlocks();
34434        code = gen_int(n_code, 0);
34435
34436        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
34437        desret_int(ret_val);
34438        call_tests++;
34439        des_int(n_code, code, 0);
34440        xmlResetLastError();
34441        if (mem_base != xmlMemBlocks()) {
34442            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
34443	           xmlMemBlocks() - mem_base);
34444	    test_ret++;
34445            printf(" %d", n_code);
34446            printf("\n");
34447        }
34448    }
34449    function_tests++;
34450#endif
34451
34452    return(test_ret);
34453}
34454
34455
34456static int
34457test_xmlUCSIsCJKCompatibility(void) {
34458    int test_ret = 0;
34459
34460#ifdef LIBXML_UNICODE_ENABLED
34461    int mem_base;
34462    int ret_val;
34463    int code; /* UCS code point */
34464    int n_code;
34465
34466    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34467        mem_base = xmlMemBlocks();
34468        code = gen_int(n_code, 0);
34469
34470        ret_val = xmlUCSIsCJKCompatibility(code);
34471        desret_int(ret_val);
34472        call_tests++;
34473        des_int(n_code, code, 0);
34474        xmlResetLastError();
34475        if (mem_base != xmlMemBlocks()) {
34476            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
34477	           xmlMemBlocks() - mem_base);
34478	    test_ret++;
34479            printf(" %d", n_code);
34480            printf("\n");
34481        }
34482    }
34483    function_tests++;
34484#endif
34485
34486    return(test_ret);
34487}
34488
34489
34490static int
34491test_xmlUCSIsCJKCompatibilityForms(void) {
34492    int test_ret = 0;
34493
34494#ifdef LIBXML_UNICODE_ENABLED
34495    int mem_base;
34496    int ret_val;
34497    int code; /* UCS code point */
34498    int n_code;
34499
34500    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34501        mem_base = xmlMemBlocks();
34502        code = gen_int(n_code, 0);
34503
34504        ret_val = xmlUCSIsCJKCompatibilityForms(code);
34505        desret_int(ret_val);
34506        call_tests++;
34507        des_int(n_code, code, 0);
34508        xmlResetLastError();
34509        if (mem_base != xmlMemBlocks()) {
34510            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
34511	           xmlMemBlocks() - mem_base);
34512	    test_ret++;
34513            printf(" %d", n_code);
34514            printf("\n");
34515        }
34516    }
34517    function_tests++;
34518#endif
34519
34520    return(test_ret);
34521}
34522
34523
34524static int
34525test_xmlUCSIsCJKCompatibilityIdeographs(void) {
34526    int test_ret = 0;
34527
34528#ifdef LIBXML_UNICODE_ENABLED
34529    int mem_base;
34530    int ret_val;
34531    int code; /* UCS code point */
34532    int n_code;
34533
34534    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34535        mem_base = xmlMemBlocks();
34536        code = gen_int(n_code, 0);
34537
34538        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
34539        desret_int(ret_val);
34540        call_tests++;
34541        des_int(n_code, code, 0);
34542        xmlResetLastError();
34543        if (mem_base != xmlMemBlocks()) {
34544            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
34545	           xmlMemBlocks() - mem_base);
34546	    test_ret++;
34547            printf(" %d", n_code);
34548            printf("\n");
34549        }
34550    }
34551    function_tests++;
34552#endif
34553
34554    return(test_ret);
34555}
34556
34557
34558static int
34559test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
34560    int test_ret = 0;
34561
34562#ifdef LIBXML_UNICODE_ENABLED
34563    int mem_base;
34564    int ret_val;
34565    int code; /* UCS code point */
34566    int n_code;
34567
34568    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34569        mem_base = xmlMemBlocks();
34570        code = gen_int(n_code, 0);
34571
34572        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
34573        desret_int(ret_val);
34574        call_tests++;
34575        des_int(n_code, code, 0);
34576        xmlResetLastError();
34577        if (mem_base != xmlMemBlocks()) {
34578            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
34579	           xmlMemBlocks() - mem_base);
34580	    test_ret++;
34581            printf(" %d", n_code);
34582            printf("\n");
34583        }
34584    }
34585    function_tests++;
34586#endif
34587
34588    return(test_ret);
34589}
34590
34591
34592static int
34593test_xmlUCSIsCJKRadicalsSupplement(void) {
34594    int test_ret = 0;
34595
34596#ifdef LIBXML_UNICODE_ENABLED
34597    int mem_base;
34598    int ret_val;
34599    int code; /* UCS code point */
34600    int n_code;
34601
34602    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34603        mem_base = xmlMemBlocks();
34604        code = gen_int(n_code, 0);
34605
34606        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
34607        desret_int(ret_val);
34608        call_tests++;
34609        des_int(n_code, code, 0);
34610        xmlResetLastError();
34611        if (mem_base != xmlMemBlocks()) {
34612            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
34613	           xmlMemBlocks() - mem_base);
34614	    test_ret++;
34615            printf(" %d", n_code);
34616            printf("\n");
34617        }
34618    }
34619    function_tests++;
34620#endif
34621
34622    return(test_ret);
34623}
34624
34625
34626static int
34627test_xmlUCSIsCJKSymbolsandPunctuation(void) {
34628    int test_ret = 0;
34629
34630#ifdef LIBXML_UNICODE_ENABLED
34631    int mem_base;
34632    int ret_val;
34633    int code; /* UCS code point */
34634    int n_code;
34635
34636    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34637        mem_base = xmlMemBlocks();
34638        code = gen_int(n_code, 0);
34639
34640        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
34641        desret_int(ret_val);
34642        call_tests++;
34643        des_int(n_code, code, 0);
34644        xmlResetLastError();
34645        if (mem_base != xmlMemBlocks()) {
34646            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
34647	           xmlMemBlocks() - mem_base);
34648	    test_ret++;
34649            printf(" %d", n_code);
34650            printf("\n");
34651        }
34652    }
34653    function_tests++;
34654#endif
34655
34656    return(test_ret);
34657}
34658
34659
34660static int
34661test_xmlUCSIsCJKUnifiedIdeographs(void) {
34662    int test_ret = 0;
34663
34664#ifdef LIBXML_UNICODE_ENABLED
34665    int mem_base;
34666    int ret_val;
34667    int code; /* UCS code point */
34668    int n_code;
34669
34670    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34671        mem_base = xmlMemBlocks();
34672        code = gen_int(n_code, 0);
34673
34674        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
34675        desret_int(ret_val);
34676        call_tests++;
34677        des_int(n_code, code, 0);
34678        xmlResetLastError();
34679        if (mem_base != xmlMemBlocks()) {
34680            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
34681	           xmlMemBlocks() - mem_base);
34682	    test_ret++;
34683            printf(" %d", n_code);
34684            printf("\n");
34685        }
34686    }
34687    function_tests++;
34688#endif
34689
34690    return(test_ret);
34691}
34692
34693
34694static int
34695test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
34696    int test_ret = 0;
34697
34698#ifdef LIBXML_UNICODE_ENABLED
34699    int mem_base;
34700    int ret_val;
34701    int code; /* UCS code point */
34702    int n_code;
34703
34704    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34705        mem_base = xmlMemBlocks();
34706        code = gen_int(n_code, 0);
34707
34708        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
34709        desret_int(ret_val);
34710        call_tests++;
34711        des_int(n_code, code, 0);
34712        xmlResetLastError();
34713        if (mem_base != xmlMemBlocks()) {
34714            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
34715	           xmlMemBlocks() - mem_base);
34716	    test_ret++;
34717            printf(" %d", n_code);
34718            printf("\n");
34719        }
34720    }
34721    function_tests++;
34722#endif
34723
34724    return(test_ret);
34725}
34726
34727
34728static int
34729test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
34730    int test_ret = 0;
34731
34732#ifdef LIBXML_UNICODE_ENABLED
34733    int mem_base;
34734    int ret_val;
34735    int code; /* UCS code point */
34736    int n_code;
34737
34738    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34739        mem_base = xmlMemBlocks();
34740        code = gen_int(n_code, 0);
34741
34742        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
34743        desret_int(ret_val);
34744        call_tests++;
34745        des_int(n_code, code, 0);
34746        xmlResetLastError();
34747        if (mem_base != xmlMemBlocks()) {
34748            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
34749	           xmlMemBlocks() - mem_base);
34750	    test_ret++;
34751            printf(" %d", n_code);
34752            printf("\n");
34753        }
34754    }
34755    function_tests++;
34756#endif
34757
34758    return(test_ret);
34759}
34760
34761
34762static int
34763test_xmlUCSIsCat(void) {
34764    int test_ret = 0;
34765
34766#ifdef LIBXML_UNICODE_ENABLED
34767    int mem_base;
34768    int ret_val;
34769    int code; /* UCS code point */
34770    int n_code;
34771    char * cat; /* UCS Category name */
34772    int n_cat;
34773
34774    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34775    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
34776        mem_base = xmlMemBlocks();
34777        code = gen_int(n_code, 0);
34778        cat = gen_const_char_ptr(n_cat, 1);
34779
34780        ret_val = xmlUCSIsCat(code, (const char *)cat);
34781        desret_int(ret_val);
34782        call_tests++;
34783        des_int(n_code, code, 0);
34784        des_const_char_ptr(n_cat, (const char *)cat, 1);
34785        xmlResetLastError();
34786        if (mem_base != xmlMemBlocks()) {
34787            printf("Leak of %d blocks found in xmlUCSIsCat",
34788	           xmlMemBlocks() - mem_base);
34789	    test_ret++;
34790            printf(" %d", n_code);
34791            printf(" %d", n_cat);
34792            printf("\n");
34793        }
34794    }
34795    }
34796    function_tests++;
34797#endif
34798
34799    return(test_ret);
34800}
34801
34802
34803static int
34804test_xmlUCSIsCatC(void) {
34805    int test_ret = 0;
34806
34807#ifdef LIBXML_UNICODE_ENABLED
34808    int mem_base;
34809    int ret_val;
34810    int code; /* UCS code point */
34811    int n_code;
34812
34813    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34814        mem_base = xmlMemBlocks();
34815        code = gen_int(n_code, 0);
34816
34817        ret_val = xmlUCSIsCatC(code);
34818        desret_int(ret_val);
34819        call_tests++;
34820        des_int(n_code, code, 0);
34821        xmlResetLastError();
34822        if (mem_base != xmlMemBlocks()) {
34823            printf("Leak of %d blocks found in xmlUCSIsCatC",
34824	           xmlMemBlocks() - mem_base);
34825	    test_ret++;
34826            printf(" %d", n_code);
34827            printf("\n");
34828        }
34829    }
34830    function_tests++;
34831#endif
34832
34833    return(test_ret);
34834}
34835
34836
34837static int
34838test_xmlUCSIsCatCc(void) {
34839    int test_ret = 0;
34840
34841#ifdef LIBXML_UNICODE_ENABLED
34842    int mem_base;
34843    int ret_val;
34844    int code; /* UCS code point */
34845    int n_code;
34846
34847    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34848        mem_base = xmlMemBlocks();
34849        code = gen_int(n_code, 0);
34850
34851        ret_val = xmlUCSIsCatCc(code);
34852        desret_int(ret_val);
34853        call_tests++;
34854        des_int(n_code, code, 0);
34855        xmlResetLastError();
34856        if (mem_base != xmlMemBlocks()) {
34857            printf("Leak of %d blocks found in xmlUCSIsCatCc",
34858	           xmlMemBlocks() - mem_base);
34859	    test_ret++;
34860            printf(" %d", n_code);
34861            printf("\n");
34862        }
34863    }
34864    function_tests++;
34865#endif
34866
34867    return(test_ret);
34868}
34869
34870
34871static int
34872test_xmlUCSIsCatCf(void) {
34873    int test_ret = 0;
34874
34875#ifdef LIBXML_UNICODE_ENABLED
34876    int mem_base;
34877    int ret_val;
34878    int code; /* UCS code point */
34879    int n_code;
34880
34881    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34882        mem_base = xmlMemBlocks();
34883        code = gen_int(n_code, 0);
34884
34885        ret_val = xmlUCSIsCatCf(code);
34886        desret_int(ret_val);
34887        call_tests++;
34888        des_int(n_code, code, 0);
34889        xmlResetLastError();
34890        if (mem_base != xmlMemBlocks()) {
34891            printf("Leak of %d blocks found in xmlUCSIsCatCf",
34892	           xmlMemBlocks() - mem_base);
34893	    test_ret++;
34894            printf(" %d", n_code);
34895            printf("\n");
34896        }
34897    }
34898    function_tests++;
34899#endif
34900
34901    return(test_ret);
34902}
34903
34904
34905static int
34906test_xmlUCSIsCatCo(void) {
34907    int test_ret = 0;
34908
34909#ifdef LIBXML_UNICODE_ENABLED
34910    int mem_base;
34911    int ret_val;
34912    int code; /* UCS code point */
34913    int n_code;
34914
34915    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34916        mem_base = xmlMemBlocks();
34917        code = gen_int(n_code, 0);
34918
34919        ret_val = xmlUCSIsCatCo(code);
34920        desret_int(ret_val);
34921        call_tests++;
34922        des_int(n_code, code, 0);
34923        xmlResetLastError();
34924        if (mem_base != xmlMemBlocks()) {
34925            printf("Leak of %d blocks found in xmlUCSIsCatCo",
34926	           xmlMemBlocks() - mem_base);
34927	    test_ret++;
34928            printf(" %d", n_code);
34929            printf("\n");
34930        }
34931    }
34932    function_tests++;
34933#endif
34934
34935    return(test_ret);
34936}
34937
34938
34939static int
34940test_xmlUCSIsCatCs(void) {
34941    int test_ret = 0;
34942
34943#ifdef LIBXML_UNICODE_ENABLED
34944    int mem_base;
34945    int ret_val;
34946    int code; /* UCS code point */
34947    int n_code;
34948
34949    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34950        mem_base = xmlMemBlocks();
34951        code = gen_int(n_code, 0);
34952
34953        ret_val = xmlUCSIsCatCs(code);
34954        desret_int(ret_val);
34955        call_tests++;
34956        des_int(n_code, code, 0);
34957        xmlResetLastError();
34958        if (mem_base != xmlMemBlocks()) {
34959            printf("Leak of %d blocks found in xmlUCSIsCatCs",
34960	           xmlMemBlocks() - mem_base);
34961	    test_ret++;
34962            printf(" %d", n_code);
34963            printf("\n");
34964        }
34965    }
34966    function_tests++;
34967#endif
34968
34969    return(test_ret);
34970}
34971
34972
34973static int
34974test_xmlUCSIsCatL(void) {
34975    int test_ret = 0;
34976
34977#ifdef LIBXML_UNICODE_ENABLED
34978    int mem_base;
34979    int ret_val;
34980    int code; /* UCS code point */
34981    int n_code;
34982
34983    for (n_code = 0;n_code < gen_nb_int;n_code++) {
34984        mem_base = xmlMemBlocks();
34985        code = gen_int(n_code, 0);
34986
34987        ret_val = xmlUCSIsCatL(code);
34988        desret_int(ret_val);
34989        call_tests++;
34990        des_int(n_code, code, 0);
34991        xmlResetLastError();
34992        if (mem_base != xmlMemBlocks()) {
34993            printf("Leak of %d blocks found in xmlUCSIsCatL",
34994	           xmlMemBlocks() - mem_base);
34995	    test_ret++;
34996            printf(" %d", n_code);
34997            printf("\n");
34998        }
34999    }
35000    function_tests++;
35001#endif
35002
35003    return(test_ret);
35004}
35005
35006
35007static int
35008test_xmlUCSIsCatLl(void) {
35009    int test_ret = 0;
35010
35011#ifdef LIBXML_UNICODE_ENABLED
35012    int mem_base;
35013    int ret_val;
35014    int code; /* UCS code point */
35015    int n_code;
35016
35017    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35018        mem_base = xmlMemBlocks();
35019        code = gen_int(n_code, 0);
35020
35021        ret_val = xmlUCSIsCatLl(code);
35022        desret_int(ret_val);
35023        call_tests++;
35024        des_int(n_code, code, 0);
35025        xmlResetLastError();
35026        if (mem_base != xmlMemBlocks()) {
35027            printf("Leak of %d blocks found in xmlUCSIsCatLl",
35028	           xmlMemBlocks() - mem_base);
35029	    test_ret++;
35030            printf(" %d", n_code);
35031            printf("\n");
35032        }
35033    }
35034    function_tests++;
35035#endif
35036
35037    return(test_ret);
35038}
35039
35040
35041static int
35042test_xmlUCSIsCatLm(void) {
35043    int test_ret = 0;
35044
35045#ifdef LIBXML_UNICODE_ENABLED
35046    int mem_base;
35047    int ret_val;
35048    int code; /* UCS code point */
35049    int n_code;
35050
35051    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35052        mem_base = xmlMemBlocks();
35053        code = gen_int(n_code, 0);
35054
35055        ret_val = xmlUCSIsCatLm(code);
35056        desret_int(ret_val);
35057        call_tests++;
35058        des_int(n_code, code, 0);
35059        xmlResetLastError();
35060        if (mem_base != xmlMemBlocks()) {
35061            printf("Leak of %d blocks found in xmlUCSIsCatLm",
35062	           xmlMemBlocks() - mem_base);
35063	    test_ret++;
35064            printf(" %d", n_code);
35065            printf("\n");
35066        }
35067    }
35068    function_tests++;
35069#endif
35070
35071    return(test_ret);
35072}
35073
35074
35075static int
35076test_xmlUCSIsCatLo(void) {
35077    int test_ret = 0;
35078
35079#ifdef LIBXML_UNICODE_ENABLED
35080    int mem_base;
35081    int ret_val;
35082    int code; /* UCS code point */
35083    int n_code;
35084
35085    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35086        mem_base = xmlMemBlocks();
35087        code = gen_int(n_code, 0);
35088
35089        ret_val = xmlUCSIsCatLo(code);
35090        desret_int(ret_val);
35091        call_tests++;
35092        des_int(n_code, code, 0);
35093        xmlResetLastError();
35094        if (mem_base != xmlMemBlocks()) {
35095            printf("Leak of %d blocks found in xmlUCSIsCatLo",
35096	           xmlMemBlocks() - mem_base);
35097	    test_ret++;
35098            printf(" %d", n_code);
35099            printf("\n");
35100        }
35101    }
35102    function_tests++;
35103#endif
35104
35105    return(test_ret);
35106}
35107
35108
35109static int
35110test_xmlUCSIsCatLt(void) {
35111    int test_ret = 0;
35112
35113#ifdef LIBXML_UNICODE_ENABLED
35114    int mem_base;
35115    int ret_val;
35116    int code; /* UCS code point */
35117    int n_code;
35118
35119    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35120        mem_base = xmlMemBlocks();
35121        code = gen_int(n_code, 0);
35122
35123        ret_val = xmlUCSIsCatLt(code);
35124        desret_int(ret_val);
35125        call_tests++;
35126        des_int(n_code, code, 0);
35127        xmlResetLastError();
35128        if (mem_base != xmlMemBlocks()) {
35129            printf("Leak of %d blocks found in xmlUCSIsCatLt",
35130	           xmlMemBlocks() - mem_base);
35131	    test_ret++;
35132            printf(" %d", n_code);
35133            printf("\n");
35134        }
35135    }
35136    function_tests++;
35137#endif
35138
35139    return(test_ret);
35140}
35141
35142
35143static int
35144test_xmlUCSIsCatLu(void) {
35145    int test_ret = 0;
35146
35147#ifdef LIBXML_UNICODE_ENABLED
35148    int mem_base;
35149    int ret_val;
35150    int code; /* UCS code point */
35151    int n_code;
35152
35153    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35154        mem_base = xmlMemBlocks();
35155        code = gen_int(n_code, 0);
35156
35157        ret_val = xmlUCSIsCatLu(code);
35158        desret_int(ret_val);
35159        call_tests++;
35160        des_int(n_code, code, 0);
35161        xmlResetLastError();
35162        if (mem_base != xmlMemBlocks()) {
35163            printf("Leak of %d blocks found in xmlUCSIsCatLu",
35164	           xmlMemBlocks() - mem_base);
35165	    test_ret++;
35166            printf(" %d", n_code);
35167            printf("\n");
35168        }
35169    }
35170    function_tests++;
35171#endif
35172
35173    return(test_ret);
35174}
35175
35176
35177static int
35178test_xmlUCSIsCatM(void) {
35179    int test_ret = 0;
35180
35181#ifdef LIBXML_UNICODE_ENABLED
35182    int mem_base;
35183    int ret_val;
35184    int code; /* UCS code point */
35185    int n_code;
35186
35187    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35188        mem_base = xmlMemBlocks();
35189        code = gen_int(n_code, 0);
35190
35191        ret_val = xmlUCSIsCatM(code);
35192        desret_int(ret_val);
35193        call_tests++;
35194        des_int(n_code, code, 0);
35195        xmlResetLastError();
35196        if (mem_base != xmlMemBlocks()) {
35197            printf("Leak of %d blocks found in xmlUCSIsCatM",
35198	           xmlMemBlocks() - mem_base);
35199	    test_ret++;
35200            printf(" %d", n_code);
35201            printf("\n");
35202        }
35203    }
35204    function_tests++;
35205#endif
35206
35207    return(test_ret);
35208}
35209
35210
35211static int
35212test_xmlUCSIsCatMc(void) {
35213    int test_ret = 0;
35214
35215#ifdef LIBXML_UNICODE_ENABLED
35216    int mem_base;
35217    int ret_val;
35218    int code; /* UCS code point */
35219    int n_code;
35220
35221    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35222        mem_base = xmlMemBlocks();
35223        code = gen_int(n_code, 0);
35224
35225        ret_val = xmlUCSIsCatMc(code);
35226        desret_int(ret_val);
35227        call_tests++;
35228        des_int(n_code, code, 0);
35229        xmlResetLastError();
35230        if (mem_base != xmlMemBlocks()) {
35231            printf("Leak of %d blocks found in xmlUCSIsCatMc",
35232	           xmlMemBlocks() - mem_base);
35233	    test_ret++;
35234            printf(" %d", n_code);
35235            printf("\n");
35236        }
35237    }
35238    function_tests++;
35239#endif
35240
35241    return(test_ret);
35242}
35243
35244
35245static int
35246test_xmlUCSIsCatMe(void) {
35247    int test_ret = 0;
35248
35249#ifdef LIBXML_UNICODE_ENABLED
35250    int mem_base;
35251    int ret_val;
35252    int code; /* UCS code point */
35253    int n_code;
35254
35255    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35256        mem_base = xmlMemBlocks();
35257        code = gen_int(n_code, 0);
35258
35259        ret_val = xmlUCSIsCatMe(code);
35260        desret_int(ret_val);
35261        call_tests++;
35262        des_int(n_code, code, 0);
35263        xmlResetLastError();
35264        if (mem_base != xmlMemBlocks()) {
35265            printf("Leak of %d blocks found in xmlUCSIsCatMe",
35266	           xmlMemBlocks() - mem_base);
35267	    test_ret++;
35268            printf(" %d", n_code);
35269            printf("\n");
35270        }
35271    }
35272    function_tests++;
35273#endif
35274
35275    return(test_ret);
35276}
35277
35278
35279static int
35280test_xmlUCSIsCatMn(void) {
35281    int test_ret = 0;
35282
35283#ifdef LIBXML_UNICODE_ENABLED
35284    int mem_base;
35285    int ret_val;
35286    int code; /* UCS code point */
35287    int n_code;
35288
35289    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35290        mem_base = xmlMemBlocks();
35291        code = gen_int(n_code, 0);
35292
35293        ret_val = xmlUCSIsCatMn(code);
35294        desret_int(ret_val);
35295        call_tests++;
35296        des_int(n_code, code, 0);
35297        xmlResetLastError();
35298        if (mem_base != xmlMemBlocks()) {
35299            printf("Leak of %d blocks found in xmlUCSIsCatMn",
35300	           xmlMemBlocks() - mem_base);
35301	    test_ret++;
35302            printf(" %d", n_code);
35303            printf("\n");
35304        }
35305    }
35306    function_tests++;
35307#endif
35308
35309    return(test_ret);
35310}
35311
35312
35313static int
35314test_xmlUCSIsCatN(void) {
35315    int test_ret = 0;
35316
35317#ifdef LIBXML_UNICODE_ENABLED
35318    int mem_base;
35319    int ret_val;
35320    int code; /* UCS code point */
35321    int n_code;
35322
35323    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35324        mem_base = xmlMemBlocks();
35325        code = gen_int(n_code, 0);
35326
35327        ret_val = xmlUCSIsCatN(code);
35328        desret_int(ret_val);
35329        call_tests++;
35330        des_int(n_code, code, 0);
35331        xmlResetLastError();
35332        if (mem_base != xmlMemBlocks()) {
35333            printf("Leak of %d blocks found in xmlUCSIsCatN",
35334	           xmlMemBlocks() - mem_base);
35335	    test_ret++;
35336            printf(" %d", n_code);
35337            printf("\n");
35338        }
35339    }
35340    function_tests++;
35341#endif
35342
35343    return(test_ret);
35344}
35345
35346
35347static int
35348test_xmlUCSIsCatNd(void) {
35349    int test_ret = 0;
35350
35351#ifdef LIBXML_UNICODE_ENABLED
35352    int mem_base;
35353    int ret_val;
35354    int code; /* UCS code point */
35355    int n_code;
35356
35357    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35358        mem_base = xmlMemBlocks();
35359        code = gen_int(n_code, 0);
35360
35361        ret_val = xmlUCSIsCatNd(code);
35362        desret_int(ret_val);
35363        call_tests++;
35364        des_int(n_code, code, 0);
35365        xmlResetLastError();
35366        if (mem_base != xmlMemBlocks()) {
35367            printf("Leak of %d blocks found in xmlUCSIsCatNd",
35368	           xmlMemBlocks() - mem_base);
35369	    test_ret++;
35370            printf(" %d", n_code);
35371            printf("\n");
35372        }
35373    }
35374    function_tests++;
35375#endif
35376
35377    return(test_ret);
35378}
35379
35380
35381static int
35382test_xmlUCSIsCatNl(void) {
35383    int test_ret = 0;
35384
35385#ifdef LIBXML_UNICODE_ENABLED
35386    int mem_base;
35387    int ret_val;
35388    int code; /* UCS code point */
35389    int n_code;
35390
35391    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35392        mem_base = xmlMemBlocks();
35393        code = gen_int(n_code, 0);
35394
35395        ret_val = xmlUCSIsCatNl(code);
35396        desret_int(ret_val);
35397        call_tests++;
35398        des_int(n_code, code, 0);
35399        xmlResetLastError();
35400        if (mem_base != xmlMemBlocks()) {
35401            printf("Leak of %d blocks found in xmlUCSIsCatNl",
35402	           xmlMemBlocks() - mem_base);
35403	    test_ret++;
35404            printf(" %d", n_code);
35405            printf("\n");
35406        }
35407    }
35408    function_tests++;
35409#endif
35410
35411    return(test_ret);
35412}
35413
35414
35415static int
35416test_xmlUCSIsCatNo(void) {
35417    int test_ret = 0;
35418
35419#ifdef LIBXML_UNICODE_ENABLED
35420    int mem_base;
35421    int ret_val;
35422    int code; /* UCS code point */
35423    int n_code;
35424
35425    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35426        mem_base = xmlMemBlocks();
35427        code = gen_int(n_code, 0);
35428
35429        ret_val = xmlUCSIsCatNo(code);
35430        desret_int(ret_val);
35431        call_tests++;
35432        des_int(n_code, code, 0);
35433        xmlResetLastError();
35434        if (mem_base != xmlMemBlocks()) {
35435            printf("Leak of %d blocks found in xmlUCSIsCatNo",
35436	           xmlMemBlocks() - mem_base);
35437	    test_ret++;
35438            printf(" %d", n_code);
35439            printf("\n");
35440        }
35441    }
35442    function_tests++;
35443#endif
35444
35445    return(test_ret);
35446}
35447
35448
35449static int
35450test_xmlUCSIsCatP(void) {
35451    int test_ret = 0;
35452
35453#ifdef LIBXML_UNICODE_ENABLED
35454    int mem_base;
35455    int ret_val;
35456    int code; /* UCS code point */
35457    int n_code;
35458
35459    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35460        mem_base = xmlMemBlocks();
35461        code = gen_int(n_code, 0);
35462
35463        ret_val = xmlUCSIsCatP(code);
35464        desret_int(ret_val);
35465        call_tests++;
35466        des_int(n_code, code, 0);
35467        xmlResetLastError();
35468        if (mem_base != xmlMemBlocks()) {
35469            printf("Leak of %d blocks found in xmlUCSIsCatP",
35470	           xmlMemBlocks() - mem_base);
35471	    test_ret++;
35472            printf(" %d", n_code);
35473            printf("\n");
35474        }
35475    }
35476    function_tests++;
35477#endif
35478
35479    return(test_ret);
35480}
35481
35482
35483static int
35484test_xmlUCSIsCatPc(void) {
35485    int test_ret = 0;
35486
35487#ifdef LIBXML_UNICODE_ENABLED
35488    int mem_base;
35489    int ret_val;
35490    int code; /* UCS code point */
35491    int n_code;
35492
35493    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35494        mem_base = xmlMemBlocks();
35495        code = gen_int(n_code, 0);
35496
35497        ret_val = xmlUCSIsCatPc(code);
35498        desret_int(ret_val);
35499        call_tests++;
35500        des_int(n_code, code, 0);
35501        xmlResetLastError();
35502        if (mem_base != xmlMemBlocks()) {
35503            printf("Leak of %d blocks found in xmlUCSIsCatPc",
35504	           xmlMemBlocks() - mem_base);
35505	    test_ret++;
35506            printf(" %d", n_code);
35507            printf("\n");
35508        }
35509    }
35510    function_tests++;
35511#endif
35512
35513    return(test_ret);
35514}
35515
35516
35517static int
35518test_xmlUCSIsCatPd(void) {
35519    int test_ret = 0;
35520
35521#ifdef LIBXML_UNICODE_ENABLED
35522    int mem_base;
35523    int ret_val;
35524    int code; /* UCS code point */
35525    int n_code;
35526
35527    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35528        mem_base = xmlMemBlocks();
35529        code = gen_int(n_code, 0);
35530
35531        ret_val = xmlUCSIsCatPd(code);
35532        desret_int(ret_val);
35533        call_tests++;
35534        des_int(n_code, code, 0);
35535        xmlResetLastError();
35536        if (mem_base != xmlMemBlocks()) {
35537            printf("Leak of %d blocks found in xmlUCSIsCatPd",
35538	           xmlMemBlocks() - mem_base);
35539	    test_ret++;
35540            printf(" %d", n_code);
35541            printf("\n");
35542        }
35543    }
35544    function_tests++;
35545#endif
35546
35547    return(test_ret);
35548}
35549
35550
35551static int
35552test_xmlUCSIsCatPe(void) {
35553    int test_ret = 0;
35554
35555#ifdef LIBXML_UNICODE_ENABLED
35556    int mem_base;
35557    int ret_val;
35558    int code; /* UCS code point */
35559    int n_code;
35560
35561    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35562        mem_base = xmlMemBlocks();
35563        code = gen_int(n_code, 0);
35564
35565        ret_val = xmlUCSIsCatPe(code);
35566        desret_int(ret_val);
35567        call_tests++;
35568        des_int(n_code, code, 0);
35569        xmlResetLastError();
35570        if (mem_base != xmlMemBlocks()) {
35571            printf("Leak of %d blocks found in xmlUCSIsCatPe",
35572	           xmlMemBlocks() - mem_base);
35573	    test_ret++;
35574            printf(" %d", n_code);
35575            printf("\n");
35576        }
35577    }
35578    function_tests++;
35579#endif
35580
35581    return(test_ret);
35582}
35583
35584
35585static int
35586test_xmlUCSIsCatPf(void) {
35587    int test_ret = 0;
35588
35589#ifdef LIBXML_UNICODE_ENABLED
35590    int mem_base;
35591    int ret_val;
35592    int code; /* UCS code point */
35593    int n_code;
35594
35595    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35596        mem_base = xmlMemBlocks();
35597        code = gen_int(n_code, 0);
35598
35599        ret_val = xmlUCSIsCatPf(code);
35600        desret_int(ret_val);
35601        call_tests++;
35602        des_int(n_code, code, 0);
35603        xmlResetLastError();
35604        if (mem_base != xmlMemBlocks()) {
35605            printf("Leak of %d blocks found in xmlUCSIsCatPf",
35606	           xmlMemBlocks() - mem_base);
35607	    test_ret++;
35608            printf(" %d", n_code);
35609            printf("\n");
35610        }
35611    }
35612    function_tests++;
35613#endif
35614
35615    return(test_ret);
35616}
35617
35618
35619static int
35620test_xmlUCSIsCatPi(void) {
35621    int test_ret = 0;
35622
35623#ifdef LIBXML_UNICODE_ENABLED
35624    int mem_base;
35625    int ret_val;
35626    int code; /* UCS code point */
35627    int n_code;
35628
35629    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35630        mem_base = xmlMemBlocks();
35631        code = gen_int(n_code, 0);
35632
35633        ret_val = xmlUCSIsCatPi(code);
35634        desret_int(ret_val);
35635        call_tests++;
35636        des_int(n_code, code, 0);
35637        xmlResetLastError();
35638        if (mem_base != xmlMemBlocks()) {
35639            printf("Leak of %d blocks found in xmlUCSIsCatPi",
35640	           xmlMemBlocks() - mem_base);
35641	    test_ret++;
35642            printf(" %d", n_code);
35643            printf("\n");
35644        }
35645    }
35646    function_tests++;
35647#endif
35648
35649    return(test_ret);
35650}
35651
35652
35653static int
35654test_xmlUCSIsCatPo(void) {
35655    int test_ret = 0;
35656
35657#ifdef LIBXML_UNICODE_ENABLED
35658    int mem_base;
35659    int ret_val;
35660    int code; /* UCS code point */
35661    int n_code;
35662
35663    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35664        mem_base = xmlMemBlocks();
35665        code = gen_int(n_code, 0);
35666
35667        ret_val = xmlUCSIsCatPo(code);
35668        desret_int(ret_val);
35669        call_tests++;
35670        des_int(n_code, code, 0);
35671        xmlResetLastError();
35672        if (mem_base != xmlMemBlocks()) {
35673            printf("Leak of %d blocks found in xmlUCSIsCatPo",
35674	           xmlMemBlocks() - mem_base);
35675	    test_ret++;
35676            printf(" %d", n_code);
35677            printf("\n");
35678        }
35679    }
35680    function_tests++;
35681#endif
35682
35683    return(test_ret);
35684}
35685
35686
35687static int
35688test_xmlUCSIsCatPs(void) {
35689    int test_ret = 0;
35690
35691#ifdef LIBXML_UNICODE_ENABLED
35692    int mem_base;
35693    int ret_val;
35694    int code; /* UCS code point */
35695    int n_code;
35696
35697    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35698        mem_base = xmlMemBlocks();
35699        code = gen_int(n_code, 0);
35700
35701        ret_val = xmlUCSIsCatPs(code);
35702        desret_int(ret_val);
35703        call_tests++;
35704        des_int(n_code, code, 0);
35705        xmlResetLastError();
35706        if (mem_base != xmlMemBlocks()) {
35707            printf("Leak of %d blocks found in xmlUCSIsCatPs",
35708	           xmlMemBlocks() - mem_base);
35709	    test_ret++;
35710            printf(" %d", n_code);
35711            printf("\n");
35712        }
35713    }
35714    function_tests++;
35715#endif
35716
35717    return(test_ret);
35718}
35719
35720
35721static int
35722test_xmlUCSIsCatS(void) {
35723    int test_ret = 0;
35724
35725#ifdef LIBXML_UNICODE_ENABLED
35726    int mem_base;
35727    int ret_val;
35728    int code; /* UCS code point */
35729    int n_code;
35730
35731    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35732        mem_base = xmlMemBlocks();
35733        code = gen_int(n_code, 0);
35734
35735        ret_val = xmlUCSIsCatS(code);
35736        desret_int(ret_val);
35737        call_tests++;
35738        des_int(n_code, code, 0);
35739        xmlResetLastError();
35740        if (mem_base != xmlMemBlocks()) {
35741            printf("Leak of %d blocks found in xmlUCSIsCatS",
35742	           xmlMemBlocks() - mem_base);
35743	    test_ret++;
35744            printf(" %d", n_code);
35745            printf("\n");
35746        }
35747    }
35748    function_tests++;
35749#endif
35750
35751    return(test_ret);
35752}
35753
35754
35755static int
35756test_xmlUCSIsCatSc(void) {
35757    int test_ret = 0;
35758
35759#ifdef LIBXML_UNICODE_ENABLED
35760    int mem_base;
35761    int ret_val;
35762    int code; /* UCS code point */
35763    int n_code;
35764
35765    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35766        mem_base = xmlMemBlocks();
35767        code = gen_int(n_code, 0);
35768
35769        ret_val = xmlUCSIsCatSc(code);
35770        desret_int(ret_val);
35771        call_tests++;
35772        des_int(n_code, code, 0);
35773        xmlResetLastError();
35774        if (mem_base != xmlMemBlocks()) {
35775            printf("Leak of %d blocks found in xmlUCSIsCatSc",
35776	           xmlMemBlocks() - mem_base);
35777	    test_ret++;
35778            printf(" %d", n_code);
35779            printf("\n");
35780        }
35781    }
35782    function_tests++;
35783#endif
35784
35785    return(test_ret);
35786}
35787
35788
35789static int
35790test_xmlUCSIsCatSk(void) {
35791    int test_ret = 0;
35792
35793#ifdef LIBXML_UNICODE_ENABLED
35794    int mem_base;
35795    int ret_val;
35796    int code; /* UCS code point */
35797    int n_code;
35798
35799    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35800        mem_base = xmlMemBlocks();
35801        code = gen_int(n_code, 0);
35802
35803        ret_val = xmlUCSIsCatSk(code);
35804        desret_int(ret_val);
35805        call_tests++;
35806        des_int(n_code, code, 0);
35807        xmlResetLastError();
35808        if (mem_base != xmlMemBlocks()) {
35809            printf("Leak of %d blocks found in xmlUCSIsCatSk",
35810	           xmlMemBlocks() - mem_base);
35811	    test_ret++;
35812            printf(" %d", n_code);
35813            printf("\n");
35814        }
35815    }
35816    function_tests++;
35817#endif
35818
35819    return(test_ret);
35820}
35821
35822
35823static int
35824test_xmlUCSIsCatSm(void) {
35825    int test_ret = 0;
35826
35827#ifdef LIBXML_UNICODE_ENABLED
35828    int mem_base;
35829    int ret_val;
35830    int code; /* UCS code point */
35831    int n_code;
35832
35833    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35834        mem_base = xmlMemBlocks();
35835        code = gen_int(n_code, 0);
35836
35837        ret_val = xmlUCSIsCatSm(code);
35838        desret_int(ret_val);
35839        call_tests++;
35840        des_int(n_code, code, 0);
35841        xmlResetLastError();
35842        if (mem_base != xmlMemBlocks()) {
35843            printf("Leak of %d blocks found in xmlUCSIsCatSm",
35844	           xmlMemBlocks() - mem_base);
35845	    test_ret++;
35846            printf(" %d", n_code);
35847            printf("\n");
35848        }
35849    }
35850    function_tests++;
35851#endif
35852
35853    return(test_ret);
35854}
35855
35856
35857static int
35858test_xmlUCSIsCatSo(void) {
35859    int test_ret = 0;
35860
35861#ifdef LIBXML_UNICODE_ENABLED
35862    int mem_base;
35863    int ret_val;
35864    int code; /* UCS code point */
35865    int n_code;
35866
35867    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35868        mem_base = xmlMemBlocks();
35869        code = gen_int(n_code, 0);
35870
35871        ret_val = xmlUCSIsCatSo(code);
35872        desret_int(ret_val);
35873        call_tests++;
35874        des_int(n_code, code, 0);
35875        xmlResetLastError();
35876        if (mem_base != xmlMemBlocks()) {
35877            printf("Leak of %d blocks found in xmlUCSIsCatSo",
35878	           xmlMemBlocks() - mem_base);
35879	    test_ret++;
35880            printf(" %d", n_code);
35881            printf("\n");
35882        }
35883    }
35884    function_tests++;
35885#endif
35886
35887    return(test_ret);
35888}
35889
35890
35891static int
35892test_xmlUCSIsCatZ(void) {
35893    int test_ret = 0;
35894
35895#ifdef LIBXML_UNICODE_ENABLED
35896    int mem_base;
35897    int ret_val;
35898    int code; /* UCS code point */
35899    int n_code;
35900
35901    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35902        mem_base = xmlMemBlocks();
35903        code = gen_int(n_code, 0);
35904
35905        ret_val = xmlUCSIsCatZ(code);
35906        desret_int(ret_val);
35907        call_tests++;
35908        des_int(n_code, code, 0);
35909        xmlResetLastError();
35910        if (mem_base != xmlMemBlocks()) {
35911            printf("Leak of %d blocks found in xmlUCSIsCatZ",
35912	           xmlMemBlocks() - mem_base);
35913	    test_ret++;
35914            printf(" %d", n_code);
35915            printf("\n");
35916        }
35917    }
35918    function_tests++;
35919#endif
35920
35921    return(test_ret);
35922}
35923
35924
35925static int
35926test_xmlUCSIsCatZl(void) {
35927    int test_ret = 0;
35928
35929#ifdef LIBXML_UNICODE_ENABLED
35930    int mem_base;
35931    int ret_val;
35932    int code; /* UCS code point */
35933    int n_code;
35934
35935    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35936        mem_base = xmlMemBlocks();
35937        code = gen_int(n_code, 0);
35938
35939        ret_val = xmlUCSIsCatZl(code);
35940        desret_int(ret_val);
35941        call_tests++;
35942        des_int(n_code, code, 0);
35943        xmlResetLastError();
35944        if (mem_base != xmlMemBlocks()) {
35945            printf("Leak of %d blocks found in xmlUCSIsCatZl",
35946	           xmlMemBlocks() - mem_base);
35947	    test_ret++;
35948            printf(" %d", n_code);
35949            printf("\n");
35950        }
35951    }
35952    function_tests++;
35953#endif
35954
35955    return(test_ret);
35956}
35957
35958
35959static int
35960test_xmlUCSIsCatZp(void) {
35961    int test_ret = 0;
35962
35963#ifdef LIBXML_UNICODE_ENABLED
35964    int mem_base;
35965    int ret_val;
35966    int code; /* UCS code point */
35967    int n_code;
35968
35969    for (n_code = 0;n_code < gen_nb_int;n_code++) {
35970        mem_base = xmlMemBlocks();
35971        code = gen_int(n_code, 0);
35972
35973        ret_val = xmlUCSIsCatZp(code);
35974        desret_int(ret_val);
35975        call_tests++;
35976        des_int(n_code, code, 0);
35977        xmlResetLastError();
35978        if (mem_base != xmlMemBlocks()) {
35979            printf("Leak of %d blocks found in xmlUCSIsCatZp",
35980	           xmlMemBlocks() - mem_base);
35981	    test_ret++;
35982            printf(" %d", n_code);
35983            printf("\n");
35984        }
35985    }
35986    function_tests++;
35987#endif
35988
35989    return(test_ret);
35990}
35991
35992
35993static int
35994test_xmlUCSIsCatZs(void) {
35995    int test_ret = 0;
35996
35997#ifdef LIBXML_UNICODE_ENABLED
35998    int mem_base;
35999    int ret_val;
36000    int code; /* UCS code point */
36001    int n_code;
36002
36003    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36004        mem_base = xmlMemBlocks();
36005        code = gen_int(n_code, 0);
36006
36007        ret_val = xmlUCSIsCatZs(code);
36008        desret_int(ret_val);
36009        call_tests++;
36010        des_int(n_code, code, 0);
36011        xmlResetLastError();
36012        if (mem_base != xmlMemBlocks()) {
36013            printf("Leak of %d blocks found in xmlUCSIsCatZs",
36014	           xmlMemBlocks() - mem_base);
36015	    test_ret++;
36016            printf(" %d", n_code);
36017            printf("\n");
36018        }
36019    }
36020    function_tests++;
36021#endif
36022
36023    return(test_ret);
36024}
36025
36026
36027static int
36028test_xmlUCSIsCherokee(void) {
36029    int test_ret = 0;
36030
36031#ifdef LIBXML_UNICODE_ENABLED
36032    int mem_base;
36033    int ret_val;
36034    int code; /* UCS code point */
36035    int n_code;
36036
36037    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36038        mem_base = xmlMemBlocks();
36039        code = gen_int(n_code, 0);
36040
36041        ret_val = xmlUCSIsCherokee(code);
36042        desret_int(ret_val);
36043        call_tests++;
36044        des_int(n_code, code, 0);
36045        xmlResetLastError();
36046        if (mem_base != xmlMemBlocks()) {
36047            printf("Leak of %d blocks found in xmlUCSIsCherokee",
36048	           xmlMemBlocks() - mem_base);
36049	    test_ret++;
36050            printf(" %d", n_code);
36051            printf("\n");
36052        }
36053    }
36054    function_tests++;
36055#endif
36056
36057    return(test_ret);
36058}
36059
36060
36061static int
36062test_xmlUCSIsCombiningDiacriticalMarks(void) {
36063    int test_ret = 0;
36064
36065#ifdef LIBXML_UNICODE_ENABLED
36066    int mem_base;
36067    int ret_val;
36068    int code; /* UCS code point */
36069    int n_code;
36070
36071    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36072        mem_base = xmlMemBlocks();
36073        code = gen_int(n_code, 0);
36074
36075        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
36076        desret_int(ret_val);
36077        call_tests++;
36078        des_int(n_code, code, 0);
36079        xmlResetLastError();
36080        if (mem_base != xmlMemBlocks()) {
36081            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
36082	           xmlMemBlocks() - mem_base);
36083	    test_ret++;
36084            printf(" %d", n_code);
36085            printf("\n");
36086        }
36087    }
36088    function_tests++;
36089#endif
36090
36091    return(test_ret);
36092}
36093
36094
36095static int
36096test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
36097    int test_ret = 0;
36098
36099#ifdef LIBXML_UNICODE_ENABLED
36100    int mem_base;
36101    int ret_val;
36102    int code; /* UCS code point */
36103    int n_code;
36104
36105    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36106        mem_base = xmlMemBlocks();
36107        code = gen_int(n_code, 0);
36108
36109        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
36110        desret_int(ret_val);
36111        call_tests++;
36112        des_int(n_code, code, 0);
36113        xmlResetLastError();
36114        if (mem_base != xmlMemBlocks()) {
36115            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
36116	           xmlMemBlocks() - mem_base);
36117	    test_ret++;
36118            printf(" %d", n_code);
36119            printf("\n");
36120        }
36121    }
36122    function_tests++;
36123#endif
36124
36125    return(test_ret);
36126}
36127
36128
36129static int
36130test_xmlUCSIsCombiningHalfMarks(void) {
36131    int test_ret = 0;
36132
36133#ifdef LIBXML_UNICODE_ENABLED
36134    int mem_base;
36135    int ret_val;
36136    int code; /* UCS code point */
36137    int n_code;
36138
36139    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36140        mem_base = xmlMemBlocks();
36141        code = gen_int(n_code, 0);
36142
36143        ret_val = xmlUCSIsCombiningHalfMarks(code);
36144        desret_int(ret_val);
36145        call_tests++;
36146        des_int(n_code, code, 0);
36147        xmlResetLastError();
36148        if (mem_base != xmlMemBlocks()) {
36149            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
36150	           xmlMemBlocks() - mem_base);
36151	    test_ret++;
36152            printf(" %d", n_code);
36153            printf("\n");
36154        }
36155    }
36156    function_tests++;
36157#endif
36158
36159    return(test_ret);
36160}
36161
36162
36163static int
36164test_xmlUCSIsCombiningMarksforSymbols(void) {
36165    int test_ret = 0;
36166
36167#ifdef LIBXML_UNICODE_ENABLED
36168    int mem_base;
36169    int ret_val;
36170    int code; /* UCS code point */
36171    int n_code;
36172
36173    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36174        mem_base = xmlMemBlocks();
36175        code = gen_int(n_code, 0);
36176
36177        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
36178        desret_int(ret_val);
36179        call_tests++;
36180        des_int(n_code, code, 0);
36181        xmlResetLastError();
36182        if (mem_base != xmlMemBlocks()) {
36183            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
36184	           xmlMemBlocks() - mem_base);
36185	    test_ret++;
36186            printf(" %d", n_code);
36187            printf("\n");
36188        }
36189    }
36190    function_tests++;
36191#endif
36192
36193    return(test_ret);
36194}
36195
36196
36197static int
36198test_xmlUCSIsControlPictures(void) {
36199    int test_ret = 0;
36200
36201#ifdef LIBXML_UNICODE_ENABLED
36202    int mem_base;
36203    int ret_val;
36204    int code; /* UCS code point */
36205    int n_code;
36206
36207    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36208        mem_base = xmlMemBlocks();
36209        code = gen_int(n_code, 0);
36210
36211        ret_val = xmlUCSIsControlPictures(code);
36212        desret_int(ret_val);
36213        call_tests++;
36214        des_int(n_code, code, 0);
36215        xmlResetLastError();
36216        if (mem_base != xmlMemBlocks()) {
36217            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
36218	           xmlMemBlocks() - mem_base);
36219	    test_ret++;
36220            printf(" %d", n_code);
36221            printf("\n");
36222        }
36223    }
36224    function_tests++;
36225#endif
36226
36227    return(test_ret);
36228}
36229
36230
36231static int
36232test_xmlUCSIsCurrencySymbols(void) {
36233    int test_ret = 0;
36234
36235#ifdef LIBXML_UNICODE_ENABLED
36236    int mem_base;
36237    int ret_val;
36238    int code; /* UCS code point */
36239    int n_code;
36240
36241    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36242        mem_base = xmlMemBlocks();
36243        code = gen_int(n_code, 0);
36244
36245        ret_val = xmlUCSIsCurrencySymbols(code);
36246        desret_int(ret_val);
36247        call_tests++;
36248        des_int(n_code, code, 0);
36249        xmlResetLastError();
36250        if (mem_base != xmlMemBlocks()) {
36251            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
36252	           xmlMemBlocks() - mem_base);
36253	    test_ret++;
36254            printf(" %d", n_code);
36255            printf("\n");
36256        }
36257    }
36258    function_tests++;
36259#endif
36260
36261    return(test_ret);
36262}
36263
36264
36265static int
36266test_xmlUCSIsCypriotSyllabary(void) {
36267    int test_ret = 0;
36268
36269#ifdef LIBXML_UNICODE_ENABLED
36270    int mem_base;
36271    int ret_val;
36272    int code; /* UCS code point */
36273    int n_code;
36274
36275    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36276        mem_base = xmlMemBlocks();
36277        code = gen_int(n_code, 0);
36278
36279        ret_val = xmlUCSIsCypriotSyllabary(code);
36280        desret_int(ret_val);
36281        call_tests++;
36282        des_int(n_code, code, 0);
36283        xmlResetLastError();
36284        if (mem_base != xmlMemBlocks()) {
36285            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
36286	           xmlMemBlocks() - mem_base);
36287	    test_ret++;
36288            printf(" %d", n_code);
36289            printf("\n");
36290        }
36291    }
36292    function_tests++;
36293#endif
36294
36295    return(test_ret);
36296}
36297
36298
36299static int
36300test_xmlUCSIsCyrillic(void) {
36301    int test_ret = 0;
36302
36303#ifdef LIBXML_UNICODE_ENABLED
36304    int mem_base;
36305    int ret_val;
36306    int code; /* UCS code point */
36307    int n_code;
36308
36309    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36310        mem_base = xmlMemBlocks();
36311        code = gen_int(n_code, 0);
36312
36313        ret_val = xmlUCSIsCyrillic(code);
36314        desret_int(ret_val);
36315        call_tests++;
36316        des_int(n_code, code, 0);
36317        xmlResetLastError();
36318        if (mem_base != xmlMemBlocks()) {
36319            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
36320	           xmlMemBlocks() - mem_base);
36321	    test_ret++;
36322            printf(" %d", n_code);
36323            printf("\n");
36324        }
36325    }
36326    function_tests++;
36327#endif
36328
36329    return(test_ret);
36330}
36331
36332
36333static int
36334test_xmlUCSIsCyrillicSupplement(void) {
36335    int test_ret = 0;
36336
36337#ifdef LIBXML_UNICODE_ENABLED
36338    int mem_base;
36339    int ret_val;
36340    int code; /* UCS code point */
36341    int n_code;
36342
36343    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36344        mem_base = xmlMemBlocks();
36345        code = gen_int(n_code, 0);
36346
36347        ret_val = xmlUCSIsCyrillicSupplement(code);
36348        desret_int(ret_val);
36349        call_tests++;
36350        des_int(n_code, code, 0);
36351        xmlResetLastError();
36352        if (mem_base != xmlMemBlocks()) {
36353            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
36354	           xmlMemBlocks() - mem_base);
36355	    test_ret++;
36356            printf(" %d", n_code);
36357            printf("\n");
36358        }
36359    }
36360    function_tests++;
36361#endif
36362
36363    return(test_ret);
36364}
36365
36366
36367static int
36368test_xmlUCSIsDeseret(void) {
36369    int test_ret = 0;
36370
36371#ifdef LIBXML_UNICODE_ENABLED
36372    int mem_base;
36373    int ret_val;
36374    int code; /* UCS code point */
36375    int n_code;
36376
36377    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36378        mem_base = xmlMemBlocks();
36379        code = gen_int(n_code, 0);
36380
36381        ret_val = xmlUCSIsDeseret(code);
36382        desret_int(ret_val);
36383        call_tests++;
36384        des_int(n_code, code, 0);
36385        xmlResetLastError();
36386        if (mem_base != xmlMemBlocks()) {
36387            printf("Leak of %d blocks found in xmlUCSIsDeseret",
36388	           xmlMemBlocks() - mem_base);
36389	    test_ret++;
36390            printf(" %d", n_code);
36391            printf("\n");
36392        }
36393    }
36394    function_tests++;
36395#endif
36396
36397    return(test_ret);
36398}
36399
36400
36401static int
36402test_xmlUCSIsDevanagari(void) {
36403    int test_ret = 0;
36404
36405#ifdef LIBXML_UNICODE_ENABLED
36406    int mem_base;
36407    int ret_val;
36408    int code; /* UCS code point */
36409    int n_code;
36410
36411    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36412        mem_base = xmlMemBlocks();
36413        code = gen_int(n_code, 0);
36414
36415        ret_val = xmlUCSIsDevanagari(code);
36416        desret_int(ret_val);
36417        call_tests++;
36418        des_int(n_code, code, 0);
36419        xmlResetLastError();
36420        if (mem_base != xmlMemBlocks()) {
36421            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
36422	           xmlMemBlocks() - mem_base);
36423	    test_ret++;
36424            printf(" %d", n_code);
36425            printf("\n");
36426        }
36427    }
36428    function_tests++;
36429#endif
36430
36431    return(test_ret);
36432}
36433
36434
36435static int
36436test_xmlUCSIsDingbats(void) {
36437    int test_ret = 0;
36438
36439#ifdef LIBXML_UNICODE_ENABLED
36440    int mem_base;
36441    int ret_val;
36442    int code; /* UCS code point */
36443    int n_code;
36444
36445    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36446        mem_base = xmlMemBlocks();
36447        code = gen_int(n_code, 0);
36448
36449        ret_val = xmlUCSIsDingbats(code);
36450        desret_int(ret_val);
36451        call_tests++;
36452        des_int(n_code, code, 0);
36453        xmlResetLastError();
36454        if (mem_base != xmlMemBlocks()) {
36455            printf("Leak of %d blocks found in xmlUCSIsDingbats",
36456	           xmlMemBlocks() - mem_base);
36457	    test_ret++;
36458            printf(" %d", n_code);
36459            printf("\n");
36460        }
36461    }
36462    function_tests++;
36463#endif
36464
36465    return(test_ret);
36466}
36467
36468
36469static int
36470test_xmlUCSIsEnclosedAlphanumerics(void) {
36471    int test_ret = 0;
36472
36473#ifdef LIBXML_UNICODE_ENABLED
36474    int mem_base;
36475    int ret_val;
36476    int code; /* UCS code point */
36477    int n_code;
36478
36479    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36480        mem_base = xmlMemBlocks();
36481        code = gen_int(n_code, 0);
36482
36483        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
36484        desret_int(ret_val);
36485        call_tests++;
36486        des_int(n_code, code, 0);
36487        xmlResetLastError();
36488        if (mem_base != xmlMemBlocks()) {
36489            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
36490	           xmlMemBlocks() - mem_base);
36491	    test_ret++;
36492            printf(" %d", n_code);
36493            printf("\n");
36494        }
36495    }
36496    function_tests++;
36497#endif
36498
36499    return(test_ret);
36500}
36501
36502
36503static int
36504test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
36505    int test_ret = 0;
36506
36507#ifdef LIBXML_UNICODE_ENABLED
36508    int mem_base;
36509    int ret_val;
36510    int code; /* UCS code point */
36511    int n_code;
36512
36513    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36514        mem_base = xmlMemBlocks();
36515        code = gen_int(n_code, 0);
36516
36517        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
36518        desret_int(ret_val);
36519        call_tests++;
36520        des_int(n_code, code, 0);
36521        xmlResetLastError();
36522        if (mem_base != xmlMemBlocks()) {
36523            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
36524	           xmlMemBlocks() - mem_base);
36525	    test_ret++;
36526            printf(" %d", n_code);
36527            printf("\n");
36528        }
36529    }
36530    function_tests++;
36531#endif
36532
36533    return(test_ret);
36534}
36535
36536
36537static int
36538test_xmlUCSIsEthiopic(void) {
36539    int test_ret = 0;
36540
36541#ifdef LIBXML_UNICODE_ENABLED
36542    int mem_base;
36543    int ret_val;
36544    int code; /* UCS code point */
36545    int n_code;
36546
36547    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36548        mem_base = xmlMemBlocks();
36549        code = gen_int(n_code, 0);
36550
36551        ret_val = xmlUCSIsEthiopic(code);
36552        desret_int(ret_val);
36553        call_tests++;
36554        des_int(n_code, code, 0);
36555        xmlResetLastError();
36556        if (mem_base != xmlMemBlocks()) {
36557            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
36558	           xmlMemBlocks() - mem_base);
36559	    test_ret++;
36560            printf(" %d", n_code);
36561            printf("\n");
36562        }
36563    }
36564    function_tests++;
36565#endif
36566
36567    return(test_ret);
36568}
36569
36570
36571static int
36572test_xmlUCSIsGeneralPunctuation(void) {
36573    int test_ret = 0;
36574
36575#ifdef LIBXML_UNICODE_ENABLED
36576    int mem_base;
36577    int ret_val;
36578    int code; /* UCS code point */
36579    int n_code;
36580
36581    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36582        mem_base = xmlMemBlocks();
36583        code = gen_int(n_code, 0);
36584
36585        ret_val = xmlUCSIsGeneralPunctuation(code);
36586        desret_int(ret_val);
36587        call_tests++;
36588        des_int(n_code, code, 0);
36589        xmlResetLastError();
36590        if (mem_base != xmlMemBlocks()) {
36591            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
36592	           xmlMemBlocks() - mem_base);
36593	    test_ret++;
36594            printf(" %d", n_code);
36595            printf("\n");
36596        }
36597    }
36598    function_tests++;
36599#endif
36600
36601    return(test_ret);
36602}
36603
36604
36605static int
36606test_xmlUCSIsGeometricShapes(void) {
36607    int test_ret = 0;
36608
36609#ifdef LIBXML_UNICODE_ENABLED
36610    int mem_base;
36611    int ret_val;
36612    int code; /* UCS code point */
36613    int n_code;
36614
36615    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36616        mem_base = xmlMemBlocks();
36617        code = gen_int(n_code, 0);
36618
36619        ret_val = xmlUCSIsGeometricShapes(code);
36620        desret_int(ret_val);
36621        call_tests++;
36622        des_int(n_code, code, 0);
36623        xmlResetLastError();
36624        if (mem_base != xmlMemBlocks()) {
36625            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
36626	           xmlMemBlocks() - mem_base);
36627	    test_ret++;
36628            printf(" %d", n_code);
36629            printf("\n");
36630        }
36631    }
36632    function_tests++;
36633#endif
36634
36635    return(test_ret);
36636}
36637
36638
36639static int
36640test_xmlUCSIsGeorgian(void) {
36641    int test_ret = 0;
36642
36643#ifdef LIBXML_UNICODE_ENABLED
36644    int mem_base;
36645    int ret_val;
36646    int code; /* UCS code point */
36647    int n_code;
36648
36649    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36650        mem_base = xmlMemBlocks();
36651        code = gen_int(n_code, 0);
36652
36653        ret_val = xmlUCSIsGeorgian(code);
36654        desret_int(ret_val);
36655        call_tests++;
36656        des_int(n_code, code, 0);
36657        xmlResetLastError();
36658        if (mem_base != xmlMemBlocks()) {
36659            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
36660	           xmlMemBlocks() - mem_base);
36661	    test_ret++;
36662            printf(" %d", n_code);
36663            printf("\n");
36664        }
36665    }
36666    function_tests++;
36667#endif
36668
36669    return(test_ret);
36670}
36671
36672
36673static int
36674test_xmlUCSIsGothic(void) {
36675    int test_ret = 0;
36676
36677#ifdef LIBXML_UNICODE_ENABLED
36678    int mem_base;
36679    int ret_val;
36680    int code; /* UCS code point */
36681    int n_code;
36682
36683    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36684        mem_base = xmlMemBlocks();
36685        code = gen_int(n_code, 0);
36686
36687        ret_val = xmlUCSIsGothic(code);
36688        desret_int(ret_val);
36689        call_tests++;
36690        des_int(n_code, code, 0);
36691        xmlResetLastError();
36692        if (mem_base != xmlMemBlocks()) {
36693            printf("Leak of %d blocks found in xmlUCSIsGothic",
36694	           xmlMemBlocks() - mem_base);
36695	    test_ret++;
36696            printf(" %d", n_code);
36697            printf("\n");
36698        }
36699    }
36700    function_tests++;
36701#endif
36702
36703    return(test_ret);
36704}
36705
36706
36707static int
36708test_xmlUCSIsGreek(void) {
36709    int test_ret = 0;
36710
36711#ifdef LIBXML_UNICODE_ENABLED
36712    int mem_base;
36713    int ret_val;
36714    int code; /* UCS code point */
36715    int n_code;
36716
36717    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36718        mem_base = xmlMemBlocks();
36719        code = gen_int(n_code, 0);
36720
36721        ret_val = xmlUCSIsGreek(code);
36722        desret_int(ret_val);
36723        call_tests++;
36724        des_int(n_code, code, 0);
36725        xmlResetLastError();
36726        if (mem_base != xmlMemBlocks()) {
36727            printf("Leak of %d blocks found in xmlUCSIsGreek",
36728	           xmlMemBlocks() - mem_base);
36729	    test_ret++;
36730            printf(" %d", n_code);
36731            printf("\n");
36732        }
36733    }
36734    function_tests++;
36735#endif
36736
36737    return(test_ret);
36738}
36739
36740
36741static int
36742test_xmlUCSIsGreekExtended(void) {
36743    int test_ret = 0;
36744
36745#ifdef LIBXML_UNICODE_ENABLED
36746    int mem_base;
36747    int ret_val;
36748    int code; /* UCS code point */
36749    int n_code;
36750
36751    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36752        mem_base = xmlMemBlocks();
36753        code = gen_int(n_code, 0);
36754
36755        ret_val = xmlUCSIsGreekExtended(code);
36756        desret_int(ret_val);
36757        call_tests++;
36758        des_int(n_code, code, 0);
36759        xmlResetLastError();
36760        if (mem_base != xmlMemBlocks()) {
36761            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
36762	           xmlMemBlocks() - mem_base);
36763	    test_ret++;
36764            printf(" %d", n_code);
36765            printf("\n");
36766        }
36767    }
36768    function_tests++;
36769#endif
36770
36771    return(test_ret);
36772}
36773
36774
36775static int
36776test_xmlUCSIsGreekandCoptic(void) {
36777    int test_ret = 0;
36778
36779#ifdef LIBXML_UNICODE_ENABLED
36780    int mem_base;
36781    int ret_val;
36782    int code; /* UCS code point */
36783    int n_code;
36784
36785    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36786        mem_base = xmlMemBlocks();
36787        code = gen_int(n_code, 0);
36788
36789        ret_val = xmlUCSIsGreekandCoptic(code);
36790        desret_int(ret_val);
36791        call_tests++;
36792        des_int(n_code, code, 0);
36793        xmlResetLastError();
36794        if (mem_base != xmlMemBlocks()) {
36795            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
36796	           xmlMemBlocks() - mem_base);
36797	    test_ret++;
36798            printf(" %d", n_code);
36799            printf("\n");
36800        }
36801    }
36802    function_tests++;
36803#endif
36804
36805    return(test_ret);
36806}
36807
36808
36809static int
36810test_xmlUCSIsGujarati(void) {
36811    int test_ret = 0;
36812
36813#ifdef LIBXML_UNICODE_ENABLED
36814    int mem_base;
36815    int ret_val;
36816    int code; /* UCS code point */
36817    int n_code;
36818
36819    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36820        mem_base = xmlMemBlocks();
36821        code = gen_int(n_code, 0);
36822
36823        ret_val = xmlUCSIsGujarati(code);
36824        desret_int(ret_val);
36825        call_tests++;
36826        des_int(n_code, code, 0);
36827        xmlResetLastError();
36828        if (mem_base != xmlMemBlocks()) {
36829            printf("Leak of %d blocks found in xmlUCSIsGujarati",
36830	           xmlMemBlocks() - mem_base);
36831	    test_ret++;
36832            printf(" %d", n_code);
36833            printf("\n");
36834        }
36835    }
36836    function_tests++;
36837#endif
36838
36839    return(test_ret);
36840}
36841
36842
36843static int
36844test_xmlUCSIsGurmukhi(void) {
36845    int test_ret = 0;
36846
36847#ifdef LIBXML_UNICODE_ENABLED
36848    int mem_base;
36849    int ret_val;
36850    int code; /* UCS code point */
36851    int n_code;
36852
36853    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36854        mem_base = xmlMemBlocks();
36855        code = gen_int(n_code, 0);
36856
36857        ret_val = xmlUCSIsGurmukhi(code);
36858        desret_int(ret_val);
36859        call_tests++;
36860        des_int(n_code, code, 0);
36861        xmlResetLastError();
36862        if (mem_base != xmlMemBlocks()) {
36863            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
36864	           xmlMemBlocks() - mem_base);
36865	    test_ret++;
36866            printf(" %d", n_code);
36867            printf("\n");
36868        }
36869    }
36870    function_tests++;
36871#endif
36872
36873    return(test_ret);
36874}
36875
36876
36877static int
36878test_xmlUCSIsHalfwidthandFullwidthForms(void) {
36879    int test_ret = 0;
36880
36881#ifdef LIBXML_UNICODE_ENABLED
36882    int mem_base;
36883    int ret_val;
36884    int code; /* UCS code point */
36885    int n_code;
36886
36887    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36888        mem_base = xmlMemBlocks();
36889        code = gen_int(n_code, 0);
36890
36891        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
36892        desret_int(ret_val);
36893        call_tests++;
36894        des_int(n_code, code, 0);
36895        xmlResetLastError();
36896        if (mem_base != xmlMemBlocks()) {
36897            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
36898	           xmlMemBlocks() - mem_base);
36899	    test_ret++;
36900            printf(" %d", n_code);
36901            printf("\n");
36902        }
36903    }
36904    function_tests++;
36905#endif
36906
36907    return(test_ret);
36908}
36909
36910
36911static int
36912test_xmlUCSIsHangulCompatibilityJamo(void) {
36913    int test_ret = 0;
36914
36915#ifdef LIBXML_UNICODE_ENABLED
36916    int mem_base;
36917    int ret_val;
36918    int code; /* UCS code point */
36919    int n_code;
36920
36921    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36922        mem_base = xmlMemBlocks();
36923        code = gen_int(n_code, 0);
36924
36925        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
36926        desret_int(ret_val);
36927        call_tests++;
36928        des_int(n_code, code, 0);
36929        xmlResetLastError();
36930        if (mem_base != xmlMemBlocks()) {
36931            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
36932	           xmlMemBlocks() - mem_base);
36933	    test_ret++;
36934            printf(" %d", n_code);
36935            printf("\n");
36936        }
36937    }
36938    function_tests++;
36939#endif
36940
36941    return(test_ret);
36942}
36943
36944
36945static int
36946test_xmlUCSIsHangulJamo(void) {
36947    int test_ret = 0;
36948
36949#ifdef LIBXML_UNICODE_ENABLED
36950    int mem_base;
36951    int ret_val;
36952    int code; /* UCS code point */
36953    int n_code;
36954
36955    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36956        mem_base = xmlMemBlocks();
36957        code = gen_int(n_code, 0);
36958
36959        ret_val = xmlUCSIsHangulJamo(code);
36960        desret_int(ret_val);
36961        call_tests++;
36962        des_int(n_code, code, 0);
36963        xmlResetLastError();
36964        if (mem_base != xmlMemBlocks()) {
36965            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
36966	           xmlMemBlocks() - mem_base);
36967	    test_ret++;
36968            printf(" %d", n_code);
36969            printf("\n");
36970        }
36971    }
36972    function_tests++;
36973#endif
36974
36975    return(test_ret);
36976}
36977
36978
36979static int
36980test_xmlUCSIsHangulSyllables(void) {
36981    int test_ret = 0;
36982
36983#ifdef LIBXML_UNICODE_ENABLED
36984    int mem_base;
36985    int ret_val;
36986    int code; /* UCS code point */
36987    int n_code;
36988
36989    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36990        mem_base = xmlMemBlocks();
36991        code = gen_int(n_code, 0);
36992
36993        ret_val = xmlUCSIsHangulSyllables(code);
36994        desret_int(ret_val);
36995        call_tests++;
36996        des_int(n_code, code, 0);
36997        xmlResetLastError();
36998        if (mem_base != xmlMemBlocks()) {
36999            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
37000	           xmlMemBlocks() - mem_base);
37001	    test_ret++;
37002            printf(" %d", n_code);
37003            printf("\n");
37004        }
37005    }
37006    function_tests++;
37007#endif
37008
37009    return(test_ret);
37010}
37011
37012
37013static int
37014test_xmlUCSIsHanunoo(void) {
37015    int test_ret = 0;
37016
37017#ifdef LIBXML_UNICODE_ENABLED
37018    int mem_base;
37019    int ret_val;
37020    int code; /* UCS code point */
37021    int n_code;
37022
37023    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37024        mem_base = xmlMemBlocks();
37025        code = gen_int(n_code, 0);
37026
37027        ret_val = xmlUCSIsHanunoo(code);
37028        desret_int(ret_val);
37029        call_tests++;
37030        des_int(n_code, code, 0);
37031        xmlResetLastError();
37032        if (mem_base != xmlMemBlocks()) {
37033            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
37034	           xmlMemBlocks() - mem_base);
37035	    test_ret++;
37036            printf(" %d", n_code);
37037            printf("\n");
37038        }
37039    }
37040    function_tests++;
37041#endif
37042
37043    return(test_ret);
37044}
37045
37046
37047static int
37048test_xmlUCSIsHebrew(void) {
37049    int test_ret = 0;
37050
37051#ifdef LIBXML_UNICODE_ENABLED
37052    int mem_base;
37053    int ret_val;
37054    int code; /* UCS code point */
37055    int n_code;
37056
37057    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37058        mem_base = xmlMemBlocks();
37059        code = gen_int(n_code, 0);
37060
37061        ret_val = xmlUCSIsHebrew(code);
37062        desret_int(ret_val);
37063        call_tests++;
37064        des_int(n_code, code, 0);
37065        xmlResetLastError();
37066        if (mem_base != xmlMemBlocks()) {
37067            printf("Leak of %d blocks found in xmlUCSIsHebrew",
37068	           xmlMemBlocks() - mem_base);
37069	    test_ret++;
37070            printf(" %d", n_code);
37071            printf("\n");
37072        }
37073    }
37074    function_tests++;
37075#endif
37076
37077    return(test_ret);
37078}
37079
37080
37081static int
37082test_xmlUCSIsHighPrivateUseSurrogates(void) {
37083    int test_ret = 0;
37084
37085#ifdef LIBXML_UNICODE_ENABLED
37086    int mem_base;
37087    int ret_val;
37088    int code; /* UCS code point */
37089    int n_code;
37090
37091    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37092        mem_base = xmlMemBlocks();
37093        code = gen_int(n_code, 0);
37094
37095        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
37096        desret_int(ret_val);
37097        call_tests++;
37098        des_int(n_code, code, 0);
37099        xmlResetLastError();
37100        if (mem_base != xmlMemBlocks()) {
37101            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
37102	           xmlMemBlocks() - mem_base);
37103	    test_ret++;
37104            printf(" %d", n_code);
37105            printf("\n");
37106        }
37107    }
37108    function_tests++;
37109#endif
37110
37111    return(test_ret);
37112}
37113
37114
37115static int
37116test_xmlUCSIsHighSurrogates(void) {
37117    int test_ret = 0;
37118
37119#ifdef LIBXML_UNICODE_ENABLED
37120    int mem_base;
37121    int ret_val;
37122    int code; /* UCS code point */
37123    int n_code;
37124
37125    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37126        mem_base = xmlMemBlocks();
37127        code = gen_int(n_code, 0);
37128
37129        ret_val = xmlUCSIsHighSurrogates(code);
37130        desret_int(ret_val);
37131        call_tests++;
37132        des_int(n_code, code, 0);
37133        xmlResetLastError();
37134        if (mem_base != xmlMemBlocks()) {
37135            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
37136	           xmlMemBlocks() - mem_base);
37137	    test_ret++;
37138            printf(" %d", n_code);
37139            printf("\n");
37140        }
37141    }
37142    function_tests++;
37143#endif
37144
37145    return(test_ret);
37146}
37147
37148
37149static int
37150test_xmlUCSIsHiragana(void) {
37151    int test_ret = 0;
37152
37153#ifdef LIBXML_UNICODE_ENABLED
37154    int mem_base;
37155    int ret_val;
37156    int code; /* UCS code point */
37157    int n_code;
37158
37159    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37160        mem_base = xmlMemBlocks();
37161        code = gen_int(n_code, 0);
37162
37163        ret_val = xmlUCSIsHiragana(code);
37164        desret_int(ret_val);
37165        call_tests++;
37166        des_int(n_code, code, 0);
37167        xmlResetLastError();
37168        if (mem_base != xmlMemBlocks()) {
37169            printf("Leak of %d blocks found in xmlUCSIsHiragana",
37170	           xmlMemBlocks() - mem_base);
37171	    test_ret++;
37172            printf(" %d", n_code);
37173            printf("\n");
37174        }
37175    }
37176    function_tests++;
37177#endif
37178
37179    return(test_ret);
37180}
37181
37182
37183static int
37184test_xmlUCSIsIPAExtensions(void) {
37185    int test_ret = 0;
37186
37187#ifdef LIBXML_UNICODE_ENABLED
37188    int mem_base;
37189    int ret_val;
37190    int code; /* UCS code point */
37191    int n_code;
37192
37193    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37194        mem_base = xmlMemBlocks();
37195        code = gen_int(n_code, 0);
37196
37197        ret_val = xmlUCSIsIPAExtensions(code);
37198        desret_int(ret_val);
37199        call_tests++;
37200        des_int(n_code, code, 0);
37201        xmlResetLastError();
37202        if (mem_base != xmlMemBlocks()) {
37203            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
37204	           xmlMemBlocks() - mem_base);
37205	    test_ret++;
37206            printf(" %d", n_code);
37207            printf("\n");
37208        }
37209    }
37210    function_tests++;
37211#endif
37212
37213    return(test_ret);
37214}
37215
37216
37217static int
37218test_xmlUCSIsIdeographicDescriptionCharacters(void) {
37219    int test_ret = 0;
37220
37221#ifdef LIBXML_UNICODE_ENABLED
37222    int mem_base;
37223    int ret_val;
37224    int code; /* UCS code point */
37225    int n_code;
37226
37227    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37228        mem_base = xmlMemBlocks();
37229        code = gen_int(n_code, 0);
37230
37231        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
37232        desret_int(ret_val);
37233        call_tests++;
37234        des_int(n_code, code, 0);
37235        xmlResetLastError();
37236        if (mem_base != xmlMemBlocks()) {
37237            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
37238	           xmlMemBlocks() - mem_base);
37239	    test_ret++;
37240            printf(" %d", n_code);
37241            printf("\n");
37242        }
37243    }
37244    function_tests++;
37245#endif
37246
37247    return(test_ret);
37248}
37249
37250
37251static int
37252test_xmlUCSIsKanbun(void) {
37253    int test_ret = 0;
37254
37255#ifdef LIBXML_UNICODE_ENABLED
37256    int mem_base;
37257    int ret_val;
37258    int code; /* UCS code point */
37259    int n_code;
37260
37261    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37262        mem_base = xmlMemBlocks();
37263        code = gen_int(n_code, 0);
37264
37265        ret_val = xmlUCSIsKanbun(code);
37266        desret_int(ret_val);
37267        call_tests++;
37268        des_int(n_code, code, 0);
37269        xmlResetLastError();
37270        if (mem_base != xmlMemBlocks()) {
37271            printf("Leak of %d blocks found in xmlUCSIsKanbun",
37272	           xmlMemBlocks() - mem_base);
37273	    test_ret++;
37274            printf(" %d", n_code);
37275            printf("\n");
37276        }
37277    }
37278    function_tests++;
37279#endif
37280
37281    return(test_ret);
37282}
37283
37284
37285static int
37286test_xmlUCSIsKangxiRadicals(void) {
37287    int test_ret = 0;
37288
37289#ifdef LIBXML_UNICODE_ENABLED
37290    int mem_base;
37291    int ret_val;
37292    int code; /* UCS code point */
37293    int n_code;
37294
37295    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37296        mem_base = xmlMemBlocks();
37297        code = gen_int(n_code, 0);
37298
37299        ret_val = xmlUCSIsKangxiRadicals(code);
37300        desret_int(ret_val);
37301        call_tests++;
37302        des_int(n_code, code, 0);
37303        xmlResetLastError();
37304        if (mem_base != xmlMemBlocks()) {
37305            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
37306	           xmlMemBlocks() - mem_base);
37307	    test_ret++;
37308            printf(" %d", n_code);
37309            printf("\n");
37310        }
37311    }
37312    function_tests++;
37313#endif
37314
37315    return(test_ret);
37316}
37317
37318
37319static int
37320test_xmlUCSIsKannada(void) {
37321    int test_ret = 0;
37322
37323#ifdef LIBXML_UNICODE_ENABLED
37324    int mem_base;
37325    int ret_val;
37326    int code; /* UCS code point */
37327    int n_code;
37328
37329    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37330        mem_base = xmlMemBlocks();
37331        code = gen_int(n_code, 0);
37332
37333        ret_val = xmlUCSIsKannada(code);
37334        desret_int(ret_val);
37335        call_tests++;
37336        des_int(n_code, code, 0);
37337        xmlResetLastError();
37338        if (mem_base != xmlMemBlocks()) {
37339            printf("Leak of %d blocks found in xmlUCSIsKannada",
37340	           xmlMemBlocks() - mem_base);
37341	    test_ret++;
37342            printf(" %d", n_code);
37343            printf("\n");
37344        }
37345    }
37346    function_tests++;
37347#endif
37348
37349    return(test_ret);
37350}
37351
37352
37353static int
37354test_xmlUCSIsKatakana(void) {
37355    int test_ret = 0;
37356
37357#ifdef LIBXML_UNICODE_ENABLED
37358    int mem_base;
37359    int ret_val;
37360    int code; /* UCS code point */
37361    int n_code;
37362
37363    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37364        mem_base = xmlMemBlocks();
37365        code = gen_int(n_code, 0);
37366
37367        ret_val = xmlUCSIsKatakana(code);
37368        desret_int(ret_val);
37369        call_tests++;
37370        des_int(n_code, code, 0);
37371        xmlResetLastError();
37372        if (mem_base != xmlMemBlocks()) {
37373            printf("Leak of %d blocks found in xmlUCSIsKatakana",
37374	           xmlMemBlocks() - mem_base);
37375	    test_ret++;
37376            printf(" %d", n_code);
37377            printf("\n");
37378        }
37379    }
37380    function_tests++;
37381#endif
37382
37383    return(test_ret);
37384}
37385
37386
37387static int
37388test_xmlUCSIsKatakanaPhoneticExtensions(void) {
37389    int test_ret = 0;
37390
37391#ifdef LIBXML_UNICODE_ENABLED
37392    int mem_base;
37393    int ret_val;
37394    int code; /* UCS code point */
37395    int n_code;
37396
37397    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37398        mem_base = xmlMemBlocks();
37399        code = gen_int(n_code, 0);
37400
37401        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
37402        desret_int(ret_val);
37403        call_tests++;
37404        des_int(n_code, code, 0);
37405        xmlResetLastError();
37406        if (mem_base != xmlMemBlocks()) {
37407            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
37408	           xmlMemBlocks() - mem_base);
37409	    test_ret++;
37410            printf(" %d", n_code);
37411            printf("\n");
37412        }
37413    }
37414    function_tests++;
37415#endif
37416
37417    return(test_ret);
37418}
37419
37420
37421static int
37422test_xmlUCSIsKhmer(void) {
37423    int test_ret = 0;
37424
37425#ifdef LIBXML_UNICODE_ENABLED
37426    int mem_base;
37427    int ret_val;
37428    int code; /* UCS code point */
37429    int n_code;
37430
37431    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37432        mem_base = xmlMemBlocks();
37433        code = gen_int(n_code, 0);
37434
37435        ret_val = xmlUCSIsKhmer(code);
37436        desret_int(ret_val);
37437        call_tests++;
37438        des_int(n_code, code, 0);
37439        xmlResetLastError();
37440        if (mem_base != xmlMemBlocks()) {
37441            printf("Leak of %d blocks found in xmlUCSIsKhmer",
37442	           xmlMemBlocks() - mem_base);
37443	    test_ret++;
37444            printf(" %d", n_code);
37445            printf("\n");
37446        }
37447    }
37448    function_tests++;
37449#endif
37450
37451    return(test_ret);
37452}
37453
37454
37455static int
37456test_xmlUCSIsKhmerSymbols(void) {
37457    int test_ret = 0;
37458
37459#ifdef LIBXML_UNICODE_ENABLED
37460    int mem_base;
37461    int ret_val;
37462    int code; /* UCS code point */
37463    int n_code;
37464
37465    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37466        mem_base = xmlMemBlocks();
37467        code = gen_int(n_code, 0);
37468
37469        ret_val = xmlUCSIsKhmerSymbols(code);
37470        desret_int(ret_val);
37471        call_tests++;
37472        des_int(n_code, code, 0);
37473        xmlResetLastError();
37474        if (mem_base != xmlMemBlocks()) {
37475            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
37476	           xmlMemBlocks() - mem_base);
37477	    test_ret++;
37478            printf(" %d", n_code);
37479            printf("\n");
37480        }
37481    }
37482    function_tests++;
37483#endif
37484
37485    return(test_ret);
37486}
37487
37488
37489static int
37490test_xmlUCSIsLao(void) {
37491    int test_ret = 0;
37492
37493#ifdef LIBXML_UNICODE_ENABLED
37494    int mem_base;
37495    int ret_val;
37496    int code; /* UCS code point */
37497    int n_code;
37498
37499    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37500        mem_base = xmlMemBlocks();
37501        code = gen_int(n_code, 0);
37502
37503        ret_val = xmlUCSIsLao(code);
37504        desret_int(ret_val);
37505        call_tests++;
37506        des_int(n_code, code, 0);
37507        xmlResetLastError();
37508        if (mem_base != xmlMemBlocks()) {
37509            printf("Leak of %d blocks found in xmlUCSIsLao",
37510	           xmlMemBlocks() - mem_base);
37511	    test_ret++;
37512            printf(" %d", n_code);
37513            printf("\n");
37514        }
37515    }
37516    function_tests++;
37517#endif
37518
37519    return(test_ret);
37520}
37521
37522
37523static int
37524test_xmlUCSIsLatin1Supplement(void) {
37525    int test_ret = 0;
37526
37527#ifdef LIBXML_UNICODE_ENABLED
37528    int mem_base;
37529    int ret_val;
37530    int code; /* UCS code point */
37531    int n_code;
37532
37533    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37534        mem_base = xmlMemBlocks();
37535        code = gen_int(n_code, 0);
37536
37537        ret_val = xmlUCSIsLatin1Supplement(code);
37538        desret_int(ret_val);
37539        call_tests++;
37540        des_int(n_code, code, 0);
37541        xmlResetLastError();
37542        if (mem_base != xmlMemBlocks()) {
37543            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
37544	           xmlMemBlocks() - mem_base);
37545	    test_ret++;
37546            printf(" %d", n_code);
37547            printf("\n");
37548        }
37549    }
37550    function_tests++;
37551#endif
37552
37553    return(test_ret);
37554}
37555
37556
37557static int
37558test_xmlUCSIsLatinExtendedA(void) {
37559    int test_ret = 0;
37560
37561#ifdef LIBXML_UNICODE_ENABLED
37562    int mem_base;
37563    int ret_val;
37564    int code; /* UCS code point */
37565    int n_code;
37566
37567    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37568        mem_base = xmlMemBlocks();
37569        code = gen_int(n_code, 0);
37570
37571        ret_val = xmlUCSIsLatinExtendedA(code);
37572        desret_int(ret_val);
37573        call_tests++;
37574        des_int(n_code, code, 0);
37575        xmlResetLastError();
37576        if (mem_base != xmlMemBlocks()) {
37577            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
37578	           xmlMemBlocks() - mem_base);
37579	    test_ret++;
37580            printf(" %d", n_code);
37581            printf("\n");
37582        }
37583    }
37584    function_tests++;
37585#endif
37586
37587    return(test_ret);
37588}
37589
37590
37591static int
37592test_xmlUCSIsLatinExtendedAdditional(void) {
37593    int test_ret = 0;
37594
37595#ifdef LIBXML_UNICODE_ENABLED
37596    int mem_base;
37597    int ret_val;
37598    int code; /* UCS code point */
37599    int n_code;
37600
37601    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37602        mem_base = xmlMemBlocks();
37603        code = gen_int(n_code, 0);
37604
37605        ret_val = xmlUCSIsLatinExtendedAdditional(code);
37606        desret_int(ret_val);
37607        call_tests++;
37608        des_int(n_code, code, 0);
37609        xmlResetLastError();
37610        if (mem_base != xmlMemBlocks()) {
37611            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
37612	           xmlMemBlocks() - mem_base);
37613	    test_ret++;
37614            printf(" %d", n_code);
37615            printf("\n");
37616        }
37617    }
37618    function_tests++;
37619#endif
37620
37621    return(test_ret);
37622}
37623
37624
37625static int
37626test_xmlUCSIsLatinExtendedB(void) {
37627    int test_ret = 0;
37628
37629#ifdef LIBXML_UNICODE_ENABLED
37630    int mem_base;
37631    int ret_val;
37632    int code; /* UCS code point */
37633    int n_code;
37634
37635    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37636        mem_base = xmlMemBlocks();
37637        code = gen_int(n_code, 0);
37638
37639        ret_val = xmlUCSIsLatinExtendedB(code);
37640        desret_int(ret_val);
37641        call_tests++;
37642        des_int(n_code, code, 0);
37643        xmlResetLastError();
37644        if (mem_base != xmlMemBlocks()) {
37645            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
37646	           xmlMemBlocks() - mem_base);
37647	    test_ret++;
37648            printf(" %d", n_code);
37649            printf("\n");
37650        }
37651    }
37652    function_tests++;
37653#endif
37654
37655    return(test_ret);
37656}
37657
37658
37659static int
37660test_xmlUCSIsLetterlikeSymbols(void) {
37661    int test_ret = 0;
37662
37663#ifdef LIBXML_UNICODE_ENABLED
37664    int mem_base;
37665    int ret_val;
37666    int code; /* UCS code point */
37667    int n_code;
37668
37669    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37670        mem_base = xmlMemBlocks();
37671        code = gen_int(n_code, 0);
37672
37673        ret_val = xmlUCSIsLetterlikeSymbols(code);
37674        desret_int(ret_val);
37675        call_tests++;
37676        des_int(n_code, code, 0);
37677        xmlResetLastError();
37678        if (mem_base != xmlMemBlocks()) {
37679            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
37680	           xmlMemBlocks() - mem_base);
37681	    test_ret++;
37682            printf(" %d", n_code);
37683            printf("\n");
37684        }
37685    }
37686    function_tests++;
37687#endif
37688
37689    return(test_ret);
37690}
37691
37692
37693static int
37694test_xmlUCSIsLimbu(void) {
37695    int test_ret = 0;
37696
37697#ifdef LIBXML_UNICODE_ENABLED
37698    int mem_base;
37699    int ret_val;
37700    int code; /* UCS code point */
37701    int n_code;
37702
37703    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37704        mem_base = xmlMemBlocks();
37705        code = gen_int(n_code, 0);
37706
37707        ret_val = xmlUCSIsLimbu(code);
37708        desret_int(ret_val);
37709        call_tests++;
37710        des_int(n_code, code, 0);
37711        xmlResetLastError();
37712        if (mem_base != xmlMemBlocks()) {
37713            printf("Leak of %d blocks found in xmlUCSIsLimbu",
37714	           xmlMemBlocks() - mem_base);
37715	    test_ret++;
37716            printf(" %d", n_code);
37717            printf("\n");
37718        }
37719    }
37720    function_tests++;
37721#endif
37722
37723    return(test_ret);
37724}
37725
37726
37727static int
37728test_xmlUCSIsLinearBIdeograms(void) {
37729    int test_ret = 0;
37730
37731#ifdef LIBXML_UNICODE_ENABLED
37732    int mem_base;
37733    int ret_val;
37734    int code; /* UCS code point */
37735    int n_code;
37736
37737    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37738        mem_base = xmlMemBlocks();
37739        code = gen_int(n_code, 0);
37740
37741        ret_val = xmlUCSIsLinearBIdeograms(code);
37742        desret_int(ret_val);
37743        call_tests++;
37744        des_int(n_code, code, 0);
37745        xmlResetLastError();
37746        if (mem_base != xmlMemBlocks()) {
37747            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
37748	           xmlMemBlocks() - mem_base);
37749	    test_ret++;
37750            printf(" %d", n_code);
37751            printf("\n");
37752        }
37753    }
37754    function_tests++;
37755#endif
37756
37757    return(test_ret);
37758}
37759
37760
37761static int
37762test_xmlUCSIsLinearBSyllabary(void) {
37763    int test_ret = 0;
37764
37765#ifdef LIBXML_UNICODE_ENABLED
37766    int mem_base;
37767    int ret_val;
37768    int code; /* UCS code point */
37769    int n_code;
37770
37771    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37772        mem_base = xmlMemBlocks();
37773        code = gen_int(n_code, 0);
37774
37775        ret_val = xmlUCSIsLinearBSyllabary(code);
37776        desret_int(ret_val);
37777        call_tests++;
37778        des_int(n_code, code, 0);
37779        xmlResetLastError();
37780        if (mem_base != xmlMemBlocks()) {
37781            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
37782	           xmlMemBlocks() - mem_base);
37783	    test_ret++;
37784            printf(" %d", n_code);
37785            printf("\n");
37786        }
37787    }
37788    function_tests++;
37789#endif
37790
37791    return(test_ret);
37792}
37793
37794
37795static int
37796test_xmlUCSIsLowSurrogates(void) {
37797    int test_ret = 0;
37798
37799#ifdef LIBXML_UNICODE_ENABLED
37800    int mem_base;
37801    int ret_val;
37802    int code; /* UCS code point */
37803    int n_code;
37804
37805    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37806        mem_base = xmlMemBlocks();
37807        code = gen_int(n_code, 0);
37808
37809        ret_val = xmlUCSIsLowSurrogates(code);
37810        desret_int(ret_val);
37811        call_tests++;
37812        des_int(n_code, code, 0);
37813        xmlResetLastError();
37814        if (mem_base != xmlMemBlocks()) {
37815            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
37816	           xmlMemBlocks() - mem_base);
37817	    test_ret++;
37818            printf(" %d", n_code);
37819            printf("\n");
37820        }
37821    }
37822    function_tests++;
37823#endif
37824
37825    return(test_ret);
37826}
37827
37828
37829static int
37830test_xmlUCSIsMalayalam(void) {
37831    int test_ret = 0;
37832
37833#ifdef LIBXML_UNICODE_ENABLED
37834    int mem_base;
37835    int ret_val;
37836    int code; /* UCS code point */
37837    int n_code;
37838
37839    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37840        mem_base = xmlMemBlocks();
37841        code = gen_int(n_code, 0);
37842
37843        ret_val = xmlUCSIsMalayalam(code);
37844        desret_int(ret_val);
37845        call_tests++;
37846        des_int(n_code, code, 0);
37847        xmlResetLastError();
37848        if (mem_base != xmlMemBlocks()) {
37849            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
37850	           xmlMemBlocks() - mem_base);
37851	    test_ret++;
37852            printf(" %d", n_code);
37853            printf("\n");
37854        }
37855    }
37856    function_tests++;
37857#endif
37858
37859    return(test_ret);
37860}
37861
37862
37863static int
37864test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
37865    int test_ret = 0;
37866
37867#ifdef LIBXML_UNICODE_ENABLED
37868    int mem_base;
37869    int ret_val;
37870    int code; /* UCS code point */
37871    int n_code;
37872
37873    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37874        mem_base = xmlMemBlocks();
37875        code = gen_int(n_code, 0);
37876
37877        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
37878        desret_int(ret_val);
37879        call_tests++;
37880        des_int(n_code, code, 0);
37881        xmlResetLastError();
37882        if (mem_base != xmlMemBlocks()) {
37883            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
37884	           xmlMemBlocks() - mem_base);
37885	    test_ret++;
37886            printf(" %d", n_code);
37887            printf("\n");
37888        }
37889    }
37890    function_tests++;
37891#endif
37892
37893    return(test_ret);
37894}
37895
37896
37897static int
37898test_xmlUCSIsMathematicalOperators(void) {
37899    int test_ret = 0;
37900
37901#ifdef LIBXML_UNICODE_ENABLED
37902    int mem_base;
37903    int ret_val;
37904    int code; /* UCS code point */
37905    int n_code;
37906
37907    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37908        mem_base = xmlMemBlocks();
37909        code = gen_int(n_code, 0);
37910
37911        ret_val = xmlUCSIsMathematicalOperators(code);
37912        desret_int(ret_val);
37913        call_tests++;
37914        des_int(n_code, code, 0);
37915        xmlResetLastError();
37916        if (mem_base != xmlMemBlocks()) {
37917            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
37918	           xmlMemBlocks() - mem_base);
37919	    test_ret++;
37920            printf(" %d", n_code);
37921            printf("\n");
37922        }
37923    }
37924    function_tests++;
37925#endif
37926
37927    return(test_ret);
37928}
37929
37930
37931static int
37932test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
37933    int test_ret = 0;
37934
37935#ifdef LIBXML_UNICODE_ENABLED
37936    int mem_base;
37937    int ret_val;
37938    int code; /* UCS code point */
37939    int n_code;
37940
37941    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37942        mem_base = xmlMemBlocks();
37943        code = gen_int(n_code, 0);
37944
37945        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
37946        desret_int(ret_val);
37947        call_tests++;
37948        des_int(n_code, code, 0);
37949        xmlResetLastError();
37950        if (mem_base != xmlMemBlocks()) {
37951            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
37952	           xmlMemBlocks() - mem_base);
37953	    test_ret++;
37954            printf(" %d", n_code);
37955            printf("\n");
37956        }
37957    }
37958    function_tests++;
37959#endif
37960
37961    return(test_ret);
37962}
37963
37964
37965static int
37966test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
37967    int test_ret = 0;
37968
37969#ifdef LIBXML_UNICODE_ENABLED
37970    int mem_base;
37971    int ret_val;
37972    int code; /* UCS code point */
37973    int n_code;
37974
37975    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37976        mem_base = xmlMemBlocks();
37977        code = gen_int(n_code, 0);
37978
37979        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
37980        desret_int(ret_val);
37981        call_tests++;
37982        des_int(n_code, code, 0);
37983        xmlResetLastError();
37984        if (mem_base != xmlMemBlocks()) {
37985            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
37986	           xmlMemBlocks() - mem_base);
37987	    test_ret++;
37988            printf(" %d", n_code);
37989            printf("\n");
37990        }
37991    }
37992    function_tests++;
37993#endif
37994
37995    return(test_ret);
37996}
37997
37998
37999static int
38000test_xmlUCSIsMiscellaneousSymbols(void) {
38001    int test_ret = 0;
38002
38003#ifdef LIBXML_UNICODE_ENABLED
38004    int mem_base;
38005    int ret_val;
38006    int code; /* UCS code point */
38007    int n_code;
38008
38009    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38010        mem_base = xmlMemBlocks();
38011        code = gen_int(n_code, 0);
38012
38013        ret_val = xmlUCSIsMiscellaneousSymbols(code);
38014        desret_int(ret_val);
38015        call_tests++;
38016        des_int(n_code, code, 0);
38017        xmlResetLastError();
38018        if (mem_base != xmlMemBlocks()) {
38019            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
38020	           xmlMemBlocks() - mem_base);
38021	    test_ret++;
38022            printf(" %d", n_code);
38023            printf("\n");
38024        }
38025    }
38026    function_tests++;
38027#endif
38028
38029    return(test_ret);
38030}
38031
38032
38033static int
38034test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
38035    int test_ret = 0;
38036
38037#ifdef LIBXML_UNICODE_ENABLED
38038    int mem_base;
38039    int ret_val;
38040    int code; /* UCS code point */
38041    int n_code;
38042
38043    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38044        mem_base = xmlMemBlocks();
38045        code = gen_int(n_code, 0);
38046
38047        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
38048        desret_int(ret_val);
38049        call_tests++;
38050        des_int(n_code, code, 0);
38051        xmlResetLastError();
38052        if (mem_base != xmlMemBlocks()) {
38053            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
38054	           xmlMemBlocks() - mem_base);
38055	    test_ret++;
38056            printf(" %d", n_code);
38057            printf("\n");
38058        }
38059    }
38060    function_tests++;
38061#endif
38062
38063    return(test_ret);
38064}
38065
38066
38067static int
38068test_xmlUCSIsMiscellaneousTechnical(void) {
38069    int test_ret = 0;
38070
38071#ifdef LIBXML_UNICODE_ENABLED
38072    int mem_base;
38073    int ret_val;
38074    int code; /* UCS code point */
38075    int n_code;
38076
38077    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38078        mem_base = xmlMemBlocks();
38079        code = gen_int(n_code, 0);
38080
38081        ret_val = xmlUCSIsMiscellaneousTechnical(code);
38082        desret_int(ret_val);
38083        call_tests++;
38084        des_int(n_code, code, 0);
38085        xmlResetLastError();
38086        if (mem_base != xmlMemBlocks()) {
38087            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
38088	           xmlMemBlocks() - mem_base);
38089	    test_ret++;
38090            printf(" %d", n_code);
38091            printf("\n");
38092        }
38093    }
38094    function_tests++;
38095#endif
38096
38097    return(test_ret);
38098}
38099
38100
38101static int
38102test_xmlUCSIsMongolian(void) {
38103    int test_ret = 0;
38104
38105#ifdef LIBXML_UNICODE_ENABLED
38106    int mem_base;
38107    int ret_val;
38108    int code; /* UCS code point */
38109    int n_code;
38110
38111    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38112        mem_base = xmlMemBlocks();
38113        code = gen_int(n_code, 0);
38114
38115        ret_val = xmlUCSIsMongolian(code);
38116        desret_int(ret_val);
38117        call_tests++;
38118        des_int(n_code, code, 0);
38119        xmlResetLastError();
38120        if (mem_base != xmlMemBlocks()) {
38121            printf("Leak of %d blocks found in xmlUCSIsMongolian",
38122	           xmlMemBlocks() - mem_base);
38123	    test_ret++;
38124            printf(" %d", n_code);
38125            printf("\n");
38126        }
38127    }
38128    function_tests++;
38129#endif
38130
38131    return(test_ret);
38132}
38133
38134
38135static int
38136test_xmlUCSIsMusicalSymbols(void) {
38137    int test_ret = 0;
38138
38139#ifdef LIBXML_UNICODE_ENABLED
38140    int mem_base;
38141    int ret_val;
38142    int code; /* UCS code point */
38143    int n_code;
38144
38145    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38146        mem_base = xmlMemBlocks();
38147        code = gen_int(n_code, 0);
38148
38149        ret_val = xmlUCSIsMusicalSymbols(code);
38150        desret_int(ret_val);
38151        call_tests++;
38152        des_int(n_code, code, 0);
38153        xmlResetLastError();
38154        if (mem_base != xmlMemBlocks()) {
38155            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
38156	           xmlMemBlocks() - mem_base);
38157	    test_ret++;
38158            printf(" %d", n_code);
38159            printf("\n");
38160        }
38161    }
38162    function_tests++;
38163#endif
38164
38165    return(test_ret);
38166}
38167
38168
38169static int
38170test_xmlUCSIsMyanmar(void) {
38171    int test_ret = 0;
38172
38173#ifdef LIBXML_UNICODE_ENABLED
38174    int mem_base;
38175    int ret_val;
38176    int code; /* UCS code point */
38177    int n_code;
38178
38179    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38180        mem_base = xmlMemBlocks();
38181        code = gen_int(n_code, 0);
38182
38183        ret_val = xmlUCSIsMyanmar(code);
38184        desret_int(ret_val);
38185        call_tests++;
38186        des_int(n_code, code, 0);
38187        xmlResetLastError();
38188        if (mem_base != xmlMemBlocks()) {
38189            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
38190	           xmlMemBlocks() - mem_base);
38191	    test_ret++;
38192            printf(" %d", n_code);
38193            printf("\n");
38194        }
38195    }
38196    function_tests++;
38197#endif
38198
38199    return(test_ret);
38200}
38201
38202
38203static int
38204test_xmlUCSIsNumberForms(void) {
38205    int test_ret = 0;
38206
38207#ifdef LIBXML_UNICODE_ENABLED
38208    int mem_base;
38209    int ret_val;
38210    int code; /* UCS code point */
38211    int n_code;
38212
38213    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38214        mem_base = xmlMemBlocks();
38215        code = gen_int(n_code, 0);
38216
38217        ret_val = xmlUCSIsNumberForms(code);
38218        desret_int(ret_val);
38219        call_tests++;
38220        des_int(n_code, code, 0);
38221        xmlResetLastError();
38222        if (mem_base != xmlMemBlocks()) {
38223            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
38224	           xmlMemBlocks() - mem_base);
38225	    test_ret++;
38226            printf(" %d", n_code);
38227            printf("\n");
38228        }
38229    }
38230    function_tests++;
38231#endif
38232
38233    return(test_ret);
38234}
38235
38236
38237static int
38238test_xmlUCSIsOgham(void) {
38239    int test_ret = 0;
38240
38241#ifdef LIBXML_UNICODE_ENABLED
38242    int mem_base;
38243    int ret_val;
38244    int code; /* UCS code point */
38245    int n_code;
38246
38247    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38248        mem_base = xmlMemBlocks();
38249        code = gen_int(n_code, 0);
38250
38251        ret_val = xmlUCSIsOgham(code);
38252        desret_int(ret_val);
38253        call_tests++;
38254        des_int(n_code, code, 0);
38255        xmlResetLastError();
38256        if (mem_base != xmlMemBlocks()) {
38257            printf("Leak of %d blocks found in xmlUCSIsOgham",
38258	           xmlMemBlocks() - mem_base);
38259	    test_ret++;
38260            printf(" %d", n_code);
38261            printf("\n");
38262        }
38263    }
38264    function_tests++;
38265#endif
38266
38267    return(test_ret);
38268}
38269
38270
38271static int
38272test_xmlUCSIsOldItalic(void) {
38273    int test_ret = 0;
38274
38275#ifdef LIBXML_UNICODE_ENABLED
38276    int mem_base;
38277    int ret_val;
38278    int code; /* UCS code point */
38279    int n_code;
38280
38281    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38282        mem_base = xmlMemBlocks();
38283        code = gen_int(n_code, 0);
38284
38285        ret_val = xmlUCSIsOldItalic(code);
38286        desret_int(ret_val);
38287        call_tests++;
38288        des_int(n_code, code, 0);
38289        xmlResetLastError();
38290        if (mem_base != xmlMemBlocks()) {
38291            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
38292	           xmlMemBlocks() - mem_base);
38293	    test_ret++;
38294            printf(" %d", n_code);
38295            printf("\n");
38296        }
38297    }
38298    function_tests++;
38299#endif
38300
38301    return(test_ret);
38302}
38303
38304
38305static int
38306test_xmlUCSIsOpticalCharacterRecognition(void) {
38307    int test_ret = 0;
38308
38309#ifdef LIBXML_UNICODE_ENABLED
38310    int mem_base;
38311    int ret_val;
38312    int code; /* UCS code point */
38313    int n_code;
38314
38315    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38316        mem_base = xmlMemBlocks();
38317        code = gen_int(n_code, 0);
38318
38319        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
38320        desret_int(ret_val);
38321        call_tests++;
38322        des_int(n_code, code, 0);
38323        xmlResetLastError();
38324        if (mem_base != xmlMemBlocks()) {
38325            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
38326	           xmlMemBlocks() - mem_base);
38327	    test_ret++;
38328            printf(" %d", n_code);
38329            printf("\n");
38330        }
38331    }
38332    function_tests++;
38333#endif
38334
38335    return(test_ret);
38336}
38337
38338
38339static int
38340test_xmlUCSIsOriya(void) {
38341    int test_ret = 0;
38342
38343#ifdef LIBXML_UNICODE_ENABLED
38344    int mem_base;
38345    int ret_val;
38346    int code; /* UCS code point */
38347    int n_code;
38348
38349    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38350        mem_base = xmlMemBlocks();
38351        code = gen_int(n_code, 0);
38352
38353        ret_val = xmlUCSIsOriya(code);
38354        desret_int(ret_val);
38355        call_tests++;
38356        des_int(n_code, code, 0);
38357        xmlResetLastError();
38358        if (mem_base != xmlMemBlocks()) {
38359            printf("Leak of %d blocks found in xmlUCSIsOriya",
38360	           xmlMemBlocks() - mem_base);
38361	    test_ret++;
38362            printf(" %d", n_code);
38363            printf("\n");
38364        }
38365    }
38366    function_tests++;
38367#endif
38368
38369    return(test_ret);
38370}
38371
38372
38373static int
38374test_xmlUCSIsOsmanya(void) {
38375    int test_ret = 0;
38376
38377#ifdef LIBXML_UNICODE_ENABLED
38378    int mem_base;
38379    int ret_val;
38380    int code; /* UCS code point */
38381    int n_code;
38382
38383    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38384        mem_base = xmlMemBlocks();
38385        code = gen_int(n_code, 0);
38386
38387        ret_val = xmlUCSIsOsmanya(code);
38388        desret_int(ret_val);
38389        call_tests++;
38390        des_int(n_code, code, 0);
38391        xmlResetLastError();
38392        if (mem_base != xmlMemBlocks()) {
38393            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
38394	           xmlMemBlocks() - mem_base);
38395	    test_ret++;
38396            printf(" %d", n_code);
38397            printf("\n");
38398        }
38399    }
38400    function_tests++;
38401#endif
38402
38403    return(test_ret);
38404}
38405
38406
38407static int
38408test_xmlUCSIsPhoneticExtensions(void) {
38409    int test_ret = 0;
38410
38411#ifdef LIBXML_UNICODE_ENABLED
38412    int mem_base;
38413    int ret_val;
38414    int code; /* UCS code point */
38415    int n_code;
38416
38417    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38418        mem_base = xmlMemBlocks();
38419        code = gen_int(n_code, 0);
38420
38421        ret_val = xmlUCSIsPhoneticExtensions(code);
38422        desret_int(ret_val);
38423        call_tests++;
38424        des_int(n_code, code, 0);
38425        xmlResetLastError();
38426        if (mem_base != xmlMemBlocks()) {
38427            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
38428	           xmlMemBlocks() - mem_base);
38429	    test_ret++;
38430            printf(" %d", n_code);
38431            printf("\n");
38432        }
38433    }
38434    function_tests++;
38435#endif
38436
38437    return(test_ret);
38438}
38439
38440
38441static int
38442test_xmlUCSIsPrivateUse(void) {
38443    int test_ret = 0;
38444
38445#ifdef LIBXML_UNICODE_ENABLED
38446    int mem_base;
38447    int ret_val;
38448    int code; /* UCS code point */
38449    int n_code;
38450
38451    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38452        mem_base = xmlMemBlocks();
38453        code = gen_int(n_code, 0);
38454
38455        ret_val = xmlUCSIsPrivateUse(code);
38456        desret_int(ret_val);
38457        call_tests++;
38458        des_int(n_code, code, 0);
38459        xmlResetLastError();
38460        if (mem_base != xmlMemBlocks()) {
38461            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
38462	           xmlMemBlocks() - mem_base);
38463	    test_ret++;
38464            printf(" %d", n_code);
38465            printf("\n");
38466        }
38467    }
38468    function_tests++;
38469#endif
38470
38471    return(test_ret);
38472}
38473
38474
38475static int
38476test_xmlUCSIsPrivateUseArea(void) {
38477    int test_ret = 0;
38478
38479#ifdef LIBXML_UNICODE_ENABLED
38480    int mem_base;
38481    int ret_val;
38482    int code; /* UCS code point */
38483    int n_code;
38484
38485    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38486        mem_base = xmlMemBlocks();
38487        code = gen_int(n_code, 0);
38488
38489        ret_val = xmlUCSIsPrivateUseArea(code);
38490        desret_int(ret_val);
38491        call_tests++;
38492        des_int(n_code, code, 0);
38493        xmlResetLastError();
38494        if (mem_base != xmlMemBlocks()) {
38495            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
38496	           xmlMemBlocks() - mem_base);
38497	    test_ret++;
38498            printf(" %d", n_code);
38499            printf("\n");
38500        }
38501    }
38502    function_tests++;
38503#endif
38504
38505    return(test_ret);
38506}
38507
38508
38509static int
38510test_xmlUCSIsRunic(void) {
38511    int test_ret = 0;
38512
38513#ifdef LIBXML_UNICODE_ENABLED
38514    int mem_base;
38515    int ret_val;
38516    int code; /* UCS code point */
38517    int n_code;
38518
38519    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38520        mem_base = xmlMemBlocks();
38521        code = gen_int(n_code, 0);
38522
38523        ret_val = xmlUCSIsRunic(code);
38524        desret_int(ret_val);
38525        call_tests++;
38526        des_int(n_code, code, 0);
38527        xmlResetLastError();
38528        if (mem_base != xmlMemBlocks()) {
38529            printf("Leak of %d blocks found in xmlUCSIsRunic",
38530	           xmlMemBlocks() - mem_base);
38531	    test_ret++;
38532            printf(" %d", n_code);
38533            printf("\n");
38534        }
38535    }
38536    function_tests++;
38537#endif
38538
38539    return(test_ret);
38540}
38541
38542
38543static int
38544test_xmlUCSIsShavian(void) {
38545    int test_ret = 0;
38546
38547#ifdef LIBXML_UNICODE_ENABLED
38548    int mem_base;
38549    int ret_val;
38550    int code; /* UCS code point */
38551    int n_code;
38552
38553    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38554        mem_base = xmlMemBlocks();
38555        code = gen_int(n_code, 0);
38556
38557        ret_val = xmlUCSIsShavian(code);
38558        desret_int(ret_val);
38559        call_tests++;
38560        des_int(n_code, code, 0);
38561        xmlResetLastError();
38562        if (mem_base != xmlMemBlocks()) {
38563            printf("Leak of %d blocks found in xmlUCSIsShavian",
38564	           xmlMemBlocks() - mem_base);
38565	    test_ret++;
38566            printf(" %d", n_code);
38567            printf("\n");
38568        }
38569    }
38570    function_tests++;
38571#endif
38572
38573    return(test_ret);
38574}
38575
38576
38577static int
38578test_xmlUCSIsSinhala(void) {
38579    int test_ret = 0;
38580
38581#ifdef LIBXML_UNICODE_ENABLED
38582    int mem_base;
38583    int ret_val;
38584    int code; /* UCS code point */
38585    int n_code;
38586
38587    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38588        mem_base = xmlMemBlocks();
38589        code = gen_int(n_code, 0);
38590
38591        ret_val = xmlUCSIsSinhala(code);
38592        desret_int(ret_val);
38593        call_tests++;
38594        des_int(n_code, code, 0);
38595        xmlResetLastError();
38596        if (mem_base != xmlMemBlocks()) {
38597            printf("Leak of %d blocks found in xmlUCSIsSinhala",
38598	           xmlMemBlocks() - mem_base);
38599	    test_ret++;
38600            printf(" %d", n_code);
38601            printf("\n");
38602        }
38603    }
38604    function_tests++;
38605#endif
38606
38607    return(test_ret);
38608}
38609
38610
38611static int
38612test_xmlUCSIsSmallFormVariants(void) {
38613    int test_ret = 0;
38614
38615#ifdef LIBXML_UNICODE_ENABLED
38616    int mem_base;
38617    int ret_val;
38618    int code; /* UCS code point */
38619    int n_code;
38620
38621    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38622        mem_base = xmlMemBlocks();
38623        code = gen_int(n_code, 0);
38624
38625        ret_val = xmlUCSIsSmallFormVariants(code);
38626        desret_int(ret_val);
38627        call_tests++;
38628        des_int(n_code, code, 0);
38629        xmlResetLastError();
38630        if (mem_base != xmlMemBlocks()) {
38631            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
38632	           xmlMemBlocks() - mem_base);
38633	    test_ret++;
38634            printf(" %d", n_code);
38635            printf("\n");
38636        }
38637    }
38638    function_tests++;
38639#endif
38640
38641    return(test_ret);
38642}
38643
38644
38645static int
38646test_xmlUCSIsSpacingModifierLetters(void) {
38647    int test_ret = 0;
38648
38649#ifdef LIBXML_UNICODE_ENABLED
38650    int mem_base;
38651    int ret_val;
38652    int code; /* UCS code point */
38653    int n_code;
38654
38655    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38656        mem_base = xmlMemBlocks();
38657        code = gen_int(n_code, 0);
38658
38659        ret_val = xmlUCSIsSpacingModifierLetters(code);
38660        desret_int(ret_val);
38661        call_tests++;
38662        des_int(n_code, code, 0);
38663        xmlResetLastError();
38664        if (mem_base != xmlMemBlocks()) {
38665            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
38666	           xmlMemBlocks() - mem_base);
38667	    test_ret++;
38668            printf(" %d", n_code);
38669            printf("\n");
38670        }
38671    }
38672    function_tests++;
38673#endif
38674
38675    return(test_ret);
38676}
38677
38678
38679static int
38680test_xmlUCSIsSpecials(void) {
38681    int test_ret = 0;
38682
38683#ifdef LIBXML_UNICODE_ENABLED
38684    int mem_base;
38685    int ret_val;
38686    int code; /* UCS code point */
38687    int n_code;
38688
38689    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38690        mem_base = xmlMemBlocks();
38691        code = gen_int(n_code, 0);
38692
38693        ret_val = xmlUCSIsSpecials(code);
38694        desret_int(ret_val);
38695        call_tests++;
38696        des_int(n_code, code, 0);
38697        xmlResetLastError();
38698        if (mem_base != xmlMemBlocks()) {
38699            printf("Leak of %d blocks found in xmlUCSIsSpecials",
38700	           xmlMemBlocks() - mem_base);
38701	    test_ret++;
38702            printf(" %d", n_code);
38703            printf("\n");
38704        }
38705    }
38706    function_tests++;
38707#endif
38708
38709    return(test_ret);
38710}
38711
38712
38713static int
38714test_xmlUCSIsSuperscriptsandSubscripts(void) {
38715    int test_ret = 0;
38716
38717#ifdef LIBXML_UNICODE_ENABLED
38718    int mem_base;
38719    int ret_val;
38720    int code; /* UCS code point */
38721    int n_code;
38722
38723    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38724        mem_base = xmlMemBlocks();
38725        code = gen_int(n_code, 0);
38726
38727        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
38728        desret_int(ret_val);
38729        call_tests++;
38730        des_int(n_code, code, 0);
38731        xmlResetLastError();
38732        if (mem_base != xmlMemBlocks()) {
38733            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
38734	           xmlMemBlocks() - mem_base);
38735	    test_ret++;
38736            printf(" %d", n_code);
38737            printf("\n");
38738        }
38739    }
38740    function_tests++;
38741#endif
38742
38743    return(test_ret);
38744}
38745
38746
38747static int
38748test_xmlUCSIsSupplementalArrowsA(void) {
38749    int test_ret = 0;
38750
38751#ifdef LIBXML_UNICODE_ENABLED
38752    int mem_base;
38753    int ret_val;
38754    int code; /* UCS code point */
38755    int n_code;
38756
38757    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38758        mem_base = xmlMemBlocks();
38759        code = gen_int(n_code, 0);
38760
38761        ret_val = xmlUCSIsSupplementalArrowsA(code);
38762        desret_int(ret_val);
38763        call_tests++;
38764        des_int(n_code, code, 0);
38765        xmlResetLastError();
38766        if (mem_base != xmlMemBlocks()) {
38767            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
38768	           xmlMemBlocks() - mem_base);
38769	    test_ret++;
38770            printf(" %d", n_code);
38771            printf("\n");
38772        }
38773    }
38774    function_tests++;
38775#endif
38776
38777    return(test_ret);
38778}
38779
38780
38781static int
38782test_xmlUCSIsSupplementalArrowsB(void) {
38783    int test_ret = 0;
38784
38785#ifdef LIBXML_UNICODE_ENABLED
38786    int mem_base;
38787    int ret_val;
38788    int code; /* UCS code point */
38789    int n_code;
38790
38791    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38792        mem_base = xmlMemBlocks();
38793        code = gen_int(n_code, 0);
38794
38795        ret_val = xmlUCSIsSupplementalArrowsB(code);
38796        desret_int(ret_val);
38797        call_tests++;
38798        des_int(n_code, code, 0);
38799        xmlResetLastError();
38800        if (mem_base != xmlMemBlocks()) {
38801            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
38802	           xmlMemBlocks() - mem_base);
38803	    test_ret++;
38804            printf(" %d", n_code);
38805            printf("\n");
38806        }
38807    }
38808    function_tests++;
38809#endif
38810
38811    return(test_ret);
38812}
38813
38814
38815static int
38816test_xmlUCSIsSupplementalMathematicalOperators(void) {
38817    int test_ret = 0;
38818
38819#ifdef LIBXML_UNICODE_ENABLED
38820    int mem_base;
38821    int ret_val;
38822    int code; /* UCS code point */
38823    int n_code;
38824
38825    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38826        mem_base = xmlMemBlocks();
38827        code = gen_int(n_code, 0);
38828
38829        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
38830        desret_int(ret_val);
38831        call_tests++;
38832        des_int(n_code, code, 0);
38833        xmlResetLastError();
38834        if (mem_base != xmlMemBlocks()) {
38835            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
38836	           xmlMemBlocks() - mem_base);
38837	    test_ret++;
38838            printf(" %d", n_code);
38839            printf("\n");
38840        }
38841    }
38842    function_tests++;
38843#endif
38844
38845    return(test_ret);
38846}
38847
38848
38849static int
38850test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
38851    int test_ret = 0;
38852
38853#ifdef LIBXML_UNICODE_ENABLED
38854    int mem_base;
38855    int ret_val;
38856    int code; /* UCS code point */
38857    int n_code;
38858
38859    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38860        mem_base = xmlMemBlocks();
38861        code = gen_int(n_code, 0);
38862
38863        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
38864        desret_int(ret_val);
38865        call_tests++;
38866        des_int(n_code, code, 0);
38867        xmlResetLastError();
38868        if (mem_base != xmlMemBlocks()) {
38869            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
38870	           xmlMemBlocks() - mem_base);
38871	    test_ret++;
38872            printf(" %d", n_code);
38873            printf("\n");
38874        }
38875    }
38876    function_tests++;
38877#endif
38878
38879    return(test_ret);
38880}
38881
38882
38883static int
38884test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
38885    int test_ret = 0;
38886
38887#ifdef LIBXML_UNICODE_ENABLED
38888    int mem_base;
38889    int ret_val;
38890    int code; /* UCS code point */
38891    int n_code;
38892
38893    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38894        mem_base = xmlMemBlocks();
38895        code = gen_int(n_code, 0);
38896
38897        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
38898        desret_int(ret_val);
38899        call_tests++;
38900        des_int(n_code, code, 0);
38901        xmlResetLastError();
38902        if (mem_base != xmlMemBlocks()) {
38903            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
38904	           xmlMemBlocks() - mem_base);
38905	    test_ret++;
38906            printf(" %d", n_code);
38907            printf("\n");
38908        }
38909    }
38910    function_tests++;
38911#endif
38912
38913    return(test_ret);
38914}
38915
38916
38917static int
38918test_xmlUCSIsSyriac(void) {
38919    int test_ret = 0;
38920
38921#ifdef LIBXML_UNICODE_ENABLED
38922    int mem_base;
38923    int ret_val;
38924    int code; /* UCS code point */
38925    int n_code;
38926
38927    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38928        mem_base = xmlMemBlocks();
38929        code = gen_int(n_code, 0);
38930
38931        ret_val = xmlUCSIsSyriac(code);
38932        desret_int(ret_val);
38933        call_tests++;
38934        des_int(n_code, code, 0);
38935        xmlResetLastError();
38936        if (mem_base != xmlMemBlocks()) {
38937            printf("Leak of %d blocks found in xmlUCSIsSyriac",
38938	           xmlMemBlocks() - mem_base);
38939	    test_ret++;
38940            printf(" %d", n_code);
38941            printf("\n");
38942        }
38943    }
38944    function_tests++;
38945#endif
38946
38947    return(test_ret);
38948}
38949
38950
38951static int
38952test_xmlUCSIsTagalog(void) {
38953    int test_ret = 0;
38954
38955#ifdef LIBXML_UNICODE_ENABLED
38956    int mem_base;
38957    int ret_val;
38958    int code; /* UCS code point */
38959    int n_code;
38960
38961    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38962        mem_base = xmlMemBlocks();
38963        code = gen_int(n_code, 0);
38964
38965        ret_val = xmlUCSIsTagalog(code);
38966        desret_int(ret_val);
38967        call_tests++;
38968        des_int(n_code, code, 0);
38969        xmlResetLastError();
38970        if (mem_base != xmlMemBlocks()) {
38971            printf("Leak of %d blocks found in xmlUCSIsTagalog",
38972	           xmlMemBlocks() - mem_base);
38973	    test_ret++;
38974            printf(" %d", n_code);
38975            printf("\n");
38976        }
38977    }
38978    function_tests++;
38979#endif
38980
38981    return(test_ret);
38982}
38983
38984
38985static int
38986test_xmlUCSIsTagbanwa(void) {
38987    int test_ret = 0;
38988
38989#ifdef LIBXML_UNICODE_ENABLED
38990    int mem_base;
38991    int ret_val;
38992    int code; /* UCS code point */
38993    int n_code;
38994
38995    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38996        mem_base = xmlMemBlocks();
38997        code = gen_int(n_code, 0);
38998
38999        ret_val = xmlUCSIsTagbanwa(code);
39000        desret_int(ret_val);
39001        call_tests++;
39002        des_int(n_code, code, 0);
39003        xmlResetLastError();
39004        if (mem_base != xmlMemBlocks()) {
39005            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
39006	           xmlMemBlocks() - mem_base);
39007	    test_ret++;
39008            printf(" %d", n_code);
39009            printf("\n");
39010        }
39011    }
39012    function_tests++;
39013#endif
39014
39015    return(test_ret);
39016}
39017
39018
39019static int
39020test_xmlUCSIsTags(void) {
39021    int test_ret = 0;
39022
39023#ifdef LIBXML_UNICODE_ENABLED
39024    int mem_base;
39025    int ret_val;
39026    int code; /* UCS code point */
39027    int n_code;
39028
39029    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39030        mem_base = xmlMemBlocks();
39031        code = gen_int(n_code, 0);
39032
39033        ret_val = xmlUCSIsTags(code);
39034        desret_int(ret_val);
39035        call_tests++;
39036        des_int(n_code, code, 0);
39037        xmlResetLastError();
39038        if (mem_base != xmlMemBlocks()) {
39039            printf("Leak of %d blocks found in xmlUCSIsTags",
39040	           xmlMemBlocks() - mem_base);
39041	    test_ret++;
39042            printf(" %d", n_code);
39043            printf("\n");
39044        }
39045    }
39046    function_tests++;
39047#endif
39048
39049    return(test_ret);
39050}
39051
39052
39053static int
39054test_xmlUCSIsTaiLe(void) {
39055    int test_ret = 0;
39056
39057#ifdef LIBXML_UNICODE_ENABLED
39058    int mem_base;
39059    int ret_val;
39060    int code; /* UCS code point */
39061    int n_code;
39062
39063    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39064        mem_base = xmlMemBlocks();
39065        code = gen_int(n_code, 0);
39066
39067        ret_val = xmlUCSIsTaiLe(code);
39068        desret_int(ret_val);
39069        call_tests++;
39070        des_int(n_code, code, 0);
39071        xmlResetLastError();
39072        if (mem_base != xmlMemBlocks()) {
39073            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
39074	           xmlMemBlocks() - mem_base);
39075	    test_ret++;
39076            printf(" %d", n_code);
39077            printf("\n");
39078        }
39079    }
39080    function_tests++;
39081#endif
39082
39083    return(test_ret);
39084}
39085
39086
39087static int
39088test_xmlUCSIsTaiXuanJingSymbols(void) {
39089    int test_ret = 0;
39090
39091#ifdef LIBXML_UNICODE_ENABLED
39092    int mem_base;
39093    int ret_val;
39094    int code; /* UCS code point */
39095    int n_code;
39096
39097    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39098        mem_base = xmlMemBlocks();
39099        code = gen_int(n_code, 0);
39100
39101        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
39102        desret_int(ret_val);
39103        call_tests++;
39104        des_int(n_code, code, 0);
39105        xmlResetLastError();
39106        if (mem_base != xmlMemBlocks()) {
39107            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
39108	           xmlMemBlocks() - mem_base);
39109	    test_ret++;
39110            printf(" %d", n_code);
39111            printf("\n");
39112        }
39113    }
39114    function_tests++;
39115#endif
39116
39117    return(test_ret);
39118}
39119
39120
39121static int
39122test_xmlUCSIsTamil(void) {
39123    int test_ret = 0;
39124
39125#ifdef LIBXML_UNICODE_ENABLED
39126    int mem_base;
39127    int ret_val;
39128    int code; /* UCS code point */
39129    int n_code;
39130
39131    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39132        mem_base = xmlMemBlocks();
39133        code = gen_int(n_code, 0);
39134
39135        ret_val = xmlUCSIsTamil(code);
39136        desret_int(ret_val);
39137        call_tests++;
39138        des_int(n_code, code, 0);
39139        xmlResetLastError();
39140        if (mem_base != xmlMemBlocks()) {
39141            printf("Leak of %d blocks found in xmlUCSIsTamil",
39142	           xmlMemBlocks() - mem_base);
39143	    test_ret++;
39144            printf(" %d", n_code);
39145            printf("\n");
39146        }
39147    }
39148    function_tests++;
39149#endif
39150
39151    return(test_ret);
39152}
39153
39154
39155static int
39156test_xmlUCSIsTelugu(void) {
39157    int test_ret = 0;
39158
39159#ifdef LIBXML_UNICODE_ENABLED
39160    int mem_base;
39161    int ret_val;
39162    int code; /* UCS code point */
39163    int n_code;
39164
39165    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39166        mem_base = xmlMemBlocks();
39167        code = gen_int(n_code, 0);
39168
39169        ret_val = xmlUCSIsTelugu(code);
39170        desret_int(ret_val);
39171        call_tests++;
39172        des_int(n_code, code, 0);
39173        xmlResetLastError();
39174        if (mem_base != xmlMemBlocks()) {
39175            printf("Leak of %d blocks found in xmlUCSIsTelugu",
39176	           xmlMemBlocks() - mem_base);
39177	    test_ret++;
39178            printf(" %d", n_code);
39179            printf("\n");
39180        }
39181    }
39182    function_tests++;
39183#endif
39184
39185    return(test_ret);
39186}
39187
39188
39189static int
39190test_xmlUCSIsThaana(void) {
39191    int test_ret = 0;
39192
39193#ifdef LIBXML_UNICODE_ENABLED
39194    int mem_base;
39195    int ret_val;
39196    int code; /* UCS code point */
39197    int n_code;
39198
39199    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39200        mem_base = xmlMemBlocks();
39201        code = gen_int(n_code, 0);
39202
39203        ret_val = xmlUCSIsThaana(code);
39204        desret_int(ret_val);
39205        call_tests++;
39206        des_int(n_code, code, 0);
39207        xmlResetLastError();
39208        if (mem_base != xmlMemBlocks()) {
39209            printf("Leak of %d blocks found in xmlUCSIsThaana",
39210	           xmlMemBlocks() - mem_base);
39211	    test_ret++;
39212            printf(" %d", n_code);
39213            printf("\n");
39214        }
39215    }
39216    function_tests++;
39217#endif
39218
39219    return(test_ret);
39220}
39221
39222
39223static int
39224test_xmlUCSIsThai(void) {
39225    int test_ret = 0;
39226
39227#ifdef LIBXML_UNICODE_ENABLED
39228    int mem_base;
39229    int ret_val;
39230    int code; /* UCS code point */
39231    int n_code;
39232
39233    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39234        mem_base = xmlMemBlocks();
39235        code = gen_int(n_code, 0);
39236
39237        ret_val = xmlUCSIsThai(code);
39238        desret_int(ret_val);
39239        call_tests++;
39240        des_int(n_code, code, 0);
39241        xmlResetLastError();
39242        if (mem_base != xmlMemBlocks()) {
39243            printf("Leak of %d blocks found in xmlUCSIsThai",
39244	           xmlMemBlocks() - mem_base);
39245	    test_ret++;
39246            printf(" %d", n_code);
39247            printf("\n");
39248        }
39249    }
39250    function_tests++;
39251#endif
39252
39253    return(test_ret);
39254}
39255
39256
39257static int
39258test_xmlUCSIsTibetan(void) {
39259    int test_ret = 0;
39260
39261#ifdef LIBXML_UNICODE_ENABLED
39262    int mem_base;
39263    int ret_val;
39264    int code; /* UCS code point */
39265    int n_code;
39266
39267    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39268        mem_base = xmlMemBlocks();
39269        code = gen_int(n_code, 0);
39270
39271        ret_val = xmlUCSIsTibetan(code);
39272        desret_int(ret_val);
39273        call_tests++;
39274        des_int(n_code, code, 0);
39275        xmlResetLastError();
39276        if (mem_base != xmlMemBlocks()) {
39277            printf("Leak of %d blocks found in xmlUCSIsTibetan",
39278	           xmlMemBlocks() - mem_base);
39279	    test_ret++;
39280            printf(" %d", n_code);
39281            printf("\n");
39282        }
39283    }
39284    function_tests++;
39285#endif
39286
39287    return(test_ret);
39288}
39289
39290
39291static int
39292test_xmlUCSIsUgaritic(void) {
39293    int test_ret = 0;
39294
39295#ifdef LIBXML_UNICODE_ENABLED
39296    int mem_base;
39297    int ret_val;
39298    int code; /* UCS code point */
39299    int n_code;
39300
39301    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39302        mem_base = xmlMemBlocks();
39303        code = gen_int(n_code, 0);
39304
39305        ret_val = xmlUCSIsUgaritic(code);
39306        desret_int(ret_val);
39307        call_tests++;
39308        des_int(n_code, code, 0);
39309        xmlResetLastError();
39310        if (mem_base != xmlMemBlocks()) {
39311            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
39312	           xmlMemBlocks() - mem_base);
39313	    test_ret++;
39314            printf(" %d", n_code);
39315            printf("\n");
39316        }
39317    }
39318    function_tests++;
39319#endif
39320
39321    return(test_ret);
39322}
39323
39324
39325static int
39326test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
39327    int test_ret = 0;
39328
39329#ifdef LIBXML_UNICODE_ENABLED
39330    int mem_base;
39331    int ret_val;
39332    int code; /* UCS code point */
39333    int n_code;
39334
39335    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39336        mem_base = xmlMemBlocks();
39337        code = gen_int(n_code, 0);
39338
39339        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
39340        desret_int(ret_val);
39341        call_tests++;
39342        des_int(n_code, code, 0);
39343        xmlResetLastError();
39344        if (mem_base != xmlMemBlocks()) {
39345            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
39346	           xmlMemBlocks() - mem_base);
39347	    test_ret++;
39348            printf(" %d", n_code);
39349            printf("\n");
39350        }
39351    }
39352    function_tests++;
39353#endif
39354
39355    return(test_ret);
39356}
39357
39358
39359static int
39360test_xmlUCSIsVariationSelectors(void) {
39361    int test_ret = 0;
39362
39363#ifdef LIBXML_UNICODE_ENABLED
39364    int mem_base;
39365    int ret_val;
39366    int code; /* UCS code point */
39367    int n_code;
39368
39369    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39370        mem_base = xmlMemBlocks();
39371        code = gen_int(n_code, 0);
39372
39373        ret_val = xmlUCSIsVariationSelectors(code);
39374        desret_int(ret_val);
39375        call_tests++;
39376        des_int(n_code, code, 0);
39377        xmlResetLastError();
39378        if (mem_base != xmlMemBlocks()) {
39379            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
39380	           xmlMemBlocks() - mem_base);
39381	    test_ret++;
39382            printf(" %d", n_code);
39383            printf("\n");
39384        }
39385    }
39386    function_tests++;
39387#endif
39388
39389    return(test_ret);
39390}
39391
39392
39393static int
39394test_xmlUCSIsVariationSelectorsSupplement(void) {
39395    int test_ret = 0;
39396
39397#ifdef LIBXML_UNICODE_ENABLED
39398    int mem_base;
39399    int ret_val;
39400    int code; /* UCS code point */
39401    int n_code;
39402
39403    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39404        mem_base = xmlMemBlocks();
39405        code = gen_int(n_code, 0);
39406
39407        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
39408        desret_int(ret_val);
39409        call_tests++;
39410        des_int(n_code, code, 0);
39411        xmlResetLastError();
39412        if (mem_base != xmlMemBlocks()) {
39413            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
39414	           xmlMemBlocks() - mem_base);
39415	    test_ret++;
39416            printf(" %d", n_code);
39417            printf("\n");
39418        }
39419    }
39420    function_tests++;
39421#endif
39422
39423    return(test_ret);
39424}
39425
39426
39427static int
39428test_xmlUCSIsYiRadicals(void) {
39429    int test_ret = 0;
39430
39431#ifdef LIBXML_UNICODE_ENABLED
39432    int mem_base;
39433    int ret_val;
39434    int code; /* UCS code point */
39435    int n_code;
39436
39437    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39438        mem_base = xmlMemBlocks();
39439        code = gen_int(n_code, 0);
39440
39441        ret_val = xmlUCSIsYiRadicals(code);
39442        desret_int(ret_val);
39443        call_tests++;
39444        des_int(n_code, code, 0);
39445        xmlResetLastError();
39446        if (mem_base != xmlMemBlocks()) {
39447            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
39448	           xmlMemBlocks() - mem_base);
39449	    test_ret++;
39450            printf(" %d", n_code);
39451            printf("\n");
39452        }
39453    }
39454    function_tests++;
39455#endif
39456
39457    return(test_ret);
39458}
39459
39460
39461static int
39462test_xmlUCSIsYiSyllables(void) {
39463    int test_ret = 0;
39464
39465#ifdef LIBXML_UNICODE_ENABLED
39466    int mem_base;
39467    int ret_val;
39468    int code; /* UCS code point */
39469    int n_code;
39470
39471    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39472        mem_base = xmlMemBlocks();
39473        code = gen_int(n_code, 0);
39474
39475        ret_val = xmlUCSIsYiSyllables(code);
39476        desret_int(ret_val);
39477        call_tests++;
39478        des_int(n_code, code, 0);
39479        xmlResetLastError();
39480        if (mem_base != xmlMemBlocks()) {
39481            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
39482	           xmlMemBlocks() - mem_base);
39483	    test_ret++;
39484            printf(" %d", n_code);
39485            printf("\n");
39486        }
39487    }
39488    function_tests++;
39489#endif
39490
39491    return(test_ret);
39492}
39493
39494
39495static int
39496test_xmlUCSIsYijingHexagramSymbols(void) {
39497    int test_ret = 0;
39498
39499#ifdef LIBXML_UNICODE_ENABLED
39500    int mem_base;
39501    int ret_val;
39502    int code; /* UCS code point */
39503    int n_code;
39504
39505    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39506        mem_base = xmlMemBlocks();
39507        code = gen_int(n_code, 0);
39508
39509        ret_val = xmlUCSIsYijingHexagramSymbols(code);
39510        desret_int(ret_val);
39511        call_tests++;
39512        des_int(n_code, code, 0);
39513        xmlResetLastError();
39514        if (mem_base != xmlMemBlocks()) {
39515            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
39516	           xmlMemBlocks() - mem_base);
39517	    test_ret++;
39518            printf(" %d", n_code);
39519            printf("\n");
39520        }
39521    }
39522    function_tests++;
39523#endif
39524
39525    return(test_ret);
39526}
39527
39528static int
39529test_xmlunicode(void) {
39530    int test_ret = 0;
39531
39532    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
39533    test_ret += test_xmlUCSIsAegeanNumbers();
39534    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
39535    test_ret += test_xmlUCSIsArabic();
39536    test_ret += test_xmlUCSIsArabicPresentationFormsA();
39537    test_ret += test_xmlUCSIsArabicPresentationFormsB();
39538    test_ret += test_xmlUCSIsArmenian();
39539    test_ret += test_xmlUCSIsArrows();
39540    test_ret += test_xmlUCSIsBasicLatin();
39541    test_ret += test_xmlUCSIsBengali();
39542    test_ret += test_xmlUCSIsBlock();
39543    test_ret += test_xmlUCSIsBlockElements();
39544    test_ret += test_xmlUCSIsBopomofo();
39545    test_ret += test_xmlUCSIsBopomofoExtended();
39546    test_ret += test_xmlUCSIsBoxDrawing();
39547    test_ret += test_xmlUCSIsBraillePatterns();
39548    test_ret += test_xmlUCSIsBuhid();
39549    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
39550    test_ret += test_xmlUCSIsCJKCompatibility();
39551    test_ret += test_xmlUCSIsCJKCompatibilityForms();
39552    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
39553    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
39554    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
39555    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
39556    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
39557    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
39558    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
39559    test_ret += test_xmlUCSIsCat();
39560    test_ret += test_xmlUCSIsCatC();
39561    test_ret += test_xmlUCSIsCatCc();
39562    test_ret += test_xmlUCSIsCatCf();
39563    test_ret += test_xmlUCSIsCatCo();
39564    test_ret += test_xmlUCSIsCatCs();
39565    test_ret += test_xmlUCSIsCatL();
39566    test_ret += test_xmlUCSIsCatLl();
39567    test_ret += test_xmlUCSIsCatLm();
39568    test_ret += test_xmlUCSIsCatLo();
39569    test_ret += test_xmlUCSIsCatLt();
39570    test_ret += test_xmlUCSIsCatLu();
39571    test_ret += test_xmlUCSIsCatM();
39572    test_ret += test_xmlUCSIsCatMc();
39573    test_ret += test_xmlUCSIsCatMe();
39574    test_ret += test_xmlUCSIsCatMn();
39575    test_ret += test_xmlUCSIsCatN();
39576    test_ret += test_xmlUCSIsCatNd();
39577    test_ret += test_xmlUCSIsCatNl();
39578    test_ret += test_xmlUCSIsCatNo();
39579    test_ret += test_xmlUCSIsCatP();
39580    test_ret += test_xmlUCSIsCatPc();
39581    test_ret += test_xmlUCSIsCatPd();
39582    test_ret += test_xmlUCSIsCatPe();
39583    test_ret += test_xmlUCSIsCatPf();
39584    test_ret += test_xmlUCSIsCatPi();
39585    test_ret += test_xmlUCSIsCatPo();
39586    test_ret += test_xmlUCSIsCatPs();
39587    test_ret += test_xmlUCSIsCatS();
39588    test_ret += test_xmlUCSIsCatSc();
39589    test_ret += test_xmlUCSIsCatSk();
39590    test_ret += test_xmlUCSIsCatSm();
39591    test_ret += test_xmlUCSIsCatSo();
39592    test_ret += test_xmlUCSIsCatZ();
39593    test_ret += test_xmlUCSIsCatZl();
39594    test_ret += test_xmlUCSIsCatZp();
39595    test_ret += test_xmlUCSIsCatZs();
39596    test_ret += test_xmlUCSIsCherokee();
39597    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
39598    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
39599    test_ret += test_xmlUCSIsCombiningHalfMarks();
39600    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
39601    test_ret += test_xmlUCSIsControlPictures();
39602    test_ret += test_xmlUCSIsCurrencySymbols();
39603    test_ret += test_xmlUCSIsCypriotSyllabary();
39604    test_ret += test_xmlUCSIsCyrillic();
39605    test_ret += test_xmlUCSIsCyrillicSupplement();
39606    test_ret += test_xmlUCSIsDeseret();
39607    test_ret += test_xmlUCSIsDevanagari();
39608    test_ret += test_xmlUCSIsDingbats();
39609    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
39610    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
39611    test_ret += test_xmlUCSIsEthiopic();
39612    test_ret += test_xmlUCSIsGeneralPunctuation();
39613    test_ret += test_xmlUCSIsGeometricShapes();
39614    test_ret += test_xmlUCSIsGeorgian();
39615    test_ret += test_xmlUCSIsGothic();
39616    test_ret += test_xmlUCSIsGreek();
39617    test_ret += test_xmlUCSIsGreekExtended();
39618    test_ret += test_xmlUCSIsGreekandCoptic();
39619    test_ret += test_xmlUCSIsGujarati();
39620    test_ret += test_xmlUCSIsGurmukhi();
39621    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
39622    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
39623    test_ret += test_xmlUCSIsHangulJamo();
39624    test_ret += test_xmlUCSIsHangulSyllables();
39625    test_ret += test_xmlUCSIsHanunoo();
39626    test_ret += test_xmlUCSIsHebrew();
39627    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
39628    test_ret += test_xmlUCSIsHighSurrogates();
39629    test_ret += test_xmlUCSIsHiragana();
39630    test_ret += test_xmlUCSIsIPAExtensions();
39631    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
39632    test_ret += test_xmlUCSIsKanbun();
39633    test_ret += test_xmlUCSIsKangxiRadicals();
39634    test_ret += test_xmlUCSIsKannada();
39635    test_ret += test_xmlUCSIsKatakana();
39636    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
39637    test_ret += test_xmlUCSIsKhmer();
39638    test_ret += test_xmlUCSIsKhmerSymbols();
39639    test_ret += test_xmlUCSIsLao();
39640    test_ret += test_xmlUCSIsLatin1Supplement();
39641    test_ret += test_xmlUCSIsLatinExtendedA();
39642    test_ret += test_xmlUCSIsLatinExtendedAdditional();
39643    test_ret += test_xmlUCSIsLatinExtendedB();
39644    test_ret += test_xmlUCSIsLetterlikeSymbols();
39645    test_ret += test_xmlUCSIsLimbu();
39646    test_ret += test_xmlUCSIsLinearBIdeograms();
39647    test_ret += test_xmlUCSIsLinearBSyllabary();
39648    test_ret += test_xmlUCSIsLowSurrogates();
39649    test_ret += test_xmlUCSIsMalayalam();
39650    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
39651    test_ret += test_xmlUCSIsMathematicalOperators();
39652    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
39653    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
39654    test_ret += test_xmlUCSIsMiscellaneousSymbols();
39655    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
39656    test_ret += test_xmlUCSIsMiscellaneousTechnical();
39657    test_ret += test_xmlUCSIsMongolian();
39658    test_ret += test_xmlUCSIsMusicalSymbols();
39659    test_ret += test_xmlUCSIsMyanmar();
39660    test_ret += test_xmlUCSIsNumberForms();
39661    test_ret += test_xmlUCSIsOgham();
39662    test_ret += test_xmlUCSIsOldItalic();
39663    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
39664    test_ret += test_xmlUCSIsOriya();
39665    test_ret += test_xmlUCSIsOsmanya();
39666    test_ret += test_xmlUCSIsPhoneticExtensions();
39667    test_ret += test_xmlUCSIsPrivateUse();
39668    test_ret += test_xmlUCSIsPrivateUseArea();
39669    test_ret += test_xmlUCSIsRunic();
39670    test_ret += test_xmlUCSIsShavian();
39671    test_ret += test_xmlUCSIsSinhala();
39672    test_ret += test_xmlUCSIsSmallFormVariants();
39673    test_ret += test_xmlUCSIsSpacingModifierLetters();
39674    test_ret += test_xmlUCSIsSpecials();
39675    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
39676    test_ret += test_xmlUCSIsSupplementalArrowsA();
39677    test_ret += test_xmlUCSIsSupplementalArrowsB();
39678    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
39679    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
39680    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
39681    test_ret += test_xmlUCSIsSyriac();
39682    test_ret += test_xmlUCSIsTagalog();
39683    test_ret += test_xmlUCSIsTagbanwa();
39684    test_ret += test_xmlUCSIsTags();
39685    test_ret += test_xmlUCSIsTaiLe();
39686    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
39687    test_ret += test_xmlUCSIsTamil();
39688    test_ret += test_xmlUCSIsTelugu();
39689    test_ret += test_xmlUCSIsThaana();
39690    test_ret += test_xmlUCSIsThai();
39691    test_ret += test_xmlUCSIsTibetan();
39692    test_ret += test_xmlUCSIsUgaritic();
39693    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
39694    test_ret += test_xmlUCSIsVariationSelectors();
39695    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
39696    test_ret += test_xmlUCSIsYiRadicals();
39697    test_ret += test_xmlUCSIsYiSyllables();
39698    test_ret += test_xmlUCSIsYijingHexagramSymbols();
39699
39700    if (test_ret != 0)
39701	printf("Module xmlunicode: %d errors\n", test_ret);
39702    return(test_ret);
39703}
39704
39705static int
39706test_xmlNewTextWriter(void) {
39707    int test_ret = 0;
39708
39709#ifdef LIBXML_WRITER_ENABLED
39710    int mem_base;
39711    xmlTextWriterPtr ret_val;
39712    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
39713    int n_out;
39714
39715    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
39716        mem_base = xmlMemBlocks();
39717        out = gen_xmlOutputBufferPtr(n_out, 0);
39718
39719        ret_val = xmlNewTextWriter(out);
39720        if (ret_val != NULL) out = NULL;
39721        desret_xmlTextWriterPtr(ret_val);
39722        call_tests++;
39723        des_xmlOutputBufferPtr(n_out, out, 0);
39724        xmlResetLastError();
39725        if (mem_base != xmlMemBlocks()) {
39726            printf("Leak of %d blocks found in xmlNewTextWriter",
39727	           xmlMemBlocks() - mem_base);
39728	    test_ret++;
39729            printf(" %d", n_out);
39730            printf("\n");
39731        }
39732    }
39733    function_tests++;
39734#endif
39735
39736    return(test_ret);
39737}
39738
39739
39740static int
39741test_xmlNewTextWriterFilename(void) {
39742    int test_ret = 0;
39743
39744#ifdef LIBXML_WRITER_ENABLED
39745    int mem_base;
39746    xmlTextWriterPtr ret_val;
39747    const char * uri; /* the URI of the resource for the output */
39748    int n_uri;
39749    int compression; /* compress the output? */
39750    int n_compression;
39751
39752    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
39753    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39754        mem_base = xmlMemBlocks();
39755        uri = gen_fileoutput(n_uri, 0);
39756        compression = gen_int(n_compression, 1);
39757
39758        ret_val = xmlNewTextWriterFilename(uri, compression);
39759        desret_xmlTextWriterPtr(ret_val);
39760        call_tests++;
39761        des_fileoutput(n_uri, uri, 0);
39762        des_int(n_compression, compression, 1);
39763        xmlResetLastError();
39764        if (mem_base != xmlMemBlocks()) {
39765            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
39766	           xmlMemBlocks() - mem_base);
39767	    test_ret++;
39768            printf(" %d", n_uri);
39769            printf(" %d", n_compression);
39770            printf("\n");
39771        }
39772    }
39773    }
39774    function_tests++;
39775#endif
39776
39777    return(test_ret);
39778}
39779
39780
39781static int
39782test_xmlNewTextWriterMemory(void) {
39783    int test_ret = 0;
39784
39785#ifdef LIBXML_WRITER_ENABLED
39786    int mem_base;
39787    xmlTextWriterPtr ret_val;
39788    xmlBufferPtr buf; /* xmlBufferPtr */
39789    int n_buf;
39790    int compression; /* compress the output? */
39791    int n_compression;
39792
39793    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
39794    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39795        mem_base = xmlMemBlocks();
39796        buf = gen_xmlBufferPtr(n_buf, 0);
39797        compression = gen_int(n_compression, 1);
39798
39799        ret_val = xmlNewTextWriterMemory(buf, compression);
39800        desret_xmlTextWriterPtr(ret_val);
39801        call_tests++;
39802        des_xmlBufferPtr(n_buf, buf, 0);
39803        des_int(n_compression, compression, 1);
39804        xmlResetLastError();
39805        if (mem_base != xmlMemBlocks()) {
39806            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
39807	           xmlMemBlocks() - mem_base);
39808	    test_ret++;
39809            printf(" %d", n_buf);
39810            printf(" %d", n_compression);
39811            printf("\n");
39812        }
39813    }
39814    }
39815    function_tests++;
39816#endif
39817
39818    return(test_ret);
39819}
39820
39821
39822static int
39823test_xmlNewTextWriterPushParser(void) {
39824    int test_ret = 0;
39825
39826#ifdef LIBXML_WRITER_ENABLED
39827    int mem_base;
39828    xmlTextWriterPtr ret_val;
39829    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
39830    int n_ctxt;
39831    int compression; /* compress the output? */
39832    int n_compression;
39833
39834    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
39835    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39836        mem_base = xmlMemBlocks();
39837        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
39838        compression = gen_int(n_compression, 1);
39839
39840        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
39841        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
39842        desret_xmlTextWriterPtr(ret_val);
39843        call_tests++;
39844        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
39845        des_int(n_compression, compression, 1);
39846        xmlResetLastError();
39847        if (mem_base != xmlMemBlocks()) {
39848            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
39849	           xmlMemBlocks() - mem_base);
39850	    test_ret++;
39851            printf(" %d", n_ctxt);
39852            printf(" %d", n_compression);
39853            printf("\n");
39854        }
39855    }
39856    }
39857    function_tests++;
39858#endif
39859
39860    return(test_ret);
39861}
39862
39863
39864static int
39865test_xmlNewTextWriterTree(void) {
39866    int test_ret = 0;
39867
39868#ifdef LIBXML_WRITER_ENABLED
39869    int mem_base;
39870    xmlTextWriterPtr ret_val;
39871    xmlDocPtr doc; /* xmlDocPtr */
39872    int n_doc;
39873    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
39874    int n_node;
39875    int compression; /* compress the output? */
39876    int n_compression;
39877
39878    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
39879    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
39880    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
39881        mem_base = xmlMemBlocks();
39882        doc = gen_xmlDocPtr(n_doc, 0);
39883        node = gen_xmlNodePtr(n_node, 1);
39884        compression = gen_int(n_compression, 2);
39885
39886        ret_val = xmlNewTextWriterTree(doc, node, compression);
39887        desret_xmlTextWriterPtr(ret_val);
39888        call_tests++;
39889        des_xmlDocPtr(n_doc, doc, 0);
39890        des_xmlNodePtr(n_node, node, 1);
39891        des_int(n_compression, compression, 2);
39892        xmlResetLastError();
39893        if (mem_base != xmlMemBlocks()) {
39894            printf("Leak of %d blocks found in xmlNewTextWriterTree",
39895	           xmlMemBlocks() - mem_base);
39896	    test_ret++;
39897            printf(" %d", n_doc);
39898            printf(" %d", n_node);
39899            printf(" %d", n_compression);
39900            printf("\n");
39901        }
39902    }
39903    }
39904    }
39905    function_tests++;
39906#endif
39907
39908    return(test_ret);
39909}
39910
39911
39912static int
39913test_xmlTextWriterEndAttribute(void) {
39914    int test_ret = 0;
39915
39916#ifdef LIBXML_WRITER_ENABLED
39917    int mem_base;
39918    int ret_val;
39919    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39920    int n_writer;
39921
39922    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39923        mem_base = xmlMemBlocks();
39924        writer = gen_xmlTextWriterPtr(n_writer, 0);
39925
39926        ret_val = xmlTextWriterEndAttribute(writer);
39927        desret_int(ret_val);
39928        call_tests++;
39929        des_xmlTextWriterPtr(n_writer, writer, 0);
39930        xmlResetLastError();
39931        if (mem_base != xmlMemBlocks()) {
39932            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
39933	           xmlMemBlocks() - mem_base);
39934	    test_ret++;
39935            printf(" %d", n_writer);
39936            printf("\n");
39937        }
39938    }
39939    function_tests++;
39940#endif
39941
39942    return(test_ret);
39943}
39944
39945
39946static int
39947test_xmlTextWriterEndCDATA(void) {
39948    int test_ret = 0;
39949
39950#ifdef LIBXML_WRITER_ENABLED
39951    int mem_base;
39952    int ret_val;
39953    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39954    int n_writer;
39955
39956    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39957        mem_base = xmlMemBlocks();
39958        writer = gen_xmlTextWriterPtr(n_writer, 0);
39959
39960        ret_val = xmlTextWriterEndCDATA(writer);
39961        desret_int(ret_val);
39962        call_tests++;
39963        des_xmlTextWriterPtr(n_writer, writer, 0);
39964        xmlResetLastError();
39965        if (mem_base != xmlMemBlocks()) {
39966            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
39967	           xmlMemBlocks() - mem_base);
39968	    test_ret++;
39969            printf(" %d", n_writer);
39970            printf("\n");
39971        }
39972    }
39973    function_tests++;
39974#endif
39975
39976    return(test_ret);
39977}
39978
39979
39980static int
39981test_xmlTextWriterEndComment(void) {
39982    int test_ret = 0;
39983
39984#ifdef LIBXML_WRITER_ENABLED
39985    int mem_base;
39986    int ret_val;
39987    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
39988    int n_writer;
39989
39990    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
39991        mem_base = xmlMemBlocks();
39992        writer = gen_xmlTextWriterPtr(n_writer, 0);
39993
39994        ret_val = xmlTextWriterEndComment(writer);
39995        desret_int(ret_val);
39996        call_tests++;
39997        des_xmlTextWriterPtr(n_writer, writer, 0);
39998        xmlResetLastError();
39999        if (mem_base != xmlMemBlocks()) {
40000            printf("Leak of %d blocks found in xmlTextWriterEndComment",
40001	           xmlMemBlocks() - mem_base);
40002	    test_ret++;
40003            printf(" %d", n_writer);
40004            printf("\n");
40005        }
40006    }
40007    function_tests++;
40008#endif
40009
40010    return(test_ret);
40011}
40012
40013
40014static int
40015test_xmlTextWriterEndDTD(void) {
40016    int test_ret = 0;
40017
40018#ifdef LIBXML_WRITER_ENABLED
40019    int mem_base;
40020    int ret_val;
40021    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40022    int n_writer;
40023
40024    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40025        mem_base = xmlMemBlocks();
40026        writer = gen_xmlTextWriterPtr(n_writer, 0);
40027
40028        ret_val = xmlTextWriterEndDTD(writer);
40029        desret_int(ret_val);
40030        call_tests++;
40031        des_xmlTextWriterPtr(n_writer, writer, 0);
40032        xmlResetLastError();
40033        if (mem_base != xmlMemBlocks()) {
40034            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
40035	           xmlMemBlocks() - mem_base);
40036	    test_ret++;
40037            printf(" %d", n_writer);
40038            printf("\n");
40039        }
40040    }
40041    function_tests++;
40042#endif
40043
40044    return(test_ret);
40045}
40046
40047
40048static int
40049test_xmlTextWriterEndDTDAttlist(void) {
40050    int test_ret = 0;
40051
40052#ifdef LIBXML_WRITER_ENABLED
40053    int mem_base;
40054    int ret_val;
40055    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40056    int n_writer;
40057
40058    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40059        mem_base = xmlMemBlocks();
40060        writer = gen_xmlTextWriterPtr(n_writer, 0);
40061
40062        ret_val = xmlTextWriterEndDTDAttlist(writer);
40063        desret_int(ret_val);
40064        call_tests++;
40065        des_xmlTextWriterPtr(n_writer, writer, 0);
40066        xmlResetLastError();
40067        if (mem_base != xmlMemBlocks()) {
40068            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
40069	           xmlMemBlocks() - mem_base);
40070	    test_ret++;
40071            printf(" %d", n_writer);
40072            printf("\n");
40073        }
40074    }
40075    function_tests++;
40076#endif
40077
40078    return(test_ret);
40079}
40080
40081
40082static int
40083test_xmlTextWriterEndDTDElement(void) {
40084    int test_ret = 0;
40085
40086#ifdef LIBXML_WRITER_ENABLED
40087    int mem_base;
40088    int ret_val;
40089    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40090    int n_writer;
40091
40092    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40093        mem_base = xmlMemBlocks();
40094        writer = gen_xmlTextWriterPtr(n_writer, 0);
40095
40096        ret_val = xmlTextWriterEndDTDElement(writer);
40097        desret_int(ret_val);
40098        call_tests++;
40099        des_xmlTextWriterPtr(n_writer, writer, 0);
40100        xmlResetLastError();
40101        if (mem_base != xmlMemBlocks()) {
40102            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
40103	           xmlMemBlocks() - mem_base);
40104	    test_ret++;
40105            printf(" %d", n_writer);
40106            printf("\n");
40107        }
40108    }
40109    function_tests++;
40110#endif
40111
40112    return(test_ret);
40113}
40114
40115
40116static int
40117test_xmlTextWriterEndDTDEntity(void) {
40118    int test_ret = 0;
40119
40120#ifdef LIBXML_WRITER_ENABLED
40121    int mem_base;
40122    int ret_val;
40123    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40124    int n_writer;
40125
40126    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40127        mem_base = xmlMemBlocks();
40128        writer = gen_xmlTextWriterPtr(n_writer, 0);
40129
40130        ret_val = xmlTextWriterEndDTDEntity(writer);
40131        desret_int(ret_val);
40132        call_tests++;
40133        des_xmlTextWriterPtr(n_writer, writer, 0);
40134        xmlResetLastError();
40135        if (mem_base != xmlMemBlocks()) {
40136            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
40137	           xmlMemBlocks() - mem_base);
40138	    test_ret++;
40139            printf(" %d", n_writer);
40140            printf("\n");
40141        }
40142    }
40143    function_tests++;
40144#endif
40145
40146    return(test_ret);
40147}
40148
40149
40150static int
40151test_xmlTextWriterEndDocument(void) {
40152    int test_ret = 0;
40153
40154#ifdef LIBXML_WRITER_ENABLED
40155    int mem_base;
40156    int ret_val;
40157    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40158    int n_writer;
40159
40160    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40161        mem_base = xmlMemBlocks();
40162        writer = gen_xmlTextWriterPtr(n_writer, 0);
40163
40164        ret_val = xmlTextWriterEndDocument(writer);
40165        desret_int(ret_val);
40166        call_tests++;
40167        des_xmlTextWriterPtr(n_writer, writer, 0);
40168        xmlResetLastError();
40169        if (mem_base != xmlMemBlocks()) {
40170            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
40171	           xmlMemBlocks() - mem_base);
40172	    test_ret++;
40173            printf(" %d", n_writer);
40174            printf("\n");
40175        }
40176    }
40177    function_tests++;
40178#endif
40179
40180    return(test_ret);
40181}
40182
40183
40184static int
40185test_xmlTextWriterEndElement(void) {
40186    int test_ret = 0;
40187
40188#ifdef LIBXML_WRITER_ENABLED
40189    int mem_base;
40190    int ret_val;
40191    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40192    int n_writer;
40193
40194    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40195        mem_base = xmlMemBlocks();
40196        writer = gen_xmlTextWriterPtr(n_writer, 0);
40197
40198        ret_val = xmlTextWriterEndElement(writer);
40199        desret_int(ret_val);
40200        call_tests++;
40201        des_xmlTextWriterPtr(n_writer, writer, 0);
40202        xmlResetLastError();
40203        if (mem_base != xmlMemBlocks()) {
40204            printf("Leak of %d blocks found in xmlTextWriterEndElement",
40205	           xmlMemBlocks() - mem_base);
40206	    test_ret++;
40207            printf(" %d", n_writer);
40208            printf("\n");
40209        }
40210    }
40211    function_tests++;
40212#endif
40213
40214    return(test_ret);
40215}
40216
40217
40218static int
40219test_xmlTextWriterEndPI(void) {
40220    int test_ret = 0;
40221
40222#ifdef LIBXML_WRITER_ENABLED
40223    int mem_base;
40224    int ret_val;
40225    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40226    int n_writer;
40227
40228    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40229        mem_base = xmlMemBlocks();
40230        writer = gen_xmlTextWriterPtr(n_writer, 0);
40231
40232        ret_val = xmlTextWriterEndPI(writer);
40233        desret_int(ret_val);
40234        call_tests++;
40235        des_xmlTextWriterPtr(n_writer, writer, 0);
40236        xmlResetLastError();
40237        if (mem_base != xmlMemBlocks()) {
40238            printf("Leak of %d blocks found in xmlTextWriterEndPI",
40239	           xmlMemBlocks() - mem_base);
40240	    test_ret++;
40241            printf(" %d", n_writer);
40242            printf("\n");
40243        }
40244    }
40245    function_tests++;
40246#endif
40247
40248    return(test_ret);
40249}
40250
40251
40252static int
40253test_xmlTextWriterFlush(void) {
40254    int test_ret = 0;
40255
40256#ifdef LIBXML_WRITER_ENABLED
40257    int mem_base;
40258    int ret_val;
40259    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40260    int n_writer;
40261
40262    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40263        mem_base = xmlMemBlocks();
40264        writer = gen_xmlTextWriterPtr(n_writer, 0);
40265
40266        ret_val = xmlTextWriterFlush(writer);
40267        desret_int(ret_val);
40268        call_tests++;
40269        des_xmlTextWriterPtr(n_writer, writer, 0);
40270        xmlResetLastError();
40271        if (mem_base != xmlMemBlocks()) {
40272            printf("Leak of %d blocks found in xmlTextWriterFlush",
40273	           xmlMemBlocks() - mem_base);
40274	    test_ret++;
40275            printf(" %d", n_writer);
40276            printf("\n");
40277        }
40278    }
40279    function_tests++;
40280#endif
40281
40282    return(test_ret);
40283}
40284
40285
40286static int
40287test_xmlTextWriterFullEndElement(void) {
40288    int test_ret = 0;
40289
40290#ifdef LIBXML_WRITER_ENABLED
40291    int mem_base;
40292    int ret_val;
40293    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40294    int n_writer;
40295
40296    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40297        mem_base = xmlMemBlocks();
40298        writer = gen_xmlTextWriterPtr(n_writer, 0);
40299
40300        ret_val = xmlTextWriterFullEndElement(writer);
40301        desret_int(ret_val);
40302        call_tests++;
40303        des_xmlTextWriterPtr(n_writer, writer, 0);
40304        xmlResetLastError();
40305        if (mem_base != xmlMemBlocks()) {
40306            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
40307	           xmlMemBlocks() - mem_base);
40308	    test_ret++;
40309            printf(" %d", n_writer);
40310            printf("\n");
40311        }
40312    }
40313    function_tests++;
40314#endif
40315
40316    return(test_ret);
40317}
40318
40319
40320static int
40321test_xmlTextWriterSetIndent(void) {
40322    int test_ret = 0;
40323
40324#ifdef LIBXML_WRITER_ENABLED
40325    int mem_base;
40326    int ret_val;
40327    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40328    int n_writer;
40329    int indent; /* do indentation? */
40330    int n_indent;
40331
40332    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40333    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
40334        mem_base = xmlMemBlocks();
40335        writer = gen_xmlTextWriterPtr(n_writer, 0);
40336        indent = gen_int(n_indent, 1);
40337
40338        ret_val = xmlTextWriterSetIndent(writer, indent);
40339        desret_int(ret_val);
40340        call_tests++;
40341        des_xmlTextWriterPtr(n_writer, writer, 0);
40342        des_int(n_indent, indent, 1);
40343        xmlResetLastError();
40344        if (mem_base != xmlMemBlocks()) {
40345            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
40346	           xmlMemBlocks() - mem_base);
40347	    test_ret++;
40348            printf(" %d", n_writer);
40349            printf(" %d", n_indent);
40350            printf("\n");
40351        }
40352    }
40353    }
40354    function_tests++;
40355#endif
40356
40357    return(test_ret);
40358}
40359
40360
40361static int
40362test_xmlTextWriterSetIndentString(void) {
40363    int test_ret = 0;
40364
40365#ifdef LIBXML_WRITER_ENABLED
40366    int mem_base;
40367    int ret_val;
40368    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40369    int n_writer;
40370    xmlChar * str; /* the xmlChar string */
40371    int n_str;
40372
40373    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40374    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
40375        mem_base = xmlMemBlocks();
40376        writer = gen_xmlTextWriterPtr(n_writer, 0);
40377        str = gen_const_xmlChar_ptr(n_str, 1);
40378
40379        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
40380        desret_int(ret_val);
40381        call_tests++;
40382        des_xmlTextWriterPtr(n_writer, writer, 0);
40383        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
40384        xmlResetLastError();
40385        if (mem_base != xmlMemBlocks()) {
40386            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
40387	           xmlMemBlocks() - mem_base);
40388	    test_ret++;
40389            printf(" %d", n_writer);
40390            printf(" %d", n_str);
40391            printf("\n");
40392        }
40393    }
40394    }
40395    function_tests++;
40396#endif
40397
40398    return(test_ret);
40399}
40400
40401
40402static int
40403test_xmlTextWriterStartAttribute(void) {
40404    int test_ret = 0;
40405
40406#ifdef LIBXML_WRITER_ENABLED
40407    int mem_base;
40408    int ret_val;
40409    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40410    int n_writer;
40411    xmlChar * name; /* element name */
40412    int n_name;
40413
40414    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40415    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40416        mem_base = xmlMemBlocks();
40417        writer = gen_xmlTextWriterPtr(n_writer, 0);
40418        name = gen_const_xmlChar_ptr(n_name, 1);
40419
40420        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
40421        desret_int(ret_val);
40422        call_tests++;
40423        des_xmlTextWriterPtr(n_writer, writer, 0);
40424        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
40425        xmlResetLastError();
40426        if (mem_base != xmlMemBlocks()) {
40427            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
40428	           xmlMemBlocks() - mem_base);
40429	    test_ret++;
40430            printf(" %d", n_writer);
40431            printf(" %d", n_name);
40432            printf("\n");
40433        }
40434    }
40435    }
40436    function_tests++;
40437#endif
40438
40439    return(test_ret);
40440}
40441
40442
40443static int
40444test_xmlTextWriterStartAttributeNS(void) {
40445    int test_ret = 0;
40446
40447#ifdef LIBXML_WRITER_ENABLED
40448    int mem_base;
40449    int ret_val;
40450    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40451    int n_writer;
40452    xmlChar * prefix; /* namespace prefix or NULL */
40453    int n_prefix;
40454    xmlChar * name; /* element local name */
40455    int n_name;
40456    xmlChar * namespaceURI; /* namespace URI or NULL */
40457    int n_namespaceURI;
40458
40459    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40460    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
40461    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40462    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
40463        mem_base = xmlMemBlocks();
40464        writer = gen_xmlTextWriterPtr(n_writer, 0);
40465        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
40466        name = gen_const_xmlChar_ptr(n_name, 2);
40467        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
40468
40469        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
40470        desret_int(ret_val);
40471        call_tests++;
40472        des_xmlTextWriterPtr(n_writer, writer, 0);
40473        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
40474        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
40475        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
40476        xmlResetLastError();
40477        if (mem_base != xmlMemBlocks()) {
40478            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
40479	           xmlMemBlocks() - mem_base);
40480	    test_ret++;
40481            printf(" %d", n_writer);
40482            printf(" %d", n_prefix);
40483            printf(" %d", n_name);
40484            printf(" %d", n_namespaceURI);
40485            printf("\n");
40486        }
40487    }
40488    }
40489    }
40490    }
40491    function_tests++;
40492#endif
40493
40494    return(test_ret);
40495}
40496
40497
40498static int
40499test_xmlTextWriterStartCDATA(void) {
40500    int test_ret = 0;
40501
40502#ifdef LIBXML_WRITER_ENABLED
40503    int mem_base;
40504    int ret_val;
40505    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40506    int n_writer;
40507
40508    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40509        mem_base = xmlMemBlocks();
40510        writer = gen_xmlTextWriterPtr(n_writer, 0);
40511
40512        ret_val = xmlTextWriterStartCDATA(writer);
40513        desret_int(ret_val);
40514        call_tests++;
40515        des_xmlTextWriterPtr(n_writer, writer, 0);
40516        xmlResetLastError();
40517        if (mem_base != xmlMemBlocks()) {
40518            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
40519	           xmlMemBlocks() - mem_base);
40520	    test_ret++;
40521            printf(" %d", n_writer);
40522            printf("\n");
40523        }
40524    }
40525    function_tests++;
40526#endif
40527
40528    return(test_ret);
40529}
40530
40531
40532static int
40533test_xmlTextWriterStartComment(void) {
40534    int test_ret = 0;
40535
40536#ifdef LIBXML_WRITER_ENABLED
40537    int mem_base;
40538    int ret_val;
40539    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40540    int n_writer;
40541
40542    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40543        mem_base = xmlMemBlocks();
40544        writer = gen_xmlTextWriterPtr(n_writer, 0);
40545
40546        ret_val = xmlTextWriterStartComment(writer);
40547        desret_int(ret_val);
40548        call_tests++;
40549        des_xmlTextWriterPtr(n_writer, writer, 0);
40550        xmlResetLastError();
40551        if (mem_base != xmlMemBlocks()) {
40552            printf("Leak of %d blocks found in xmlTextWriterStartComment",
40553	           xmlMemBlocks() - mem_base);
40554	    test_ret++;
40555            printf(" %d", n_writer);
40556            printf("\n");
40557        }
40558    }
40559    function_tests++;
40560#endif
40561
40562    return(test_ret);
40563}
40564
40565
40566static int
40567test_xmlTextWriterStartDTD(void) {
40568    int test_ret = 0;
40569
40570#ifdef LIBXML_WRITER_ENABLED
40571    int mem_base;
40572    int ret_val;
40573    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40574    int n_writer;
40575    xmlChar * name; /* the name of the DTD */
40576    int n_name;
40577    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
40578    int n_pubid;
40579    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
40580    int n_sysid;
40581
40582    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40583    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40584    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
40585    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
40586        mem_base = xmlMemBlocks();
40587        writer = gen_xmlTextWriterPtr(n_writer, 0);
40588        name = gen_const_xmlChar_ptr(n_name, 1);
40589        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
40590        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
40591
40592        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
40593        desret_int(ret_val);
40594        call_tests++;
40595        des_xmlTextWriterPtr(n_writer, writer, 0);
40596        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
40597        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
40598        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
40599        xmlResetLastError();
40600        if (mem_base != xmlMemBlocks()) {
40601            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
40602	           xmlMemBlocks() - mem_base);
40603	    test_ret++;
40604            printf(" %d", n_writer);
40605            printf(" %d", n_name);
40606            printf(" %d", n_pubid);
40607            printf(" %d", n_sysid);
40608            printf("\n");
40609        }
40610    }
40611    }
40612    }
40613    }
40614    function_tests++;
40615#endif
40616
40617    return(test_ret);
40618}
40619
40620
40621static int
40622test_xmlTextWriterStartDTDAttlist(void) {
40623    int test_ret = 0;
40624
40625#ifdef LIBXML_WRITER_ENABLED
40626    int mem_base;
40627    int ret_val;
40628    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40629    int n_writer;
40630    xmlChar * name; /* the name of the DTD ATTLIST */
40631    int n_name;
40632
40633    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40634    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40635        mem_base = xmlMemBlocks();
40636        writer = gen_xmlTextWriterPtr(n_writer, 0);
40637        name = gen_const_xmlChar_ptr(n_name, 1);
40638
40639        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
40640        desret_int(ret_val);
40641        call_tests++;
40642        des_xmlTextWriterPtr(n_writer, writer, 0);
40643        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
40644        xmlResetLastError();
40645        if (mem_base != xmlMemBlocks()) {
40646            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
40647	           xmlMemBlocks() - mem_base);
40648	    test_ret++;
40649            printf(" %d", n_writer);
40650            printf(" %d", n_name);
40651            printf("\n");
40652        }
40653    }
40654    }
40655    function_tests++;
40656#endif
40657
40658    return(test_ret);
40659}
40660
40661
40662static int
40663test_xmlTextWriterStartDTDElement(void) {
40664    int test_ret = 0;
40665
40666#ifdef LIBXML_WRITER_ENABLED
40667    int mem_base;
40668    int ret_val;
40669    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40670    int n_writer;
40671    xmlChar * name; /* the name of the DTD element */
40672    int n_name;
40673
40674    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40675    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40676        mem_base = xmlMemBlocks();
40677        writer = gen_xmlTextWriterPtr(n_writer, 0);
40678        name = gen_const_xmlChar_ptr(n_name, 1);
40679
40680        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
40681        desret_int(ret_val);
40682        call_tests++;
40683        des_xmlTextWriterPtr(n_writer, writer, 0);
40684        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
40685        xmlResetLastError();
40686        if (mem_base != xmlMemBlocks()) {
40687            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
40688	           xmlMemBlocks() - mem_base);
40689	    test_ret++;
40690            printf(" %d", n_writer);
40691            printf(" %d", n_name);
40692            printf("\n");
40693        }
40694    }
40695    }
40696    function_tests++;
40697#endif
40698
40699    return(test_ret);
40700}
40701
40702
40703static int
40704test_xmlTextWriterStartDTDEntity(void) {
40705    int test_ret = 0;
40706
40707#ifdef LIBXML_WRITER_ENABLED
40708    int mem_base;
40709    int ret_val;
40710    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40711    int n_writer;
40712    int pe; /* TRUE if this is a parameter entity, FALSE if not */
40713    int n_pe;
40714    xmlChar * name; /* the name of the DTD ATTLIST */
40715    int n_name;
40716
40717    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40718    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
40719    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40720        mem_base = xmlMemBlocks();
40721        writer = gen_xmlTextWriterPtr(n_writer, 0);
40722        pe = gen_int(n_pe, 1);
40723        name = gen_const_xmlChar_ptr(n_name, 2);
40724
40725        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
40726        desret_int(ret_val);
40727        call_tests++;
40728        des_xmlTextWriterPtr(n_writer, writer, 0);
40729        des_int(n_pe, pe, 1);
40730        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
40731        xmlResetLastError();
40732        if (mem_base != xmlMemBlocks()) {
40733            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
40734	           xmlMemBlocks() - mem_base);
40735	    test_ret++;
40736            printf(" %d", n_writer);
40737            printf(" %d", n_pe);
40738            printf(" %d", n_name);
40739            printf("\n");
40740        }
40741    }
40742    }
40743    }
40744    function_tests++;
40745#endif
40746
40747    return(test_ret);
40748}
40749
40750
40751static int
40752test_xmlTextWriterStartDocument(void) {
40753    int test_ret = 0;
40754
40755#ifdef LIBXML_WRITER_ENABLED
40756    int mem_base;
40757    int ret_val;
40758    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40759    int n_writer;
40760    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
40761    int n_version;
40762    char * encoding; /* the encoding or NULL for default */
40763    int n_encoding;
40764    char * standalone; /* "yes" or "no" or NULL for default */
40765    int n_standalone;
40766
40767    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40768    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
40769    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
40770    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
40771        mem_base = xmlMemBlocks();
40772        writer = gen_xmlTextWriterPtr(n_writer, 0);
40773        version = gen_const_char_ptr(n_version, 1);
40774        encoding = gen_const_char_ptr(n_encoding, 2);
40775        standalone = gen_const_char_ptr(n_standalone, 3);
40776
40777        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
40778        desret_int(ret_val);
40779        call_tests++;
40780        des_xmlTextWriterPtr(n_writer, writer, 0);
40781        des_const_char_ptr(n_version, (const char *)version, 1);
40782        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
40783        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
40784        xmlResetLastError();
40785        if (mem_base != xmlMemBlocks()) {
40786            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
40787	           xmlMemBlocks() - mem_base);
40788	    test_ret++;
40789            printf(" %d", n_writer);
40790            printf(" %d", n_version);
40791            printf(" %d", n_encoding);
40792            printf(" %d", n_standalone);
40793            printf("\n");
40794        }
40795    }
40796    }
40797    }
40798    }
40799    function_tests++;
40800#endif
40801
40802    return(test_ret);
40803}
40804
40805
40806static int
40807test_xmlTextWriterStartElement(void) {
40808    int test_ret = 0;
40809
40810#ifdef LIBXML_WRITER_ENABLED
40811    int mem_base;
40812    int ret_val;
40813    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40814    int n_writer;
40815    xmlChar * name; /* element name */
40816    int n_name;
40817
40818    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40819    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40820        mem_base = xmlMemBlocks();
40821        writer = gen_xmlTextWriterPtr(n_writer, 0);
40822        name = gen_const_xmlChar_ptr(n_name, 1);
40823
40824        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
40825        desret_int(ret_val);
40826        call_tests++;
40827        des_xmlTextWriterPtr(n_writer, writer, 0);
40828        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
40829        xmlResetLastError();
40830        if (mem_base != xmlMemBlocks()) {
40831            printf("Leak of %d blocks found in xmlTextWriterStartElement",
40832	           xmlMemBlocks() - mem_base);
40833	    test_ret++;
40834            printf(" %d", n_writer);
40835            printf(" %d", n_name);
40836            printf("\n");
40837        }
40838    }
40839    }
40840    function_tests++;
40841#endif
40842
40843    return(test_ret);
40844}
40845
40846
40847static int
40848test_xmlTextWriterStartElementNS(void) {
40849    int test_ret = 0;
40850
40851#ifdef LIBXML_WRITER_ENABLED
40852    int mem_base;
40853    int ret_val;
40854    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40855    int n_writer;
40856    xmlChar * prefix; /* namespace prefix or NULL */
40857    int n_prefix;
40858    xmlChar * name; /* element local name */
40859    int n_name;
40860    xmlChar * namespaceURI; /* namespace URI or NULL */
40861    int n_namespaceURI;
40862
40863    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40864    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
40865    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40866    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
40867        mem_base = xmlMemBlocks();
40868        writer = gen_xmlTextWriterPtr(n_writer, 0);
40869        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
40870        name = gen_const_xmlChar_ptr(n_name, 2);
40871        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
40872
40873        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
40874        desret_int(ret_val);
40875        call_tests++;
40876        des_xmlTextWriterPtr(n_writer, writer, 0);
40877        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
40878        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
40879        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
40880        xmlResetLastError();
40881        if (mem_base != xmlMemBlocks()) {
40882            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
40883	           xmlMemBlocks() - mem_base);
40884	    test_ret++;
40885            printf(" %d", n_writer);
40886            printf(" %d", n_prefix);
40887            printf(" %d", n_name);
40888            printf(" %d", n_namespaceURI);
40889            printf("\n");
40890        }
40891    }
40892    }
40893    }
40894    }
40895    function_tests++;
40896#endif
40897
40898    return(test_ret);
40899}
40900
40901
40902static int
40903test_xmlTextWriterStartPI(void) {
40904    int test_ret = 0;
40905
40906#ifdef LIBXML_WRITER_ENABLED
40907    int mem_base;
40908    int ret_val;
40909    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40910    int n_writer;
40911    xmlChar * target; /* PI target */
40912    int n_target;
40913
40914    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40915    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
40916        mem_base = xmlMemBlocks();
40917        writer = gen_xmlTextWriterPtr(n_writer, 0);
40918        target = gen_const_xmlChar_ptr(n_target, 1);
40919
40920        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
40921        desret_int(ret_val);
40922        call_tests++;
40923        des_xmlTextWriterPtr(n_writer, writer, 0);
40924        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
40925        xmlResetLastError();
40926        if (mem_base != xmlMemBlocks()) {
40927            printf("Leak of %d blocks found in xmlTextWriterStartPI",
40928	           xmlMemBlocks() - mem_base);
40929	    test_ret++;
40930            printf(" %d", n_writer);
40931            printf(" %d", n_target);
40932            printf("\n");
40933        }
40934    }
40935    }
40936    function_tests++;
40937#endif
40938
40939    return(test_ret);
40940}
40941
40942
40943static int
40944test_xmlTextWriterWriteAttribute(void) {
40945    int test_ret = 0;
40946
40947#ifdef LIBXML_WRITER_ENABLED
40948    int mem_base;
40949    int ret_val;
40950    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40951    int n_writer;
40952    xmlChar * name; /* attribute name */
40953    int n_name;
40954    xmlChar * content; /* attribute content */
40955    int n_content;
40956
40957    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
40958    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
40959    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
40960        mem_base = xmlMemBlocks();
40961        writer = gen_xmlTextWriterPtr(n_writer, 0);
40962        name = gen_const_xmlChar_ptr(n_name, 1);
40963        content = gen_const_xmlChar_ptr(n_content, 2);
40964
40965        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
40966        desret_int(ret_val);
40967        call_tests++;
40968        des_xmlTextWriterPtr(n_writer, writer, 0);
40969        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
40970        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
40971        xmlResetLastError();
40972        if (mem_base != xmlMemBlocks()) {
40973            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
40974	           xmlMemBlocks() - mem_base);
40975	    test_ret++;
40976            printf(" %d", n_writer);
40977            printf(" %d", n_name);
40978            printf(" %d", n_content);
40979            printf("\n");
40980        }
40981    }
40982    }
40983    }
40984    function_tests++;
40985#endif
40986
40987    return(test_ret);
40988}
40989
40990
40991static int
40992test_xmlTextWriterWriteAttributeNS(void) {
40993    int test_ret = 0;
40994
40995#ifdef LIBXML_WRITER_ENABLED
40996    int mem_base;
40997    int ret_val;
40998    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
40999    int n_writer;
41000    xmlChar * prefix; /* namespace prefix */
41001    int n_prefix;
41002    xmlChar * name; /* attribute local name */
41003    int n_name;
41004    xmlChar * namespaceURI; /* namespace URI */
41005    int n_namespaceURI;
41006    xmlChar * content; /* attribute content */
41007    int n_content;
41008
41009    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41010    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41011    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41012    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41013    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41014        mem_base = xmlMemBlocks();
41015        writer = gen_xmlTextWriterPtr(n_writer, 0);
41016        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
41017        name = gen_const_xmlChar_ptr(n_name, 2);
41018        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
41019        content = gen_const_xmlChar_ptr(n_content, 4);
41020
41021        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
41022        desret_int(ret_val);
41023        call_tests++;
41024        des_xmlTextWriterPtr(n_writer, writer, 0);
41025        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
41026        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41027        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
41028        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
41029        xmlResetLastError();
41030        if (mem_base != xmlMemBlocks()) {
41031            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
41032	           xmlMemBlocks() - mem_base);
41033	    test_ret++;
41034            printf(" %d", n_writer);
41035            printf(" %d", n_prefix);
41036            printf(" %d", n_name);
41037            printf(" %d", n_namespaceURI);
41038            printf(" %d", n_content);
41039            printf("\n");
41040        }
41041    }
41042    }
41043    }
41044    }
41045    }
41046    function_tests++;
41047#endif
41048
41049    return(test_ret);
41050}
41051
41052
41053static int
41054test_xmlTextWriterWriteBase64(void) {
41055    int test_ret = 0;
41056
41057#ifdef LIBXML_WRITER_ENABLED
41058    int mem_base;
41059    int ret_val;
41060    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41061    int n_writer;
41062    char * data; /* binary data */
41063    int n_data;
41064    int start; /* the position within the data of the first byte to encode */
41065    int n_start;
41066    int len; /* the number of bytes to encode */
41067    int n_len;
41068
41069    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41070    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
41071    for (n_start = 0;n_start < gen_nb_int;n_start++) {
41072    for (n_len = 0;n_len < gen_nb_int;n_len++) {
41073        mem_base = xmlMemBlocks();
41074        writer = gen_xmlTextWriterPtr(n_writer, 0);
41075        data = gen_const_char_ptr(n_data, 1);
41076        start = gen_int(n_start, 2);
41077        len = gen_int(n_len, 3);
41078
41079        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
41080        desret_int(ret_val);
41081        call_tests++;
41082        des_xmlTextWriterPtr(n_writer, writer, 0);
41083        des_const_char_ptr(n_data, (const char *)data, 1);
41084        des_int(n_start, start, 2);
41085        des_int(n_len, len, 3);
41086        xmlResetLastError();
41087        if (mem_base != xmlMemBlocks()) {
41088            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
41089	           xmlMemBlocks() - mem_base);
41090	    test_ret++;
41091            printf(" %d", n_writer);
41092            printf(" %d", n_data);
41093            printf(" %d", n_start);
41094            printf(" %d", n_len);
41095            printf("\n");
41096        }
41097    }
41098    }
41099    }
41100    }
41101    function_tests++;
41102#endif
41103
41104    return(test_ret);
41105}
41106
41107
41108static int
41109test_xmlTextWriterWriteBinHex(void) {
41110    int test_ret = 0;
41111
41112#ifdef LIBXML_WRITER_ENABLED
41113    int mem_base;
41114    int ret_val;
41115    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41116    int n_writer;
41117    char * data; /* binary data */
41118    int n_data;
41119    int start; /* the position within the data of the first byte to encode */
41120    int n_start;
41121    int len; /* the number of bytes to encode */
41122    int n_len;
41123
41124    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41125    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
41126    for (n_start = 0;n_start < gen_nb_int;n_start++) {
41127    for (n_len = 0;n_len < gen_nb_int;n_len++) {
41128        mem_base = xmlMemBlocks();
41129        writer = gen_xmlTextWriterPtr(n_writer, 0);
41130        data = gen_const_char_ptr(n_data, 1);
41131        start = gen_int(n_start, 2);
41132        len = gen_int(n_len, 3);
41133
41134        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
41135        desret_int(ret_val);
41136        call_tests++;
41137        des_xmlTextWriterPtr(n_writer, writer, 0);
41138        des_const_char_ptr(n_data, (const char *)data, 1);
41139        des_int(n_start, start, 2);
41140        des_int(n_len, len, 3);
41141        xmlResetLastError();
41142        if (mem_base != xmlMemBlocks()) {
41143            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
41144	           xmlMemBlocks() - mem_base);
41145	    test_ret++;
41146            printf(" %d", n_writer);
41147            printf(" %d", n_data);
41148            printf(" %d", n_start);
41149            printf(" %d", n_len);
41150            printf("\n");
41151        }
41152    }
41153    }
41154    }
41155    }
41156    function_tests++;
41157#endif
41158
41159    return(test_ret);
41160}
41161
41162
41163static int
41164test_xmlTextWriterWriteCDATA(void) {
41165    int test_ret = 0;
41166
41167#ifdef LIBXML_WRITER_ENABLED
41168    int mem_base;
41169    int ret_val;
41170    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41171    int n_writer;
41172    xmlChar * content; /* CDATA content */
41173    int n_content;
41174
41175    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41176    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41177        mem_base = xmlMemBlocks();
41178        writer = gen_xmlTextWriterPtr(n_writer, 0);
41179        content = gen_const_xmlChar_ptr(n_content, 1);
41180
41181        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
41182        desret_int(ret_val);
41183        call_tests++;
41184        des_xmlTextWriterPtr(n_writer, writer, 0);
41185        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
41186        xmlResetLastError();
41187        if (mem_base != xmlMemBlocks()) {
41188            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
41189	           xmlMemBlocks() - mem_base);
41190	    test_ret++;
41191            printf(" %d", n_writer);
41192            printf(" %d", n_content);
41193            printf("\n");
41194        }
41195    }
41196    }
41197    function_tests++;
41198#endif
41199
41200    return(test_ret);
41201}
41202
41203
41204static int
41205test_xmlTextWriterWriteComment(void) {
41206    int test_ret = 0;
41207
41208#ifdef LIBXML_WRITER_ENABLED
41209    int mem_base;
41210    int ret_val;
41211    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41212    int n_writer;
41213    xmlChar * content; /* comment string */
41214    int n_content;
41215
41216    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41217    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41218        mem_base = xmlMemBlocks();
41219        writer = gen_xmlTextWriterPtr(n_writer, 0);
41220        content = gen_const_xmlChar_ptr(n_content, 1);
41221
41222        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
41223        desret_int(ret_val);
41224        call_tests++;
41225        des_xmlTextWriterPtr(n_writer, writer, 0);
41226        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
41227        xmlResetLastError();
41228        if (mem_base != xmlMemBlocks()) {
41229            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
41230	           xmlMemBlocks() - mem_base);
41231	    test_ret++;
41232            printf(" %d", n_writer);
41233            printf(" %d", n_content);
41234            printf("\n");
41235        }
41236    }
41237    }
41238    function_tests++;
41239#endif
41240
41241    return(test_ret);
41242}
41243
41244
41245static int
41246test_xmlTextWriterWriteDTD(void) {
41247    int test_ret = 0;
41248
41249#ifdef LIBXML_WRITER_ENABLED
41250    int mem_base;
41251    int ret_val;
41252    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41253    int n_writer;
41254    xmlChar * name; /* the name of the DTD */
41255    int n_name;
41256    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
41257    int n_pubid;
41258    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
41259    int n_sysid;
41260    xmlChar * subset; /* string content of the DTD */
41261    int n_subset;
41262
41263    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41264    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41265    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41266    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41267    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
41268        mem_base = xmlMemBlocks();
41269        writer = gen_xmlTextWriterPtr(n_writer, 0);
41270        name = gen_const_xmlChar_ptr(n_name, 1);
41271        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
41272        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
41273        subset = gen_const_xmlChar_ptr(n_subset, 4);
41274
41275        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
41276        desret_int(ret_val);
41277        call_tests++;
41278        des_xmlTextWriterPtr(n_writer, writer, 0);
41279        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41280        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
41281        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
41282        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
41283        xmlResetLastError();
41284        if (mem_base != xmlMemBlocks()) {
41285            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
41286	           xmlMemBlocks() - mem_base);
41287	    test_ret++;
41288            printf(" %d", n_writer);
41289            printf(" %d", n_name);
41290            printf(" %d", n_pubid);
41291            printf(" %d", n_sysid);
41292            printf(" %d", n_subset);
41293            printf("\n");
41294        }
41295    }
41296    }
41297    }
41298    }
41299    }
41300    function_tests++;
41301#endif
41302
41303    return(test_ret);
41304}
41305
41306
41307static int
41308test_xmlTextWriterWriteDTDAttlist(void) {
41309    int test_ret = 0;
41310
41311#ifdef LIBXML_WRITER_ENABLED
41312    int mem_base;
41313    int ret_val;
41314    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41315    int n_writer;
41316    xmlChar * name; /* the name of the DTD ATTLIST */
41317    int n_name;
41318    xmlChar * content; /* content of the ATTLIST */
41319    int n_content;
41320
41321    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41322    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41323    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41324        mem_base = xmlMemBlocks();
41325        writer = gen_xmlTextWriterPtr(n_writer, 0);
41326        name = gen_const_xmlChar_ptr(n_name, 1);
41327        content = gen_const_xmlChar_ptr(n_content, 2);
41328
41329        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
41330        desret_int(ret_val);
41331        call_tests++;
41332        des_xmlTextWriterPtr(n_writer, writer, 0);
41333        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41334        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
41335        xmlResetLastError();
41336        if (mem_base != xmlMemBlocks()) {
41337            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
41338	           xmlMemBlocks() - mem_base);
41339	    test_ret++;
41340            printf(" %d", n_writer);
41341            printf(" %d", n_name);
41342            printf(" %d", n_content);
41343            printf("\n");
41344        }
41345    }
41346    }
41347    }
41348    function_tests++;
41349#endif
41350
41351    return(test_ret);
41352}
41353
41354
41355static int
41356test_xmlTextWriterWriteDTDElement(void) {
41357    int test_ret = 0;
41358
41359#ifdef LIBXML_WRITER_ENABLED
41360    int mem_base;
41361    int ret_val;
41362    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41363    int n_writer;
41364    xmlChar * name; /* the name of the DTD element */
41365    int n_name;
41366    xmlChar * content; /* content of the element */
41367    int n_content;
41368
41369    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41370    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41371    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41372        mem_base = xmlMemBlocks();
41373        writer = gen_xmlTextWriterPtr(n_writer, 0);
41374        name = gen_const_xmlChar_ptr(n_name, 1);
41375        content = gen_const_xmlChar_ptr(n_content, 2);
41376
41377        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
41378        desret_int(ret_val);
41379        call_tests++;
41380        des_xmlTextWriterPtr(n_writer, writer, 0);
41381        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41382        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
41383        xmlResetLastError();
41384        if (mem_base != xmlMemBlocks()) {
41385            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
41386	           xmlMemBlocks() - mem_base);
41387	    test_ret++;
41388            printf(" %d", n_writer);
41389            printf(" %d", n_name);
41390            printf(" %d", n_content);
41391            printf("\n");
41392        }
41393    }
41394    }
41395    }
41396    function_tests++;
41397#endif
41398
41399    return(test_ret);
41400}
41401
41402
41403static int
41404test_xmlTextWriterWriteDTDEntity(void) {
41405    int test_ret = 0;
41406
41407#ifdef LIBXML_WRITER_ENABLED
41408    int mem_base;
41409    int ret_val;
41410    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41411    int n_writer;
41412    int pe; /* TRUE if this is a parameter entity, FALSE if not */
41413    int n_pe;
41414    xmlChar * name; /* the name of the DTD entity */
41415    int n_name;
41416    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
41417    int n_pubid;
41418    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
41419    int n_sysid;
41420    xmlChar * ndataid; /* the xml notation name. */
41421    int n_ndataid;
41422    xmlChar * content; /* content of the entity */
41423    int n_content;
41424
41425    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41426    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41427    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41428    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41429    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41430    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
41431    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41432        mem_base = xmlMemBlocks();
41433        writer = gen_xmlTextWriterPtr(n_writer, 0);
41434        pe = gen_int(n_pe, 1);
41435        name = gen_const_xmlChar_ptr(n_name, 2);
41436        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
41437        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
41438        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
41439        content = gen_const_xmlChar_ptr(n_content, 6);
41440
41441        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
41442        desret_int(ret_val);
41443        call_tests++;
41444        des_xmlTextWriterPtr(n_writer, writer, 0);
41445        des_int(n_pe, pe, 1);
41446        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41447        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
41448        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
41449        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
41450        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
41451        xmlResetLastError();
41452        if (mem_base != xmlMemBlocks()) {
41453            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
41454	           xmlMemBlocks() - mem_base);
41455	    test_ret++;
41456            printf(" %d", n_writer);
41457            printf(" %d", n_pe);
41458            printf(" %d", n_name);
41459            printf(" %d", n_pubid);
41460            printf(" %d", n_sysid);
41461            printf(" %d", n_ndataid);
41462            printf(" %d", n_content);
41463            printf("\n");
41464        }
41465    }
41466    }
41467    }
41468    }
41469    }
41470    }
41471    }
41472    function_tests++;
41473#endif
41474
41475    return(test_ret);
41476}
41477
41478
41479static int
41480test_xmlTextWriterWriteDTDExternalEntity(void) {
41481    int test_ret = 0;
41482
41483#ifdef LIBXML_WRITER_ENABLED
41484    int mem_base;
41485    int ret_val;
41486    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41487    int n_writer;
41488    int pe; /* TRUE if this is a parameter entity, FALSE if not */
41489    int n_pe;
41490    xmlChar * name; /* the name of the DTD entity */
41491    int n_name;
41492    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
41493    int n_pubid;
41494    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
41495    int n_sysid;
41496    xmlChar * ndataid; /* the xml notation name. */
41497    int n_ndataid;
41498
41499    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41500    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41501    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41502    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41503    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41504    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
41505        mem_base = xmlMemBlocks();
41506        writer = gen_xmlTextWriterPtr(n_writer, 0);
41507        pe = gen_int(n_pe, 1);
41508        name = gen_const_xmlChar_ptr(n_name, 2);
41509        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
41510        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
41511        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
41512
41513        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
41514        desret_int(ret_val);
41515        call_tests++;
41516        des_xmlTextWriterPtr(n_writer, writer, 0);
41517        des_int(n_pe, pe, 1);
41518        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41519        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
41520        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
41521        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
41522        xmlResetLastError();
41523        if (mem_base != xmlMemBlocks()) {
41524            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
41525	           xmlMemBlocks() - mem_base);
41526	    test_ret++;
41527            printf(" %d", n_writer);
41528            printf(" %d", n_pe);
41529            printf(" %d", n_name);
41530            printf(" %d", n_pubid);
41531            printf(" %d", n_sysid);
41532            printf(" %d", n_ndataid);
41533            printf("\n");
41534        }
41535    }
41536    }
41537    }
41538    }
41539    }
41540    }
41541    function_tests++;
41542#endif
41543
41544    return(test_ret);
41545}
41546
41547
41548static int
41549test_xmlTextWriterWriteDTDExternalEntityContents(void) {
41550    int test_ret = 0;
41551
41552#ifdef LIBXML_WRITER_ENABLED
41553    int mem_base;
41554    int ret_val;
41555    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41556    int n_writer;
41557    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
41558    int n_pubid;
41559    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
41560    int n_sysid;
41561    xmlChar * ndataid; /* the xml notation name. */
41562    int n_ndataid;
41563
41564    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41565    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41566    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41567    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
41568        mem_base = xmlMemBlocks();
41569        writer = gen_xmlTextWriterPtr(n_writer, 0);
41570        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
41571        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
41572        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
41573
41574        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
41575        desret_int(ret_val);
41576        call_tests++;
41577        des_xmlTextWriterPtr(n_writer, writer, 0);
41578        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
41579        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
41580        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
41581        xmlResetLastError();
41582        if (mem_base != xmlMemBlocks()) {
41583            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
41584	           xmlMemBlocks() - mem_base);
41585	    test_ret++;
41586            printf(" %d", n_writer);
41587            printf(" %d", n_pubid);
41588            printf(" %d", n_sysid);
41589            printf(" %d", n_ndataid);
41590            printf("\n");
41591        }
41592    }
41593    }
41594    }
41595    }
41596    function_tests++;
41597#endif
41598
41599    return(test_ret);
41600}
41601
41602
41603static int
41604test_xmlTextWriterWriteDTDInternalEntity(void) {
41605    int test_ret = 0;
41606
41607#ifdef LIBXML_WRITER_ENABLED
41608    int mem_base;
41609    int ret_val;
41610    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41611    int n_writer;
41612    int pe; /* TRUE if this is a parameter entity, FALSE if not */
41613    int n_pe;
41614    xmlChar * name; /* the name of the DTD entity */
41615    int n_name;
41616    xmlChar * content; /* content of the entity */
41617    int n_content;
41618
41619    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41620    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
41621    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41622    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41623        mem_base = xmlMemBlocks();
41624        writer = gen_xmlTextWriterPtr(n_writer, 0);
41625        pe = gen_int(n_pe, 1);
41626        name = gen_const_xmlChar_ptr(n_name, 2);
41627        content = gen_const_xmlChar_ptr(n_content, 3);
41628
41629        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
41630        desret_int(ret_val);
41631        call_tests++;
41632        des_xmlTextWriterPtr(n_writer, writer, 0);
41633        des_int(n_pe, pe, 1);
41634        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41635        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
41636        xmlResetLastError();
41637        if (mem_base != xmlMemBlocks()) {
41638            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
41639	           xmlMemBlocks() - mem_base);
41640	    test_ret++;
41641            printf(" %d", n_writer);
41642            printf(" %d", n_pe);
41643            printf(" %d", n_name);
41644            printf(" %d", n_content);
41645            printf("\n");
41646        }
41647    }
41648    }
41649    }
41650    }
41651    function_tests++;
41652#endif
41653
41654    return(test_ret);
41655}
41656
41657
41658static int
41659test_xmlTextWriterWriteDTDNotation(void) {
41660    int test_ret = 0;
41661
41662#ifdef LIBXML_WRITER_ENABLED
41663    int mem_base;
41664    int ret_val;
41665    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41666    int n_writer;
41667    xmlChar * name; /* the name of the xml notation */
41668    int n_name;
41669    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
41670    int n_pubid;
41671    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
41672    int n_sysid;
41673
41674    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41675    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41676    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
41677    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
41678        mem_base = xmlMemBlocks();
41679        writer = gen_xmlTextWriterPtr(n_writer, 0);
41680        name = gen_const_xmlChar_ptr(n_name, 1);
41681        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
41682        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
41683
41684        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
41685        desret_int(ret_val);
41686        call_tests++;
41687        des_xmlTextWriterPtr(n_writer, writer, 0);
41688        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41689        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
41690        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
41691        xmlResetLastError();
41692        if (mem_base != xmlMemBlocks()) {
41693            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
41694	           xmlMemBlocks() - mem_base);
41695	    test_ret++;
41696            printf(" %d", n_writer);
41697            printf(" %d", n_name);
41698            printf(" %d", n_pubid);
41699            printf(" %d", n_sysid);
41700            printf("\n");
41701        }
41702    }
41703    }
41704    }
41705    }
41706    function_tests++;
41707#endif
41708
41709    return(test_ret);
41710}
41711
41712
41713static int
41714test_xmlTextWriterWriteElement(void) {
41715    int test_ret = 0;
41716
41717#ifdef LIBXML_WRITER_ENABLED
41718    int mem_base;
41719    int ret_val;
41720    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41721    int n_writer;
41722    xmlChar * name; /* element name */
41723    int n_name;
41724    xmlChar * content; /* element content */
41725    int n_content;
41726
41727    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41728    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41729    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41730        mem_base = xmlMemBlocks();
41731        writer = gen_xmlTextWriterPtr(n_writer, 0);
41732        name = gen_const_xmlChar_ptr(n_name, 1);
41733        content = gen_const_xmlChar_ptr(n_content, 2);
41734
41735        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
41736        desret_int(ret_val);
41737        call_tests++;
41738        des_xmlTextWriterPtr(n_writer, writer, 0);
41739        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
41740        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
41741        xmlResetLastError();
41742        if (mem_base != xmlMemBlocks()) {
41743            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
41744	           xmlMemBlocks() - mem_base);
41745	    test_ret++;
41746            printf(" %d", n_writer);
41747            printf(" %d", n_name);
41748            printf(" %d", n_content);
41749            printf("\n");
41750        }
41751    }
41752    }
41753    }
41754    function_tests++;
41755#endif
41756
41757    return(test_ret);
41758}
41759
41760
41761static int
41762test_xmlTextWriterWriteElementNS(void) {
41763    int test_ret = 0;
41764
41765#ifdef LIBXML_WRITER_ENABLED
41766    int mem_base;
41767    int ret_val;
41768    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41769    int n_writer;
41770    xmlChar * prefix; /* namespace prefix */
41771    int n_prefix;
41772    xmlChar * name; /* element local name */
41773    int n_name;
41774    xmlChar * namespaceURI; /* namespace URI */
41775    int n_namespaceURI;
41776    xmlChar * content; /* element content */
41777    int n_content;
41778
41779    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41780    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
41781    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
41782    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
41783    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41784        mem_base = xmlMemBlocks();
41785        writer = gen_xmlTextWriterPtr(n_writer, 0);
41786        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
41787        name = gen_const_xmlChar_ptr(n_name, 2);
41788        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
41789        content = gen_const_xmlChar_ptr(n_content, 4);
41790
41791        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
41792        desret_int(ret_val);
41793        call_tests++;
41794        des_xmlTextWriterPtr(n_writer, writer, 0);
41795        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
41796        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
41797        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
41798        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
41799        xmlResetLastError();
41800        if (mem_base != xmlMemBlocks()) {
41801            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
41802	           xmlMemBlocks() - mem_base);
41803	    test_ret++;
41804            printf(" %d", n_writer);
41805            printf(" %d", n_prefix);
41806            printf(" %d", n_name);
41807            printf(" %d", n_namespaceURI);
41808            printf(" %d", n_content);
41809            printf("\n");
41810        }
41811    }
41812    }
41813    }
41814    }
41815    }
41816    function_tests++;
41817#endif
41818
41819    return(test_ret);
41820}
41821
41822
41823static int
41824test_xmlTextWriterWriteFormatAttribute(void) {
41825    int test_ret = 0;
41826
41827
41828    /* missing type support */
41829    return(test_ret);
41830}
41831
41832
41833static int
41834test_xmlTextWriterWriteFormatAttributeNS(void) {
41835    int test_ret = 0;
41836
41837
41838    /* missing type support */
41839    return(test_ret);
41840}
41841
41842
41843static int
41844test_xmlTextWriterWriteFormatCDATA(void) {
41845    int test_ret = 0;
41846
41847
41848    /* missing type support */
41849    return(test_ret);
41850}
41851
41852
41853static int
41854test_xmlTextWriterWriteFormatComment(void) {
41855    int test_ret = 0;
41856
41857
41858    /* missing type support */
41859    return(test_ret);
41860}
41861
41862
41863static int
41864test_xmlTextWriterWriteFormatDTD(void) {
41865    int test_ret = 0;
41866
41867
41868    /* missing type support */
41869    return(test_ret);
41870}
41871
41872
41873static int
41874test_xmlTextWriterWriteFormatDTDAttlist(void) {
41875    int test_ret = 0;
41876
41877
41878    /* missing type support */
41879    return(test_ret);
41880}
41881
41882
41883static int
41884test_xmlTextWriterWriteFormatDTDElement(void) {
41885    int test_ret = 0;
41886
41887
41888    /* missing type support */
41889    return(test_ret);
41890}
41891
41892
41893static int
41894test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
41895    int test_ret = 0;
41896
41897
41898    /* missing type support */
41899    return(test_ret);
41900}
41901
41902
41903static int
41904test_xmlTextWriterWriteFormatElement(void) {
41905    int test_ret = 0;
41906
41907
41908    /* missing type support */
41909    return(test_ret);
41910}
41911
41912
41913static int
41914test_xmlTextWriterWriteFormatElementNS(void) {
41915    int test_ret = 0;
41916
41917
41918    /* missing type support */
41919    return(test_ret);
41920}
41921
41922
41923static int
41924test_xmlTextWriterWriteFormatPI(void) {
41925    int test_ret = 0;
41926
41927
41928    /* missing type support */
41929    return(test_ret);
41930}
41931
41932
41933static int
41934test_xmlTextWriterWriteFormatRaw(void) {
41935    int test_ret = 0;
41936
41937
41938    /* missing type support */
41939    return(test_ret);
41940}
41941
41942
41943static int
41944test_xmlTextWriterWriteFormatString(void) {
41945    int test_ret = 0;
41946
41947
41948    /* missing type support */
41949    return(test_ret);
41950}
41951
41952
41953static int
41954test_xmlTextWriterWritePI(void) {
41955    int test_ret = 0;
41956
41957#ifdef LIBXML_WRITER_ENABLED
41958    int mem_base;
41959    int ret_val;
41960    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
41961    int n_writer;
41962    xmlChar * target; /* PI target */
41963    int n_target;
41964    xmlChar * content; /* PI content */
41965    int n_content;
41966
41967    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
41968    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
41969    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
41970        mem_base = xmlMemBlocks();
41971        writer = gen_xmlTextWriterPtr(n_writer, 0);
41972        target = gen_const_xmlChar_ptr(n_target, 1);
41973        content = gen_const_xmlChar_ptr(n_content, 2);
41974
41975        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
41976        desret_int(ret_val);
41977        call_tests++;
41978        des_xmlTextWriterPtr(n_writer, writer, 0);
41979        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
41980        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
41981        xmlResetLastError();
41982        if (mem_base != xmlMemBlocks()) {
41983            printf("Leak of %d blocks found in xmlTextWriterWritePI",
41984	           xmlMemBlocks() - mem_base);
41985	    test_ret++;
41986            printf(" %d", n_writer);
41987            printf(" %d", n_target);
41988            printf(" %d", n_content);
41989            printf("\n");
41990        }
41991    }
41992    }
41993    }
41994    function_tests++;
41995#endif
41996
41997    return(test_ret);
41998}
41999
42000
42001static int
42002test_xmlTextWriterWriteRaw(void) {
42003    int test_ret = 0;
42004
42005#ifdef LIBXML_WRITER_ENABLED
42006    int mem_base;
42007    int ret_val;
42008    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42009    int n_writer;
42010    xmlChar * content; /* text string */
42011    int n_content;
42012
42013    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42014    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42015        mem_base = xmlMemBlocks();
42016        writer = gen_xmlTextWriterPtr(n_writer, 0);
42017        content = gen_const_xmlChar_ptr(n_content, 1);
42018
42019        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
42020        desret_int(ret_val);
42021        call_tests++;
42022        des_xmlTextWriterPtr(n_writer, writer, 0);
42023        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
42024        xmlResetLastError();
42025        if (mem_base != xmlMemBlocks()) {
42026            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
42027	           xmlMemBlocks() - mem_base);
42028	    test_ret++;
42029            printf(" %d", n_writer);
42030            printf(" %d", n_content);
42031            printf("\n");
42032        }
42033    }
42034    }
42035    function_tests++;
42036#endif
42037
42038    return(test_ret);
42039}
42040
42041
42042static int
42043test_xmlTextWriterWriteRawLen(void) {
42044    int test_ret = 0;
42045
42046#ifdef LIBXML_WRITER_ENABLED
42047    int mem_base;
42048    int ret_val;
42049    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42050    int n_writer;
42051    xmlChar * content; /* text string */
42052    int n_content;
42053    int len; /* length of the text string */
42054    int n_len;
42055
42056    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42057    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42058    for (n_len = 0;n_len < gen_nb_int;n_len++) {
42059        mem_base = xmlMemBlocks();
42060        writer = gen_xmlTextWriterPtr(n_writer, 0);
42061        content = gen_const_xmlChar_ptr(n_content, 1);
42062        len = gen_int(n_len, 2);
42063
42064        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
42065        desret_int(ret_val);
42066        call_tests++;
42067        des_xmlTextWriterPtr(n_writer, writer, 0);
42068        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
42069        des_int(n_len, len, 2);
42070        xmlResetLastError();
42071        if (mem_base != xmlMemBlocks()) {
42072            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
42073	           xmlMemBlocks() - mem_base);
42074	    test_ret++;
42075            printf(" %d", n_writer);
42076            printf(" %d", n_content);
42077            printf(" %d", n_len);
42078            printf("\n");
42079        }
42080    }
42081    }
42082    }
42083    function_tests++;
42084#endif
42085
42086    return(test_ret);
42087}
42088
42089
42090static int
42091test_xmlTextWriterWriteString(void) {
42092    int test_ret = 0;
42093
42094#ifdef LIBXML_WRITER_ENABLED
42095    int mem_base;
42096    int ret_val;
42097    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42098    int n_writer;
42099    xmlChar * content; /* text string */
42100    int n_content;
42101
42102    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42103    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
42104        mem_base = xmlMemBlocks();
42105        writer = gen_xmlTextWriterPtr(n_writer, 0);
42106        content = gen_const_xmlChar_ptr(n_content, 1);
42107
42108        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
42109        desret_int(ret_val);
42110        call_tests++;
42111        des_xmlTextWriterPtr(n_writer, writer, 0);
42112        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
42113        xmlResetLastError();
42114        if (mem_base != xmlMemBlocks()) {
42115            printf("Leak of %d blocks found in xmlTextWriterWriteString",
42116	           xmlMemBlocks() - mem_base);
42117	    test_ret++;
42118            printf(" %d", n_writer);
42119            printf(" %d", n_content);
42120            printf("\n");
42121        }
42122    }
42123    }
42124    function_tests++;
42125#endif
42126
42127    return(test_ret);
42128}
42129
42130
42131static int
42132test_xmlTextWriterWriteVFormatAttribute(void) {
42133    int test_ret = 0;
42134
42135
42136    /* missing type support */
42137    return(test_ret);
42138}
42139
42140
42141static int
42142test_xmlTextWriterWriteVFormatAttributeNS(void) {
42143    int test_ret = 0;
42144
42145
42146    /* missing type support */
42147    return(test_ret);
42148}
42149
42150
42151static int
42152test_xmlTextWriterWriteVFormatCDATA(void) {
42153    int test_ret = 0;
42154
42155
42156    /* missing type support */
42157    return(test_ret);
42158}
42159
42160
42161static int
42162test_xmlTextWriterWriteVFormatComment(void) {
42163    int test_ret = 0;
42164
42165
42166    /* missing type support */
42167    return(test_ret);
42168}
42169
42170
42171static int
42172test_xmlTextWriterWriteVFormatDTD(void) {
42173    int test_ret = 0;
42174
42175
42176    /* missing type support */
42177    return(test_ret);
42178}
42179
42180
42181static int
42182test_xmlTextWriterWriteVFormatDTDAttlist(void) {
42183    int test_ret = 0;
42184
42185
42186    /* missing type support */
42187    return(test_ret);
42188}
42189
42190
42191static int
42192test_xmlTextWriterWriteVFormatDTDElement(void) {
42193    int test_ret = 0;
42194
42195
42196    /* missing type support */
42197    return(test_ret);
42198}
42199
42200
42201static int
42202test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
42203    int test_ret = 0;
42204
42205
42206    /* missing type support */
42207    return(test_ret);
42208}
42209
42210
42211static int
42212test_xmlTextWriterWriteVFormatElement(void) {
42213    int test_ret = 0;
42214
42215
42216    /* missing type support */
42217    return(test_ret);
42218}
42219
42220
42221static int
42222test_xmlTextWriterWriteVFormatElementNS(void) {
42223    int test_ret = 0;
42224
42225
42226    /* missing type support */
42227    return(test_ret);
42228}
42229
42230
42231static int
42232test_xmlTextWriterWriteVFormatPI(void) {
42233    int test_ret = 0;
42234
42235
42236    /* missing type support */
42237    return(test_ret);
42238}
42239
42240
42241static int
42242test_xmlTextWriterWriteVFormatRaw(void) {
42243    int test_ret = 0;
42244
42245
42246    /* missing type support */
42247    return(test_ret);
42248}
42249
42250
42251static int
42252test_xmlTextWriterWriteVFormatString(void) {
42253    int test_ret = 0;
42254
42255
42256    /* missing type support */
42257    return(test_ret);
42258}
42259
42260static int
42261test_xmlwriter(void) {
42262    int test_ret = 0;
42263
42264    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
42265    test_ret += test_xmlNewTextWriter();
42266    test_ret += test_xmlNewTextWriterFilename();
42267    test_ret += test_xmlNewTextWriterMemory();
42268    test_ret += test_xmlNewTextWriterPushParser();
42269    test_ret += test_xmlNewTextWriterTree();
42270    test_ret += test_xmlTextWriterEndAttribute();
42271    test_ret += test_xmlTextWriterEndCDATA();
42272    test_ret += test_xmlTextWriterEndComment();
42273    test_ret += test_xmlTextWriterEndDTD();
42274    test_ret += test_xmlTextWriterEndDTDAttlist();
42275    test_ret += test_xmlTextWriterEndDTDElement();
42276    test_ret += test_xmlTextWriterEndDTDEntity();
42277    test_ret += test_xmlTextWriterEndDocument();
42278    test_ret += test_xmlTextWriterEndElement();
42279    test_ret += test_xmlTextWriterEndPI();
42280    test_ret += test_xmlTextWriterFlush();
42281    test_ret += test_xmlTextWriterFullEndElement();
42282    test_ret += test_xmlTextWriterSetIndent();
42283    test_ret += test_xmlTextWriterSetIndentString();
42284    test_ret += test_xmlTextWriterStartAttribute();
42285    test_ret += test_xmlTextWriterStartAttributeNS();
42286    test_ret += test_xmlTextWriterStartCDATA();
42287    test_ret += test_xmlTextWriterStartComment();
42288    test_ret += test_xmlTextWriterStartDTD();
42289    test_ret += test_xmlTextWriterStartDTDAttlist();
42290    test_ret += test_xmlTextWriterStartDTDElement();
42291    test_ret += test_xmlTextWriterStartDTDEntity();
42292    test_ret += test_xmlTextWriterStartDocument();
42293    test_ret += test_xmlTextWriterStartElement();
42294    test_ret += test_xmlTextWriterStartElementNS();
42295    test_ret += test_xmlTextWriterStartPI();
42296    test_ret += test_xmlTextWriterWriteAttribute();
42297    test_ret += test_xmlTextWriterWriteAttributeNS();
42298    test_ret += test_xmlTextWriterWriteBase64();
42299    test_ret += test_xmlTextWriterWriteBinHex();
42300    test_ret += test_xmlTextWriterWriteCDATA();
42301    test_ret += test_xmlTextWriterWriteComment();
42302    test_ret += test_xmlTextWriterWriteDTD();
42303    test_ret += test_xmlTextWriterWriteDTDAttlist();
42304    test_ret += test_xmlTextWriterWriteDTDElement();
42305    test_ret += test_xmlTextWriterWriteDTDEntity();
42306    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
42307    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
42308    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
42309    test_ret += test_xmlTextWriterWriteDTDNotation();
42310    test_ret += test_xmlTextWriterWriteElement();
42311    test_ret += test_xmlTextWriterWriteElementNS();
42312    test_ret += test_xmlTextWriterWriteFormatAttribute();
42313    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
42314    test_ret += test_xmlTextWriterWriteFormatCDATA();
42315    test_ret += test_xmlTextWriterWriteFormatComment();
42316    test_ret += test_xmlTextWriterWriteFormatDTD();
42317    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
42318    test_ret += test_xmlTextWriterWriteFormatDTDElement();
42319    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
42320    test_ret += test_xmlTextWriterWriteFormatElement();
42321    test_ret += test_xmlTextWriterWriteFormatElementNS();
42322    test_ret += test_xmlTextWriterWriteFormatPI();
42323    test_ret += test_xmlTextWriterWriteFormatRaw();
42324    test_ret += test_xmlTextWriterWriteFormatString();
42325    test_ret += test_xmlTextWriterWritePI();
42326    test_ret += test_xmlTextWriterWriteRaw();
42327    test_ret += test_xmlTextWriterWriteRawLen();
42328    test_ret += test_xmlTextWriterWriteString();
42329    test_ret += test_xmlTextWriterWriteVFormatAttribute();
42330    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
42331    test_ret += test_xmlTextWriterWriteVFormatCDATA();
42332    test_ret += test_xmlTextWriterWriteVFormatComment();
42333    test_ret += test_xmlTextWriterWriteVFormatDTD();
42334    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
42335    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
42336    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
42337    test_ret += test_xmlTextWriterWriteVFormatElement();
42338    test_ret += test_xmlTextWriterWriteVFormatElementNS();
42339    test_ret += test_xmlTextWriterWriteVFormatPI();
42340    test_ret += test_xmlTextWriterWriteVFormatRaw();
42341    test_ret += test_xmlTextWriterWriteVFormatString();
42342
42343    if (test_ret != 0)
42344	printf("Module xmlwriter: %d errors\n", test_ret);
42345    return(test_ret);
42346}
42347
42348static int
42349test_xmlXPathCastBooleanToNumber(void) {
42350    int test_ret = 0;
42351
42352#ifdef LIBXML_XPATH_ENABLED
42353    int mem_base;
42354    double ret_val;
42355    int val; /* a boolean */
42356    int n_val;
42357
42358    for (n_val = 0;n_val < gen_nb_int;n_val++) {
42359        mem_base = xmlMemBlocks();
42360        val = gen_int(n_val, 0);
42361
42362        ret_val = xmlXPathCastBooleanToNumber(val);
42363        desret_double(ret_val);
42364        call_tests++;
42365        des_int(n_val, val, 0);
42366        xmlResetLastError();
42367        if (mem_base != xmlMemBlocks()) {
42368            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
42369	           xmlMemBlocks() - mem_base);
42370	    test_ret++;
42371            printf(" %d", n_val);
42372            printf("\n");
42373        }
42374    }
42375    function_tests++;
42376#endif
42377
42378    return(test_ret);
42379}
42380
42381
42382static int
42383test_xmlXPathCastBooleanToString(void) {
42384    int test_ret = 0;
42385
42386#ifdef LIBXML_XPATH_ENABLED
42387    int mem_base;
42388    xmlChar * ret_val;
42389    int val; /* a boolean */
42390    int n_val;
42391
42392    for (n_val = 0;n_val < gen_nb_int;n_val++) {
42393        mem_base = xmlMemBlocks();
42394        val = gen_int(n_val, 0);
42395
42396        ret_val = xmlXPathCastBooleanToString(val);
42397        desret_xmlChar_ptr(ret_val);
42398        call_tests++;
42399        des_int(n_val, val, 0);
42400        xmlResetLastError();
42401        if (mem_base != xmlMemBlocks()) {
42402            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
42403	           xmlMemBlocks() - mem_base);
42404	    test_ret++;
42405            printf(" %d", n_val);
42406            printf("\n");
42407        }
42408    }
42409    function_tests++;
42410#endif
42411
42412    return(test_ret);
42413}
42414
42415
42416static int
42417test_xmlXPathCastNodeSetToBoolean(void) {
42418    int test_ret = 0;
42419
42420#ifdef LIBXML_XPATH_ENABLED
42421    int mem_base;
42422    int ret_val;
42423    xmlNodeSetPtr ns; /* a node-set */
42424    int n_ns;
42425
42426    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
42427        mem_base = xmlMemBlocks();
42428        ns = gen_xmlNodeSetPtr(n_ns, 0);
42429
42430        ret_val = xmlXPathCastNodeSetToBoolean(ns);
42431        desret_int(ret_val);
42432        call_tests++;
42433        des_xmlNodeSetPtr(n_ns, ns, 0);
42434        xmlResetLastError();
42435        if (mem_base != xmlMemBlocks()) {
42436            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
42437	           xmlMemBlocks() - mem_base);
42438	    test_ret++;
42439            printf(" %d", n_ns);
42440            printf("\n");
42441        }
42442    }
42443    function_tests++;
42444#endif
42445
42446    return(test_ret);
42447}
42448
42449
42450static int
42451test_xmlXPathCastNodeSetToNumber(void) {
42452    int test_ret = 0;
42453
42454#ifdef LIBXML_XPATH_ENABLED
42455    int mem_base;
42456    double ret_val;
42457    xmlNodeSetPtr ns; /* a node-set */
42458    int n_ns;
42459
42460    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
42461        mem_base = xmlMemBlocks();
42462        ns = gen_xmlNodeSetPtr(n_ns, 0);
42463
42464        ret_val = xmlXPathCastNodeSetToNumber(ns);
42465        desret_double(ret_val);
42466        call_tests++;
42467        des_xmlNodeSetPtr(n_ns, ns, 0);
42468        xmlResetLastError();
42469        if (mem_base != xmlMemBlocks()) {
42470            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
42471	           xmlMemBlocks() - mem_base);
42472	    test_ret++;
42473            printf(" %d", n_ns);
42474            printf("\n");
42475        }
42476    }
42477    function_tests++;
42478#endif
42479
42480    return(test_ret);
42481}
42482
42483
42484static int
42485test_xmlXPathCastNodeSetToString(void) {
42486    int test_ret = 0;
42487
42488#ifdef LIBXML_XPATH_ENABLED
42489    int mem_base;
42490    xmlChar * ret_val;
42491    xmlNodeSetPtr ns; /* a node-set */
42492    int n_ns;
42493
42494    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
42495        mem_base = xmlMemBlocks();
42496        ns = gen_xmlNodeSetPtr(n_ns, 0);
42497
42498        ret_val = xmlXPathCastNodeSetToString(ns);
42499        desret_xmlChar_ptr(ret_val);
42500        call_tests++;
42501        des_xmlNodeSetPtr(n_ns, ns, 0);
42502        xmlResetLastError();
42503        if (mem_base != xmlMemBlocks()) {
42504            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
42505	           xmlMemBlocks() - mem_base);
42506	    test_ret++;
42507            printf(" %d", n_ns);
42508            printf("\n");
42509        }
42510    }
42511    function_tests++;
42512#endif
42513
42514    return(test_ret);
42515}
42516
42517
42518static int
42519test_xmlXPathCastNodeToNumber(void) {
42520    int test_ret = 0;
42521
42522#ifdef LIBXML_XPATH_ENABLED
42523    int mem_base;
42524    double ret_val;
42525    xmlNodePtr node; /* a node */
42526    int n_node;
42527
42528    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42529        mem_base = xmlMemBlocks();
42530        node = gen_xmlNodePtr(n_node, 0);
42531
42532        ret_val = xmlXPathCastNodeToNumber(node);
42533        desret_double(ret_val);
42534        call_tests++;
42535        des_xmlNodePtr(n_node, node, 0);
42536        xmlResetLastError();
42537        if (mem_base != xmlMemBlocks()) {
42538            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
42539	           xmlMemBlocks() - mem_base);
42540	    test_ret++;
42541            printf(" %d", n_node);
42542            printf("\n");
42543        }
42544    }
42545    function_tests++;
42546#endif
42547
42548    return(test_ret);
42549}
42550
42551
42552static int
42553test_xmlXPathCastNodeToString(void) {
42554    int test_ret = 0;
42555
42556#ifdef LIBXML_XPATH_ENABLED
42557    int mem_base;
42558    xmlChar * ret_val;
42559    xmlNodePtr node; /* a node */
42560    int n_node;
42561
42562    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42563        mem_base = xmlMemBlocks();
42564        node = gen_xmlNodePtr(n_node, 0);
42565
42566        ret_val = xmlXPathCastNodeToString(node);
42567        desret_xmlChar_ptr(ret_val);
42568        call_tests++;
42569        des_xmlNodePtr(n_node, node, 0);
42570        xmlResetLastError();
42571        if (mem_base != xmlMemBlocks()) {
42572            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
42573	           xmlMemBlocks() - mem_base);
42574	    test_ret++;
42575            printf(" %d", n_node);
42576            printf("\n");
42577        }
42578    }
42579    function_tests++;
42580#endif
42581
42582    return(test_ret);
42583}
42584
42585
42586static int
42587test_xmlXPathCastNumberToBoolean(void) {
42588    int test_ret = 0;
42589
42590#ifdef LIBXML_XPATH_ENABLED
42591    int mem_base;
42592    int ret_val;
42593    double val; /* a number */
42594    int n_val;
42595
42596    for (n_val = 0;n_val < gen_nb_double;n_val++) {
42597        mem_base = xmlMemBlocks();
42598        val = gen_double(n_val, 0);
42599
42600        ret_val = xmlXPathCastNumberToBoolean(val);
42601        desret_int(ret_val);
42602        call_tests++;
42603        des_double(n_val, val, 0);
42604        xmlResetLastError();
42605        if (mem_base != xmlMemBlocks()) {
42606            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
42607	           xmlMemBlocks() - mem_base);
42608	    test_ret++;
42609            printf(" %d", n_val);
42610            printf("\n");
42611        }
42612    }
42613    function_tests++;
42614#endif
42615
42616    return(test_ret);
42617}
42618
42619
42620static int
42621test_xmlXPathCastNumberToString(void) {
42622    int test_ret = 0;
42623
42624#ifdef LIBXML_XPATH_ENABLED
42625    int mem_base;
42626    xmlChar * ret_val;
42627    double val; /* a number */
42628    int n_val;
42629
42630    for (n_val = 0;n_val < gen_nb_double;n_val++) {
42631        mem_base = xmlMemBlocks();
42632        val = gen_double(n_val, 0);
42633
42634        ret_val = xmlXPathCastNumberToString(val);
42635        desret_xmlChar_ptr(ret_val);
42636        call_tests++;
42637        des_double(n_val, val, 0);
42638        xmlResetLastError();
42639        if (mem_base != xmlMemBlocks()) {
42640            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
42641	           xmlMemBlocks() - mem_base);
42642	    test_ret++;
42643            printf(" %d", n_val);
42644            printf("\n");
42645        }
42646    }
42647    function_tests++;
42648#endif
42649
42650    return(test_ret);
42651}
42652
42653
42654static int
42655test_xmlXPathCastStringToBoolean(void) {
42656    int test_ret = 0;
42657
42658#ifdef LIBXML_XPATH_ENABLED
42659    int mem_base;
42660    int ret_val;
42661    xmlChar * val; /* a string */
42662    int n_val;
42663
42664    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
42665        mem_base = xmlMemBlocks();
42666        val = gen_const_xmlChar_ptr(n_val, 0);
42667
42668        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
42669        desret_int(ret_val);
42670        call_tests++;
42671        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
42672        xmlResetLastError();
42673        if (mem_base != xmlMemBlocks()) {
42674            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
42675	           xmlMemBlocks() - mem_base);
42676	    test_ret++;
42677            printf(" %d", n_val);
42678            printf("\n");
42679        }
42680    }
42681    function_tests++;
42682#endif
42683
42684    return(test_ret);
42685}
42686
42687
42688static int
42689test_xmlXPathCastStringToNumber(void) {
42690    int test_ret = 0;
42691
42692#ifdef LIBXML_XPATH_ENABLED
42693    int mem_base;
42694    double ret_val;
42695    xmlChar * val; /* a string */
42696    int n_val;
42697
42698    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
42699        mem_base = xmlMemBlocks();
42700        val = gen_const_xmlChar_ptr(n_val, 0);
42701
42702        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
42703        desret_double(ret_val);
42704        call_tests++;
42705        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
42706        xmlResetLastError();
42707        if (mem_base != xmlMemBlocks()) {
42708            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
42709	           xmlMemBlocks() - mem_base);
42710	    test_ret++;
42711            printf(" %d", n_val);
42712            printf("\n");
42713        }
42714    }
42715    function_tests++;
42716#endif
42717
42718    return(test_ret);
42719}
42720
42721
42722static int
42723test_xmlXPathCastToBoolean(void) {
42724    int test_ret = 0;
42725
42726#ifdef LIBXML_XPATH_ENABLED
42727    int mem_base;
42728    int ret_val;
42729    xmlXPathObjectPtr val; /* an XPath object */
42730    int n_val;
42731
42732    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42733        mem_base = xmlMemBlocks();
42734        val = gen_xmlXPathObjectPtr(n_val, 0);
42735
42736        ret_val = xmlXPathCastToBoolean(val);
42737        desret_int(ret_val);
42738        call_tests++;
42739        des_xmlXPathObjectPtr(n_val, val, 0);
42740        xmlResetLastError();
42741        if (mem_base != xmlMemBlocks()) {
42742            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
42743	           xmlMemBlocks() - mem_base);
42744	    test_ret++;
42745            printf(" %d", n_val);
42746            printf("\n");
42747        }
42748    }
42749    function_tests++;
42750#endif
42751
42752    return(test_ret);
42753}
42754
42755
42756static int
42757test_xmlXPathCastToNumber(void) {
42758    int test_ret = 0;
42759
42760#ifdef LIBXML_XPATH_ENABLED
42761    int mem_base;
42762    double ret_val;
42763    xmlXPathObjectPtr val; /* an XPath object */
42764    int n_val;
42765
42766    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42767        mem_base = xmlMemBlocks();
42768        val = gen_xmlXPathObjectPtr(n_val, 0);
42769
42770        ret_val = xmlXPathCastToNumber(val);
42771        desret_double(ret_val);
42772        call_tests++;
42773        des_xmlXPathObjectPtr(n_val, val, 0);
42774        xmlResetLastError();
42775        if (mem_base != xmlMemBlocks()) {
42776            printf("Leak of %d blocks found in xmlXPathCastToNumber",
42777	           xmlMemBlocks() - mem_base);
42778	    test_ret++;
42779            printf(" %d", n_val);
42780            printf("\n");
42781        }
42782    }
42783    function_tests++;
42784#endif
42785
42786    return(test_ret);
42787}
42788
42789
42790static int
42791test_xmlXPathCastToString(void) {
42792    int test_ret = 0;
42793
42794#ifdef LIBXML_XPATH_ENABLED
42795    int mem_base;
42796    xmlChar * ret_val;
42797    xmlXPathObjectPtr val; /* an XPath object */
42798    int n_val;
42799
42800    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42801        mem_base = xmlMemBlocks();
42802        val = gen_xmlXPathObjectPtr(n_val, 0);
42803
42804        ret_val = xmlXPathCastToString(val);
42805        desret_xmlChar_ptr(ret_val);
42806        call_tests++;
42807        des_xmlXPathObjectPtr(n_val, val, 0);
42808        xmlResetLastError();
42809        if (mem_base != xmlMemBlocks()) {
42810            printf("Leak of %d blocks found in xmlXPathCastToString",
42811	           xmlMemBlocks() - mem_base);
42812	    test_ret++;
42813            printf(" %d", n_val);
42814            printf("\n");
42815        }
42816    }
42817    function_tests++;
42818#endif
42819
42820    return(test_ret);
42821}
42822
42823
42824static int
42825test_xmlXPathCmpNodes(void) {
42826    int test_ret = 0;
42827
42828#ifdef LIBXML_XPATH_ENABLED
42829    int mem_base;
42830    int ret_val;
42831    xmlNodePtr node1; /* the first node */
42832    int n_node1;
42833    xmlNodePtr node2; /* the second node */
42834    int n_node2;
42835
42836    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
42837    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
42838        mem_base = xmlMemBlocks();
42839        node1 = gen_xmlNodePtr(n_node1, 0);
42840        node2 = gen_xmlNodePtr(n_node2, 1);
42841
42842        ret_val = xmlXPathCmpNodes(node1, node2);
42843        desret_int(ret_val);
42844        call_tests++;
42845        des_xmlNodePtr(n_node1, node1, 0);
42846        des_xmlNodePtr(n_node2, node2, 1);
42847        xmlResetLastError();
42848        if (mem_base != xmlMemBlocks()) {
42849            printf("Leak of %d blocks found in xmlXPathCmpNodes",
42850	           xmlMemBlocks() - mem_base);
42851	    test_ret++;
42852            printf(" %d", n_node1);
42853            printf(" %d", n_node2);
42854            printf("\n");
42855        }
42856    }
42857    }
42858    function_tests++;
42859#endif
42860
42861    return(test_ret);
42862}
42863
42864
42865static int
42866test_xmlXPathCompile(void) {
42867    int test_ret = 0;
42868
42869
42870    /* missing type support */
42871    return(test_ret);
42872}
42873
42874#ifdef LIBXML_XPATH_ENABLED
42875
42876#define gen_nb_xmlXPathCompExprPtr 1
42877static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42878    return(NULL);
42879}
42880static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42881}
42882#endif
42883
42884#ifdef LIBXML_XPATH_ENABLED
42885
42886#define gen_nb_xmlXPathContextPtr 1
42887static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42888    return(NULL);
42889}
42890static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
42891}
42892#endif
42893
42894
42895static int
42896test_xmlXPathCompiledEval(void) {
42897    int test_ret = 0;
42898
42899#ifdef LIBXML_XPATH_ENABLED
42900    int mem_base;
42901    xmlXPathObjectPtr ret_val;
42902    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
42903    int n_comp;
42904    xmlXPathContextPtr ctx; /* the XPath context */
42905    int n_ctx;
42906
42907    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
42908    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
42909        mem_base = xmlMemBlocks();
42910        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
42911        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
42912
42913        ret_val = xmlXPathCompiledEval(comp, ctx);
42914        desret_xmlXPathObjectPtr(ret_val);
42915        call_tests++;
42916        des_xmlXPathCompExprPtr(n_comp, comp, 0);
42917        des_xmlXPathContextPtr(n_ctx, ctx, 1);
42918        xmlResetLastError();
42919        if (mem_base != xmlMemBlocks()) {
42920            printf("Leak of %d blocks found in xmlXPathCompiledEval",
42921	           xmlMemBlocks() - mem_base);
42922	    test_ret++;
42923            printf(" %d", n_comp);
42924            printf(" %d", n_ctx);
42925            printf("\n");
42926        }
42927    }
42928    }
42929    function_tests++;
42930#endif
42931
42932    return(test_ret);
42933}
42934
42935
42936static int
42937test_xmlXPathConvertBoolean(void) {
42938    int test_ret = 0;
42939
42940#ifdef LIBXML_XPATH_ENABLED
42941    int mem_base;
42942    xmlXPathObjectPtr ret_val;
42943    xmlXPathObjectPtr val; /* an XPath object */
42944    int n_val;
42945
42946    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42947        mem_base = xmlMemBlocks();
42948        val = gen_xmlXPathObjectPtr(n_val, 0);
42949
42950        ret_val = xmlXPathConvertBoolean(val);
42951        val = NULL;
42952        desret_xmlXPathObjectPtr(ret_val);
42953        call_tests++;
42954        des_xmlXPathObjectPtr(n_val, val, 0);
42955        xmlResetLastError();
42956        if (mem_base != xmlMemBlocks()) {
42957            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
42958	           xmlMemBlocks() - mem_base);
42959	    test_ret++;
42960            printf(" %d", n_val);
42961            printf("\n");
42962        }
42963    }
42964    function_tests++;
42965#endif
42966
42967    return(test_ret);
42968}
42969
42970
42971static int
42972test_xmlXPathConvertNumber(void) {
42973    int test_ret = 0;
42974
42975#ifdef LIBXML_XPATH_ENABLED
42976    int mem_base;
42977    xmlXPathObjectPtr ret_val;
42978    xmlXPathObjectPtr val; /* an XPath object */
42979    int n_val;
42980
42981    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
42982        mem_base = xmlMemBlocks();
42983        val = gen_xmlXPathObjectPtr(n_val, 0);
42984
42985        ret_val = xmlXPathConvertNumber(val);
42986        val = NULL;
42987        desret_xmlXPathObjectPtr(ret_val);
42988        call_tests++;
42989        des_xmlXPathObjectPtr(n_val, val, 0);
42990        xmlResetLastError();
42991        if (mem_base != xmlMemBlocks()) {
42992            printf("Leak of %d blocks found in xmlXPathConvertNumber",
42993	           xmlMemBlocks() - mem_base);
42994	    test_ret++;
42995            printf(" %d", n_val);
42996            printf("\n");
42997        }
42998    }
42999    function_tests++;
43000#endif
43001
43002    return(test_ret);
43003}
43004
43005
43006static int
43007test_xmlXPathConvertString(void) {
43008    int test_ret = 0;
43009
43010#ifdef LIBXML_XPATH_ENABLED
43011    int mem_base;
43012    xmlXPathObjectPtr ret_val;
43013    xmlXPathObjectPtr val; /* an XPath object */
43014    int n_val;
43015
43016    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43017        mem_base = xmlMemBlocks();
43018        val = gen_xmlXPathObjectPtr(n_val, 0);
43019
43020        ret_val = xmlXPathConvertString(val);
43021        val = NULL;
43022        desret_xmlXPathObjectPtr(ret_val);
43023        call_tests++;
43024        des_xmlXPathObjectPtr(n_val, val, 0);
43025        xmlResetLastError();
43026        if (mem_base != xmlMemBlocks()) {
43027            printf("Leak of %d blocks found in xmlXPathConvertString",
43028	           xmlMemBlocks() - mem_base);
43029	    test_ret++;
43030            printf(" %d", n_val);
43031            printf("\n");
43032        }
43033    }
43034    function_tests++;
43035#endif
43036
43037    return(test_ret);
43038}
43039
43040
43041static int
43042test_xmlXPathCtxtCompile(void) {
43043    int test_ret = 0;
43044
43045
43046    /* missing type support */
43047    return(test_ret);
43048}
43049
43050
43051static int
43052test_xmlXPathEval(void) {
43053    int test_ret = 0;
43054
43055#ifdef LIBXML_XPATH_ENABLED
43056    int mem_base;
43057    xmlXPathObjectPtr ret_val;
43058    xmlChar * str; /* the XPath expression */
43059    int n_str;
43060    xmlXPathContextPtr ctx; /* the XPath context */
43061    int n_ctx;
43062
43063    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43064    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
43065        mem_base = xmlMemBlocks();
43066        str = gen_const_xmlChar_ptr(n_str, 0);
43067        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
43068
43069        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
43070        desret_xmlXPathObjectPtr(ret_val);
43071        call_tests++;
43072        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
43073        des_xmlXPathContextPtr(n_ctx, ctx, 1);
43074        xmlResetLastError();
43075        if (mem_base != xmlMemBlocks()) {
43076            printf("Leak of %d blocks found in xmlXPathEval",
43077	           xmlMemBlocks() - mem_base);
43078	    test_ret++;
43079            printf(" %d", n_str);
43080            printf(" %d", n_ctx);
43081            printf("\n");
43082        }
43083    }
43084    }
43085    function_tests++;
43086#endif
43087
43088    return(test_ret);
43089}
43090
43091
43092static int
43093test_xmlXPathEvalExpression(void) {
43094    int test_ret = 0;
43095
43096#ifdef LIBXML_XPATH_ENABLED
43097    int mem_base;
43098    xmlXPathObjectPtr ret_val;
43099    xmlChar * str; /* the XPath expression */
43100    int n_str;
43101    xmlXPathContextPtr ctxt; /* the XPath context */
43102    int n_ctxt;
43103
43104    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43105    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
43106        mem_base = xmlMemBlocks();
43107        str = gen_const_xmlChar_ptr(n_str, 0);
43108        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
43109
43110        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
43111        desret_xmlXPathObjectPtr(ret_val);
43112        call_tests++;
43113        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
43114        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
43115        xmlResetLastError();
43116        if (mem_base != xmlMemBlocks()) {
43117            printf("Leak of %d blocks found in xmlXPathEvalExpression",
43118	           xmlMemBlocks() - mem_base);
43119	    test_ret++;
43120            printf(" %d", n_str);
43121            printf(" %d", n_ctxt);
43122            printf("\n");
43123        }
43124    }
43125    }
43126    function_tests++;
43127#endif
43128
43129    return(test_ret);
43130}
43131
43132
43133static int
43134test_xmlXPathEvalPredicate(void) {
43135    int test_ret = 0;
43136
43137#ifdef LIBXML_XPATH_ENABLED
43138    int mem_base;
43139    int ret_val;
43140    xmlXPathContextPtr ctxt; /* the XPath context */
43141    int n_ctxt;
43142    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
43143    int n_res;
43144
43145    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
43146    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
43147        mem_base = xmlMemBlocks();
43148        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
43149        res = gen_xmlXPathObjectPtr(n_res, 1);
43150
43151        ret_val = xmlXPathEvalPredicate(ctxt, res);
43152        desret_int(ret_val);
43153        call_tests++;
43154        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
43155        des_xmlXPathObjectPtr(n_res, res, 1);
43156        xmlResetLastError();
43157        if (mem_base != xmlMemBlocks()) {
43158            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
43159	           xmlMemBlocks() - mem_base);
43160	    test_ret++;
43161            printf(" %d", n_ctxt);
43162            printf(" %d", n_res);
43163            printf("\n");
43164        }
43165    }
43166    }
43167    function_tests++;
43168#endif
43169
43170    return(test_ret);
43171}
43172
43173
43174static int
43175test_xmlXPathInit(void) {
43176    int test_ret = 0;
43177
43178#ifdef LIBXML_XPATH_ENABLED
43179    int mem_base;
43180
43181        mem_base = xmlMemBlocks();
43182
43183        xmlXPathInit();
43184        call_tests++;
43185        xmlResetLastError();
43186        if (mem_base != xmlMemBlocks()) {
43187            printf("Leak of %d blocks found in xmlXPathInit",
43188	           xmlMemBlocks() - mem_base);
43189	    test_ret++;
43190            printf("\n");
43191        }
43192    function_tests++;
43193#endif
43194
43195    return(test_ret);
43196}
43197
43198
43199static int
43200test_xmlXPathIsInf(void) {
43201    int test_ret = 0;
43202
43203#ifdef LIBXML_XPATH_ENABLED
43204    int mem_base;
43205    int ret_val;
43206    double val; /* a double value */
43207    int n_val;
43208
43209    for (n_val = 0;n_val < gen_nb_double;n_val++) {
43210        mem_base = xmlMemBlocks();
43211        val = gen_double(n_val, 0);
43212
43213        ret_val = xmlXPathIsInf(val);
43214        desret_int(ret_val);
43215        call_tests++;
43216        des_double(n_val, val, 0);
43217        xmlResetLastError();
43218        if (mem_base != xmlMemBlocks()) {
43219            printf("Leak of %d blocks found in xmlXPathIsInf",
43220	           xmlMemBlocks() - mem_base);
43221	    test_ret++;
43222            printf(" %d", n_val);
43223            printf("\n");
43224        }
43225    }
43226    function_tests++;
43227#endif
43228
43229    return(test_ret);
43230}
43231
43232
43233static int
43234test_xmlXPathIsNaN(void) {
43235    int test_ret = 0;
43236
43237#ifdef LIBXML_XPATH_ENABLED
43238    int mem_base;
43239    int ret_val;
43240    double val; /* a double value */
43241    int n_val;
43242
43243    for (n_val = 0;n_val < gen_nb_double;n_val++) {
43244        mem_base = xmlMemBlocks();
43245        val = gen_double(n_val, 0);
43246
43247        ret_val = xmlXPathIsNaN(val);
43248        desret_int(ret_val);
43249        call_tests++;
43250        des_double(n_val, val, 0);
43251        xmlResetLastError();
43252        if (mem_base != xmlMemBlocks()) {
43253            printf("Leak of %d blocks found in xmlXPathIsNaN",
43254	           xmlMemBlocks() - mem_base);
43255	    test_ret++;
43256            printf(" %d", n_val);
43257            printf("\n");
43258        }
43259    }
43260    function_tests++;
43261#endif
43262
43263    return(test_ret);
43264}
43265
43266
43267static int
43268test_xmlXPathNewContext(void) {
43269    int test_ret = 0;
43270
43271
43272    /* missing type support */
43273    return(test_ret);
43274}
43275
43276
43277static int
43278test_xmlXPathNodeSetCreate(void) {
43279    int test_ret = 0;
43280
43281#ifdef LIBXML_XPATH_ENABLED
43282    int mem_base;
43283    xmlNodeSetPtr ret_val;
43284    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
43285    int n_val;
43286
43287    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
43288        mem_base = xmlMemBlocks();
43289        val = gen_xmlNodePtr(n_val, 0);
43290
43291        ret_val = xmlXPathNodeSetCreate(val);
43292        desret_xmlNodeSetPtr(ret_val);
43293        call_tests++;
43294        des_xmlNodePtr(n_val, val, 0);
43295        xmlResetLastError();
43296        if (mem_base != xmlMemBlocks()) {
43297            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
43298	           xmlMemBlocks() - mem_base);
43299	    test_ret++;
43300            printf(" %d", n_val);
43301            printf("\n");
43302        }
43303    }
43304    function_tests++;
43305#endif
43306
43307    return(test_ret);
43308}
43309
43310
43311static int
43312test_xmlXPathObjectCopy(void) {
43313    int test_ret = 0;
43314
43315#ifdef LIBXML_XPATH_ENABLED
43316    int mem_base;
43317    xmlXPathObjectPtr ret_val;
43318    xmlXPathObjectPtr val; /* the original object */
43319    int n_val;
43320
43321    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
43322        mem_base = xmlMemBlocks();
43323        val = gen_xmlXPathObjectPtr(n_val, 0);
43324
43325        ret_val = xmlXPathObjectCopy(val);
43326        desret_xmlXPathObjectPtr(ret_val);
43327        call_tests++;
43328        des_xmlXPathObjectPtr(n_val, val, 0);
43329        xmlResetLastError();
43330        if (mem_base != xmlMemBlocks()) {
43331            printf("Leak of %d blocks found in xmlXPathObjectCopy",
43332	           xmlMemBlocks() - mem_base);
43333	    test_ret++;
43334            printf(" %d", n_val);
43335            printf("\n");
43336        }
43337    }
43338    function_tests++;
43339#endif
43340
43341    return(test_ret);
43342}
43343
43344
43345static int
43346test_xmlXPathOrderDocElems(void) {
43347    int test_ret = 0;
43348
43349#ifdef LIBXML_XPATH_ENABLED
43350    int mem_base;
43351    long ret_val;
43352    xmlDocPtr doc; /* an input document */
43353    int n_doc;
43354
43355    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43356        mem_base = xmlMemBlocks();
43357        doc = gen_xmlDocPtr(n_doc, 0);
43358
43359        ret_val = xmlXPathOrderDocElems(doc);
43360        desret_long(ret_val);
43361        call_tests++;
43362        des_xmlDocPtr(n_doc, doc, 0);
43363        xmlResetLastError();
43364        if (mem_base != xmlMemBlocks()) {
43365            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
43366	           xmlMemBlocks() - mem_base);
43367	    test_ret++;
43368            printf(" %d", n_doc);
43369            printf("\n");
43370        }
43371    }
43372    function_tests++;
43373#endif
43374
43375    return(test_ret);
43376}
43377
43378static int
43379test_xpath(void) {
43380    int test_ret = 0;
43381
43382    if (quiet == 0) printf("Testing xpath : 28 of 36 functions ...\n");
43383    test_ret += test_xmlXPathCastBooleanToNumber();
43384    test_ret += test_xmlXPathCastBooleanToString();
43385    test_ret += test_xmlXPathCastNodeSetToBoolean();
43386    test_ret += test_xmlXPathCastNodeSetToNumber();
43387    test_ret += test_xmlXPathCastNodeSetToString();
43388    test_ret += test_xmlXPathCastNodeToNumber();
43389    test_ret += test_xmlXPathCastNodeToString();
43390    test_ret += test_xmlXPathCastNumberToBoolean();
43391    test_ret += test_xmlXPathCastNumberToString();
43392    test_ret += test_xmlXPathCastStringToBoolean();
43393    test_ret += test_xmlXPathCastStringToNumber();
43394    test_ret += test_xmlXPathCastToBoolean();
43395    test_ret += test_xmlXPathCastToNumber();
43396    test_ret += test_xmlXPathCastToString();
43397    test_ret += test_xmlXPathCmpNodes();
43398    test_ret += test_xmlXPathCompile();
43399    test_ret += test_xmlXPathCompiledEval();
43400    test_ret += test_xmlXPathConvertBoolean();
43401    test_ret += test_xmlXPathConvertNumber();
43402    test_ret += test_xmlXPathConvertString();
43403    test_ret += test_xmlXPathCtxtCompile();
43404    test_ret += test_xmlXPathEval();
43405    test_ret += test_xmlXPathEvalExpression();
43406    test_ret += test_xmlXPathEvalPredicate();
43407    test_ret += test_xmlXPathInit();
43408    test_ret += test_xmlXPathIsInf();
43409    test_ret += test_xmlXPathIsNaN();
43410    test_ret += test_xmlXPathNewContext();
43411    test_ret += test_xmlXPathNodeSetCreate();
43412    test_ret += test_xmlXPathObjectCopy();
43413    test_ret += test_xmlXPathOrderDocElems();
43414
43415    if (test_ret != 0)
43416	printf("Module xpath: %d errors\n", test_ret);
43417    return(test_ret);
43418}
43419#ifdef LIBXML_XPATH_ENABLED
43420
43421#define gen_nb_xmlXPathParserContextPtr 1
43422static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43423    return(NULL);
43424}
43425static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
43426}
43427#endif
43428
43429
43430static int
43431test_valuePop(void) {
43432    int test_ret = 0;
43433
43434#ifdef LIBXML_XPATH_ENABLED
43435    int mem_base;
43436    xmlXPathObjectPtr ret_val;
43437    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
43438    int n_ctxt;
43439
43440    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43441        mem_base = xmlMemBlocks();
43442        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43443
43444        ret_val = valuePop(ctxt);
43445        desret_xmlXPathObjectPtr(ret_val);
43446        call_tests++;
43447        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43448        xmlResetLastError();
43449        if (mem_base != xmlMemBlocks()) {
43450            printf("Leak of %d blocks found in valuePop",
43451	           xmlMemBlocks() - mem_base);
43452	    test_ret++;
43453            printf(" %d", n_ctxt);
43454            printf("\n");
43455        }
43456    }
43457    function_tests++;
43458#endif
43459
43460    return(test_ret);
43461}
43462
43463
43464static int
43465test_valuePush(void) {
43466    int test_ret = 0;
43467
43468#ifdef LIBXML_XPATH_ENABLED
43469    int mem_base;
43470    int ret_val;
43471    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
43472    int n_ctxt;
43473    xmlXPathObjectPtr value; /* the XPath object */
43474    int n_value;
43475
43476    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43477    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
43478        mem_base = xmlMemBlocks();
43479        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43480        value = gen_xmlXPathObjectPtr(n_value, 1);
43481
43482        ret_val = valuePush(ctxt, value);
43483        desret_int(ret_val);
43484        call_tests++;
43485        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43486        des_xmlXPathObjectPtr(n_value, value, 1);
43487        xmlResetLastError();
43488        if (mem_base != xmlMemBlocks()) {
43489            printf("Leak of %d blocks found in valuePush",
43490	           xmlMemBlocks() - mem_base);
43491	    test_ret++;
43492            printf(" %d", n_ctxt);
43493            printf(" %d", n_value);
43494            printf("\n");
43495        }
43496    }
43497    }
43498    function_tests++;
43499#endif
43500
43501    return(test_ret);
43502}
43503
43504
43505static int
43506test_xmlXPathAddValues(void) {
43507    int test_ret = 0;
43508
43509#ifdef LIBXML_XPATH_ENABLED
43510    int mem_base;
43511    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43512    int n_ctxt;
43513
43514    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43515        mem_base = xmlMemBlocks();
43516        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43517
43518        xmlXPathAddValues(ctxt);
43519        call_tests++;
43520        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43521        xmlResetLastError();
43522        if (mem_base != xmlMemBlocks()) {
43523            printf("Leak of %d blocks found in xmlXPathAddValues",
43524	           xmlMemBlocks() - mem_base);
43525	    test_ret++;
43526            printf(" %d", n_ctxt);
43527            printf("\n");
43528        }
43529    }
43530    function_tests++;
43531#endif
43532
43533    return(test_ret);
43534}
43535
43536
43537static int
43538test_xmlXPathBooleanFunction(void) {
43539    int test_ret = 0;
43540
43541#ifdef LIBXML_XPATH_ENABLED
43542    int mem_base;
43543    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43544    int n_ctxt;
43545    int nargs; /* the number of arguments */
43546    int n_nargs;
43547
43548    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43549    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43550        mem_base = xmlMemBlocks();
43551        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43552        nargs = gen_int(n_nargs, 1);
43553
43554        xmlXPathBooleanFunction(ctxt, nargs);
43555        call_tests++;
43556        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43557        des_int(n_nargs, nargs, 1);
43558        xmlResetLastError();
43559        if (mem_base != xmlMemBlocks()) {
43560            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
43561	           xmlMemBlocks() - mem_base);
43562	    test_ret++;
43563            printf(" %d", n_ctxt);
43564            printf(" %d", n_nargs);
43565            printf("\n");
43566        }
43567    }
43568    }
43569    function_tests++;
43570#endif
43571
43572    return(test_ret);
43573}
43574
43575
43576static int
43577test_xmlXPathCeilingFunction(void) {
43578    int test_ret = 0;
43579
43580#ifdef LIBXML_XPATH_ENABLED
43581    int mem_base;
43582    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43583    int n_ctxt;
43584    int nargs; /* the number of arguments */
43585    int n_nargs;
43586
43587    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43588    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43589        mem_base = xmlMemBlocks();
43590        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43591        nargs = gen_int(n_nargs, 1);
43592
43593        xmlXPathCeilingFunction(ctxt, nargs);
43594        call_tests++;
43595        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43596        des_int(n_nargs, nargs, 1);
43597        xmlResetLastError();
43598        if (mem_base != xmlMemBlocks()) {
43599            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
43600	           xmlMemBlocks() - mem_base);
43601	    test_ret++;
43602            printf(" %d", n_ctxt);
43603            printf(" %d", n_nargs);
43604            printf("\n");
43605        }
43606    }
43607    }
43608    function_tests++;
43609#endif
43610
43611    return(test_ret);
43612}
43613
43614
43615static int
43616test_xmlXPathCompareValues(void) {
43617    int test_ret = 0;
43618
43619#ifdef LIBXML_XPATH_ENABLED
43620    int mem_base;
43621    int ret_val;
43622    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43623    int n_ctxt;
43624    int inf; /* less than (1) or greater than (0) */
43625    int n_inf;
43626    int strict; /* is the comparison strict */
43627    int n_strict;
43628
43629    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43630    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
43631    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
43632        mem_base = xmlMemBlocks();
43633        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43634        inf = gen_int(n_inf, 1);
43635        strict = gen_int(n_strict, 2);
43636
43637        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
43638        desret_int(ret_val);
43639        call_tests++;
43640        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43641        des_int(n_inf, inf, 1);
43642        des_int(n_strict, strict, 2);
43643        xmlResetLastError();
43644        if (mem_base != xmlMemBlocks()) {
43645            printf("Leak of %d blocks found in xmlXPathCompareValues",
43646	           xmlMemBlocks() - mem_base);
43647	    test_ret++;
43648            printf(" %d", n_ctxt);
43649            printf(" %d", n_inf);
43650            printf(" %d", n_strict);
43651            printf("\n");
43652        }
43653    }
43654    }
43655    }
43656    function_tests++;
43657#endif
43658
43659    return(test_ret);
43660}
43661
43662
43663static int
43664test_xmlXPathConcatFunction(void) {
43665    int test_ret = 0;
43666
43667#ifdef LIBXML_XPATH_ENABLED
43668    int mem_base;
43669    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43670    int n_ctxt;
43671    int nargs; /* the number of arguments */
43672    int n_nargs;
43673
43674    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43675    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43676        mem_base = xmlMemBlocks();
43677        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43678        nargs = gen_int(n_nargs, 1);
43679
43680        xmlXPathConcatFunction(ctxt, nargs);
43681        call_tests++;
43682        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43683        des_int(n_nargs, nargs, 1);
43684        xmlResetLastError();
43685        if (mem_base != xmlMemBlocks()) {
43686            printf("Leak of %d blocks found in xmlXPathConcatFunction",
43687	           xmlMemBlocks() - mem_base);
43688	    test_ret++;
43689            printf(" %d", n_ctxt);
43690            printf(" %d", n_nargs);
43691            printf("\n");
43692        }
43693    }
43694    }
43695    function_tests++;
43696#endif
43697
43698    return(test_ret);
43699}
43700
43701
43702static int
43703test_xmlXPathContainsFunction(void) {
43704    int test_ret = 0;
43705
43706#ifdef LIBXML_XPATH_ENABLED
43707    int mem_base;
43708    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43709    int n_ctxt;
43710    int nargs; /* the number of arguments */
43711    int n_nargs;
43712
43713    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43714    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43715        mem_base = xmlMemBlocks();
43716        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43717        nargs = gen_int(n_nargs, 1);
43718
43719        xmlXPathContainsFunction(ctxt, nargs);
43720        call_tests++;
43721        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43722        des_int(n_nargs, nargs, 1);
43723        xmlResetLastError();
43724        if (mem_base != xmlMemBlocks()) {
43725            printf("Leak of %d blocks found in xmlXPathContainsFunction",
43726	           xmlMemBlocks() - mem_base);
43727	    test_ret++;
43728            printf(" %d", n_ctxt);
43729            printf(" %d", n_nargs);
43730            printf("\n");
43731        }
43732    }
43733    }
43734    function_tests++;
43735#endif
43736
43737    return(test_ret);
43738}
43739
43740
43741static int
43742test_xmlXPathCountFunction(void) {
43743    int test_ret = 0;
43744
43745#ifdef LIBXML_XPATH_ENABLED
43746    int mem_base;
43747    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43748    int n_ctxt;
43749    int nargs; /* the number of arguments */
43750    int n_nargs;
43751
43752    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43753    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
43754        mem_base = xmlMemBlocks();
43755        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43756        nargs = gen_int(n_nargs, 1);
43757
43758        xmlXPathCountFunction(ctxt, nargs);
43759        call_tests++;
43760        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
43761        des_int(n_nargs, nargs, 1);
43762        xmlResetLastError();
43763        if (mem_base != xmlMemBlocks()) {
43764            printf("Leak of %d blocks found in xmlXPathCountFunction",
43765	           xmlMemBlocks() - mem_base);
43766	    test_ret++;
43767            printf(" %d", n_ctxt);
43768            printf(" %d", n_nargs);
43769            printf("\n");
43770        }
43771    }
43772    }
43773    function_tests++;
43774#endif
43775
43776    return(test_ret);
43777}
43778
43779
43780static int
43781test_xmlXPathDebugDumpCompExpr(void) {
43782    int test_ret = 0;
43783
43784#ifdef LIBXML_XPATH_ENABLED
43785#ifdef LIBXML_DEBUG_ENABLED
43786    int mem_base;
43787    FILE * output; /* the FILE * for the output */
43788    int n_output;
43789    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
43790    int n_comp;
43791    int depth; /* the indentation level. */
43792    int n_depth;
43793
43794    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
43795    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
43796    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
43797        mem_base = xmlMemBlocks();
43798        output = gen_FILE_ptr(n_output, 0);
43799        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
43800        depth = gen_int(n_depth, 2);
43801
43802        xmlXPathDebugDumpCompExpr(output, comp, depth);
43803        call_tests++;
43804        des_FILE_ptr(n_output, output, 0);
43805        des_xmlXPathCompExprPtr(n_comp, comp, 1);
43806        des_int(n_depth, depth, 2);
43807        xmlResetLastError();
43808        if (mem_base != xmlMemBlocks()) {
43809            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
43810	           xmlMemBlocks() - mem_base);
43811	    test_ret++;
43812            printf(" %d", n_output);
43813            printf(" %d", n_comp);
43814            printf(" %d", n_depth);
43815            printf("\n");
43816        }
43817    }
43818    }
43819    }
43820    function_tests++;
43821#endif
43822#endif
43823
43824    return(test_ret);
43825}
43826
43827
43828static int
43829test_xmlXPathDebugDumpObject(void) {
43830    int test_ret = 0;
43831
43832#ifdef LIBXML_XPATH_ENABLED
43833#ifdef LIBXML_DEBUG_ENABLED
43834    int mem_base;
43835    FILE * output; /* the FILE * to dump the output */
43836    int n_output;
43837    xmlXPathObjectPtr cur; /* the object to inspect */
43838    int n_cur;
43839    int depth; /* indentation level */
43840    int n_depth;
43841
43842    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
43843    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
43844    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
43845        mem_base = xmlMemBlocks();
43846        output = gen_FILE_ptr(n_output, 0);
43847        cur = gen_xmlXPathObjectPtr(n_cur, 1);
43848        depth = gen_int(n_depth, 2);
43849
43850        xmlXPathDebugDumpObject(output, cur, depth);
43851        call_tests++;
43852        des_FILE_ptr(n_output, output, 0);
43853        des_xmlXPathObjectPtr(n_cur, cur, 1);
43854        des_int(n_depth, depth, 2);
43855        xmlResetLastError();
43856        if (mem_base != xmlMemBlocks()) {
43857            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
43858	           xmlMemBlocks() - mem_base);
43859	    test_ret++;
43860            printf(" %d", n_output);
43861            printf(" %d", n_cur);
43862            printf(" %d", n_depth);
43863            printf("\n");
43864        }
43865    }
43866    }
43867    }
43868    function_tests++;
43869#endif
43870#endif
43871
43872    return(test_ret);
43873}
43874
43875
43876static int
43877test_xmlXPathDifference(void) {
43878    int test_ret = 0;
43879
43880#ifdef LIBXML_XPATH_ENABLED
43881    int mem_base;
43882    xmlNodeSetPtr ret_val;
43883    xmlNodeSetPtr nodes1; /* a node-set */
43884    int n_nodes1;
43885    xmlNodeSetPtr nodes2; /* a node-set */
43886    int n_nodes2;
43887
43888    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
43889    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
43890        mem_base = xmlMemBlocks();
43891        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
43892        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
43893
43894        ret_val = xmlXPathDifference(nodes1, nodes2);
43895        desret_xmlNodeSetPtr(ret_val);
43896        call_tests++;
43897        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
43898        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
43899        xmlResetLastError();
43900        if (mem_base != xmlMemBlocks()) {
43901            printf("Leak of %d blocks found in xmlXPathDifference",
43902	           xmlMemBlocks() - mem_base);
43903	    test_ret++;
43904            printf(" %d", n_nodes1);
43905            printf(" %d", n_nodes2);
43906            printf("\n");
43907        }
43908    }
43909    }
43910    function_tests++;
43911#endif
43912
43913    return(test_ret);
43914}
43915
43916
43917static int
43918test_xmlXPathDistinct(void) {
43919    int test_ret = 0;
43920
43921#ifdef LIBXML_XPATH_ENABLED
43922    int mem_base;
43923    xmlNodeSetPtr ret_val;
43924    xmlNodeSetPtr nodes; /* a node-set */
43925    int n_nodes;
43926
43927    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
43928        mem_base = xmlMemBlocks();
43929        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
43930
43931        ret_val = xmlXPathDistinct(nodes);
43932        desret_xmlNodeSetPtr(ret_val);
43933        call_tests++;
43934        des_xmlNodeSetPtr(n_nodes, nodes, 0);
43935        xmlResetLastError();
43936        if (mem_base != xmlMemBlocks()) {
43937            printf("Leak of %d blocks found in xmlXPathDistinct",
43938	           xmlMemBlocks() - mem_base);
43939	    test_ret++;
43940            printf(" %d", n_nodes);
43941            printf("\n");
43942        }
43943    }
43944    function_tests++;
43945#endif
43946
43947    return(test_ret);
43948}
43949
43950
43951static int
43952test_xmlXPathDistinctSorted(void) {
43953    int test_ret = 0;
43954
43955#ifdef LIBXML_XPATH_ENABLED
43956    int mem_base;
43957    xmlNodeSetPtr ret_val;
43958    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
43959    int n_nodes;
43960
43961    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
43962        mem_base = xmlMemBlocks();
43963        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
43964
43965        ret_val = xmlXPathDistinctSorted(nodes);
43966        desret_xmlNodeSetPtr(ret_val);
43967        call_tests++;
43968        des_xmlNodeSetPtr(n_nodes, nodes, 0);
43969        xmlResetLastError();
43970        if (mem_base != xmlMemBlocks()) {
43971            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
43972	           xmlMemBlocks() - mem_base);
43973	    test_ret++;
43974            printf(" %d", n_nodes);
43975            printf("\n");
43976        }
43977    }
43978    function_tests++;
43979#endif
43980
43981    return(test_ret);
43982}
43983
43984
43985static int
43986test_xmlXPathDivValues(void) {
43987    int test_ret = 0;
43988
43989#ifdef LIBXML_XPATH_ENABLED
43990    int mem_base;
43991    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
43992    int n_ctxt;
43993
43994    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
43995        mem_base = xmlMemBlocks();
43996        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
43997
43998        xmlXPathDivValues(ctxt);
43999        call_tests++;
44000        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44001        xmlResetLastError();
44002        if (mem_base != xmlMemBlocks()) {
44003            printf("Leak of %d blocks found in xmlXPathDivValues",
44004	           xmlMemBlocks() - mem_base);
44005	    test_ret++;
44006            printf(" %d", n_ctxt);
44007            printf("\n");
44008        }
44009    }
44010    function_tests++;
44011#endif
44012
44013    return(test_ret);
44014}
44015
44016
44017static int
44018test_xmlXPathEqualValues(void) {
44019    int test_ret = 0;
44020
44021#ifdef LIBXML_XPATH_ENABLED
44022    int mem_base;
44023    int ret_val;
44024    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44025    int n_ctxt;
44026
44027    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44028        mem_base = xmlMemBlocks();
44029        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44030
44031        ret_val = xmlXPathEqualValues(ctxt);
44032        desret_int(ret_val);
44033        call_tests++;
44034        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44035        xmlResetLastError();
44036        if (mem_base != xmlMemBlocks()) {
44037            printf("Leak of %d blocks found in xmlXPathEqualValues",
44038	           xmlMemBlocks() - mem_base);
44039	    test_ret++;
44040            printf(" %d", n_ctxt);
44041            printf("\n");
44042        }
44043    }
44044    function_tests++;
44045#endif
44046
44047    return(test_ret);
44048}
44049
44050
44051static int
44052test_xmlXPathErr(void) {
44053    int test_ret = 0;
44054
44055#ifdef LIBXML_XPATH_ENABLED
44056    int mem_base;
44057    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
44058    int n_ctxt;
44059    int error; /* the error code */
44060    int n_error;
44061
44062    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44063    for (n_error = 0;n_error < gen_nb_int;n_error++) {
44064        mem_base = xmlMemBlocks();
44065        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44066        error = gen_int(n_error, 1);
44067
44068        xmlXPathErr(ctxt, error);
44069        call_tests++;
44070        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44071        des_int(n_error, error, 1);
44072        xmlResetLastError();
44073        if (mem_base != xmlMemBlocks()) {
44074            printf("Leak of %d blocks found in xmlXPathErr",
44075	           xmlMemBlocks() - mem_base);
44076	    test_ret++;
44077            printf(" %d", n_ctxt);
44078            printf(" %d", n_error);
44079            printf("\n");
44080        }
44081    }
44082    }
44083    function_tests++;
44084#endif
44085
44086    return(test_ret);
44087}
44088
44089
44090static int
44091test_xmlXPathEvalExpr(void) {
44092    int test_ret = 0;
44093
44094#ifdef LIBXML_XPATH_ENABLED
44095    int mem_base;
44096    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44097    int n_ctxt;
44098
44099    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44100        mem_base = xmlMemBlocks();
44101        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44102
44103        xmlXPathEvalExpr(ctxt);
44104        call_tests++;
44105        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44106        xmlResetLastError();
44107        if (mem_base != xmlMemBlocks()) {
44108            printf("Leak of %d blocks found in xmlXPathEvalExpr",
44109	           xmlMemBlocks() - mem_base);
44110	    test_ret++;
44111            printf(" %d", n_ctxt);
44112            printf("\n");
44113        }
44114    }
44115    function_tests++;
44116#endif
44117
44118    return(test_ret);
44119}
44120
44121
44122static int
44123test_xmlXPathEvaluatePredicateResult(void) {
44124    int test_ret = 0;
44125
44126#ifdef LIBXML_XPATH_ENABLED
44127    int mem_base;
44128    int ret_val;
44129    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44130    int n_ctxt;
44131    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
44132    int n_res;
44133
44134    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44135    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
44136        mem_base = xmlMemBlocks();
44137        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44138        res = gen_xmlXPathObjectPtr(n_res, 1);
44139
44140        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
44141        desret_int(ret_val);
44142        call_tests++;
44143        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44144        des_xmlXPathObjectPtr(n_res, res, 1);
44145        xmlResetLastError();
44146        if (mem_base != xmlMemBlocks()) {
44147            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
44148	           xmlMemBlocks() - mem_base);
44149	    test_ret++;
44150            printf(" %d", n_ctxt);
44151            printf(" %d", n_res);
44152            printf("\n");
44153        }
44154    }
44155    }
44156    function_tests++;
44157#endif
44158
44159    return(test_ret);
44160}
44161
44162
44163static int
44164test_xmlXPathFalseFunction(void) {
44165    int test_ret = 0;
44166
44167#ifdef LIBXML_XPATH_ENABLED
44168    int mem_base;
44169    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44170    int n_ctxt;
44171    int nargs; /* the number of arguments */
44172    int n_nargs;
44173
44174    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44175    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44176        mem_base = xmlMemBlocks();
44177        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44178        nargs = gen_int(n_nargs, 1);
44179
44180        xmlXPathFalseFunction(ctxt, nargs);
44181        call_tests++;
44182        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44183        des_int(n_nargs, nargs, 1);
44184        xmlResetLastError();
44185        if (mem_base != xmlMemBlocks()) {
44186            printf("Leak of %d blocks found in xmlXPathFalseFunction",
44187	           xmlMemBlocks() - mem_base);
44188	    test_ret++;
44189            printf(" %d", n_ctxt);
44190            printf(" %d", n_nargs);
44191            printf("\n");
44192        }
44193    }
44194    }
44195    function_tests++;
44196#endif
44197
44198    return(test_ret);
44199}
44200
44201
44202static int
44203test_xmlXPathFloorFunction(void) {
44204    int test_ret = 0;
44205
44206#ifdef LIBXML_XPATH_ENABLED
44207    int mem_base;
44208    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44209    int n_ctxt;
44210    int nargs; /* the number of arguments */
44211    int n_nargs;
44212
44213    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44214    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44215        mem_base = xmlMemBlocks();
44216        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44217        nargs = gen_int(n_nargs, 1);
44218
44219        xmlXPathFloorFunction(ctxt, nargs);
44220        call_tests++;
44221        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44222        des_int(n_nargs, nargs, 1);
44223        xmlResetLastError();
44224        if (mem_base != xmlMemBlocks()) {
44225            printf("Leak of %d blocks found in xmlXPathFloorFunction",
44226	           xmlMemBlocks() - mem_base);
44227	    test_ret++;
44228            printf(" %d", n_ctxt);
44229            printf(" %d", n_nargs);
44230            printf("\n");
44231        }
44232    }
44233    }
44234    function_tests++;
44235#endif
44236
44237    return(test_ret);
44238}
44239
44240
44241static int
44242test_xmlXPathFunctionLookup(void) {
44243    int test_ret = 0;
44244
44245
44246    /* missing type support */
44247    return(test_ret);
44248}
44249
44250
44251static int
44252test_xmlXPathFunctionLookupNS(void) {
44253    int test_ret = 0;
44254
44255
44256    /* missing type support */
44257    return(test_ret);
44258}
44259
44260
44261static int
44262test_xmlXPathHasSameNodes(void) {
44263    int test_ret = 0;
44264
44265#ifdef LIBXML_XPATH_ENABLED
44266    int mem_base;
44267    int ret_val;
44268    xmlNodeSetPtr nodes1; /* a node-set */
44269    int n_nodes1;
44270    xmlNodeSetPtr nodes2; /* a node-set */
44271    int n_nodes2;
44272
44273    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
44274    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
44275        mem_base = xmlMemBlocks();
44276        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
44277        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
44278
44279        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
44280        desret_int(ret_val);
44281        call_tests++;
44282        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
44283        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
44284        xmlResetLastError();
44285        if (mem_base != xmlMemBlocks()) {
44286            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
44287	           xmlMemBlocks() - mem_base);
44288	    test_ret++;
44289            printf(" %d", n_nodes1);
44290            printf(" %d", n_nodes2);
44291            printf("\n");
44292        }
44293    }
44294    }
44295    function_tests++;
44296#endif
44297
44298    return(test_ret);
44299}
44300
44301
44302static int
44303test_xmlXPathIdFunction(void) {
44304    int test_ret = 0;
44305
44306#ifdef LIBXML_XPATH_ENABLED
44307    int mem_base;
44308    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44309    int n_ctxt;
44310    int nargs; /* the number of arguments */
44311    int n_nargs;
44312
44313    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44314    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44315        mem_base = xmlMemBlocks();
44316        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44317        nargs = gen_int(n_nargs, 1);
44318
44319        xmlXPathIdFunction(ctxt, nargs);
44320        call_tests++;
44321        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44322        des_int(n_nargs, nargs, 1);
44323        xmlResetLastError();
44324        if (mem_base != xmlMemBlocks()) {
44325            printf("Leak of %d blocks found in xmlXPathIdFunction",
44326	           xmlMemBlocks() - mem_base);
44327	    test_ret++;
44328            printf(" %d", n_ctxt);
44329            printf(" %d", n_nargs);
44330            printf("\n");
44331        }
44332    }
44333    }
44334    function_tests++;
44335#endif
44336
44337    return(test_ret);
44338}
44339
44340
44341static int
44342test_xmlXPathIntersection(void) {
44343    int test_ret = 0;
44344
44345#ifdef LIBXML_XPATH_ENABLED
44346    int mem_base;
44347    xmlNodeSetPtr ret_val;
44348    xmlNodeSetPtr nodes1; /* a node-set */
44349    int n_nodes1;
44350    xmlNodeSetPtr nodes2; /* a node-set */
44351    int n_nodes2;
44352
44353    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
44354    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
44355        mem_base = xmlMemBlocks();
44356        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
44357        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
44358
44359        ret_val = xmlXPathIntersection(nodes1, nodes2);
44360        desret_xmlNodeSetPtr(ret_val);
44361        call_tests++;
44362        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
44363        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
44364        xmlResetLastError();
44365        if (mem_base != xmlMemBlocks()) {
44366            printf("Leak of %d blocks found in xmlXPathIntersection",
44367	           xmlMemBlocks() - mem_base);
44368	    test_ret++;
44369            printf(" %d", n_nodes1);
44370            printf(" %d", n_nodes2);
44371            printf("\n");
44372        }
44373    }
44374    }
44375    function_tests++;
44376#endif
44377
44378    return(test_ret);
44379}
44380
44381
44382static int
44383test_xmlXPathIsNodeType(void) {
44384    int test_ret = 0;
44385
44386#ifdef LIBXML_XPATH_ENABLED
44387    int mem_base;
44388    int ret_val;
44389    xmlChar * name; /* a name string */
44390    int n_name;
44391
44392    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44393        mem_base = xmlMemBlocks();
44394        name = gen_const_xmlChar_ptr(n_name, 0);
44395
44396        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
44397        desret_int(ret_val);
44398        call_tests++;
44399        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
44400        xmlResetLastError();
44401        if (mem_base != xmlMemBlocks()) {
44402            printf("Leak of %d blocks found in xmlXPathIsNodeType",
44403	           xmlMemBlocks() - mem_base);
44404	    test_ret++;
44405            printf(" %d", n_name);
44406            printf("\n");
44407        }
44408    }
44409    function_tests++;
44410#endif
44411
44412    return(test_ret);
44413}
44414
44415
44416static int
44417test_xmlXPathLangFunction(void) {
44418    int test_ret = 0;
44419
44420#ifdef LIBXML_XPATH_ENABLED
44421    int mem_base;
44422    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44423    int n_ctxt;
44424    int nargs; /* the number of arguments */
44425    int n_nargs;
44426
44427    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44428    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44429        mem_base = xmlMemBlocks();
44430        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44431        nargs = gen_int(n_nargs, 1);
44432
44433        xmlXPathLangFunction(ctxt, nargs);
44434        call_tests++;
44435        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44436        des_int(n_nargs, nargs, 1);
44437        xmlResetLastError();
44438        if (mem_base != xmlMemBlocks()) {
44439            printf("Leak of %d blocks found in xmlXPathLangFunction",
44440	           xmlMemBlocks() - mem_base);
44441	    test_ret++;
44442            printf(" %d", n_ctxt);
44443            printf(" %d", n_nargs);
44444            printf("\n");
44445        }
44446    }
44447    }
44448    function_tests++;
44449#endif
44450
44451    return(test_ret);
44452}
44453
44454
44455static int
44456test_xmlXPathLastFunction(void) {
44457    int test_ret = 0;
44458
44459#ifdef LIBXML_XPATH_ENABLED
44460    int mem_base;
44461    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44462    int n_ctxt;
44463    int nargs; /* the number of arguments */
44464    int n_nargs;
44465
44466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44467    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44468        mem_base = xmlMemBlocks();
44469        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44470        nargs = gen_int(n_nargs, 1);
44471
44472        xmlXPathLastFunction(ctxt, nargs);
44473        call_tests++;
44474        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44475        des_int(n_nargs, nargs, 1);
44476        xmlResetLastError();
44477        if (mem_base != xmlMemBlocks()) {
44478            printf("Leak of %d blocks found in xmlXPathLastFunction",
44479	           xmlMemBlocks() - mem_base);
44480	    test_ret++;
44481            printf(" %d", n_ctxt);
44482            printf(" %d", n_nargs);
44483            printf("\n");
44484        }
44485    }
44486    }
44487    function_tests++;
44488#endif
44489
44490    return(test_ret);
44491}
44492
44493
44494static int
44495test_xmlXPathLeading(void) {
44496    int test_ret = 0;
44497
44498#ifdef LIBXML_XPATH_ENABLED
44499    int mem_base;
44500    xmlNodeSetPtr ret_val;
44501    xmlNodeSetPtr nodes1; /* a node-set */
44502    int n_nodes1;
44503    xmlNodeSetPtr nodes2; /* a node-set */
44504    int n_nodes2;
44505
44506    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
44507    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
44508        mem_base = xmlMemBlocks();
44509        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
44510        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
44511
44512        ret_val = xmlXPathLeading(nodes1, nodes2);
44513        desret_xmlNodeSetPtr(ret_val);
44514        call_tests++;
44515        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
44516        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
44517        xmlResetLastError();
44518        if (mem_base != xmlMemBlocks()) {
44519            printf("Leak of %d blocks found in xmlXPathLeading",
44520	           xmlMemBlocks() - mem_base);
44521	    test_ret++;
44522            printf(" %d", n_nodes1);
44523            printf(" %d", n_nodes2);
44524            printf("\n");
44525        }
44526    }
44527    }
44528    function_tests++;
44529#endif
44530
44531    return(test_ret);
44532}
44533
44534
44535static int
44536test_xmlXPathLeadingSorted(void) {
44537    int test_ret = 0;
44538
44539#ifdef LIBXML_XPATH_ENABLED
44540    int mem_base;
44541    xmlNodeSetPtr ret_val;
44542    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
44543    int n_nodes1;
44544    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
44545    int n_nodes2;
44546
44547    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
44548    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
44549        mem_base = xmlMemBlocks();
44550        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
44551        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
44552
44553        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
44554        desret_xmlNodeSetPtr(ret_val);
44555        call_tests++;
44556        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
44557        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
44558        xmlResetLastError();
44559        if (mem_base != xmlMemBlocks()) {
44560            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
44561	           xmlMemBlocks() - mem_base);
44562	    test_ret++;
44563            printf(" %d", n_nodes1);
44564            printf(" %d", n_nodes2);
44565            printf("\n");
44566        }
44567    }
44568    }
44569    function_tests++;
44570#endif
44571
44572    return(test_ret);
44573}
44574
44575
44576static int
44577test_xmlXPathLocalNameFunction(void) {
44578    int test_ret = 0;
44579
44580#ifdef LIBXML_XPATH_ENABLED
44581    int mem_base;
44582    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44583    int n_ctxt;
44584    int nargs; /* the number of arguments */
44585    int n_nargs;
44586
44587    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44588    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44589        mem_base = xmlMemBlocks();
44590        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44591        nargs = gen_int(n_nargs, 1);
44592
44593        xmlXPathLocalNameFunction(ctxt, nargs);
44594        call_tests++;
44595        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44596        des_int(n_nargs, nargs, 1);
44597        xmlResetLastError();
44598        if (mem_base != xmlMemBlocks()) {
44599            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
44600	           xmlMemBlocks() - mem_base);
44601	    test_ret++;
44602            printf(" %d", n_ctxt);
44603            printf(" %d", n_nargs);
44604            printf("\n");
44605        }
44606    }
44607    }
44608    function_tests++;
44609#endif
44610
44611    return(test_ret);
44612}
44613
44614
44615static int
44616test_xmlXPathModValues(void) {
44617    int test_ret = 0;
44618
44619#ifdef LIBXML_XPATH_ENABLED
44620    int mem_base;
44621    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44622    int n_ctxt;
44623
44624    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44625        mem_base = xmlMemBlocks();
44626        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44627
44628        xmlXPathModValues(ctxt);
44629        call_tests++;
44630        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44631        xmlResetLastError();
44632        if (mem_base != xmlMemBlocks()) {
44633            printf("Leak of %d blocks found in xmlXPathModValues",
44634	           xmlMemBlocks() - mem_base);
44635	    test_ret++;
44636            printf(" %d", n_ctxt);
44637            printf("\n");
44638        }
44639    }
44640    function_tests++;
44641#endif
44642
44643    return(test_ret);
44644}
44645
44646
44647static int
44648test_xmlXPathMultValues(void) {
44649    int test_ret = 0;
44650
44651#ifdef LIBXML_XPATH_ENABLED
44652    int mem_base;
44653    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44654    int n_ctxt;
44655
44656    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44657        mem_base = xmlMemBlocks();
44658        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44659
44660        xmlXPathMultValues(ctxt);
44661        call_tests++;
44662        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44663        xmlResetLastError();
44664        if (mem_base != xmlMemBlocks()) {
44665            printf("Leak of %d blocks found in xmlXPathMultValues",
44666	           xmlMemBlocks() - mem_base);
44667	    test_ret++;
44668            printf(" %d", n_ctxt);
44669            printf("\n");
44670        }
44671    }
44672    function_tests++;
44673#endif
44674
44675    return(test_ret);
44676}
44677
44678
44679static int
44680test_xmlXPathNamespaceURIFunction(void) {
44681    int test_ret = 0;
44682
44683#ifdef LIBXML_XPATH_ENABLED
44684    int mem_base;
44685    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44686    int n_ctxt;
44687    int nargs; /* the number of arguments */
44688    int n_nargs;
44689
44690    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44691    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
44692        mem_base = xmlMemBlocks();
44693        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44694        nargs = gen_int(n_nargs, 1);
44695
44696        xmlXPathNamespaceURIFunction(ctxt, nargs);
44697        call_tests++;
44698        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44699        des_int(n_nargs, nargs, 1);
44700        xmlResetLastError();
44701        if (mem_base != xmlMemBlocks()) {
44702            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
44703	           xmlMemBlocks() - mem_base);
44704	    test_ret++;
44705            printf(" %d", n_ctxt);
44706            printf(" %d", n_nargs);
44707            printf("\n");
44708        }
44709    }
44710    }
44711    function_tests++;
44712#endif
44713
44714    return(test_ret);
44715}
44716
44717
44718static int
44719test_xmlXPathNewBoolean(void) {
44720    int test_ret = 0;
44721
44722#ifdef LIBXML_XPATH_ENABLED
44723    int mem_base;
44724    xmlXPathObjectPtr ret_val;
44725    int val; /* the boolean value */
44726    int n_val;
44727
44728    for (n_val = 0;n_val < gen_nb_int;n_val++) {
44729        mem_base = xmlMemBlocks();
44730        val = gen_int(n_val, 0);
44731
44732        ret_val = xmlXPathNewBoolean(val);
44733        desret_xmlXPathObjectPtr(ret_val);
44734        call_tests++;
44735        des_int(n_val, val, 0);
44736        xmlResetLastError();
44737        if (mem_base != xmlMemBlocks()) {
44738            printf("Leak of %d blocks found in xmlXPathNewBoolean",
44739	           xmlMemBlocks() - mem_base);
44740	    test_ret++;
44741            printf(" %d", n_val);
44742            printf("\n");
44743        }
44744    }
44745    function_tests++;
44746#endif
44747
44748    return(test_ret);
44749}
44750
44751
44752static int
44753test_xmlXPathNewCString(void) {
44754    int test_ret = 0;
44755
44756#ifdef LIBXML_XPATH_ENABLED
44757    int mem_base;
44758    xmlXPathObjectPtr ret_val;
44759    char * val; /* the char * value */
44760    int n_val;
44761
44762    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
44763        mem_base = xmlMemBlocks();
44764        val = gen_const_char_ptr(n_val, 0);
44765
44766        ret_val = xmlXPathNewCString((const char *)val);
44767        desret_xmlXPathObjectPtr(ret_val);
44768        call_tests++;
44769        des_const_char_ptr(n_val, (const char *)val, 0);
44770        xmlResetLastError();
44771        if (mem_base != xmlMemBlocks()) {
44772            printf("Leak of %d blocks found in xmlXPathNewCString",
44773	           xmlMemBlocks() - mem_base);
44774	    test_ret++;
44775            printf(" %d", n_val);
44776            printf("\n");
44777        }
44778    }
44779    function_tests++;
44780#endif
44781
44782    return(test_ret);
44783}
44784
44785
44786static int
44787test_xmlXPathNewFloat(void) {
44788    int test_ret = 0;
44789
44790#ifdef LIBXML_XPATH_ENABLED
44791    int mem_base;
44792    xmlXPathObjectPtr ret_val;
44793    double val; /* the double value */
44794    int n_val;
44795
44796    for (n_val = 0;n_val < gen_nb_double;n_val++) {
44797        mem_base = xmlMemBlocks();
44798        val = gen_double(n_val, 0);
44799
44800        ret_val = xmlXPathNewFloat(val);
44801        desret_xmlXPathObjectPtr(ret_val);
44802        call_tests++;
44803        des_double(n_val, val, 0);
44804        xmlResetLastError();
44805        if (mem_base != xmlMemBlocks()) {
44806            printf("Leak of %d blocks found in xmlXPathNewFloat",
44807	           xmlMemBlocks() - mem_base);
44808	    test_ret++;
44809            printf(" %d", n_val);
44810            printf("\n");
44811        }
44812    }
44813    function_tests++;
44814#endif
44815
44816    return(test_ret);
44817}
44818
44819
44820static int
44821test_xmlXPathNewNodeSet(void) {
44822    int test_ret = 0;
44823
44824#ifdef LIBXML_XPATH_ENABLED
44825    int mem_base;
44826    xmlXPathObjectPtr ret_val;
44827    xmlNodePtr val; /* the NodePtr value */
44828    int n_val;
44829
44830    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
44831        mem_base = xmlMemBlocks();
44832        val = gen_xmlNodePtr(n_val, 0);
44833
44834        ret_val = xmlXPathNewNodeSet(val);
44835        desret_xmlXPathObjectPtr(ret_val);
44836        call_tests++;
44837        des_xmlNodePtr(n_val, val, 0);
44838        xmlResetLastError();
44839        if (mem_base != xmlMemBlocks()) {
44840            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
44841	           xmlMemBlocks() - mem_base);
44842	    test_ret++;
44843            printf(" %d", n_val);
44844            printf("\n");
44845        }
44846    }
44847    function_tests++;
44848#endif
44849
44850    return(test_ret);
44851}
44852
44853
44854static int
44855test_xmlXPathNewNodeSetList(void) {
44856    int test_ret = 0;
44857
44858#ifdef LIBXML_XPATH_ENABLED
44859    int mem_base;
44860    xmlXPathObjectPtr ret_val;
44861    xmlNodeSetPtr val; /* an existing NodeSet */
44862    int n_val;
44863
44864    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
44865        mem_base = xmlMemBlocks();
44866        val = gen_xmlNodeSetPtr(n_val, 0);
44867
44868        ret_val = xmlXPathNewNodeSetList(val);
44869        desret_xmlXPathObjectPtr(ret_val);
44870        call_tests++;
44871        des_xmlNodeSetPtr(n_val, val, 0);
44872        xmlResetLastError();
44873        if (mem_base != xmlMemBlocks()) {
44874            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
44875	           xmlMemBlocks() - mem_base);
44876	    test_ret++;
44877            printf(" %d", n_val);
44878            printf("\n");
44879        }
44880    }
44881    function_tests++;
44882#endif
44883
44884    return(test_ret);
44885}
44886
44887
44888static int
44889test_xmlXPathNewParserContext(void) {
44890    int test_ret = 0;
44891
44892
44893    /* missing type support */
44894    return(test_ret);
44895}
44896
44897
44898static int
44899test_xmlXPathNewString(void) {
44900    int test_ret = 0;
44901
44902#ifdef LIBXML_XPATH_ENABLED
44903    int mem_base;
44904    xmlXPathObjectPtr ret_val;
44905    xmlChar * val; /* the xmlChar * value */
44906    int n_val;
44907
44908    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
44909        mem_base = xmlMemBlocks();
44910        val = gen_const_xmlChar_ptr(n_val, 0);
44911
44912        ret_val = xmlXPathNewString((const xmlChar *)val);
44913        desret_xmlXPathObjectPtr(ret_val);
44914        call_tests++;
44915        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
44916        xmlResetLastError();
44917        if (mem_base != xmlMemBlocks()) {
44918            printf("Leak of %d blocks found in xmlXPathNewString",
44919	           xmlMemBlocks() - mem_base);
44920	    test_ret++;
44921            printf(" %d", n_val);
44922            printf("\n");
44923        }
44924    }
44925    function_tests++;
44926#endif
44927
44928    return(test_ret);
44929}
44930
44931
44932static int
44933test_xmlXPathNextAncestor(void) {
44934    int test_ret = 0;
44935
44936#ifdef LIBXML_XPATH_ENABLED
44937    int mem_base;
44938    xmlNodePtr ret_val;
44939    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44940    int n_ctxt;
44941    xmlNodePtr cur; /* the current node in the traversal */
44942    int n_cur;
44943
44944    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44945    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44946        mem_base = xmlMemBlocks();
44947        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44948        cur = gen_xmlNodePtr(n_cur, 1);
44949
44950        ret_val = xmlXPathNextAncestor(ctxt, cur);
44951        desret_xmlNodePtr(ret_val);
44952        call_tests++;
44953        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44954        des_xmlNodePtr(n_cur, cur, 1);
44955        xmlResetLastError();
44956        if (mem_base != xmlMemBlocks()) {
44957            printf("Leak of %d blocks found in xmlXPathNextAncestor",
44958	           xmlMemBlocks() - mem_base);
44959	    test_ret++;
44960            printf(" %d", n_ctxt);
44961            printf(" %d", n_cur);
44962            printf("\n");
44963        }
44964    }
44965    }
44966    function_tests++;
44967#endif
44968
44969    return(test_ret);
44970}
44971
44972
44973static int
44974test_xmlXPathNextAncestorOrSelf(void) {
44975    int test_ret = 0;
44976
44977#ifdef LIBXML_XPATH_ENABLED
44978    int mem_base;
44979    xmlNodePtr ret_val;
44980    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
44981    int n_ctxt;
44982    xmlNodePtr cur; /* the current node in the traversal */
44983    int n_cur;
44984
44985    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
44986    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
44987        mem_base = xmlMemBlocks();
44988        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
44989        cur = gen_xmlNodePtr(n_cur, 1);
44990
44991        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
44992        desret_xmlNodePtr(ret_val);
44993        call_tests++;
44994        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
44995        des_xmlNodePtr(n_cur, cur, 1);
44996        xmlResetLastError();
44997        if (mem_base != xmlMemBlocks()) {
44998            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
44999	           xmlMemBlocks() - mem_base);
45000	    test_ret++;
45001            printf(" %d", n_ctxt);
45002            printf(" %d", n_cur);
45003            printf("\n");
45004        }
45005    }
45006    }
45007    function_tests++;
45008#endif
45009
45010    return(test_ret);
45011}
45012
45013
45014static int
45015test_xmlXPathNextAttribute(void) {
45016    int test_ret = 0;
45017
45018#ifdef LIBXML_XPATH_ENABLED
45019    int mem_base;
45020    xmlNodePtr ret_val;
45021    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45022    int n_ctxt;
45023    xmlNodePtr cur; /* the current attribute in the traversal */
45024    int n_cur;
45025
45026    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45027    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45028        mem_base = xmlMemBlocks();
45029        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45030        cur = gen_xmlNodePtr(n_cur, 1);
45031
45032        ret_val = xmlXPathNextAttribute(ctxt, cur);
45033        desret_xmlNodePtr(ret_val);
45034        call_tests++;
45035        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45036        des_xmlNodePtr(n_cur, cur, 1);
45037        xmlResetLastError();
45038        if (mem_base != xmlMemBlocks()) {
45039            printf("Leak of %d blocks found in xmlXPathNextAttribute",
45040	           xmlMemBlocks() - mem_base);
45041	    test_ret++;
45042            printf(" %d", n_ctxt);
45043            printf(" %d", n_cur);
45044            printf("\n");
45045        }
45046    }
45047    }
45048    function_tests++;
45049#endif
45050
45051    return(test_ret);
45052}
45053
45054
45055static int
45056test_xmlXPathNextChild(void) {
45057    int test_ret = 0;
45058
45059#ifdef LIBXML_XPATH_ENABLED
45060    int mem_base;
45061    xmlNodePtr ret_val;
45062    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45063    int n_ctxt;
45064    xmlNodePtr cur; /* the current node in the traversal */
45065    int n_cur;
45066
45067    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45068    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45069        mem_base = xmlMemBlocks();
45070        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45071        cur = gen_xmlNodePtr(n_cur, 1);
45072
45073        ret_val = xmlXPathNextChild(ctxt, cur);
45074        desret_xmlNodePtr(ret_val);
45075        call_tests++;
45076        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45077        des_xmlNodePtr(n_cur, cur, 1);
45078        xmlResetLastError();
45079        if (mem_base != xmlMemBlocks()) {
45080            printf("Leak of %d blocks found in xmlXPathNextChild",
45081	           xmlMemBlocks() - mem_base);
45082	    test_ret++;
45083            printf(" %d", n_ctxt);
45084            printf(" %d", n_cur);
45085            printf("\n");
45086        }
45087    }
45088    }
45089    function_tests++;
45090#endif
45091
45092    return(test_ret);
45093}
45094
45095
45096static int
45097test_xmlXPathNextDescendant(void) {
45098    int test_ret = 0;
45099
45100#ifdef LIBXML_XPATH_ENABLED
45101    int mem_base;
45102    xmlNodePtr ret_val;
45103    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45104    int n_ctxt;
45105    xmlNodePtr cur; /* the current node in the traversal */
45106    int n_cur;
45107
45108    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45109    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45110        mem_base = xmlMemBlocks();
45111        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45112        cur = gen_xmlNodePtr(n_cur, 1);
45113
45114        ret_val = xmlXPathNextDescendant(ctxt, cur);
45115        desret_xmlNodePtr(ret_val);
45116        call_tests++;
45117        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45118        des_xmlNodePtr(n_cur, cur, 1);
45119        xmlResetLastError();
45120        if (mem_base != xmlMemBlocks()) {
45121            printf("Leak of %d blocks found in xmlXPathNextDescendant",
45122	           xmlMemBlocks() - mem_base);
45123	    test_ret++;
45124            printf(" %d", n_ctxt);
45125            printf(" %d", n_cur);
45126            printf("\n");
45127        }
45128    }
45129    }
45130    function_tests++;
45131#endif
45132
45133    return(test_ret);
45134}
45135
45136
45137static int
45138test_xmlXPathNextDescendantOrSelf(void) {
45139    int test_ret = 0;
45140
45141#ifdef LIBXML_XPATH_ENABLED
45142    int mem_base;
45143    xmlNodePtr ret_val;
45144    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45145    int n_ctxt;
45146    xmlNodePtr cur; /* the current node in the traversal */
45147    int n_cur;
45148
45149    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45150    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45151        mem_base = xmlMemBlocks();
45152        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45153        cur = gen_xmlNodePtr(n_cur, 1);
45154
45155        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
45156        desret_xmlNodePtr(ret_val);
45157        call_tests++;
45158        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45159        des_xmlNodePtr(n_cur, cur, 1);
45160        xmlResetLastError();
45161        if (mem_base != xmlMemBlocks()) {
45162            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
45163	           xmlMemBlocks() - mem_base);
45164	    test_ret++;
45165            printf(" %d", n_ctxt);
45166            printf(" %d", n_cur);
45167            printf("\n");
45168        }
45169    }
45170    }
45171    function_tests++;
45172#endif
45173
45174    return(test_ret);
45175}
45176
45177
45178static int
45179test_xmlXPathNextFollowing(void) {
45180    int test_ret = 0;
45181
45182#ifdef LIBXML_XPATH_ENABLED
45183    int mem_base;
45184    xmlNodePtr ret_val;
45185    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45186    int n_ctxt;
45187    xmlNodePtr cur; /* the current node in the traversal */
45188    int n_cur;
45189
45190    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45191    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45192        mem_base = xmlMemBlocks();
45193        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45194        cur = gen_xmlNodePtr(n_cur, 1);
45195
45196        ret_val = xmlXPathNextFollowing(ctxt, cur);
45197        desret_xmlNodePtr(ret_val);
45198        call_tests++;
45199        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45200        des_xmlNodePtr(n_cur, cur, 1);
45201        xmlResetLastError();
45202        if (mem_base != xmlMemBlocks()) {
45203            printf("Leak of %d blocks found in xmlXPathNextFollowing",
45204	           xmlMemBlocks() - mem_base);
45205	    test_ret++;
45206            printf(" %d", n_ctxt);
45207            printf(" %d", n_cur);
45208            printf("\n");
45209        }
45210    }
45211    }
45212    function_tests++;
45213#endif
45214
45215    return(test_ret);
45216}
45217
45218
45219static int
45220test_xmlXPathNextFollowingSibling(void) {
45221    int test_ret = 0;
45222
45223#ifdef LIBXML_XPATH_ENABLED
45224    int mem_base;
45225    xmlNodePtr ret_val;
45226    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45227    int n_ctxt;
45228    xmlNodePtr cur; /* the current node in the traversal */
45229    int n_cur;
45230
45231    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45232    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45233        mem_base = xmlMemBlocks();
45234        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45235        cur = gen_xmlNodePtr(n_cur, 1);
45236
45237        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
45238        desret_xmlNodePtr(ret_val);
45239        call_tests++;
45240        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45241        des_xmlNodePtr(n_cur, cur, 1);
45242        xmlResetLastError();
45243        if (mem_base != xmlMemBlocks()) {
45244            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
45245	           xmlMemBlocks() - mem_base);
45246	    test_ret++;
45247            printf(" %d", n_ctxt);
45248            printf(" %d", n_cur);
45249            printf("\n");
45250        }
45251    }
45252    }
45253    function_tests++;
45254#endif
45255
45256    return(test_ret);
45257}
45258
45259
45260static int
45261test_xmlXPathNextNamespace(void) {
45262    int test_ret = 0;
45263
45264#ifdef LIBXML_XPATH_ENABLED
45265    int mem_base;
45266    xmlNodePtr ret_val;
45267    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45268    int n_ctxt;
45269    xmlNodePtr cur; /* the current attribute in the traversal */
45270    int n_cur;
45271
45272    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45273    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45274        mem_base = xmlMemBlocks();
45275        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45276        cur = gen_xmlNodePtr(n_cur, 1);
45277
45278        ret_val = xmlXPathNextNamespace(ctxt, cur);
45279        desret_xmlNodePtr(ret_val);
45280        call_tests++;
45281        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45282        des_xmlNodePtr(n_cur, cur, 1);
45283        xmlResetLastError();
45284        if (mem_base != xmlMemBlocks()) {
45285            printf("Leak of %d blocks found in xmlXPathNextNamespace",
45286	           xmlMemBlocks() - mem_base);
45287	    test_ret++;
45288            printf(" %d", n_ctxt);
45289            printf(" %d", n_cur);
45290            printf("\n");
45291        }
45292    }
45293    }
45294    function_tests++;
45295#endif
45296
45297    return(test_ret);
45298}
45299
45300
45301static int
45302test_xmlXPathNextParent(void) {
45303    int test_ret = 0;
45304
45305#ifdef LIBXML_XPATH_ENABLED
45306    int mem_base;
45307    xmlNodePtr ret_val;
45308    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45309    int n_ctxt;
45310    xmlNodePtr cur; /* the current node in the traversal */
45311    int n_cur;
45312
45313    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45314    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45315        mem_base = xmlMemBlocks();
45316        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45317        cur = gen_xmlNodePtr(n_cur, 1);
45318
45319        ret_val = xmlXPathNextParent(ctxt, cur);
45320        desret_xmlNodePtr(ret_val);
45321        call_tests++;
45322        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45323        des_xmlNodePtr(n_cur, cur, 1);
45324        xmlResetLastError();
45325        if (mem_base != xmlMemBlocks()) {
45326            printf("Leak of %d blocks found in xmlXPathNextParent",
45327	           xmlMemBlocks() - mem_base);
45328	    test_ret++;
45329            printf(" %d", n_ctxt);
45330            printf(" %d", n_cur);
45331            printf("\n");
45332        }
45333    }
45334    }
45335    function_tests++;
45336#endif
45337
45338    return(test_ret);
45339}
45340
45341
45342static int
45343test_xmlXPathNextPreceding(void) {
45344    int test_ret = 0;
45345
45346#ifdef LIBXML_XPATH_ENABLED
45347    int mem_base;
45348    xmlNodePtr ret_val;
45349    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45350    int n_ctxt;
45351    xmlNodePtr cur; /* the current node in the traversal */
45352    int n_cur;
45353
45354    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45355    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45356        mem_base = xmlMemBlocks();
45357        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45358        cur = gen_xmlNodePtr(n_cur, 1);
45359
45360        ret_val = xmlXPathNextPreceding(ctxt, cur);
45361        desret_xmlNodePtr(ret_val);
45362        call_tests++;
45363        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45364        des_xmlNodePtr(n_cur, cur, 1);
45365        xmlResetLastError();
45366        if (mem_base != xmlMemBlocks()) {
45367            printf("Leak of %d blocks found in xmlXPathNextPreceding",
45368	           xmlMemBlocks() - mem_base);
45369	    test_ret++;
45370            printf(" %d", n_ctxt);
45371            printf(" %d", n_cur);
45372            printf("\n");
45373        }
45374    }
45375    }
45376    function_tests++;
45377#endif
45378
45379    return(test_ret);
45380}
45381
45382
45383static int
45384test_xmlXPathNextPrecedingSibling(void) {
45385    int test_ret = 0;
45386
45387#ifdef LIBXML_XPATH_ENABLED
45388    int mem_base;
45389    xmlNodePtr ret_val;
45390    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45391    int n_ctxt;
45392    xmlNodePtr cur; /* the current node in the traversal */
45393    int n_cur;
45394
45395    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45396    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45397        mem_base = xmlMemBlocks();
45398        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45399        cur = gen_xmlNodePtr(n_cur, 1);
45400
45401        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
45402        desret_xmlNodePtr(ret_val);
45403        call_tests++;
45404        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45405        des_xmlNodePtr(n_cur, cur, 1);
45406        xmlResetLastError();
45407        if (mem_base != xmlMemBlocks()) {
45408            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
45409	           xmlMemBlocks() - mem_base);
45410	    test_ret++;
45411            printf(" %d", n_ctxt);
45412            printf(" %d", n_cur);
45413            printf("\n");
45414        }
45415    }
45416    }
45417    function_tests++;
45418#endif
45419
45420    return(test_ret);
45421}
45422
45423
45424static int
45425test_xmlXPathNextSelf(void) {
45426    int test_ret = 0;
45427
45428#ifdef LIBXML_XPATH_ENABLED
45429    int mem_base;
45430    xmlNodePtr ret_val;
45431    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45432    int n_ctxt;
45433    xmlNodePtr cur; /* the current node in the traversal */
45434    int n_cur;
45435
45436    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45437    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
45438        mem_base = xmlMemBlocks();
45439        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45440        cur = gen_xmlNodePtr(n_cur, 1);
45441
45442        ret_val = xmlXPathNextSelf(ctxt, cur);
45443        desret_xmlNodePtr(ret_val);
45444        call_tests++;
45445        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45446        des_xmlNodePtr(n_cur, cur, 1);
45447        xmlResetLastError();
45448        if (mem_base != xmlMemBlocks()) {
45449            printf("Leak of %d blocks found in xmlXPathNextSelf",
45450	           xmlMemBlocks() - mem_base);
45451	    test_ret++;
45452            printf(" %d", n_ctxt);
45453            printf(" %d", n_cur);
45454            printf("\n");
45455        }
45456    }
45457    }
45458    function_tests++;
45459#endif
45460
45461    return(test_ret);
45462}
45463
45464
45465static int
45466test_xmlXPathNodeLeading(void) {
45467    int test_ret = 0;
45468
45469#ifdef LIBXML_XPATH_ENABLED
45470    int mem_base;
45471    xmlNodeSetPtr ret_val;
45472    xmlNodeSetPtr nodes; /* a node-set */
45473    int n_nodes;
45474    xmlNodePtr node; /* a node */
45475    int n_node;
45476
45477    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
45478    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45479        mem_base = xmlMemBlocks();
45480        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
45481        node = gen_xmlNodePtr(n_node, 1);
45482
45483        ret_val = xmlXPathNodeLeading(nodes, node);
45484        desret_xmlNodeSetPtr(ret_val);
45485        call_tests++;
45486        des_xmlNodeSetPtr(n_nodes, nodes, 0);
45487        des_xmlNodePtr(n_node, node, 1);
45488        xmlResetLastError();
45489        if (mem_base != xmlMemBlocks()) {
45490            printf("Leak of %d blocks found in xmlXPathNodeLeading",
45491	           xmlMemBlocks() - mem_base);
45492	    test_ret++;
45493            printf(" %d", n_nodes);
45494            printf(" %d", n_node);
45495            printf("\n");
45496        }
45497    }
45498    }
45499    function_tests++;
45500#endif
45501
45502    return(test_ret);
45503}
45504
45505
45506static int
45507test_xmlXPathNodeLeadingSorted(void) {
45508    int test_ret = 0;
45509
45510#ifdef LIBXML_XPATH_ENABLED
45511    int mem_base;
45512    xmlNodeSetPtr ret_val;
45513    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
45514    int n_nodes;
45515    xmlNodePtr node; /* a node */
45516    int n_node;
45517
45518    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
45519    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45520        mem_base = xmlMemBlocks();
45521        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
45522        node = gen_xmlNodePtr(n_node, 1);
45523
45524        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
45525        desret_xmlNodeSetPtr(ret_val);
45526        call_tests++;
45527        des_xmlNodeSetPtr(n_nodes, nodes, 0);
45528        des_xmlNodePtr(n_node, node, 1);
45529        xmlResetLastError();
45530        if (mem_base != xmlMemBlocks()) {
45531            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
45532	           xmlMemBlocks() - mem_base);
45533	    test_ret++;
45534            printf(" %d", n_nodes);
45535            printf(" %d", n_node);
45536            printf("\n");
45537        }
45538    }
45539    }
45540    function_tests++;
45541#endif
45542
45543    return(test_ret);
45544}
45545
45546
45547static int
45548test_xmlXPathNodeSetAdd(void) {
45549    int test_ret = 0;
45550
45551#ifdef LIBXML_XPATH_ENABLED
45552    int mem_base;
45553    xmlNodeSetPtr cur; /* the initial node set */
45554    int n_cur;
45555    xmlNodePtr val; /* a new xmlNodePtr */
45556    int n_val;
45557
45558    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45559    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45560        mem_base = xmlMemBlocks();
45561        cur = gen_xmlNodeSetPtr(n_cur, 0);
45562        val = gen_xmlNodePtr(n_val, 1);
45563
45564        xmlXPathNodeSetAdd(cur, val);
45565        call_tests++;
45566        des_xmlNodeSetPtr(n_cur, cur, 0);
45567        des_xmlNodePtr(n_val, val, 1);
45568        xmlResetLastError();
45569        if (mem_base != xmlMemBlocks()) {
45570            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
45571	           xmlMemBlocks() - mem_base);
45572	    test_ret++;
45573            printf(" %d", n_cur);
45574            printf(" %d", n_val);
45575            printf("\n");
45576        }
45577    }
45578    }
45579    function_tests++;
45580#endif
45581
45582    return(test_ret);
45583}
45584
45585
45586static int
45587test_xmlXPathNodeSetAddNs(void) {
45588    int test_ret = 0;
45589
45590#ifdef LIBXML_XPATH_ENABLED
45591    int mem_base;
45592    xmlNodeSetPtr cur; /* the initial node set */
45593    int n_cur;
45594    xmlNodePtr node; /* the hosting node */
45595    int n_node;
45596    xmlNsPtr ns; /* a the namespace node */
45597    int n_ns;
45598
45599    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45600    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45601    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
45602        mem_base = xmlMemBlocks();
45603        cur = gen_xmlNodeSetPtr(n_cur, 0);
45604        node = gen_xmlNodePtr(n_node, 1);
45605        ns = gen_xmlNsPtr(n_ns, 2);
45606
45607        xmlXPathNodeSetAddNs(cur, node, ns);
45608        call_tests++;
45609        des_xmlNodeSetPtr(n_cur, cur, 0);
45610        des_xmlNodePtr(n_node, node, 1);
45611        des_xmlNsPtr(n_ns, ns, 2);
45612        xmlResetLastError();
45613        if (mem_base != xmlMemBlocks()) {
45614            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
45615	           xmlMemBlocks() - mem_base);
45616	    test_ret++;
45617            printf(" %d", n_cur);
45618            printf(" %d", n_node);
45619            printf(" %d", n_ns);
45620            printf("\n");
45621        }
45622    }
45623    }
45624    }
45625    function_tests++;
45626#endif
45627
45628    return(test_ret);
45629}
45630
45631
45632static int
45633test_xmlXPathNodeSetAddUnique(void) {
45634    int test_ret = 0;
45635
45636#ifdef LIBXML_XPATH_ENABLED
45637    int mem_base;
45638    xmlNodeSetPtr cur; /* the initial node set */
45639    int n_cur;
45640    xmlNodePtr val; /* a new xmlNodePtr */
45641    int n_val;
45642
45643    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45644    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45645        mem_base = xmlMemBlocks();
45646        cur = gen_xmlNodeSetPtr(n_cur, 0);
45647        val = gen_xmlNodePtr(n_val, 1);
45648
45649        xmlXPathNodeSetAddUnique(cur, val);
45650        call_tests++;
45651        des_xmlNodeSetPtr(n_cur, cur, 0);
45652        des_xmlNodePtr(n_val, val, 1);
45653        xmlResetLastError();
45654        if (mem_base != xmlMemBlocks()) {
45655            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
45656	           xmlMemBlocks() - mem_base);
45657	    test_ret++;
45658            printf(" %d", n_cur);
45659            printf(" %d", n_val);
45660            printf("\n");
45661        }
45662    }
45663    }
45664    function_tests++;
45665#endif
45666
45667    return(test_ret);
45668}
45669
45670
45671static int
45672test_xmlXPathNodeSetContains(void) {
45673    int test_ret = 0;
45674
45675#ifdef LIBXML_XPATH_ENABLED
45676    int mem_base;
45677    int ret_val;
45678    xmlNodeSetPtr cur; /* the node-set */
45679    int n_cur;
45680    xmlNodePtr val; /* the node */
45681    int n_val;
45682
45683    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45684    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45685        mem_base = xmlMemBlocks();
45686        cur = gen_xmlNodeSetPtr(n_cur, 0);
45687        val = gen_xmlNodePtr(n_val, 1);
45688
45689        ret_val = xmlXPathNodeSetContains(cur, val);
45690        desret_int(ret_val);
45691        call_tests++;
45692        des_xmlNodeSetPtr(n_cur, cur, 0);
45693        des_xmlNodePtr(n_val, val, 1);
45694        xmlResetLastError();
45695        if (mem_base != xmlMemBlocks()) {
45696            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
45697	           xmlMemBlocks() - mem_base);
45698	    test_ret++;
45699            printf(" %d", n_cur);
45700            printf(" %d", n_val);
45701            printf("\n");
45702        }
45703    }
45704    }
45705    function_tests++;
45706#endif
45707
45708    return(test_ret);
45709}
45710
45711
45712static int
45713test_xmlXPathNodeSetDel(void) {
45714    int test_ret = 0;
45715
45716#ifdef LIBXML_XPATH_ENABLED
45717    int mem_base;
45718    xmlNodeSetPtr cur; /* the initial node set */
45719    int n_cur;
45720    xmlNodePtr val; /* an xmlNodePtr */
45721    int n_val;
45722
45723    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45724    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
45725        mem_base = xmlMemBlocks();
45726        cur = gen_xmlNodeSetPtr(n_cur, 0);
45727        val = gen_xmlNodePtr(n_val, 1);
45728
45729        xmlXPathNodeSetDel(cur, val);
45730        call_tests++;
45731        des_xmlNodeSetPtr(n_cur, cur, 0);
45732        des_xmlNodePtr(n_val, val, 1);
45733        xmlResetLastError();
45734        if (mem_base != xmlMemBlocks()) {
45735            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
45736	           xmlMemBlocks() - mem_base);
45737	    test_ret++;
45738            printf(" %d", n_cur);
45739            printf(" %d", n_val);
45740            printf("\n");
45741        }
45742    }
45743    }
45744    function_tests++;
45745#endif
45746
45747    return(test_ret);
45748}
45749
45750
45751static int
45752test_xmlXPathNodeSetMerge(void) {
45753    int test_ret = 0;
45754
45755#ifdef LIBXML_XPATH_ENABLED
45756    int mem_base;
45757    xmlNodeSetPtr ret_val;
45758    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
45759    int n_val1;
45760    xmlNodeSetPtr val2; /* the second NodeSet */
45761    int n_val2;
45762
45763    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
45764    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
45765        mem_base = xmlMemBlocks();
45766        val1 = gen_xmlNodeSetPtr(n_val1, 0);
45767        val2 = gen_xmlNodeSetPtr(n_val2, 1);
45768
45769        ret_val = xmlXPathNodeSetMerge(val1, val2);
45770        desret_xmlNodeSetPtr(ret_val);
45771        call_tests++;
45772        des_xmlNodeSetPtr(n_val1, val1, 0);
45773        des_xmlNodeSetPtr(n_val2, val2, 1);
45774        xmlResetLastError();
45775        if (mem_base != xmlMemBlocks()) {
45776            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
45777	           xmlMemBlocks() - mem_base);
45778	    test_ret++;
45779            printf(" %d", n_val1);
45780            printf(" %d", n_val2);
45781            printf("\n");
45782        }
45783    }
45784    }
45785    function_tests++;
45786#endif
45787
45788    return(test_ret);
45789}
45790
45791
45792static int
45793test_xmlXPathNodeSetRemove(void) {
45794    int test_ret = 0;
45795
45796#ifdef LIBXML_XPATH_ENABLED
45797    int mem_base;
45798    xmlNodeSetPtr cur; /* the initial node set */
45799    int n_cur;
45800    int val; /* the index to remove */
45801    int n_val;
45802
45803    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
45804    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45805        mem_base = xmlMemBlocks();
45806        cur = gen_xmlNodeSetPtr(n_cur, 0);
45807        val = gen_int(n_val, 1);
45808
45809        xmlXPathNodeSetRemove(cur, val);
45810        call_tests++;
45811        des_xmlNodeSetPtr(n_cur, cur, 0);
45812        des_int(n_val, val, 1);
45813        xmlResetLastError();
45814        if (mem_base != xmlMemBlocks()) {
45815            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
45816	           xmlMemBlocks() - mem_base);
45817	    test_ret++;
45818            printf(" %d", n_cur);
45819            printf(" %d", n_val);
45820            printf("\n");
45821        }
45822    }
45823    }
45824    function_tests++;
45825#endif
45826
45827    return(test_ret);
45828}
45829
45830
45831static int
45832test_xmlXPathNodeSetSort(void) {
45833    int test_ret = 0;
45834
45835#ifdef LIBXML_XPATH_ENABLED
45836    int mem_base;
45837    xmlNodeSetPtr set; /* the node set */
45838    int n_set;
45839
45840    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
45841        mem_base = xmlMemBlocks();
45842        set = gen_xmlNodeSetPtr(n_set, 0);
45843
45844        xmlXPathNodeSetSort(set);
45845        call_tests++;
45846        des_xmlNodeSetPtr(n_set, set, 0);
45847        xmlResetLastError();
45848        if (mem_base != xmlMemBlocks()) {
45849            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
45850	           xmlMemBlocks() - mem_base);
45851	    test_ret++;
45852            printf(" %d", n_set);
45853            printf("\n");
45854        }
45855    }
45856    function_tests++;
45857#endif
45858
45859    return(test_ret);
45860}
45861
45862
45863static int
45864test_xmlXPathNodeTrailing(void) {
45865    int test_ret = 0;
45866
45867#ifdef LIBXML_XPATH_ENABLED
45868    int mem_base;
45869    xmlNodeSetPtr ret_val;
45870    xmlNodeSetPtr nodes; /* a node-set */
45871    int n_nodes;
45872    xmlNodePtr node; /* a node */
45873    int n_node;
45874
45875    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
45876    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45877        mem_base = xmlMemBlocks();
45878        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
45879        node = gen_xmlNodePtr(n_node, 1);
45880
45881        ret_val = xmlXPathNodeTrailing(nodes, node);
45882        desret_xmlNodeSetPtr(ret_val);
45883        call_tests++;
45884        des_xmlNodeSetPtr(n_nodes, nodes, 0);
45885        des_xmlNodePtr(n_node, node, 1);
45886        xmlResetLastError();
45887        if (mem_base != xmlMemBlocks()) {
45888            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
45889	           xmlMemBlocks() - mem_base);
45890	    test_ret++;
45891            printf(" %d", n_nodes);
45892            printf(" %d", n_node);
45893            printf("\n");
45894        }
45895    }
45896    }
45897    function_tests++;
45898#endif
45899
45900    return(test_ret);
45901}
45902
45903
45904static int
45905test_xmlXPathNodeTrailingSorted(void) {
45906    int test_ret = 0;
45907
45908#ifdef LIBXML_XPATH_ENABLED
45909    int mem_base;
45910    xmlNodeSetPtr ret_val;
45911    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
45912    int n_nodes;
45913    xmlNodePtr node; /* a node */
45914    int n_node;
45915
45916    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
45917    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45918        mem_base = xmlMemBlocks();
45919        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
45920        node = gen_xmlNodePtr(n_node, 1);
45921
45922        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
45923        desret_xmlNodeSetPtr(ret_val);
45924        call_tests++;
45925        des_xmlNodeSetPtr(n_nodes, nodes, 0);
45926        des_xmlNodePtr(n_node, node, 1);
45927        xmlResetLastError();
45928        if (mem_base != xmlMemBlocks()) {
45929            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
45930	           xmlMemBlocks() - mem_base);
45931	    test_ret++;
45932            printf(" %d", n_nodes);
45933            printf(" %d", n_node);
45934            printf("\n");
45935        }
45936    }
45937    }
45938    function_tests++;
45939#endif
45940
45941    return(test_ret);
45942}
45943
45944
45945static int
45946test_xmlXPathNormalizeFunction(void) {
45947    int test_ret = 0;
45948
45949#ifdef LIBXML_XPATH_ENABLED
45950    int mem_base;
45951    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45952    int n_ctxt;
45953    int nargs; /* the number of arguments */
45954    int n_nargs;
45955
45956    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45957    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
45958        mem_base = xmlMemBlocks();
45959        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45960        nargs = gen_int(n_nargs, 1);
45961
45962        xmlXPathNormalizeFunction(ctxt, nargs);
45963        call_tests++;
45964        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
45965        des_int(n_nargs, nargs, 1);
45966        xmlResetLastError();
45967        if (mem_base != xmlMemBlocks()) {
45968            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
45969	           xmlMemBlocks() - mem_base);
45970	    test_ret++;
45971            printf(" %d", n_ctxt);
45972            printf(" %d", n_nargs);
45973            printf("\n");
45974        }
45975    }
45976    }
45977    function_tests++;
45978#endif
45979
45980    return(test_ret);
45981}
45982
45983
45984static int
45985test_xmlXPathNotEqualValues(void) {
45986    int test_ret = 0;
45987
45988#ifdef LIBXML_XPATH_ENABLED
45989    int mem_base;
45990    int ret_val;
45991    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
45992    int n_ctxt;
45993
45994    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
45995        mem_base = xmlMemBlocks();
45996        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
45997
45998        ret_val = xmlXPathNotEqualValues(ctxt);
45999        desret_int(ret_val);
46000        call_tests++;
46001        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46002        xmlResetLastError();
46003        if (mem_base != xmlMemBlocks()) {
46004            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
46005	           xmlMemBlocks() - mem_base);
46006	    test_ret++;
46007            printf(" %d", n_ctxt);
46008            printf("\n");
46009        }
46010    }
46011    function_tests++;
46012#endif
46013
46014    return(test_ret);
46015}
46016
46017
46018static int
46019test_xmlXPathNotFunction(void) {
46020    int test_ret = 0;
46021
46022#ifdef LIBXML_XPATH_ENABLED
46023    int mem_base;
46024    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46025    int n_ctxt;
46026    int nargs; /* the number of arguments */
46027    int n_nargs;
46028
46029    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46030    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46031        mem_base = xmlMemBlocks();
46032        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46033        nargs = gen_int(n_nargs, 1);
46034
46035        xmlXPathNotFunction(ctxt, nargs);
46036        call_tests++;
46037        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46038        des_int(n_nargs, nargs, 1);
46039        xmlResetLastError();
46040        if (mem_base != xmlMemBlocks()) {
46041            printf("Leak of %d blocks found in xmlXPathNotFunction",
46042	           xmlMemBlocks() - mem_base);
46043	    test_ret++;
46044            printf(" %d", n_ctxt);
46045            printf(" %d", n_nargs);
46046            printf("\n");
46047        }
46048    }
46049    }
46050    function_tests++;
46051#endif
46052
46053    return(test_ret);
46054}
46055
46056
46057static int
46058test_xmlXPathNsLookup(void) {
46059    int test_ret = 0;
46060
46061#ifdef LIBXML_XPATH_ENABLED
46062    int mem_base;
46063    const xmlChar * ret_val;
46064    xmlXPathContextPtr ctxt; /* the XPath context */
46065    int n_ctxt;
46066    xmlChar * prefix; /* the namespace prefix value */
46067    int n_prefix;
46068
46069    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46070    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
46071        mem_base = xmlMemBlocks();
46072        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46073        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
46074
46075        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
46076        desret_const_xmlChar_ptr(ret_val);
46077        call_tests++;
46078        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46079        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
46080        xmlResetLastError();
46081        if (mem_base != xmlMemBlocks()) {
46082            printf("Leak of %d blocks found in xmlXPathNsLookup",
46083	           xmlMemBlocks() - mem_base);
46084	    test_ret++;
46085            printf(" %d", n_ctxt);
46086            printf(" %d", n_prefix);
46087            printf("\n");
46088        }
46089    }
46090    }
46091    function_tests++;
46092#endif
46093
46094    return(test_ret);
46095}
46096
46097
46098static int
46099test_xmlXPathNumberFunction(void) {
46100    int test_ret = 0;
46101
46102#ifdef LIBXML_XPATH_ENABLED
46103    int mem_base;
46104    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46105    int n_ctxt;
46106    int nargs; /* the number of arguments */
46107    int n_nargs;
46108
46109    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46110    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46111        mem_base = xmlMemBlocks();
46112        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46113        nargs = gen_int(n_nargs, 1);
46114
46115        xmlXPathNumberFunction(ctxt, nargs);
46116        call_tests++;
46117        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46118        des_int(n_nargs, nargs, 1);
46119        xmlResetLastError();
46120        if (mem_base != xmlMemBlocks()) {
46121            printf("Leak of %d blocks found in xmlXPathNumberFunction",
46122	           xmlMemBlocks() - mem_base);
46123	    test_ret++;
46124            printf(" %d", n_ctxt);
46125            printf(" %d", n_nargs);
46126            printf("\n");
46127        }
46128    }
46129    }
46130    function_tests++;
46131#endif
46132
46133    return(test_ret);
46134}
46135
46136
46137static int
46138test_xmlXPathParseNCName(void) {
46139    int test_ret = 0;
46140
46141#ifdef LIBXML_XPATH_ENABLED
46142    int mem_base;
46143    xmlChar * ret_val;
46144    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46145    int n_ctxt;
46146
46147    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46148        mem_base = xmlMemBlocks();
46149        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46150
46151        ret_val = xmlXPathParseNCName(ctxt);
46152        desret_xmlChar_ptr(ret_val);
46153        call_tests++;
46154        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46155        xmlResetLastError();
46156        if (mem_base != xmlMemBlocks()) {
46157            printf("Leak of %d blocks found in xmlXPathParseNCName",
46158	           xmlMemBlocks() - mem_base);
46159	    test_ret++;
46160            printf(" %d", n_ctxt);
46161            printf("\n");
46162        }
46163    }
46164    function_tests++;
46165#endif
46166
46167    return(test_ret);
46168}
46169
46170
46171static int
46172test_xmlXPathParseName(void) {
46173    int test_ret = 0;
46174
46175#ifdef LIBXML_XPATH_ENABLED
46176    int mem_base;
46177    xmlChar * ret_val;
46178    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46179    int n_ctxt;
46180
46181    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46182        mem_base = xmlMemBlocks();
46183        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46184
46185        ret_val = xmlXPathParseName(ctxt);
46186        desret_xmlChar_ptr(ret_val);
46187        call_tests++;
46188        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46189        xmlResetLastError();
46190        if (mem_base != xmlMemBlocks()) {
46191            printf("Leak of %d blocks found in xmlXPathParseName",
46192	           xmlMemBlocks() - mem_base);
46193	    test_ret++;
46194            printf(" %d", n_ctxt);
46195            printf("\n");
46196        }
46197    }
46198    function_tests++;
46199#endif
46200
46201    return(test_ret);
46202}
46203
46204
46205static int
46206test_xmlXPathPopBoolean(void) {
46207    int test_ret = 0;
46208
46209#ifdef LIBXML_XPATH_ENABLED
46210    int mem_base;
46211    int ret_val;
46212    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
46213    int n_ctxt;
46214
46215    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46216        mem_base = xmlMemBlocks();
46217        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46218
46219        ret_val = xmlXPathPopBoolean(ctxt);
46220        desret_int(ret_val);
46221        call_tests++;
46222        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46223        xmlResetLastError();
46224        if (mem_base != xmlMemBlocks()) {
46225            printf("Leak of %d blocks found in xmlXPathPopBoolean",
46226	           xmlMemBlocks() - mem_base);
46227	    test_ret++;
46228            printf(" %d", n_ctxt);
46229            printf("\n");
46230        }
46231    }
46232    function_tests++;
46233#endif
46234
46235    return(test_ret);
46236}
46237
46238
46239static int
46240test_xmlXPathPopExternal(void) {
46241    int test_ret = 0;
46242
46243#ifdef LIBXML_XPATH_ENABLED
46244    int mem_base;
46245    void * ret_val;
46246    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
46247    int n_ctxt;
46248
46249    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46250        mem_base = xmlMemBlocks();
46251        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46252
46253        ret_val = xmlXPathPopExternal(ctxt);
46254        desret_void_ptr(ret_val);
46255        call_tests++;
46256        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46257        xmlResetLastError();
46258        if (mem_base != xmlMemBlocks()) {
46259            printf("Leak of %d blocks found in xmlXPathPopExternal",
46260	           xmlMemBlocks() - mem_base);
46261	    test_ret++;
46262            printf(" %d", n_ctxt);
46263            printf("\n");
46264        }
46265    }
46266    function_tests++;
46267#endif
46268
46269    return(test_ret);
46270}
46271
46272
46273static int
46274test_xmlXPathPopNodeSet(void) {
46275    int test_ret = 0;
46276
46277#ifdef LIBXML_XPATH_ENABLED
46278    int mem_base;
46279    xmlNodeSetPtr ret_val;
46280    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
46281    int n_ctxt;
46282
46283    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46284        mem_base = xmlMemBlocks();
46285        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46286
46287        ret_val = xmlXPathPopNodeSet(ctxt);
46288        desret_xmlNodeSetPtr(ret_val);
46289        call_tests++;
46290        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46291        xmlResetLastError();
46292        if (mem_base != xmlMemBlocks()) {
46293            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
46294	           xmlMemBlocks() - mem_base);
46295	    test_ret++;
46296            printf(" %d", n_ctxt);
46297            printf("\n");
46298        }
46299    }
46300    function_tests++;
46301#endif
46302
46303    return(test_ret);
46304}
46305
46306
46307static int
46308test_xmlXPathPopNumber(void) {
46309    int test_ret = 0;
46310
46311#ifdef LIBXML_XPATH_ENABLED
46312    int mem_base;
46313    double ret_val;
46314    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
46315    int n_ctxt;
46316
46317    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46318        mem_base = xmlMemBlocks();
46319        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46320
46321        ret_val = xmlXPathPopNumber(ctxt);
46322        desret_double(ret_val);
46323        call_tests++;
46324        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46325        xmlResetLastError();
46326        if (mem_base != xmlMemBlocks()) {
46327            printf("Leak of %d blocks found in xmlXPathPopNumber",
46328	           xmlMemBlocks() - mem_base);
46329	    test_ret++;
46330            printf(" %d", n_ctxt);
46331            printf("\n");
46332        }
46333    }
46334    function_tests++;
46335#endif
46336
46337    return(test_ret);
46338}
46339
46340
46341static int
46342test_xmlXPathPopString(void) {
46343    int test_ret = 0;
46344
46345#ifdef LIBXML_XPATH_ENABLED
46346    int mem_base;
46347    xmlChar * ret_val;
46348    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
46349    int n_ctxt;
46350
46351    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46352        mem_base = xmlMemBlocks();
46353        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46354
46355        ret_val = xmlXPathPopString(ctxt);
46356        desret_xmlChar_ptr(ret_val);
46357        call_tests++;
46358        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46359        xmlResetLastError();
46360        if (mem_base != xmlMemBlocks()) {
46361            printf("Leak of %d blocks found in xmlXPathPopString",
46362	           xmlMemBlocks() - mem_base);
46363	    test_ret++;
46364            printf(" %d", n_ctxt);
46365            printf("\n");
46366        }
46367    }
46368    function_tests++;
46369#endif
46370
46371    return(test_ret);
46372}
46373
46374
46375static int
46376test_xmlXPathPositionFunction(void) {
46377    int test_ret = 0;
46378
46379#ifdef LIBXML_XPATH_ENABLED
46380    int mem_base;
46381    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46382    int n_ctxt;
46383    int nargs; /* the number of arguments */
46384    int n_nargs;
46385
46386    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46387    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46388        mem_base = xmlMemBlocks();
46389        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46390        nargs = gen_int(n_nargs, 1);
46391
46392        xmlXPathPositionFunction(ctxt, nargs);
46393        call_tests++;
46394        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46395        des_int(n_nargs, nargs, 1);
46396        xmlResetLastError();
46397        if (mem_base != xmlMemBlocks()) {
46398            printf("Leak of %d blocks found in xmlXPathPositionFunction",
46399	           xmlMemBlocks() - mem_base);
46400	    test_ret++;
46401            printf(" %d", n_ctxt);
46402            printf(" %d", n_nargs);
46403            printf("\n");
46404        }
46405    }
46406    }
46407    function_tests++;
46408#endif
46409
46410    return(test_ret);
46411}
46412
46413
46414static int
46415test_xmlXPathRegisterAllFunctions(void) {
46416    int test_ret = 0;
46417
46418#ifdef LIBXML_XPATH_ENABLED
46419    int mem_base;
46420    xmlXPathContextPtr ctxt; /* the XPath context */
46421    int n_ctxt;
46422
46423    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46424        mem_base = xmlMemBlocks();
46425        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46426
46427        xmlXPathRegisterAllFunctions(ctxt);
46428        call_tests++;
46429        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46430        xmlResetLastError();
46431        if (mem_base != xmlMemBlocks()) {
46432            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
46433	           xmlMemBlocks() - mem_base);
46434	    test_ret++;
46435            printf(" %d", n_ctxt);
46436            printf("\n");
46437        }
46438    }
46439    function_tests++;
46440#endif
46441
46442    return(test_ret);
46443}
46444
46445
46446static int
46447test_xmlXPathRegisterFunc(void) {
46448    int test_ret = 0;
46449
46450
46451    /* missing type support */
46452    return(test_ret);
46453}
46454
46455
46456static int
46457test_xmlXPathRegisterFuncLookup(void) {
46458    int test_ret = 0;
46459
46460
46461    /* missing type support */
46462    return(test_ret);
46463}
46464
46465
46466static int
46467test_xmlXPathRegisterFuncNS(void) {
46468    int test_ret = 0;
46469
46470
46471    /* missing type support */
46472    return(test_ret);
46473}
46474
46475
46476static int
46477test_xmlXPathRegisterNs(void) {
46478    int test_ret = 0;
46479
46480#ifdef LIBXML_XPATH_ENABLED
46481    int mem_base;
46482    int ret_val;
46483    xmlXPathContextPtr ctxt; /* the XPath context */
46484    int n_ctxt;
46485    xmlChar * prefix; /* the namespace prefix */
46486    int n_prefix;
46487    xmlChar * ns_uri; /* the namespace name */
46488    int n_ns_uri;
46489
46490    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46491    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
46492    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
46493        mem_base = xmlMemBlocks();
46494        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46495        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
46496        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
46497
46498        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
46499        desret_int(ret_val);
46500        call_tests++;
46501        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46502        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
46503        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
46504        xmlResetLastError();
46505        if (mem_base != xmlMemBlocks()) {
46506            printf("Leak of %d blocks found in xmlXPathRegisterNs",
46507	           xmlMemBlocks() - mem_base);
46508	    test_ret++;
46509            printf(" %d", n_ctxt);
46510            printf(" %d", n_prefix);
46511            printf(" %d", n_ns_uri);
46512            printf("\n");
46513        }
46514    }
46515    }
46516    }
46517    function_tests++;
46518#endif
46519
46520    return(test_ret);
46521}
46522
46523
46524static int
46525test_xmlXPathRegisterVariable(void) {
46526    int test_ret = 0;
46527
46528#ifdef LIBXML_XPATH_ENABLED
46529    int mem_base;
46530    int ret_val;
46531    xmlXPathContextPtr ctxt; /* the XPath context */
46532    int n_ctxt;
46533    xmlChar * name; /* the variable name */
46534    int n_name;
46535    xmlXPathObjectPtr value; /* the variable value or NULL */
46536    int n_value;
46537
46538    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46539    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46540    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46541        mem_base = xmlMemBlocks();
46542        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46543        name = gen_const_xmlChar_ptr(n_name, 1);
46544        value = gen_xmlXPathObjectPtr(n_value, 2);
46545
46546        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
46547        desret_int(ret_val);
46548        call_tests++;
46549        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46550        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46551        des_xmlXPathObjectPtr(n_value, value, 2);
46552        xmlResetLastError();
46553        if (mem_base != xmlMemBlocks()) {
46554            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
46555	           xmlMemBlocks() - mem_base);
46556	    test_ret++;
46557            printf(" %d", n_ctxt);
46558            printf(" %d", n_name);
46559            printf(" %d", n_value);
46560            printf("\n");
46561        }
46562    }
46563    }
46564    }
46565    function_tests++;
46566#endif
46567
46568    return(test_ret);
46569}
46570
46571
46572static int
46573test_xmlXPathRegisterVariableLookup(void) {
46574    int test_ret = 0;
46575
46576
46577    /* missing type support */
46578    return(test_ret);
46579}
46580
46581
46582static int
46583test_xmlXPathRegisterVariableNS(void) {
46584    int test_ret = 0;
46585
46586#ifdef LIBXML_XPATH_ENABLED
46587    int mem_base;
46588    int ret_val;
46589    xmlXPathContextPtr ctxt; /* the XPath context */
46590    int n_ctxt;
46591    xmlChar * name; /* the variable name */
46592    int n_name;
46593    xmlChar * ns_uri; /* the variable namespace URI */
46594    int n_ns_uri;
46595    xmlXPathObjectPtr value; /* the variable value or NULL */
46596    int n_value;
46597
46598    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46599    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
46600    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
46601    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46602        mem_base = xmlMemBlocks();
46603        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46604        name = gen_const_xmlChar_ptr(n_name, 1);
46605        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
46606        value = gen_xmlXPathObjectPtr(n_value, 3);
46607
46608        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
46609        desret_int(ret_val);
46610        call_tests++;
46611        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46612        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
46613        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
46614        des_xmlXPathObjectPtr(n_value, value, 3);
46615        xmlResetLastError();
46616        if (mem_base != xmlMemBlocks()) {
46617            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
46618	           xmlMemBlocks() - mem_base);
46619	    test_ret++;
46620            printf(" %d", n_ctxt);
46621            printf(" %d", n_name);
46622            printf(" %d", n_ns_uri);
46623            printf(" %d", n_value);
46624            printf("\n");
46625        }
46626    }
46627    }
46628    }
46629    }
46630    function_tests++;
46631#endif
46632
46633    return(test_ret);
46634}
46635
46636
46637static int
46638test_xmlXPathRegisteredFuncsCleanup(void) {
46639    int test_ret = 0;
46640
46641#ifdef LIBXML_XPATH_ENABLED
46642    int mem_base;
46643    xmlXPathContextPtr ctxt; /* the XPath context */
46644    int n_ctxt;
46645
46646    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46647        mem_base = xmlMemBlocks();
46648        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46649
46650        xmlXPathRegisteredFuncsCleanup(ctxt);
46651        call_tests++;
46652        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46653        xmlResetLastError();
46654        if (mem_base != xmlMemBlocks()) {
46655            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
46656	           xmlMemBlocks() - mem_base);
46657	    test_ret++;
46658            printf(" %d", n_ctxt);
46659            printf("\n");
46660        }
46661    }
46662    function_tests++;
46663#endif
46664
46665    return(test_ret);
46666}
46667
46668
46669static int
46670test_xmlXPathRegisteredNsCleanup(void) {
46671    int test_ret = 0;
46672
46673#ifdef LIBXML_XPATH_ENABLED
46674    int mem_base;
46675    xmlXPathContextPtr ctxt; /* the XPath context */
46676    int n_ctxt;
46677
46678    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46679        mem_base = xmlMemBlocks();
46680        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46681
46682        xmlXPathRegisteredNsCleanup(ctxt);
46683        call_tests++;
46684        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46685        xmlResetLastError();
46686        if (mem_base != xmlMemBlocks()) {
46687            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
46688	           xmlMemBlocks() - mem_base);
46689	    test_ret++;
46690            printf(" %d", n_ctxt);
46691            printf("\n");
46692        }
46693    }
46694    function_tests++;
46695#endif
46696
46697    return(test_ret);
46698}
46699
46700
46701static int
46702test_xmlXPathRegisteredVariablesCleanup(void) {
46703    int test_ret = 0;
46704
46705#ifdef LIBXML_XPATH_ENABLED
46706    int mem_base;
46707    xmlXPathContextPtr ctxt; /* the XPath context */
46708    int n_ctxt;
46709
46710    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46711        mem_base = xmlMemBlocks();
46712        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46713
46714        xmlXPathRegisteredVariablesCleanup(ctxt);
46715        call_tests++;
46716        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46717        xmlResetLastError();
46718        if (mem_base != xmlMemBlocks()) {
46719            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
46720	           xmlMemBlocks() - mem_base);
46721	    test_ret++;
46722            printf(" %d", n_ctxt);
46723            printf("\n");
46724        }
46725    }
46726    function_tests++;
46727#endif
46728
46729    return(test_ret);
46730}
46731
46732
46733static int
46734test_xmlXPathRoot(void) {
46735    int test_ret = 0;
46736
46737#ifdef LIBXML_XPATH_ENABLED
46738    int mem_base;
46739    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46740    int n_ctxt;
46741
46742    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46743        mem_base = xmlMemBlocks();
46744        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46745
46746        xmlXPathRoot(ctxt);
46747        call_tests++;
46748        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46749        xmlResetLastError();
46750        if (mem_base != xmlMemBlocks()) {
46751            printf("Leak of %d blocks found in xmlXPathRoot",
46752	           xmlMemBlocks() - mem_base);
46753	    test_ret++;
46754            printf(" %d", n_ctxt);
46755            printf("\n");
46756        }
46757    }
46758    function_tests++;
46759#endif
46760
46761    return(test_ret);
46762}
46763
46764
46765static int
46766test_xmlXPathRoundFunction(void) {
46767    int test_ret = 0;
46768
46769#ifdef LIBXML_XPATH_ENABLED
46770    int mem_base;
46771    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46772    int n_ctxt;
46773    int nargs; /* the number of arguments */
46774    int n_nargs;
46775
46776    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46777    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46778        mem_base = xmlMemBlocks();
46779        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46780        nargs = gen_int(n_nargs, 1);
46781
46782        xmlXPathRoundFunction(ctxt, nargs);
46783        call_tests++;
46784        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46785        des_int(n_nargs, nargs, 1);
46786        xmlResetLastError();
46787        if (mem_base != xmlMemBlocks()) {
46788            printf("Leak of %d blocks found in xmlXPathRoundFunction",
46789	           xmlMemBlocks() - mem_base);
46790	    test_ret++;
46791            printf(" %d", n_ctxt);
46792            printf(" %d", n_nargs);
46793            printf("\n");
46794        }
46795    }
46796    }
46797    function_tests++;
46798#endif
46799
46800    return(test_ret);
46801}
46802
46803
46804static int
46805test_xmlXPathStartsWithFunction(void) {
46806    int test_ret = 0;
46807
46808#ifdef LIBXML_XPATH_ENABLED
46809    int mem_base;
46810    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46811    int n_ctxt;
46812    int nargs; /* the number of arguments */
46813    int n_nargs;
46814
46815    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46816    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46817        mem_base = xmlMemBlocks();
46818        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46819        nargs = gen_int(n_nargs, 1);
46820
46821        xmlXPathStartsWithFunction(ctxt, nargs);
46822        call_tests++;
46823        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46824        des_int(n_nargs, nargs, 1);
46825        xmlResetLastError();
46826        if (mem_base != xmlMemBlocks()) {
46827            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
46828	           xmlMemBlocks() - mem_base);
46829	    test_ret++;
46830            printf(" %d", n_ctxt);
46831            printf(" %d", n_nargs);
46832            printf("\n");
46833        }
46834    }
46835    }
46836    function_tests++;
46837#endif
46838
46839    return(test_ret);
46840}
46841
46842
46843static int
46844test_xmlXPathStringEvalNumber(void) {
46845    int test_ret = 0;
46846
46847#ifdef LIBXML_XPATH_ENABLED
46848    int mem_base;
46849    double ret_val;
46850    xmlChar * str; /* A string to scan */
46851    int n_str;
46852
46853    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46854        mem_base = xmlMemBlocks();
46855        str = gen_const_xmlChar_ptr(n_str, 0);
46856
46857        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
46858        desret_double(ret_val);
46859        call_tests++;
46860        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46861        xmlResetLastError();
46862        if (mem_base != xmlMemBlocks()) {
46863            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
46864	           xmlMemBlocks() - mem_base);
46865	    test_ret++;
46866            printf(" %d", n_str);
46867            printf("\n");
46868        }
46869    }
46870    function_tests++;
46871#endif
46872
46873    return(test_ret);
46874}
46875
46876
46877static int
46878test_xmlXPathStringFunction(void) {
46879    int test_ret = 0;
46880
46881#ifdef LIBXML_XPATH_ENABLED
46882    int mem_base;
46883    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46884    int n_ctxt;
46885    int nargs; /* the number of arguments */
46886    int n_nargs;
46887
46888    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46889    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46890        mem_base = xmlMemBlocks();
46891        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46892        nargs = gen_int(n_nargs, 1);
46893
46894        xmlXPathStringFunction(ctxt, nargs);
46895        call_tests++;
46896        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46897        des_int(n_nargs, nargs, 1);
46898        xmlResetLastError();
46899        if (mem_base != xmlMemBlocks()) {
46900            printf("Leak of %d blocks found in xmlXPathStringFunction",
46901	           xmlMemBlocks() - mem_base);
46902	    test_ret++;
46903            printf(" %d", n_ctxt);
46904            printf(" %d", n_nargs);
46905            printf("\n");
46906        }
46907    }
46908    }
46909    function_tests++;
46910#endif
46911
46912    return(test_ret);
46913}
46914
46915
46916static int
46917test_xmlXPathStringLengthFunction(void) {
46918    int test_ret = 0;
46919
46920#ifdef LIBXML_XPATH_ENABLED
46921    int mem_base;
46922    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46923    int n_ctxt;
46924    int nargs; /* the number of arguments */
46925    int n_nargs;
46926
46927    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46928    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46929        mem_base = xmlMemBlocks();
46930        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46931        nargs = gen_int(n_nargs, 1);
46932
46933        xmlXPathStringLengthFunction(ctxt, nargs);
46934        call_tests++;
46935        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46936        des_int(n_nargs, nargs, 1);
46937        xmlResetLastError();
46938        if (mem_base != xmlMemBlocks()) {
46939            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
46940	           xmlMemBlocks() - mem_base);
46941	    test_ret++;
46942            printf(" %d", n_ctxt);
46943            printf(" %d", n_nargs);
46944            printf("\n");
46945        }
46946    }
46947    }
46948    function_tests++;
46949#endif
46950
46951    return(test_ret);
46952}
46953
46954
46955static int
46956test_xmlXPathSubValues(void) {
46957    int test_ret = 0;
46958
46959#ifdef LIBXML_XPATH_ENABLED
46960    int mem_base;
46961    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46962    int n_ctxt;
46963
46964    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46965        mem_base = xmlMemBlocks();
46966        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46967
46968        xmlXPathSubValues(ctxt);
46969        call_tests++;
46970        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46971        xmlResetLastError();
46972        if (mem_base != xmlMemBlocks()) {
46973            printf("Leak of %d blocks found in xmlXPathSubValues",
46974	           xmlMemBlocks() - mem_base);
46975	    test_ret++;
46976            printf(" %d", n_ctxt);
46977            printf("\n");
46978        }
46979    }
46980    function_tests++;
46981#endif
46982
46983    return(test_ret);
46984}
46985
46986
46987static int
46988test_xmlXPathSubstringAfterFunction(void) {
46989    int test_ret = 0;
46990
46991#ifdef LIBXML_XPATH_ENABLED
46992    int mem_base;
46993    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46994    int n_ctxt;
46995    int nargs; /* the number of arguments */
46996    int n_nargs;
46997
46998    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46999    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47000        mem_base = xmlMemBlocks();
47001        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47002        nargs = gen_int(n_nargs, 1);
47003
47004        xmlXPathSubstringAfterFunction(ctxt, nargs);
47005        call_tests++;
47006        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47007        des_int(n_nargs, nargs, 1);
47008        xmlResetLastError();
47009        if (mem_base != xmlMemBlocks()) {
47010            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
47011	           xmlMemBlocks() - mem_base);
47012	    test_ret++;
47013            printf(" %d", n_ctxt);
47014            printf(" %d", n_nargs);
47015            printf("\n");
47016        }
47017    }
47018    }
47019    function_tests++;
47020#endif
47021
47022    return(test_ret);
47023}
47024
47025
47026static int
47027test_xmlXPathSubstringBeforeFunction(void) {
47028    int test_ret = 0;
47029
47030#ifdef LIBXML_XPATH_ENABLED
47031    int mem_base;
47032    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47033    int n_ctxt;
47034    int nargs; /* the number of arguments */
47035    int n_nargs;
47036
47037    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47038    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47039        mem_base = xmlMemBlocks();
47040        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47041        nargs = gen_int(n_nargs, 1);
47042
47043        xmlXPathSubstringBeforeFunction(ctxt, nargs);
47044        call_tests++;
47045        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47046        des_int(n_nargs, nargs, 1);
47047        xmlResetLastError();
47048        if (mem_base != xmlMemBlocks()) {
47049            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
47050	           xmlMemBlocks() - mem_base);
47051	    test_ret++;
47052            printf(" %d", n_ctxt);
47053            printf(" %d", n_nargs);
47054            printf("\n");
47055        }
47056    }
47057    }
47058    function_tests++;
47059#endif
47060
47061    return(test_ret);
47062}
47063
47064
47065static int
47066test_xmlXPathSubstringFunction(void) {
47067    int test_ret = 0;
47068
47069#ifdef LIBXML_XPATH_ENABLED
47070    int mem_base;
47071    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47072    int n_ctxt;
47073    int nargs; /* the number of arguments */
47074    int n_nargs;
47075
47076    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47077    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47078        mem_base = xmlMemBlocks();
47079        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47080        nargs = gen_int(n_nargs, 1);
47081
47082        xmlXPathSubstringFunction(ctxt, nargs);
47083        call_tests++;
47084        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47085        des_int(n_nargs, nargs, 1);
47086        xmlResetLastError();
47087        if (mem_base != xmlMemBlocks()) {
47088            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
47089	           xmlMemBlocks() - mem_base);
47090	    test_ret++;
47091            printf(" %d", n_ctxt);
47092            printf(" %d", n_nargs);
47093            printf("\n");
47094        }
47095    }
47096    }
47097    function_tests++;
47098#endif
47099
47100    return(test_ret);
47101}
47102
47103
47104static int
47105test_xmlXPathSumFunction(void) {
47106    int test_ret = 0;
47107
47108#ifdef LIBXML_XPATH_ENABLED
47109    int mem_base;
47110    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47111    int n_ctxt;
47112    int nargs; /* the number of arguments */
47113    int n_nargs;
47114
47115    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47116    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47117        mem_base = xmlMemBlocks();
47118        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47119        nargs = gen_int(n_nargs, 1);
47120
47121        xmlXPathSumFunction(ctxt, nargs);
47122        call_tests++;
47123        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47124        des_int(n_nargs, nargs, 1);
47125        xmlResetLastError();
47126        if (mem_base != xmlMemBlocks()) {
47127            printf("Leak of %d blocks found in xmlXPathSumFunction",
47128	           xmlMemBlocks() - mem_base);
47129	    test_ret++;
47130            printf(" %d", n_ctxt);
47131            printf(" %d", n_nargs);
47132            printf("\n");
47133        }
47134    }
47135    }
47136    function_tests++;
47137#endif
47138
47139    return(test_ret);
47140}
47141
47142
47143static int
47144test_xmlXPathTrailing(void) {
47145    int test_ret = 0;
47146
47147#ifdef LIBXML_XPATH_ENABLED
47148    int mem_base;
47149    xmlNodeSetPtr ret_val;
47150    xmlNodeSetPtr nodes1; /* a node-set */
47151    int n_nodes1;
47152    xmlNodeSetPtr nodes2; /* a node-set */
47153    int n_nodes2;
47154
47155    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47156    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47157        mem_base = xmlMemBlocks();
47158        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47159        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47160
47161        ret_val = xmlXPathTrailing(nodes1, nodes2);
47162        desret_xmlNodeSetPtr(ret_val);
47163        call_tests++;
47164        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47165        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47166        xmlResetLastError();
47167        if (mem_base != xmlMemBlocks()) {
47168            printf("Leak of %d blocks found in xmlXPathTrailing",
47169	           xmlMemBlocks() - mem_base);
47170	    test_ret++;
47171            printf(" %d", n_nodes1);
47172            printf(" %d", n_nodes2);
47173            printf("\n");
47174        }
47175    }
47176    }
47177    function_tests++;
47178#endif
47179
47180    return(test_ret);
47181}
47182
47183
47184static int
47185test_xmlXPathTrailingSorted(void) {
47186    int test_ret = 0;
47187
47188#ifdef LIBXML_XPATH_ENABLED
47189    int mem_base;
47190    xmlNodeSetPtr ret_val;
47191    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47192    int n_nodes1;
47193    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47194    int n_nodes2;
47195
47196    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47197    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47198        mem_base = xmlMemBlocks();
47199        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47200        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47201
47202        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
47203        desret_xmlNodeSetPtr(ret_val);
47204        call_tests++;
47205        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47206        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47207        xmlResetLastError();
47208        if (mem_base != xmlMemBlocks()) {
47209            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
47210	           xmlMemBlocks() - mem_base);
47211	    test_ret++;
47212            printf(" %d", n_nodes1);
47213            printf(" %d", n_nodes2);
47214            printf("\n");
47215        }
47216    }
47217    }
47218    function_tests++;
47219#endif
47220
47221    return(test_ret);
47222}
47223
47224
47225static int
47226test_xmlXPathTranslateFunction(void) {
47227    int test_ret = 0;
47228
47229#ifdef LIBXML_XPATH_ENABLED
47230    int mem_base;
47231    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47232    int n_ctxt;
47233    int nargs; /* the number of arguments */
47234    int n_nargs;
47235
47236    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47237    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47238        mem_base = xmlMemBlocks();
47239        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47240        nargs = gen_int(n_nargs, 1);
47241
47242        xmlXPathTranslateFunction(ctxt, nargs);
47243        call_tests++;
47244        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47245        des_int(n_nargs, nargs, 1);
47246        xmlResetLastError();
47247        if (mem_base != xmlMemBlocks()) {
47248            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
47249	           xmlMemBlocks() - mem_base);
47250	    test_ret++;
47251            printf(" %d", n_ctxt);
47252            printf(" %d", n_nargs);
47253            printf("\n");
47254        }
47255    }
47256    }
47257    function_tests++;
47258#endif
47259
47260    return(test_ret);
47261}
47262
47263
47264static int
47265test_xmlXPathTrueFunction(void) {
47266    int test_ret = 0;
47267
47268#ifdef LIBXML_XPATH_ENABLED
47269    int mem_base;
47270    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47271    int n_ctxt;
47272    int nargs; /* the number of arguments */
47273    int n_nargs;
47274
47275    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47276    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47277        mem_base = xmlMemBlocks();
47278        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47279        nargs = gen_int(n_nargs, 1);
47280
47281        xmlXPathTrueFunction(ctxt, nargs);
47282        call_tests++;
47283        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47284        des_int(n_nargs, nargs, 1);
47285        xmlResetLastError();
47286        if (mem_base != xmlMemBlocks()) {
47287            printf("Leak of %d blocks found in xmlXPathTrueFunction",
47288	           xmlMemBlocks() - mem_base);
47289	    test_ret++;
47290            printf(" %d", n_ctxt);
47291            printf(" %d", n_nargs);
47292            printf("\n");
47293        }
47294    }
47295    }
47296    function_tests++;
47297#endif
47298
47299    return(test_ret);
47300}
47301
47302
47303static int
47304test_xmlXPathValueFlipSign(void) {
47305    int test_ret = 0;
47306
47307#ifdef LIBXML_XPATH_ENABLED
47308    int mem_base;
47309    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47310    int n_ctxt;
47311
47312    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47313        mem_base = xmlMemBlocks();
47314        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47315
47316        xmlXPathValueFlipSign(ctxt);
47317        call_tests++;
47318        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47319        xmlResetLastError();
47320        if (mem_base != xmlMemBlocks()) {
47321            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
47322	           xmlMemBlocks() - mem_base);
47323	    test_ret++;
47324            printf(" %d", n_ctxt);
47325            printf("\n");
47326        }
47327    }
47328    function_tests++;
47329#endif
47330
47331    return(test_ret);
47332}
47333
47334
47335static int
47336test_xmlXPathVariableLookup(void) {
47337    int test_ret = 0;
47338
47339#ifdef LIBXML_XPATH_ENABLED
47340    int mem_base;
47341    xmlXPathObjectPtr ret_val;
47342    xmlXPathContextPtr ctxt; /* the XPath context */
47343    int n_ctxt;
47344    xmlChar * name; /* the variable name */
47345    int n_name;
47346
47347    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47348    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47349        mem_base = xmlMemBlocks();
47350        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47351        name = gen_const_xmlChar_ptr(n_name, 1);
47352
47353        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
47354        desret_xmlXPathObjectPtr(ret_val);
47355        call_tests++;
47356        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47357        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
47358        xmlResetLastError();
47359        if (mem_base != xmlMemBlocks()) {
47360            printf("Leak of %d blocks found in xmlXPathVariableLookup",
47361	           xmlMemBlocks() - mem_base);
47362	    test_ret++;
47363            printf(" %d", n_ctxt);
47364            printf(" %d", n_name);
47365            printf("\n");
47366        }
47367    }
47368    }
47369    function_tests++;
47370#endif
47371
47372    return(test_ret);
47373}
47374
47375
47376static int
47377test_xmlXPathVariableLookupNS(void) {
47378    int test_ret = 0;
47379
47380#ifdef LIBXML_XPATH_ENABLED
47381    int mem_base;
47382    xmlXPathObjectPtr ret_val;
47383    xmlXPathContextPtr ctxt; /* the XPath context */
47384    int n_ctxt;
47385    xmlChar * name; /* the variable name */
47386    int n_name;
47387    xmlChar * ns_uri; /* the variable namespace URI */
47388    int n_ns_uri;
47389
47390    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
47391    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47392    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
47393        mem_base = xmlMemBlocks();
47394        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
47395        name = gen_const_xmlChar_ptr(n_name, 1);
47396        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
47397
47398        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
47399        desret_xmlXPathObjectPtr(ret_val);
47400        call_tests++;
47401        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
47402        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
47403        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
47404        xmlResetLastError();
47405        if (mem_base != xmlMemBlocks()) {
47406            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
47407	           xmlMemBlocks() - mem_base);
47408	    test_ret++;
47409            printf(" %d", n_ctxt);
47410            printf(" %d", n_name);
47411            printf(" %d", n_ns_uri);
47412            printf("\n");
47413        }
47414    }
47415    }
47416    }
47417    function_tests++;
47418#endif
47419
47420    return(test_ret);
47421}
47422
47423
47424static int
47425test_xmlXPathWrapCString(void) {
47426    int test_ret = 0;
47427
47428#ifdef LIBXML_XPATH_ENABLED
47429    int mem_base;
47430    xmlXPathObjectPtr ret_val;
47431    char * val; /* the char * value */
47432    int n_val;
47433
47434    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
47435        mem_base = xmlMemBlocks();
47436        val = gen_char_ptr(n_val, 0);
47437
47438        ret_val = xmlXPathWrapCString(val);
47439        desret_xmlXPathObjectPtr(ret_val);
47440        call_tests++;
47441        des_char_ptr(n_val, val, 0);
47442        xmlResetLastError();
47443        if (mem_base != xmlMemBlocks()) {
47444            printf("Leak of %d blocks found in xmlXPathWrapCString",
47445	           xmlMemBlocks() - mem_base);
47446	    test_ret++;
47447            printf(" %d", n_val);
47448            printf("\n");
47449        }
47450    }
47451    function_tests++;
47452#endif
47453
47454    return(test_ret);
47455}
47456
47457
47458static int
47459test_xmlXPathWrapExternal(void) {
47460    int test_ret = 0;
47461
47462#ifdef LIBXML_XPATH_ENABLED
47463    int mem_base;
47464    xmlXPathObjectPtr ret_val;
47465    void * val; /* the user data */
47466    int n_val;
47467
47468    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
47469        mem_base = xmlMemBlocks();
47470        val = gen_void_ptr(n_val, 0);
47471
47472        ret_val = xmlXPathWrapExternal(val);
47473        desret_xmlXPathObjectPtr(ret_val);
47474        call_tests++;
47475        des_void_ptr(n_val, val, 0);
47476        xmlResetLastError();
47477        if (mem_base != xmlMemBlocks()) {
47478            printf("Leak of %d blocks found in xmlXPathWrapExternal",
47479	           xmlMemBlocks() - mem_base);
47480	    test_ret++;
47481            printf(" %d", n_val);
47482            printf("\n");
47483        }
47484    }
47485    function_tests++;
47486#endif
47487
47488    return(test_ret);
47489}
47490
47491
47492static int
47493test_xmlXPathWrapNodeSet(void) {
47494    int test_ret = 0;
47495
47496#ifdef LIBXML_XPATH_ENABLED
47497    int mem_base;
47498    xmlXPathObjectPtr ret_val;
47499    xmlNodeSetPtr val; /* the NodePtr value */
47500    int n_val;
47501
47502    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47503        mem_base = xmlMemBlocks();
47504        val = gen_xmlNodeSetPtr(n_val, 0);
47505
47506        ret_val = xmlXPathWrapNodeSet(val);
47507        desret_xmlXPathObjectPtr(ret_val);
47508        call_tests++;
47509        des_xmlNodeSetPtr(n_val, val, 0);
47510        xmlResetLastError();
47511        if (mem_base != xmlMemBlocks()) {
47512            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
47513	           xmlMemBlocks() - mem_base);
47514	    test_ret++;
47515            printf(" %d", n_val);
47516            printf("\n");
47517        }
47518    }
47519    function_tests++;
47520#endif
47521
47522    return(test_ret);
47523}
47524
47525
47526static int
47527test_xmlXPatherror(void) {
47528    int test_ret = 0;
47529
47530#ifdef LIBXML_XPATH_ENABLED
47531    int mem_base;
47532    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47533    int n_ctxt;
47534    const char * file; /* the file name */
47535    int n_file;
47536    int line; /* the line number */
47537    int n_line;
47538    int no; /* the error number */
47539    int n_no;
47540
47541    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47542    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
47543    for (n_line = 0;n_line < gen_nb_int;n_line++) {
47544    for (n_no = 0;n_no < gen_nb_int;n_no++) {
47545        mem_base = xmlMemBlocks();
47546        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47547        file = gen_filepath(n_file, 1);
47548        line = gen_int(n_line, 2);
47549        no = gen_int(n_no, 3);
47550
47551        xmlXPatherror(ctxt, file, line, no);
47552        call_tests++;
47553        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47554        des_filepath(n_file, file, 1);
47555        des_int(n_line, line, 2);
47556        des_int(n_no, no, 3);
47557        xmlResetLastError();
47558        if (mem_base != xmlMemBlocks()) {
47559            printf("Leak of %d blocks found in xmlXPatherror",
47560	           xmlMemBlocks() - mem_base);
47561	    test_ret++;
47562            printf(" %d", n_ctxt);
47563            printf(" %d", n_file);
47564            printf(" %d", n_line);
47565            printf(" %d", n_no);
47566            printf("\n");
47567        }
47568    }
47569    }
47570    }
47571    }
47572    function_tests++;
47573#endif
47574
47575    return(test_ret);
47576}
47577
47578static int
47579test_xpathInternals(void) {
47580    int test_ret = 0;
47581
47582    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
47583    test_ret += test_valuePop();
47584    test_ret += test_valuePush();
47585    test_ret += test_xmlXPathAddValues();
47586    test_ret += test_xmlXPathBooleanFunction();
47587    test_ret += test_xmlXPathCeilingFunction();
47588    test_ret += test_xmlXPathCompareValues();
47589    test_ret += test_xmlXPathConcatFunction();
47590    test_ret += test_xmlXPathContainsFunction();
47591    test_ret += test_xmlXPathCountFunction();
47592    test_ret += test_xmlXPathDebugDumpCompExpr();
47593    test_ret += test_xmlXPathDebugDumpObject();
47594    test_ret += test_xmlXPathDifference();
47595    test_ret += test_xmlXPathDistinct();
47596    test_ret += test_xmlXPathDistinctSorted();
47597    test_ret += test_xmlXPathDivValues();
47598    test_ret += test_xmlXPathEqualValues();
47599    test_ret += test_xmlXPathErr();
47600    test_ret += test_xmlXPathEvalExpr();
47601    test_ret += test_xmlXPathEvaluatePredicateResult();
47602    test_ret += test_xmlXPathFalseFunction();
47603    test_ret += test_xmlXPathFloorFunction();
47604    test_ret += test_xmlXPathFunctionLookup();
47605    test_ret += test_xmlXPathFunctionLookupNS();
47606    test_ret += test_xmlXPathHasSameNodes();
47607    test_ret += test_xmlXPathIdFunction();
47608    test_ret += test_xmlXPathIntersection();
47609    test_ret += test_xmlXPathIsNodeType();
47610    test_ret += test_xmlXPathLangFunction();
47611    test_ret += test_xmlXPathLastFunction();
47612    test_ret += test_xmlXPathLeading();
47613    test_ret += test_xmlXPathLeadingSorted();
47614    test_ret += test_xmlXPathLocalNameFunction();
47615    test_ret += test_xmlXPathModValues();
47616    test_ret += test_xmlXPathMultValues();
47617    test_ret += test_xmlXPathNamespaceURIFunction();
47618    test_ret += test_xmlXPathNewBoolean();
47619    test_ret += test_xmlXPathNewCString();
47620    test_ret += test_xmlXPathNewFloat();
47621    test_ret += test_xmlXPathNewNodeSet();
47622    test_ret += test_xmlXPathNewNodeSetList();
47623    test_ret += test_xmlXPathNewParserContext();
47624    test_ret += test_xmlXPathNewString();
47625    test_ret += test_xmlXPathNextAncestor();
47626    test_ret += test_xmlXPathNextAncestorOrSelf();
47627    test_ret += test_xmlXPathNextAttribute();
47628    test_ret += test_xmlXPathNextChild();
47629    test_ret += test_xmlXPathNextDescendant();
47630    test_ret += test_xmlXPathNextDescendantOrSelf();
47631    test_ret += test_xmlXPathNextFollowing();
47632    test_ret += test_xmlXPathNextFollowingSibling();
47633    test_ret += test_xmlXPathNextNamespace();
47634    test_ret += test_xmlXPathNextParent();
47635    test_ret += test_xmlXPathNextPreceding();
47636    test_ret += test_xmlXPathNextPrecedingSibling();
47637    test_ret += test_xmlXPathNextSelf();
47638    test_ret += test_xmlXPathNodeLeading();
47639    test_ret += test_xmlXPathNodeLeadingSorted();
47640    test_ret += test_xmlXPathNodeSetAdd();
47641    test_ret += test_xmlXPathNodeSetAddNs();
47642    test_ret += test_xmlXPathNodeSetAddUnique();
47643    test_ret += test_xmlXPathNodeSetContains();
47644    test_ret += test_xmlXPathNodeSetDel();
47645    test_ret += test_xmlXPathNodeSetMerge();
47646    test_ret += test_xmlXPathNodeSetRemove();
47647    test_ret += test_xmlXPathNodeSetSort();
47648    test_ret += test_xmlXPathNodeTrailing();
47649    test_ret += test_xmlXPathNodeTrailingSorted();
47650    test_ret += test_xmlXPathNormalizeFunction();
47651    test_ret += test_xmlXPathNotEqualValues();
47652    test_ret += test_xmlXPathNotFunction();
47653    test_ret += test_xmlXPathNsLookup();
47654    test_ret += test_xmlXPathNumberFunction();
47655    test_ret += test_xmlXPathParseNCName();
47656    test_ret += test_xmlXPathParseName();
47657    test_ret += test_xmlXPathPopBoolean();
47658    test_ret += test_xmlXPathPopExternal();
47659    test_ret += test_xmlXPathPopNodeSet();
47660    test_ret += test_xmlXPathPopNumber();
47661    test_ret += test_xmlXPathPopString();
47662    test_ret += test_xmlXPathPositionFunction();
47663    test_ret += test_xmlXPathRegisterAllFunctions();
47664    test_ret += test_xmlXPathRegisterFunc();
47665    test_ret += test_xmlXPathRegisterFuncLookup();
47666    test_ret += test_xmlXPathRegisterFuncNS();
47667    test_ret += test_xmlXPathRegisterNs();
47668    test_ret += test_xmlXPathRegisterVariable();
47669    test_ret += test_xmlXPathRegisterVariableLookup();
47670    test_ret += test_xmlXPathRegisterVariableNS();
47671    test_ret += test_xmlXPathRegisteredFuncsCleanup();
47672    test_ret += test_xmlXPathRegisteredNsCleanup();
47673    test_ret += test_xmlXPathRegisteredVariablesCleanup();
47674    test_ret += test_xmlXPathRoot();
47675    test_ret += test_xmlXPathRoundFunction();
47676    test_ret += test_xmlXPathStartsWithFunction();
47677    test_ret += test_xmlXPathStringEvalNumber();
47678    test_ret += test_xmlXPathStringFunction();
47679    test_ret += test_xmlXPathStringLengthFunction();
47680    test_ret += test_xmlXPathSubValues();
47681    test_ret += test_xmlXPathSubstringAfterFunction();
47682    test_ret += test_xmlXPathSubstringBeforeFunction();
47683    test_ret += test_xmlXPathSubstringFunction();
47684    test_ret += test_xmlXPathSumFunction();
47685    test_ret += test_xmlXPathTrailing();
47686    test_ret += test_xmlXPathTrailingSorted();
47687    test_ret += test_xmlXPathTranslateFunction();
47688    test_ret += test_xmlXPathTrueFunction();
47689    test_ret += test_xmlXPathValueFlipSign();
47690    test_ret += test_xmlXPathVariableLookup();
47691    test_ret += test_xmlXPathVariableLookupNS();
47692    test_ret += test_xmlXPathWrapCString();
47693    test_ret += test_xmlXPathWrapExternal();
47694    test_ret += test_xmlXPathWrapNodeSet();
47695    test_ret += test_xmlXPatherror();
47696
47697    if (test_ret != 0)
47698	printf("Module xpathInternals: %d errors\n", test_ret);
47699    return(test_ret);
47700}
47701
47702static int
47703test_xmlXPtrBuildNodeList(void) {
47704    int test_ret = 0;
47705
47706#ifdef LIBXML_XPTR_ENABLED
47707    int mem_base;
47708    xmlNodePtr ret_val;
47709    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
47710    int n_obj;
47711
47712    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
47713        mem_base = xmlMemBlocks();
47714        obj = gen_xmlXPathObjectPtr(n_obj, 0);
47715
47716        ret_val = xmlXPtrBuildNodeList(obj);
47717        desret_xmlNodePtr(ret_val);
47718        call_tests++;
47719        des_xmlXPathObjectPtr(n_obj, obj, 0);
47720        xmlResetLastError();
47721        if (mem_base != xmlMemBlocks()) {
47722            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
47723	           xmlMemBlocks() - mem_base);
47724	    test_ret++;
47725            printf(" %d", n_obj);
47726            printf("\n");
47727        }
47728    }
47729    function_tests++;
47730#endif
47731
47732    return(test_ret);
47733}
47734
47735
47736static int
47737test_xmlXPtrEval(void) {
47738    int test_ret = 0;
47739
47740#ifdef LIBXML_XPTR_ENABLED
47741    int mem_base;
47742    xmlXPathObjectPtr ret_val;
47743    xmlChar * str; /* the XPointer expression */
47744    int n_str;
47745    xmlXPathContextPtr ctx; /* the XPointer context */
47746    int n_ctx;
47747
47748    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
47749    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
47750        mem_base = xmlMemBlocks();
47751        str = gen_const_xmlChar_ptr(n_str, 0);
47752        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
47753
47754        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
47755        desret_xmlXPathObjectPtr(ret_val);
47756        call_tests++;
47757        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
47758        des_xmlXPathContextPtr(n_ctx, ctx, 1);
47759        xmlResetLastError();
47760        if (mem_base != xmlMemBlocks()) {
47761            printf("Leak of %d blocks found in xmlXPtrEval",
47762	           xmlMemBlocks() - mem_base);
47763	    test_ret++;
47764            printf(" %d", n_str);
47765            printf(" %d", n_ctx);
47766            printf("\n");
47767        }
47768    }
47769    }
47770    function_tests++;
47771#endif
47772
47773    return(test_ret);
47774}
47775
47776
47777static int
47778test_xmlXPtrEvalRangePredicate(void) {
47779    int test_ret = 0;
47780
47781#ifdef LIBXML_XPTR_ENABLED
47782    int mem_base;
47783    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
47784    int n_ctxt;
47785
47786    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47787        mem_base = xmlMemBlocks();
47788        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47789
47790        xmlXPtrEvalRangePredicate(ctxt);
47791        call_tests++;
47792        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47793        xmlResetLastError();
47794        if (mem_base != xmlMemBlocks()) {
47795            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
47796	           xmlMemBlocks() - mem_base);
47797	    test_ret++;
47798            printf(" %d", n_ctxt);
47799            printf("\n");
47800        }
47801    }
47802    function_tests++;
47803#endif
47804
47805    return(test_ret);
47806}
47807
47808#ifdef LIBXML_XPTR_ENABLED
47809
47810#define gen_nb_xmlLocationSetPtr 1
47811static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47812    return(NULL);
47813}
47814static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
47815}
47816#endif
47817
47818
47819static int
47820test_xmlXPtrLocationSetAdd(void) {
47821    int test_ret = 0;
47822
47823#ifdef LIBXML_XPTR_ENABLED
47824    int mem_base;
47825    xmlLocationSetPtr cur; /* the initial range set */
47826    int n_cur;
47827    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
47828    int n_val;
47829
47830    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
47831    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47832        mem_base = xmlMemBlocks();
47833        cur = gen_xmlLocationSetPtr(n_cur, 0);
47834        val = gen_xmlXPathObjectPtr(n_val, 1);
47835
47836        xmlXPtrLocationSetAdd(cur, val);
47837        call_tests++;
47838        des_xmlLocationSetPtr(n_cur, cur, 0);
47839        des_xmlXPathObjectPtr(n_val, val, 1);
47840        xmlResetLastError();
47841        if (mem_base != xmlMemBlocks()) {
47842            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
47843	           xmlMemBlocks() - mem_base);
47844	    test_ret++;
47845            printf(" %d", n_cur);
47846            printf(" %d", n_val);
47847            printf("\n");
47848        }
47849    }
47850    }
47851    function_tests++;
47852#endif
47853
47854    return(test_ret);
47855}
47856
47857
47858static int
47859test_xmlXPtrLocationSetCreate(void) {
47860    int test_ret = 0;
47861
47862
47863    /* missing type support */
47864    return(test_ret);
47865}
47866
47867
47868static int
47869test_xmlXPtrLocationSetDel(void) {
47870    int test_ret = 0;
47871
47872#ifdef LIBXML_XPTR_ENABLED
47873    int mem_base;
47874    xmlLocationSetPtr cur; /* the initial range set */
47875    int n_cur;
47876    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
47877    int n_val;
47878
47879    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
47880    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
47881        mem_base = xmlMemBlocks();
47882        cur = gen_xmlLocationSetPtr(n_cur, 0);
47883        val = gen_xmlXPathObjectPtr(n_val, 1);
47884
47885        xmlXPtrLocationSetDel(cur, val);
47886        call_tests++;
47887        des_xmlLocationSetPtr(n_cur, cur, 0);
47888        des_xmlXPathObjectPtr(n_val, val, 1);
47889        xmlResetLastError();
47890        if (mem_base != xmlMemBlocks()) {
47891            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
47892	           xmlMemBlocks() - mem_base);
47893	    test_ret++;
47894            printf(" %d", n_cur);
47895            printf(" %d", n_val);
47896            printf("\n");
47897        }
47898    }
47899    }
47900    function_tests++;
47901#endif
47902
47903    return(test_ret);
47904}
47905
47906
47907static int
47908test_xmlXPtrLocationSetMerge(void) {
47909    int test_ret = 0;
47910
47911
47912    /* missing type support */
47913    return(test_ret);
47914}
47915
47916
47917static int
47918test_xmlXPtrLocationSetRemove(void) {
47919    int test_ret = 0;
47920
47921#ifdef LIBXML_XPTR_ENABLED
47922    int mem_base;
47923    xmlLocationSetPtr cur; /* the initial range set */
47924    int n_cur;
47925    int val; /* the index to remove */
47926    int n_val;
47927
47928    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
47929    for (n_val = 0;n_val < gen_nb_int;n_val++) {
47930        mem_base = xmlMemBlocks();
47931        cur = gen_xmlLocationSetPtr(n_cur, 0);
47932        val = gen_int(n_val, 1);
47933
47934        xmlXPtrLocationSetRemove(cur, val);
47935        call_tests++;
47936        des_xmlLocationSetPtr(n_cur, cur, 0);
47937        des_int(n_val, val, 1);
47938        xmlResetLastError();
47939        if (mem_base != xmlMemBlocks()) {
47940            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
47941	           xmlMemBlocks() - mem_base);
47942	    test_ret++;
47943            printf(" %d", n_cur);
47944            printf(" %d", n_val);
47945            printf("\n");
47946        }
47947    }
47948    }
47949    function_tests++;
47950#endif
47951
47952    return(test_ret);
47953}
47954
47955
47956static int
47957test_xmlXPtrNewCollapsedRange(void) {
47958    int test_ret = 0;
47959
47960#ifdef LIBXML_XPTR_ENABLED
47961    int mem_base;
47962    xmlXPathObjectPtr ret_val;
47963    xmlNodePtr start; /* the starting and ending node */
47964    int n_start;
47965
47966    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
47967        mem_base = xmlMemBlocks();
47968        start = gen_xmlNodePtr(n_start, 0);
47969
47970        ret_val = xmlXPtrNewCollapsedRange(start);
47971        desret_xmlXPathObjectPtr(ret_val);
47972        call_tests++;
47973        des_xmlNodePtr(n_start, start, 0);
47974        xmlResetLastError();
47975        if (mem_base != xmlMemBlocks()) {
47976            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
47977	           xmlMemBlocks() - mem_base);
47978	    test_ret++;
47979            printf(" %d", n_start);
47980            printf("\n");
47981        }
47982    }
47983    function_tests++;
47984#endif
47985
47986    return(test_ret);
47987}
47988
47989
47990static int
47991test_xmlXPtrNewContext(void) {
47992    int test_ret = 0;
47993
47994
47995    /* missing type support */
47996    return(test_ret);
47997}
47998
47999
48000static int
48001test_xmlXPtrNewLocationSetNodeSet(void) {
48002    int test_ret = 0;
48003
48004#ifdef LIBXML_XPTR_ENABLED
48005    int mem_base;
48006    xmlXPathObjectPtr ret_val;
48007    xmlNodeSetPtr set; /* a node set */
48008    int n_set;
48009
48010    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48011        mem_base = xmlMemBlocks();
48012        set = gen_xmlNodeSetPtr(n_set, 0);
48013
48014        ret_val = xmlXPtrNewLocationSetNodeSet(set);
48015        desret_xmlXPathObjectPtr(ret_val);
48016        call_tests++;
48017        des_xmlNodeSetPtr(n_set, set, 0);
48018        xmlResetLastError();
48019        if (mem_base != xmlMemBlocks()) {
48020            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
48021	           xmlMemBlocks() - mem_base);
48022	    test_ret++;
48023            printf(" %d", n_set);
48024            printf("\n");
48025        }
48026    }
48027    function_tests++;
48028#endif
48029
48030    return(test_ret);
48031}
48032
48033
48034static int
48035test_xmlXPtrNewLocationSetNodes(void) {
48036    int test_ret = 0;
48037
48038#ifdef LIBXML_XPTR_ENABLED
48039    int mem_base;
48040    xmlXPathObjectPtr ret_val;
48041    xmlNodePtr start; /* the start NodePtr value */
48042    int n_start;
48043    xmlNodePtr end; /* the end NodePtr value or NULL */
48044    int n_end;
48045
48046    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
48047    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
48048        mem_base = xmlMemBlocks();
48049        start = gen_xmlNodePtr(n_start, 0);
48050        end = gen_xmlNodePtr(n_end, 1);
48051
48052        ret_val = xmlXPtrNewLocationSetNodes(start, end);
48053        desret_xmlXPathObjectPtr(ret_val);
48054        call_tests++;
48055        des_xmlNodePtr(n_start, start, 0);
48056        des_xmlNodePtr(n_end, end, 1);
48057        xmlResetLastError();
48058        if (mem_base != xmlMemBlocks()) {
48059            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
48060	           xmlMemBlocks() - mem_base);
48061	    test_ret++;
48062            printf(" %d", n_start);
48063            printf(" %d", n_end);
48064            printf("\n");
48065        }
48066    }
48067    }
48068    function_tests++;
48069#endif
48070
48071    return(test_ret);
48072}
48073
48074
48075static int
48076test_xmlXPtrNewRange(void) {
48077    int test_ret = 0;
48078
48079#ifdef LIBXML_XPTR_ENABLED
48080    int mem_base;
48081    xmlXPathObjectPtr ret_val;
48082    xmlNodePtr start; /* the starting node */
48083    int n_start;
48084    int startindex; /* the start index */
48085    int n_startindex;
48086    xmlNodePtr end; /* the ending point */
48087    int n_end;
48088    int endindex; /* the ending index */
48089    int n_endindex;
48090
48091    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
48092    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
48093    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
48094    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
48095        mem_base = xmlMemBlocks();
48096        start = gen_xmlNodePtr(n_start, 0);
48097        startindex = gen_int(n_startindex, 1);
48098        end = gen_xmlNodePtr(n_end, 2);
48099        endindex = gen_int(n_endindex, 3);
48100
48101        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
48102        desret_xmlXPathObjectPtr(ret_val);
48103        call_tests++;
48104        des_xmlNodePtr(n_start, start, 0);
48105        des_int(n_startindex, startindex, 1);
48106        des_xmlNodePtr(n_end, end, 2);
48107        des_int(n_endindex, endindex, 3);
48108        xmlResetLastError();
48109        if (mem_base != xmlMemBlocks()) {
48110            printf("Leak of %d blocks found in xmlXPtrNewRange",
48111	           xmlMemBlocks() - mem_base);
48112	    test_ret++;
48113            printf(" %d", n_start);
48114            printf(" %d", n_startindex);
48115            printf(" %d", n_end);
48116            printf(" %d", n_endindex);
48117            printf("\n");
48118        }
48119    }
48120    }
48121    }
48122    }
48123    function_tests++;
48124#endif
48125
48126    return(test_ret);
48127}
48128
48129
48130static int
48131test_xmlXPtrNewRangeNodeObject(void) {
48132    int test_ret = 0;
48133
48134#ifdef LIBXML_XPTR_ENABLED
48135    int mem_base;
48136    xmlXPathObjectPtr ret_val;
48137    xmlNodePtr start; /* the starting node */
48138    int n_start;
48139    xmlXPathObjectPtr end; /* the ending object */
48140    int n_end;
48141
48142    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
48143    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
48144        mem_base = xmlMemBlocks();
48145        start = gen_xmlNodePtr(n_start, 0);
48146        end = gen_xmlXPathObjectPtr(n_end, 1);
48147
48148        ret_val = xmlXPtrNewRangeNodeObject(start, end);
48149        desret_xmlXPathObjectPtr(ret_val);
48150        call_tests++;
48151        des_xmlNodePtr(n_start, start, 0);
48152        des_xmlXPathObjectPtr(n_end, end, 1);
48153        xmlResetLastError();
48154        if (mem_base != xmlMemBlocks()) {
48155            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
48156	           xmlMemBlocks() - mem_base);
48157	    test_ret++;
48158            printf(" %d", n_start);
48159            printf(" %d", n_end);
48160            printf("\n");
48161        }
48162    }
48163    }
48164    function_tests++;
48165#endif
48166
48167    return(test_ret);
48168}
48169
48170
48171static int
48172test_xmlXPtrNewRangeNodePoint(void) {
48173    int test_ret = 0;
48174
48175#ifdef LIBXML_XPTR_ENABLED
48176    int mem_base;
48177    xmlXPathObjectPtr ret_val;
48178    xmlNodePtr start; /* the starting node */
48179    int n_start;
48180    xmlXPathObjectPtr end; /* the ending point */
48181    int n_end;
48182
48183    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
48184    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
48185        mem_base = xmlMemBlocks();
48186        start = gen_xmlNodePtr(n_start, 0);
48187        end = gen_xmlXPathObjectPtr(n_end, 1);
48188
48189        ret_val = xmlXPtrNewRangeNodePoint(start, end);
48190        desret_xmlXPathObjectPtr(ret_val);
48191        call_tests++;
48192        des_xmlNodePtr(n_start, start, 0);
48193        des_xmlXPathObjectPtr(n_end, end, 1);
48194        xmlResetLastError();
48195        if (mem_base != xmlMemBlocks()) {
48196            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
48197	           xmlMemBlocks() - mem_base);
48198	    test_ret++;
48199            printf(" %d", n_start);
48200            printf(" %d", n_end);
48201            printf("\n");
48202        }
48203    }
48204    }
48205    function_tests++;
48206#endif
48207
48208    return(test_ret);
48209}
48210
48211
48212static int
48213test_xmlXPtrNewRangeNodes(void) {
48214    int test_ret = 0;
48215
48216#ifdef LIBXML_XPTR_ENABLED
48217    int mem_base;
48218    xmlXPathObjectPtr ret_val;
48219    xmlNodePtr start; /* the starting node */
48220    int n_start;
48221    xmlNodePtr end; /* the ending node */
48222    int n_end;
48223
48224    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
48225    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
48226        mem_base = xmlMemBlocks();
48227        start = gen_xmlNodePtr(n_start, 0);
48228        end = gen_xmlNodePtr(n_end, 1);
48229
48230        ret_val = xmlXPtrNewRangeNodes(start, end);
48231        desret_xmlXPathObjectPtr(ret_val);
48232        call_tests++;
48233        des_xmlNodePtr(n_start, start, 0);
48234        des_xmlNodePtr(n_end, end, 1);
48235        xmlResetLastError();
48236        if (mem_base != xmlMemBlocks()) {
48237            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
48238	           xmlMemBlocks() - mem_base);
48239	    test_ret++;
48240            printf(" %d", n_start);
48241            printf(" %d", n_end);
48242            printf("\n");
48243        }
48244    }
48245    }
48246    function_tests++;
48247#endif
48248
48249    return(test_ret);
48250}
48251
48252
48253static int
48254test_xmlXPtrNewRangePointNode(void) {
48255    int test_ret = 0;
48256
48257#ifdef LIBXML_XPTR_ENABLED
48258    int mem_base;
48259    xmlXPathObjectPtr ret_val;
48260    xmlXPathObjectPtr start; /* the starting point */
48261    int n_start;
48262    xmlNodePtr end; /* the ending node */
48263    int n_end;
48264
48265    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
48266    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
48267        mem_base = xmlMemBlocks();
48268        start = gen_xmlXPathObjectPtr(n_start, 0);
48269        end = gen_xmlNodePtr(n_end, 1);
48270
48271        ret_val = xmlXPtrNewRangePointNode(start, end);
48272        desret_xmlXPathObjectPtr(ret_val);
48273        call_tests++;
48274        des_xmlXPathObjectPtr(n_start, start, 0);
48275        des_xmlNodePtr(n_end, end, 1);
48276        xmlResetLastError();
48277        if (mem_base != xmlMemBlocks()) {
48278            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
48279	           xmlMemBlocks() - mem_base);
48280	    test_ret++;
48281            printf(" %d", n_start);
48282            printf(" %d", n_end);
48283            printf("\n");
48284        }
48285    }
48286    }
48287    function_tests++;
48288#endif
48289
48290    return(test_ret);
48291}
48292
48293
48294static int
48295test_xmlXPtrNewRangePoints(void) {
48296    int test_ret = 0;
48297
48298#ifdef LIBXML_XPTR_ENABLED
48299    int mem_base;
48300    xmlXPathObjectPtr ret_val;
48301    xmlXPathObjectPtr start; /* the starting point */
48302    int n_start;
48303    xmlXPathObjectPtr end; /* the ending point */
48304    int n_end;
48305
48306    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
48307    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
48308        mem_base = xmlMemBlocks();
48309        start = gen_xmlXPathObjectPtr(n_start, 0);
48310        end = gen_xmlXPathObjectPtr(n_end, 1);
48311
48312        ret_val = xmlXPtrNewRangePoints(start, end);
48313        desret_xmlXPathObjectPtr(ret_val);
48314        call_tests++;
48315        des_xmlXPathObjectPtr(n_start, start, 0);
48316        des_xmlXPathObjectPtr(n_end, end, 1);
48317        xmlResetLastError();
48318        if (mem_base != xmlMemBlocks()) {
48319            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
48320	           xmlMemBlocks() - mem_base);
48321	    test_ret++;
48322            printf(" %d", n_start);
48323            printf(" %d", n_end);
48324            printf("\n");
48325        }
48326    }
48327    }
48328    function_tests++;
48329#endif
48330
48331    return(test_ret);
48332}
48333
48334
48335static int
48336test_xmlXPtrRangeToFunction(void) {
48337    int test_ret = 0;
48338
48339#ifdef LIBXML_XPTR_ENABLED
48340    int mem_base;
48341    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
48342    int n_ctxt;
48343    int nargs; /* the number of args */
48344    int n_nargs;
48345
48346    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48347    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48348        mem_base = xmlMemBlocks();
48349        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48350        nargs = gen_int(n_nargs, 1);
48351
48352        xmlXPtrRangeToFunction(ctxt, nargs);
48353        call_tests++;
48354        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48355        des_int(n_nargs, nargs, 1);
48356        xmlResetLastError();
48357        if (mem_base != xmlMemBlocks()) {
48358            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
48359	           xmlMemBlocks() - mem_base);
48360	    test_ret++;
48361            printf(" %d", n_ctxt);
48362            printf(" %d", n_nargs);
48363            printf("\n");
48364        }
48365    }
48366    }
48367    function_tests++;
48368#endif
48369
48370    return(test_ret);
48371}
48372
48373
48374static int
48375test_xmlXPtrWrapLocationSet(void) {
48376    int test_ret = 0;
48377
48378#ifdef LIBXML_XPTR_ENABLED
48379    int mem_base;
48380    xmlXPathObjectPtr ret_val;
48381    xmlLocationSetPtr val; /* the LocationSet value */
48382    int n_val;
48383
48384    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
48385        mem_base = xmlMemBlocks();
48386        val = gen_xmlLocationSetPtr(n_val, 0);
48387
48388        ret_val = xmlXPtrWrapLocationSet(val);
48389        desret_xmlXPathObjectPtr(ret_val);
48390        call_tests++;
48391        des_xmlLocationSetPtr(n_val, val, 0);
48392        xmlResetLastError();
48393        if (mem_base != xmlMemBlocks()) {
48394            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
48395	           xmlMemBlocks() - mem_base);
48396	    test_ret++;
48397            printf(" %d", n_val);
48398            printf("\n");
48399        }
48400    }
48401    function_tests++;
48402#endif
48403
48404    return(test_ret);
48405}
48406
48407static int
48408test_xpointer(void) {
48409    int test_ret = 0;
48410
48411    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
48412    test_ret += test_xmlXPtrBuildNodeList();
48413    test_ret += test_xmlXPtrEval();
48414    test_ret += test_xmlXPtrEvalRangePredicate();
48415    test_ret += test_xmlXPtrLocationSetAdd();
48416    test_ret += test_xmlXPtrLocationSetCreate();
48417    test_ret += test_xmlXPtrLocationSetDel();
48418    test_ret += test_xmlXPtrLocationSetMerge();
48419    test_ret += test_xmlXPtrLocationSetRemove();
48420    test_ret += test_xmlXPtrNewCollapsedRange();
48421    test_ret += test_xmlXPtrNewContext();
48422    test_ret += test_xmlXPtrNewLocationSetNodeSet();
48423    test_ret += test_xmlXPtrNewLocationSetNodes();
48424    test_ret += test_xmlXPtrNewRange();
48425    test_ret += test_xmlXPtrNewRangeNodeObject();
48426    test_ret += test_xmlXPtrNewRangeNodePoint();
48427    test_ret += test_xmlXPtrNewRangeNodes();
48428    test_ret += test_xmlXPtrNewRangePointNode();
48429    test_ret += test_xmlXPtrNewRangePoints();
48430    test_ret += test_xmlXPtrRangeToFunction();
48431    test_ret += test_xmlXPtrWrapLocationSet();
48432
48433    if (test_ret != 0)
48434	printf("Module xpointer: %d errors\n", test_ret);
48435    return(test_ret);
48436}
48437static int
48438test_module(const char *module) {
48439    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
48440    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
48441    if (!strcmp(module, "SAX2")) return(test_SAX2());
48442    if (!strcmp(module, "c14n")) return(test_c14n());
48443    if (!strcmp(module, "catalog")) return(test_catalog());
48444    if (!strcmp(module, "chvalid")) return(test_chvalid());
48445    if (!strcmp(module, "debugXML")) return(test_debugXML());
48446    if (!strcmp(module, "dict")) return(test_dict());
48447    if (!strcmp(module, "encoding")) return(test_encoding());
48448    if (!strcmp(module, "entities")) return(test_entities());
48449    if (!strcmp(module, "hash")) return(test_hash());
48450    if (!strcmp(module, "list")) return(test_list());
48451    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
48452    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
48453    if (!strcmp(module, "parser")) return(test_parser());
48454    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
48455    if (!strcmp(module, "pattern")) return(test_pattern());
48456    if (!strcmp(module, "relaxng")) return(test_relaxng());
48457    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
48458    if (!strcmp(module, "tree")) return(test_tree());
48459    if (!strcmp(module, "uri")) return(test_uri());
48460    if (!strcmp(module, "valid")) return(test_valid());
48461    if (!strcmp(module, "xinclude")) return(test_xinclude());
48462    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
48463    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
48464    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
48465    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
48466    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
48467    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
48468    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
48469    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
48470    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
48471    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
48472    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
48473    if (!strcmp(module, "xpath")) return(test_xpath());
48474    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
48475    if (!strcmp(module, "xpointer")) return(test_xpointer());
48476    return(0);
48477}
48478