1 /*
2  * testapi.c: libxml2 API tester program.
3  *
4  * Automatically generated by gentest.py from libxml2-api.xml
5  *
6  * See Copyright for the status of this software.
7  *
8  * daniel@veillard.com
9  */
10 
11 #ifdef HAVE_CONFIG_H
12 #include "libxml.h"
13 #else
14 #include <stdio.h>
15 #endif
16 
17 #include <stdlib.h> /* for putenv() */
18 #include <string.h>
19 #include <libxml/xmlerror.h>
20 #include <libxml/relaxng.h>
21 
22 #if defined(_WIN32) && !defined(__CYGWIN__)
23 #define snprintf _snprintf
24 #endif
25 
26 static int testlibxml2(void);
27 static int test_module(const char *module);
28 
29 static int generic_errors = 0;
30 static int call_tests = 0;
31 static int function_tests = 0;
32 
33 static xmlChar chartab[1024];
34 static int inttab[1024];
35 static unsigned long longtab[1024];
36 
37 static xmlDocPtr api_doc = NULL;
38 static xmlDtdPtr api_dtd = NULL;
39 static xmlNodePtr api_root = NULL;
40 static xmlAttrPtr api_attr = NULL;
41 static xmlNsPtr api_ns = NULL;
42 
43 static void
structured_errors(void * userData ATTRIBUTE_UNUSED,xmlErrorPtr error ATTRIBUTE_UNUSED)44 structured_errors(void *userData ATTRIBUTE_UNUSED,
45                   xmlErrorPtr error ATTRIBUTE_UNUSED) {
46     generic_errors++;
47 }
48 
49 static void
free_api_doc(void)50 free_api_doc(void) {
51     xmlFreeDoc(api_doc);
52     api_doc = NULL;
53     api_dtd = NULL;
54     api_root = NULL;
55     api_attr = NULL;
56     api_ns = NULL;
57 }
58 
59 static xmlDocPtr
get_api_doc(void)60 get_api_doc(void) {
61     if (api_doc == NULL) {
62         api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
63 	api_root = NULL;
64 	api_attr = NULL;
65     }
66     return(api_doc);
67 }
68 
69 static xmlDtdPtr
get_api_dtd(void)70 get_api_dtd(void) {
71     if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
72         get_api_doc();
73 	if ((api_doc != NULL) && (api_doc->children != NULL) &&
74 	    (api_doc->children->type == XML_DTD_NODE))
75 	    api_dtd = (xmlDtdPtr) api_doc->children;
76     }
77     return(api_dtd);
78 }
79 
80 static xmlNodePtr
get_api_root(void)81 get_api_root(void) {
82     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
83         get_api_doc();
84 	if ((api_doc != NULL) && (api_doc->children != NULL) &&
85 	    (api_doc->children->next != NULL) &&
86 	    (api_doc->children->next->type == XML_ELEMENT_NODE))
87 	    api_root = api_doc->children->next;
88     }
89     return(api_root);
90 }
91 
92 static xmlNsPtr
get_api_ns(void)93 get_api_ns(void) {
94     get_api_root();
95     if (api_root != NULL)
96         api_ns = api_root->nsDef;
97     return(api_ns);
98 }
99 
100 static xmlAttrPtr
get_api_attr(void)101 get_api_attr(void) {
102 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
103     static int nr = 0;
104     xmlChar name[20];
105 #endif
106 
107     if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
108         get_api_root();
109     }
110     if (api_root == NULL)
111         return(NULL);
112     if (api_root->properties != NULL) {
113         api_attr = api_root->properties;
114         return(api_root->properties);
115     }
116     api_attr = NULL;
117 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
118     snprintf((char *) name, 20, "foo%d", nr++);
119     api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
120 #endif
121     return(api_attr);
122 }
123 
124 static int quiet = 0;
125 
main(int argc,char ** argv)126 int main(int argc, char **argv) {
127     int ret;
128     int blocks, mem;
129 
130     /* access to the proxy can slow up regression tests a lot */
131     putenv((char *) "http_proxy=");
132 
133     memset(chartab, 0, sizeof(chartab));
134     strncpy((char *) chartab, "  chartab\n", 20);
135     memset(inttab, 0, sizeof(inttab));
136     memset(longtab, 0, sizeof(longtab));
137 
138     xmlInitParser();
139 #ifdef LIBXML_SCHEMAS_ENABLED
140     xmlRelaxNGInitTypes();
141 #endif
142 
143     LIBXML_TEST_VERSION
144 
145     xmlSetStructuredErrorFunc(NULL, structured_errors);
146 
147     if (argc >= 2) {
148         if (!strcmp(argv[1], "-q")) {
149 	    quiet = 1;
150 	    if (argc >= 3)
151 	        ret = test_module(argv[2]);
152 	    else
153 		ret = testlibxml2();
154         } else {
155 	   ret = test_module(argv[1]);
156 	}
157     } else
158 	ret = testlibxml2();
159 
160     xmlCleanupParser();
161     blocks = xmlMemBlocks();
162     mem = xmlMemUsed();
163     if ((blocks != 0) || (mem != 0)) {
164         printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
165     }
166     xmlMemoryDump();
167 
168     return (ret != 0);
169 }
170 
171 #include <libxml/HTMLparser.h>
172 #include <libxml/HTMLtree.h>
173 #include <libxml/catalog.h>
174 #include <libxml/chvalid.h>
175 #include <libxml/dict.h>
176 #include <libxml/encoding.h>
177 #include <libxml/entities.h>
178 #include <libxml/hash.h>
179 #include <libxml/list.h>
180 #include <libxml/nanoftp.h>
181 #include <libxml/nanohttp.h>
182 #include <libxml/parser.h>
183 #include <libxml/parserInternals.h>
184 #include <libxml/pattern.h>
185 #include <libxml/relaxng.h>
186 #include <libxml/schemasInternals.h>
187 #include <libxml/schematron.h>
188 #include <libxml/tree.h>
189 #include <libxml/uri.h>
190 #include <libxml/valid.h>
191 #include <libxml/xinclude.h>
192 #include <libxml/xmlIO.h>
193 #include <libxml/xmlerror.h>
194 #include <libxml/xmlreader.h>
195 #include <libxml/xmlsave.h>
196 #include <libxml/xmlschemas.h>
197 #include <libxml/xmlschemastypes.h>
198 #include <libxml/xmlstring.h>
199 #include <libxml/xmlwriter.h>
200 #include <libxml/xpath.h>
201 #include <libxml/xpointer.h>
202 #include <libxml/debugXML.h>
203 
204 /*
205   We manually define xmlErrMemory because it's normal declaration
206   is "hidden" by #ifdef IN_LIBXML
207 */
208 void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
209 
210 /*
211  We need some "remote" addresses, but want to avoid getting into
212  name resolution delays, so we use these
213 */
214 #define	REMOTE1GOOD	"http://localhost/"
215 #define	REMOTE1BAD	"http://missing. example.org/"
216 #define	REMOTE2GOOD	"ftp://localhost/foo"
217 
218 #define gen_nb_void_ptr 2
219 
gen_void_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)220 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
221     return(NULL);
222 }
des_void_ptr(int no ATTRIBUTE_UNUSED,void * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)223 static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
224 }
225 
226 #if 0
227 #define gen_nb_const_void_ptr 2
228 
229 static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
230     if (no == 0) return((const void *) "immutable string");
231     return(NULL);
232 }
233 static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
234 }
235 #endif
236 
237 #define gen_nb_userdata 3
238 
gen_userdata(int no,int nr ATTRIBUTE_UNUSED)239 static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
240     if (no == 0) return((void *) &call_tests);
241     if (no == 1) return((void *) -1);
242     return(NULL);
243 }
des_userdata(int no ATTRIBUTE_UNUSED,void * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)244 static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
245 }
246 
247 
248 #define gen_nb_int 4
249 
gen_int(int no,int nr ATTRIBUTE_UNUSED)250 static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
251     if (no == 0) return(0);
252     if (no == 1) return(1);
253     if (no == 2) return(-1);
254     if (no == 3) return(122);
255     return(-1);
256 }
257 
des_int(int no ATTRIBUTE_UNUSED,int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)258 static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
259 }
260 
261 #define gen_nb_parseroptions 5
262 
gen_parseroptions(int no,int nr ATTRIBUTE_UNUSED)263 static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
264     if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
265     if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
266     if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
267     if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
268     return(XML_PARSE_SAX1);
269 }
270 
des_parseroptions(int no ATTRIBUTE_UNUSED,int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)271 static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
272 }
273 
274 #if 0
275 #define gen_nb_long 5
276 
277 static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
278     if (no == 0) return(0);
279     if (no == 1) return(1);
280     if (no == 2) return(-1);
281     if (no == 3) return(122);
282     return(-1);
283 }
284 
285 static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
286 }
287 #endif
288 
289 #define gen_nb_xmlChar 4
290 
gen_xmlChar(int no,int nr ATTRIBUTE_UNUSED)291 static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
292     if (no == 0) return('a');
293     if (no == 1) return(' ');
294     if (no == 2) return((xmlChar) '�');
295     return(0);
296 }
297 
des_xmlChar(int no ATTRIBUTE_UNUSED,xmlChar val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)298 static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
299 }
300 
301 #define gen_nb_unsigned_int 3
302 
gen_unsigned_int(int no,int nr ATTRIBUTE_UNUSED)303 static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
304     if (no == 0) return(0);
305     if (no == 1) return(1);
306     if (no == 2) return(122);
307     return((unsigned int) -1);
308 }
309 
des_unsigned_int(int no ATTRIBUTE_UNUSED,unsigned int val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)310 static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
311 }
312 
313 #define gen_nb_unsigned_long 4
314 
gen_unsigned_long(int no,int nr ATTRIBUTE_UNUSED)315 static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
316     if (no == 0) return(0);
317     if (no == 1) return(1);
318     if (no == 2) return(122);
319     return((unsigned long) -1);
320 }
321 
des_unsigned_long(int no ATTRIBUTE_UNUSED,unsigned long val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)322 static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
323 }
324 
325 #define gen_nb_double 4
326 
gen_double(int no,int nr ATTRIBUTE_UNUSED)327 static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
328     if (no == 0) return(0);
329     if (no == 1) return(-1.1);
330 #if defined(LIBXML_XPATH_ENABLED)
331     if (no == 2) return(xmlXPathNAN);
332 #endif
333     return(-1);
334 }
335 
des_double(int no ATTRIBUTE_UNUSED,double val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)336 static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
337 }
338 
339 #define gen_nb_unsigned_long_ptr 2
340 
gen_unsigned_long_ptr(int no,int nr)341 static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
342     if (no == 0) return(&longtab[nr]);
343     return(NULL);
344 }
345 
des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED,unsigned long * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)346 static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
347 }
348 
349 #define gen_nb_int_ptr 2
350 
gen_int_ptr(int no,int nr)351 static int *gen_int_ptr(int no, int nr) {
352     if (no == 0) return(&inttab[nr]);
353     return(NULL);
354 }
355 
des_int_ptr(int no ATTRIBUTE_UNUSED,int * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)356 static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
357 }
358 
359 #define gen_nb_const_char_ptr 4
360 
gen_const_char_ptr(int no,int nr ATTRIBUTE_UNUSED)361 static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
362     if (no == 0) return((char *) "foo");
363     if (no == 1) return((char *) "<foo/>");
364     if (no == 2) return((char *) "test/ent2");
365     return(NULL);
366 }
des_const_char_ptr(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)367 static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
368 }
369 
370 #define gen_nb_xmlChar_ptr 2
371 
gen_xmlChar_ptr(int no,int nr ATTRIBUTE_UNUSED)372 static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
373     if (no == 0) return(&chartab[0]);
374     return(NULL);
375 }
des_xmlChar_ptr(int no ATTRIBUTE_UNUSED,xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)376 static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
377 }
378 
379 #define gen_nb_FILE_ptr 2
380 
gen_FILE_ptr(int no,int nr ATTRIBUTE_UNUSED)381 static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
382     if (no == 0) return(fopen("test.out", "a+"));
383     return(NULL);
384 }
des_FILE_ptr(int no ATTRIBUTE_UNUSED,FILE * val,int nr ATTRIBUTE_UNUSED)385 static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
386     if (val != NULL) fclose(val);
387 }
388 
389 #define gen_nb_debug_FILE_ptr 2
gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)390 static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
391     return(fopen("test.out", "a+"));
392 }
des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED,FILE * val,int nr ATTRIBUTE_UNUSED)393 static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
394     if (val != NULL) fclose(val);
395 }
396 
397 #define gen_nb_const_xmlChar_ptr 5
398 
gen_const_xmlChar_ptr(int no,int nr ATTRIBUTE_UNUSED)399 static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
400     if (no == 0) return((xmlChar *) "foo");
401     if (no == 1) return((xmlChar *) "<foo/>");
402     if (no == 2) return((xmlChar *) "n�ne");
403     if (no == 3) return((xmlChar *) " 2ab ");
404     return(NULL);
405 }
des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED,const xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)406 static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
407 }
408 
409 #define gen_nb_filepath 8
410 
gen_filepath(int no,int nr ATTRIBUTE_UNUSED)411 static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
412     if (no == 0) return("missing.xml");
413     if (no == 1) return("<foo/>");
414     if (no == 2) return("test/ent2");
415     if (no == 3) return("test/valid/REC-xml-19980210.xml");
416     if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
417     if (no == 5) return(REMOTE1GOOD);
418     if (no == 6) return(REMOTE1BAD);
419     return(NULL);
420 }
des_filepath(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)421 static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
422 }
423 
424 #define gen_nb_eaten_name 2
425 
gen_eaten_name(int no,int nr ATTRIBUTE_UNUSED)426 static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
427     if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
428     return(NULL);
429 }
des_eaten_name(int no ATTRIBUTE_UNUSED,xmlChar * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)430 static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
431 }
432 
433 #define gen_nb_fileoutput 6
434 
gen_fileoutput(int no,int nr ATTRIBUTE_UNUSED)435 static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
436     if (no == 0) return("/missing.xml");
437     if (no == 1) return("<foo/>");
438     if (no == 2) return(REMOTE2GOOD);
439     if (no == 3) return(REMOTE1GOOD);
440     if (no == 4) return(REMOTE1BAD);
441     return(NULL);
442 }
des_fileoutput(int no ATTRIBUTE_UNUSED,const char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)443 static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
444 }
445 
446 #define gen_nb_xmlParserCtxtPtr 3
gen_xmlParserCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)447 static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
448     if (no == 0) return(xmlNewParserCtxt());
449     if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
450     return(NULL);
451 }
des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlParserCtxtPtr val,int nr ATTRIBUTE_UNUSED)452 static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
453     if (val != NULL)
454         xmlFreeParserCtxt(val);
455 }
456 
457 #define gen_nb_xmlSAXHandlerPtr 2
gen_xmlSAXHandlerPtr(int no,int nr ATTRIBUTE_UNUSED)458 static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
459 #ifdef LIBXML_SAX1_ENABLED
460     if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
461 #endif
462     return(NULL);
463 }
des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED,xmlSAXHandlerPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)464 static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
465 }
466 
467 #define gen_nb_xmlValidCtxtPtr 2
gen_xmlValidCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)468 static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
469 #ifdef LIBXML_VALID_ENABLED
470     if (no == 0) return(xmlNewValidCtxt());
471 #endif
472     return(NULL);
473 }
des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlValidCtxtPtr val,int nr ATTRIBUTE_UNUSED)474 static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
475 #ifdef LIBXML_VALID_ENABLED
476     if (val != NULL)
477         xmlFreeValidCtxt(val);
478 #endif
479 }
480 
481 #define gen_nb_xmlParserInputBufferPtr 8
482 
gen_xmlParserInputBufferPtr(int no,int nr ATTRIBUTE_UNUSED)483 static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
484     if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
485     if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
486     if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
487     if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
488     if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
489     if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
490     if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
491     return(NULL);
492 }
des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED,xmlParserInputBufferPtr val,int nr ATTRIBUTE_UNUSED)493 static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
494     xmlFreeParserInputBuffer(val);
495 }
496 
497 #define gen_nb_xmlDocPtr 3
gen_xmlDocPtr(int no,int nr ATTRIBUTE_UNUSED)498 static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
499     if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
500     if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
501     return(NULL);
502 }
des_xmlDocPtr(int no ATTRIBUTE_UNUSED,xmlDocPtr val,int nr ATTRIBUTE_UNUSED)503 static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
504     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
505         xmlFreeDoc(val);
506 }
507 
508 #define gen_nb_xmlAttrPtr 2
gen_xmlAttrPtr(int no,int nr ATTRIBUTE_UNUSED)509 static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
510     if (no == 0) return(get_api_attr());
511     return(NULL);
512 }
des_xmlAttrPtr(int no,xmlAttrPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)513 static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
514     if (no == 0) free_api_doc();
515 }
516 
517 #define gen_nb_xmlDictPtr 2
gen_xmlDictPtr(int no,int nr ATTRIBUTE_UNUSED)518 static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
519     if (no == 0) return(xmlDictCreate());
520     return(NULL);
521 }
des_xmlDictPtr(int no ATTRIBUTE_UNUSED,xmlDictPtr val,int nr ATTRIBUTE_UNUSED)522 static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
523     if (val != NULL)
524         xmlDictFree(val);
525 }
526 
527 #define gen_nb_xmlNodePtr 3
gen_xmlNodePtr(int no,int nr ATTRIBUTE_UNUSED)528 static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
529     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
530     if (no == 1) return(get_api_root());
531     return(NULL);
532 /*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
533 }
des_xmlNodePtr(int no,xmlNodePtr val,int nr ATTRIBUTE_UNUSED)534 static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
535     if (no == 1) {
536         free_api_doc();
537     } else if (val != NULL) {
538         xmlUnlinkNode(val);
539         xmlFreeNode(val);
540     }
541 }
542 
543 #define gen_nb_xmlDtdPtr 3
gen_xmlDtdPtr(int no,int nr ATTRIBUTE_UNUSED)544 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
545     if (no == 0)
546         return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
547     if (no == 1) return(get_api_dtd());
548     return(NULL);
549 }
des_xmlDtdPtr(int no,xmlDtdPtr val,int nr ATTRIBUTE_UNUSED)550 static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
551     if (no == 1) free_api_doc();
552     else if (val != NULL) {
553         xmlUnlinkNode((xmlNodePtr) val);
554         xmlFreeNode((xmlNodePtr) val);
555     }
556 }
557 
558 #define gen_nb_xmlNsPtr 2
gen_xmlNsPtr(int no,int nr ATTRIBUTE_UNUSED)559 static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
560     if (no == 0) return(get_api_ns());
561     return(NULL);
562 }
des_xmlNsPtr(int no,xmlNsPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)563 static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
564     if (no == 0) free_api_doc();
565 }
566 
567 #define gen_nb_xmlNodePtr_in 3
gen_xmlNodePtr_in(int no,int nr ATTRIBUTE_UNUSED)568 static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
569     if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
570     if (no == 0) return(xmlNewText(BAD_CAST "text"));
571     return(NULL);
572 }
des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED,xmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)573 static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
574 }
575 
576 #ifdef LIBXML_WRITER_ENABLED
577 #define gen_nb_xmlTextWriterPtr 2
gen_xmlTextWriterPtr(int no,int nr ATTRIBUTE_UNUSED)578 static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
579     if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
580     return(NULL);
581 }
des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED,xmlTextWriterPtr val,int nr ATTRIBUTE_UNUSED)582 static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
583     if (val != NULL) xmlFreeTextWriter(val);
584 }
585 #endif
586 
587 #ifdef LIBXML_READER_ENABLED
588 #define gen_nb_xmlTextReaderPtr 4
gen_xmlTextReaderPtr(int no,int nr ATTRIBUTE_UNUSED)589 static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
590     if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
591     if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
592     if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
593     return(NULL);
594 }
des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED,xmlTextReaderPtr val,int nr ATTRIBUTE_UNUSED)595 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
596     if (val != NULL) xmlFreeTextReader(val);
597 }
598 #endif
599 
600 #define gen_nb_xmlBufferPtr 3
gen_xmlBufferPtr(int no,int nr ATTRIBUTE_UNUSED)601 static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
602     if (no == 0) return(xmlBufferCreate());
603     if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
604     return(NULL);
605 }
des_xmlBufferPtr(int no ATTRIBUTE_UNUSED,xmlBufferPtr val,int nr ATTRIBUTE_UNUSED)606 static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
607     if (val != NULL) {
608         xmlBufferFree(val);
609     }
610 }
611 
612 #define gen_nb_xmlListPtr 2
gen_xmlListPtr(int no,int nr ATTRIBUTE_UNUSED)613 static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
614     if (no == 0) return(xmlListCreate(NULL, NULL));
615     return(NULL);
616 }
des_xmlListPtr(int no ATTRIBUTE_UNUSED,xmlListPtr val,int nr ATTRIBUTE_UNUSED)617 static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
618     if (val != NULL) {
619         xmlListDelete(val);
620     }
621 }
622 
623 #define gen_nb_xmlHashTablePtr 2
gen_xmlHashTablePtr(int no,int nr ATTRIBUTE_UNUSED)624 static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
625     if (no == 0) return(xmlHashCreate(10));
626     return(NULL);
627 }
des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED,xmlHashTablePtr val,int nr ATTRIBUTE_UNUSED)628 static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
629     if (val != NULL) {
630         xmlHashFree(val, NULL);
631     }
632 }
633 
634 #include <libxml/xpathInternals.h>
635 
636 #ifdef LIBXML_XPATH_ENABLED
637 #define gen_nb_xmlXPathObjectPtr 5
gen_xmlXPathObjectPtr(int no,int nr ATTRIBUTE_UNUSED)638 static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
639     if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
640     if (no == 1) return(xmlXPathNewFloat(1.1));
641     if (no == 2) return(xmlXPathNewBoolean(1));
642     if (no == 3) return(xmlXPathNewNodeSet(NULL));
643     return(NULL);
644 }
des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED,xmlXPathObjectPtr val,int nr ATTRIBUTE_UNUSED)645 static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
646     if (val != NULL) {
647         xmlXPathFreeObject(val);
648     }
649 }
650 #endif
651 
652 #ifdef LIBXML_OUTPUT_ENABLED
653 #define gen_nb_xmlOutputBufferPtr 2
gen_xmlOutputBufferPtr(int no,int nr ATTRIBUTE_UNUSED)654 static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
655     if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
656     return(NULL);
657 }
des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED,xmlOutputBufferPtr val,int nr ATTRIBUTE_UNUSED)658 static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
659     if (val != NULL) {
660         xmlOutputBufferClose(val);
661     }
662 }
663 #endif
664 
665 #ifdef LIBXML_FTP_ENABLED
666 #define gen_nb_xmlNanoFTPCtxtPtr 4
gen_xmlNanoFTPCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)667 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
668     if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
669     if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
670     if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
671     return(NULL);
672 }
des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED,void * val,int nr ATTRIBUTE_UNUSED)673 static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
674     if (val != NULL) {
675         xmlNanoFTPFreeCtxt(val);
676     }
677 }
678 #endif
679 
680 #ifdef LIBXML_HTTP_ENABLED
681 #define gen_nb_xmlNanoHTTPCtxtPtr 1
gen_xmlNanoHTTPCtxtPtr(int no,int nr ATTRIBUTE_UNUSED)682 static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
683     if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
684     if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
685     if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
686     return(NULL);
687 }
des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED,void * val,int nr ATTRIBUTE_UNUSED)688 static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
689     if (val != NULL) {
690 	xmlNanoHTTPClose(val);
691     }
692 }
693 #endif
694 
695 #define gen_nb_xmlCharEncoding 4
gen_xmlCharEncoding(int no,int nr ATTRIBUTE_UNUSED)696 static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
697     if (no == 0) return(XML_CHAR_ENCODING_UTF8);
698     if (no == 1) return(XML_CHAR_ENCODING_NONE);
699     if (no == 2) return(XML_CHAR_ENCODING_8859_1);
700     return(XML_CHAR_ENCODING_ERROR);
701 }
des_xmlCharEncoding(int no ATTRIBUTE_UNUSED,xmlCharEncoding val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)702 static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
703 }
704 
705 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
706 
707 #define gen_nb_xmlExpCtxtPtr 1
gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)708 static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
709     return(NULL);
710 }
des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED,xmlExpCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)711 static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
712 }
713 
714 #define gen_nb_xmlExpNodePtr 1
gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)715 static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
716     return(NULL);
717 }
des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED,xmlExpNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)718 static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
719 }
720 
721 #endif
722 
723 #define gen_nb_xmlHashDeallocator 2
724 static void
test_xmlHashDeallocator(void * payload ATTRIBUTE_UNUSED,xmlChar * name ATTRIBUTE_UNUSED)725 test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
726 }
727 
gen_xmlHashDeallocator(int no,int nr ATTRIBUTE_UNUSED)728 static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
729     if (no == 0) return(test_xmlHashDeallocator);
730     return(NULL);
731 }
des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED,xmlHashDeallocator val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)732 static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
733 }
734 
735 
desret_int(int val ATTRIBUTE_UNUSED)736 static void desret_int(int val ATTRIBUTE_UNUSED) {
737 }
desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED)738 static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
739 }
desret_long(long val ATTRIBUTE_UNUSED)740 static void desret_long(long val ATTRIBUTE_UNUSED) {
741 }
desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED)742 static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
743 }
desret_double(double val ATTRIBUTE_UNUSED)744 static void desret_double(double val ATTRIBUTE_UNUSED) {
745 }
desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED)746 static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
747 }
748 #if 0
749 static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
750 }
751 #endif
desret_void_ptr(void * val ATTRIBUTE_UNUSED)752 static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
753 }
desret_const_char_ptr(const char * val ATTRIBUTE_UNUSED)754 static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
755 }
desret_const_xmlChar_ptr(const xmlChar * val ATTRIBUTE_UNUSED)756 static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
757 }
desret_xmlChar_ptr(xmlChar * val)758 static void desret_xmlChar_ptr(xmlChar *val) {
759     if (val != NULL)
760 	xmlFree(val);
761 }
desret_xmlDocPtr(xmlDocPtr val)762 static void desret_xmlDocPtr(xmlDocPtr val) {
763     if (val != api_doc)
764 	xmlFreeDoc(val);
765 }
desret_xmlDictPtr(xmlDictPtr val)766 static void desret_xmlDictPtr(xmlDictPtr val) {
767     xmlDictFree(val);
768 }
769 #ifdef LIBXML_OUTPUT_ENABLED
desret_xmlOutputBufferPtr(xmlOutputBufferPtr val)770 static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
771     xmlOutputBufferClose(val);
772 }
773 #endif
774 #ifdef LIBXML_READER_ENABLED
desret_xmlTextReaderPtr(xmlTextReaderPtr val)775 static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
776     xmlFreeTextReader(val);
777 }
778 #endif
desret_xmlNodePtr(xmlNodePtr val)779 static void desret_xmlNodePtr(xmlNodePtr val) {
780     if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
781 	xmlUnlinkNode(val);
782 	xmlFreeNode(val);
783     }
784 }
desret_xmlAttrPtr(xmlAttrPtr val)785 static void desret_xmlAttrPtr(xmlAttrPtr val) {
786     if (val != NULL) {
787 	xmlUnlinkNode((xmlNodePtr) val);
788 	xmlFreeNode((xmlNodePtr) val);
789     }
790 }
desret_xmlEntityPtr(xmlEntityPtr val)791 static void desret_xmlEntityPtr(xmlEntityPtr val) {
792     if (val != NULL) {
793 	xmlUnlinkNode((xmlNodePtr) val);
794 	xmlFreeNode((xmlNodePtr) val);
795     }
796 }
desret_xmlElementPtr(xmlElementPtr val)797 static void desret_xmlElementPtr(xmlElementPtr val) {
798     if (val != NULL) {
799 	xmlUnlinkNode((xmlNodePtr) val);
800     }
801 }
desret_xmlAttributePtr(xmlAttributePtr val)802 static void desret_xmlAttributePtr(xmlAttributePtr val) {
803     if (val != NULL) {
804 	xmlUnlinkNode((xmlNodePtr) val);
805     }
806 }
desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED)807 static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
808 }
desret_xmlDtdPtr(xmlDtdPtr val)809 static void desret_xmlDtdPtr(xmlDtdPtr val) {
810     desret_xmlNodePtr((xmlNodePtr)val);
811 }
812 #ifdef LIBXML_XPATH_ENABLED
desret_xmlXPathObjectPtr(xmlXPathObjectPtr val)813 static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
814     xmlXPathFreeObject(val);
815 }
desret_xmlNodeSetPtr(xmlNodeSetPtr val)816 static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
817     xmlXPathFreeNodeSet(val);
818 }
819 #endif
desret_xmlParserCtxtPtr(xmlParserCtxtPtr val)820 static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
821     xmlFreeParserCtxt(val);
822 }
desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val)823 static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
824     xmlFreeParserInputBuffer(val);
825 }
desret_xmlParserInputPtr(xmlParserInputPtr val)826 static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
827     xmlFreeInputStream(val);
828 }
829 #ifdef LIBXML_WRITER_ENABLED
desret_xmlTextWriterPtr(xmlTextWriterPtr val)830 static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
831     xmlFreeTextWriter(val);
832 }
833 #endif
desret_xmlBufferPtr(xmlBufferPtr val)834 static void desret_xmlBufferPtr(xmlBufferPtr val) {
835     xmlBufferFree(val);
836 }
837 #ifdef LIBXML_SCHEMAS_ENABLED
desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val)838 static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
839     xmlSchemaFreeParserCtxt(val);
840 }
desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED)841 static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
842 }
desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val)843 static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
844     xmlRelaxNGFreeParserCtxt(val);
845 }
846 #endif
847 #ifdef LIBXML_HTML_ENABLED
desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED)848 static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
849 }
850 #endif
851 #ifdef LIBXML_HTTP_ENABLED
desret_xmlNanoHTTPCtxtPtr(void * val)852 static void desret_xmlNanoHTTPCtxtPtr(void *val) {
853     xmlNanoHTTPClose(val);
854 }
855 #endif
856 #ifdef LIBXML_FTP_ENABLED
desret_xmlNanoFTPCtxtPtr(void * val)857 static void desret_xmlNanoFTPCtxtPtr(void *val) {
858     xmlNanoFTPClose(val);
859 }
860 #endif
861 /* cut and pasted from autogenerated to avoid troubles */
862 #define gen_nb_const_xmlChar_ptr_ptr 1
gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)863 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
864     return(NULL);
865 }
des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,const xmlChar ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)866 static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
867 }
868 
869 #define gen_nb_unsigned_char_ptr 1
gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)870 static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
871     return(NULL);
872 }
des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,unsigned char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)873 static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
874 }
875 
876 #define gen_nb_const_unsigned_char_ptr 1
gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)877 static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
878     return(NULL);
879 }
des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED,const unsigned char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)880 static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
881 }
882 
883 #ifdef LIBXML_HTML_ENABLED
884 #define gen_nb_const_htmlNodePtr 1
gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)885 static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
886     return(NULL);
887 }
des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED,const htmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)888 static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
889 }
890 #endif
891 
892 #ifdef LIBXML_HTML_ENABLED
893 #define gen_nb_htmlDocPtr 3
gen_htmlDocPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)894 static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
895     if (no == 0) return(htmlNewDoc(NULL, NULL));
896     if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
897     return(NULL);
898 }
des_htmlDocPtr(int no ATTRIBUTE_UNUSED,htmlDocPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)899 static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
900     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
901         xmlFreeDoc(val);
902 }
desret_htmlDocPtr(htmlDocPtr val)903 static void desret_htmlDocPtr(htmlDocPtr val) {
904     if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
905         xmlFreeDoc(val);
906 }
907 #define gen_nb_htmlParserCtxtPtr 3
gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)908 static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
909     if (no == 0) return(xmlNewParserCtxt());
910     if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
911     return(NULL);
912 }
des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,htmlParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)913 static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
914     if (val != NULL)
915         htmlFreeParserCtxt(val);
916 }
desret_htmlParserCtxtPtr(htmlParserCtxtPtr val)917 static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
918     if (val != NULL)
919         htmlFreeParserCtxt(val);
920 }
921 #endif
922 
923 #ifdef LIBXML_XPATH_ENABLED
924 #define gen_nb_xmlNodeSetPtr 1
gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)925 static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
926     return(NULL);
927 }
des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED,xmlNodeSetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)928 static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
929 }
930 #endif
931 
932 #ifdef LIBXML_DEBUG_ENABLED
933 #ifdef LIBXML_XPATH_ENABLED
934 #define gen_nb_xmlShellCtxtPtr 1
gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)935 static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
936     return(NULL);
937 }
des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED,xmlShellCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)938 static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
939 }
940 #endif
941 #endif
942 
943 #ifdef LIBXML_PATTERN_ENABLED
944 #define gen_nb_xmlPatternPtr 1
gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)945 static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
946     return(NULL);
947 }
des_xmlPatternPtr(int no ATTRIBUTE_UNUSED,xmlPatternPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)948 static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
949 }
950 #endif
951 
952 #define gen_nb_xmlElementContentPtr 1
gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)953 static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
954     return(NULL);
955 }
des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED,xmlElementContentPtr val,int nr ATTRIBUTE_UNUSED)956 static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
957     if (val != NULL)
958         xmlFreeElementContent(val);
959 }
desret_xmlElementContentPtr(xmlElementContentPtr val)960 static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
961     if (val != NULL)
962         xmlFreeElementContent(val);
963 }
964 
965 #define gen_nb_xmlParserNodeInfoSeqPtr 1
gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)966 static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
967     return(NULL);
968 }
des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)969 static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
970 }
971 
desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo * val ATTRIBUTE_UNUSED)972 static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
973 }
974 
975 /************************************************************************
976  *									*
977  *   WARNING: end of the manually maintained part of the test code	*
978  *            do not remove or alter the CUT HERE line			*
979  *									*
980  ************************************************************************/
981 
982 /* CUT HERE: everything below that line is generated */
983 #ifdef LIBXML_HTML_ENABLED
desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED)984 static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
985 }
986 
987 #endif
988 
989 #define gen_nb_xmlAttributeDefault 4
gen_xmlAttributeDefault(int no,int nr ATTRIBUTE_UNUSED)990 static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
991     if (no == 1) return(XML_ATTRIBUTE_FIXED);
992     if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
993     if (no == 3) return(XML_ATTRIBUTE_NONE);
994     if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
995     return(0);
996 }
997 
des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED,xmlAttributeDefault val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)998 static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
999 }
1000 
1001 #define gen_nb_xmlAttributeType 4
gen_xmlAttributeType(int no,int nr ATTRIBUTE_UNUSED)1002 static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1003     if (no == 1) return(XML_ATTRIBUTE_CDATA);
1004     if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1005     if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1006     if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1007     return(0);
1008 }
1009 
des_xmlAttributeType(int no ATTRIBUTE_UNUSED,xmlAttributeType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1010 static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1011 }
1012 
1013 #define gen_nb_xmlBufferAllocationScheme 3
gen_xmlBufferAllocationScheme(int no,int nr ATTRIBUTE_UNUSED)1014 static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1015     if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1016     if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1017     if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1018     return(0);
1019 }
1020 
des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED,xmlBufferAllocationScheme val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1021 static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1022 }
1023 
desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED)1024 static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1025 }
1026 
1027 #ifdef LIBXML_CATALOG_ENABLED
1028 #define gen_nb_xmlCatalogAllow 4
gen_xmlCatalogAllow(int no,int nr ATTRIBUTE_UNUSED)1029 static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1030     if (no == 1) return(XML_CATA_ALLOW_ALL);
1031     if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1032     if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1033     if (no == 4) return(XML_CATA_ALLOW_NONE);
1034     return(0);
1035 }
1036 
des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED,xmlCatalogAllow val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1037 static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1038 }
1039 
desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED)1040 static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1041 }
1042 
1043 #endif
1044 
1045 #ifdef LIBXML_CATALOG_ENABLED
1046 #define gen_nb_xmlCatalogPrefer 3
gen_xmlCatalogPrefer(int no,int nr ATTRIBUTE_UNUSED)1047 static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1048     if (no == 1) return(XML_CATA_PREFER_NONE);
1049     if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1050     if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1051     return(0);
1052 }
1053 
des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED,xmlCatalogPrefer val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1054 static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1055 }
1056 
desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED)1057 static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1058 }
1059 
1060 #endif
1061 
1062 #define gen_nb_xmlElementContentType 4
gen_xmlElementContentType(int no,int nr ATTRIBUTE_UNUSED)1063 static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1064     if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1065     if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1066     if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1067     if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1068     return(0);
1069 }
1070 
des_xmlElementContentType(int no ATTRIBUTE_UNUSED,xmlElementContentType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1071 static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1072 }
1073 
1074 #define gen_nb_xmlElementTypeVal 4
gen_xmlElementTypeVal(int no,int nr ATTRIBUTE_UNUSED)1075 static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1076     if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1077     if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1078     if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1079     if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1080     return(0);
1081 }
1082 
des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED,xmlElementTypeVal val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1083 static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1084 }
1085 
1086 #define gen_nb_xmlFeature 4
gen_xmlFeature(int no,int nr ATTRIBUTE_UNUSED)1087 static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1088     if (no == 1) return(XML_WITH_AUTOMATA);
1089     if (no == 2) return(XML_WITH_C14N);
1090     if (no == 3) return(XML_WITH_CATALOG);
1091     if (no == 4) return(XML_WITH_DEBUG);
1092     return(0);
1093 }
1094 
des_xmlFeature(int no ATTRIBUTE_UNUSED,xmlFeature val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1095 static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1096 }
1097 
desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED)1098 static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1099 }
1100 
1101 #ifdef LIBXML_SCHEMAS_ENABLED
1102 #define gen_nb_xmlSchemaValType 4
gen_xmlSchemaValType(int no,int nr ATTRIBUTE_UNUSED)1103 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1104     if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1105     if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1106     if (no == 3) return(XML_SCHEMAS_ANYURI);
1107     if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1108     return(0);
1109 }
1110 
des_xmlSchemaValType(int no ATTRIBUTE_UNUSED,xmlSchemaValType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1111 static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1112 }
1113 
desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED)1114 static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1115 }
1116 
1117 #endif
1118 
1119 #ifdef LIBXML_SCHEMAS_ENABLED
1120 #define gen_nb_xmlSchemaWhitespaceValueType 4
gen_xmlSchemaWhitespaceValueType(int no,int nr ATTRIBUTE_UNUSED)1121 static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1122     if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1123     if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1124     if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1125     if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1126     return(0);
1127 }
1128 
des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED,xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1129 static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1130 }
1131 
1132 #endif
1133 
1134 #include <libxml/HTMLparser.h>
1135 #include <libxml/HTMLtree.h>
1136 #include <libxml/SAX2.h>
1137 #include <libxml/c14n.h>
1138 #include <libxml/catalog.h>
1139 #include <libxml/chvalid.h>
1140 #include <libxml/debugXML.h>
1141 #include <libxml/dict.h>
1142 #include <libxml/encoding.h>
1143 #include <libxml/entities.h>
1144 #include <libxml/hash.h>
1145 #include <libxml/list.h>
1146 #include <libxml/nanoftp.h>
1147 #include <libxml/nanohttp.h>
1148 #include <libxml/parser.h>
1149 #include <libxml/parserInternals.h>
1150 #include <libxml/pattern.h>
1151 #include <libxml/relaxng.h>
1152 #include <libxml/schemasInternals.h>
1153 #include <libxml/schematron.h>
1154 #include <libxml/tree.h>
1155 #include <libxml/uri.h>
1156 #include <libxml/valid.h>
1157 #include <libxml/xinclude.h>
1158 #include <libxml/xmlIO.h>
1159 #include <libxml/xmlautomata.h>
1160 #include <libxml/xmlerror.h>
1161 #include <libxml/xmlmodule.h>
1162 #include <libxml/xmlreader.h>
1163 #include <libxml/xmlregexp.h>
1164 #include <libxml/xmlsave.h>
1165 #include <libxml/xmlschemas.h>
1166 #include <libxml/xmlschemastypes.h>
1167 #include <libxml/xmlstring.h>
1168 #include <libxml/xmlunicode.h>
1169 #include <libxml/xmlwriter.h>
1170 #include <libxml/xpath.h>
1171 #include <libxml/xpathInternals.h>
1172 #include <libxml/xpointer.h>
1173 static int test_HTMLparser(void);
1174 static int test_HTMLtree(void);
1175 static int test_SAX2(void);
1176 static int test_c14n(void);
1177 static int test_catalog(void);
1178 static int test_chvalid(void);
1179 static int test_debugXML(void);
1180 static int test_dict(void);
1181 static int test_encoding(void);
1182 static int test_entities(void);
1183 static int test_hash(void);
1184 static int test_list(void);
1185 static int test_nanoftp(void);
1186 static int test_nanohttp(void);
1187 static int test_parser(void);
1188 static int test_parserInternals(void);
1189 static int test_pattern(void);
1190 static int test_relaxng(void);
1191 static int test_schemasInternals(void);
1192 static int test_schematron(void);
1193 static int test_tree(void);
1194 static int test_uri(void);
1195 static int test_valid(void);
1196 static int test_xinclude(void);
1197 static int test_xmlIO(void);
1198 static int test_xmlautomata(void);
1199 static int test_xmlerror(void);
1200 static int test_xmlmodule(void);
1201 static int test_xmlreader(void);
1202 static int test_xmlregexp(void);
1203 static int test_xmlsave(void);
1204 static int test_xmlschemas(void);
1205 static int test_xmlschemastypes(void);
1206 static int test_xmlstring(void);
1207 static int test_xmlunicode(void);
1208 static int test_xmlwriter(void);
1209 static int test_xpath(void);
1210 static int test_xpathInternals(void);
1211 static int test_xpointer(void);
1212 
1213 /**
1214  * testlibxml2:
1215  *
1216  * Main entry point of the tester for the full libxml2 module,
1217  * it calls all the tester entry point for each module.
1218  *
1219  * Returns the number of error found
1220  */
1221 static int
testlibxml2(void)1222 testlibxml2(void)
1223 {
1224     int test_ret = 0;
1225 
1226     test_ret += test_HTMLparser();
1227     test_ret += test_HTMLtree();
1228     test_ret += test_SAX2();
1229     test_ret += test_c14n();
1230     test_ret += test_catalog();
1231     test_ret += test_chvalid();
1232     test_ret += test_debugXML();
1233     test_ret += test_dict();
1234     test_ret += test_encoding();
1235     test_ret += test_entities();
1236     test_ret += test_hash();
1237     test_ret += test_list();
1238     test_ret += test_nanoftp();
1239     test_ret += test_nanohttp();
1240     test_ret += test_parser();
1241     test_ret += test_parserInternals();
1242     test_ret += test_pattern();
1243     test_ret += test_relaxng();
1244     test_ret += test_schemasInternals();
1245     test_ret += test_schematron();
1246     test_ret += test_tree();
1247     test_ret += test_uri();
1248     test_ret += test_valid();
1249     test_ret += test_xinclude();
1250     test_ret += test_xmlIO();
1251     test_ret += test_xmlautomata();
1252     test_ret += test_xmlerror();
1253     test_ret += test_xmlmodule();
1254     test_ret += test_xmlreader();
1255     test_ret += test_xmlregexp();
1256     test_ret += test_xmlsave();
1257     test_ret += test_xmlschemas();
1258     test_ret += test_xmlschemastypes();
1259     test_ret += test_xmlstring();
1260     test_ret += test_xmlunicode();
1261     test_ret += test_xmlwriter();
1262     test_ret += test_xpath();
1263     test_ret += test_xpathInternals();
1264     test_ret += test_xpointer();
1265 
1266     printf("Total: %d functions, %d tests, %d errors\n",
1267            function_tests, call_tests, test_ret);
1268     return(test_ret);
1269 }
1270 
1271 
1272 static int
test_UTF8ToHtml(void)1273 test_UTF8ToHtml(void) {
1274     int test_ret = 0;
1275 
1276 #if defined(LIBXML_HTML_ENABLED)
1277     int mem_base;
1278     int ret_val;
1279     unsigned char * out; /* a pointer to an array of bytes to store the result */
1280     int n_out;
1281     int * outlen; /* the length of @out */
1282     int n_outlen;
1283     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1284     int n_in;
1285     int * inlen; /* the length of @in */
1286     int n_inlen;
1287 
1288     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1289     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1290     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1291     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1292         mem_base = xmlMemBlocks();
1293         out = gen_unsigned_char_ptr(n_out, 0);
1294         outlen = gen_int_ptr(n_outlen, 1);
1295         in = gen_const_unsigned_char_ptr(n_in, 2);
1296         inlen = gen_int_ptr(n_inlen, 3);
1297 
1298         ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1299         desret_int(ret_val);
1300         call_tests++;
1301         des_unsigned_char_ptr(n_out, out, 0);
1302         des_int_ptr(n_outlen, outlen, 1);
1303         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1304         des_int_ptr(n_inlen, inlen, 3);
1305         xmlResetLastError();
1306         if (mem_base != xmlMemBlocks()) {
1307             printf("Leak of %d blocks found in UTF8ToHtml",
1308 	           xmlMemBlocks() - mem_base);
1309 	    test_ret++;
1310             printf(" %d", n_out);
1311             printf(" %d", n_outlen);
1312             printf(" %d", n_in);
1313             printf(" %d", n_inlen);
1314             printf("\n");
1315         }
1316     }
1317     }
1318     }
1319     }
1320     function_tests++;
1321 #endif
1322 
1323     return(test_ret);
1324 }
1325 
1326 #ifdef LIBXML_HTML_ENABLED
1327 
1328 #define gen_nb_const_htmlElemDesc_ptr 1
gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1329 static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1330     return(NULL);
1331 }
des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED,const htmlElemDesc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1332 static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1333 }
1334 #endif
1335 
1336 
1337 static int
test_htmlAttrAllowed(void)1338 test_htmlAttrAllowed(void) {
1339     int test_ret = 0;
1340 
1341 #if defined(LIBXML_HTML_ENABLED)
1342     int mem_base;
1343     htmlStatus ret_val;
1344     htmlElemDesc * elt; /* HTML element */
1345     int n_elt;
1346     xmlChar * attr; /* HTML attribute */
1347     int n_attr;
1348     int legacy; /* whether to allow deprecated attributes */
1349     int n_legacy;
1350 
1351     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1352     for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1353     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1354         mem_base = xmlMemBlocks();
1355         elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1356         attr = gen_const_xmlChar_ptr(n_attr, 1);
1357         legacy = gen_int(n_legacy, 2);
1358 
1359         ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1360         desret_htmlStatus(ret_val);
1361         call_tests++;
1362         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1363         des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1364         des_int(n_legacy, legacy, 2);
1365         xmlResetLastError();
1366         if (mem_base != xmlMemBlocks()) {
1367             printf("Leak of %d blocks found in htmlAttrAllowed",
1368 	           xmlMemBlocks() - mem_base);
1369 	    test_ret++;
1370             printf(" %d", n_elt);
1371             printf(" %d", n_attr);
1372             printf(" %d", n_legacy);
1373             printf("\n");
1374         }
1375     }
1376     }
1377     }
1378     function_tests++;
1379 #endif
1380 
1381     return(test_ret);
1382 }
1383 
1384 #ifdef LIBXML_HTML_ENABLED
1385 
1386 #define gen_nb_htmlNodePtr 1
gen_htmlNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1387 static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1388     return(NULL);
1389 }
des_htmlNodePtr(int no ATTRIBUTE_UNUSED,htmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1390 static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1391 }
1392 #endif
1393 
1394 
1395 static int
test_htmlAutoCloseTag(void)1396 test_htmlAutoCloseTag(void) {
1397     int test_ret = 0;
1398 
1399 #if defined(LIBXML_HTML_ENABLED)
1400     int mem_base;
1401     int ret_val;
1402     htmlDocPtr doc; /* the HTML document */
1403     int n_doc;
1404     xmlChar * name; /* The tag name */
1405     int n_name;
1406     htmlNodePtr elem; /* the HTML element */
1407     int n_elem;
1408 
1409     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1410     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1411     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1412         mem_base = xmlMemBlocks();
1413         doc = gen_htmlDocPtr(n_doc, 0);
1414         name = gen_const_xmlChar_ptr(n_name, 1);
1415         elem = gen_htmlNodePtr(n_elem, 2);
1416 
1417         ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1418         desret_int(ret_val);
1419         call_tests++;
1420         des_htmlDocPtr(n_doc, doc, 0);
1421         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1422         des_htmlNodePtr(n_elem, elem, 2);
1423         xmlResetLastError();
1424         if (mem_base != xmlMemBlocks()) {
1425             printf("Leak of %d blocks found in htmlAutoCloseTag",
1426 	           xmlMemBlocks() - mem_base);
1427 	    test_ret++;
1428             printf(" %d", n_doc);
1429             printf(" %d", n_name);
1430             printf(" %d", n_elem);
1431             printf("\n");
1432         }
1433     }
1434     }
1435     }
1436     function_tests++;
1437 #endif
1438 
1439     return(test_ret);
1440 }
1441 
1442 
1443 static int
test_htmlCreateMemoryParserCtxt(void)1444 test_htmlCreateMemoryParserCtxt(void) {
1445     int test_ret = 0;
1446 
1447 #if defined(LIBXML_HTML_ENABLED)
1448     int mem_base;
1449     htmlParserCtxtPtr ret_val;
1450     char * buffer; /* a pointer to a char array */
1451     int n_buffer;
1452     int size; /* the size of the array */
1453     int n_size;
1454 
1455     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1456     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1457         mem_base = xmlMemBlocks();
1458         buffer = gen_const_char_ptr(n_buffer, 0);
1459         size = gen_int(n_size, 1);
1460 
1461         ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1462         desret_htmlParserCtxtPtr(ret_val);
1463         call_tests++;
1464         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1465         des_int(n_size, size, 1);
1466         xmlResetLastError();
1467         if (mem_base != xmlMemBlocks()) {
1468             printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1469 	           xmlMemBlocks() - mem_base);
1470 	    test_ret++;
1471             printf(" %d", n_buffer);
1472             printf(" %d", n_size);
1473             printf("\n");
1474         }
1475     }
1476     }
1477     function_tests++;
1478 #endif
1479 
1480     return(test_ret);
1481 }
1482 
1483 #ifdef LIBXML_HTML_ENABLED
1484 
1485 #define gen_nb_htmlSAXHandlerPtr 1
gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1486 static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1487     return(NULL);
1488 }
des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED,htmlSAXHandlerPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)1489 static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1490 }
1491 #endif
1492 
1493 
1494 static int
test_htmlCreatePushParserCtxt(void)1495 test_htmlCreatePushParserCtxt(void) {
1496     int test_ret = 0;
1497 
1498 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1499     int mem_base;
1500     htmlParserCtxtPtr ret_val;
1501     htmlSAXHandlerPtr sax; /* a SAX handler */
1502     int n_sax;
1503     void * user_data; /* The user data returned on SAX callbacks */
1504     int n_user_data;
1505     char * chunk; /* a pointer to an array of chars */
1506     int n_chunk;
1507     int size; /* number of chars in the array */
1508     int n_size;
1509     const char * filename; /* an optional file name or URI */
1510     int n_filename;
1511     xmlCharEncoding enc; /* an optional encoding */
1512     int n_enc;
1513 
1514     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1515     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1516     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1517     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1518     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1519     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1520         mem_base = xmlMemBlocks();
1521         sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1522         user_data = gen_userdata(n_user_data, 1);
1523         chunk = gen_const_char_ptr(n_chunk, 2);
1524         size = gen_int(n_size, 3);
1525         filename = gen_fileoutput(n_filename, 4);
1526         enc = gen_xmlCharEncoding(n_enc, 5);
1527 
1528         ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1529         desret_htmlParserCtxtPtr(ret_val);
1530         call_tests++;
1531         des_htmlSAXHandlerPtr(n_sax, sax, 0);
1532         des_userdata(n_user_data, user_data, 1);
1533         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1534         des_int(n_size, size, 3);
1535         des_fileoutput(n_filename, filename, 4);
1536         des_xmlCharEncoding(n_enc, enc, 5);
1537         xmlResetLastError();
1538         if (mem_base != xmlMemBlocks()) {
1539             printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1540 	           xmlMemBlocks() - mem_base);
1541 	    test_ret++;
1542             printf(" %d", n_sax);
1543             printf(" %d", n_user_data);
1544             printf(" %d", n_chunk);
1545             printf(" %d", n_size);
1546             printf(" %d", n_filename);
1547             printf(" %d", n_enc);
1548             printf("\n");
1549         }
1550     }
1551     }
1552     }
1553     }
1554     }
1555     }
1556     function_tests++;
1557 #endif
1558 
1559     return(test_ret);
1560 }
1561 
1562 
1563 static int
test_htmlCtxtReadDoc(void)1564 test_htmlCtxtReadDoc(void) {
1565     int test_ret = 0;
1566 
1567 #if defined(LIBXML_HTML_ENABLED)
1568     int mem_base;
1569     htmlDocPtr ret_val;
1570     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1571     int n_ctxt;
1572     xmlChar * cur; /* a pointer to a zero terminated string */
1573     int n_cur;
1574     const char * URL; /* the base URL to use for the document */
1575     int n_URL;
1576     char * encoding; /* the document encoding, or NULL */
1577     int n_encoding;
1578     int options; /* a combination of htmlParserOption(s) */
1579     int n_options;
1580 
1581     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1582     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1583     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1584     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1585     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1586         mem_base = xmlMemBlocks();
1587         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1588         cur = gen_const_xmlChar_ptr(n_cur, 1);
1589         URL = gen_filepath(n_URL, 2);
1590         encoding = gen_const_char_ptr(n_encoding, 3);
1591         options = gen_int(n_options, 4);
1592 
1593         ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1594         desret_htmlDocPtr(ret_val);
1595         call_tests++;
1596         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1597         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1598         des_filepath(n_URL, URL, 2);
1599         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1600         des_int(n_options, options, 4);
1601         xmlResetLastError();
1602         if (mem_base != xmlMemBlocks()) {
1603             printf("Leak of %d blocks found in htmlCtxtReadDoc",
1604 	           xmlMemBlocks() - mem_base);
1605 	    test_ret++;
1606             printf(" %d", n_ctxt);
1607             printf(" %d", n_cur);
1608             printf(" %d", n_URL);
1609             printf(" %d", n_encoding);
1610             printf(" %d", n_options);
1611             printf("\n");
1612         }
1613     }
1614     }
1615     }
1616     }
1617     }
1618     function_tests++;
1619 #endif
1620 
1621     return(test_ret);
1622 }
1623 
1624 
1625 static int
test_htmlCtxtReadFile(void)1626 test_htmlCtxtReadFile(void) {
1627     int test_ret = 0;
1628 
1629 #if defined(LIBXML_HTML_ENABLED)
1630     htmlDocPtr ret_val;
1631     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1632     int n_ctxt;
1633     const char * filename; /* a file or URL */
1634     int n_filename;
1635     char * encoding; /* the document encoding, or NULL */
1636     int n_encoding;
1637     int options; /* a combination of htmlParserOption(s) */
1638     int n_options;
1639 
1640     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1641     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1642     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1643     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1644         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1645         filename = gen_filepath(n_filename, 1);
1646         encoding = gen_const_char_ptr(n_encoding, 2);
1647         options = gen_int(n_options, 3);
1648 
1649         ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1650         desret_htmlDocPtr(ret_val);
1651         call_tests++;
1652         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1653         des_filepath(n_filename, filename, 1);
1654         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1655         des_int(n_options, options, 3);
1656         xmlResetLastError();
1657     }
1658     }
1659     }
1660     }
1661     function_tests++;
1662 #endif
1663 
1664     return(test_ret);
1665 }
1666 
1667 
1668 static int
test_htmlCtxtReadMemory(void)1669 test_htmlCtxtReadMemory(void) {
1670     int test_ret = 0;
1671 
1672 #if defined(LIBXML_HTML_ENABLED)
1673     int mem_base;
1674     htmlDocPtr ret_val;
1675     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1676     int n_ctxt;
1677     char * buffer; /* a pointer to a char array */
1678     int n_buffer;
1679     int size; /* the size of the array */
1680     int n_size;
1681     const char * URL; /* the base URL to use for the document */
1682     int n_URL;
1683     char * encoding; /* the document encoding, or NULL */
1684     int n_encoding;
1685     int options; /* a combination of htmlParserOption(s) */
1686     int n_options;
1687 
1688     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1689     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1690     for (n_size = 0;n_size < gen_nb_int;n_size++) {
1691     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1692     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1693     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1694         mem_base = xmlMemBlocks();
1695         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1696         buffer = gen_const_char_ptr(n_buffer, 1);
1697         size = gen_int(n_size, 2);
1698         URL = gen_filepath(n_URL, 3);
1699         encoding = gen_const_char_ptr(n_encoding, 4);
1700         options = gen_int(n_options, 5);
1701 
1702         ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1703         desret_htmlDocPtr(ret_val);
1704         call_tests++;
1705         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1706         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1707         des_int(n_size, size, 2);
1708         des_filepath(n_URL, URL, 3);
1709         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1710         des_int(n_options, options, 5);
1711         xmlResetLastError();
1712         if (mem_base != xmlMemBlocks()) {
1713             printf("Leak of %d blocks found in htmlCtxtReadMemory",
1714 	           xmlMemBlocks() - mem_base);
1715 	    test_ret++;
1716             printf(" %d", n_ctxt);
1717             printf(" %d", n_buffer);
1718             printf(" %d", n_size);
1719             printf(" %d", n_URL);
1720             printf(" %d", n_encoding);
1721             printf(" %d", n_options);
1722             printf("\n");
1723         }
1724     }
1725     }
1726     }
1727     }
1728     }
1729     }
1730     function_tests++;
1731 #endif
1732 
1733     return(test_ret);
1734 }
1735 
1736 
1737 static int
test_htmlCtxtReset(void)1738 test_htmlCtxtReset(void) {
1739     int test_ret = 0;
1740 
1741 #if defined(LIBXML_HTML_ENABLED)
1742     int mem_base;
1743     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1744     int n_ctxt;
1745 
1746     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1747         mem_base = xmlMemBlocks();
1748         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1749 
1750         htmlCtxtReset(ctxt);
1751         call_tests++;
1752         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1753         xmlResetLastError();
1754         if (mem_base != xmlMemBlocks()) {
1755             printf("Leak of %d blocks found in htmlCtxtReset",
1756 	           xmlMemBlocks() - mem_base);
1757 	    test_ret++;
1758             printf(" %d", n_ctxt);
1759             printf("\n");
1760         }
1761     }
1762     function_tests++;
1763 #endif
1764 
1765     return(test_ret);
1766 }
1767 
1768 
1769 static int
test_htmlCtxtUseOptions(void)1770 test_htmlCtxtUseOptions(void) {
1771     int test_ret = 0;
1772 
1773 #if defined(LIBXML_HTML_ENABLED)
1774     int mem_base;
1775     int ret_val;
1776     htmlParserCtxtPtr ctxt; /* an HTML parser context */
1777     int n_ctxt;
1778     int options; /* a combination of htmlParserOption(s) */
1779     int n_options;
1780 
1781     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1782     for (n_options = 0;n_options < gen_nb_int;n_options++) {
1783         mem_base = xmlMemBlocks();
1784         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1785         options = gen_int(n_options, 1);
1786 
1787         ret_val = htmlCtxtUseOptions(ctxt, options);
1788         desret_int(ret_val);
1789         call_tests++;
1790         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1791         des_int(n_options, options, 1);
1792         xmlResetLastError();
1793         if (mem_base != xmlMemBlocks()) {
1794             printf("Leak of %d blocks found in htmlCtxtUseOptions",
1795 	           xmlMemBlocks() - mem_base);
1796 	    test_ret++;
1797             printf(" %d", n_ctxt);
1798             printf(" %d", n_options);
1799             printf("\n");
1800         }
1801     }
1802     }
1803     function_tests++;
1804 #endif
1805 
1806     return(test_ret);
1807 }
1808 
1809 
1810 static int
test_htmlElementAllowedHere(void)1811 test_htmlElementAllowedHere(void) {
1812     int test_ret = 0;
1813 
1814 #if defined(LIBXML_HTML_ENABLED)
1815     int mem_base;
1816     int ret_val;
1817     htmlElemDesc * parent; /* HTML parent element */
1818     int n_parent;
1819     xmlChar * elt; /* HTML element */
1820     int n_elt;
1821 
1822     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1823     for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1824         mem_base = xmlMemBlocks();
1825         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1826         elt = gen_const_xmlChar_ptr(n_elt, 1);
1827 
1828         ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1829         desret_int(ret_val);
1830         call_tests++;
1831         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1832         des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1833         xmlResetLastError();
1834         if (mem_base != xmlMemBlocks()) {
1835             printf("Leak of %d blocks found in htmlElementAllowedHere",
1836 	           xmlMemBlocks() - mem_base);
1837 	    test_ret++;
1838             printf(" %d", n_parent);
1839             printf(" %d", n_elt);
1840             printf("\n");
1841         }
1842     }
1843     }
1844     function_tests++;
1845 #endif
1846 
1847     return(test_ret);
1848 }
1849 
1850 
1851 static int
test_htmlElementStatusHere(void)1852 test_htmlElementStatusHere(void) {
1853     int test_ret = 0;
1854 
1855 #if defined(LIBXML_HTML_ENABLED)
1856     int mem_base;
1857     htmlStatus ret_val;
1858     htmlElemDesc * parent; /* HTML parent element */
1859     int n_parent;
1860     htmlElemDesc * elt; /* HTML element */
1861     int n_elt;
1862 
1863     for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1864     for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1865         mem_base = xmlMemBlocks();
1866         parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1867         elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1868 
1869         ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1870         desret_htmlStatus(ret_val);
1871         call_tests++;
1872         des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1873         des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1874         xmlResetLastError();
1875         if (mem_base != xmlMemBlocks()) {
1876             printf("Leak of %d blocks found in htmlElementStatusHere",
1877 	           xmlMemBlocks() - mem_base);
1878 	    test_ret++;
1879             printf(" %d", n_parent);
1880             printf(" %d", n_elt);
1881             printf("\n");
1882         }
1883     }
1884     }
1885     function_tests++;
1886 #endif
1887 
1888     return(test_ret);
1889 }
1890 
1891 
1892 static int
test_htmlEncodeEntities(void)1893 test_htmlEncodeEntities(void) {
1894     int test_ret = 0;
1895 
1896 #if defined(LIBXML_HTML_ENABLED)
1897     int mem_base;
1898     int ret_val;
1899     unsigned char * out; /* a pointer to an array of bytes to store the result */
1900     int n_out;
1901     int * outlen; /* the length of @out */
1902     int n_outlen;
1903     unsigned char * in; /* a pointer to an array of UTF-8 chars */
1904     int n_in;
1905     int * inlen; /* the length of @in */
1906     int n_inlen;
1907     int quoteChar; /* the quote character to escape (' or ") or zero. */
1908     int n_quoteChar;
1909 
1910     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1911     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1912     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1913     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1914     for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1915         mem_base = xmlMemBlocks();
1916         out = gen_unsigned_char_ptr(n_out, 0);
1917         outlen = gen_int_ptr(n_outlen, 1);
1918         in = gen_const_unsigned_char_ptr(n_in, 2);
1919         inlen = gen_int_ptr(n_inlen, 3);
1920         quoteChar = gen_int(n_quoteChar, 4);
1921 
1922         ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1923         desret_int(ret_val);
1924         call_tests++;
1925         des_unsigned_char_ptr(n_out, out, 0);
1926         des_int_ptr(n_outlen, outlen, 1);
1927         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1928         des_int_ptr(n_inlen, inlen, 3);
1929         des_int(n_quoteChar, quoteChar, 4);
1930         xmlResetLastError();
1931         if (mem_base != xmlMemBlocks()) {
1932             printf("Leak of %d blocks found in htmlEncodeEntities",
1933 	           xmlMemBlocks() - mem_base);
1934 	    test_ret++;
1935             printf(" %d", n_out);
1936             printf(" %d", n_outlen);
1937             printf(" %d", n_in);
1938             printf(" %d", n_inlen);
1939             printf(" %d", n_quoteChar);
1940             printf("\n");
1941         }
1942     }
1943     }
1944     }
1945     }
1946     }
1947     function_tests++;
1948 #endif
1949 
1950     return(test_ret);
1951 }
1952 
1953 
1954 static int
test_htmlEntityLookup(void)1955 test_htmlEntityLookup(void) {
1956     int test_ret = 0;
1957 
1958 #if defined(LIBXML_HTML_ENABLED)
1959     int mem_base;
1960     const htmlEntityDesc * ret_val;
1961     xmlChar * name; /* the entity name */
1962     int n_name;
1963 
1964     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1965         mem_base = xmlMemBlocks();
1966         name = gen_const_xmlChar_ptr(n_name, 0);
1967 
1968         ret_val = htmlEntityLookup((const xmlChar *)name);
1969         desret_const_htmlEntityDesc_ptr(ret_val);
1970         call_tests++;
1971         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1972         xmlResetLastError();
1973         if (mem_base != xmlMemBlocks()) {
1974             printf("Leak of %d blocks found in htmlEntityLookup",
1975 	           xmlMemBlocks() - mem_base);
1976 	    test_ret++;
1977             printf(" %d", n_name);
1978             printf("\n");
1979         }
1980     }
1981     function_tests++;
1982 #endif
1983 
1984     return(test_ret);
1985 }
1986 
1987 
1988 static int
test_htmlEntityValueLookup(void)1989 test_htmlEntityValueLookup(void) {
1990     int test_ret = 0;
1991 
1992 #if defined(LIBXML_HTML_ENABLED)
1993     int mem_base;
1994     const htmlEntityDesc * ret_val;
1995     unsigned int value; /* the entity's unicode value */
1996     int n_value;
1997 
1998     for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
1999         mem_base = xmlMemBlocks();
2000         value = gen_unsigned_int(n_value, 0);
2001 
2002         ret_val = htmlEntityValueLookup(value);
2003         desret_const_htmlEntityDesc_ptr(ret_val);
2004         call_tests++;
2005         des_unsigned_int(n_value, value, 0);
2006         xmlResetLastError();
2007         if (mem_base != xmlMemBlocks()) {
2008             printf("Leak of %d blocks found in htmlEntityValueLookup",
2009 	           xmlMemBlocks() - mem_base);
2010 	    test_ret++;
2011             printf(" %d", n_value);
2012             printf("\n");
2013         }
2014     }
2015     function_tests++;
2016 #endif
2017 
2018     return(test_ret);
2019 }
2020 
2021 
2022 static int
test_htmlHandleOmittedElem(void)2023 test_htmlHandleOmittedElem(void) {
2024     int test_ret = 0;
2025 
2026 #if defined(LIBXML_HTML_ENABLED)
2027     int mem_base;
2028     int ret_val;
2029     int val; /* int 0 or 1 */
2030     int n_val;
2031 
2032     for (n_val = 0;n_val < gen_nb_int;n_val++) {
2033         mem_base = xmlMemBlocks();
2034         val = gen_int(n_val, 0);
2035 
2036         ret_val = htmlHandleOmittedElem(val);
2037         desret_int(ret_val);
2038         call_tests++;
2039         des_int(n_val, val, 0);
2040         xmlResetLastError();
2041         if (mem_base != xmlMemBlocks()) {
2042             printf("Leak of %d blocks found in htmlHandleOmittedElem",
2043 	           xmlMemBlocks() - mem_base);
2044 	    test_ret++;
2045             printf(" %d", n_val);
2046             printf("\n");
2047         }
2048     }
2049     function_tests++;
2050 #endif
2051 
2052     return(test_ret);
2053 }
2054 
2055 
2056 static int
test_htmlIsAutoClosed(void)2057 test_htmlIsAutoClosed(void) {
2058     int test_ret = 0;
2059 
2060 #if defined(LIBXML_HTML_ENABLED)
2061     int mem_base;
2062     int ret_val;
2063     htmlDocPtr doc; /* the HTML document */
2064     int n_doc;
2065     htmlNodePtr elem; /* the HTML element */
2066     int n_elem;
2067 
2068     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2069     for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2070         mem_base = xmlMemBlocks();
2071         doc = gen_htmlDocPtr(n_doc, 0);
2072         elem = gen_htmlNodePtr(n_elem, 1);
2073 
2074         ret_val = htmlIsAutoClosed(doc, elem);
2075         desret_int(ret_val);
2076         call_tests++;
2077         des_htmlDocPtr(n_doc, doc, 0);
2078         des_htmlNodePtr(n_elem, elem, 1);
2079         xmlResetLastError();
2080         if (mem_base != xmlMemBlocks()) {
2081             printf("Leak of %d blocks found in htmlIsAutoClosed",
2082 	           xmlMemBlocks() - mem_base);
2083 	    test_ret++;
2084             printf(" %d", n_doc);
2085             printf(" %d", n_elem);
2086             printf("\n");
2087         }
2088     }
2089     }
2090     function_tests++;
2091 #endif
2092 
2093     return(test_ret);
2094 }
2095 
2096 
2097 static int
test_htmlIsScriptAttribute(void)2098 test_htmlIsScriptAttribute(void) {
2099     int test_ret = 0;
2100 
2101 #if defined(LIBXML_HTML_ENABLED)
2102     int mem_base;
2103     int ret_val;
2104     xmlChar * name; /* an attribute name */
2105     int n_name;
2106 
2107     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2108         mem_base = xmlMemBlocks();
2109         name = gen_const_xmlChar_ptr(n_name, 0);
2110 
2111         ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2112         desret_int(ret_val);
2113         call_tests++;
2114         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2115         xmlResetLastError();
2116         if (mem_base != xmlMemBlocks()) {
2117             printf("Leak of %d blocks found in htmlIsScriptAttribute",
2118 	           xmlMemBlocks() - mem_base);
2119 	    test_ret++;
2120             printf(" %d", n_name);
2121             printf("\n");
2122         }
2123     }
2124     function_tests++;
2125 #endif
2126 
2127     return(test_ret);
2128 }
2129 
2130 
2131 static int
test_htmlNewParserCtxt(void)2132 test_htmlNewParserCtxt(void) {
2133     int test_ret = 0;
2134 
2135 #if defined(LIBXML_HTML_ENABLED)
2136     int mem_base;
2137     htmlParserCtxtPtr ret_val;
2138 
2139         mem_base = xmlMemBlocks();
2140 
2141         ret_val = htmlNewParserCtxt();
2142         desret_htmlParserCtxtPtr(ret_val);
2143         call_tests++;
2144         xmlResetLastError();
2145         if (mem_base != xmlMemBlocks()) {
2146             printf("Leak of %d blocks found in htmlNewParserCtxt",
2147 	           xmlMemBlocks() - mem_base);
2148 	    test_ret++;
2149             printf("\n");
2150         }
2151     function_tests++;
2152 #endif
2153 
2154     return(test_ret);
2155 }
2156 
2157 
2158 static int
test_htmlNodeStatus(void)2159 test_htmlNodeStatus(void) {
2160     int test_ret = 0;
2161 
2162 #if defined(LIBXML_HTML_ENABLED)
2163     int mem_base;
2164     htmlStatus ret_val;
2165     htmlNodePtr node; /* an htmlNodePtr in a tree */
2166     int n_node;
2167     int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2168     int n_legacy;
2169 
2170     for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2171     for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2172         mem_base = xmlMemBlocks();
2173         node = gen_const_htmlNodePtr(n_node, 0);
2174         legacy = gen_int(n_legacy, 1);
2175 
2176         ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2177         desret_htmlStatus(ret_val);
2178         call_tests++;
2179         des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2180         des_int(n_legacy, legacy, 1);
2181         xmlResetLastError();
2182         if (mem_base != xmlMemBlocks()) {
2183             printf("Leak of %d blocks found in htmlNodeStatus",
2184 	           xmlMemBlocks() - mem_base);
2185 	    test_ret++;
2186             printf(" %d", n_node);
2187             printf(" %d", n_legacy);
2188             printf("\n");
2189         }
2190     }
2191     }
2192     function_tests++;
2193 #endif
2194 
2195     return(test_ret);
2196 }
2197 
2198 
2199 static int
test_htmlParseCharRef(void)2200 test_htmlParseCharRef(void) {
2201     int test_ret = 0;
2202 
2203 #if defined(LIBXML_HTML_ENABLED)
2204     int mem_base;
2205     int ret_val;
2206     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2207     int n_ctxt;
2208 
2209     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2210         mem_base = xmlMemBlocks();
2211         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2212 
2213         ret_val = htmlParseCharRef(ctxt);
2214         desret_int(ret_val);
2215         call_tests++;
2216         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2217         xmlResetLastError();
2218         if (mem_base != xmlMemBlocks()) {
2219             printf("Leak of %d blocks found in htmlParseCharRef",
2220 	           xmlMemBlocks() - mem_base);
2221 	    test_ret++;
2222             printf(" %d", n_ctxt);
2223             printf("\n");
2224         }
2225     }
2226     function_tests++;
2227 #endif
2228 
2229     return(test_ret);
2230 }
2231 
2232 
2233 static int
test_htmlParseChunk(void)2234 test_htmlParseChunk(void) {
2235     int test_ret = 0;
2236 
2237 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2238     int mem_base;
2239     int ret_val;
2240     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2241     int n_ctxt;
2242     char * chunk; /* an char array */
2243     int n_chunk;
2244     int size; /* the size in byte of the chunk */
2245     int n_size;
2246     int terminate; /* last chunk indicator */
2247     int n_terminate;
2248 
2249     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2250     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2251     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2252     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2253         mem_base = xmlMemBlocks();
2254         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2255         chunk = gen_const_char_ptr(n_chunk, 1);
2256         size = gen_int(n_size, 2);
2257         terminate = gen_int(n_terminate, 3);
2258 
2259         ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2260         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2261         desret_int(ret_val);
2262         call_tests++;
2263         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2264         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2265         des_int(n_size, size, 2);
2266         des_int(n_terminate, terminate, 3);
2267         xmlResetLastError();
2268         if (mem_base != xmlMemBlocks()) {
2269             printf("Leak of %d blocks found in htmlParseChunk",
2270 	           xmlMemBlocks() - mem_base);
2271 	    test_ret++;
2272             printf(" %d", n_ctxt);
2273             printf(" %d", n_chunk);
2274             printf(" %d", n_size);
2275             printf(" %d", n_terminate);
2276             printf("\n");
2277         }
2278     }
2279     }
2280     }
2281     }
2282     function_tests++;
2283 #endif
2284 
2285     return(test_ret);
2286 }
2287 
2288 
2289 static int
test_htmlParseDoc(void)2290 test_htmlParseDoc(void) {
2291     int test_ret = 0;
2292 
2293 #if defined(LIBXML_HTML_ENABLED)
2294     int mem_base;
2295     htmlDocPtr ret_val;
2296     xmlChar * cur; /* a pointer to an array of xmlChar */
2297     int n_cur;
2298     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2299     int n_encoding;
2300 
2301     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2302     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2303         mem_base = xmlMemBlocks();
2304         cur = gen_xmlChar_ptr(n_cur, 0);
2305         encoding = gen_const_char_ptr(n_encoding, 1);
2306 
2307         ret_val = htmlParseDoc(cur, (const char *)encoding);
2308         desret_htmlDocPtr(ret_val);
2309         call_tests++;
2310         des_xmlChar_ptr(n_cur, cur, 0);
2311         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2312         xmlResetLastError();
2313         if (mem_base != xmlMemBlocks()) {
2314             printf("Leak of %d blocks found in htmlParseDoc",
2315 	           xmlMemBlocks() - mem_base);
2316 	    test_ret++;
2317             printf(" %d", n_cur);
2318             printf(" %d", n_encoding);
2319             printf("\n");
2320         }
2321     }
2322     }
2323     function_tests++;
2324 #endif
2325 
2326     return(test_ret);
2327 }
2328 
2329 
2330 static int
test_htmlParseDocument(void)2331 test_htmlParseDocument(void) {
2332     int test_ret = 0;
2333 
2334 #if defined(LIBXML_HTML_ENABLED)
2335     int mem_base;
2336     int ret_val;
2337     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2338     int n_ctxt;
2339 
2340     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2341         mem_base = xmlMemBlocks();
2342         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2343 
2344         ret_val = htmlParseDocument(ctxt);
2345         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2346         desret_int(ret_val);
2347         call_tests++;
2348         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2349         xmlResetLastError();
2350         if (mem_base != xmlMemBlocks()) {
2351             printf("Leak of %d blocks found in htmlParseDocument",
2352 	           xmlMemBlocks() - mem_base);
2353 	    test_ret++;
2354             printf(" %d", n_ctxt);
2355             printf("\n");
2356         }
2357     }
2358     function_tests++;
2359 #endif
2360 
2361     return(test_ret);
2362 }
2363 
2364 
2365 static int
test_htmlParseElement(void)2366 test_htmlParseElement(void) {
2367     int test_ret = 0;
2368 
2369 #if defined(LIBXML_HTML_ENABLED)
2370     int mem_base;
2371     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2372     int n_ctxt;
2373 
2374     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2375         mem_base = xmlMemBlocks();
2376         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2377 
2378         htmlParseElement(ctxt);
2379         call_tests++;
2380         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2381         xmlResetLastError();
2382         if (mem_base != xmlMemBlocks()) {
2383             printf("Leak of %d blocks found in htmlParseElement",
2384 	           xmlMemBlocks() - mem_base);
2385 	    test_ret++;
2386             printf(" %d", n_ctxt);
2387             printf("\n");
2388         }
2389     }
2390     function_tests++;
2391 #endif
2392 
2393     return(test_ret);
2394 }
2395 
2396 
2397 static int
test_htmlParseEntityRef(void)2398 test_htmlParseEntityRef(void) {
2399     int test_ret = 0;
2400 
2401 #if defined(LIBXML_HTML_ENABLED)
2402     int mem_base;
2403     const htmlEntityDesc * ret_val;
2404     htmlParserCtxtPtr ctxt; /* an HTML parser context */
2405     int n_ctxt;
2406     xmlChar ** str; /* location to store the entity name */
2407     int n_str;
2408 
2409     for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2410     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2411         mem_base = xmlMemBlocks();
2412         ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2413         str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2414 
2415         ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2416         desret_const_htmlEntityDesc_ptr(ret_val);
2417         call_tests++;
2418         des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2419         des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2420         xmlResetLastError();
2421         if (mem_base != xmlMemBlocks()) {
2422             printf("Leak of %d blocks found in htmlParseEntityRef",
2423 	           xmlMemBlocks() - mem_base);
2424 	    test_ret++;
2425             printf(" %d", n_ctxt);
2426             printf(" %d", n_str);
2427             printf("\n");
2428         }
2429     }
2430     }
2431     function_tests++;
2432 #endif
2433 
2434     return(test_ret);
2435 }
2436 
2437 
2438 static int
test_htmlParseFile(void)2439 test_htmlParseFile(void) {
2440     int test_ret = 0;
2441 
2442 #if defined(LIBXML_HTML_ENABLED)
2443     htmlDocPtr ret_val;
2444     const char * filename; /* the filename */
2445     int n_filename;
2446     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2447     int n_encoding;
2448 
2449     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2450     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2451         filename = gen_filepath(n_filename, 0);
2452         encoding = gen_const_char_ptr(n_encoding, 1);
2453 
2454         ret_val = htmlParseFile(filename, (const char *)encoding);
2455         desret_htmlDocPtr(ret_val);
2456         call_tests++;
2457         des_filepath(n_filename, filename, 0);
2458         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2459         xmlResetLastError();
2460     }
2461     }
2462     function_tests++;
2463 #endif
2464 
2465     return(test_ret);
2466 }
2467 
2468 
2469 static int
test_htmlReadDoc(void)2470 test_htmlReadDoc(void) {
2471     int test_ret = 0;
2472 
2473 #if defined(LIBXML_HTML_ENABLED)
2474     int mem_base;
2475     htmlDocPtr ret_val;
2476     xmlChar * cur; /* a pointer to a zero terminated string */
2477     int n_cur;
2478     const char * URL; /* the base URL to use for the document */
2479     int n_URL;
2480     char * encoding; /* the document encoding, or NULL */
2481     int n_encoding;
2482     int options; /* a combination of htmlParserOption(s) */
2483     int n_options;
2484 
2485     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2486     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2487     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2488     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2489         mem_base = xmlMemBlocks();
2490         cur = gen_const_xmlChar_ptr(n_cur, 0);
2491         URL = gen_filepath(n_URL, 1);
2492         encoding = gen_const_char_ptr(n_encoding, 2);
2493         options = gen_int(n_options, 3);
2494 
2495         ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2496         desret_htmlDocPtr(ret_val);
2497         call_tests++;
2498         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2499         des_filepath(n_URL, URL, 1);
2500         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2501         des_int(n_options, options, 3);
2502         xmlResetLastError();
2503         if (mem_base != xmlMemBlocks()) {
2504             printf("Leak of %d blocks found in htmlReadDoc",
2505 	           xmlMemBlocks() - mem_base);
2506 	    test_ret++;
2507             printf(" %d", n_cur);
2508             printf(" %d", n_URL);
2509             printf(" %d", n_encoding);
2510             printf(" %d", n_options);
2511             printf("\n");
2512         }
2513     }
2514     }
2515     }
2516     }
2517     function_tests++;
2518 #endif
2519 
2520     return(test_ret);
2521 }
2522 
2523 
2524 static int
test_htmlReadFile(void)2525 test_htmlReadFile(void) {
2526     int test_ret = 0;
2527 
2528 #if defined(LIBXML_HTML_ENABLED)
2529     int mem_base;
2530     htmlDocPtr ret_val;
2531     const char * filename; /* a file or URL */
2532     int n_filename;
2533     char * encoding; /* the document encoding, or NULL */
2534     int n_encoding;
2535     int options; /* a combination of htmlParserOption(s) */
2536     int n_options;
2537 
2538     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2539     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2540     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2541         mem_base = xmlMemBlocks();
2542         filename = gen_filepath(n_filename, 0);
2543         encoding = gen_const_char_ptr(n_encoding, 1);
2544         options = gen_int(n_options, 2);
2545 
2546         ret_val = htmlReadFile(filename, (const char *)encoding, options);
2547         desret_htmlDocPtr(ret_val);
2548         call_tests++;
2549         des_filepath(n_filename, filename, 0);
2550         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2551         des_int(n_options, options, 2);
2552         xmlResetLastError();
2553         if (mem_base != xmlMemBlocks()) {
2554             printf("Leak of %d blocks found in htmlReadFile",
2555 	           xmlMemBlocks() - mem_base);
2556 	    test_ret++;
2557             printf(" %d", n_filename);
2558             printf(" %d", n_encoding);
2559             printf(" %d", n_options);
2560             printf("\n");
2561         }
2562     }
2563     }
2564     }
2565     function_tests++;
2566 #endif
2567 
2568     return(test_ret);
2569 }
2570 
2571 
2572 static int
test_htmlReadMemory(void)2573 test_htmlReadMemory(void) {
2574     int test_ret = 0;
2575 
2576 #if defined(LIBXML_HTML_ENABLED)
2577     int mem_base;
2578     htmlDocPtr ret_val;
2579     char * buffer; /* a pointer to a char array */
2580     int n_buffer;
2581     int size; /* the size of the array */
2582     int n_size;
2583     const char * URL; /* the base URL to use for the document */
2584     int n_URL;
2585     char * encoding; /* the document encoding, or NULL */
2586     int n_encoding;
2587     int options; /* a combination of htmlParserOption(s) */
2588     int n_options;
2589 
2590     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2591     for (n_size = 0;n_size < gen_nb_int;n_size++) {
2592     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2593     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2594     for (n_options = 0;n_options < gen_nb_int;n_options++) {
2595         mem_base = xmlMemBlocks();
2596         buffer = gen_const_char_ptr(n_buffer, 0);
2597         size = gen_int(n_size, 1);
2598         URL = gen_filepath(n_URL, 2);
2599         encoding = gen_const_char_ptr(n_encoding, 3);
2600         options = gen_int(n_options, 4);
2601 
2602         ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2603         desret_htmlDocPtr(ret_val);
2604         call_tests++;
2605         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2606         des_int(n_size, size, 1);
2607         des_filepath(n_URL, URL, 2);
2608         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2609         des_int(n_options, options, 4);
2610         xmlResetLastError();
2611         if (mem_base != xmlMemBlocks()) {
2612             printf("Leak of %d blocks found in htmlReadMemory",
2613 	           xmlMemBlocks() - mem_base);
2614 	    test_ret++;
2615             printf(" %d", n_buffer);
2616             printf(" %d", n_size);
2617             printf(" %d", n_URL);
2618             printf(" %d", n_encoding);
2619             printf(" %d", n_options);
2620             printf("\n");
2621         }
2622     }
2623     }
2624     }
2625     }
2626     }
2627     function_tests++;
2628 #endif
2629 
2630     return(test_ret);
2631 }
2632 
2633 
2634 static int
test_htmlSAXParseDoc(void)2635 test_htmlSAXParseDoc(void) {
2636     int test_ret = 0;
2637 
2638 #if defined(LIBXML_HTML_ENABLED)
2639     int mem_base;
2640     htmlDocPtr ret_val;
2641     xmlChar * cur; /* a pointer to an array of xmlChar */
2642     int n_cur;
2643     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2644     int n_encoding;
2645     htmlSAXHandlerPtr sax; /* the SAX handler block */
2646     int n_sax;
2647     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2648     int n_userData;
2649 
2650     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2651     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2652     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2653     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2654         mem_base = xmlMemBlocks();
2655         cur = gen_xmlChar_ptr(n_cur, 0);
2656         encoding = gen_const_char_ptr(n_encoding, 1);
2657         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2658         userData = gen_userdata(n_userData, 3);
2659 
2660         ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2661         desret_htmlDocPtr(ret_val);
2662         call_tests++;
2663         des_xmlChar_ptr(n_cur, cur, 0);
2664         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2665         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2666         des_userdata(n_userData, userData, 3);
2667         xmlResetLastError();
2668         if (mem_base != xmlMemBlocks()) {
2669             printf("Leak of %d blocks found in htmlSAXParseDoc",
2670 	           xmlMemBlocks() - mem_base);
2671 	    test_ret++;
2672             printf(" %d", n_cur);
2673             printf(" %d", n_encoding);
2674             printf(" %d", n_sax);
2675             printf(" %d", n_userData);
2676             printf("\n");
2677         }
2678     }
2679     }
2680     }
2681     }
2682     function_tests++;
2683 #endif
2684 
2685     return(test_ret);
2686 }
2687 
2688 
2689 static int
test_htmlSAXParseFile(void)2690 test_htmlSAXParseFile(void) {
2691     int test_ret = 0;
2692 
2693 #if defined(LIBXML_HTML_ENABLED)
2694     int mem_base;
2695     htmlDocPtr ret_val;
2696     const char * filename; /* the filename */
2697     int n_filename;
2698     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2699     int n_encoding;
2700     htmlSAXHandlerPtr sax; /* the SAX handler block */
2701     int n_sax;
2702     void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2703     int n_userData;
2704 
2705     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2706     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2707     for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2708     for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2709         mem_base = xmlMemBlocks();
2710         filename = gen_filepath(n_filename, 0);
2711         encoding = gen_const_char_ptr(n_encoding, 1);
2712         sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2713         userData = gen_userdata(n_userData, 3);
2714 
2715         ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2716         desret_htmlDocPtr(ret_val);
2717         call_tests++;
2718         des_filepath(n_filename, filename, 0);
2719         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2720         des_htmlSAXHandlerPtr(n_sax, sax, 2);
2721         des_userdata(n_userData, userData, 3);
2722         xmlResetLastError();
2723         if (mem_base != xmlMemBlocks()) {
2724             printf("Leak of %d blocks found in htmlSAXParseFile",
2725 	           xmlMemBlocks() - mem_base);
2726 	    test_ret++;
2727             printf(" %d", n_filename);
2728             printf(" %d", n_encoding);
2729             printf(" %d", n_sax);
2730             printf(" %d", n_userData);
2731             printf("\n");
2732         }
2733     }
2734     }
2735     }
2736     }
2737     function_tests++;
2738 #endif
2739 
2740     return(test_ret);
2741 }
2742 
2743 
2744 static int
test_htmlTagLookup(void)2745 test_htmlTagLookup(void) {
2746     int test_ret = 0;
2747 
2748 
2749     /* missing type support */
2750     return(test_ret);
2751 }
2752 
2753 static int
test_HTMLparser(void)2754 test_HTMLparser(void) {
2755     int test_ret = 0;
2756 
2757     if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2758     test_ret += test_UTF8ToHtml();
2759     test_ret += test_htmlAttrAllowed();
2760     test_ret += test_htmlAutoCloseTag();
2761     test_ret += test_htmlCreateMemoryParserCtxt();
2762     test_ret += test_htmlCreatePushParserCtxt();
2763     test_ret += test_htmlCtxtReadDoc();
2764     test_ret += test_htmlCtxtReadFile();
2765     test_ret += test_htmlCtxtReadMemory();
2766     test_ret += test_htmlCtxtReset();
2767     test_ret += test_htmlCtxtUseOptions();
2768     test_ret += test_htmlElementAllowedHere();
2769     test_ret += test_htmlElementStatusHere();
2770     test_ret += test_htmlEncodeEntities();
2771     test_ret += test_htmlEntityLookup();
2772     test_ret += test_htmlEntityValueLookup();
2773     test_ret += test_htmlHandleOmittedElem();
2774     test_ret += test_htmlIsAutoClosed();
2775     test_ret += test_htmlIsScriptAttribute();
2776     test_ret += test_htmlNewParserCtxt();
2777     test_ret += test_htmlNodeStatus();
2778     test_ret += test_htmlParseCharRef();
2779     test_ret += test_htmlParseChunk();
2780     test_ret += test_htmlParseDoc();
2781     test_ret += test_htmlParseDocument();
2782     test_ret += test_htmlParseElement();
2783     test_ret += test_htmlParseEntityRef();
2784     test_ret += test_htmlParseFile();
2785     test_ret += test_htmlReadDoc();
2786     test_ret += test_htmlReadFile();
2787     test_ret += test_htmlReadMemory();
2788     test_ret += test_htmlSAXParseDoc();
2789     test_ret += test_htmlSAXParseFile();
2790     test_ret += test_htmlTagLookup();
2791 
2792     if (test_ret != 0)
2793 	printf("Module HTMLparser: %d errors\n", test_ret);
2794     return(test_ret);
2795 }
2796 
2797 static int
test_htmlDocContentDumpFormatOutput(void)2798 test_htmlDocContentDumpFormatOutput(void) {
2799     int test_ret = 0;
2800 
2801 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2802     int mem_base;
2803     xmlOutputBufferPtr buf; /* the HTML buffer output */
2804     int n_buf;
2805     xmlDocPtr cur; /* the document */
2806     int n_cur;
2807     char * encoding; /* the encoding string */
2808     int n_encoding;
2809     int format; /* should formatting spaces been added */
2810     int n_format;
2811 
2812     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2813     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2814     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2815     for (n_format = 0;n_format < gen_nb_int;n_format++) {
2816         mem_base = xmlMemBlocks();
2817         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2818         cur = gen_xmlDocPtr(n_cur, 1);
2819         encoding = gen_const_char_ptr(n_encoding, 2);
2820         format = gen_int(n_format, 3);
2821 
2822         htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2823         call_tests++;
2824         des_xmlOutputBufferPtr(n_buf, buf, 0);
2825         des_xmlDocPtr(n_cur, cur, 1);
2826         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2827         des_int(n_format, format, 3);
2828         xmlResetLastError();
2829         if (mem_base != xmlMemBlocks()) {
2830             printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2831 	           xmlMemBlocks() - mem_base);
2832 	    test_ret++;
2833             printf(" %d", n_buf);
2834             printf(" %d", n_cur);
2835             printf(" %d", n_encoding);
2836             printf(" %d", n_format);
2837             printf("\n");
2838         }
2839     }
2840     }
2841     }
2842     }
2843     function_tests++;
2844 #endif
2845 
2846     return(test_ret);
2847 }
2848 
2849 
2850 static int
test_htmlDocContentDumpOutput(void)2851 test_htmlDocContentDumpOutput(void) {
2852     int test_ret = 0;
2853 
2854 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2855     int mem_base;
2856     xmlOutputBufferPtr buf; /* the HTML buffer output */
2857     int n_buf;
2858     xmlDocPtr cur; /* the document */
2859     int n_cur;
2860     char * encoding; /* the encoding string */
2861     int n_encoding;
2862 
2863     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2864     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2865     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2866         mem_base = xmlMemBlocks();
2867         buf = gen_xmlOutputBufferPtr(n_buf, 0);
2868         cur = gen_xmlDocPtr(n_cur, 1);
2869         encoding = gen_const_char_ptr(n_encoding, 2);
2870 
2871         htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2872         call_tests++;
2873         des_xmlOutputBufferPtr(n_buf, buf, 0);
2874         des_xmlDocPtr(n_cur, cur, 1);
2875         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2876         xmlResetLastError();
2877         if (mem_base != xmlMemBlocks()) {
2878             printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2879 	           xmlMemBlocks() - mem_base);
2880 	    test_ret++;
2881             printf(" %d", n_buf);
2882             printf(" %d", n_cur);
2883             printf(" %d", n_encoding);
2884             printf("\n");
2885         }
2886     }
2887     }
2888     }
2889     function_tests++;
2890 #endif
2891 
2892     return(test_ret);
2893 }
2894 
2895 
2896 static int
test_htmlDocDump(void)2897 test_htmlDocDump(void) {
2898     int test_ret = 0;
2899 
2900 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2901     int mem_base;
2902     int ret_val;
2903     FILE * f; /* the FILE* */
2904     int n_f;
2905     xmlDocPtr cur; /* the document */
2906     int n_cur;
2907 
2908     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2909     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2910         mem_base = xmlMemBlocks();
2911         f = gen_FILE_ptr(n_f, 0);
2912         cur = gen_xmlDocPtr(n_cur, 1);
2913 
2914         ret_val = htmlDocDump(f, cur);
2915         desret_int(ret_val);
2916         call_tests++;
2917         des_FILE_ptr(n_f, f, 0);
2918         des_xmlDocPtr(n_cur, cur, 1);
2919         xmlResetLastError();
2920         if (mem_base != xmlMemBlocks()) {
2921             printf("Leak of %d blocks found in htmlDocDump",
2922 	           xmlMemBlocks() - mem_base);
2923 	    test_ret++;
2924             printf(" %d", n_f);
2925             printf(" %d", n_cur);
2926             printf("\n");
2927         }
2928     }
2929     }
2930     function_tests++;
2931 #endif
2932 
2933     return(test_ret);
2934 }
2935 
2936 
2937 #define gen_nb_xmlChar_ptr_ptr 1
gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)2938 static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2939     return(NULL);
2940 }
des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED,xmlChar ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)2941 static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2942 }
2943 
2944 static int
test_htmlDocDumpMemory(void)2945 test_htmlDocDumpMemory(void) {
2946     int test_ret = 0;
2947 
2948 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2949     int mem_base;
2950     xmlDocPtr cur; /* the document */
2951     int n_cur;
2952     xmlChar ** mem; /* OUT: the memory pointer */
2953     int n_mem;
2954     int * size; /* OUT: the memory length */
2955     int n_size;
2956 
2957     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2958     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2959     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2960         mem_base = xmlMemBlocks();
2961         cur = gen_xmlDocPtr(n_cur, 0);
2962         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2963         size = gen_int_ptr(n_size, 2);
2964 
2965         htmlDocDumpMemory(cur, mem, size);
2966         call_tests++;
2967         des_xmlDocPtr(n_cur, cur, 0);
2968         des_xmlChar_ptr_ptr(n_mem, mem, 1);
2969         des_int_ptr(n_size, size, 2);
2970         xmlResetLastError();
2971         if (mem_base != xmlMemBlocks()) {
2972             printf("Leak of %d blocks found in htmlDocDumpMemory",
2973 	           xmlMemBlocks() - mem_base);
2974 	    test_ret++;
2975             printf(" %d", n_cur);
2976             printf(" %d", n_mem);
2977             printf(" %d", n_size);
2978             printf("\n");
2979         }
2980     }
2981     }
2982     }
2983     function_tests++;
2984 #endif
2985 
2986     return(test_ret);
2987 }
2988 
2989 
2990 static int
test_htmlDocDumpMemoryFormat(void)2991 test_htmlDocDumpMemoryFormat(void) {
2992     int test_ret = 0;
2993 
2994 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2995     int mem_base;
2996     xmlDocPtr cur; /* the document */
2997     int n_cur;
2998     xmlChar ** mem; /* OUT: the memory pointer */
2999     int n_mem;
3000     int * size; /* OUT: the memory length */
3001     int n_size;
3002     int format; /* should formatting spaces been added */
3003     int n_format;
3004 
3005     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3006     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3007     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3008     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3009         mem_base = xmlMemBlocks();
3010         cur = gen_xmlDocPtr(n_cur, 0);
3011         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3012         size = gen_int_ptr(n_size, 2);
3013         format = gen_int(n_format, 3);
3014 
3015         htmlDocDumpMemoryFormat(cur, mem, size, format);
3016         call_tests++;
3017         des_xmlDocPtr(n_cur, cur, 0);
3018         des_xmlChar_ptr_ptr(n_mem, mem, 1);
3019         des_int_ptr(n_size, size, 2);
3020         des_int(n_format, format, 3);
3021         xmlResetLastError();
3022         if (mem_base != xmlMemBlocks()) {
3023             printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3024 	           xmlMemBlocks() - mem_base);
3025 	    test_ret++;
3026             printf(" %d", n_cur);
3027             printf(" %d", n_mem);
3028             printf(" %d", n_size);
3029             printf(" %d", n_format);
3030             printf("\n");
3031         }
3032     }
3033     }
3034     }
3035     }
3036     function_tests++;
3037 #endif
3038 
3039     return(test_ret);
3040 }
3041 
3042 
3043 static int
test_htmlGetMetaEncoding(void)3044 test_htmlGetMetaEncoding(void) {
3045     int test_ret = 0;
3046 
3047 #if defined(LIBXML_HTML_ENABLED)
3048     int mem_base;
3049     const xmlChar * ret_val;
3050     htmlDocPtr doc; /* the document */
3051     int n_doc;
3052 
3053     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3054         mem_base = xmlMemBlocks();
3055         doc = gen_htmlDocPtr(n_doc, 0);
3056 
3057         ret_val = htmlGetMetaEncoding(doc);
3058         desret_const_xmlChar_ptr(ret_val);
3059         call_tests++;
3060         des_htmlDocPtr(n_doc, doc, 0);
3061         xmlResetLastError();
3062         if (mem_base != xmlMemBlocks()) {
3063             printf("Leak of %d blocks found in htmlGetMetaEncoding",
3064 	           xmlMemBlocks() - mem_base);
3065 	    test_ret++;
3066             printf(" %d", n_doc);
3067             printf("\n");
3068         }
3069     }
3070     function_tests++;
3071 #endif
3072 
3073     return(test_ret);
3074 }
3075 
3076 
3077 static int
test_htmlIsBooleanAttr(void)3078 test_htmlIsBooleanAttr(void) {
3079     int test_ret = 0;
3080 
3081 #if defined(LIBXML_HTML_ENABLED)
3082     int mem_base;
3083     int ret_val;
3084     xmlChar * name; /* the name of the attribute to check */
3085     int n_name;
3086 
3087     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3088         mem_base = xmlMemBlocks();
3089         name = gen_const_xmlChar_ptr(n_name, 0);
3090 
3091         ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3092         desret_int(ret_val);
3093         call_tests++;
3094         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3095         xmlResetLastError();
3096         if (mem_base != xmlMemBlocks()) {
3097             printf("Leak of %d blocks found in htmlIsBooleanAttr",
3098 	           xmlMemBlocks() - mem_base);
3099 	    test_ret++;
3100             printf(" %d", n_name);
3101             printf("\n");
3102         }
3103     }
3104     function_tests++;
3105 #endif
3106 
3107     return(test_ret);
3108 }
3109 
3110 
3111 static int
test_htmlNewDoc(void)3112 test_htmlNewDoc(void) {
3113     int test_ret = 0;
3114 
3115 #if defined(LIBXML_HTML_ENABLED)
3116     int mem_base;
3117     htmlDocPtr ret_val;
3118     xmlChar * URI; /* URI for the dtd, or NULL */
3119     int n_URI;
3120     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3121     int n_ExternalID;
3122 
3123     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3124     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3125         mem_base = xmlMemBlocks();
3126         URI = gen_const_xmlChar_ptr(n_URI, 0);
3127         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3128 
3129         ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3130         desret_htmlDocPtr(ret_val);
3131         call_tests++;
3132         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3133         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3134         xmlResetLastError();
3135         if (mem_base != xmlMemBlocks()) {
3136             printf("Leak of %d blocks found in htmlNewDoc",
3137 	           xmlMemBlocks() - mem_base);
3138 	    test_ret++;
3139             printf(" %d", n_URI);
3140             printf(" %d", n_ExternalID);
3141             printf("\n");
3142         }
3143     }
3144     }
3145     function_tests++;
3146 #endif
3147 
3148     return(test_ret);
3149 }
3150 
3151 
3152 static int
test_htmlNewDocNoDtD(void)3153 test_htmlNewDocNoDtD(void) {
3154     int test_ret = 0;
3155 
3156 #if defined(LIBXML_HTML_ENABLED)
3157     int mem_base;
3158     htmlDocPtr ret_val;
3159     xmlChar * URI; /* URI for the dtd, or NULL */
3160     int n_URI;
3161     xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3162     int n_ExternalID;
3163 
3164     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3165     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3166         mem_base = xmlMemBlocks();
3167         URI = gen_const_xmlChar_ptr(n_URI, 0);
3168         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3169 
3170         ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3171         desret_htmlDocPtr(ret_val);
3172         call_tests++;
3173         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3174         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3175         xmlResetLastError();
3176         if (mem_base != xmlMemBlocks()) {
3177             printf("Leak of %d blocks found in htmlNewDocNoDtD",
3178 	           xmlMemBlocks() - mem_base);
3179 	    test_ret++;
3180             printf(" %d", n_URI);
3181             printf(" %d", n_ExternalID);
3182             printf("\n");
3183         }
3184     }
3185     }
3186     function_tests++;
3187 #endif
3188 
3189     return(test_ret);
3190 }
3191 
3192 
3193 static int
test_htmlNodeDump(void)3194 test_htmlNodeDump(void) {
3195     int test_ret = 0;
3196 
3197 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3198     int mem_base;
3199     int ret_val;
3200     xmlBufferPtr buf; /* the HTML buffer output */
3201     int n_buf;
3202     xmlDocPtr doc; /* the document */
3203     int n_doc;
3204     xmlNodePtr cur; /* the current node */
3205     int n_cur;
3206 
3207     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3208     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3209     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3210         mem_base = xmlMemBlocks();
3211         buf = gen_xmlBufferPtr(n_buf, 0);
3212         doc = gen_xmlDocPtr(n_doc, 1);
3213         cur = gen_xmlNodePtr(n_cur, 2);
3214 
3215         ret_val = htmlNodeDump(buf, doc, cur);
3216         desret_int(ret_val);
3217         call_tests++;
3218         des_xmlBufferPtr(n_buf, buf, 0);
3219         des_xmlDocPtr(n_doc, doc, 1);
3220         des_xmlNodePtr(n_cur, cur, 2);
3221         xmlResetLastError();
3222         if (mem_base != xmlMemBlocks()) {
3223             printf("Leak of %d blocks found in htmlNodeDump",
3224 	           xmlMemBlocks() - mem_base);
3225 	    test_ret++;
3226             printf(" %d", n_buf);
3227             printf(" %d", n_doc);
3228             printf(" %d", n_cur);
3229             printf("\n");
3230         }
3231     }
3232     }
3233     }
3234     function_tests++;
3235 #endif
3236 
3237     return(test_ret);
3238 }
3239 
3240 
3241 static int
test_htmlNodeDumpFile(void)3242 test_htmlNodeDumpFile(void) {
3243     int test_ret = 0;
3244 
3245 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3246     int mem_base;
3247     FILE * out; /* the FILE pointer */
3248     int n_out;
3249     xmlDocPtr doc; /* the document */
3250     int n_doc;
3251     xmlNodePtr cur; /* the current node */
3252     int n_cur;
3253 
3254     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3255     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3256     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3257         mem_base = xmlMemBlocks();
3258         out = gen_FILE_ptr(n_out, 0);
3259         doc = gen_xmlDocPtr(n_doc, 1);
3260         cur = gen_xmlNodePtr(n_cur, 2);
3261 
3262         htmlNodeDumpFile(out, doc, cur);
3263         call_tests++;
3264         des_FILE_ptr(n_out, out, 0);
3265         des_xmlDocPtr(n_doc, doc, 1);
3266         des_xmlNodePtr(n_cur, cur, 2);
3267         xmlResetLastError();
3268         if (mem_base != xmlMemBlocks()) {
3269             printf("Leak of %d blocks found in htmlNodeDumpFile",
3270 	           xmlMemBlocks() - mem_base);
3271 	    test_ret++;
3272             printf(" %d", n_out);
3273             printf(" %d", n_doc);
3274             printf(" %d", n_cur);
3275             printf("\n");
3276         }
3277     }
3278     }
3279     }
3280     function_tests++;
3281 #endif
3282 
3283     return(test_ret);
3284 }
3285 
3286 
3287 static int
test_htmlNodeDumpFileFormat(void)3288 test_htmlNodeDumpFileFormat(void) {
3289     int test_ret = 0;
3290 
3291 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3292     int mem_base;
3293     int ret_val;
3294     FILE * out; /* the FILE pointer */
3295     int n_out;
3296     xmlDocPtr doc; /* the document */
3297     int n_doc;
3298     xmlNodePtr cur; /* the current node */
3299     int n_cur;
3300     char * encoding; /* the document encoding */
3301     int n_encoding;
3302     int format; /* should formatting spaces been added */
3303     int n_format;
3304 
3305     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3306     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3307     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3308     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3309     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3310         mem_base = xmlMemBlocks();
3311         out = gen_FILE_ptr(n_out, 0);
3312         doc = gen_xmlDocPtr(n_doc, 1);
3313         cur = gen_xmlNodePtr(n_cur, 2);
3314         encoding = gen_const_char_ptr(n_encoding, 3);
3315         format = gen_int(n_format, 4);
3316 
3317         ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3318         desret_int(ret_val);
3319         call_tests++;
3320         des_FILE_ptr(n_out, out, 0);
3321         des_xmlDocPtr(n_doc, doc, 1);
3322         des_xmlNodePtr(n_cur, cur, 2);
3323         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3324         des_int(n_format, format, 4);
3325         xmlResetLastError();
3326         if (mem_base != xmlMemBlocks()) {
3327             printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3328 	           xmlMemBlocks() - mem_base);
3329 	    test_ret++;
3330             printf(" %d", n_out);
3331             printf(" %d", n_doc);
3332             printf(" %d", n_cur);
3333             printf(" %d", n_encoding);
3334             printf(" %d", n_format);
3335             printf("\n");
3336         }
3337     }
3338     }
3339     }
3340     }
3341     }
3342     function_tests++;
3343 #endif
3344 
3345     return(test_ret);
3346 }
3347 
3348 
3349 static int
test_htmlNodeDumpFormatOutput(void)3350 test_htmlNodeDumpFormatOutput(void) {
3351     int test_ret = 0;
3352 
3353 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3354     int mem_base;
3355     xmlOutputBufferPtr buf; /* the HTML buffer output */
3356     int n_buf;
3357     xmlDocPtr doc; /* the document */
3358     int n_doc;
3359     xmlNodePtr cur; /* the current node */
3360     int n_cur;
3361     char * encoding; /* the encoding string */
3362     int n_encoding;
3363     int format; /* should formatting spaces been added */
3364     int n_format;
3365 
3366     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3367     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3368     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3369     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3370     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3371         mem_base = xmlMemBlocks();
3372         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3373         doc = gen_xmlDocPtr(n_doc, 1);
3374         cur = gen_xmlNodePtr(n_cur, 2);
3375         encoding = gen_const_char_ptr(n_encoding, 3);
3376         format = gen_int(n_format, 4);
3377 
3378         htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3379         call_tests++;
3380         des_xmlOutputBufferPtr(n_buf, buf, 0);
3381         des_xmlDocPtr(n_doc, doc, 1);
3382         des_xmlNodePtr(n_cur, cur, 2);
3383         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3384         des_int(n_format, format, 4);
3385         xmlResetLastError();
3386         if (mem_base != xmlMemBlocks()) {
3387             printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3388 	           xmlMemBlocks() - mem_base);
3389 	    test_ret++;
3390             printf(" %d", n_buf);
3391             printf(" %d", n_doc);
3392             printf(" %d", n_cur);
3393             printf(" %d", n_encoding);
3394             printf(" %d", n_format);
3395             printf("\n");
3396         }
3397     }
3398     }
3399     }
3400     }
3401     }
3402     function_tests++;
3403 #endif
3404 
3405     return(test_ret);
3406 }
3407 
3408 
3409 static int
test_htmlNodeDumpOutput(void)3410 test_htmlNodeDumpOutput(void) {
3411     int test_ret = 0;
3412 
3413 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3414     int mem_base;
3415     xmlOutputBufferPtr buf; /* the HTML buffer output */
3416     int n_buf;
3417     xmlDocPtr doc; /* the document */
3418     int n_doc;
3419     xmlNodePtr cur; /* the current node */
3420     int n_cur;
3421     char * encoding; /* the encoding string */
3422     int n_encoding;
3423 
3424     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3425     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3426     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3427     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3428         mem_base = xmlMemBlocks();
3429         buf = gen_xmlOutputBufferPtr(n_buf, 0);
3430         doc = gen_xmlDocPtr(n_doc, 1);
3431         cur = gen_xmlNodePtr(n_cur, 2);
3432         encoding = gen_const_char_ptr(n_encoding, 3);
3433 
3434         htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3435         call_tests++;
3436         des_xmlOutputBufferPtr(n_buf, buf, 0);
3437         des_xmlDocPtr(n_doc, doc, 1);
3438         des_xmlNodePtr(n_cur, cur, 2);
3439         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3440         xmlResetLastError();
3441         if (mem_base != xmlMemBlocks()) {
3442             printf("Leak of %d blocks found in htmlNodeDumpOutput",
3443 	           xmlMemBlocks() - mem_base);
3444 	    test_ret++;
3445             printf(" %d", n_buf);
3446             printf(" %d", n_doc);
3447             printf(" %d", n_cur);
3448             printf(" %d", n_encoding);
3449             printf("\n");
3450         }
3451     }
3452     }
3453     }
3454     }
3455     function_tests++;
3456 #endif
3457 
3458     return(test_ret);
3459 }
3460 
3461 
3462 static int
test_htmlSaveFile(void)3463 test_htmlSaveFile(void) {
3464     int test_ret = 0;
3465 
3466 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3467     int mem_base;
3468     int ret_val;
3469     const char * filename; /* the filename (or URL) */
3470     int n_filename;
3471     xmlDocPtr cur; /* the document */
3472     int n_cur;
3473 
3474     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3475     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3476         mem_base = xmlMemBlocks();
3477         filename = gen_fileoutput(n_filename, 0);
3478         cur = gen_xmlDocPtr(n_cur, 1);
3479 
3480         ret_val = htmlSaveFile(filename, cur);
3481         desret_int(ret_val);
3482         call_tests++;
3483         des_fileoutput(n_filename, filename, 0);
3484         des_xmlDocPtr(n_cur, cur, 1);
3485         xmlResetLastError();
3486         if (mem_base != xmlMemBlocks()) {
3487             printf("Leak of %d blocks found in htmlSaveFile",
3488 	           xmlMemBlocks() - mem_base);
3489 	    test_ret++;
3490             printf(" %d", n_filename);
3491             printf(" %d", n_cur);
3492             printf("\n");
3493         }
3494     }
3495     }
3496     function_tests++;
3497 #endif
3498 
3499     return(test_ret);
3500 }
3501 
3502 
3503 static int
test_htmlSaveFileEnc(void)3504 test_htmlSaveFileEnc(void) {
3505     int test_ret = 0;
3506 
3507 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3508     int mem_base;
3509     int ret_val;
3510     const char * filename; /* the filename */
3511     int n_filename;
3512     xmlDocPtr cur; /* the document */
3513     int n_cur;
3514     char * encoding; /* the document encoding */
3515     int n_encoding;
3516 
3517     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3518     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3519     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3520         mem_base = xmlMemBlocks();
3521         filename = gen_fileoutput(n_filename, 0);
3522         cur = gen_xmlDocPtr(n_cur, 1);
3523         encoding = gen_const_char_ptr(n_encoding, 2);
3524 
3525         ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3526         desret_int(ret_val);
3527         call_tests++;
3528         des_fileoutput(n_filename, filename, 0);
3529         des_xmlDocPtr(n_cur, cur, 1);
3530         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3531         xmlResetLastError();
3532         if (mem_base != xmlMemBlocks()) {
3533             printf("Leak of %d blocks found in htmlSaveFileEnc",
3534 	           xmlMemBlocks() - mem_base);
3535 	    test_ret++;
3536             printf(" %d", n_filename);
3537             printf(" %d", n_cur);
3538             printf(" %d", n_encoding);
3539             printf("\n");
3540         }
3541     }
3542     }
3543     }
3544     function_tests++;
3545 #endif
3546 
3547     return(test_ret);
3548 }
3549 
3550 
3551 static int
test_htmlSaveFileFormat(void)3552 test_htmlSaveFileFormat(void) {
3553     int test_ret = 0;
3554 
3555 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3556     int mem_base;
3557     int ret_val;
3558     const char * filename; /* the filename */
3559     int n_filename;
3560     xmlDocPtr cur; /* the document */
3561     int n_cur;
3562     char * encoding; /* the document encoding */
3563     int n_encoding;
3564     int format; /* should formatting spaces been added */
3565     int n_format;
3566 
3567     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3568     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3569     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3570     for (n_format = 0;n_format < gen_nb_int;n_format++) {
3571         mem_base = xmlMemBlocks();
3572         filename = gen_fileoutput(n_filename, 0);
3573         cur = gen_xmlDocPtr(n_cur, 1);
3574         encoding = gen_const_char_ptr(n_encoding, 2);
3575         format = gen_int(n_format, 3);
3576 
3577         ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3578         desret_int(ret_val);
3579         call_tests++;
3580         des_fileoutput(n_filename, filename, 0);
3581         des_xmlDocPtr(n_cur, cur, 1);
3582         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3583         des_int(n_format, format, 3);
3584         xmlResetLastError();
3585         if (mem_base != xmlMemBlocks()) {
3586             printf("Leak of %d blocks found in htmlSaveFileFormat",
3587 	           xmlMemBlocks() - mem_base);
3588 	    test_ret++;
3589             printf(" %d", n_filename);
3590             printf(" %d", n_cur);
3591             printf(" %d", n_encoding);
3592             printf(" %d", n_format);
3593             printf("\n");
3594         }
3595     }
3596     }
3597     }
3598     }
3599     function_tests++;
3600 #endif
3601 
3602     return(test_ret);
3603 }
3604 
3605 
3606 static int
test_htmlSetMetaEncoding(void)3607 test_htmlSetMetaEncoding(void) {
3608     int test_ret = 0;
3609 
3610 #if defined(LIBXML_HTML_ENABLED)
3611     int mem_base;
3612     int ret_val;
3613     htmlDocPtr doc; /* the document */
3614     int n_doc;
3615     xmlChar * encoding; /* the encoding string */
3616     int n_encoding;
3617 
3618     for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3619     for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3620         mem_base = xmlMemBlocks();
3621         doc = gen_htmlDocPtr(n_doc, 0);
3622         encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3623 
3624         ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3625         desret_int(ret_val);
3626         call_tests++;
3627         des_htmlDocPtr(n_doc, doc, 0);
3628         des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3629         xmlResetLastError();
3630         if (mem_base != xmlMemBlocks()) {
3631             printf("Leak of %d blocks found in htmlSetMetaEncoding",
3632 	           xmlMemBlocks() - mem_base);
3633 	    test_ret++;
3634             printf(" %d", n_doc);
3635             printf(" %d", n_encoding);
3636             printf("\n");
3637         }
3638     }
3639     }
3640     function_tests++;
3641 #endif
3642 
3643     return(test_ret);
3644 }
3645 
3646 static int
test_HTMLtree(void)3647 test_HTMLtree(void) {
3648     int test_ret = 0;
3649 
3650     if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3651     test_ret += test_htmlDocContentDumpFormatOutput();
3652     test_ret += test_htmlDocContentDumpOutput();
3653     test_ret += test_htmlDocDump();
3654     test_ret += test_htmlDocDumpMemory();
3655     test_ret += test_htmlDocDumpMemoryFormat();
3656     test_ret += test_htmlGetMetaEncoding();
3657     test_ret += test_htmlIsBooleanAttr();
3658     test_ret += test_htmlNewDoc();
3659     test_ret += test_htmlNewDocNoDtD();
3660     test_ret += test_htmlNodeDump();
3661     test_ret += test_htmlNodeDumpFile();
3662     test_ret += test_htmlNodeDumpFileFormat();
3663     test_ret += test_htmlNodeDumpFormatOutput();
3664     test_ret += test_htmlNodeDumpOutput();
3665     test_ret += test_htmlSaveFile();
3666     test_ret += test_htmlSaveFileEnc();
3667     test_ret += test_htmlSaveFileFormat();
3668     test_ret += test_htmlSetMetaEncoding();
3669 
3670     if (test_ret != 0)
3671 	printf("Module HTMLtree: %d errors\n", test_ret);
3672     return(test_ret);
3673 }
3674 
3675 static int
test_docbDefaultSAXHandlerInit(void)3676 test_docbDefaultSAXHandlerInit(void) {
3677     int test_ret = 0;
3678 
3679 #if defined(LIBXML_DOCB_ENABLED)
3680 #ifdef LIBXML_DOCB_ENABLED
3681     int mem_base;
3682 
3683         mem_base = xmlMemBlocks();
3684 
3685         docbDefaultSAXHandlerInit();
3686         call_tests++;
3687         xmlResetLastError();
3688         if (mem_base != xmlMemBlocks()) {
3689             printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3690 	           xmlMemBlocks() - mem_base);
3691 	    test_ret++;
3692             printf("\n");
3693         }
3694     function_tests++;
3695 #endif
3696 #endif
3697 
3698     return(test_ret);
3699 }
3700 
3701 
3702 static int
test_htmlDefaultSAXHandlerInit(void)3703 test_htmlDefaultSAXHandlerInit(void) {
3704     int test_ret = 0;
3705 
3706 #if defined(LIBXML_HTML_ENABLED)
3707 #ifdef LIBXML_HTML_ENABLED
3708     int mem_base;
3709 
3710         mem_base = xmlMemBlocks();
3711 
3712         htmlDefaultSAXHandlerInit();
3713         call_tests++;
3714         xmlResetLastError();
3715         if (mem_base != xmlMemBlocks()) {
3716             printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3717 	           xmlMemBlocks() - mem_base);
3718 	    test_ret++;
3719             printf("\n");
3720         }
3721     function_tests++;
3722 #endif
3723 #endif
3724 
3725     return(test_ret);
3726 }
3727 
3728 
3729 static int
test_xmlDefaultSAXHandlerInit(void)3730 test_xmlDefaultSAXHandlerInit(void) {
3731     int test_ret = 0;
3732 
3733     int mem_base;
3734 
3735         mem_base = xmlMemBlocks();
3736 
3737         xmlDefaultSAXHandlerInit();
3738         call_tests++;
3739         xmlResetLastError();
3740         if (mem_base != xmlMemBlocks()) {
3741             printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3742 	           xmlMemBlocks() - mem_base);
3743 	    test_ret++;
3744             printf("\n");
3745         }
3746     function_tests++;
3747 
3748     return(test_ret);
3749 }
3750 
3751 
3752 #define gen_nb_xmlEnumerationPtr 1
gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)3753 static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3754     return(NULL);
3755 }
des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED,xmlEnumerationPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)3756 static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3757 }
3758 
3759 static int
test_xmlSAX2AttributeDecl(void)3760 test_xmlSAX2AttributeDecl(void) {
3761     int test_ret = 0;
3762 
3763     int mem_base;
3764     void * ctx; /* the user data (XML parser context) */
3765     int n_ctx;
3766     xmlChar * elem; /* the name of the element */
3767     int n_elem;
3768     xmlChar * fullname; /* the attribute name */
3769     int n_fullname;
3770     int type; /* the attribute type */
3771     int n_type;
3772     int def; /* the type of default value */
3773     int n_def;
3774     xmlChar * defaultValue; /* the attribute default value */
3775     int n_defaultValue;
3776     xmlEnumerationPtr tree; /* the tree of enumerated value set */
3777     int n_tree;
3778 
3779     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3780     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3781     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3782     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3783     for (n_def = 0;n_def < gen_nb_int;n_def++) {
3784     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3785     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3786         mem_base = xmlMemBlocks();
3787         ctx = gen_void_ptr(n_ctx, 0);
3788         elem = gen_const_xmlChar_ptr(n_elem, 1);
3789         fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3790         type = gen_int(n_type, 3);
3791         def = gen_int(n_def, 4);
3792         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3793         tree = gen_xmlEnumerationPtr(n_tree, 6);
3794 
3795         xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3796         call_tests++;
3797         des_void_ptr(n_ctx, ctx, 0);
3798         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3799         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3800         des_int(n_type, type, 3);
3801         des_int(n_def, def, 4);
3802         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3803         des_xmlEnumerationPtr(n_tree, tree, 6);
3804         xmlResetLastError();
3805         if (mem_base != xmlMemBlocks()) {
3806             printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3807 	           xmlMemBlocks() - mem_base);
3808 	    test_ret++;
3809             printf(" %d", n_ctx);
3810             printf(" %d", n_elem);
3811             printf(" %d", n_fullname);
3812             printf(" %d", n_type);
3813             printf(" %d", n_def);
3814             printf(" %d", n_defaultValue);
3815             printf(" %d", n_tree);
3816             printf("\n");
3817         }
3818     }
3819     }
3820     }
3821     }
3822     }
3823     }
3824     }
3825     function_tests++;
3826 
3827     return(test_ret);
3828 }
3829 
3830 
3831 static int
test_xmlSAX2CDataBlock(void)3832 test_xmlSAX2CDataBlock(void) {
3833     int test_ret = 0;
3834 
3835     int mem_base;
3836     void * ctx; /* the user data (XML parser context) */
3837     int n_ctx;
3838     xmlChar * value; /* The pcdata content */
3839     int n_value;
3840     int len; /* the block length */
3841     int n_len;
3842 
3843     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3844     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3845     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3846         mem_base = xmlMemBlocks();
3847         ctx = gen_void_ptr(n_ctx, 0);
3848         value = gen_const_xmlChar_ptr(n_value, 1);
3849         len = gen_int(n_len, 2);
3850 
3851         xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3852         call_tests++;
3853         des_void_ptr(n_ctx, ctx, 0);
3854         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3855         des_int(n_len, len, 2);
3856         xmlResetLastError();
3857         if (mem_base != xmlMemBlocks()) {
3858             printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3859 	           xmlMemBlocks() - mem_base);
3860 	    test_ret++;
3861             printf(" %d", n_ctx);
3862             printf(" %d", n_value);
3863             printf(" %d", n_len);
3864             printf("\n");
3865         }
3866     }
3867     }
3868     }
3869     function_tests++;
3870 
3871     return(test_ret);
3872 }
3873 
3874 
3875 static int
test_xmlSAX2Characters(void)3876 test_xmlSAX2Characters(void) {
3877     int test_ret = 0;
3878 
3879     int mem_base;
3880     void * ctx; /* the user data (XML parser context) */
3881     int n_ctx;
3882     xmlChar * ch; /* a xmlChar string */
3883     int n_ch;
3884     int len; /* the number of xmlChar */
3885     int n_len;
3886 
3887     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3888     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3889     for (n_len = 0;n_len < gen_nb_int;n_len++) {
3890         mem_base = xmlMemBlocks();
3891         ctx = gen_void_ptr(n_ctx, 0);
3892         ch = gen_const_xmlChar_ptr(n_ch, 1);
3893         len = gen_int(n_len, 2);
3894 
3895         xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3896         call_tests++;
3897         des_void_ptr(n_ctx, ctx, 0);
3898         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3899         des_int(n_len, len, 2);
3900         xmlResetLastError();
3901         if (mem_base != xmlMemBlocks()) {
3902             printf("Leak of %d blocks found in xmlSAX2Characters",
3903 	           xmlMemBlocks() - mem_base);
3904 	    test_ret++;
3905             printf(" %d", n_ctx);
3906             printf(" %d", n_ch);
3907             printf(" %d", n_len);
3908             printf("\n");
3909         }
3910     }
3911     }
3912     }
3913     function_tests++;
3914 
3915     return(test_ret);
3916 }
3917 
3918 
3919 static int
test_xmlSAX2Comment(void)3920 test_xmlSAX2Comment(void) {
3921     int test_ret = 0;
3922 
3923     int mem_base;
3924     void * ctx; /* the user data (XML parser context) */
3925     int n_ctx;
3926     xmlChar * value; /* the xmlSAX2Comment content */
3927     int n_value;
3928 
3929     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3930     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3931         mem_base = xmlMemBlocks();
3932         ctx = gen_void_ptr(n_ctx, 0);
3933         value = gen_const_xmlChar_ptr(n_value, 1);
3934 
3935         xmlSAX2Comment(ctx, (const xmlChar *)value);
3936         call_tests++;
3937         des_void_ptr(n_ctx, ctx, 0);
3938         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3939         xmlResetLastError();
3940         if (mem_base != xmlMemBlocks()) {
3941             printf("Leak of %d blocks found in xmlSAX2Comment",
3942 	           xmlMemBlocks() - mem_base);
3943 	    test_ret++;
3944             printf(" %d", n_ctx);
3945             printf(" %d", n_value);
3946             printf("\n");
3947         }
3948     }
3949     }
3950     function_tests++;
3951 
3952     return(test_ret);
3953 }
3954 
3955 
3956 static int
test_xmlSAX2ElementDecl(void)3957 test_xmlSAX2ElementDecl(void) {
3958     int test_ret = 0;
3959 
3960     int mem_base;
3961     void * ctx; /* the user data (XML parser context) */
3962     int n_ctx;
3963     xmlChar * name; /* the element name */
3964     int n_name;
3965     int type; /* the element type */
3966     int n_type;
3967     xmlElementContentPtr content; /* the element value tree */
3968     int n_content;
3969 
3970     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3971     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3972     for (n_type = 0;n_type < gen_nb_int;n_type++) {
3973     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3974         mem_base = xmlMemBlocks();
3975         ctx = gen_void_ptr(n_ctx, 0);
3976         name = gen_const_xmlChar_ptr(n_name, 1);
3977         type = gen_int(n_type, 2);
3978         content = gen_xmlElementContentPtr(n_content, 3);
3979 
3980         xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3981         call_tests++;
3982         des_void_ptr(n_ctx, ctx, 0);
3983         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
3984         des_int(n_type, type, 2);
3985         des_xmlElementContentPtr(n_content, content, 3);
3986         xmlResetLastError();
3987         if (mem_base != xmlMemBlocks()) {
3988             printf("Leak of %d blocks found in xmlSAX2ElementDecl",
3989 	           xmlMemBlocks() - mem_base);
3990 	    test_ret++;
3991             printf(" %d", n_ctx);
3992             printf(" %d", n_name);
3993             printf(" %d", n_type);
3994             printf(" %d", n_content);
3995             printf("\n");
3996         }
3997     }
3998     }
3999     }
4000     }
4001     function_tests++;
4002 
4003     return(test_ret);
4004 }
4005 
4006 
4007 static int
test_xmlSAX2EndDocument(void)4008 test_xmlSAX2EndDocument(void) {
4009     int test_ret = 0;
4010 
4011     int mem_base;
4012     void * ctx; /* the user data (XML parser context) */
4013     int n_ctx;
4014 
4015     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4016         mem_base = xmlMemBlocks();
4017         ctx = gen_void_ptr(n_ctx, 0);
4018 
4019         xmlSAX2EndDocument(ctx);
4020         call_tests++;
4021         des_void_ptr(n_ctx, ctx, 0);
4022         xmlResetLastError();
4023         if (mem_base != xmlMemBlocks()) {
4024             printf("Leak of %d blocks found in xmlSAX2EndDocument",
4025 	           xmlMemBlocks() - mem_base);
4026 	    test_ret++;
4027             printf(" %d", n_ctx);
4028             printf("\n");
4029         }
4030     }
4031     function_tests++;
4032 
4033     return(test_ret);
4034 }
4035 
4036 
4037 static int
test_xmlSAX2EndElement(void)4038 test_xmlSAX2EndElement(void) {
4039     int test_ret = 0;
4040 
4041 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4042 #ifdef LIBXML_SAX1_ENABLED
4043     int mem_base;
4044     void * ctx; /* the user data (XML parser context) */
4045     int n_ctx;
4046     xmlChar * name; /* The element name */
4047     int n_name;
4048 
4049     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4050     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4051         mem_base = xmlMemBlocks();
4052         ctx = gen_void_ptr(n_ctx, 0);
4053         name = gen_const_xmlChar_ptr(n_name, 1);
4054 
4055         xmlSAX2EndElement(ctx, (const xmlChar *)name);
4056         call_tests++;
4057         des_void_ptr(n_ctx, ctx, 0);
4058         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4059         xmlResetLastError();
4060         if (mem_base != xmlMemBlocks()) {
4061             printf("Leak of %d blocks found in xmlSAX2EndElement",
4062 	           xmlMemBlocks() - mem_base);
4063 	    test_ret++;
4064             printf(" %d", n_ctx);
4065             printf(" %d", n_name);
4066             printf("\n");
4067         }
4068     }
4069     }
4070     function_tests++;
4071 #endif
4072 #endif
4073 
4074     return(test_ret);
4075 }
4076 
4077 
4078 static int
test_xmlSAX2EndElementNs(void)4079 test_xmlSAX2EndElementNs(void) {
4080     int test_ret = 0;
4081 
4082     int mem_base;
4083     void * ctx; /* the user data (XML parser context) */
4084     int n_ctx;
4085     xmlChar * localname; /* the local name of the element */
4086     int n_localname;
4087     xmlChar * prefix; /* the element namespace prefix if available */
4088     int n_prefix;
4089     xmlChar * URI; /* the element namespace name if available */
4090     int n_URI;
4091 
4092     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4093     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4094     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4095     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4096         mem_base = xmlMemBlocks();
4097         ctx = gen_void_ptr(n_ctx, 0);
4098         localname = gen_const_xmlChar_ptr(n_localname, 1);
4099         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4100         URI = gen_const_xmlChar_ptr(n_URI, 3);
4101 
4102         xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4103         call_tests++;
4104         des_void_ptr(n_ctx, ctx, 0);
4105         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4106         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4107         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4108         xmlResetLastError();
4109         if (mem_base != xmlMemBlocks()) {
4110             printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4111 	           xmlMemBlocks() - mem_base);
4112 	    test_ret++;
4113             printf(" %d", n_ctx);
4114             printf(" %d", n_localname);
4115             printf(" %d", n_prefix);
4116             printf(" %d", n_URI);
4117             printf("\n");
4118         }
4119     }
4120     }
4121     }
4122     }
4123     function_tests++;
4124 
4125     return(test_ret);
4126 }
4127 
4128 
4129 static int
test_xmlSAX2EntityDecl(void)4130 test_xmlSAX2EntityDecl(void) {
4131     int test_ret = 0;
4132 
4133     int mem_base;
4134     void * ctx; /* the user data (XML parser context) */
4135     int n_ctx;
4136     xmlChar * name; /* the entity name */
4137     int n_name;
4138     int type; /* the entity type */
4139     int n_type;
4140     xmlChar * publicId; /* The public ID of the entity */
4141     int n_publicId;
4142     xmlChar * systemId; /* The system ID of the entity */
4143     int n_systemId;
4144     xmlChar * content; /* the entity value (without processing). */
4145     int n_content;
4146 
4147     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4148     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4149     for (n_type = 0;n_type < gen_nb_int;n_type++) {
4150     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4151     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4152     for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4153         mem_base = xmlMemBlocks();
4154         ctx = gen_void_ptr(n_ctx, 0);
4155         name = gen_const_xmlChar_ptr(n_name, 1);
4156         type = gen_int(n_type, 2);
4157         publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4158         systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4159         content = gen_xmlChar_ptr(n_content, 5);
4160 
4161         xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4162         call_tests++;
4163         des_void_ptr(n_ctx, ctx, 0);
4164         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4165         des_int(n_type, type, 2);
4166         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4167         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4168         des_xmlChar_ptr(n_content, content, 5);
4169         xmlResetLastError();
4170         if (mem_base != xmlMemBlocks()) {
4171             printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4172 	           xmlMemBlocks() - mem_base);
4173 	    test_ret++;
4174             printf(" %d", n_ctx);
4175             printf(" %d", n_name);
4176             printf(" %d", n_type);
4177             printf(" %d", n_publicId);
4178             printf(" %d", n_systemId);
4179             printf(" %d", n_content);
4180             printf("\n");
4181         }
4182     }
4183     }
4184     }
4185     }
4186     }
4187     }
4188     function_tests++;
4189 
4190     return(test_ret);
4191 }
4192 
4193 
4194 static int
test_xmlSAX2ExternalSubset(void)4195 test_xmlSAX2ExternalSubset(void) {
4196     int test_ret = 0;
4197 
4198     int mem_base;
4199     void * ctx; /* the user data (XML parser context) */
4200     int n_ctx;
4201     xmlChar * name; /* the root element name */
4202     int n_name;
4203     xmlChar * ExternalID; /* the external ID */
4204     int n_ExternalID;
4205     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4206     int n_SystemID;
4207 
4208     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4209     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4210     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4211     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4212         mem_base = xmlMemBlocks();
4213         ctx = gen_void_ptr(n_ctx, 0);
4214         name = gen_const_xmlChar_ptr(n_name, 1);
4215         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4216         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4217 
4218         xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4219         call_tests++;
4220         des_void_ptr(n_ctx, ctx, 0);
4221         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4222         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4223         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4224         xmlResetLastError();
4225         if (mem_base != xmlMemBlocks()) {
4226             printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4227 	           xmlMemBlocks() - mem_base);
4228 	    test_ret++;
4229             printf(" %d", n_ctx);
4230             printf(" %d", n_name);
4231             printf(" %d", n_ExternalID);
4232             printf(" %d", n_SystemID);
4233             printf("\n");
4234         }
4235     }
4236     }
4237     }
4238     }
4239     function_tests++;
4240 
4241     return(test_ret);
4242 }
4243 
4244 
4245 static int
test_xmlSAX2GetColumnNumber(void)4246 test_xmlSAX2GetColumnNumber(void) {
4247     int test_ret = 0;
4248 
4249     int mem_base;
4250     int ret_val;
4251     void * ctx; /* the user data (XML parser context) */
4252     int n_ctx;
4253 
4254     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4255         mem_base = xmlMemBlocks();
4256         ctx = gen_void_ptr(n_ctx, 0);
4257 
4258         ret_val = xmlSAX2GetColumnNumber(ctx);
4259         desret_int(ret_val);
4260         call_tests++;
4261         des_void_ptr(n_ctx, ctx, 0);
4262         xmlResetLastError();
4263         if (mem_base != xmlMemBlocks()) {
4264             printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4265 	           xmlMemBlocks() - mem_base);
4266 	    test_ret++;
4267             printf(" %d", n_ctx);
4268             printf("\n");
4269         }
4270     }
4271     function_tests++;
4272 
4273     return(test_ret);
4274 }
4275 
4276 
4277 static int
test_xmlSAX2GetEntity(void)4278 test_xmlSAX2GetEntity(void) {
4279     int test_ret = 0;
4280 
4281     int mem_base;
4282     xmlEntityPtr ret_val;
4283     void * ctx; /* the user data (XML parser context) */
4284     int n_ctx;
4285     xmlChar * name; /* The entity name */
4286     int n_name;
4287 
4288     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4289     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4290         mem_base = xmlMemBlocks();
4291         ctx = gen_void_ptr(n_ctx, 0);
4292         name = gen_const_xmlChar_ptr(n_name, 1);
4293 
4294         ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4295         desret_xmlEntityPtr(ret_val);
4296         call_tests++;
4297         des_void_ptr(n_ctx, ctx, 0);
4298         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4299         xmlResetLastError();
4300         if (mem_base != xmlMemBlocks()) {
4301             printf("Leak of %d blocks found in xmlSAX2GetEntity",
4302 	           xmlMemBlocks() - mem_base);
4303 	    test_ret++;
4304             printf(" %d", n_ctx);
4305             printf(" %d", n_name);
4306             printf("\n");
4307         }
4308     }
4309     }
4310     function_tests++;
4311 
4312     return(test_ret);
4313 }
4314 
4315 
4316 static int
test_xmlSAX2GetLineNumber(void)4317 test_xmlSAX2GetLineNumber(void) {
4318     int test_ret = 0;
4319 
4320     int mem_base;
4321     int ret_val;
4322     void * ctx; /* the user data (XML parser context) */
4323     int n_ctx;
4324 
4325     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4326         mem_base = xmlMemBlocks();
4327         ctx = gen_void_ptr(n_ctx, 0);
4328 
4329         ret_val = xmlSAX2GetLineNumber(ctx);
4330         desret_int(ret_val);
4331         call_tests++;
4332         des_void_ptr(n_ctx, ctx, 0);
4333         xmlResetLastError();
4334         if (mem_base != xmlMemBlocks()) {
4335             printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4336 	           xmlMemBlocks() - mem_base);
4337 	    test_ret++;
4338             printf(" %d", n_ctx);
4339             printf("\n");
4340         }
4341     }
4342     function_tests++;
4343 
4344     return(test_ret);
4345 }
4346 
4347 
4348 static int
test_xmlSAX2GetParameterEntity(void)4349 test_xmlSAX2GetParameterEntity(void) {
4350     int test_ret = 0;
4351 
4352     int mem_base;
4353     xmlEntityPtr ret_val;
4354     void * ctx; /* the user data (XML parser context) */
4355     int n_ctx;
4356     xmlChar * name; /* The entity name */
4357     int n_name;
4358 
4359     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4360     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4361         mem_base = xmlMemBlocks();
4362         ctx = gen_void_ptr(n_ctx, 0);
4363         name = gen_const_xmlChar_ptr(n_name, 1);
4364 
4365         ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4366         desret_xmlEntityPtr(ret_val);
4367         call_tests++;
4368         des_void_ptr(n_ctx, ctx, 0);
4369         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4370         xmlResetLastError();
4371         if (mem_base != xmlMemBlocks()) {
4372             printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4373 	           xmlMemBlocks() - mem_base);
4374 	    test_ret++;
4375             printf(" %d", n_ctx);
4376             printf(" %d", n_name);
4377             printf("\n");
4378         }
4379     }
4380     }
4381     function_tests++;
4382 
4383     return(test_ret);
4384 }
4385 
4386 
4387 static int
test_xmlSAX2GetPublicId(void)4388 test_xmlSAX2GetPublicId(void) {
4389     int test_ret = 0;
4390 
4391     int mem_base;
4392     const xmlChar * ret_val;
4393     void * ctx; /* the user data (XML parser context) */
4394     int n_ctx;
4395 
4396     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4397         mem_base = xmlMemBlocks();
4398         ctx = gen_void_ptr(n_ctx, 0);
4399 
4400         ret_val = xmlSAX2GetPublicId(ctx);
4401         desret_const_xmlChar_ptr(ret_val);
4402         call_tests++;
4403         des_void_ptr(n_ctx, ctx, 0);
4404         xmlResetLastError();
4405         if (mem_base != xmlMemBlocks()) {
4406             printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4407 	           xmlMemBlocks() - mem_base);
4408 	    test_ret++;
4409             printf(" %d", n_ctx);
4410             printf("\n");
4411         }
4412     }
4413     function_tests++;
4414 
4415     return(test_ret);
4416 }
4417 
4418 
4419 static int
test_xmlSAX2GetSystemId(void)4420 test_xmlSAX2GetSystemId(void) {
4421     int test_ret = 0;
4422 
4423     int mem_base;
4424     const xmlChar * ret_val;
4425     void * ctx; /* the user data (XML parser context) */
4426     int n_ctx;
4427 
4428     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4429         mem_base = xmlMemBlocks();
4430         ctx = gen_void_ptr(n_ctx, 0);
4431 
4432         ret_val = xmlSAX2GetSystemId(ctx);
4433         desret_const_xmlChar_ptr(ret_val);
4434         call_tests++;
4435         des_void_ptr(n_ctx, ctx, 0);
4436         xmlResetLastError();
4437         if (mem_base != xmlMemBlocks()) {
4438             printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4439 	           xmlMemBlocks() - mem_base);
4440 	    test_ret++;
4441             printf(" %d", n_ctx);
4442             printf("\n");
4443         }
4444     }
4445     function_tests++;
4446 
4447     return(test_ret);
4448 }
4449 
4450 
4451 static int
test_xmlSAX2HasExternalSubset(void)4452 test_xmlSAX2HasExternalSubset(void) {
4453     int test_ret = 0;
4454 
4455     int mem_base;
4456     int ret_val;
4457     void * ctx; /* the user data (XML parser context) */
4458     int n_ctx;
4459 
4460     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4461         mem_base = xmlMemBlocks();
4462         ctx = gen_void_ptr(n_ctx, 0);
4463 
4464         ret_val = xmlSAX2HasExternalSubset(ctx);
4465         desret_int(ret_val);
4466         call_tests++;
4467         des_void_ptr(n_ctx, ctx, 0);
4468         xmlResetLastError();
4469         if (mem_base != xmlMemBlocks()) {
4470             printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4471 	           xmlMemBlocks() - mem_base);
4472 	    test_ret++;
4473             printf(" %d", n_ctx);
4474             printf("\n");
4475         }
4476     }
4477     function_tests++;
4478 
4479     return(test_ret);
4480 }
4481 
4482 
4483 static int
test_xmlSAX2HasInternalSubset(void)4484 test_xmlSAX2HasInternalSubset(void) {
4485     int test_ret = 0;
4486 
4487     int mem_base;
4488     int ret_val;
4489     void * ctx; /* the user data (XML parser context) */
4490     int n_ctx;
4491 
4492     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4493         mem_base = xmlMemBlocks();
4494         ctx = gen_void_ptr(n_ctx, 0);
4495 
4496         ret_val = xmlSAX2HasInternalSubset(ctx);
4497         desret_int(ret_val);
4498         call_tests++;
4499         des_void_ptr(n_ctx, ctx, 0);
4500         xmlResetLastError();
4501         if (mem_base != xmlMemBlocks()) {
4502             printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4503 	           xmlMemBlocks() - mem_base);
4504 	    test_ret++;
4505             printf(" %d", n_ctx);
4506             printf("\n");
4507         }
4508     }
4509     function_tests++;
4510 
4511     return(test_ret);
4512 }
4513 
4514 
4515 static int
test_xmlSAX2IgnorableWhitespace(void)4516 test_xmlSAX2IgnorableWhitespace(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 * ch; /* a xmlChar string */
4523     int n_ch;
4524     int len; /* the number of xmlChar */
4525     int n_len;
4526 
4527     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4528     for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4529     for (n_len = 0;n_len < gen_nb_int;n_len++) {
4530         mem_base = xmlMemBlocks();
4531         ctx = gen_void_ptr(n_ctx, 0);
4532         ch = gen_const_xmlChar_ptr(n_ch, 1);
4533         len = gen_int(n_len, 2);
4534 
4535         xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4536         call_tests++;
4537         des_void_ptr(n_ctx, ctx, 0);
4538         des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4539         des_int(n_len, len, 2);
4540         xmlResetLastError();
4541         if (mem_base != xmlMemBlocks()) {
4542             printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4543 	           xmlMemBlocks() - mem_base);
4544 	    test_ret++;
4545             printf(" %d", n_ctx);
4546             printf(" %d", n_ch);
4547             printf(" %d", n_len);
4548             printf("\n");
4549         }
4550     }
4551     }
4552     }
4553     function_tests++;
4554 
4555     return(test_ret);
4556 }
4557 
4558 
4559 #define gen_nb_xmlSAXHandler_ptr 1
gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4560 static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4561     return(NULL);
4562 }
des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED,xmlSAXHandler * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4563 static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4564 }
4565 
4566 static int
test_xmlSAX2InitDefaultSAXHandler(void)4567 test_xmlSAX2InitDefaultSAXHandler(void) {
4568     int test_ret = 0;
4569 
4570     int mem_base;
4571     xmlSAXHandler * hdlr; /* the SAX handler */
4572     int n_hdlr;
4573     int warning; /* flag if non-zero sets the handler warning procedure */
4574     int n_warning;
4575 
4576     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4577     for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4578         mem_base = xmlMemBlocks();
4579         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4580         warning = gen_int(n_warning, 1);
4581 
4582         xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4583         call_tests++;
4584         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4585         des_int(n_warning, warning, 1);
4586         xmlResetLastError();
4587         if (mem_base != xmlMemBlocks()) {
4588             printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4589 	           xmlMemBlocks() - mem_base);
4590 	    test_ret++;
4591             printf(" %d", n_hdlr);
4592             printf(" %d", n_warning);
4593             printf("\n");
4594         }
4595     }
4596     }
4597     function_tests++;
4598 
4599     return(test_ret);
4600 }
4601 
4602 
4603 static int
test_xmlSAX2InitDocbDefaultSAXHandler(void)4604 test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4605     int test_ret = 0;
4606 
4607 #if defined(LIBXML_DOCB_ENABLED)
4608     int mem_base;
4609     xmlSAXHandler * hdlr; /* the SAX handler */
4610     int n_hdlr;
4611 
4612     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4613         mem_base = xmlMemBlocks();
4614         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4615 
4616         xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4617         call_tests++;
4618         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4619         xmlResetLastError();
4620         if (mem_base != xmlMemBlocks()) {
4621             printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4622 	           xmlMemBlocks() - mem_base);
4623 	    test_ret++;
4624             printf(" %d", n_hdlr);
4625             printf("\n");
4626         }
4627     }
4628     function_tests++;
4629 #endif
4630 
4631     return(test_ret);
4632 }
4633 
4634 
4635 static int
test_xmlSAX2InitHtmlDefaultSAXHandler(void)4636 test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4637     int test_ret = 0;
4638 
4639 #if defined(LIBXML_HTML_ENABLED)
4640     int mem_base;
4641     xmlSAXHandler * hdlr; /* the SAX handler */
4642     int n_hdlr;
4643 
4644     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4645         mem_base = xmlMemBlocks();
4646         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4647 
4648         xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4649         call_tests++;
4650         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4651         xmlResetLastError();
4652         if (mem_base != xmlMemBlocks()) {
4653             printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4654 	           xmlMemBlocks() - mem_base);
4655 	    test_ret++;
4656             printf(" %d", n_hdlr);
4657             printf("\n");
4658         }
4659     }
4660     function_tests++;
4661 #endif
4662 
4663     return(test_ret);
4664 }
4665 
4666 
4667 static int
test_xmlSAX2InternalSubset(void)4668 test_xmlSAX2InternalSubset(void) {
4669     int test_ret = 0;
4670 
4671     int mem_base;
4672     void * ctx; /* the user data (XML parser context) */
4673     int n_ctx;
4674     xmlChar * name; /* the root element name */
4675     int n_name;
4676     xmlChar * ExternalID; /* the external ID */
4677     int n_ExternalID;
4678     xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4679     int n_SystemID;
4680 
4681     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4682     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4683     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4684     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4685         mem_base = xmlMemBlocks();
4686         ctx = gen_void_ptr(n_ctx, 0);
4687         name = gen_const_xmlChar_ptr(n_name, 1);
4688         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4689         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4690 
4691         xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4692         call_tests++;
4693         des_void_ptr(n_ctx, ctx, 0);
4694         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4695         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4696         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4697         xmlResetLastError();
4698         if (mem_base != xmlMemBlocks()) {
4699             printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4700 	           xmlMemBlocks() - mem_base);
4701 	    test_ret++;
4702             printf(" %d", n_ctx);
4703             printf(" %d", n_name);
4704             printf(" %d", n_ExternalID);
4705             printf(" %d", n_SystemID);
4706             printf("\n");
4707         }
4708     }
4709     }
4710     }
4711     }
4712     function_tests++;
4713 
4714     return(test_ret);
4715 }
4716 
4717 
4718 static int
test_xmlSAX2IsStandalone(void)4719 test_xmlSAX2IsStandalone(void) {
4720     int test_ret = 0;
4721 
4722     int mem_base;
4723     int ret_val;
4724     void * ctx; /* the user data (XML parser context) */
4725     int n_ctx;
4726 
4727     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4728         mem_base = xmlMemBlocks();
4729         ctx = gen_void_ptr(n_ctx, 0);
4730 
4731         ret_val = xmlSAX2IsStandalone(ctx);
4732         desret_int(ret_val);
4733         call_tests++;
4734         des_void_ptr(n_ctx, ctx, 0);
4735         xmlResetLastError();
4736         if (mem_base != xmlMemBlocks()) {
4737             printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4738 	           xmlMemBlocks() - mem_base);
4739 	    test_ret++;
4740             printf(" %d", n_ctx);
4741             printf("\n");
4742         }
4743     }
4744     function_tests++;
4745 
4746     return(test_ret);
4747 }
4748 
4749 
4750 static int
test_xmlSAX2NotationDecl(void)4751 test_xmlSAX2NotationDecl(void) {
4752     int test_ret = 0;
4753 
4754     int mem_base;
4755     void * ctx; /* the user data (XML parser context) */
4756     int n_ctx;
4757     xmlChar * name; /* The name of the notation */
4758     int n_name;
4759     xmlChar * publicId; /* The public ID of the entity */
4760     int n_publicId;
4761     xmlChar * systemId; /* The system ID of the entity */
4762     int n_systemId;
4763 
4764     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4765     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4766     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4767     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4768         mem_base = xmlMemBlocks();
4769         ctx = gen_void_ptr(n_ctx, 0);
4770         name = gen_const_xmlChar_ptr(n_name, 1);
4771         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4772         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4773 
4774         xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4775         call_tests++;
4776         des_void_ptr(n_ctx, ctx, 0);
4777         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4778         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4779         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4780         xmlResetLastError();
4781         if (mem_base != xmlMemBlocks()) {
4782             printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4783 	           xmlMemBlocks() - mem_base);
4784 	    test_ret++;
4785             printf(" %d", n_ctx);
4786             printf(" %d", n_name);
4787             printf(" %d", n_publicId);
4788             printf(" %d", n_systemId);
4789             printf("\n");
4790         }
4791     }
4792     }
4793     }
4794     }
4795     function_tests++;
4796 
4797     return(test_ret);
4798 }
4799 
4800 
4801 static int
test_xmlSAX2ProcessingInstruction(void)4802 test_xmlSAX2ProcessingInstruction(void) {
4803     int test_ret = 0;
4804 
4805     int mem_base;
4806     void * ctx; /* the user data (XML parser context) */
4807     int n_ctx;
4808     xmlChar * target; /* the target name */
4809     int n_target;
4810     xmlChar * data; /* the PI data's */
4811     int n_data;
4812 
4813     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4814     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4815     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4816         mem_base = xmlMemBlocks();
4817         ctx = gen_void_ptr(n_ctx, 0);
4818         target = gen_const_xmlChar_ptr(n_target, 1);
4819         data = gen_const_xmlChar_ptr(n_data, 2);
4820 
4821         xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4822         call_tests++;
4823         des_void_ptr(n_ctx, ctx, 0);
4824         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4825         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4826         xmlResetLastError();
4827         if (mem_base != xmlMemBlocks()) {
4828             printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4829 	           xmlMemBlocks() - mem_base);
4830 	    test_ret++;
4831             printf(" %d", n_ctx);
4832             printf(" %d", n_target);
4833             printf(" %d", n_data);
4834             printf("\n");
4835         }
4836     }
4837     }
4838     }
4839     function_tests++;
4840 
4841     return(test_ret);
4842 }
4843 
4844 
4845 static int
test_xmlSAX2Reference(void)4846 test_xmlSAX2Reference(void) {
4847     int test_ret = 0;
4848 
4849     int mem_base;
4850     void * ctx; /* the user data (XML parser context) */
4851     int n_ctx;
4852     xmlChar * name; /* The entity name */
4853     int n_name;
4854 
4855     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4856     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4857         mem_base = xmlMemBlocks();
4858         ctx = gen_void_ptr(n_ctx, 0);
4859         name = gen_const_xmlChar_ptr(n_name, 1);
4860 
4861         xmlSAX2Reference(ctx, (const xmlChar *)name);
4862         call_tests++;
4863         des_void_ptr(n_ctx, ctx, 0);
4864         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4865         xmlResetLastError();
4866         if (mem_base != xmlMemBlocks()) {
4867             printf("Leak of %d blocks found in xmlSAX2Reference",
4868 	           xmlMemBlocks() - mem_base);
4869 	    test_ret++;
4870             printf(" %d", n_ctx);
4871             printf(" %d", n_name);
4872             printf("\n");
4873         }
4874     }
4875     }
4876     function_tests++;
4877 
4878     return(test_ret);
4879 }
4880 
4881 
4882 static int
test_xmlSAX2ResolveEntity(void)4883 test_xmlSAX2ResolveEntity(void) {
4884     int test_ret = 0;
4885 
4886     int mem_base;
4887     xmlParserInputPtr ret_val;
4888     void * ctx; /* the user data (XML parser context) */
4889     int n_ctx;
4890     xmlChar * publicId; /* The public ID of the entity */
4891     int n_publicId;
4892     xmlChar * systemId; /* The system ID of the entity */
4893     int n_systemId;
4894 
4895     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4896     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4897     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4898         mem_base = xmlMemBlocks();
4899         ctx = gen_void_ptr(n_ctx, 0);
4900         publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4901         systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4902 
4903         ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4904         desret_xmlParserInputPtr(ret_val);
4905         call_tests++;
4906         des_void_ptr(n_ctx, ctx, 0);
4907         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4908         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4909         xmlResetLastError();
4910         if (mem_base != xmlMemBlocks()) {
4911             printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4912 	           xmlMemBlocks() - mem_base);
4913 	    test_ret++;
4914             printf(" %d", n_ctx);
4915             printf(" %d", n_publicId);
4916             printf(" %d", n_systemId);
4917             printf("\n");
4918         }
4919     }
4920     }
4921     }
4922     function_tests++;
4923 
4924     return(test_ret);
4925 }
4926 
4927 
4928 #define gen_nb_xmlSAXLocatorPtr 1
gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4929 static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4930     return(NULL);
4931 }
des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED,xmlSAXLocatorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)4932 static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4933 }
4934 
4935 static int
test_xmlSAX2SetDocumentLocator(void)4936 test_xmlSAX2SetDocumentLocator(void) {
4937     int test_ret = 0;
4938 
4939     int mem_base;
4940     void * ctx; /* the user data (XML parser context) */
4941     int n_ctx;
4942     xmlSAXLocatorPtr loc; /* A SAX Locator */
4943     int n_loc;
4944 
4945     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4946     for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4947         mem_base = xmlMemBlocks();
4948         ctx = gen_void_ptr(n_ctx, 0);
4949         loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4950 
4951         xmlSAX2SetDocumentLocator(ctx, loc);
4952         call_tests++;
4953         des_void_ptr(n_ctx, ctx, 0);
4954         des_xmlSAXLocatorPtr(n_loc, loc, 1);
4955         xmlResetLastError();
4956         if (mem_base != xmlMemBlocks()) {
4957             printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4958 	           xmlMemBlocks() - mem_base);
4959 	    test_ret++;
4960             printf(" %d", n_ctx);
4961             printf(" %d", n_loc);
4962             printf("\n");
4963         }
4964     }
4965     }
4966     function_tests++;
4967 
4968     return(test_ret);
4969 }
4970 
4971 
4972 static int
test_xmlSAX2StartDocument(void)4973 test_xmlSAX2StartDocument(void) {
4974     int test_ret = 0;
4975 
4976     int mem_base;
4977     void * ctx; /* the user data (XML parser context) */
4978     int n_ctx;
4979 
4980     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4981         mem_base = xmlMemBlocks();
4982         ctx = gen_void_ptr(n_ctx, 0);
4983 
4984         xmlSAX2StartDocument(ctx);
4985         call_tests++;
4986         des_void_ptr(n_ctx, ctx, 0);
4987         xmlResetLastError();
4988         if (mem_base != xmlMemBlocks()) {
4989             printf("Leak of %d blocks found in xmlSAX2StartDocument",
4990 	           xmlMemBlocks() - mem_base);
4991 	    test_ret++;
4992             printf(" %d", n_ctx);
4993             printf("\n");
4994         }
4995     }
4996     function_tests++;
4997 
4998     return(test_ret);
4999 }
5000 
5001 
5002 static int
test_xmlSAX2StartElement(void)5003 test_xmlSAX2StartElement(void) {
5004     int test_ret = 0;
5005 
5006 #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5007 #ifdef LIBXML_SAX1_ENABLED
5008     int mem_base;
5009     void * ctx; /* the user data (XML parser context) */
5010     int n_ctx;
5011     xmlChar * fullname; /* The element name, including namespace prefix */
5012     int n_fullname;
5013     xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5014     int n_atts;
5015 
5016     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5017     for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5018     for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5019         mem_base = xmlMemBlocks();
5020         ctx = gen_void_ptr(n_ctx, 0);
5021         fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5022         atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5023 
5024         xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5025         call_tests++;
5026         des_void_ptr(n_ctx, ctx, 0);
5027         des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5028         des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5029         xmlResetLastError();
5030         if (mem_base != xmlMemBlocks()) {
5031             printf("Leak of %d blocks found in xmlSAX2StartElement",
5032 	           xmlMemBlocks() - mem_base);
5033 	    test_ret++;
5034             printf(" %d", n_ctx);
5035             printf(" %d", n_fullname);
5036             printf(" %d", n_atts);
5037             printf("\n");
5038         }
5039     }
5040     }
5041     }
5042     function_tests++;
5043 #endif
5044 #endif
5045 
5046     return(test_ret);
5047 }
5048 
5049 
5050 static int
test_xmlSAX2StartElementNs(void)5051 test_xmlSAX2StartElementNs(void) {
5052     int test_ret = 0;
5053 
5054     int mem_base;
5055     void * ctx; /* the user data (XML parser context) */
5056     int n_ctx;
5057     xmlChar * localname; /* the local name of the element */
5058     int n_localname;
5059     xmlChar * prefix; /* the element namespace prefix if available */
5060     int n_prefix;
5061     xmlChar * URI; /* the element namespace name if available */
5062     int n_URI;
5063     int nb_namespaces; /* number of namespace definitions on that node */
5064     int n_nb_namespaces;
5065     xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5066     int n_namespaces;
5067     int nb_attributes; /* the number of attributes on that node */
5068     int n_nb_attributes;
5069     int nb_defaulted; /* the number of defaulted attributes. */
5070     int n_nb_defaulted;
5071     xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5072     int n_attributes;
5073 
5074     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5075     for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5076     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5077     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5078     for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5079     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5080     for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5081     for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5082     for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5083         mem_base = xmlMemBlocks();
5084         ctx = gen_void_ptr(n_ctx, 0);
5085         localname = gen_const_xmlChar_ptr(n_localname, 1);
5086         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5087         URI = gen_const_xmlChar_ptr(n_URI, 3);
5088         nb_namespaces = gen_int(n_nb_namespaces, 4);
5089         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5090         nb_attributes = gen_int(n_nb_attributes, 6);
5091         nb_defaulted = gen_int(n_nb_defaulted, 7);
5092         attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5093 
5094         xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5095         call_tests++;
5096         des_void_ptr(n_ctx, ctx, 0);
5097         des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5098         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5099         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5100         des_int(n_nb_namespaces, nb_namespaces, 4);
5101         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5102         des_int(n_nb_attributes, nb_attributes, 6);
5103         des_int(n_nb_defaulted, nb_defaulted, 7);
5104         des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5105         xmlResetLastError();
5106         if (mem_base != xmlMemBlocks()) {
5107             printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5108 	           xmlMemBlocks() - mem_base);
5109 	    test_ret++;
5110             printf(" %d", n_ctx);
5111             printf(" %d", n_localname);
5112             printf(" %d", n_prefix);
5113             printf(" %d", n_URI);
5114             printf(" %d", n_nb_namespaces);
5115             printf(" %d", n_namespaces);
5116             printf(" %d", n_nb_attributes);
5117             printf(" %d", n_nb_defaulted);
5118             printf(" %d", n_attributes);
5119             printf("\n");
5120         }
5121     }
5122     }
5123     }
5124     }
5125     }
5126     }
5127     }
5128     }
5129     }
5130     function_tests++;
5131 
5132     return(test_ret);
5133 }
5134 
5135 
5136 static int
test_xmlSAX2UnparsedEntityDecl(void)5137 test_xmlSAX2UnparsedEntityDecl(void) {
5138     int test_ret = 0;
5139 
5140     int mem_base;
5141     void * ctx; /* the user data (XML parser context) */
5142     int n_ctx;
5143     xmlChar * name; /* The name of the entity */
5144     int n_name;
5145     xmlChar * publicId; /* The public ID of the entity */
5146     int n_publicId;
5147     xmlChar * systemId; /* The system ID of the entity */
5148     int n_systemId;
5149     xmlChar * notationName; /* the name of the notation */
5150     int n_notationName;
5151 
5152     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5153     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5154     for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5155     for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5156     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5157         mem_base = xmlMemBlocks();
5158         ctx = gen_void_ptr(n_ctx, 0);
5159         name = gen_const_xmlChar_ptr(n_name, 1);
5160         publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5161         systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5162         notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5163 
5164         xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5165         call_tests++;
5166         des_void_ptr(n_ctx, ctx, 0);
5167         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5168         des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5169         des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5170         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5171         xmlResetLastError();
5172         if (mem_base != xmlMemBlocks()) {
5173             printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5174 	           xmlMemBlocks() - mem_base);
5175 	    test_ret++;
5176             printf(" %d", n_ctx);
5177             printf(" %d", n_name);
5178             printf(" %d", n_publicId);
5179             printf(" %d", n_systemId);
5180             printf(" %d", n_notationName);
5181             printf("\n");
5182         }
5183     }
5184     }
5185     }
5186     }
5187     }
5188     function_tests++;
5189 
5190     return(test_ret);
5191 }
5192 
5193 
5194 static int
test_xmlSAXDefaultVersion(void)5195 test_xmlSAXDefaultVersion(void) {
5196     int test_ret = 0;
5197 
5198 #if defined(LIBXML_SAX1_ENABLED)
5199 #ifdef LIBXML_SAX1_ENABLED
5200     int mem_base;
5201     int ret_val;
5202     int version; /* the version, 1 or 2 */
5203     int n_version;
5204 
5205     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5206         mem_base = xmlMemBlocks();
5207         version = gen_int(n_version, 0);
5208 
5209         ret_val = xmlSAXDefaultVersion(version);
5210         desret_int(ret_val);
5211         call_tests++;
5212         des_int(n_version, version, 0);
5213         xmlResetLastError();
5214         if (mem_base != xmlMemBlocks()) {
5215             printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5216 	           xmlMemBlocks() - mem_base);
5217 	    test_ret++;
5218             printf(" %d", n_version);
5219             printf("\n");
5220         }
5221     }
5222     function_tests++;
5223 #endif
5224 #endif
5225 
5226     return(test_ret);
5227 }
5228 
5229 
5230 static int
test_xmlSAXVersion(void)5231 test_xmlSAXVersion(void) {
5232     int test_ret = 0;
5233 
5234     int mem_base;
5235     int ret_val;
5236     xmlSAXHandler * hdlr; /* the SAX handler */
5237     int n_hdlr;
5238     int version; /* the version, 1 or 2 */
5239     int n_version;
5240 
5241     for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5242     for (n_version = 0;n_version < gen_nb_int;n_version++) {
5243         mem_base = xmlMemBlocks();
5244         hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5245         version = gen_int(n_version, 1);
5246 
5247         ret_val = xmlSAXVersion(hdlr, version);
5248         desret_int(ret_val);
5249         call_tests++;
5250         des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5251         des_int(n_version, version, 1);
5252         xmlResetLastError();
5253         if (mem_base != xmlMemBlocks()) {
5254             printf("Leak of %d blocks found in xmlSAXVersion",
5255 	           xmlMemBlocks() - mem_base);
5256 	    test_ret++;
5257             printf(" %d", n_hdlr);
5258             printf(" %d", n_version);
5259             printf("\n");
5260         }
5261     }
5262     }
5263     function_tests++;
5264 
5265     return(test_ret);
5266 }
5267 
5268 static int
test_SAX2(void)5269 test_SAX2(void) {
5270     int test_ret = 0;
5271 
5272     if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5273     test_ret += test_docbDefaultSAXHandlerInit();
5274     test_ret += test_htmlDefaultSAXHandlerInit();
5275     test_ret += test_xmlDefaultSAXHandlerInit();
5276     test_ret += test_xmlSAX2AttributeDecl();
5277     test_ret += test_xmlSAX2CDataBlock();
5278     test_ret += test_xmlSAX2Characters();
5279     test_ret += test_xmlSAX2Comment();
5280     test_ret += test_xmlSAX2ElementDecl();
5281     test_ret += test_xmlSAX2EndDocument();
5282     test_ret += test_xmlSAX2EndElement();
5283     test_ret += test_xmlSAX2EndElementNs();
5284     test_ret += test_xmlSAX2EntityDecl();
5285     test_ret += test_xmlSAX2ExternalSubset();
5286     test_ret += test_xmlSAX2GetColumnNumber();
5287     test_ret += test_xmlSAX2GetEntity();
5288     test_ret += test_xmlSAX2GetLineNumber();
5289     test_ret += test_xmlSAX2GetParameterEntity();
5290     test_ret += test_xmlSAX2GetPublicId();
5291     test_ret += test_xmlSAX2GetSystemId();
5292     test_ret += test_xmlSAX2HasExternalSubset();
5293     test_ret += test_xmlSAX2HasInternalSubset();
5294     test_ret += test_xmlSAX2IgnorableWhitespace();
5295     test_ret += test_xmlSAX2InitDefaultSAXHandler();
5296     test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5297     test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5298     test_ret += test_xmlSAX2InternalSubset();
5299     test_ret += test_xmlSAX2IsStandalone();
5300     test_ret += test_xmlSAX2NotationDecl();
5301     test_ret += test_xmlSAX2ProcessingInstruction();
5302     test_ret += test_xmlSAX2Reference();
5303     test_ret += test_xmlSAX2ResolveEntity();
5304     test_ret += test_xmlSAX2SetDocumentLocator();
5305     test_ret += test_xmlSAX2StartDocument();
5306     test_ret += test_xmlSAX2StartElement();
5307     test_ret += test_xmlSAX2StartElementNs();
5308     test_ret += test_xmlSAX2UnparsedEntityDecl();
5309     test_ret += test_xmlSAXDefaultVersion();
5310     test_ret += test_xmlSAXVersion();
5311 
5312     if (test_ret != 0)
5313 	printf("Module SAX2: %d errors\n", test_ret);
5314     return(test_ret);
5315 }
5316 
5317 static int
test_xmlC14NDocDumpMemory(void)5318 test_xmlC14NDocDumpMemory(void) {
5319     int test_ret = 0;
5320 
5321 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5322     int mem_base;
5323     int ret_val;
5324     xmlDocPtr doc; /* the XML document for canonization */
5325     int n_doc;
5326     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5327     int n_nodes;
5328     int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5329     int n_exclusive;
5330     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) */
5331     int n_inclusive_ns_prefixes;
5332     int with_comments; /* include comments in the result (!=0) or not (==0) */
5333     int n_with_comments;
5334     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 */
5335     int n_doc_txt_ptr;
5336 
5337     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5338     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5339     for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5340     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5341     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5342     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5343         mem_base = xmlMemBlocks();
5344         doc = gen_xmlDocPtr(n_doc, 0);
5345         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5346         exclusive = gen_int(n_exclusive, 2);
5347         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5348         with_comments = gen_int(n_with_comments, 4);
5349         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5350 
5351         ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5352         desret_int(ret_val);
5353         call_tests++;
5354         des_xmlDocPtr(n_doc, doc, 0);
5355         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5356         des_int(n_exclusive, exclusive, 2);
5357         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5358         des_int(n_with_comments, with_comments, 4);
5359         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5360         xmlResetLastError();
5361         if (mem_base != xmlMemBlocks()) {
5362             printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5363 	           xmlMemBlocks() - mem_base);
5364 	    test_ret++;
5365             printf(" %d", n_doc);
5366             printf(" %d", n_nodes);
5367             printf(" %d", n_exclusive);
5368             printf(" %d", n_inclusive_ns_prefixes);
5369             printf(" %d", n_with_comments);
5370             printf(" %d", n_doc_txt_ptr);
5371             printf("\n");
5372         }
5373     }
5374     }
5375     }
5376     }
5377     }
5378     }
5379     function_tests++;
5380 #endif
5381 
5382     return(test_ret);
5383 }
5384 
5385 
5386 static int
test_xmlC14NDocSave(void)5387 test_xmlC14NDocSave(void) {
5388     int test_ret = 0;
5389 
5390 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5391     int mem_base;
5392     int ret_val;
5393     xmlDocPtr doc; /* the XML document for canonization */
5394     int n_doc;
5395     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5396     int n_nodes;
5397     int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5398     int n_exclusive;
5399     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) */
5400     int n_inclusive_ns_prefixes;
5401     int with_comments; /* include comments in the result (!=0) or not (==0) */
5402     int n_with_comments;
5403     const char * filename; /* the filename to store canonical XML image */
5404     int n_filename;
5405     int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5406     int n_compression;
5407 
5408     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5409     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5410     for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5411     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5412     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5413     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5414     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5415         mem_base = xmlMemBlocks();
5416         doc = gen_xmlDocPtr(n_doc, 0);
5417         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5418         exclusive = gen_int(n_exclusive, 2);
5419         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5420         with_comments = gen_int(n_with_comments, 4);
5421         filename = gen_fileoutput(n_filename, 5);
5422         compression = gen_int(n_compression, 6);
5423 
5424         ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5425         desret_int(ret_val);
5426         call_tests++;
5427         des_xmlDocPtr(n_doc, doc, 0);
5428         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5429         des_int(n_exclusive, exclusive, 2);
5430         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5431         des_int(n_with_comments, with_comments, 4);
5432         des_fileoutput(n_filename, filename, 5);
5433         des_int(n_compression, compression, 6);
5434         xmlResetLastError();
5435         if (mem_base != xmlMemBlocks()) {
5436             printf("Leak of %d blocks found in xmlC14NDocSave",
5437 	           xmlMemBlocks() - mem_base);
5438 	    test_ret++;
5439             printf(" %d", n_doc);
5440             printf(" %d", n_nodes);
5441             printf(" %d", n_exclusive);
5442             printf(" %d", n_inclusive_ns_prefixes);
5443             printf(" %d", n_with_comments);
5444             printf(" %d", n_filename);
5445             printf(" %d", n_compression);
5446             printf("\n");
5447         }
5448     }
5449     }
5450     }
5451     }
5452     }
5453     }
5454     }
5455     function_tests++;
5456 #endif
5457 
5458     return(test_ret);
5459 }
5460 
5461 
5462 static int
test_xmlC14NDocSaveTo(void)5463 test_xmlC14NDocSaveTo(void) {
5464     int test_ret = 0;
5465 
5466 #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5467     int mem_base;
5468     int ret_val;
5469     xmlDocPtr doc; /* the XML document for canonization */
5470     int n_doc;
5471     xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5472     int n_nodes;
5473     int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5474     int n_exclusive;
5475     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) */
5476     int n_inclusive_ns_prefixes;
5477     int with_comments; /* include comments in the result (!=0) or not (==0) */
5478     int n_with_comments;
5479     xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5480     int n_buf;
5481 
5482     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5483     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5484     for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5485     for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5486     for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5487     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5488         mem_base = xmlMemBlocks();
5489         doc = gen_xmlDocPtr(n_doc, 0);
5490         nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5491         exclusive = gen_int(n_exclusive, 2);
5492         inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5493         with_comments = gen_int(n_with_comments, 4);
5494         buf = gen_xmlOutputBufferPtr(n_buf, 5);
5495 
5496         ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5497         desret_int(ret_val);
5498         call_tests++;
5499         des_xmlDocPtr(n_doc, doc, 0);
5500         des_xmlNodeSetPtr(n_nodes, nodes, 1);
5501         des_int(n_exclusive, exclusive, 2);
5502         des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5503         des_int(n_with_comments, with_comments, 4);
5504         des_xmlOutputBufferPtr(n_buf, buf, 5);
5505         xmlResetLastError();
5506         if (mem_base != xmlMemBlocks()) {
5507             printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5508 	           xmlMemBlocks() - mem_base);
5509 	    test_ret++;
5510             printf(" %d", n_doc);
5511             printf(" %d", n_nodes);
5512             printf(" %d", n_exclusive);
5513             printf(" %d", n_inclusive_ns_prefixes);
5514             printf(" %d", n_with_comments);
5515             printf(" %d", n_buf);
5516             printf("\n");
5517         }
5518     }
5519     }
5520     }
5521     }
5522     }
5523     }
5524     function_tests++;
5525 #endif
5526 
5527     return(test_ret);
5528 }
5529 
5530 
5531 static int
test_xmlC14NExecute(void)5532 test_xmlC14NExecute(void) {
5533     int test_ret = 0;
5534 
5535 
5536     /* missing type support */
5537     return(test_ret);
5538 }
5539 
5540 static int
test_c14n(void)5541 test_c14n(void) {
5542     int test_ret = 0;
5543 
5544     if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5545     test_ret += test_xmlC14NDocDumpMemory();
5546     test_ret += test_xmlC14NDocSave();
5547     test_ret += test_xmlC14NDocSaveTo();
5548     test_ret += test_xmlC14NExecute();
5549 
5550     if (test_ret != 0)
5551 	printf("Module c14n: %d errors\n", test_ret);
5552     return(test_ret);
5553 }
5554 #ifdef LIBXML_CATALOG_ENABLED
5555 
5556 #define gen_nb_xmlCatalogPtr 1
gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)5557 static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5558     return(NULL);
5559 }
des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED,xmlCatalogPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)5560 static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5561 }
5562 #endif
5563 
5564 
5565 static int
test_xmlACatalogAdd(void)5566 test_xmlACatalogAdd(void) {
5567     int test_ret = 0;
5568 
5569 #if defined(LIBXML_CATALOG_ENABLED)
5570     int mem_base;
5571     int ret_val;
5572     xmlCatalogPtr catal; /* a Catalog */
5573     int n_catal;
5574     xmlChar * type; /* the type of record to add to the catalog */
5575     int n_type;
5576     xmlChar * orig; /* the system, public or prefix to match */
5577     int n_orig;
5578     xmlChar * replace; /* the replacement value for the match */
5579     int n_replace;
5580 
5581     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5582     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5583     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5584     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5585         mem_base = xmlMemBlocks();
5586         catal = gen_xmlCatalogPtr(n_catal, 0);
5587         type = gen_const_xmlChar_ptr(n_type, 1);
5588         orig = gen_const_xmlChar_ptr(n_orig, 2);
5589         replace = gen_const_xmlChar_ptr(n_replace, 3);
5590 
5591         ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5592         desret_int(ret_val);
5593         call_tests++;
5594         des_xmlCatalogPtr(n_catal, catal, 0);
5595         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5596         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5597         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5598         xmlResetLastError();
5599         if (mem_base != xmlMemBlocks()) {
5600             printf("Leak of %d blocks found in xmlACatalogAdd",
5601 	           xmlMemBlocks() - mem_base);
5602 	    test_ret++;
5603             printf(" %d", n_catal);
5604             printf(" %d", n_type);
5605             printf(" %d", n_orig);
5606             printf(" %d", n_replace);
5607             printf("\n");
5608         }
5609     }
5610     }
5611     }
5612     }
5613     function_tests++;
5614 #endif
5615 
5616     return(test_ret);
5617 }
5618 
5619 
5620 static int
test_xmlACatalogDump(void)5621 test_xmlACatalogDump(void) {
5622     int test_ret = 0;
5623 
5624 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5625     int mem_base;
5626     xmlCatalogPtr catal; /* a Catalog */
5627     int n_catal;
5628     FILE * out; /* the file. */
5629     int n_out;
5630 
5631     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5632     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5633         mem_base = xmlMemBlocks();
5634         catal = gen_xmlCatalogPtr(n_catal, 0);
5635         out = gen_FILE_ptr(n_out, 1);
5636 
5637         xmlACatalogDump(catal, out);
5638         call_tests++;
5639         des_xmlCatalogPtr(n_catal, catal, 0);
5640         des_FILE_ptr(n_out, out, 1);
5641         xmlResetLastError();
5642         if (mem_base != xmlMemBlocks()) {
5643             printf("Leak of %d blocks found in xmlACatalogDump",
5644 	           xmlMemBlocks() - mem_base);
5645 	    test_ret++;
5646             printf(" %d", n_catal);
5647             printf(" %d", n_out);
5648             printf("\n");
5649         }
5650     }
5651     }
5652     function_tests++;
5653 #endif
5654 
5655     return(test_ret);
5656 }
5657 
5658 
5659 static int
test_xmlACatalogRemove(void)5660 test_xmlACatalogRemove(void) {
5661     int test_ret = 0;
5662 
5663 #if defined(LIBXML_CATALOG_ENABLED)
5664     int mem_base;
5665     int ret_val;
5666     xmlCatalogPtr catal; /* a Catalog */
5667     int n_catal;
5668     xmlChar * value; /* the value to remove */
5669     int n_value;
5670 
5671     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5672     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5673         mem_base = xmlMemBlocks();
5674         catal = gen_xmlCatalogPtr(n_catal, 0);
5675         value = gen_const_xmlChar_ptr(n_value, 1);
5676 
5677         ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5678         desret_int(ret_val);
5679         call_tests++;
5680         des_xmlCatalogPtr(n_catal, catal, 0);
5681         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5682         xmlResetLastError();
5683         if (mem_base != xmlMemBlocks()) {
5684             printf("Leak of %d blocks found in xmlACatalogRemove",
5685 	           xmlMemBlocks() - mem_base);
5686 	    test_ret++;
5687             printf(" %d", n_catal);
5688             printf(" %d", n_value);
5689             printf("\n");
5690         }
5691     }
5692     }
5693     function_tests++;
5694 #endif
5695 
5696     return(test_ret);
5697 }
5698 
5699 
5700 static int
test_xmlACatalogResolve(void)5701 test_xmlACatalogResolve(void) {
5702     int test_ret = 0;
5703 
5704 #if defined(LIBXML_CATALOG_ENABLED)
5705     int mem_base;
5706     xmlChar * ret_val;
5707     xmlCatalogPtr catal; /* a Catalog */
5708     int n_catal;
5709     xmlChar * pubID; /* the public ID string */
5710     int n_pubID;
5711     xmlChar * sysID; /* the system ID string */
5712     int n_sysID;
5713 
5714     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5715     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5716     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5717         mem_base = xmlMemBlocks();
5718         catal = gen_xmlCatalogPtr(n_catal, 0);
5719         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5720         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5721 
5722         ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5723         desret_xmlChar_ptr(ret_val);
5724         call_tests++;
5725         des_xmlCatalogPtr(n_catal, catal, 0);
5726         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5727         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5728         xmlResetLastError();
5729         if (mem_base != xmlMemBlocks()) {
5730             printf("Leak of %d blocks found in xmlACatalogResolve",
5731 	           xmlMemBlocks() - mem_base);
5732 	    test_ret++;
5733             printf(" %d", n_catal);
5734             printf(" %d", n_pubID);
5735             printf(" %d", n_sysID);
5736             printf("\n");
5737         }
5738     }
5739     }
5740     }
5741     function_tests++;
5742 #endif
5743 
5744     return(test_ret);
5745 }
5746 
5747 
5748 static int
test_xmlACatalogResolvePublic(void)5749 test_xmlACatalogResolvePublic(void) {
5750     int test_ret = 0;
5751 
5752 #if defined(LIBXML_CATALOG_ENABLED)
5753     int mem_base;
5754     xmlChar * ret_val;
5755     xmlCatalogPtr catal; /* a Catalog */
5756     int n_catal;
5757     xmlChar * pubID; /* the public ID string */
5758     int n_pubID;
5759 
5760     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5761     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5762         mem_base = xmlMemBlocks();
5763         catal = gen_xmlCatalogPtr(n_catal, 0);
5764         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5765 
5766         ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5767         desret_xmlChar_ptr(ret_val);
5768         call_tests++;
5769         des_xmlCatalogPtr(n_catal, catal, 0);
5770         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5771         xmlResetLastError();
5772         if (mem_base != xmlMemBlocks()) {
5773             printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5774 	           xmlMemBlocks() - mem_base);
5775 	    test_ret++;
5776             printf(" %d", n_catal);
5777             printf(" %d", n_pubID);
5778             printf("\n");
5779         }
5780     }
5781     }
5782     function_tests++;
5783 #endif
5784 
5785     return(test_ret);
5786 }
5787 
5788 
5789 static int
test_xmlACatalogResolveSystem(void)5790 test_xmlACatalogResolveSystem(void) {
5791     int test_ret = 0;
5792 
5793 #if defined(LIBXML_CATALOG_ENABLED)
5794     int mem_base;
5795     xmlChar * ret_val;
5796     xmlCatalogPtr catal; /* a Catalog */
5797     int n_catal;
5798     xmlChar * sysID; /* the system ID string */
5799     int n_sysID;
5800 
5801     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5802     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5803         mem_base = xmlMemBlocks();
5804         catal = gen_xmlCatalogPtr(n_catal, 0);
5805         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5806 
5807         ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5808         desret_xmlChar_ptr(ret_val);
5809         call_tests++;
5810         des_xmlCatalogPtr(n_catal, catal, 0);
5811         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5812         xmlResetLastError();
5813         if (mem_base != xmlMemBlocks()) {
5814             printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5815 	           xmlMemBlocks() - mem_base);
5816 	    test_ret++;
5817             printf(" %d", n_catal);
5818             printf(" %d", n_sysID);
5819             printf("\n");
5820         }
5821     }
5822     }
5823     function_tests++;
5824 #endif
5825 
5826     return(test_ret);
5827 }
5828 
5829 
5830 static int
test_xmlACatalogResolveURI(void)5831 test_xmlACatalogResolveURI(void) {
5832     int test_ret = 0;
5833 
5834 #if defined(LIBXML_CATALOG_ENABLED)
5835     int mem_base;
5836     xmlChar * ret_val;
5837     xmlCatalogPtr catal; /* a Catalog */
5838     int n_catal;
5839     xmlChar * URI; /* the URI */
5840     int n_URI;
5841 
5842     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5843     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5844         mem_base = xmlMemBlocks();
5845         catal = gen_xmlCatalogPtr(n_catal, 0);
5846         URI = gen_const_xmlChar_ptr(n_URI, 1);
5847 
5848         ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5849         desret_xmlChar_ptr(ret_val);
5850         call_tests++;
5851         des_xmlCatalogPtr(n_catal, catal, 0);
5852         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5853         xmlResetLastError();
5854         if (mem_base != xmlMemBlocks()) {
5855             printf("Leak of %d blocks found in xmlACatalogResolveURI",
5856 	           xmlMemBlocks() - mem_base);
5857 	    test_ret++;
5858             printf(" %d", n_catal);
5859             printf(" %d", n_URI);
5860             printf("\n");
5861         }
5862     }
5863     }
5864     function_tests++;
5865 #endif
5866 
5867     return(test_ret);
5868 }
5869 
5870 
5871 static int
test_xmlCatalogAdd(void)5872 test_xmlCatalogAdd(void) {
5873     int test_ret = 0;
5874 
5875 #if defined(LIBXML_CATALOG_ENABLED)
5876     int mem_base;
5877     int ret_val;
5878     xmlChar * type; /* the type of record to add to the catalog */
5879     int n_type;
5880     xmlChar * orig; /* the system, public or prefix to match */
5881     int n_orig;
5882     xmlChar * replace; /* the replacement value for the match */
5883     int n_replace;
5884 
5885     for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5886     for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5887     for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5888         mem_base = xmlMemBlocks();
5889         type = gen_const_xmlChar_ptr(n_type, 0);
5890         orig = gen_const_xmlChar_ptr(n_orig, 1);
5891         replace = gen_const_xmlChar_ptr(n_replace, 2);
5892 
5893         ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5894         desret_int(ret_val);
5895         call_tests++;
5896         des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5897         des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5898         des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5899         xmlResetLastError();
5900         if (mem_base != xmlMemBlocks()) {
5901             printf("Leak of %d blocks found in xmlCatalogAdd",
5902 	           xmlMemBlocks() - mem_base);
5903 	    test_ret++;
5904             printf(" %d", n_type);
5905             printf(" %d", n_orig);
5906             printf(" %d", n_replace);
5907             printf("\n");
5908         }
5909     }
5910     }
5911     }
5912     function_tests++;
5913 #endif
5914 
5915     return(test_ret);
5916 }
5917 
5918 
5919 static int
test_xmlCatalogCleanup(void)5920 test_xmlCatalogCleanup(void) {
5921     int test_ret = 0;
5922 
5923 #if defined(LIBXML_CATALOG_ENABLED)
5924 
5925 
5926         xmlCatalogCleanup();
5927         call_tests++;
5928         xmlResetLastError();
5929     function_tests++;
5930 #endif
5931 
5932     return(test_ret);
5933 }
5934 
5935 
5936 static int
test_xmlCatalogConvert(void)5937 test_xmlCatalogConvert(void) {
5938     int test_ret = 0;
5939 
5940 #if defined(LIBXML_CATALOG_ENABLED)
5941     int ret_val;
5942 
5943 
5944         ret_val = xmlCatalogConvert();
5945         desret_int(ret_val);
5946         call_tests++;
5947         xmlResetLastError();
5948     function_tests++;
5949 #endif
5950 
5951     return(test_ret);
5952 }
5953 
5954 
5955 static int
test_xmlCatalogDump(void)5956 test_xmlCatalogDump(void) {
5957     int test_ret = 0;
5958 
5959 #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5960     int mem_base;
5961     FILE * out; /* the file. */
5962     int n_out;
5963 
5964     for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5965         mem_base = xmlMemBlocks();
5966         out = gen_FILE_ptr(n_out, 0);
5967 
5968         xmlCatalogDump(out);
5969         call_tests++;
5970         des_FILE_ptr(n_out, out, 0);
5971         xmlResetLastError();
5972         if (mem_base != xmlMemBlocks()) {
5973             printf("Leak of %d blocks found in xmlCatalogDump",
5974 	           xmlMemBlocks() - mem_base);
5975 	    test_ret++;
5976             printf(" %d", n_out);
5977             printf("\n");
5978         }
5979     }
5980     function_tests++;
5981 #endif
5982 
5983     return(test_ret);
5984 }
5985 
5986 
5987 static int
test_xmlCatalogGetDefaults(void)5988 test_xmlCatalogGetDefaults(void) {
5989     int test_ret = 0;
5990 
5991 #if defined(LIBXML_CATALOG_ENABLED)
5992     int mem_base;
5993     xmlCatalogAllow ret_val;
5994 
5995         mem_base = xmlMemBlocks();
5996 
5997         ret_val = xmlCatalogGetDefaults();
5998         desret_xmlCatalogAllow(ret_val);
5999         call_tests++;
6000         xmlResetLastError();
6001         if (mem_base != xmlMemBlocks()) {
6002             printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6003 	           xmlMemBlocks() - mem_base);
6004 	    test_ret++;
6005             printf("\n");
6006         }
6007     function_tests++;
6008 #endif
6009 
6010     return(test_ret);
6011 }
6012 
6013 
6014 static int
test_xmlCatalogIsEmpty(void)6015 test_xmlCatalogIsEmpty(void) {
6016     int test_ret = 0;
6017 
6018 #if defined(LIBXML_CATALOG_ENABLED)
6019     int mem_base;
6020     int ret_val;
6021     xmlCatalogPtr catal; /* should this create an SGML catalog */
6022     int n_catal;
6023 
6024     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6025         mem_base = xmlMemBlocks();
6026         catal = gen_xmlCatalogPtr(n_catal, 0);
6027 
6028         ret_val = xmlCatalogIsEmpty(catal);
6029         desret_int(ret_val);
6030         call_tests++;
6031         des_xmlCatalogPtr(n_catal, catal, 0);
6032         xmlResetLastError();
6033         if (mem_base != xmlMemBlocks()) {
6034             printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6035 	           xmlMemBlocks() - mem_base);
6036 	    test_ret++;
6037             printf(" %d", n_catal);
6038             printf("\n");
6039         }
6040     }
6041     function_tests++;
6042 #endif
6043 
6044     return(test_ret);
6045 }
6046 
6047 
6048 static int
test_xmlCatalogLocalResolve(void)6049 test_xmlCatalogLocalResolve(void) {
6050     int test_ret = 0;
6051 
6052 #if defined(LIBXML_CATALOG_ENABLED)
6053     int mem_base;
6054     xmlChar * ret_val;
6055     void * catalogs; /* a document's list of catalogs */
6056     int n_catalogs;
6057     xmlChar * pubID; /* the public ID string */
6058     int n_pubID;
6059     xmlChar * sysID; /* the system ID string */
6060     int n_sysID;
6061 
6062     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6063     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6064     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6065         mem_base = xmlMemBlocks();
6066         catalogs = gen_void_ptr(n_catalogs, 0);
6067         pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6068         sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6069 
6070         ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6071         desret_xmlChar_ptr(ret_val);
6072         call_tests++;
6073         des_void_ptr(n_catalogs, catalogs, 0);
6074         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6075         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6076         xmlResetLastError();
6077         if (mem_base != xmlMemBlocks()) {
6078             printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6079 	           xmlMemBlocks() - mem_base);
6080 	    test_ret++;
6081             printf(" %d", n_catalogs);
6082             printf(" %d", n_pubID);
6083             printf(" %d", n_sysID);
6084             printf("\n");
6085         }
6086     }
6087     }
6088     }
6089     function_tests++;
6090 #endif
6091 
6092     return(test_ret);
6093 }
6094 
6095 
6096 static int
test_xmlCatalogLocalResolveURI(void)6097 test_xmlCatalogLocalResolveURI(void) {
6098     int test_ret = 0;
6099 
6100 #if defined(LIBXML_CATALOG_ENABLED)
6101     int mem_base;
6102     xmlChar * ret_val;
6103     void * catalogs; /* a document's list of catalogs */
6104     int n_catalogs;
6105     xmlChar * URI; /* the URI */
6106     int n_URI;
6107 
6108     for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6109     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6110         mem_base = xmlMemBlocks();
6111         catalogs = gen_void_ptr(n_catalogs, 0);
6112         URI = gen_const_xmlChar_ptr(n_URI, 1);
6113 
6114         ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6115         desret_xmlChar_ptr(ret_val);
6116         call_tests++;
6117         des_void_ptr(n_catalogs, catalogs, 0);
6118         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6119         xmlResetLastError();
6120         if (mem_base != xmlMemBlocks()) {
6121             printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6122 	           xmlMemBlocks() - mem_base);
6123 	    test_ret++;
6124             printf(" %d", n_catalogs);
6125             printf(" %d", n_URI);
6126             printf("\n");
6127         }
6128     }
6129     }
6130     function_tests++;
6131 #endif
6132 
6133     return(test_ret);
6134 }
6135 
6136 
6137 static int
test_xmlCatalogRemove(void)6138 test_xmlCatalogRemove(void) {
6139     int test_ret = 0;
6140 
6141 #if defined(LIBXML_CATALOG_ENABLED)
6142     int ret_val;
6143     xmlChar * value; /* the value to remove */
6144     int n_value;
6145 
6146     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6147         value = gen_const_xmlChar_ptr(n_value, 0);
6148 
6149         ret_val = xmlCatalogRemove((const xmlChar *)value);
6150         desret_int(ret_val);
6151         call_tests++;
6152         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6153         xmlResetLastError();
6154     }
6155     function_tests++;
6156 #endif
6157 
6158     return(test_ret);
6159 }
6160 
6161 
6162 static int
test_xmlCatalogResolve(void)6163 test_xmlCatalogResolve(void) {
6164     int test_ret = 0;
6165 
6166 #if defined(LIBXML_CATALOG_ENABLED)
6167     int mem_base;
6168     xmlChar * ret_val;
6169     xmlChar * pubID; /* the public ID string */
6170     int n_pubID;
6171     xmlChar * sysID; /* the system ID string */
6172     int n_sysID;
6173 
6174     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6175     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6176         mem_base = xmlMemBlocks();
6177         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6178         sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6179 
6180         ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6181         desret_xmlChar_ptr(ret_val);
6182         call_tests++;
6183         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6184         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6185         xmlResetLastError();
6186         if (mem_base != xmlMemBlocks()) {
6187             printf("Leak of %d blocks found in xmlCatalogResolve",
6188 	           xmlMemBlocks() - mem_base);
6189 	    test_ret++;
6190             printf(" %d", n_pubID);
6191             printf(" %d", n_sysID);
6192             printf("\n");
6193         }
6194     }
6195     }
6196     function_tests++;
6197 #endif
6198 
6199     return(test_ret);
6200 }
6201 
6202 
6203 static int
test_xmlCatalogResolvePublic(void)6204 test_xmlCatalogResolvePublic(void) {
6205     int test_ret = 0;
6206 
6207 #if defined(LIBXML_CATALOG_ENABLED)
6208     int mem_base;
6209     xmlChar * ret_val;
6210     xmlChar * pubID; /* the public ID string */
6211     int n_pubID;
6212 
6213     for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6214         mem_base = xmlMemBlocks();
6215         pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6216 
6217         ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6218         desret_xmlChar_ptr(ret_val);
6219         call_tests++;
6220         des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6221         xmlResetLastError();
6222         if (mem_base != xmlMemBlocks()) {
6223             printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6224 	           xmlMemBlocks() - mem_base);
6225 	    test_ret++;
6226             printf(" %d", n_pubID);
6227             printf("\n");
6228         }
6229     }
6230     function_tests++;
6231 #endif
6232 
6233     return(test_ret);
6234 }
6235 
6236 
6237 static int
test_xmlCatalogResolveSystem(void)6238 test_xmlCatalogResolveSystem(void) {
6239     int test_ret = 0;
6240 
6241 #if defined(LIBXML_CATALOG_ENABLED)
6242     int mem_base;
6243     xmlChar * ret_val;
6244     xmlChar * sysID; /* the system ID string */
6245     int n_sysID;
6246 
6247     for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6248         mem_base = xmlMemBlocks();
6249         sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6250 
6251         ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6252         desret_xmlChar_ptr(ret_val);
6253         call_tests++;
6254         des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6255         xmlResetLastError();
6256         if (mem_base != xmlMemBlocks()) {
6257             printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6258 	           xmlMemBlocks() - mem_base);
6259 	    test_ret++;
6260             printf(" %d", n_sysID);
6261             printf("\n");
6262         }
6263     }
6264     function_tests++;
6265 #endif
6266 
6267     return(test_ret);
6268 }
6269 
6270 
6271 static int
test_xmlCatalogResolveURI(void)6272 test_xmlCatalogResolveURI(void) {
6273     int test_ret = 0;
6274 
6275 #if defined(LIBXML_CATALOG_ENABLED)
6276     int mem_base;
6277     xmlChar * ret_val;
6278     xmlChar * URI; /* the URI */
6279     int n_URI;
6280 
6281     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6282         mem_base = xmlMemBlocks();
6283         URI = gen_const_xmlChar_ptr(n_URI, 0);
6284 
6285         ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6286         desret_xmlChar_ptr(ret_val);
6287         call_tests++;
6288         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6289         xmlResetLastError();
6290         if (mem_base != xmlMemBlocks()) {
6291             printf("Leak of %d blocks found in xmlCatalogResolveURI",
6292 	           xmlMemBlocks() - mem_base);
6293 	    test_ret++;
6294             printf(" %d", n_URI);
6295             printf("\n");
6296         }
6297     }
6298     function_tests++;
6299 #endif
6300 
6301     return(test_ret);
6302 }
6303 
6304 
6305 static int
test_xmlCatalogSetDefaultPrefer(void)6306 test_xmlCatalogSetDefaultPrefer(void) {
6307     int test_ret = 0;
6308 
6309 #if defined(LIBXML_CATALOG_ENABLED)
6310     int mem_base;
6311     xmlCatalogPrefer ret_val;
6312     xmlCatalogPrefer prefer; /* the default preference for delegation */
6313     int n_prefer;
6314 
6315     for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6316         mem_base = xmlMemBlocks();
6317         prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6318 
6319         ret_val = xmlCatalogSetDefaultPrefer(prefer);
6320         desret_xmlCatalogPrefer(ret_val);
6321         call_tests++;
6322         des_xmlCatalogPrefer(n_prefer, prefer, 0);
6323         xmlResetLastError();
6324         if (mem_base != xmlMemBlocks()) {
6325             printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6326 	           xmlMemBlocks() - mem_base);
6327 	    test_ret++;
6328             printf(" %d", n_prefer);
6329             printf("\n");
6330         }
6331     }
6332     function_tests++;
6333 #endif
6334 
6335     return(test_ret);
6336 }
6337 
6338 
6339 static int
test_xmlCatalogSetDefaults(void)6340 test_xmlCatalogSetDefaults(void) {
6341     int test_ret = 0;
6342 
6343 #if defined(LIBXML_CATALOG_ENABLED)
6344     int mem_base;
6345     xmlCatalogAllow allow; /* what catalogs should be accepted */
6346     int n_allow;
6347 
6348     for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6349         mem_base = xmlMemBlocks();
6350         allow = gen_xmlCatalogAllow(n_allow, 0);
6351 
6352         xmlCatalogSetDefaults(allow);
6353         call_tests++;
6354         des_xmlCatalogAllow(n_allow, allow, 0);
6355         xmlResetLastError();
6356         if (mem_base != xmlMemBlocks()) {
6357             printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6358 	           xmlMemBlocks() - mem_base);
6359 	    test_ret++;
6360             printf(" %d", n_allow);
6361             printf("\n");
6362         }
6363     }
6364     function_tests++;
6365 #endif
6366 
6367     return(test_ret);
6368 }
6369 
6370 
6371 static int
test_xmlConvertSGMLCatalog(void)6372 test_xmlConvertSGMLCatalog(void) {
6373     int test_ret = 0;
6374 
6375 #if defined(LIBXML_CATALOG_ENABLED)
6376     int mem_base;
6377     int ret_val;
6378     xmlCatalogPtr catal; /* the catalog */
6379     int n_catal;
6380 
6381     for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6382         mem_base = xmlMemBlocks();
6383         catal = gen_xmlCatalogPtr(n_catal, 0);
6384 
6385         ret_val = xmlConvertSGMLCatalog(catal);
6386         desret_int(ret_val);
6387         call_tests++;
6388         des_xmlCatalogPtr(n_catal, catal, 0);
6389         xmlResetLastError();
6390         if (mem_base != xmlMemBlocks()) {
6391             printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6392 	           xmlMemBlocks() - mem_base);
6393 	    test_ret++;
6394             printf(" %d", n_catal);
6395             printf("\n");
6396         }
6397     }
6398     function_tests++;
6399 #endif
6400 
6401     return(test_ret);
6402 }
6403 
6404 
6405 static int
test_xmlInitializeCatalog(void)6406 test_xmlInitializeCatalog(void) {
6407     int test_ret = 0;
6408 
6409 #if defined(LIBXML_CATALOG_ENABLED)
6410     int mem_base;
6411 
6412         mem_base = xmlMemBlocks();
6413 
6414         xmlInitializeCatalog();
6415         call_tests++;
6416         xmlResetLastError();
6417         if (mem_base != xmlMemBlocks()) {
6418             printf("Leak of %d blocks found in xmlInitializeCatalog",
6419 	           xmlMemBlocks() - mem_base);
6420 	    test_ret++;
6421             printf("\n");
6422         }
6423     function_tests++;
6424 #endif
6425 
6426     return(test_ret);
6427 }
6428 
6429 
6430 static int
test_xmlLoadACatalog(void)6431 test_xmlLoadACatalog(void) {
6432     int test_ret = 0;
6433 
6434 
6435     /* missing type support */
6436     return(test_ret);
6437 }
6438 
6439 
6440 static int
test_xmlLoadCatalog(void)6441 test_xmlLoadCatalog(void) {
6442     int test_ret = 0;
6443 
6444 #if defined(LIBXML_CATALOG_ENABLED)
6445     int ret_val;
6446     const char * filename; /* a file path */
6447     int n_filename;
6448 
6449     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6450         filename = gen_filepath(n_filename, 0);
6451 
6452         ret_val = xmlLoadCatalog(filename);
6453         desret_int(ret_val);
6454         call_tests++;
6455         des_filepath(n_filename, filename, 0);
6456         xmlResetLastError();
6457     }
6458     function_tests++;
6459 #endif
6460 
6461     return(test_ret);
6462 }
6463 
6464 
6465 static int
test_xmlLoadCatalogs(void)6466 test_xmlLoadCatalogs(void) {
6467     int test_ret = 0;
6468 
6469 #if defined(LIBXML_CATALOG_ENABLED)
6470     char * pathss; /* a list of directories separated by a colon or a space. */
6471     int n_pathss;
6472 
6473     for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6474         pathss = gen_const_char_ptr(n_pathss, 0);
6475 
6476         xmlLoadCatalogs((const char *)pathss);
6477         call_tests++;
6478         des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6479         xmlResetLastError();
6480     }
6481     function_tests++;
6482 #endif
6483 
6484     return(test_ret);
6485 }
6486 
6487 
6488 static int
test_xmlLoadSGMLSuperCatalog(void)6489 test_xmlLoadSGMLSuperCatalog(void) {
6490     int test_ret = 0;
6491 
6492 
6493     /* missing type support */
6494     return(test_ret);
6495 }
6496 
6497 
6498 static int
test_xmlNewCatalog(void)6499 test_xmlNewCatalog(void) {
6500     int test_ret = 0;
6501 
6502 
6503     /* missing type support */
6504     return(test_ret);
6505 }
6506 
6507 
6508 static int
test_xmlParseCatalogFile(void)6509 test_xmlParseCatalogFile(void) {
6510     int test_ret = 0;
6511 
6512 #if defined(LIBXML_CATALOG_ENABLED)
6513     int mem_base;
6514     xmlDocPtr ret_val;
6515     const char * filename; /* the filename */
6516     int n_filename;
6517 
6518     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6519         mem_base = xmlMemBlocks();
6520         filename = gen_filepath(n_filename, 0);
6521 
6522         ret_val = xmlParseCatalogFile(filename);
6523         desret_xmlDocPtr(ret_val);
6524         call_tests++;
6525         des_filepath(n_filename, filename, 0);
6526         xmlResetLastError();
6527         if (mem_base != xmlMemBlocks()) {
6528             printf("Leak of %d blocks found in xmlParseCatalogFile",
6529 	           xmlMemBlocks() - mem_base);
6530 	    test_ret++;
6531             printf(" %d", n_filename);
6532             printf("\n");
6533         }
6534     }
6535     function_tests++;
6536 #endif
6537 
6538     return(test_ret);
6539 }
6540 
6541 static int
test_catalog(void)6542 test_catalog(void) {
6543     int test_ret = 0;
6544 
6545     if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6546     test_ret += test_xmlACatalogAdd();
6547     test_ret += test_xmlACatalogDump();
6548     test_ret += test_xmlACatalogRemove();
6549     test_ret += test_xmlACatalogResolve();
6550     test_ret += test_xmlACatalogResolvePublic();
6551     test_ret += test_xmlACatalogResolveSystem();
6552     test_ret += test_xmlACatalogResolveURI();
6553     test_ret += test_xmlCatalogAdd();
6554     test_ret += test_xmlCatalogCleanup();
6555     test_ret += test_xmlCatalogConvert();
6556     test_ret += test_xmlCatalogDump();
6557     test_ret += test_xmlCatalogGetDefaults();
6558     test_ret += test_xmlCatalogIsEmpty();
6559     test_ret += test_xmlCatalogLocalResolve();
6560     test_ret += test_xmlCatalogLocalResolveURI();
6561     test_ret += test_xmlCatalogRemove();
6562     test_ret += test_xmlCatalogResolve();
6563     test_ret += test_xmlCatalogResolvePublic();
6564     test_ret += test_xmlCatalogResolveSystem();
6565     test_ret += test_xmlCatalogResolveURI();
6566     test_ret += test_xmlCatalogSetDefaultPrefer();
6567     test_ret += test_xmlCatalogSetDefaults();
6568     test_ret += test_xmlConvertSGMLCatalog();
6569     test_ret += test_xmlInitializeCatalog();
6570     test_ret += test_xmlLoadACatalog();
6571     test_ret += test_xmlLoadCatalog();
6572     test_ret += test_xmlLoadCatalogs();
6573     test_ret += test_xmlLoadSGMLSuperCatalog();
6574     test_ret += test_xmlNewCatalog();
6575     test_ret += test_xmlParseCatalogFile();
6576 
6577     if (test_ret != 0)
6578 	printf("Module catalog: %d errors\n", test_ret);
6579     return(test_ret);
6580 }
6581 
6582 #define gen_nb_const_xmlChRangeGroup_ptr 1
gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)6583 static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6584     return(NULL);
6585 }
des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED,const xmlChRangeGroup * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)6586 static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6587 }
6588 
6589 static int
test_xmlCharInRange(void)6590 test_xmlCharInRange(void) {
6591     int test_ret = 0;
6592 
6593     int mem_base;
6594     int ret_val;
6595     unsigned int val; /* character to be validated */
6596     int n_val;
6597     xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6598     int n_rptr;
6599 
6600     for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6601     for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6602         mem_base = xmlMemBlocks();
6603         val = gen_unsigned_int(n_val, 0);
6604         rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6605 
6606         ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6607         desret_int(ret_val);
6608         call_tests++;
6609         des_unsigned_int(n_val, val, 0);
6610         des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6611         xmlResetLastError();
6612         if (mem_base != xmlMemBlocks()) {
6613             printf("Leak of %d blocks found in xmlCharInRange",
6614 	           xmlMemBlocks() - mem_base);
6615 	    test_ret++;
6616             printf(" %d", n_val);
6617             printf(" %d", n_rptr);
6618             printf("\n");
6619         }
6620     }
6621     }
6622     function_tests++;
6623 
6624     return(test_ret);
6625 }
6626 
6627 
6628 static int
test_xmlIsBaseChar(void)6629 test_xmlIsBaseChar(void) {
6630     int test_ret = 0;
6631 
6632     int mem_base;
6633     int ret_val;
6634     unsigned int ch; /* character to validate */
6635     int n_ch;
6636 
6637     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6638         mem_base = xmlMemBlocks();
6639         ch = gen_unsigned_int(n_ch, 0);
6640 
6641         ret_val = xmlIsBaseChar(ch);
6642         desret_int(ret_val);
6643         call_tests++;
6644         des_unsigned_int(n_ch, ch, 0);
6645         xmlResetLastError();
6646         if (mem_base != xmlMemBlocks()) {
6647             printf("Leak of %d blocks found in xmlIsBaseChar",
6648 	           xmlMemBlocks() - mem_base);
6649 	    test_ret++;
6650             printf(" %d", n_ch);
6651             printf("\n");
6652         }
6653     }
6654     function_tests++;
6655 
6656     return(test_ret);
6657 }
6658 
6659 
6660 static int
test_xmlIsBlank(void)6661 test_xmlIsBlank(void) {
6662     int test_ret = 0;
6663 
6664     int mem_base;
6665     int ret_val;
6666     unsigned int ch; /* character to validate */
6667     int n_ch;
6668 
6669     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6670         mem_base = xmlMemBlocks();
6671         ch = gen_unsigned_int(n_ch, 0);
6672 
6673         ret_val = xmlIsBlank(ch);
6674         desret_int(ret_val);
6675         call_tests++;
6676         des_unsigned_int(n_ch, ch, 0);
6677         xmlResetLastError();
6678         if (mem_base != xmlMemBlocks()) {
6679             printf("Leak of %d blocks found in xmlIsBlank",
6680 	           xmlMemBlocks() - mem_base);
6681 	    test_ret++;
6682             printf(" %d", n_ch);
6683             printf("\n");
6684         }
6685     }
6686     function_tests++;
6687 
6688     return(test_ret);
6689 }
6690 
6691 
6692 static int
test_xmlIsChar(void)6693 test_xmlIsChar(void) {
6694     int test_ret = 0;
6695 
6696     int mem_base;
6697     int ret_val;
6698     unsigned int ch; /* character to validate */
6699     int n_ch;
6700 
6701     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6702         mem_base = xmlMemBlocks();
6703         ch = gen_unsigned_int(n_ch, 0);
6704 
6705         ret_val = xmlIsChar(ch);
6706         desret_int(ret_val);
6707         call_tests++;
6708         des_unsigned_int(n_ch, ch, 0);
6709         xmlResetLastError();
6710         if (mem_base != xmlMemBlocks()) {
6711             printf("Leak of %d blocks found in xmlIsChar",
6712 	           xmlMemBlocks() - mem_base);
6713 	    test_ret++;
6714             printf(" %d", n_ch);
6715             printf("\n");
6716         }
6717     }
6718     function_tests++;
6719 
6720     return(test_ret);
6721 }
6722 
6723 
6724 static int
test_xmlIsCombining(void)6725 test_xmlIsCombining(void) {
6726     int test_ret = 0;
6727 
6728     int mem_base;
6729     int ret_val;
6730     unsigned int ch; /* character to validate */
6731     int n_ch;
6732 
6733     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6734         mem_base = xmlMemBlocks();
6735         ch = gen_unsigned_int(n_ch, 0);
6736 
6737         ret_val = xmlIsCombining(ch);
6738         desret_int(ret_val);
6739         call_tests++;
6740         des_unsigned_int(n_ch, ch, 0);
6741         xmlResetLastError();
6742         if (mem_base != xmlMemBlocks()) {
6743             printf("Leak of %d blocks found in xmlIsCombining",
6744 	           xmlMemBlocks() - mem_base);
6745 	    test_ret++;
6746             printf(" %d", n_ch);
6747             printf("\n");
6748         }
6749     }
6750     function_tests++;
6751 
6752     return(test_ret);
6753 }
6754 
6755 
6756 static int
test_xmlIsDigit(void)6757 test_xmlIsDigit(void) {
6758     int test_ret = 0;
6759 
6760     int mem_base;
6761     int ret_val;
6762     unsigned int ch; /* character to validate */
6763     int n_ch;
6764 
6765     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6766         mem_base = xmlMemBlocks();
6767         ch = gen_unsigned_int(n_ch, 0);
6768 
6769         ret_val = xmlIsDigit(ch);
6770         desret_int(ret_val);
6771         call_tests++;
6772         des_unsigned_int(n_ch, ch, 0);
6773         xmlResetLastError();
6774         if (mem_base != xmlMemBlocks()) {
6775             printf("Leak of %d blocks found in xmlIsDigit",
6776 	           xmlMemBlocks() - mem_base);
6777 	    test_ret++;
6778             printf(" %d", n_ch);
6779             printf("\n");
6780         }
6781     }
6782     function_tests++;
6783 
6784     return(test_ret);
6785 }
6786 
6787 
6788 static int
test_xmlIsExtender(void)6789 test_xmlIsExtender(void) {
6790     int test_ret = 0;
6791 
6792     int mem_base;
6793     int ret_val;
6794     unsigned int ch; /* character to validate */
6795     int n_ch;
6796 
6797     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6798         mem_base = xmlMemBlocks();
6799         ch = gen_unsigned_int(n_ch, 0);
6800 
6801         ret_val = xmlIsExtender(ch);
6802         desret_int(ret_val);
6803         call_tests++;
6804         des_unsigned_int(n_ch, ch, 0);
6805         xmlResetLastError();
6806         if (mem_base != xmlMemBlocks()) {
6807             printf("Leak of %d blocks found in xmlIsExtender",
6808 	           xmlMemBlocks() - mem_base);
6809 	    test_ret++;
6810             printf(" %d", n_ch);
6811             printf("\n");
6812         }
6813     }
6814     function_tests++;
6815 
6816     return(test_ret);
6817 }
6818 
6819 
6820 static int
test_xmlIsIdeographic(void)6821 test_xmlIsIdeographic(void) {
6822     int test_ret = 0;
6823 
6824     int mem_base;
6825     int ret_val;
6826     unsigned int ch; /* character to validate */
6827     int n_ch;
6828 
6829     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6830         mem_base = xmlMemBlocks();
6831         ch = gen_unsigned_int(n_ch, 0);
6832 
6833         ret_val = xmlIsIdeographic(ch);
6834         desret_int(ret_val);
6835         call_tests++;
6836         des_unsigned_int(n_ch, ch, 0);
6837         xmlResetLastError();
6838         if (mem_base != xmlMemBlocks()) {
6839             printf("Leak of %d blocks found in xmlIsIdeographic",
6840 	           xmlMemBlocks() - mem_base);
6841 	    test_ret++;
6842             printf(" %d", n_ch);
6843             printf("\n");
6844         }
6845     }
6846     function_tests++;
6847 
6848     return(test_ret);
6849 }
6850 
6851 
6852 static int
test_xmlIsPubidChar(void)6853 test_xmlIsPubidChar(void) {
6854     int test_ret = 0;
6855 
6856     int mem_base;
6857     int ret_val;
6858     unsigned int ch; /* character to validate */
6859     int n_ch;
6860 
6861     for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6862         mem_base = xmlMemBlocks();
6863         ch = gen_unsigned_int(n_ch, 0);
6864 
6865         ret_val = xmlIsPubidChar(ch);
6866         desret_int(ret_val);
6867         call_tests++;
6868         des_unsigned_int(n_ch, ch, 0);
6869         xmlResetLastError();
6870         if (mem_base != xmlMemBlocks()) {
6871             printf("Leak of %d blocks found in xmlIsPubidChar",
6872 	           xmlMemBlocks() - mem_base);
6873 	    test_ret++;
6874             printf(" %d", n_ch);
6875             printf("\n");
6876         }
6877     }
6878     function_tests++;
6879 
6880     return(test_ret);
6881 }
6882 
6883 static int
test_chvalid(void)6884 test_chvalid(void) {
6885     int test_ret = 0;
6886 
6887     if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6888     test_ret += test_xmlCharInRange();
6889     test_ret += test_xmlIsBaseChar();
6890     test_ret += test_xmlIsBlank();
6891     test_ret += test_xmlIsChar();
6892     test_ret += test_xmlIsCombining();
6893     test_ret += test_xmlIsDigit();
6894     test_ret += test_xmlIsExtender();
6895     test_ret += test_xmlIsIdeographic();
6896     test_ret += test_xmlIsPubidChar();
6897 
6898     if (test_ret != 0)
6899 	printf("Module chvalid: %d errors\n", test_ret);
6900     return(test_ret);
6901 }
6902 
6903 static int
test_xmlBoolToText(void)6904 test_xmlBoolToText(void) {
6905     int test_ret = 0;
6906 
6907 #if defined(LIBXML_DEBUG_ENABLED)
6908     int mem_base;
6909     const char * ret_val;
6910     int boolval; /* a bool to turn into text */
6911     int n_boolval;
6912 
6913     for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6914         mem_base = xmlMemBlocks();
6915         boolval = gen_int(n_boolval, 0);
6916 
6917         ret_val = xmlBoolToText(boolval);
6918         desret_const_char_ptr(ret_val);
6919         call_tests++;
6920         des_int(n_boolval, boolval, 0);
6921         xmlResetLastError();
6922         if (mem_base != xmlMemBlocks()) {
6923             printf("Leak of %d blocks found in xmlBoolToText",
6924 	           xmlMemBlocks() - mem_base);
6925 	    test_ret++;
6926             printf(" %d", n_boolval);
6927             printf("\n");
6928         }
6929     }
6930     function_tests++;
6931 #endif
6932 
6933     return(test_ret);
6934 }
6935 
6936 
6937 static int
test_xmlDebugCheckDocument(void)6938 test_xmlDebugCheckDocument(void) {
6939     int test_ret = 0;
6940 
6941 #if defined(LIBXML_DEBUG_ENABLED)
6942     int mem_base;
6943     int ret_val;
6944     FILE * output; /* the FILE * for the output */
6945     int n_output;
6946     xmlDocPtr doc; /* the document */
6947     int n_doc;
6948 
6949     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6950     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6951         mem_base = xmlMemBlocks();
6952         output = gen_debug_FILE_ptr(n_output, 0);
6953         doc = gen_xmlDocPtr(n_doc, 1);
6954 
6955         ret_val = xmlDebugCheckDocument(output, doc);
6956         desret_int(ret_val);
6957         call_tests++;
6958         des_debug_FILE_ptr(n_output, output, 0);
6959         des_xmlDocPtr(n_doc, doc, 1);
6960         xmlResetLastError();
6961         if (mem_base != xmlMemBlocks()) {
6962             printf("Leak of %d blocks found in xmlDebugCheckDocument",
6963 	           xmlMemBlocks() - mem_base);
6964 	    test_ret++;
6965             printf(" %d", n_output);
6966             printf(" %d", n_doc);
6967             printf("\n");
6968         }
6969     }
6970     }
6971     function_tests++;
6972 #endif
6973 
6974     return(test_ret);
6975 }
6976 
6977 
6978 static int
test_xmlDebugDumpAttr(void)6979 test_xmlDebugDumpAttr(void) {
6980     int test_ret = 0;
6981 
6982 #if defined(LIBXML_DEBUG_ENABLED)
6983     int mem_base;
6984     FILE * output; /* the FILE * for the output */
6985     int n_output;
6986     xmlAttrPtr attr; /* the attribute */
6987     int n_attr;
6988     int depth; /* the indentation level. */
6989     int n_depth;
6990 
6991     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6992     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
6993     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
6994         mem_base = xmlMemBlocks();
6995         output = gen_debug_FILE_ptr(n_output, 0);
6996         attr = gen_xmlAttrPtr(n_attr, 1);
6997         depth = gen_int(n_depth, 2);
6998 
6999         xmlDebugDumpAttr(output, attr, depth);
7000         call_tests++;
7001         des_debug_FILE_ptr(n_output, output, 0);
7002         des_xmlAttrPtr(n_attr, attr, 1);
7003         des_int(n_depth, depth, 2);
7004         xmlResetLastError();
7005         if (mem_base != xmlMemBlocks()) {
7006             printf("Leak of %d blocks found in xmlDebugDumpAttr",
7007 	           xmlMemBlocks() - mem_base);
7008 	    test_ret++;
7009             printf(" %d", n_output);
7010             printf(" %d", n_attr);
7011             printf(" %d", n_depth);
7012             printf("\n");
7013         }
7014     }
7015     }
7016     }
7017     function_tests++;
7018 #endif
7019 
7020     return(test_ret);
7021 }
7022 
7023 
7024 static int
test_xmlDebugDumpAttrList(void)7025 test_xmlDebugDumpAttrList(void) {
7026     int test_ret = 0;
7027 
7028 #if defined(LIBXML_DEBUG_ENABLED)
7029     int mem_base;
7030     FILE * output; /* the FILE * for the output */
7031     int n_output;
7032     xmlAttrPtr attr; /* the attribute list */
7033     int n_attr;
7034     int depth; /* the indentation level. */
7035     int n_depth;
7036 
7037     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7038     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7039     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7040         mem_base = xmlMemBlocks();
7041         output = gen_debug_FILE_ptr(n_output, 0);
7042         attr = gen_xmlAttrPtr(n_attr, 1);
7043         depth = gen_int(n_depth, 2);
7044 
7045         xmlDebugDumpAttrList(output, attr, depth);
7046         call_tests++;
7047         des_debug_FILE_ptr(n_output, output, 0);
7048         des_xmlAttrPtr(n_attr, attr, 1);
7049         des_int(n_depth, depth, 2);
7050         xmlResetLastError();
7051         if (mem_base != xmlMemBlocks()) {
7052             printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7053 	           xmlMemBlocks() - mem_base);
7054 	    test_ret++;
7055             printf(" %d", n_output);
7056             printf(" %d", n_attr);
7057             printf(" %d", n_depth);
7058             printf("\n");
7059         }
7060     }
7061     }
7062     }
7063     function_tests++;
7064 #endif
7065 
7066     return(test_ret);
7067 }
7068 
7069 
7070 static int
test_xmlDebugDumpDTD(void)7071 test_xmlDebugDumpDTD(void) {
7072     int test_ret = 0;
7073 
7074 #if defined(LIBXML_DEBUG_ENABLED)
7075     int mem_base;
7076     FILE * output; /* the FILE * for the output */
7077     int n_output;
7078     xmlDtdPtr dtd; /* the DTD */
7079     int n_dtd;
7080 
7081     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7082     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7083         mem_base = xmlMemBlocks();
7084         output = gen_debug_FILE_ptr(n_output, 0);
7085         dtd = gen_xmlDtdPtr(n_dtd, 1);
7086 
7087         xmlDebugDumpDTD(output, dtd);
7088         call_tests++;
7089         des_debug_FILE_ptr(n_output, output, 0);
7090         des_xmlDtdPtr(n_dtd, dtd, 1);
7091         xmlResetLastError();
7092         if (mem_base != xmlMemBlocks()) {
7093             printf("Leak of %d blocks found in xmlDebugDumpDTD",
7094 	           xmlMemBlocks() - mem_base);
7095 	    test_ret++;
7096             printf(" %d", n_output);
7097             printf(" %d", n_dtd);
7098             printf("\n");
7099         }
7100     }
7101     }
7102     function_tests++;
7103 #endif
7104 
7105     return(test_ret);
7106 }
7107 
7108 
7109 static int
test_xmlDebugDumpDocument(void)7110 test_xmlDebugDumpDocument(void) {
7111     int test_ret = 0;
7112 
7113 #if defined(LIBXML_DEBUG_ENABLED)
7114     int mem_base;
7115     FILE * output; /* the FILE * for the output */
7116     int n_output;
7117     xmlDocPtr doc; /* the document */
7118     int n_doc;
7119 
7120     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7121     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7122         mem_base = xmlMemBlocks();
7123         output = gen_debug_FILE_ptr(n_output, 0);
7124         doc = gen_xmlDocPtr(n_doc, 1);
7125 
7126         xmlDebugDumpDocument(output, doc);
7127         call_tests++;
7128         des_debug_FILE_ptr(n_output, output, 0);
7129         des_xmlDocPtr(n_doc, doc, 1);
7130         xmlResetLastError();
7131         if (mem_base != xmlMemBlocks()) {
7132             printf("Leak of %d blocks found in xmlDebugDumpDocument",
7133 	           xmlMemBlocks() - mem_base);
7134 	    test_ret++;
7135             printf(" %d", n_output);
7136             printf(" %d", n_doc);
7137             printf("\n");
7138         }
7139     }
7140     }
7141     function_tests++;
7142 #endif
7143 
7144     return(test_ret);
7145 }
7146 
7147 
7148 static int
test_xmlDebugDumpDocumentHead(void)7149 test_xmlDebugDumpDocumentHead(void) {
7150     int test_ret = 0;
7151 
7152 #if defined(LIBXML_DEBUG_ENABLED)
7153     int mem_base;
7154     FILE * output; /* the FILE * for the output */
7155     int n_output;
7156     xmlDocPtr doc; /* the document */
7157     int n_doc;
7158 
7159     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7160     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7161         mem_base = xmlMemBlocks();
7162         output = gen_debug_FILE_ptr(n_output, 0);
7163         doc = gen_xmlDocPtr(n_doc, 1);
7164 
7165         xmlDebugDumpDocumentHead(output, doc);
7166         call_tests++;
7167         des_debug_FILE_ptr(n_output, output, 0);
7168         des_xmlDocPtr(n_doc, doc, 1);
7169         xmlResetLastError();
7170         if (mem_base != xmlMemBlocks()) {
7171             printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7172 	           xmlMemBlocks() - mem_base);
7173 	    test_ret++;
7174             printf(" %d", n_output);
7175             printf(" %d", n_doc);
7176             printf("\n");
7177         }
7178     }
7179     }
7180     function_tests++;
7181 #endif
7182 
7183     return(test_ret);
7184 }
7185 
7186 
7187 static int
test_xmlDebugDumpEntities(void)7188 test_xmlDebugDumpEntities(void) {
7189     int test_ret = 0;
7190 
7191 #if defined(LIBXML_DEBUG_ENABLED)
7192     int mem_base;
7193     FILE * output; /* the FILE * for the output */
7194     int n_output;
7195     xmlDocPtr doc; /* the document */
7196     int n_doc;
7197 
7198     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7199     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7200         mem_base = xmlMemBlocks();
7201         output = gen_debug_FILE_ptr(n_output, 0);
7202         doc = gen_xmlDocPtr(n_doc, 1);
7203 
7204         xmlDebugDumpEntities(output, doc);
7205         call_tests++;
7206         des_debug_FILE_ptr(n_output, output, 0);
7207         des_xmlDocPtr(n_doc, doc, 1);
7208         xmlResetLastError();
7209         if (mem_base != xmlMemBlocks()) {
7210             printf("Leak of %d blocks found in xmlDebugDumpEntities",
7211 	           xmlMemBlocks() - mem_base);
7212 	    test_ret++;
7213             printf(" %d", n_output);
7214             printf(" %d", n_doc);
7215             printf("\n");
7216         }
7217     }
7218     }
7219     function_tests++;
7220 #endif
7221 
7222     return(test_ret);
7223 }
7224 
7225 
7226 static int
test_xmlDebugDumpNode(void)7227 test_xmlDebugDumpNode(void) {
7228     int test_ret = 0;
7229 
7230 #if defined(LIBXML_DEBUG_ENABLED)
7231     int mem_base;
7232     FILE * output; /* the FILE * for the output */
7233     int n_output;
7234     xmlNodePtr node; /* the node */
7235     int n_node;
7236     int depth; /* the indentation level. */
7237     int n_depth;
7238 
7239     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7240     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7241     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7242         mem_base = xmlMemBlocks();
7243         output = gen_debug_FILE_ptr(n_output, 0);
7244         node = gen_xmlNodePtr(n_node, 1);
7245         depth = gen_int(n_depth, 2);
7246 
7247         xmlDebugDumpNode(output, node, depth);
7248         call_tests++;
7249         des_debug_FILE_ptr(n_output, output, 0);
7250         des_xmlNodePtr(n_node, node, 1);
7251         des_int(n_depth, depth, 2);
7252         xmlResetLastError();
7253         if (mem_base != xmlMemBlocks()) {
7254             printf("Leak of %d blocks found in xmlDebugDumpNode",
7255 	           xmlMemBlocks() - mem_base);
7256 	    test_ret++;
7257             printf(" %d", n_output);
7258             printf(" %d", n_node);
7259             printf(" %d", n_depth);
7260             printf("\n");
7261         }
7262     }
7263     }
7264     }
7265     function_tests++;
7266 #endif
7267 
7268     return(test_ret);
7269 }
7270 
7271 
7272 static int
test_xmlDebugDumpNodeList(void)7273 test_xmlDebugDumpNodeList(void) {
7274     int test_ret = 0;
7275 
7276 #if defined(LIBXML_DEBUG_ENABLED)
7277     int mem_base;
7278     FILE * output; /* the FILE * for the output */
7279     int n_output;
7280     xmlNodePtr node; /* the node list */
7281     int n_node;
7282     int depth; /* the indentation level. */
7283     int n_depth;
7284 
7285     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7286     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7287     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7288         mem_base = xmlMemBlocks();
7289         output = gen_debug_FILE_ptr(n_output, 0);
7290         node = gen_xmlNodePtr(n_node, 1);
7291         depth = gen_int(n_depth, 2);
7292 
7293         xmlDebugDumpNodeList(output, node, depth);
7294         call_tests++;
7295         des_debug_FILE_ptr(n_output, output, 0);
7296         des_xmlNodePtr(n_node, node, 1);
7297         des_int(n_depth, depth, 2);
7298         xmlResetLastError();
7299         if (mem_base != xmlMemBlocks()) {
7300             printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7301 	           xmlMemBlocks() - mem_base);
7302 	    test_ret++;
7303             printf(" %d", n_output);
7304             printf(" %d", n_node);
7305             printf(" %d", n_depth);
7306             printf("\n");
7307         }
7308     }
7309     }
7310     }
7311     function_tests++;
7312 #endif
7313 
7314     return(test_ret);
7315 }
7316 
7317 
7318 static int
test_xmlDebugDumpOneNode(void)7319 test_xmlDebugDumpOneNode(void) {
7320     int test_ret = 0;
7321 
7322 #if defined(LIBXML_DEBUG_ENABLED)
7323     int mem_base;
7324     FILE * output; /* the FILE * for the output */
7325     int n_output;
7326     xmlNodePtr node; /* the node */
7327     int n_node;
7328     int depth; /* the indentation level. */
7329     int n_depth;
7330 
7331     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7332     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7333     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7334         mem_base = xmlMemBlocks();
7335         output = gen_debug_FILE_ptr(n_output, 0);
7336         node = gen_xmlNodePtr(n_node, 1);
7337         depth = gen_int(n_depth, 2);
7338 
7339         xmlDebugDumpOneNode(output, node, depth);
7340         call_tests++;
7341         des_debug_FILE_ptr(n_output, output, 0);
7342         des_xmlNodePtr(n_node, node, 1);
7343         des_int(n_depth, depth, 2);
7344         xmlResetLastError();
7345         if (mem_base != xmlMemBlocks()) {
7346             printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7347 	           xmlMemBlocks() - mem_base);
7348 	    test_ret++;
7349             printf(" %d", n_output);
7350             printf(" %d", n_node);
7351             printf(" %d", n_depth);
7352             printf("\n");
7353         }
7354     }
7355     }
7356     }
7357     function_tests++;
7358 #endif
7359 
7360     return(test_ret);
7361 }
7362 
7363 
7364 static int
test_xmlDebugDumpString(void)7365 test_xmlDebugDumpString(void) {
7366     int test_ret = 0;
7367 
7368 #if defined(LIBXML_DEBUG_ENABLED)
7369     int mem_base;
7370     FILE * output; /* the FILE * for the output */
7371     int n_output;
7372     xmlChar * str; /* the string */
7373     int n_str;
7374 
7375     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7376     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7377         mem_base = xmlMemBlocks();
7378         output = gen_debug_FILE_ptr(n_output, 0);
7379         str = gen_const_xmlChar_ptr(n_str, 1);
7380 
7381         xmlDebugDumpString(output, (const xmlChar *)str);
7382         call_tests++;
7383         des_debug_FILE_ptr(n_output, output, 0);
7384         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7385         xmlResetLastError();
7386         if (mem_base != xmlMemBlocks()) {
7387             printf("Leak of %d blocks found in xmlDebugDumpString",
7388 	           xmlMemBlocks() - mem_base);
7389 	    test_ret++;
7390             printf(" %d", n_output);
7391             printf(" %d", n_str);
7392             printf("\n");
7393         }
7394     }
7395     }
7396     function_tests++;
7397 #endif
7398 
7399     return(test_ret);
7400 }
7401 
7402 
7403 static int
test_xmlLsCountNode(void)7404 test_xmlLsCountNode(void) {
7405     int test_ret = 0;
7406 
7407 #if defined(LIBXML_DEBUG_ENABLED)
7408     int mem_base;
7409     int ret_val;
7410     xmlNodePtr node; /* the node to count */
7411     int n_node;
7412 
7413     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7414         mem_base = xmlMemBlocks();
7415         node = gen_xmlNodePtr(n_node, 0);
7416 
7417         ret_val = xmlLsCountNode(node);
7418         desret_int(ret_val);
7419         call_tests++;
7420         des_xmlNodePtr(n_node, node, 0);
7421         xmlResetLastError();
7422         if (mem_base != xmlMemBlocks()) {
7423             printf("Leak of %d blocks found in xmlLsCountNode",
7424 	           xmlMemBlocks() - mem_base);
7425 	    test_ret++;
7426             printf(" %d", n_node);
7427             printf("\n");
7428         }
7429     }
7430     function_tests++;
7431 #endif
7432 
7433     return(test_ret);
7434 }
7435 
7436 
7437 static int
test_xmlLsOneNode(void)7438 test_xmlLsOneNode(void) {
7439     int test_ret = 0;
7440 
7441 #if defined(LIBXML_DEBUG_ENABLED)
7442     int mem_base;
7443     FILE * output; /* the FILE * for the output */
7444     int n_output;
7445     xmlNodePtr node; /* the node to dump */
7446     int n_node;
7447 
7448     for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7449     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7450         mem_base = xmlMemBlocks();
7451         output = gen_debug_FILE_ptr(n_output, 0);
7452         node = gen_xmlNodePtr(n_node, 1);
7453 
7454         xmlLsOneNode(output, node);
7455         call_tests++;
7456         des_debug_FILE_ptr(n_output, output, 0);
7457         des_xmlNodePtr(n_node, node, 1);
7458         xmlResetLastError();
7459         if (mem_base != xmlMemBlocks()) {
7460             printf("Leak of %d blocks found in xmlLsOneNode",
7461 	           xmlMemBlocks() - mem_base);
7462 	    test_ret++;
7463             printf(" %d", n_output);
7464             printf(" %d", n_node);
7465             printf("\n");
7466         }
7467     }
7468     }
7469     function_tests++;
7470 #endif
7471 
7472     return(test_ret);
7473 }
7474 
7475 
7476 #define gen_nb_char_ptr 1
gen_char_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)7477 static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7478     return(NULL);
7479 }
des_char_ptr(int no ATTRIBUTE_UNUSED,char * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)7480 static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7481 }
7482 
7483 static int
test_xmlShell(void)7484 test_xmlShell(void) {
7485     int test_ret = 0;
7486 
7487 
7488     /* missing type support */
7489     return(test_ret);
7490 }
7491 
7492 
7493 static int
test_xmlShellBase(void)7494 test_xmlShellBase(void) {
7495     int test_ret = 0;
7496 
7497 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7498     int mem_base;
7499     int ret_val;
7500     xmlShellCtxtPtr ctxt; /* the shell context */
7501     int n_ctxt;
7502     char * arg; /* unused */
7503     int n_arg;
7504     xmlNodePtr node; /* a node */
7505     int n_node;
7506     xmlNodePtr node2; /* unused */
7507     int n_node2;
7508 
7509     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7510     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7511     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7512     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7513         mem_base = xmlMemBlocks();
7514         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7515         arg = gen_char_ptr(n_arg, 1);
7516         node = gen_xmlNodePtr(n_node, 2);
7517         node2 = gen_xmlNodePtr(n_node2, 3);
7518 
7519         ret_val = xmlShellBase(ctxt, arg, node, node2);
7520         desret_int(ret_val);
7521         call_tests++;
7522         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7523         des_char_ptr(n_arg, arg, 1);
7524         des_xmlNodePtr(n_node, node, 2);
7525         des_xmlNodePtr(n_node2, node2, 3);
7526         xmlResetLastError();
7527         if (mem_base != xmlMemBlocks()) {
7528             printf("Leak of %d blocks found in xmlShellBase",
7529 	           xmlMemBlocks() - mem_base);
7530 	    test_ret++;
7531             printf(" %d", n_ctxt);
7532             printf(" %d", n_arg);
7533             printf(" %d", n_node);
7534             printf(" %d", n_node2);
7535             printf("\n");
7536         }
7537     }
7538     }
7539     }
7540     }
7541     function_tests++;
7542 #endif
7543 
7544     return(test_ret);
7545 }
7546 
7547 
7548 static int
test_xmlShellCat(void)7549 test_xmlShellCat(void) {
7550     int test_ret = 0;
7551 
7552 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7553     int mem_base;
7554     int ret_val;
7555     xmlShellCtxtPtr ctxt; /* the shell context */
7556     int n_ctxt;
7557     char * arg; /* unused */
7558     int n_arg;
7559     xmlNodePtr node; /* a node */
7560     int n_node;
7561     xmlNodePtr node2; /* unused */
7562     int n_node2;
7563 
7564     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7565     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7566     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7567     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7568         mem_base = xmlMemBlocks();
7569         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7570         arg = gen_char_ptr(n_arg, 1);
7571         node = gen_xmlNodePtr(n_node, 2);
7572         node2 = gen_xmlNodePtr(n_node2, 3);
7573 
7574         ret_val = xmlShellCat(ctxt, arg, node, node2);
7575         desret_int(ret_val);
7576         call_tests++;
7577         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7578         des_char_ptr(n_arg, arg, 1);
7579         des_xmlNodePtr(n_node, node, 2);
7580         des_xmlNodePtr(n_node2, node2, 3);
7581         xmlResetLastError();
7582         if (mem_base != xmlMemBlocks()) {
7583             printf("Leak of %d blocks found in xmlShellCat",
7584 	           xmlMemBlocks() - mem_base);
7585 	    test_ret++;
7586             printf(" %d", n_ctxt);
7587             printf(" %d", n_arg);
7588             printf(" %d", n_node);
7589             printf(" %d", n_node2);
7590             printf("\n");
7591         }
7592     }
7593     }
7594     }
7595     }
7596     function_tests++;
7597 #endif
7598 
7599     return(test_ret);
7600 }
7601 
7602 
7603 static int
test_xmlShellDir(void)7604 test_xmlShellDir(void) {
7605     int test_ret = 0;
7606 
7607 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7608     int mem_base;
7609     int ret_val;
7610     xmlShellCtxtPtr ctxt; /* the shell context */
7611     int n_ctxt;
7612     char * arg; /* unused */
7613     int n_arg;
7614     xmlNodePtr node; /* a node */
7615     int n_node;
7616     xmlNodePtr node2; /* unused */
7617     int n_node2;
7618 
7619     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7620     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7621     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7622     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7623         mem_base = xmlMemBlocks();
7624         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7625         arg = gen_char_ptr(n_arg, 1);
7626         node = gen_xmlNodePtr(n_node, 2);
7627         node2 = gen_xmlNodePtr(n_node2, 3);
7628 
7629         ret_val = xmlShellDir(ctxt, arg, node, node2);
7630         desret_int(ret_val);
7631         call_tests++;
7632         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7633         des_char_ptr(n_arg, arg, 1);
7634         des_xmlNodePtr(n_node, node, 2);
7635         des_xmlNodePtr(n_node2, node2, 3);
7636         xmlResetLastError();
7637         if (mem_base != xmlMemBlocks()) {
7638             printf("Leak of %d blocks found in xmlShellDir",
7639 	           xmlMemBlocks() - mem_base);
7640 	    test_ret++;
7641             printf(" %d", n_ctxt);
7642             printf(" %d", n_arg);
7643             printf(" %d", n_node);
7644             printf(" %d", n_node2);
7645             printf("\n");
7646         }
7647     }
7648     }
7649     }
7650     }
7651     function_tests++;
7652 #endif
7653 
7654     return(test_ret);
7655 }
7656 
7657 
7658 static int
test_xmlShellDu(void)7659 test_xmlShellDu(void) {
7660     int test_ret = 0;
7661 
7662 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7663     int mem_base;
7664     int ret_val;
7665     xmlShellCtxtPtr ctxt; /* the shell context */
7666     int n_ctxt;
7667     char * arg; /* unused */
7668     int n_arg;
7669     xmlNodePtr tree; /* a node defining a subtree */
7670     int n_tree;
7671     xmlNodePtr node2; /* unused */
7672     int n_node2;
7673 
7674     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7675     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7676     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7677     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7678         mem_base = xmlMemBlocks();
7679         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7680         arg = gen_char_ptr(n_arg, 1);
7681         tree = gen_xmlNodePtr(n_tree, 2);
7682         node2 = gen_xmlNodePtr(n_node2, 3);
7683 
7684         ret_val = xmlShellDu(ctxt, arg, tree, node2);
7685         desret_int(ret_val);
7686         call_tests++;
7687         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7688         des_char_ptr(n_arg, arg, 1);
7689         des_xmlNodePtr(n_tree, tree, 2);
7690         des_xmlNodePtr(n_node2, node2, 3);
7691         xmlResetLastError();
7692         if (mem_base != xmlMemBlocks()) {
7693             printf("Leak of %d blocks found in xmlShellDu",
7694 	           xmlMemBlocks() - mem_base);
7695 	    test_ret++;
7696             printf(" %d", n_ctxt);
7697             printf(" %d", n_arg);
7698             printf(" %d", n_tree);
7699             printf(" %d", n_node2);
7700             printf("\n");
7701         }
7702     }
7703     }
7704     }
7705     }
7706     function_tests++;
7707 #endif
7708 
7709     return(test_ret);
7710 }
7711 
7712 
7713 static int
test_xmlShellList(void)7714 test_xmlShellList(void) {
7715     int test_ret = 0;
7716 
7717 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7718     int mem_base;
7719     int ret_val;
7720     xmlShellCtxtPtr ctxt; /* the shell context */
7721     int n_ctxt;
7722     char * arg; /* unused */
7723     int n_arg;
7724     xmlNodePtr node; /* a node */
7725     int n_node;
7726     xmlNodePtr node2; /* unused */
7727     int n_node2;
7728 
7729     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7730     for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7731     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7732     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7733         mem_base = xmlMemBlocks();
7734         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7735         arg = gen_char_ptr(n_arg, 1);
7736         node = gen_xmlNodePtr(n_node, 2);
7737         node2 = gen_xmlNodePtr(n_node2, 3);
7738 
7739         ret_val = xmlShellList(ctxt, arg, node, node2);
7740         desret_int(ret_val);
7741         call_tests++;
7742         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7743         des_char_ptr(n_arg, arg, 1);
7744         des_xmlNodePtr(n_node, node, 2);
7745         des_xmlNodePtr(n_node2, node2, 3);
7746         xmlResetLastError();
7747         if (mem_base != xmlMemBlocks()) {
7748             printf("Leak of %d blocks found in xmlShellList",
7749 	           xmlMemBlocks() - mem_base);
7750 	    test_ret++;
7751             printf(" %d", n_ctxt);
7752             printf(" %d", n_arg);
7753             printf(" %d", n_node);
7754             printf(" %d", n_node2);
7755             printf("\n");
7756         }
7757     }
7758     }
7759     }
7760     }
7761     function_tests++;
7762 #endif
7763 
7764     return(test_ret);
7765 }
7766 
7767 
7768 static int
test_xmlShellLoad(void)7769 test_xmlShellLoad(void) {
7770     int test_ret = 0;
7771 
7772 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7773     int mem_base;
7774     int ret_val;
7775     xmlShellCtxtPtr ctxt; /* the shell context */
7776     int n_ctxt;
7777     char * filename; /* the file name */
7778     int n_filename;
7779     xmlNodePtr node; /* unused */
7780     int n_node;
7781     xmlNodePtr node2; /* unused */
7782     int n_node2;
7783 
7784     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7785     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7786     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7787     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7788         mem_base = xmlMemBlocks();
7789         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7790         filename = gen_char_ptr(n_filename, 1);
7791         node = gen_xmlNodePtr(n_node, 2);
7792         node2 = gen_xmlNodePtr(n_node2, 3);
7793 
7794         ret_val = xmlShellLoad(ctxt, filename, node, node2);
7795         desret_int(ret_val);
7796         call_tests++;
7797         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7798         des_char_ptr(n_filename, filename, 1);
7799         des_xmlNodePtr(n_node, node, 2);
7800         des_xmlNodePtr(n_node2, node2, 3);
7801         xmlResetLastError();
7802         if (mem_base != xmlMemBlocks()) {
7803             printf("Leak of %d blocks found in xmlShellLoad",
7804 	           xmlMemBlocks() - mem_base);
7805 	    test_ret++;
7806             printf(" %d", n_ctxt);
7807             printf(" %d", n_filename);
7808             printf(" %d", n_node);
7809             printf(" %d", n_node2);
7810             printf("\n");
7811         }
7812     }
7813     }
7814     }
7815     }
7816     function_tests++;
7817 #endif
7818 
7819     return(test_ret);
7820 }
7821 
7822 
7823 static int
test_xmlShellPrintXPathResult(void)7824 test_xmlShellPrintXPathResult(void) {
7825     int test_ret = 0;
7826 
7827 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7828     int mem_base;
7829     xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7830     int n_list;
7831 
7832     for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7833         mem_base = xmlMemBlocks();
7834         list = gen_xmlXPathObjectPtr(n_list, 0);
7835 
7836         xmlShellPrintXPathResult(list);
7837         call_tests++;
7838         des_xmlXPathObjectPtr(n_list, list, 0);
7839         xmlResetLastError();
7840         if (mem_base != xmlMemBlocks()) {
7841             printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7842 	           xmlMemBlocks() - mem_base);
7843 	    test_ret++;
7844             printf(" %d", n_list);
7845             printf("\n");
7846         }
7847     }
7848     function_tests++;
7849 #endif
7850 
7851     return(test_ret);
7852 }
7853 
7854 
7855 static int
test_xmlShellPwd(void)7856 test_xmlShellPwd(void) {
7857     int test_ret = 0;
7858 
7859 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7860     int mem_base;
7861     int ret_val;
7862     xmlShellCtxtPtr ctxt; /* the shell context */
7863     int n_ctxt;
7864     char * buffer; /* the output buffer */
7865     int n_buffer;
7866     xmlNodePtr node; /* a node */
7867     int n_node;
7868     xmlNodePtr node2; /* unused */
7869     int n_node2;
7870 
7871     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7872     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7873     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7874     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7875         mem_base = xmlMemBlocks();
7876         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7877         buffer = gen_char_ptr(n_buffer, 1);
7878         node = gen_xmlNodePtr(n_node, 2);
7879         node2 = gen_xmlNodePtr(n_node2, 3);
7880 
7881         ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7882         desret_int(ret_val);
7883         call_tests++;
7884         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7885         des_char_ptr(n_buffer, buffer, 1);
7886         des_xmlNodePtr(n_node, node, 2);
7887         des_xmlNodePtr(n_node2, node2, 3);
7888         xmlResetLastError();
7889         if (mem_base != xmlMemBlocks()) {
7890             printf("Leak of %d blocks found in xmlShellPwd",
7891 	           xmlMemBlocks() - mem_base);
7892 	    test_ret++;
7893             printf(" %d", n_ctxt);
7894             printf(" %d", n_buffer);
7895             printf(" %d", n_node);
7896             printf(" %d", n_node2);
7897             printf("\n");
7898         }
7899     }
7900     }
7901     }
7902     }
7903     function_tests++;
7904 #endif
7905 
7906     return(test_ret);
7907 }
7908 
7909 
7910 static int
test_xmlShellSave(void)7911 test_xmlShellSave(void) {
7912     int test_ret = 0;
7913 
7914 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7915     int mem_base;
7916     int ret_val;
7917     xmlShellCtxtPtr ctxt; /* the shell context */
7918     int n_ctxt;
7919     char * filename; /* the file name (optional) */
7920     int n_filename;
7921     xmlNodePtr node; /* unused */
7922     int n_node;
7923     xmlNodePtr node2; /* unused */
7924     int n_node2;
7925 
7926     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7927     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7928     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7929     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7930         mem_base = xmlMemBlocks();
7931         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7932         filename = gen_char_ptr(n_filename, 1);
7933         node = gen_xmlNodePtr(n_node, 2);
7934         node2 = gen_xmlNodePtr(n_node2, 3);
7935 
7936         ret_val = xmlShellSave(ctxt, filename, node, node2);
7937         desret_int(ret_val);
7938         call_tests++;
7939         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7940         des_char_ptr(n_filename, filename, 1);
7941         des_xmlNodePtr(n_node, node, 2);
7942         des_xmlNodePtr(n_node2, node2, 3);
7943         xmlResetLastError();
7944         if (mem_base != xmlMemBlocks()) {
7945             printf("Leak of %d blocks found in xmlShellSave",
7946 	           xmlMemBlocks() - mem_base);
7947 	    test_ret++;
7948             printf(" %d", n_ctxt);
7949             printf(" %d", n_filename);
7950             printf(" %d", n_node);
7951             printf(" %d", n_node2);
7952             printf("\n");
7953         }
7954     }
7955     }
7956     }
7957     }
7958     function_tests++;
7959 #endif
7960 
7961     return(test_ret);
7962 }
7963 
7964 
7965 static int
test_xmlShellValidate(void)7966 test_xmlShellValidate(void) {
7967     int test_ret = 0;
7968 
7969 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7970     int mem_base;
7971     int ret_val;
7972     xmlShellCtxtPtr ctxt; /* the shell context */
7973     int n_ctxt;
7974     char * dtd; /* the DTD URI (optional) */
7975     int n_dtd;
7976     xmlNodePtr node; /* unused */
7977     int n_node;
7978     xmlNodePtr node2; /* unused */
7979     int n_node2;
7980 
7981     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7982     for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7983     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7984     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7985         mem_base = xmlMemBlocks();
7986         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7987         dtd = gen_char_ptr(n_dtd, 1);
7988         node = gen_xmlNodePtr(n_node, 2);
7989         node2 = gen_xmlNodePtr(n_node2, 3);
7990 
7991         ret_val = xmlShellValidate(ctxt, dtd, node, node2);
7992         desret_int(ret_val);
7993         call_tests++;
7994         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7995         des_char_ptr(n_dtd, dtd, 1);
7996         des_xmlNodePtr(n_node, node, 2);
7997         des_xmlNodePtr(n_node2, node2, 3);
7998         xmlResetLastError();
7999         if (mem_base != xmlMemBlocks()) {
8000             printf("Leak of %d blocks found in xmlShellValidate",
8001 	           xmlMemBlocks() - mem_base);
8002 	    test_ret++;
8003             printf(" %d", n_ctxt);
8004             printf(" %d", n_dtd);
8005             printf(" %d", n_node);
8006             printf(" %d", n_node2);
8007             printf("\n");
8008         }
8009     }
8010     }
8011     }
8012     }
8013     function_tests++;
8014 #endif
8015 
8016     return(test_ret);
8017 }
8018 
8019 
8020 static int
test_xmlShellWrite(void)8021 test_xmlShellWrite(void) {
8022     int test_ret = 0;
8023 
8024 #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8025     int mem_base;
8026     int ret_val;
8027     xmlShellCtxtPtr ctxt; /* the shell context */
8028     int n_ctxt;
8029     char * filename; /* the file name */
8030     int n_filename;
8031     xmlNodePtr node; /* a node in the tree */
8032     int n_node;
8033     xmlNodePtr node2; /* unused */
8034     int n_node2;
8035 
8036     for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8037     for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8038     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8039     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8040         mem_base = xmlMemBlocks();
8041         ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8042         filename = gen_char_ptr(n_filename, 1);
8043         node = gen_xmlNodePtr(n_node, 2);
8044         node2 = gen_xmlNodePtr(n_node2, 3);
8045 
8046         ret_val = xmlShellWrite(ctxt, filename, node, node2);
8047         desret_int(ret_val);
8048         call_tests++;
8049         des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8050         des_char_ptr(n_filename, filename, 1);
8051         des_xmlNodePtr(n_node, node, 2);
8052         des_xmlNodePtr(n_node2, node2, 3);
8053         xmlResetLastError();
8054         if (mem_base != xmlMemBlocks()) {
8055             printf("Leak of %d blocks found in xmlShellWrite",
8056 	           xmlMemBlocks() - mem_base);
8057 	    test_ret++;
8058             printf(" %d", n_ctxt);
8059             printf(" %d", n_filename);
8060             printf(" %d", n_node);
8061             printf(" %d", n_node2);
8062             printf("\n");
8063         }
8064     }
8065     }
8066     }
8067     }
8068     function_tests++;
8069 #endif
8070 
8071     return(test_ret);
8072 }
8073 
8074 static int
test_debugXML(void)8075 test_debugXML(void) {
8076     int test_ret = 0;
8077 
8078     if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8079     test_ret += test_xmlBoolToText();
8080     test_ret += test_xmlDebugCheckDocument();
8081     test_ret += test_xmlDebugDumpAttr();
8082     test_ret += test_xmlDebugDumpAttrList();
8083     test_ret += test_xmlDebugDumpDTD();
8084     test_ret += test_xmlDebugDumpDocument();
8085     test_ret += test_xmlDebugDumpDocumentHead();
8086     test_ret += test_xmlDebugDumpEntities();
8087     test_ret += test_xmlDebugDumpNode();
8088     test_ret += test_xmlDebugDumpNodeList();
8089     test_ret += test_xmlDebugDumpOneNode();
8090     test_ret += test_xmlDebugDumpString();
8091     test_ret += test_xmlLsCountNode();
8092     test_ret += test_xmlLsOneNode();
8093     test_ret += test_xmlShell();
8094     test_ret += test_xmlShellBase();
8095     test_ret += test_xmlShellCat();
8096     test_ret += test_xmlShellDir();
8097     test_ret += test_xmlShellDu();
8098     test_ret += test_xmlShellList();
8099     test_ret += test_xmlShellLoad();
8100     test_ret += test_xmlShellPrintXPathResult();
8101     test_ret += test_xmlShellPwd();
8102     test_ret += test_xmlShellSave();
8103     test_ret += test_xmlShellValidate();
8104     test_ret += test_xmlShellWrite();
8105 
8106     if (test_ret != 0)
8107 	printf("Module debugXML: %d errors\n", test_ret);
8108     return(test_ret);
8109 }
8110 
8111 static int
test_xmlDictCleanup(void)8112 test_xmlDictCleanup(void) {
8113     int test_ret = 0;
8114 
8115     int mem_base;
8116 
8117         mem_base = xmlMemBlocks();
8118 
8119         xmlDictCleanup();
8120         call_tests++;
8121         xmlResetLastError();
8122         if (mem_base != xmlMemBlocks()) {
8123             printf("Leak of %d blocks found in xmlDictCleanup",
8124 	           xmlMemBlocks() - mem_base);
8125 	    test_ret++;
8126             printf("\n");
8127         }
8128     function_tests++;
8129 
8130     return(test_ret);
8131 }
8132 
8133 
8134 static int
test_xmlDictCreate(void)8135 test_xmlDictCreate(void) {
8136     int test_ret = 0;
8137 
8138     int mem_base;
8139     xmlDictPtr ret_val;
8140 
8141         mem_base = xmlMemBlocks();
8142 
8143         ret_val = xmlDictCreate();
8144         desret_xmlDictPtr(ret_val);
8145         call_tests++;
8146         xmlResetLastError();
8147         if (mem_base != xmlMemBlocks()) {
8148             printf("Leak of %d blocks found in xmlDictCreate",
8149 	           xmlMemBlocks() - mem_base);
8150 	    test_ret++;
8151             printf("\n");
8152         }
8153     function_tests++;
8154 
8155     return(test_ret);
8156 }
8157 
8158 
8159 static int
test_xmlDictCreateSub(void)8160 test_xmlDictCreateSub(void) {
8161     int test_ret = 0;
8162 
8163     int mem_base;
8164     xmlDictPtr ret_val;
8165     xmlDictPtr sub; /* an existing dictionnary */
8166     int n_sub;
8167 
8168     for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8169         mem_base = xmlMemBlocks();
8170         sub = gen_xmlDictPtr(n_sub, 0);
8171 
8172         ret_val = xmlDictCreateSub(sub);
8173         desret_xmlDictPtr(ret_val);
8174         call_tests++;
8175         des_xmlDictPtr(n_sub, sub, 0);
8176         xmlResetLastError();
8177         if (mem_base != xmlMemBlocks()) {
8178             printf("Leak of %d blocks found in xmlDictCreateSub",
8179 	           xmlMemBlocks() - mem_base);
8180 	    test_ret++;
8181             printf(" %d", n_sub);
8182             printf("\n");
8183         }
8184     }
8185     function_tests++;
8186 
8187     return(test_ret);
8188 }
8189 
8190 
8191 static int
test_xmlDictExists(void)8192 test_xmlDictExists(void) {
8193     int test_ret = 0;
8194 
8195     int mem_base;
8196     const xmlChar * ret_val;
8197     xmlDictPtr dict; /* the dictionnary */
8198     int n_dict;
8199     xmlChar * name; /* the name of the userdata */
8200     int n_name;
8201     int len; /* the length of the name, if -1 it is recomputed */
8202     int n_len;
8203 
8204     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8205     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8206     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8207         mem_base = xmlMemBlocks();
8208         dict = gen_xmlDictPtr(n_dict, 0);
8209         name = gen_const_xmlChar_ptr(n_name, 1);
8210         len = gen_int(n_len, 2);
8211 
8212         ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8213         desret_const_xmlChar_ptr(ret_val);
8214         call_tests++;
8215         des_xmlDictPtr(n_dict, dict, 0);
8216         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8217         des_int(n_len, len, 2);
8218         xmlResetLastError();
8219         if (mem_base != xmlMemBlocks()) {
8220             printf("Leak of %d blocks found in xmlDictExists",
8221 	           xmlMemBlocks() - mem_base);
8222 	    test_ret++;
8223             printf(" %d", n_dict);
8224             printf(" %d", n_name);
8225             printf(" %d", n_len);
8226             printf("\n");
8227         }
8228     }
8229     }
8230     }
8231     function_tests++;
8232 
8233     return(test_ret);
8234 }
8235 
8236 
8237 static int
test_xmlDictLookup(void)8238 test_xmlDictLookup(void) {
8239     int test_ret = 0;
8240 
8241     int mem_base;
8242     const xmlChar * ret_val;
8243     xmlDictPtr dict; /* the dictionnary */
8244     int n_dict;
8245     xmlChar * name; /* the name of the userdata */
8246     int n_name;
8247     int len; /* the length of the name, if -1 it is recomputed */
8248     int n_len;
8249 
8250     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8251     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8252     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8253         mem_base = xmlMemBlocks();
8254         dict = gen_xmlDictPtr(n_dict, 0);
8255         name = gen_const_xmlChar_ptr(n_name, 1);
8256         len = gen_int(n_len, 2);
8257 
8258         ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8259         desret_const_xmlChar_ptr(ret_val);
8260         call_tests++;
8261         des_xmlDictPtr(n_dict, dict, 0);
8262         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8263         des_int(n_len, len, 2);
8264         xmlResetLastError();
8265         if (mem_base != xmlMemBlocks()) {
8266             printf("Leak of %d blocks found in xmlDictLookup",
8267 	           xmlMemBlocks() - mem_base);
8268 	    test_ret++;
8269             printf(" %d", n_dict);
8270             printf(" %d", n_name);
8271             printf(" %d", n_len);
8272             printf("\n");
8273         }
8274     }
8275     }
8276     }
8277     function_tests++;
8278 
8279     return(test_ret);
8280 }
8281 
8282 
8283 static int
test_xmlDictOwns(void)8284 test_xmlDictOwns(void) {
8285     int test_ret = 0;
8286 
8287     int mem_base;
8288     int ret_val;
8289     xmlDictPtr dict; /* the dictionnary */
8290     int n_dict;
8291     xmlChar * str; /* the string */
8292     int n_str;
8293 
8294     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8295     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8296         mem_base = xmlMemBlocks();
8297         dict = gen_xmlDictPtr(n_dict, 0);
8298         str = gen_const_xmlChar_ptr(n_str, 1);
8299 
8300         ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8301         desret_int(ret_val);
8302         call_tests++;
8303         des_xmlDictPtr(n_dict, dict, 0);
8304         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8305         xmlResetLastError();
8306         if (mem_base != xmlMemBlocks()) {
8307             printf("Leak of %d blocks found in xmlDictOwns",
8308 	           xmlMemBlocks() - mem_base);
8309 	    test_ret++;
8310             printf(" %d", n_dict);
8311             printf(" %d", n_str);
8312             printf("\n");
8313         }
8314     }
8315     }
8316     function_tests++;
8317 
8318     return(test_ret);
8319 }
8320 
8321 
8322 static int
test_xmlDictQLookup(void)8323 test_xmlDictQLookup(void) {
8324     int test_ret = 0;
8325 
8326     int mem_base;
8327     const xmlChar * ret_val;
8328     xmlDictPtr dict; /* the dictionnary */
8329     int n_dict;
8330     xmlChar * prefix; /* the prefix */
8331     int n_prefix;
8332     xmlChar * name; /* the name */
8333     int n_name;
8334 
8335     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8336     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8337     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8338         mem_base = xmlMemBlocks();
8339         dict = gen_xmlDictPtr(n_dict, 0);
8340         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8341         name = gen_const_xmlChar_ptr(n_name, 2);
8342 
8343         ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8344         desret_const_xmlChar_ptr(ret_val);
8345         call_tests++;
8346         des_xmlDictPtr(n_dict, dict, 0);
8347         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8348         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8349         xmlResetLastError();
8350         if (mem_base != xmlMemBlocks()) {
8351             printf("Leak of %d blocks found in xmlDictQLookup",
8352 	           xmlMemBlocks() - mem_base);
8353 	    test_ret++;
8354             printf(" %d", n_dict);
8355             printf(" %d", n_prefix);
8356             printf(" %d", n_name);
8357             printf("\n");
8358         }
8359     }
8360     }
8361     }
8362     function_tests++;
8363 
8364     return(test_ret);
8365 }
8366 
8367 
8368 static int
test_xmlDictReference(void)8369 test_xmlDictReference(void) {
8370     int test_ret = 0;
8371 
8372     int mem_base;
8373     int ret_val;
8374     xmlDictPtr dict; /* the dictionnary */
8375     int n_dict;
8376 
8377     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8378         mem_base = xmlMemBlocks();
8379         dict = gen_xmlDictPtr(n_dict, 0);
8380 
8381         ret_val = xmlDictReference(dict);
8382         xmlDictFree(dict);
8383         desret_int(ret_val);
8384         call_tests++;
8385         des_xmlDictPtr(n_dict, dict, 0);
8386         xmlResetLastError();
8387         if (mem_base != xmlMemBlocks()) {
8388             printf("Leak of %d blocks found in xmlDictReference",
8389 	           xmlMemBlocks() - mem_base);
8390 	    test_ret++;
8391             printf(" %d", n_dict);
8392             printf("\n");
8393         }
8394     }
8395     function_tests++;
8396 
8397     return(test_ret);
8398 }
8399 
8400 
8401 static int
test_xmlDictSize(void)8402 test_xmlDictSize(void) {
8403     int test_ret = 0;
8404 
8405     int mem_base;
8406     int ret_val;
8407     xmlDictPtr dict; /* the dictionnary */
8408     int n_dict;
8409 
8410     for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8411         mem_base = xmlMemBlocks();
8412         dict = gen_xmlDictPtr(n_dict, 0);
8413 
8414         ret_val = xmlDictSize(dict);
8415         desret_int(ret_val);
8416         call_tests++;
8417         des_xmlDictPtr(n_dict, dict, 0);
8418         xmlResetLastError();
8419         if (mem_base != xmlMemBlocks()) {
8420             printf("Leak of %d blocks found in xmlDictSize",
8421 	           xmlMemBlocks() - mem_base);
8422 	    test_ret++;
8423             printf(" %d", n_dict);
8424             printf("\n");
8425         }
8426     }
8427     function_tests++;
8428 
8429     return(test_ret);
8430 }
8431 
8432 static int
test_dict(void)8433 test_dict(void) {
8434     int test_ret = 0;
8435 
8436     if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8437     test_ret += test_xmlDictCleanup();
8438     test_ret += test_xmlDictCreate();
8439     test_ret += test_xmlDictCreateSub();
8440     test_ret += test_xmlDictExists();
8441     test_ret += test_xmlDictLookup();
8442     test_ret += test_xmlDictOwns();
8443     test_ret += test_xmlDictQLookup();
8444     test_ret += test_xmlDictReference();
8445     test_ret += test_xmlDictSize();
8446 
8447     if (test_ret != 0)
8448 	printf("Module dict: %d errors\n", test_ret);
8449     return(test_ret);
8450 }
8451 
8452 static int
test_UTF8Toisolat1(void)8453 test_UTF8Toisolat1(void) {
8454     int test_ret = 0;
8455 
8456 #if defined(LIBXML_OUTPUT_ENABLED)
8457 #ifdef LIBXML_OUTPUT_ENABLED
8458     int mem_base;
8459     int ret_val;
8460     unsigned char * out; /* a pointer to an array of bytes to store the result */
8461     int n_out;
8462     int * outlen; /* the length of @out */
8463     int n_outlen;
8464     unsigned char * in; /* a pointer to an array of UTF-8 chars */
8465     int n_in;
8466     int * inlen; /* the length of @in */
8467     int n_inlen;
8468 
8469     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8470     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8471     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8472     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8473         mem_base = xmlMemBlocks();
8474         out = gen_unsigned_char_ptr(n_out, 0);
8475         outlen = gen_int_ptr(n_outlen, 1);
8476         in = gen_const_unsigned_char_ptr(n_in, 2);
8477         inlen = gen_int_ptr(n_inlen, 3);
8478 
8479         ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8480         desret_int(ret_val);
8481         call_tests++;
8482         des_unsigned_char_ptr(n_out, out, 0);
8483         des_int_ptr(n_outlen, outlen, 1);
8484         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8485         des_int_ptr(n_inlen, inlen, 3);
8486         xmlResetLastError();
8487         if (mem_base != xmlMemBlocks()) {
8488             printf("Leak of %d blocks found in UTF8Toisolat1",
8489 	           xmlMemBlocks() - mem_base);
8490 	    test_ret++;
8491             printf(" %d", n_out);
8492             printf(" %d", n_outlen);
8493             printf(" %d", n_in);
8494             printf(" %d", n_inlen);
8495             printf("\n");
8496         }
8497     }
8498     }
8499     }
8500     }
8501     function_tests++;
8502 #endif
8503 #endif
8504 
8505     return(test_ret);
8506 }
8507 
8508 
8509 static int
test_isolat1ToUTF8(void)8510 test_isolat1ToUTF8(void) {
8511     int test_ret = 0;
8512 
8513     int mem_base;
8514     int ret_val;
8515     unsigned char * out; /* a pointer to an array of bytes to store the result */
8516     int n_out;
8517     int * outlen; /* the length of @out */
8518     int n_outlen;
8519     unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8520     int n_in;
8521     int * inlen; /* the length of @in */
8522     int n_inlen;
8523 
8524     for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8525     for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8526     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8527     for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8528         mem_base = xmlMemBlocks();
8529         out = gen_unsigned_char_ptr(n_out, 0);
8530         outlen = gen_int_ptr(n_outlen, 1);
8531         in = gen_const_unsigned_char_ptr(n_in, 2);
8532         inlen = gen_int_ptr(n_inlen, 3);
8533 
8534         ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8535         desret_int(ret_val);
8536         call_tests++;
8537         des_unsigned_char_ptr(n_out, out, 0);
8538         des_int_ptr(n_outlen, outlen, 1);
8539         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8540         des_int_ptr(n_inlen, inlen, 3);
8541         xmlResetLastError();
8542         if (mem_base != xmlMemBlocks()) {
8543             printf("Leak of %d blocks found in isolat1ToUTF8",
8544 	           xmlMemBlocks() - mem_base);
8545 	    test_ret++;
8546             printf(" %d", n_out);
8547             printf(" %d", n_outlen);
8548             printf(" %d", n_in);
8549             printf(" %d", n_inlen);
8550             printf("\n");
8551         }
8552     }
8553     }
8554     }
8555     }
8556     function_tests++;
8557 
8558     return(test_ret);
8559 }
8560 
8561 
8562 static int
test_xmlAddEncodingAlias(void)8563 test_xmlAddEncodingAlias(void) {
8564     int test_ret = 0;
8565 
8566     int ret_val;
8567     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8568     int n_name;
8569     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8570     int n_alias;
8571 
8572     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8573     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8574         name = gen_const_char_ptr(n_name, 0);
8575         alias = gen_const_char_ptr(n_alias, 1);
8576 
8577         ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8578         desret_int(ret_val);
8579         call_tests++;
8580         des_const_char_ptr(n_name, (const char *)name, 0);
8581         des_const_char_ptr(n_alias, (const char *)alias, 1);
8582         xmlResetLastError();
8583     }
8584     }
8585     function_tests++;
8586 
8587     return(test_ret);
8588 }
8589 
8590 
8591 #define gen_nb_xmlCharEncodingHandler_ptr 1
gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)8592 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8593     return(NULL);
8594 }
des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED,xmlCharEncodingHandler * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)8595 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8596 }
8597 
8598 static int
test_xmlCharEncCloseFunc(void)8599 test_xmlCharEncCloseFunc(void) {
8600     int test_ret = 0;
8601 
8602     int mem_base;
8603     int ret_val;
8604     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8605     int n_handler;
8606 
8607     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8608         mem_base = xmlMemBlocks();
8609         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8610 
8611         ret_val = xmlCharEncCloseFunc(handler);
8612         desret_int(ret_val);
8613         call_tests++;
8614         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8615         xmlResetLastError();
8616         if (mem_base != xmlMemBlocks()) {
8617             printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8618 	           xmlMemBlocks() - mem_base);
8619 	    test_ret++;
8620             printf(" %d", n_handler);
8621             printf("\n");
8622         }
8623     }
8624     function_tests++;
8625 
8626     return(test_ret);
8627 }
8628 
8629 
8630 static int
test_xmlCharEncFirstLine(void)8631 test_xmlCharEncFirstLine(void) {
8632     int test_ret = 0;
8633 
8634     int mem_base;
8635     int ret_val;
8636     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8637     int n_handler;
8638     xmlBufferPtr out; /* an xmlBuffer for the output. */
8639     int n_out;
8640     xmlBufferPtr in; /* an xmlBuffer for the input */
8641     int n_in;
8642 
8643     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8644     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8645     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8646         mem_base = xmlMemBlocks();
8647         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8648         out = gen_xmlBufferPtr(n_out, 1);
8649         in = gen_xmlBufferPtr(n_in, 2);
8650 
8651         ret_val = xmlCharEncFirstLine(handler, out, in);
8652         desret_int(ret_val);
8653         call_tests++;
8654         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8655         des_xmlBufferPtr(n_out, out, 1);
8656         des_xmlBufferPtr(n_in, in, 2);
8657         xmlResetLastError();
8658         if (mem_base != xmlMemBlocks()) {
8659             printf("Leak of %d blocks found in xmlCharEncFirstLine",
8660 	           xmlMemBlocks() - mem_base);
8661 	    test_ret++;
8662             printf(" %d", n_handler);
8663             printf(" %d", n_out);
8664             printf(" %d", n_in);
8665             printf("\n");
8666         }
8667     }
8668     }
8669     }
8670     function_tests++;
8671 
8672     return(test_ret);
8673 }
8674 
8675 
8676 static int
test_xmlCharEncInFunc(void)8677 test_xmlCharEncInFunc(void) {
8678     int test_ret = 0;
8679 
8680     int mem_base;
8681     int ret_val;
8682     xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8683     int n_handler;
8684     xmlBufferPtr out; /* an xmlBuffer for the output. */
8685     int n_out;
8686     xmlBufferPtr in; /* an xmlBuffer for the input */
8687     int n_in;
8688 
8689     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8690     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8691     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8692         mem_base = xmlMemBlocks();
8693         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8694         out = gen_xmlBufferPtr(n_out, 1);
8695         in = gen_xmlBufferPtr(n_in, 2);
8696 
8697         ret_val = xmlCharEncInFunc(handler, out, in);
8698         desret_int(ret_val);
8699         call_tests++;
8700         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8701         des_xmlBufferPtr(n_out, out, 1);
8702         des_xmlBufferPtr(n_in, in, 2);
8703         xmlResetLastError();
8704         if (mem_base != xmlMemBlocks()) {
8705             printf("Leak of %d blocks found in xmlCharEncInFunc",
8706 	           xmlMemBlocks() - mem_base);
8707 	    test_ret++;
8708             printf(" %d", n_handler);
8709             printf(" %d", n_out);
8710             printf(" %d", n_in);
8711             printf("\n");
8712         }
8713     }
8714     }
8715     }
8716     function_tests++;
8717 
8718     return(test_ret);
8719 }
8720 
8721 
8722 static int
test_xmlCharEncOutFunc(void)8723 test_xmlCharEncOutFunc(void) {
8724     int test_ret = 0;
8725 
8726     int mem_base;
8727     int ret_val;
8728     xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8729     int n_handler;
8730     xmlBufferPtr out; /* an xmlBuffer for the output. */
8731     int n_out;
8732     xmlBufferPtr in; /* an xmlBuffer for the input */
8733     int n_in;
8734 
8735     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8736     for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8737     for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8738         mem_base = xmlMemBlocks();
8739         handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8740         out = gen_xmlBufferPtr(n_out, 1);
8741         in = gen_xmlBufferPtr(n_in, 2);
8742 
8743         ret_val = xmlCharEncOutFunc(handler, out, in);
8744         desret_int(ret_val);
8745         call_tests++;
8746         des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8747         des_xmlBufferPtr(n_out, out, 1);
8748         des_xmlBufferPtr(n_in, in, 2);
8749         xmlResetLastError();
8750         if (mem_base != xmlMemBlocks()) {
8751             printf("Leak of %d blocks found in xmlCharEncOutFunc",
8752 	           xmlMemBlocks() - mem_base);
8753 	    test_ret++;
8754             printf(" %d", n_handler);
8755             printf(" %d", n_out);
8756             printf(" %d", n_in);
8757             printf("\n");
8758         }
8759     }
8760     }
8761     }
8762     function_tests++;
8763 
8764     return(test_ret);
8765 }
8766 
8767 
8768 static int
test_xmlCleanupCharEncodingHandlers(void)8769 test_xmlCleanupCharEncodingHandlers(void) {
8770     int test_ret = 0;
8771 
8772 
8773 
8774         xmlCleanupCharEncodingHandlers();
8775         call_tests++;
8776         xmlResetLastError();
8777     function_tests++;
8778 
8779     return(test_ret);
8780 }
8781 
8782 
8783 static int
test_xmlCleanupEncodingAliases(void)8784 test_xmlCleanupEncodingAliases(void) {
8785     int test_ret = 0;
8786 
8787     int mem_base;
8788 
8789         mem_base = xmlMemBlocks();
8790 
8791         xmlCleanupEncodingAliases();
8792         call_tests++;
8793         xmlResetLastError();
8794         if (mem_base != xmlMemBlocks()) {
8795             printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8796 	           xmlMemBlocks() - mem_base);
8797 	    test_ret++;
8798             printf("\n");
8799         }
8800     function_tests++;
8801 
8802     return(test_ret);
8803 }
8804 
8805 
8806 static int
test_xmlDelEncodingAlias(void)8807 test_xmlDelEncodingAlias(void) {
8808     int test_ret = 0;
8809 
8810     int mem_base;
8811     int ret_val;
8812     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8813     int n_alias;
8814 
8815     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8816         mem_base = xmlMemBlocks();
8817         alias = gen_const_char_ptr(n_alias, 0);
8818 
8819         ret_val = xmlDelEncodingAlias((const char *)alias);
8820         desret_int(ret_val);
8821         call_tests++;
8822         des_const_char_ptr(n_alias, (const char *)alias, 0);
8823         xmlResetLastError();
8824         if (mem_base != xmlMemBlocks()) {
8825             printf("Leak of %d blocks found in xmlDelEncodingAlias",
8826 	           xmlMemBlocks() - mem_base);
8827 	    test_ret++;
8828             printf(" %d", n_alias);
8829             printf("\n");
8830         }
8831     }
8832     function_tests++;
8833 
8834     return(test_ret);
8835 }
8836 
8837 
8838 static int
test_xmlDetectCharEncoding(void)8839 test_xmlDetectCharEncoding(void) {
8840     int test_ret = 0;
8841 
8842     int mem_base;
8843     xmlCharEncoding ret_val;
8844     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). */
8845     int n_in;
8846     int len; /* pointer to the length of the buffer */
8847     int n_len;
8848 
8849     for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8850     for (n_len = 0;n_len < gen_nb_int;n_len++) {
8851         mem_base = xmlMemBlocks();
8852         in = gen_const_unsigned_char_ptr(n_in, 0);
8853         len = gen_int(n_len, 1);
8854 
8855         ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8856         desret_xmlCharEncoding(ret_val);
8857         call_tests++;
8858         des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8859         des_int(n_len, len, 1);
8860         xmlResetLastError();
8861         if (mem_base != xmlMemBlocks()) {
8862             printf("Leak of %d blocks found in xmlDetectCharEncoding",
8863 	           xmlMemBlocks() - mem_base);
8864 	    test_ret++;
8865             printf(" %d", n_in);
8866             printf(" %d", n_len);
8867             printf("\n");
8868         }
8869     }
8870     }
8871     function_tests++;
8872 
8873     return(test_ret);
8874 }
8875 
8876 
8877 static int
test_xmlFindCharEncodingHandler(void)8878 test_xmlFindCharEncodingHandler(void) {
8879     int test_ret = 0;
8880 
8881 
8882     /* missing type support */
8883     return(test_ret);
8884 }
8885 
8886 
8887 static int
test_xmlGetCharEncodingHandler(void)8888 test_xmlGetCharEncodingHandler(void) {
8889     int test_ret = 0;
8890 
8891 
8892     /* missing type support */
8893     return(test_ret);
8894 }
8895 
8896 
8897 static int
test_xmlGetCharEncodingName(void)8898 test_xmlGetCharEncodingName(void) {
8899     int test_ret = 0;
8900 
8901     int mem_base;
8902     const char * ret_val;
8903     xmlCharEncoding enc; /* the encoding */
8904     int n_enc;
8905 
8906     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8907         mem_base = xmlMemBlocks();
8908         enc = gen_xmlCharEncoding(n_enc, 0);
8909 
8910         ret_val = xmlGetCharEncodingName(enc);
8911         desret_const_char_ptr(ret_val);
8912         call_tests++;
8913         des_xmlCharEncoding(n_enc, enc, 0);
8914         xmlResetLastError();
8915         if (mem_base != xmlMemBlocks()) {
8916             printf("Leak of %d blocks found in xmlGetCharEncodingName",
8917 	           xmlMemBlocks() - mem_base);
8918 	    test_ret++;
8919             printf(" %d", n_enc);
8920             printf("\n");
8921         }
8922     }
8923     function_tests++;
8924 
8925     return(test_ret);
8926 }
8927 
8928 
8929 static int
test_xmlGetEncodingAlias(void)8930 test_xmlGetEncodingAlias(void) {
8931     int test_ret = 0;
8932 
8933     int mem_base;
8934     const char * ret_val;
8935     char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8936     int n_alias;
8937 
8938     for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8939         mem_base = xmlMemBlocks();
8940         alias = gen_const_char_ptr(n_alias, 0);
8941 
8942         ret_val = xmlGetEncodingAlias((const char *)alias);
8943         desret_const_char_ptr(ret_val);
8944         call_tests++;
8945         des_const_char_ptr(n_alias, (const char *)alias, 0);
8946         xmlResetLastError();
8947         if (mem_base != xmlMemBlocks()) {
8948             printf("Leak of %d blocks found in xmlGetEncodingAlias",
8949 	           xmlMemBlocks() - mem_base);
8950 	    test_ret++;
8951             printf(" %d", n_alias);
8952             printf("\n");
8953         }
8954     }
8955     function_tests++;
8956 
8957     return(test_ret);
8958 }
8959 
8960 
8961 static int
test_xmlInitCharEncodingHandlers(void)8962 test_xmlInitCharEncodingHandlers(void) {
8963     int test_ret = 0;
8964 
8965 
8966 
8967         xmlInitCharEncodingHandlers();
8968         call_tests++;
8969         xmlResetLastError();
8970     function_tests++;
8971 
8972     return(test_ret);
8973 }
8974 
8975 
8976 static int
test_xmlNewCharEncodingHandler(void)8977 test_xmlNewCharEncodingHandler(void) {
8978     int test_ret = 0;
8979 
8980 
8981     /* missing type support */
8982     return(test_ret);
8983 }
8984 
8985 
8986 static int
test_xmlParseCharEncoding(void)8987 test_xmlParseCharEncoding(void) {
8988     int test_ret = 0;
8989 
8990     int mem_base;
8991     xmlCharEncoding ret_val;
8992     char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8993     int n_name;
8994 
8995     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8996         mem_base = xmlMemBlocks();
8997         name = gen_const_char_ptr(n_name, 0);
8998 
8999         ret_val = xmlParseCharEncoding((const char *)name);
9000         desret_xmlCharEncoding(ret_val);
9001         call_tests++;
9002         des_const_char_ptr(n_name, (const char *)name, 0);
9003         xmlResetLastError();
9004         if (mem_base != xmlMemBlocks()) {
9005             printf("Leak of %d blocks found in xmlParseCharEncoding",
9006 	           xmlMemBlocks() - mem_base);
9007 	    test_ret++;
9008             printf(" %d", n_name);
9009             printf("\n");
9010         }
9011     }
9012     function_tests++;
9013 
9014     return(test_ret);
9015 }
9016 
9017 
9018 #define gen_nb_xmlCharEncodingHandlerPtr 1
gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9019 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9020     return(NULL);
9021 }
des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED,xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9022 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9023 }
9024 
9025 static int
test_xmlRegisterCharEncodingHandler(void)9026 test_xmlRegisterCharEncodingHandler(void) {
9027     int test_ret = 0;
9028 
9029     int mem_base;
9030     xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9031     int n_handler;
9032 
9033     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9034         mem_base = xmlMemBlocks();
9035         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9036 
9037         xmlRegisterCharEncodingHandler(handler);
9038         call_tests++;
9039         des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9040         xmlResetLastError();
9041         if (mem_base != xmlMemBlocks()) {
9042             printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9043 	           xmlMemBlocks() - mem_base);
9044 	    test_ret++;
9045             printf(" %d", n_handler);
9046             printf("\n");
9047         }
9048     }
9049     function_tests++;
9050 
9051     return(test_ret);
9052 }
9053 
9054 static int
test_encoding(void)9055 test_encoding(void) {
9056     int test_ret = 0;
9057 
9058     if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9059     test_ret += test_UTF8Toisolat1();
9060     test_ret += test_isolat1ToUTF8();
9061     test_ret += test_xmlAddEncodingAlias();
9062     test_ret += test_xmlCharEncCloseFunc();
9063     test_ret += test_xmlCharEncFirstLine();
9064     test_ret += test_xmlCharEncInFunc();
9065     test_ret += test_xmlCharEncOutFunc();
9066     test_ret += test_xmlCleanupCharEncodingHandlers();
9067     test_ret += test_xmlCleanupEncodingAliases();
9068     test_ret += test_xmlDelEncodingAlias();
9069     test_ret += test_xmlDetectCharEncoding();
9070     test_ret += test_xmlFindCharEncodingHandler();
9071     test_ret += test_xmlGetCharEncodingHandler();
9072     test_ret += test_xmlGetCharEncodingName();
9073     test_ret += test_xmlGetEncodingAlias();
9074     test_ret += test_xmlInitCharEncodingHandlers();
9075     test_ret += test_xmlNewCharEncodingHandler();
9076     test_ret += test_xmlParseCharEncoding();
9077     test_ret += test_xmlRegisterCharEncodingHandler();
9078 
9079     if (test_ret != 0)
9080 	printf("Module encoding: %d errors\n", test_ret);
9081     return(test_ret);
9082 }
9083 
9084 static int
test_xmlAddDocEntity(void)9085 test_xmlAddDocEntity(void) {
9086     int test_ret = 0;
9087 
9088     int mem_base;
9089     xmlEntityPtr ret_val;
9090     xmlDocPtr doc; /* the document */
9091     int n_doc;
9092     xmlChar * name; /* the entity name */
9093     int n_name;
9094     int type; /* the entity type XML_xxx_yyy_ENTITY */
9095     int n_type;
9096     xmlChar * ExternalID; /* the entity external ID if available */
9097     int n_ExternalID;
9098     xmlChar * SystemID; /* the entity system ID if available */
9099     int n_SystemID;
9100     xmlChar * content; /* the entity content */
9101     int n_content;
9102 
9103     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9104     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9105     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9106     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9107     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9108     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9109         mem_base = xmlMemBlocks();
9110         doc = gen_xmlDocPtr(n_doc, 0);
9111         name = gen_const_xmlChar_ptr(n_name, 1);
9112         type = gen_int(n_type, 2);
9113         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9114         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9115         content = gen_const_xmlChar_ptr(n_content, 5);
9116 
9117         ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9118         desret_xmlEntityPtr(ret_val);
9119         call_tests++;
9120         des_xmlDocPtr(n_doc, doc, 0);
9121         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9122         des_int(n_type, type, 2);
9123         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9124         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9125         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9126         xmlResetLastError();
9127         if (mem_base != xmlMemBlocks()) {
9128             printf("Leak of %d blocks found in xmlAddDocEntity",
9129 	           xmlMemBlocks() - mem_base);
9130 	    test_ret++;
9131             printf(" %d", n_doc);
9132             printf(" %d", n_name);
9133             printf(" %d", n_type);
9134             printf(" %d", n_ExternalID);
9135             printf(" %d", n_SystemID);
9136             printf(" %d", n_content);
9137             printf("\n");
9138         }
9139     }
9140     }
9141     }
9142     }
9143     }
9144     }
9145     function_tests++;
9146 
9147     return(test_ret);
9148 }
9149 
9150 
9151 static int
test_xmlAddDtdEntity(void)9152 test_xmlAddDtdEntity(void) {
9153     int test_ret = 0;
9154 
9155     int mem_base;
9156     xmlEntityPtr ret_val;
9157     xmlDocPtr doc; /* the document */
9158     int n_doc;
9159     xmlChar * name; /* the entity name */
9160     int n_name;
9161     int type; /* the entity type XML_xxx_yyy_ENTITY */
9162     int n_type;
9163     xmlChar * ExternalID; /* the entity external ID if available */
9164     int n_ExternalID;
9165     xmlChar * SystemID; /* the entity system ID if available */
9166     int n_SystemID;
9167     xmlChar * content; /* the entity content */
9168     int n_content;
9169 
9170     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9171     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9172     for (n_type = 0;n_type < gen_nb_int;n_type++) {
9173     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9174     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9175     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9176         mem_base = xmlMemBlocks();
9177         doc = gen_xmlDocPtr(n_doc, 0);
9178         name = gen_const_xmlChar_ptr(n_name, 1);
9179         type = gen_int(n_type, 2);
9180         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9181         SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9182         content = gen_const_xmlChar_ptr(n_content, 5);
9183 
9184         ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9185         desret_xmlEntityPtr(ret_val);
9186         call_tests++;
9187         des_xmlDocPtr(n_doc, doc, 0);
9188         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9189         des_int(n_type, type, 2);
9190         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9191         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9192         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9193         xmlResetLastError();
9194         if (mem_base != xmlMemBlocks()) {
9195             printf("Leak of %d blocks found in xmlAddDtdEntity",
9196 	           xmlMemBlocks() - mem_base);
9197 	    test_ret++;
9198             printf(" %d", n_doc);
9199             printf(" %d", n_name);
9200             printf(" %d", n_type);
9201             printf(" %d", n_ExternalID);
9202             printf(" %d", n_SystemID);
9203             printf(" %d", n_content);
9204             printf("\n");
9205         }
9206     }
9207     }
9208     }
9209     }
9210     }
9211     }
9212     function_tests++;
9213 
9214     return(test_ret);
9215 }
9216 
9217 
9218 static int
test_xmlCleanupPredefinedEntities(void)9219 test_xmlCleanupPredefinedEntities(void) {
9220     int test_ret = 0;
9221 
9222 #if defined(LIBXML_LEGACY_ENABLED)
9223 #ifdef LIBXML_LEGACY_ENABLED
9224     int mem_base;
9225 
9226         mem_base = xmlMemBlocks();
9227 
9228         xmlCleanupPredefinedEntities();
9229         call_tests++;
9230         xmlResetLastError();
9231         if (mem_base != xmlMemBlocks()) {
9232             printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9233 	           xmlMemBlocks() - mem_base);
9234 	    test_ret++;
9235             printf("\n");
9236         }
9237     function_tests++;
9238 #endif
9239 #endif
9240 
9241     return(test_ret);
9242 }
9243 
9244 
9245 #define gen_nb_xmlEntitiesTablePtr 1
gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9246 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9247     return(NULL);
9248 }
des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED,xmlEntitiesTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9249 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9250 }
9251 
9252 static int
test_xmlCopyEntitiesTable(void)9253 test_xmlCopyEntitiesTable(void) {
9254     int test_ret = 0;
9255 
9256 
9257     /* missing type support */
9258     return(test_ret);
9259 }
9260 
9261 
9262 static int
test_xmlCreateEntitiesTable(void)9263 test_xmlCreateEntitiesTable(void) {
9264     int test_ret = 0;
9265 
9266 
9267     /* missing type support */
9268     return(test_ret);
9269 }
9270 
9271 
9272 static int
test_xmlDumpEntitiesTable(void)9273 test_xmlDumpEntitiesTable(void) {
9274     int test_ret = 0;
9275 
9276 #if defined(LIBXML_OUTPUT_ENABLED)
9277     int mem_base;
9278     xmlBufferPtr buf; /* An XML buffer. */
9279     int n_buf;
9280     xmlEntitiesTablePtr table; /* An entity table */
9281     int n_table;
9282 
9283     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9284     for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9285         mem_base = xmlMemBlocks();
9286         buf = gen_xmlBufferPtr(n_buf, 0);
9287         table = gen_xmlEntitiesTablePtr(n_table, 1);
9288 
9289         xmlDumpEntitiesTable(buf, table);
9290         call_tests++;
9291         des_xmlBufferPtr(n_buf, buf, 0);
9292         des_xmlEntitiesTablePtr(n_table, table, 1);
9293         xmlResetLastError();
9294         if (mem_base != xmlMemBlocks()) {
9295             printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9296 	           xmlMemBlocks() - mem_base);
9297 	    test_ret++;
9298             printf(" %d", n_buf);
9299             printf(" %d", n_table);
9300             printf("\n");
9301         }
9302     }
9303     }
9304     function_tests++;
9305 #endif
9306 
9307     return(test_ret);
9308 }
9309 
9310 
9311 #define gen_nb_xmlEntityPtr 1
gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9312 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9313     return(NULL);
9314 }
des_xmlEntityPtr(int no ATTRIBUTE_UNUSED,xmlEntityPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)9315 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9316 }
9317 
9318 static int
test_xmlDumpEntityDecl(void)9319 test_xmlDumpEntityDecl(void) {
9320     int test_ret = 0;
9321 
9322 #if defined(LIBXML_OUTPUT_ENABLED)
9323     int mem_base;
9324     xmlBufferPtr buf; /* An XML buffer. */
9325     int n_buf;
9326     xmlEntityPtr ent; /* An entity table */
9327     int n_ent;
9328 
9329     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9330     for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9331         mem_base = xmlMemBlocks();
9332         buf = gen_xmlBufferPtr(n_buf, 0);
9333         ent = gen_xmlEntityPtr(n_ent, 1);
9334 
9335         xmlDumpEntityDecl(buf, ent);
9336         call_tests++;
9337         des_xmlBufferPtr(n_buf, buf, 0);
9338         des_xmlEntityPtr(n_ent, ent, 1);
9339         xmlResetLastError();
9340         if (mem_base != xmlMemBlocks()) {
9341             printf("Leak of %d blocks found in xmlDumpEntityDecl",
9342 	           xmlMemBlocks() - mem_base);
9343 	    test_ret++;
9344             printf(" %d", n_buf);
9345             printf(" %d", n_ent);
9346             printf("\n");
9347         }
9348     }
9349     }
9350     function_tests++;
9351 #endif
9352 
9353     return(test_ret);
9354 }
9355 
9356 
9357 static int
test_xmlEncodeEntitiesReentrant(void)9358 test_xmlEncodeEntitiesReentrant(void) {
9359     int test_ret = 0;
9360 
9361     int mem_base;
9362     xmlChar * ret_val;
9363     xmlDocPtr doc; /* the document containing the string */
9364     int n_doc;
9365     xmlChar * input; /* A string to convert to XML. */
9366     int n_input;
9367 
9368     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9369     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9370         mem_base = xmlMemBlocks();
9371         doc = gen_xmlDocPtr(n_doc, 0);
9372         input = gen_const_xmlChar_ptr(n_input, 1);
9373 
9374         ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9375         desret_xmlChar_ptr(ret_val);
9376         call_tests++;
9377         des_xmlDocPtr(n_doc, doc, 0);
9378         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9379         xmlResetLastError();
9380         if (mem_base != xmlMemBlocks()) {
9381             printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9382 	           xmlMemBlocks() - mem_base);
9383 	    test_ret++;
9384             printf(" %d", n_doc);
9385             printf(" %d", n_input);
9386             printf("\n");
9387         }
9388     }
9389     }
9390     function_tests++;
9391 
9392     return(test_ret);
9393 }
9394 
9395 
9396 static int
test_xmlEncodeSpecialChars(void)9397 test_xmlEncodeSpecialChars(void) {
9398     int test_ret = 0;
9399 
9400     int mem_base;
9401     xmlChar * ret_val;
9402     xmlDocPtr doc; /* the document containing the string */
9403     int n_doc;
9404     xmlChar * input; /* A string to convert to XML. */
9405     int n_input;
9406 
9407     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9408     for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9409         mem_base = xmlMemBlocks();
9410         doc = gen_xmlDocPtr(n_doc, 0);
9411         input = gen_const_xmlChar_ptr(n_input, 1);
9412 
9413         ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9414         desret_xmlChar_ptr(ret_val);
9415         call_tests++;
9416         des_xmlDocPtr(n_doc, doc, 0);
9417         des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9418         xmlResetLastError();
9419         if (mem_base != xmlMemBlocks()) {
9420             printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9421 	           xmlMemBlocks() - mem_base);
9422 	    test_ret++;
9423             printf(" %d", n_doc);
9424             printf(" %d", n_input);
9425             printf("\n");
9426         }
9427     }
9428     }
9429     function_tests++;
9430 
9431     return(test_ret);
9432 }
9433 
9434 
9435 static int
test_xmlGetDocEntity(void)9436 test_xmlGetDocEntity(void) {
9437     int test_ret = 0;
9438 
9439     int mem_base;
9440     xmlEntityPtr ret_val;
9441     xmlDocPtr doc; /* the document referencing the entity */
9442     int n_doc;
9443     xmlChar * name; /* the entity name */
9444     int n_name;
9445 
9446     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9447     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9448         mem_base = xmlMemBlocks();
9449         doc = gen_xmlDocPtr(n_doc, 0);
9450         name = gen_const_xmlChar_ptr(n_name, 1);
9451 
9452         ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9453         desret_xmlEntityPtr(ret_val);
9454         call_tests++;
9455         des_xmlDocPtr(n_doc, doc, 0);
9456         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9457         xmlResetLastError();
9458         if (mem_base != xmlMemBlocks()) {
9459             printf("Leak of %d blocks found in xmlGetDocEntity",
9460 	           xmlMemBlocks() - mem_base);
9461 	    test_ret++;
9462             printf(" %d", n_doc);
9463             printf(" %d", n_name);
9464             printf("\n");
9465         }
9466     }
9467     }
9468     function_tests++;
9469 
9470     return(test_ret);
9471 }
9472 
9473 
9474 static int
test_xmlGetDtdEntity(void)9475 test_xmlGetDtdEntity(void) {
9476     int test_ret = 0;
9477 
9478     int mem_base;
9479     xmlEntityPtr ret_val;
9480     xmlDocPtr doc; /* the document referencing the entity */
9481     int n_doc;
9482     xmlChar * name; /* the entity name */
9483     int n_name;
9484 
9485     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9486     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9487         mem_base = xmlMemBlocks();
9488         doc = gen_xmlDocPtr(n_doc, 0);
9489         name = gen_const_xmlChar_ptr(n_name, 1);
9490 
9491         ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9492         desret_xmlEntityPtr(ret_val);
9493         call_tests++;
9494         des_xmlDocPtr(n_doc, doc, 0);
9495         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9496         xmlResetLastError();
9497         if (mem_base != xmlMemBlocks()) {
9498             printf("Leak of %d blocks found in xmlGetDtdEntity",
9499 	           xmlMemBlocks() - mem_base);
9500 	    test_ret++;
9501             printf(" %d", n_doc);
9502             printf(" %d", n_name);
9503             printf("\n");
9504         }
9505     }
9506     }
9507     function_tests++;
9508 
9509     return(test_ret);
9510 }
9511 
9512 
9513 static int
test_xmlGetParameterEntity(void)9514 test_xmlGetParameterEntity(void) {
9515     int test_ret = 0;
9516 
9517     int mem_base;
9518     xmlEntityPtr ret_val;
9519     xmlDocPtr doc; /* the document referencing the entity */
9520     int n_doc;
9521     xmlChar * name; /* the entity name */
9522     int n_name;
9523 
9524     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9525     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9526         mem_base = xmlMemBlocks();
9527         doc = gen_xmlDocPtr(n_doc, 0);
9528         name = gen_const_xmlChar_ptr(n_name, 1);
9529 
9530         ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9531         desret_xmlEntityPtr(ret_val);
9532         call_tests++;
9533         des_xmlDocPtr(n_doc, doc, 0);
9534         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9535         xmlResetLastError();
9536         if (mem_base != xmlMemBlocks()) {
9537             printf("Leak of %d blocks found in xmlGetParameterEntity",
9538 	           xmlMemBlocks() - mem_base);
9539 	    test_ret++;
9540             printf(" %d", n_doc);
9541             printf(" %d", n_name);
9542             printf("\n");
9543         }
9544     }
9545     }
9546     function_tests++;
9547 
9548     return(test_ret);
9549 }
9550 
9551 
9552 static int
test_xmlGetPredefinedEntity(void)9553 test_xmlGetPredefinedEntity(void) {
9554     int test_ret = 0;
9555 
9556     int mem_base;
9557     xmlEntityPtr ret_val;
9558     xmlChar * name; /* the entity name */
9559     int n_name;
9560 
9561     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9562         mem_base = xmlMemBlocks();
9563         name = gen_const_xmlChar_ptr(n_name, 0);
9564 
9565         ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9566         desret_xmlEntityPtr(ret_val);
9567         call_tests++;
9568         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9569         xmlResetLastError();
9570         if (mem_base != xmlMemBlocks()) {
9571             printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9572 	           xmlMemBlocks() - mem_base);
9573 	    test_ret++;
9574             printf(" %d", n_name);
9575             printf("\n");
9576         }
9577     }
9578     function_tests++;
9579 
9580     return(test_ret);
9581 }
9582 
9583 
9584 static int
test_xmlInitializePredefinedEntities(void)9585 test_xmlInitializePredefinedEntities(void) {
9586     int test_ret = 0;
9587 
9588 #if defined(LIBXML_LEGACY_ENABLED)
9589 #ifdef LIBXML_LEGACY_ENABLED
9590     int mem_base;
9591 
9592         mem_base = xmlMemBlocks();
9593 
9594         xmlInitializePredefinedEntities();
9595         call_tests++;
9596         xmlResetLastError();
9597         if (mem_base != xmlMemBlocks()) {
9598             printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9599 	           xmlMemBlocks() - mem_base);
9600 	    test_ret++;
9601             printf("\n");
9602         }
9603     function_tests++;
9604 #endif
9605 #endif
9606 
9607     return(test_ret);
9608 }
9609 
9610 static int
test_entities(void)9611 test_entities(void) {
9612     int test_ret = 0;
9613 
9614     if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
9615     test_ret += test_xmlAddDocEntity();
9616     test_ret += test_xmlAddDtdEntity();
9617     test_ret += test_xmlCleanupPredefinedEntities();
9618     test_ret += test_xmlCopyEntitiesTable();
9619     test_ret += test_xmlCreateEntitiesTable();
9620     test_ret += test_xmlDumpEntitiesTable();
9621     test_ret += test_xmlDumpEntityDecl();
9622     test_ret += test_xmlEncodeEntitiesReentrant();
9623     test_ret += test_xmlEncodeSpecialChars();
9624     test_ret += test_xmlGetDocEntity();
9625     test_ret += test_xmlGetDtdEntity();
9626     test_ret += test_xmlGetParameterEntity();
9627     test_ret += test_xmlGetPredefinedEntity();
9628     test_ret += test_xmlInitializePredefinedEntities();
9629 
9630     if (test_ret != 0)
9631 	printf("Module entities: %d errors\n", test_ret);
9632     return(test_ret);
9633 }
9634 
9635 static int
test_xmlHashAddEntry(void)9636 test_xmlHashAddEntry(void) {
9637     int test_ret = 0;
9638 
9639     int mem_base;
9640     int ret_val;
9641     xmlHashTablePtr table; /* the hash table */
9642     int n_table;
9643     xmlChar * name; /* the name of the userdata */
9644     int n_name;
9645     void * userdata; /* a pointer to the userdata */
9646     int n_userdata;
9647 
9648     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9649     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9650     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9651         mem_base = xmlMemBlocks();
9652         table = gen_xmlHashTablePtr(n_table, 0);
9653         name = gen_const_xmlChar_ptr(n_name, 1);
9654         userdata = gen_userdata(n_userdata, 2);
9655 
9656         ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9657         desret_int(ret_val);
9658         call_tests++;
9659         des_xmlHashTablePtr(n_table, table, 0);
9660         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9661         des_userdata(n_userdata, userdata, 2);
9662         xmlResetLastError();
9663         if (mem_base != xmlMemBlocks()) {
9664             printf("Leak of %d blocks found in xmlHashAddEntry",
9665 	           xmlMemBlocks() - mem_base);
9666 	    test_ret++;
9667             printf(" %d", n_table);
9668             printf(" %d", n_name);
9669             printf(" %d", n_userdata);
9670             printf("\n");
9671         }
9672     }
9673     }
9674     }
9675     function_tests++;
9676 
9677     return(test_ret);
9678 }
9679 
9680 
9681 static int
test_xmlHashAddEntry2(void)9682 test_xmlHashAddEntry2(void) {
9683     int test_ret = 0;
9684 
9685     int mem_base;
9686     int ret_val;
9687     xmlHashTablePtr table; /* the hash table */
9688     int n_table;
9689     xmlChar * name; /* the name of the userdata */
9690     int n_name;
9691     xmlChar * name2; /* a second name of the userdata */
9692     int n_name2;
9693     void * userdata; /* a pointer to the userdata */
9694     int n_userdata;
9695 
9696     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9697     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9698     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9699     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9700         mem_base = xmlMemBlocks();
9701         table = gen_xmlHashTablePtr(n_table, 0);
9702         name = gen_const_xmlChar_ptr(n_name, 1);
9703         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9704         userdata = gen_userdata(n_userdata, 3);
9705 
9706         ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9707         desret_int(ret_val);
9708         call_tests++;
9709         des_xmlHashTablePtr(n_table, table, 0);
9710         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9711         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9712         des_userdata(n_userdata, userdata, 3);
9713         xmlResetLastError();
9714         if (mem_base != xmlMemBlocks()) {
9715             printf("Leak of %d blocks found in xmlHashAddEntry2",
9716 	           xmlMemBlocks() - mem_base);
9717 	    test_ret++;
9718             printf(" %d", n_table);
9719             printf(" %d", n_name);
9720             printf(" %d", n_name2);
9721             printf(" %d", n_userdata);
9722             printf("\n");
9723         }
9724     }
9725     }
9726     }
9727     }
9728     function_tests++;
9729 
9730     return(test_ret);
9731 }
9732 
9733 
9734 static int
test_xmlHashAddEntry3(void)9735 test_xmlHashAddEntry3(void) {
9736     int test_ret = 0;
9737 
9738     int mem_base;
9739     int ret_val;
9740     xmlHashTablePtr table; /* the hash table */
9741     int n_table;
9742     xmlChar * name; /* the name of the userdata */
9743     int n_name;
9744     xmlChar * name2; /* a second name of the userdata */
9745     int n_name2;
9746     xmlChar * name3; /* a third name of the userdata */
9747     int n_name3;
9748     void * userdata; /* a pointer to the userdata */
9749     int n_userdata;
9750 
9751     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9752     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9753     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9754     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9755     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9756         mem_base = xmlMemBlocks();
9757         table = gen_xmlHashTablePtr(n_table, 0);
9758         name = gen_const_xmlChar_ptr(n_name, 1);
9759         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9760         name3 = gen_const_xmlChar_ptr(n_name3, 3);
9761         userdata = gen_userdata(n_userdata, 4);
9762 
9763         ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9764         desret_int(ret_val);
9765         call_tests++;
9766         des_xmlHashTablePtr(n_table, table, 0);
9767         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9768         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9769         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9770         des_userdata(n_userdata, userdata, 4);
9771         xmlResetLastError();
9772         if (mem_base != xmlMemBlocks()) {
9773             printf("Leak of %d blocks found in xmlHashAddEntry3",
9774 	           xmlMemBlocks() - mem_base);
9775 	    test_ret++;
9776             printf(" %d", n_table);
9777             printf(" %d", n_name);
9778             printf(" %d", n_name2);
9779             printf(" %d", n_name3);
9780             printf(" %d", n_userdata);
9781             printf("\n");
9782         }
9783     }
9784     }
9785     }
9786     }
9787     }
9788     function_tests++;
9789 
9790     return(test_ret);
9791 }
9792 
9793 
9794 static int
test_xmlHashCopy(void)9795 test_xmlHashCopy(void) {
9796     int test_ret = 0;
9797 
9798 
9799     /* missing type support */
9800     return(test_ret);
9801 }
9802 
9803 
9804 static int
test_xmlHashCreate(void)9805 test_xmlHashCreate(void) {
9806     int test_ret = 0;
9807 
9808 
9809     /* missing type support */
9810     return(test_ret);
9811 }
9812 
9813 
9814 static int
test_xmlHashCreateDict(void)9815 test_xmlHashCreateDict(void) {
9816     int test_ret = 0;
9817 
9818 
9819     /* missing type support */
9820     return(test_ret);
9821 }
9822 
9823 
9824 static int
test_xmlHashLookup(void)9825 test_xmlHashLookup(void) {
9826     int test_ret = 0;
9827 
9828     int mem_base;
9829     void * ret_val;
9830     xmlHashTablePtr table; /* the hash table */
9831     int n_table;
9832     xmlChar * name; /* the name of the userdata */
9833     int n_name;
9834 
9835     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9836     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9837         mem_base = xmlMemBlocks();
9838         table = gen_xmlHashTablePtr(n_table, 0);
9839         name = gen_const_xmlChar_ptr(n_name, 1);
9840 
9841         ret_val = xmlHashLookup(table, (const xmlChar *)name);
9842         desret_void_ptr(ret_val);
9843         call_tests++;
9844         des_xmlHashTablePtr(n_table, table, 0);
9845         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9846         xmlResetLastError();
9847         if (mem_base != xmlMemBlocks()) {
9848             printf("Leak of %d blocks found in xmlHashLookup",
9849 	           xmlMemBlocks() - mem_base);
9850 	    test_ret++;
9851             printf(" %d", n_table);
9852             printf(" %d", n_name);
9853             printf("\n");
9854         }
9855     }
9856     }
9857     function_tests++;
9858 
9859     return(test_ret);
9860 }
9861 
9862 
9863 static int
test_xmlHashLookup2(void)9864 test_xmlHashLookup2(void) {
9865     int test_ret = 0;
9866 
9867     int mem_base;
9868     void * ret_val;
9869     xmlHashTablePtr table; /* the hash table */
9870     int n_table;
9871     xmlChar * name; /* the name of the userdata */
9872     int n_name;
9873     xmlChar * name2; /* a second name of the userdata */
9874     int n_name2;
9875 
9876     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9877     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9878     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9879         mem_base = xmlMemBlocks();
9880         table = gen_xmlHashTablePtr(n_table, 0);
9881         name = gen_const_xmlChar_ptr(n_name, 1);
9882         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9883 
9884         ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9885         desret_void_ptr(ret_val);
9886         call_tests++;
9887         des_xmlHashTablePtr(n_table, table, 0);
9888         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9889         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9890         xmlResetLastError();
9891         if (mem_base != xmlMemBlocks()) {
9892             printf("Leak of %d blocks found in xmlHashLookup2",
9893 	           xmlMemBlocks() - mem_base);
9894 	    test_ret++;
9895             printf(" %d", n_table);
9896             printf(" %d", n_name);
9897             printf(" %d", n_name2);
9898             printf("\n");
9899         }
9900     }
9901     }
9902     }
9903     function_tests++;
9904 
9905     return(test_ret);
9906 }
9907 
9908 
9909 static int
test_xmlHashLookup3(void)9910 test_xmlHashLookup3(void) {
9911     int test_ret = 0;
9912 
9913     int mem_base;
9914     void * ret_val;
9915     xmlHashTablePtr table; /* the hash table */
9916     int n_table;
9917     xmlChar * name; /* the name of the userdata */
9918     int n_name;
9919     xmlChar * name2; /* a second name of the userdata */
9920     int n_name2;
9921     xmlChar * name3; /* a third name of the userdata */
9922     int n_name3;
9923 
9924     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9925     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9926     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9927     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9928         mem_base = xmlMemBlocks();
9929         table = gen_xmlHashTablePtr(n_table, 0);
9930         name = gen_const_xmlChar_ptr(n_name, 1);
9931         name2 = gen_const_xmlChar_ptr(n_name2, 2);
9932         name3 = gen_const_xmlChar_ptr(n_name3, 3);
9933 
9934         ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
9935         desret_void_ptr(ret_val);
9936         call_tests++;
9937         des_xmlHashTablePtr(n_table, table, 0);
9938         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9939         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9940         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9941         xmlResetLastError();
9942         if (mem_base != xmlMemBlocks()) {
9943             printf("Leak of %d blocks found in xmlHashLookup3",
9944 	           xmlMemBlocks() - mem_base);
9945 	    test_ret++;
9946             printf(" %d", n_table);
9947             printf(" %d", n_name);
9948             printf(" %d", n_name2);
9949             printf(" %d", n_name3);
9950             printf("\n");
9951         }
9952     }
9953     }
9954     }
9955     }
9956     function_tests++;
9957 
9958     return(test_ret);
9959 }
9960 
9961 
9962 static int
test_xmlHashQLookup(void)9963 test_xmlHashQLookup(void) {
9964     int test_ret = 0;
9965 
9966     int mem_base;
9967     void * ret_val;
9968     xmlHashTablePtr table; /* the hash table */
9969     int n_table;
9970     xmlChar * prefix; /* the prefix of the userdata */
9971     int n_prefix;
9972     xmlChar * name; /* the name of the userdata */
9973     int n_name;
9974 
9975     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9976     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
9977     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9978         mem_base = xmlMemBlocks();
9979         table = gen_xmlHashTablePtr(n_table, 0);
9980         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
9981         name = gen_const_xmlChar_ptr(n_name, 2);
9982 
9983         ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
9984         desret_void_ptr(ret_val);
9985         call_tests++;
9986         des_xmlHashTablePtr(n_table, table, 0);
9987         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
9988         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
9989         xmlResetLastError();
9990         if (mem_base != xmlMemBlocks()) {
9991             printf("Leak of %d blocks found in xmlHashQLookup",
9992 	           xmlMemBlocks() - mem_base);
9993 	    test_ret++;
9994             printf(" %d", n_table);
9995             printf(" %d", n_prefix);
9996             printf(" %d", n_name);
9997             printf("\n");
9998         }
9999     }
10000     }
10001     }
10002     function_tests++;
10003 
10004     return(test_ret);
10005 }
10006 
10007 
10008 static int
test_xmlHashQLookup2(void)10009 test_xmlHashQLookup2(void) {
10010     int test_ret = 0;
10011 
10012     int mem_base;
10013     void * ret_val;
10014     xmlHashTablePtr table; /* the hash table */
10015     int n_table;
10016     xmlChar * prefix; /* the prefix of the userdata */
10017     int n_prefix;
10018     xmlChar * name; /* the name of the userdata */
10019     int n_name;
10020     xmlChar * prefix2; /* the second prefix of the userdata */
10021     int n_prefix2;
10022     xmlChar * name2; /* a second name of the userdata */
10023     int n_name2;
10024 
10025     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10026     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10027     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10028     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10029     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10030         mem_base = xmlMemBlocks();
10031         table = gen_xmlHashTablePtr(n_table, 0);
10032         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10033         name = gen_const_xmlChar_ptr(n_name, 2);
10034         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10035         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10036 
10037         ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10038         desret_void_ptr(ret_val);
10039         call_tests++;
10040         des_xmlHashTablePtr(n_table, table, 0);
10041         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10042         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10043         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10044         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10045         xmlResetLastError();
10046         if (mem_base != xmlMemBlocks()) {
10047             printf("Leak of %d blocks found in xmlHashQLookup2",
10048 	           xmlMemBlocks() - mem_base);
10049 	    test_ret++;
10050             printf(" %d", n_table);
10051             printf(" %d", n_prefix);
10052             printf(" %d", n_name);
10053             printf(" %d", n_prefix2);
10054             printf(" %d", n_name2);
10055             printf("\n");
10056         }
10057     }
10058     }
10059     }
10060     }
10061     }
10062     function_tests++;
10063 
10064     return(test_ret);
10065 }
10066 
10067 
10068 static int
test_xmlHashQLookup3(void)10069 test_xmlHashQLookup3(void) {
10070     int test_ret = 0;
10071 
10072     int mem_base;
10073     void * ret_val;
10074     xmlHashTablePtr table; /* the hash table */
10075     int n_table;
10076     xmlChar * prefix; /* the prefix of the userdata */
10077     int n_prefix;
10078     xmlChar * name; /* the name of the userdata */
10079     int n_name;
10080     xmlChar * prefix2; /* the second prefix of the userdata */
10081     int n_prefix2;
10082     xmlChar * name2; /* a second name of the userdata */
10083     int n_name2;
10084     xmlChar * prefix3; /* the third prefix of the userdata */
10085     int n_prefix3;
10086     xmlChar * name3; /* a third name of the userdata */
10087     int n_name3;
10088 
10089     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10090     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10091     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10092     for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10093     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10094     for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10095     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10096         mem_base = xmlMemBlocks();
10097         table = gen_xmlHashTablePtr(n_table, 0);
10098         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10099         name = gen_const_xmlChar_ptr(n_name, 2);
10100         prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10101         name2 = gen_const_xmlChar_ptr(n_name2, 4);
10102         prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10103         name3 = gen_const_xmlChar_ptr(n_name3, 6);
10104 
10105         ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10106         desret_void_ptr(ret_val);
10107         call_tests++;
10108         des_xmlHashTablePtr(n_table, table, 0);
10109         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10110         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10111         des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10112         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10113         des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10114         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10115         xmlResetLastError();
10116         if (mem_base != xmlMemBlocks()) {
10117             printf("Leak of %d blocks found in xmlHashQLookup3",
10118 	           xmlMemBlocks() - mem_base);
10119 	    test_ret++;
10120             printf(" %d", n_table);
10121             printf(" %d", n_prefix);
10122             printf(" %d", n_name);
10123             printf(" %d", n_prefix2);
10124             printf(" %d", n_name2);
10125             printf(" %d", n_prefix3);
10126             printf(" %d", n_name3);
10127             printf("\n");
10128         }
10129     }
10130     }
10131     }
10132     }
10133     }
10134     }
10135     }
10136     function_tests++;
10137 
10138     return(test_ret);
10139 }
10140 
10141 
10142 static int
test_xmlHashRemoveEntry(void)10143 test_xmlHashRemoveEntry(void) {
10144     int test_ret = 0;
10145 
10146     int mem_base;
10147     int ret_val;
10148     xmlHashTablePtr table; /* the hash table */
10149     int n_table;
10150     xmlChar * name; /* the name of the userdata */
10151     int n_name;
10152     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10153     int n_f;
10154 
10155     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10156     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10157     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10158         mem_base = xmlMemBlocks();
10159         table = gen_xmlHashTablePtr(n_table, 0);
10160         name = gen_const_xmlChar_ptr(n_name, 1);
10161         f = gen_xmlHashDeallocator(n_f, 2);
10162 
10163         ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10164         desret_int(ret_val);
10165         call_tests++;
10166         des_xmlHashTablePtr(n_table, table, 0);
10167         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10168         des_xmlHashDeallocator(n_f, f, 2);
10169         xmlResetLastError();
10170         if (mem_base != xmlMemBlocks()) {
10171             printf("Leak of %d blocks found in xmlHashRemoveEntry",
10172 	           xmlMemBlocks() - mem_base);
10173 	    test_ret++;
10174             printf(" %d", n_table);
10175             printf(" %d", n_name);
10176             printf(" %d", n_f);
10177             printf("\n");
10178         }
10179     }
10180     }
10181     }
10182     function_tests++;
10183 
10184     return(test_ret);
10185 }
10186 
10187 
10188 static int
test_xmlHashRemoveEntry2(void)10189 test_xmlHashRemoveEntry2(void) {
10190     int test_ret = 0;
10191 
10192     int mem_base;
10193     int ret_val;
10194     xmlHashTablePtr table; /* the hash table */
10195     int n_table;
10196     xmlChar * name; /* the name of the userdata */
10197     int n_name;
10198     xmlChar * name2; /* a second name of the userdata */
10199     int n_name2;
10200     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10201     int n_f;
10202 
10203     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10204     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10205     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10206     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10207         mem_base = xmlMemBlocks();
10208         table = gen_xmlHashTablePtr(n_table, 0);
10209         name = gen_const_xmlChar_ptr(n_name, 1);
10210         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10211         f = gen_xmlHashDeallocator(n_f, 3);
10212 
10213         ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10214         desret_int(ret_val);
10215         call_tests++;
10216         des_xmlHashTablePtr(n_table, table, 0);
10217         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10218         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10219         des_xmlHashDeallocator(n_f, f, 3);
10220         xmlResetLastError();
10221         if (mem_base != xmlMemBlocks()) {
10222             printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10223 	           xmlMemBlocks() - mem_base);
10224 	    test_ret++;
10225             printf(" %d", n_table);
10226             printf(" %d", n_name);
10227             printf(" %d", n_name2);
10228             printf(" %d", n_f);
10229             printf("\n");
10230         }
10231     }
10232     }
10233     }
10234     }
10235     function_tests++;
10236 
10237     return(test_ret);
10238 }
10239 
10240 
10241 static int
test_xmlHashRemoveEntry3(void)10242 test_xmlHashRemoveEntry3(void) {
10243     int test_ret = 0;
10244 
10245     int mem_base;
10246     int ret_val;
10247     xmlHashTablePtr table; /* the hash table */
10248     int n_table;
10249     xmlChar * name; /* the name of the userdata */
10250     int n_name;
10251     xmlChar * name2; /* a second name of the userdata */
10252     int n_name2;
10253     xmlChar * name3; /* a third name of the userdata */
10254     int n_name3;
10255     xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10256     int n_f;
10257 
10258     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10259     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10260     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10261     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10262     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10263         mem_base = xmlMemBlocks();
10264         table = gen_xmlHashTablePtr(n_table, 0);
10265         name = gen_const_xmlChar_ptr(n_name, 1);
10266         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10267         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10268         f = gen_xmlHashDeallocator(n_f, 4);
10269 
10270         ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10271         desret_int(ret_val);
10272         call_tests++;
10273         des_xmlHashTablePtr(n_table, table, 0);
10274         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10275         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10276         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10277         des_xmlHashDeallocator(n_f, f, 4);
10278         xmlResetLastError();
10279         if (mem_base != xmlMemBlocks()) {
10280             printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10281 	           xmlMemBlocks() - mem_base);
10282 	    test_ret++;
10283             printf(" %d", n_table);
10284             printf(" %d", n_name);
10285             printf(" %d", n_name2);
10286             printf(" %d", n_name3);
10287             printf(" %d", n_f);
10288             printf("\n");
10289         }
10290     }
10291     }
10292     }
10293     }
10294     }
10295     function_tests++;
10296 
10297     return(test_ret);
10298 }
10299 
10300 
10301 static int
test_xmlHashScan(void)10302 test_xmlHashScan(void) {
10303     int test_ret = 0;
10304 
10305 
10306     /* missing type support */
10307     return(test_ret);
10308 }
10309 
10310 
10311 static int
test_xmlHashScan3(void)10312 test_xmlHashScan3(void) {
10313     int test_ret = 0;
10314 
10315 
10316     /* missing type support */
10317     return(test_ret);
10318 }
10319 
10320 
10321 static int
test_xmlHashScanFull(void)10322 test_xmlHashScanFull(void) {
10323     int test_ret = 0;
10324 
10325 
10326     /* missing type support */
10327     return(test_ret);
10328 }
10329 
10330 
10331 static int
test_xmlHashScanFull3(void)10332 test_xmlHashScanFull3(void) {
10333     int test_ret = 0;
10334 
10335 
10336     /* missing type support */
10337     return(test_ret);
10338 }
10339 
10340 
10341 static int
test_xmlHashSize(void)10342 test_xmlHashSize(void) {
10343     int test_ret = 0;
10344 
10345     int mem_base;
10346     int ret_val;
10347     xmlHashTablePtr table; /* the hash table */
10348     int n_table;
10349 
10350     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10351         mem_base = xmlMemBlocks();
10352         table = gen_xmlHashTablePtr(n_table, 0);
10353 
10354         ret_val = xmlHashSize(table);
10355         desret_int(ret_val);
10356         call_tests++;
10357         des_xmlHashTablePtr(n_table, table, 0);
10358         xmlResetLastError();
10359         if (mem_base != xmlMemBlocks()) {
10360             printf("Leak of %d blocks found in xmlHashSize",
10361 	           xmlMemBlocks() - mem_base);
10362 	    test_ret++;
10363             printf(" %d", n_table);
10364             printf("\n");
10365         }
10366     }
10367     function_tests++;
10368 
10369     return(test_ret);
10370 }
10371 
10372 
10373 static int
test_xmlHashUpdateEntry(void)10374 test_xmlHashUpdateEntry(void) {
10375     int test_ret = 0;
10376 
10377     int mem_base;
10378     int ret_val;
10379     xmlHashTablePtr table; /* the hash table */
10380     int n_table;
10381     xmlChar * name; /* the name of the userdata */
10382     int n_name;
10383     void * userdata; /* a pointer to the userdata */
10384     int n_userdata;
10385     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10386     int n_f;
10387 
10388     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10389     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10390     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10391     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10392         mem_base = xmlMemBlocks();
10393         table = gen_xmlHashTablePtr(n_table, 0);
10394         name = gen_const_xmlChar_ptr(n_name, 1);
10395         userdata = gen_userdata(n_userdata, 2);
10396         f = gen_xmlHashDeallocator(n_f, 3);
10397 
10398         ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10399         desret_int(ret_val);
10400         call_tests++;
10401         des_xmlHashTablePtr(n_table, table, 0);
10402         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10403         des_userdata(n_userdata, userdata, 2);
10404         des_xmlHashDeallocator(n_f, f, 3);
10405         xmlResetLastError();
10406         if (mem_base != xmlMemBlocks()) {
10407             printf("Leak of %d blocks found in xmlHashUpdateEntry",
10408 	           xmlMemBlocks() - mem_base);
10409 	    test_ret++;
10410             printf(" %d", n_table);
10411             printf(" %d", n_name);
10412             printf(" %d", n_userdata);
10413             printf(" %d", n_f);
10414             printf("\n");
10415         }
10416     }
10417     }
10418     }
10419     }
10420     function_tests++;
10421 
10422     return(test_ret);
10423 }
10424 
10425 
10426 static int
test_xmlHashUpdateEntry2(void)10427 test_xmlHashUpdateEntry2(void) {
10428     int test_ret = 0;
10429 
10430     int mem_base;
10431     int ret_val;
10432     xmlHashTablePtr table; /* the hash table */
10433     int n_table;
10434     xmlChar * name; /* the name of the userdata */
10435     int n_name;
10436     xmlChar * name2; /* a second name of the userdata */
10437     int n_name2;
10438     void * userdata; /* a pointer to the userdata */
10439     int n_userdata;
10440     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10441     int n_f;
10442 
10443     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10444     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10445     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10446     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10447     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10448         mem_base = xmlMemBlocks();
10449         table = gen_xmlHashTablePtr(n_table, 0);
10450         name = gen_const_xmlChar_ptr(n_name, 1);
10451         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10452         userdata = gen_userdata(n_userdata, 3);
10453         f = gen_xmlHashDeallocator(n_f, 4);
10454 
10455         ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10456         desret_int(ret_val);
10457         call_tests++;
10458         des_xmlHashTablePtr(n_table, table, 0);
10459         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10460         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10461         des_userdata(n_userdata, userdata, 3);
10462         des_xmlHashDeallocator(n_f, f, 4);
10463         xmlResetLastError();
10464         if (mem_base != xmlMemBlocks()) {
10465             printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10466 	           xmlMemBlocks() - mem_base);
10467 	    test_ret++;
10468             printf(" %d", n_table);
10469             printf(" %d", n_name);
10470             printf(" %d", n_name2);
10471             printf(" %d", n_userdata);
10472             printf(" %d", n_f);
10473             printf("\n");
10474         }
10475     }
10476     }
10477     }
10478     }
10479     }
10480     function_tests++;
10481 
10482     return(test_ret);
10483 }
10484 
10485 
10486 static int
test_xmlHashUpdateEntry3(void)10487 test_xmlHashUpdateEntry3(void) {
10488     int test_ret = 0;
10489 
10490     int mem_base;
10491     int ret_val;
10492     xmlHashTablePtr table; /* the hash table */
10493     int n_table;
10494     xmlChar * name; /* the name of the userdata */
10495     int n_name;
10496     xmlChar * name2; /* a second name of the userdata */
10497     int n_name2;
10498     xmlChar * name3; /* a third name of the userdata */
10499     int n_name3;
10500     void * userdata; /* a pointer to the userdata */
10501     int n_userdata;
10502     xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10503     int n_f;
10504 
10505     for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10506     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10507     for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10508     for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10509     for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10510     for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10511         mem_base = xmlMemBlocks();
10512         table = gen_xmlHashTablePtr(n_table, 0);
10513         name = gen_const_xmlChar_ptr(n_name, 1);
10514         name2 = gen_const_xmlChar_ptr(n_name2, 2);
10515         name3 = gen_const_xmlChar_ptr(n_name3, 3);
10516         userdata = gen_userdata(n_userdata, 4);
10517         f = gen_xmlHashDeallocator(n_f, 5);
10518 
10519         ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10520         desret_int(ret_val);
10521         call_tests++;
10522         des_xmlHashTablePtr(n_table, table, 0);
10523         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10524         des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10525         des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10526         des_userdata(n_userdata, userdata, 4);
10527         des_xmlHashDeallocator(n_f, f, 5);
10528         xmlResetLastError();
10529         if (mem_base != xmlMemBlocks()) {
10530             printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10531 	           xmlMemBlocks() - mem_base);
10532 	    test_ret++;
10533             printf(" %d", n_table);
10534             printf(" %d", n_name);
10535             printf(" %d", n_name2);
10536             printf(" %d", n_name3);
10537             printf(" %d", n_userdata);
10538             printf(" %d", n_f);
10539             printf("\n");
10540         }
10541     }
10542     }
10543     }
10544     }
10545     }
10546     }
10547     function_tests++;
10548 
10549     return(test_ret);
10550 }
10551 
10552 static int
test_hash(void)10553 test_hash(void) {
10554     int test_ret = 0;
10555 
10556     if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10557     test_ret += test_xmlHashAddEntry();
10558     test_ret += test_xmlHashAddEntry2();
10559     test_ret += test_xmlHashAddEntry3();
10560     test_ret += test_xmlHashCopy();
10561     test_ret += test_xmlHashCreate();
10562     test_ret += test_xmlHashCreateDict();
10563     test_ret += test_xmlHashLookup();
10564     test_ret += test_xmlHashLookup2();
10565     test_ret += test_xmlHashLookup3();
10566     test_ret += test_xmlHashQLookup();
10567     test_ret += test_xmlHashQLookup2();
10568     test_ret += test_xmlHashQLookup3();
10569     test_ret += test_xmlHashRemoveEntry();
10570     test_ret += test_xmlHashRemoveEntry2();
10571     test_ret += test_xmlHashRemoveEntry3();
10572     test_ret += test_xmlHashScan();
10573     test_ret += test_xmlHashScan3();
10574     test_ret += test_xmlHashScanFull();
10575     test_ret += test_xmlHashScanFull3();
10576     test_ret += test_xmlHashSize();
10577     test_ret += test_xmlHashUpdateEntry();
10578     test_ret += test_xmlHashUpdateEntry2();
10579     test_ret += test_xmlHashUpdateEntry3();
10580 
10581     if (test_ret != 0)
10582 	printf("Module hash: %d errors\n", test_ret);
10583     return(test_ret);
10584 }
10585 
10586 #define gen_nb_xmlLinkPtr 1
gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10587 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10588     return(NULL);
10589 }
des_xmlLinkPtr(int no ATTRIBUTE_UNUSED,xmlLinkPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10590 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10591 }
10592 
10593 static int
test_xmlLinkGetData(void)10594 test_xmlLinkGetData(void) {
10595     int test_ret = 0;
10596 
10597     int mem_base;
10598     void * ret_val;
10599     xmlLinkPtr lk; /* a link */
10600     int n_lk;
10601 
10602     for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10603         mem_base = xmlMemBlocks();
10604         lk = gen_xmlLinkPtr(n_lk, 0);
10605 
10606         ret_val = xmlLinkGetData(lk);
10607         desret_void_ptr(ret_val);
10608         call_tests++;
10609         des_xmlLinkPtr(n_lk, lk, 0);
10610         xmlResetLastError();
10611         if (mem_base != xmlMemBlocks()) {
10612             printf("Leak of %d blocks found in xmlLinkGetData",
10613 	           xmlMemBlocks() - mem_base);
10614 	    test_ret++;
10615             printf(" %d", n_lk);
10616             printf("\n");
10617         }
10618     }
10619     function_tests++;
10620 
10621     return(test_ret);
10622 }
10623 
10624 
10625 static int
test_xmlListAppend(void)10626 test_xmlListAppend(void) {
10627     int test_ret = 0;
10628 
10629     int mem_base;
10630     int ret_val;
10631     xmlListPtr l; /* a list */
10632     int n_l;
10633     void * data; /* the data */
10634     int n_data;
10635 
10636     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10637     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10638         mem_base = xmlMemBlocks();
10639         l = gen_xmlListPtr(n_l, 0);
10640         data = gen_userdata(n_data, 1);
10641 
10642         ret_val = xmlListAppend(l, data);
10643         desret_int(ret_val);
10644         call_tests++;
10645         des_xmlListPtr(n_l, l, 0);
10646         des_userdata(n_data, data, 1);
10647         xmlResetLastError();
10648         if (mem_base != xmlMemBlocks()) {
10649             printf("Leak of %d blocks found in xmlListAppend",
10650 	           xmlMemBlocks() - mem_base);
10651 	    test_ret++;
10652             printf(" %d", n_l);
10653             printf(" %d", n_data);
10654             printf("\n");
10655         }
10656     }
10657     }
10658     function_tests++;
10659 
10660     return(test_ret);
10661 }
10662 
10663 
10664 static int
test_xmlListClear(void)10665 test_xmlListClear(void) {
10666     int test_ret = 0;
10667 
10668     int mem_base;
10669     xmlListPtr l; /* a list */
10670     int n_l;
10671 
10672     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10673         mem_base = xmlMemBlocks();
10674         l = gen_xmlListPtr(n_l, 0);
10675 
10676         xmlListClear(l);
10677         call_tests++;
10678         des_xmlListPtr(n_l, l, 0);
10679         xmlResetLastError();
10680         if (mem_base != xmlMemBlocks()) {
10681             printf("Leak of %d blocks found in xmlListClear",
10682 	           xmlMemBlocks() - mem_base);
10683 	    test_ret++;
10684             printf(" %d", n_l);
10685             printf("\n");
10686         }
10687     }
10688     function_tests++;
10689 
10690     return(test_ret);
10691 }
10692 
10693 
10694 #define gen_nb_const_xmlListPtr 1
gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10695 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10696     return(NULL);
10697 }
des_const_xmlListPtr(int no ATTRIBUTE_UNUSED,const xmlListPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)10698 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10699 }
10700 
10701 static int
test_xmlListCopy(void)10702 test_xmlListCopy(void) {
10703     int test_ret = 0;
10704 
10705     int mem_base;
10706     int ret_val;
10707     xmlListPtr cur; /* the new list */
10708     int n_cur;
10709     xmlListPtr old; /* the old list */
10710     int n_old;
10711 
10712     for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10713     for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10714         mem_base = xmlMemBlocks();
10715         cur = gen_xmlListPtr(n_cur, 0);
10716         old = gen_const_xmlListPtr(n_old, 1);
10717 
10718         ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10719         desret_int(ret_val);
10720         call_tests++;
10721         des_xmlListPtr(n_cur, cur, 0);
10722         des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10723         xmlResetLastError();
10724         if (mem_base != xmlMemBlocks()) {
10725             printf("Leak of %d blocks found in xmlListCopy",
10726 	           xmlMemBlocks() - mem_base);
10727 	    test_ret++;
10728             printf(" %d", n_cur);
10729             printf(" %d", n_old);
10730             printf("\n");
10731         }
10732     }
10733     }
10734     function_tests++;
10735 
10736     return(test_ret);
10737 }
10738 
10739 
10740 static int
test_xmlListCreate(void)10741 test_xmlListCreate(void) {
10742     int test_ret = 0;
10743 
10744 
10745     /* missing type support */
10746     return(test_ret);
10747 }
10748 
10749 
10750 static int
test_xmlListDup(void)10751 test_xmlListDup(void) {
10752     int test_ret = 0;
10753 
10754 
10755     /* missing type support */
10756     return(test_ret);
10757 }
10758 
10759 
10760 static int
test_xmlListEmpty(void)10761 test_xmlListEmpty(void) {
10762     int test_ret = 0;
10763 
10764     int mem_base;
10765     int ret_val;
10766     xmlListPtr l; /* a list */
10767     int n_l;
10768 
10769     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10770         mem_base = xmlMemBlocks();
10771         l = gen_xmlListPtr(n_l, 0);
10772 
10773         ret_val = xmlListEmpty(l);
10774         desret_int(ret_val);
10775         call_tests++;
10776         des_xmlListPtr(n_l, l, 0);
10777         xmlResetLastError();
10778         if (mem_base != xmlMemBlocks()) {
10779             printf("Leak of %d blocks found in xmlListEmpty",
10780 	           xmlMemBlocks() - mem_base);
10781 	    test_ret++;
10782             printf(" %d", n_l);
10783             printf("\n");
10784         }
10785     }
10786     function_tests++;
10787 
10788     return(test_ret);
10789 }
10790 
10791 
10792 static int
test_xmlListEnd(void)10793 test_xmlListEnd(void) {
10794     int test_ret = 0;
10795 
10796 
10797     /* missing type support */
10798     return(test_ret);
10799 }
10800 
10801 
10802 static int
test_xmlListFront(void)10803 test_xmlListFront(void) {
10804     int test_ret = 0;
10805 
10806 
10807     /* missing type support */
10808     return(test_ret);
10809 }
10810 
10811 
10812 static int
test_xmlListInsert(void)10813 test_xmlListInsert(void) {
10814     int test_ret = 0;
10815 
10816     int mem_base;
10817     int ret_val;
10818     xmlListPtr l; /* a list */
10819     int n_l;
10820     void * data; /* the data */
10821     int n_data;
10822 
10823     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10824     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10825         mem_base = xmlMemBlocks();
10826         l = gen_xmlListPtr(n_l, 0);
10827         data = gen_userdata(n_data, 1);
10828 
10829         ret_val = xmlListInsert(l, data);
10830         desret_int(ret_val);
10831         call_tests++;
10832         des_xmlListPtr(n_l, l, 0);
10833         des_userdata(n_data, data, 1);
10834         xmlResetLastError();
10835         if (mem_base != xmlMemBlocks()) {
10836             printf("Leak of %d blocks found in xmlListInsert",
10837 	           xmlMemBlocks() - mem_base);
10838 	    test_ret++;
10839             printf(" %d", n_l);
10840             printf(" %d", n_data);
10841             printf("\n");
10842         }
10843     }
10844     }
10845     function_tests++;
10846 
10847     return(test_ret);
10848 }
10849 
10850 
10851 static int
test_xmlListMerge(void)10852 test_xmlListMerge(void) {
10853     int test_ret = 0;
10854 
10855     int mem_base;
10856     xmlListPtr l1; /* the original list */
10857     int n_l1;
10858     xmlListPtr l2; /* the new list */
10859     int n_l2;
10860 
10861     for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10862     for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10863         mem_base = xmlMemBlocks();
10864         l1 = gen_xmlListPtr(n_l1, 0);
10865         l2 = gen_xmlListPtr(n_l2, 1);
10866 
10867         xmlListMerge(l1, l2);
10868         call_tests++;
10869         des_xmlListPtr(n_l1, l1, 0);
10870         des_xmlListPtr(n_l2, l2, 1);
10871         xmlResetLastError();
10872         if (mem_base != xmlMemBlocks()) {
10873             printf("Leak of %d blocks found in xmlListMerge",
10874 	           xmlMemBlocks() - mem_base);
10875 	    test_ret++;
10876             printf(" %d", n_l1);
10877             printf(" %d", n_l2);
10878             printf("\n");
10879         }
10880     }
10881     }
10882     function_tests++;
10883 
10884     return(test_ret);
10885 }
10886 
10887 
10888 static int
test_xmlListPopBack(void)10889 test_xmlListPopBack(void) {
10890     int test_ret = 0;
10891 
10892     int mem_base;
10893     xmlListPtr l; /* a list */
10894     int n_l;
10895 
10896     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10897         mem_base = xmlMemBlocks();
10898         l = gen_xmlListPtr(n_l, 0);
10899 
10900         xmlListPopBack(l);
10901         call_tests++;
10902         des_xmlListPtr(n_l, l, 0);
10903         xmlResetLastError();
10904         if (mem_base != xmlMemBlocks()) {
10905             printf("Leak of %d blocks found in xmlListPopBack",
10906 	           xmlMemBlocks() - mem_base);
10907 	    test_ret++;
10908             printf(" %d", n_l);
10909             printf("\n");
10910         }
10911     }
10912     function_tests++;
10913 
10914     return(test_ret);
10915 }
10916 
10917 
10918 static int
test_xmlListPopFront(void)10919 test_xmlListPopFront(void) {
10920     int test_ret = 0;
10921 
10922     int mem_base;
10923     xmlListPtr l; /* a list */
10924     int n_l;
10925 
10926     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10927         mem_base = xmlMemBlocks();
10928         l = gen_xmlListPtr(n_l, 0);
10929 
10930         xmlListPopFront(l);
10931         call_tests++;
10932         des_xmlListPtr(n_l, l, 0);
10933         xmlResetLastError();
10934         if (mem_base != xmlMemBlocks()) {
10935             printf("Leak of %d blocks found in xmlListPopFront",
10936 	           xmlMemBlocks() - mem_base);
10937 	    test_ret++;
10938             printf(" %d", n_l);
10939             printf("\n");
10940         }
10941     }
10942     function_tests++;
10943 
10944     return(test_ret);
10945 }
10946 
10947 
10948 static int
test_xmlListPushBack(void)10949 test_xmlListPushBack(void) {
10950     int test_ret = 0;
10951 
10952     int mem_base;
10953     int ret_val;
10954     xmlListPtr l; /* a list */
10955     int n_l;
10956     void * data; /* new data */
10957     int n_data;
10958 
10959     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10960     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10961         mem_base = xmlMemBlocks();
10962         l = gen_xmlListPtr(n_l, 0);
10963         data = gen_userdata(n_data, 1);
10964 
10965         ret_val = xmlListPushBack(l, data);
10966         desret_int(ret_val);
10967         call_tests++;
10968         des_xmlListPtr(n_l, l, 0);
10969         des_userdata(n_data, data, 1);
10970         xmlResetLastError();
10971         if (mem_base != xmlMemBlocks()) {
10972             printf("Leak of %d blocks found in xmlListPushBack",
10973 	           xmlMemBlocks() - mem_base);
10974 	    test_ret++;
10975             printf(" %d", n_l);
10976             printf(" %d", n_data);
10977             printf("\n");
10978         }
10979     }
10980     }
10981     function_tests++;
10982 
10983     return(test_ret);
10984 }
10985 
10986 
10987 static int
test_xmlListPushFront(void)10988 test_xmlListPushFront(void) {
10989     int test_ret = 0;
10990 
10991     int mem_base;
10992     int ret_val;
10993     xmlListPtr l; /* a list */
10994     int n_l;
10995     void * data; /* new data */
10996     int n_data;
10997 
10998     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10999     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11000         mem_base = xmlMemBlocks();
11001         l = gen_xmlListPtr(n_l, 0);
11002         data = gen_userdata(n_data, 1);
11003 
11004         ret_val = xmlListPushFront(l, data);
11005         desret_int(ret_val);
11006         call_tests++;
11007         des_xmlListPtr(n_l, l, 0);
11008         des_userdata(n_data, data, 1);
11009         xmlResetLastError();
11010         if (mem_base != xmlMemBlocks()) {
11011             printf("Leak of %d blocks found in xmlListPushFront",
11012 	           xmlMemBlocks() - mem_base);
11013 	    test_ret++;
11014             printf(" %d", n_l);
11015             printf(" %d", n_data);
11016             printf("\n");
11017         }
11018     }
11019     }
11020     function_tests++;
11021 
11022     return(test_ret);
11023 }
11024 
11025 
11026 static int
test_xmlListRemoveAll(void)11027 test_xmlListRemoveAll(void) {
11028     int test_ret = 0;
11029 
11030     int mem_base;
11031     int ret_val;
11032     xmlListPtr l; /* a list */
11033     int n_l;
11034     void * data; /* list data */
11035     int n_data;
11036 
11037     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11038     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11039         mem_base = xmlMemBlocks();
11040         l = gen_xmlListPtr(n_l, 0);
11041         data = gen_userdata(n_data, 1);
11042 
11043         ret_val = xmlListRemoveAll(l, data);
11044         desret_int(ret_val);
11045         call_tests++;
11046         des_xmlListPtr(n_l, l, 0);
11047         des_userdata(n_data, data, 1);
11048         xmlResetLastError();
11049         if (mem_base != xmlMemBlocks()) {
11050             printf("Leak of %d blocks found in xmlListRemoveAll",
11051 	           xmlMemBlocks() - mem_base);
11052 	    test_ret++;
11053             printf(" %d", n_l);
11054             printf(" %d", n_data);
11055             printf("\n");
11056         }
11057     }
11058     }
11059     function_tests++;
11060 
11061     return(test_ret);
11062 }
11063 
11064 
11065 static int
test_xmlListRemoveFirst(void)11066 test_xmlListRemoveFirst(void) {
11067     int test_ret = 0;
11068 
11069     int mem_base;
11070     int ret_val;
11071     xmlListPtr l; /* a list */
11072     int n_l;
11073     void * data; /* list data */
11074     int n_data;
11075 
11076     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11077     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11078         mem_base = xmlMemBlocks();
11079         l = gen_xmlListPtr(n_l, 0);
11080         data = gen_userdata(n_data, 1);
11081 
11082         ret_val = xmlListRemoveFirst(l, data);
11083         desret_int(ret_val);
11084         call_tests++;
11085         des_xmlListPtr(n_l, l, 0);
11086         des_userdata(n_data, data, 1);
11087         xmlResetLastError();
11088         if (mem_base != xmlMemBlocks()) {
11089             printf("Leak of %d blocks found in xmlListRemoveFirst",
11090 	           xmlMemBlocks() - mem_base);
11091 	    test_ret++;
11092             printf(" %d", n_l);
11093             printf(" %d", n_data);
11094             printf("\n");
11095         }
11096     }
11097     }
11098     function_tests++;
11099 
11100     return(test_ret);
11101 }
11102 
11103 
11104 static int
test_xmlListRemoveLast(void)11105 test_xmlListRemoveLast(void) {
11106     int test_ret = 0;
11107 
11108     int mem_base;
11109     int ret_val;
11110     xmlListPtr l; /* a list */
11111     int n_l;
11112     void * data; /* list data */
11113     int n_data;
11114 
11115     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11116     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11117         mem_base = xmlMemBlocks();
11118         l = gen_xmlListPtr(n_l, 0);
11119         data = gen_userdata(n_data, 1);
11120 
11121         ret_val = xmlListRemoveLast(l, data);
11122         desret_int(ret_val);
11123         call_tests++;
11124         des_xmlListPtr(n_l, l, 0);
11125         des_userdata(n_data, data, 1);
11126         xmlResetLastError();
11127         if (mem_base != xmlMemBlocks()) {
11128             printf("Leak of %d blocks found in xmlListRemoveLast",
11129 	           xmlMemBlocks() - mem_base);
11130 	    test_ret++;
11131             printf(" %d", n_l);
11132             printf(" %d", n_data);
11133             printf("\n");
11134         }
11135     }
11136     }
11137     function_tests++;
11138 
11139     return(test_ret);
11140 }
11141 
11142 
11143 static int
test_xmlListReverse(void)11144 test_xmlListReverse(void) {
11145     int test_ret = 0;
11146 
11147     int mem_base;
11148     xmlListPtr l; /* a list */
11149     int n_l;
11150 
11151     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11152         mem_base = xmlMemBlocks();
11153         l = gen_xmlListPtr(n_l, 0);
11154 
11155         xmlListReverse(l);
11156         call_tests++;
11157         des_xmlListPtr(n_l, l, 0);
11158         xmlResetLastError();
11159         if (mem_base != xmlMemBlocks()) {
11160             printf("Leak of %d blocks found in xmlListReverse",
11161 	           xmlMemBlocks() - mem_base);
11162 	    test_ret++;
11163             printf(" %d", n_l);
11164             printf("\n");
11165         }
11166     }
11167     function_tests++;
11168 
11169     return(test_ret);
11170 }
11171 
11172 
11173 static int
test_xmlListReverseSearch(void)11174 test_xmlListReverseSearch(void) {
11175     int test_ret = 0;
11176 
11177     int mem_base;
11178     void * ret_val;
11179     xmlListPtr l; /* a list */
11180     int n_l;
11181     void * data; /* a search value */
11182     int n_data;
11183 
11184     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11185     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11186         mem_base = xmlMemBlocks();
11187         l = gen_xmlListPtr(n_l, 0);
11188         data = gen_userdata(n_data, 1);
11189 
11190         ret_val = xmlListReverseSearch(l, data);
11191         desret_void_ptr(ret_val);
11192         call_tests++;
11193         des_xmlListPtr(n_l, l, 0);
11194         des_userdata(n_data, data, 1);
11195         xmlResetLastError();
11196         if (mem_base != xmlMemBlocks()) {
11197             printf("Leak of %d blocks found in xmlListReverseSearch",
11198 	           xmlMemBlocks() - mem_base);
11199 	    test_ret++;
11200             printf(" %d", n_l);
11201             printf(" %d", n_data);
11202             printf("\n");
11203         }
11204     }
11205     }
11206     function_tests++;
11207 
11208     return(test_ret);
11209 }
11210 
11211 
11212 static int
test_xmlListReverseWalk(void)11213 test_xmlListReverseWalk(void) {
11214     int test_ret = 0;
11215 
11216 
11217     /* missing type support */
11218     return(test_ret);
11219 }
11220 
11221 
11222 static int
test_xmlListSearch(void)11223 test_xmlListSearch(void) {
11224     int test_ret = 0;
11225 
11226     int mem_base;
11227     void * ret_val;
11228     xmlListPtr l; /* a list */
11229     int n_l;
11230     void * data; /* a search value */
11231     int n_data;
11232 
11233     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11234     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11235         mem_base = xmlMemBlocks();
11236         l = gen_xmlListPtr(n_l, 0);
11237         data = gen_userdata(n_data, 1);
11238 
11239         ret_val = xmlListSearch(l, data);
11240         desret_void_ptr(ret_val);
11241         call_tests++;
11242         des_xmlListPtr(n_l, l, 0);
11243         des_userdata(n_data, data, 1);
11244         xmlResetLastError();
11245         if (mem_base != xmlMemBlocks()) {
11246             printf("Leak of %d blocks found in xmlListSearch",
11247 	           xmlMemBlocks() - mem_base);
11248 	    test_ret++;
11249             printf(" %d", n_l);
11250             printf(" %d", n_data);
11251             printf("\n");
11252         }
11253     }
11254     }
11255     function_tests++;
11256 
11257     return(test_ret);
11258 }
11259 
11260 
11261 static int
test_xmlListSize(void)11262 test_xmlListSize(void) {
11263     int test_ret = 0;
11264 
11265     int mem_base;
11266     int ret_val;
11267     xmlListPtr l; /* a list */
11268     int n_l;
11269 
11270     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11271         mem_base = xmlMemBlocks();
11272         l = gen_xmlListPtr(n_l, 0);
11273 
11274         ret_val = xmlListSize(l);
11275         desret_int(ret_val);
11276         call_tests++;
11277         des_xmlListPtr(n_l, l, 0);
11278         xmlResetLastError();
11279         if (mem_base != xmlMemBlocks()) {
11280             printf("Leak of %d blocks found in xmlListSize",
11281 	           xmlMemBlocks() - mem_base);
11282 	    test_ret++;
11283             printf(" %d", n_l);
11284             printf("\n");
11285         }
11286     }
11287     function_tests++;
11288 
11289     return(test_ret);
11290 }
11291 
11292 
11293 static int
test_xmlListSort(void)11294 test_xmlListSort(void) {
11295     int test_ret = 0;
11296 
11297     int mem_base;
11298     xmlListPtr l; /* a list */
11299     int n_l;
11300 
11301     for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11302         mem_base = xmlMemBlocks();
11303         l = gen_xmlListPtr(n_l, 0);
11304 
11305         xmlListSort(l);
11306         call_tests++;
11307         des_xmlListPtr(n_l, l, 0);
11308         xmlResetLastError();
11309         if (mem_base != xmlMemBlocks()) {
11310             printf("Leak of %d blocks found in xmlListSort",
11311 	           xmlMemBlocks() - mem_base);
11312 	    test_ret++;
11313             printf(" %d", n_l);
11314             printf("\n");
11315         }
11316     }
11317     function_tests++;
11318 
11319     return(test_ret);
11320 }
11321 
11322 
11323 static int
test_xmlListWalk(void)11324 test_xmlListWalk(void) {
11325     int test_ret = 0;
11326 
11327 
11328     /* missing type support */
11329     return(test_ret);
11330 }
11331 
11332 static int
test_list(void)11333 test_list(void) {
11334     int test_ret = 0;
11335 
11336     if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11337     test_ret += test_xmlLinkGetData();
11338     test_ret += test_xmlListAppend();
11339     test_ret += test_xmlListClear();
11340     test_ret += test_xmlListCopy();
11341     test_ret += test_xmlListCreate();
11342     test_ret += test_xmlListDup();
11343     test_ret += test_xmlListEmpty();
11344     test_ret += test_xmlListEnd();
11345     test_ret += test_xmlListFront();
11346     test_ret += test_xmlListInsert();
11347     test_ret += test_xmlListMerge();
11348     test_ret += test_xmlListPopBack();
11349     test_ret += test_xmlListPopFront();
11350     test_ret += test_xmlListPushBack();
11351     test_ret += test_xmlListPushFront();
11352     test_ret += test_xmlListRemoveAll();
11353     test_ret += test_xmlListRemoveFirst();
11354     test_ret += test_xmlListRemoveLast();
11355     test_ret += test_xmlListReverse();
11356     test_ret += test_xmlListReverseSearch();
11357     test_ret += test_xmlListReverseWalk();
11358     test_ret += test_xmlListSearch();
11359     test_ret += test_xmlListSize();
11360     test_ret += test_xmlListSort();
11361     test_ret += test_xmlListWalk();
11362 
11363     if (test_ret != 0)
11364 	printf("Module list: %d errors\n", test_ret);
11365     return(test_ret);
11366 }
11367 
11368 static int
test_xmlNanoFTPCheckResponse(void)11369 test_xmlNanoFTPCheckResponse(void) {
11370     int test_ret = 0;
11371 
11372 #if defined(LIBXML_FTP_ENABLED)
11373     int mem_base;
11374     int ret_val;
11375     void * ctx; /* an FTP context */
11376     int n_ctx;
11377 
11378     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11379         mem_base = xmlMemBlocks();
11380         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11381 
11382         ret_val = xmlNanoFTPCheckResponse(ctx);
11383         desret_int(ret_val);
11384         call_tests++;
11385         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11386         xmlResetLastError();
11387         if (mem_base != xmlMemBlocks()) {
11388             printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11389 	           xmlMemBlocks() - mem_base);
11390 	    test_ret++;
11391             printf(" %d", n_ctx);
11392             printf("\n");
11393         }
11394     }
11395     function_tests++;
11396 #endif
11397 
11398     return(test_ret);
11399 }
11400 
11401 
11402 static int
test_xmlNanoFTPCleanup(void)11403 test_xmlNanoFTPCleanup(void) {
11404     int test_ret = 0;
11405 
11406 #if defined(LIBXML_FTP_ENABLED)
11407     int mem_base;
11408 
11409         mem_base = xmlMemBlocks();
11410 
11411         xmlNanoFTPCleanup();
11412         call_tests++;
11413         xmlResetLastError();
11414         if (mem_base != xmlMemBlocks()) {
11415             printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11416 	           xmlMemBlocks() - mem_base);
11417 	    test_ret++;
11418             printf("\n");
11419         }
11420     function_tests++;
11421 #endif
11422 
11423     return(test_ret);
11424 }
11425 
11426 
11427 static int
test_xmlNanoFTPCloseConnection(void)11428 test_xmlNanoFTPCloseConnection(void) {
11429     int test_ret = 0;
11430 
11431 #if defined(LIBXML_FTP_ENABLED)
11432     int mem_base;
11433     int ret_val;
11434     void * ctx; /* an FTP context */
11435     int n_ctx;
11436 
11437     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11438         mem_base = xmlMemBlocks();
11439         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11440 
11441         ret_val = xmlNanoFTPCloseConnection(ctx);
11442         desret_int(ret_val);
11443         call_tests++;
11444         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11445         xmlResetLastError();
11446         if (mem_base != xmlMemBlocks()) {
11447             printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11448 	           xmlMemBlocks() - mem_base);
11449 	    test_ret++;
11450             printf(" %d", n_ctx);
11451             printf("\n");
11452         }
11453     }
11454     function_tests++;
11455 #endif
11456 
11457     return(test_ret);
11458 }
11459 
11460 
11461 static int
test_xmlNanoFTPCwd(void)11462 test_xmlNanoFTPCwd(void) {
11463     int test_ret = 0;
11464 
11465 #if defined(LIBXML_FTP_ENABLED)
11466     int mem_base;
11467     int ret_val;
11468     void * ctx; /* an FTP context */
11469     int n_ctx;
11470     char * directory; /* a directory on the server */
11471     int n_directory;
11472 
11473     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11474     for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11475         mem_base = xmlMemBlocks();
11476         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11477         directory = gen_const_char_ptr(n_directory, 1);
11478 
11479         ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11480         desret_int(ret_val);
11481         call_tests++;
11482         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11483         des_const_char_ptr(n_directory, (const char *)directory, 1);
11484         xmlResetLastError();
11485         if (mem_base != xmlMemBlocks()) {
11486             printf("Leak of %d blocks found in xmlNanoFTPCwd",
11487 	           xmlMemBlocks() - mem_base);
11488 	    test_ret++;
11489             printf(" %d", n_ctx);
11490             printf(" %d", n_directory);
11491             printf("\n");
11492         }
11493     }
11494     }
11495     function_tests++;
11496 #endif
11497 
11498     return(test_ret);
11499 }
11500 
11501 
11502 static int
test_xmlNanoFTPDele(void)11503 test_xmlNanoFTPDele(void) {
11504     int test_ret = 0;
11505 
11506 #if defined(LIBXML_FTP_ENABLED)
11507     int mem_base;
11508     int ret_val;
11509     void * ctx; /* an FTP context */
11510     int n_ctx;
11511     const char * file; /* a file or directory on the server */
11512     int n_file;
11513 
11514     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11515     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11516         mem_base = xmlMemBlocks();
11517         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11518         file = gen_filepath(n_file, 1);
11519 
11520         ret_val = xmlNanoFTPDele(ctx, file);
11521         desret_int(ret_val);
11522         call_tests++;
11523         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11524         des_filepath(n_file, file, 1);
11525         xmlResetLastError();
11526         if (mem_base != xmlMemBlocks()) {
11527             printf("Leak of %d blocks found in xmlNanoFTPDele",
11528 	           xmlMemBlocks() - mem_base);
11529 	    test_ret++;
11530             printf(" %d", n_ctx);
11531             printf(" %d", n_file);
11532             printf("\n");
11533         }
11534     }
11535     }
11536     function_tests++;
11537 #endif
11538 
11539     return(test_ret);
11540 }
11541 
11542 
11543 static int
test_xmlNanoFTPGet(void)11544 test_xmlNanoFTPGet(void) {
11545     int test_ret = 0;
11546 
11547 
11548     /* missing type support */
11549     return(test_ret);
11550 }
11551 
11552 
11553 static int
test_xmlNanoFTPGetConnection(void)11554 test_xmlNanoFTPGetConnection(void) {
11555     int test_ret = 0;
11556 
11557 #if defined(LIBXML_FTP_ENABLED)
11558     int mem_base;
11559     int ret_val;
11560     void * ctx; /* an FTP context */
11561     int n_ctx;
11562 
11563     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11564         mem_base = xmlMemBlocks();
11565         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11566 
11567         ret_val = xmlNanoFTPGetConnection(ctx);
11568         desret_int(ret_val);
11569         call_tests++;
11570         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11571         xmlResetLastError();
11572         if (mem_base != xmlMemBlocks()) {
11573             printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11574 	           xmlMemBlocks() - mem_base);
11575 	    test_ret++;
11576             printf(" %d", n_ctx);
11577             printf("\n");
11578         }
11579     }
11580     function_tests++;
11581 #endif
11582 
11583     return(test_ret);
11584 }
11585 
11586 
11587 static int
test_xmlNanoFTPGetResponse(void)11588 test_xmlNanoFTPGetResponse(void) {
11589     int test_ret = 0;
11590 
11591 #if defined(LIBXML_FTP_ENABLED)
11592     int mem_base;
11593     int ret_val;
11594     void * ctx; /* an FTP context */
11595     int n_ctx;
11596 
11597     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11598         mem_base = xmlMemBlocks();
11599         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11600 
11601         ret_val = xmlNanoFTPGetResponse(ctx);
11602         desret_int(ret_val);
11603         call_tests++;
11604         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11605         xmlResetLastError();
11606         if (mem_base != xmlMemBlocks()) {
11607             printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11608 	           xmlMemBlocks() - mem_base);
11609 	    test_ret++;
11610             printf(" %d", n_ctx);
11611             printf("\n");
11612         }
11613     }
11614     function_tests++;
11615 #endif
11616 
11617     return(test_ret);
11618 }
11619 
11620 
11621 static int
test_xmlNanoFTPGetSocket(void)11622 test_xmlNanoFTPGetSocket(void) {
11623     int test_ret = 0;
11624 
11625 #if defined(LIBXML_FTP_ENABLED)
11626     int mem_base;
11627     int ret_val;
11628     void * ctx; /* an FTP context */
11629     int n_ctx;
11630     const char * filename; /* the file to retrieve (or NULL if path is in context). */
11631     int n_filename;
11632 
11633     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11634     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11635         mem_base = xmlMemBlocks();
11636         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11637         filename = gen_filepath(n_filename, 1);
11638 
11639         ret_val = xmlNanoFTPGetSocket(ctx, filename);
11640         desret_int(ret_val);
11641         call_tests++;
11642         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11643         des_filepath(n_filename, filename, 1);
11644         xmlResetLastError();
11645         if (mem_base != xmlMemBlocks()) {
11646             printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11647 	           xmlMemBlocks() - mem_base);
11648 	    test_ret++;
11649             printf(" %d", n_ctx);
11650             printf(" %d", n_filename);
11651             printf("\n");
11652         }
11653     }
11654     }
11655     function_tests++;
11656 #endif
11657 
11658     return(test_ret);
11659 }
11660 
11661 
11662 static int
test_xmlNanoFTPInit(void)11663 test_xmlNanoFTPInit(void) {
11664     int test_ret = 0;
11665 
11666 #if defined(LIBXML_FTP_ENABLED)
11667     int mem_base;
11668 
11669         mem_base = xmlMemBlocks();
11670 
11671         xmlNanoFTPInit();
11672         call_tests++;
11673         xmlResetLastError();
11674         if (mem_base != xmlMemBlocks()) {
11675             printf("Leak of %d blocks found in xmlNanoFTPInit",
11676 	           xmlMemBlocks() - mem_base);
11677 	    test_ret++;
11678             printf("\n");
11679         }
11680     function_tests++;
11681 #endif
11682 
11683     return(test_ret);
11684 }
11685 
11686 
11687 static int
test_xmlNanoFTPList(void)11688 test_xmlNanoFTPList(void) {
11689     int test_ret = 0;
11690 
11691 
11692     /* missing type support */
11693     return(test_ret);
11694 }
11695 
11696 
11697 static int
test_xmlNanoFTPNewCtxt(void)11698 test_xmlNanoFTPNewCtxt(void) {
11699     int test_ret = 0;
11700 
11701 #if defined(LIBXML_FTP_ENABLED)
11702     int mem_base;
11703     void * ret_val;
11704     const char * URL; /* The URL used to initialize the context */
11705     int n_URL;
11706 
11707     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11708         mem_base = xmlMemBlocks();
11709         URL = gen_filepath(n_URL, 0);
11710 
11711         ret_val = xmlNanoFTPNewCtxt(URL);
11712         desret_xmlNanoFTPCtxtPtr(ret_val);
11713         call_tests++;
11714         des_filepath(n_URL, URL, 0);
11715         xmlResetLastError();
11716         if (mem_base != xmlMemBlocks()) {
11717             printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11718 	           xmlMemBlocks() - mem_base);
11719 	    test_ret++;
11720             printf(" %d", n_URL);
11721             printf("\n");
11722         }
11723     }
11724     function_tests++;
11725 #endif
11726 
11727     return(test_ret);
11728 }
11729 
11730 
11731 static int
test_xmlNanoFTPOpen(void)11732 test_xmlNanoFTPOpen(void) {
11733     int test_ret = 0;
11734 
11735 #if defined(LIBXML_FTP_ENABLED)
11736     int mem_base;
11737     void * ret_val;
11738     const char * URL; /* the URL to the resource */
11739     int n_URL;
11740 
11741     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11742         mem_base = xmlMemBlocks();
11743         URL = gen_filepath(n_URL, 0);
11744 
11745         ret_val = xmlNanoFTPOpen(URL);
11746         desret_xmlNanoFTPCtxtPtr(ret_val);
11747         call_tests++;
11748         des_filepath(n_URL, URL, 0);
11749         xmlResetLastError();
11750         if (mem_base != xmlMemBlocks()) {
11751             printf("Leak of %d blocks found in xmlNanoFTPOpen",
11752 	           xmlMemBlocks() - mem_base);
11753 	    test_ret++;
11754             printf(" %d", n_URL);
11755             printf("\n");
11756         }
11757     }
11758     function_tests++;
11759 #endif
11760 
11761     return(test_ret);
11762 }
11763 
11764 
11765 static int
test_xmlNanoFTPProxy(void)11766 test_xmlNanoFTPProxy(void) {
11767     int test_ret = 0;
11768 
11769 #if defined(LIBXML_FTP_ENABLED)
11770     char * host; /* the proxy host name */
11771     int n_host;
11772     int port; /* the proxy port */
11773     int n_port;
11774     char * user; /* the proxy user name */
11775     int n_user;
11776     char * passwd; /* the proxy password */
11777     int n_passwd;
11778     int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11779     int n_type;
11780 
11781     for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11782     for (n_port = 0;n_port < gen_nb_int;n_port++) {
11783     for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11784     for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11785     for (n_type = 0;n_type < gen_nb_int;n_type++) {
11786         host = gen_const_char_ptr(n_host, 0);
11787         port = gen_int(n_port, 1);
11788         user = gen_const_char_ptr(n_user, 2);
11789         passwd = gen_const_char_ptr(n_passwd, 3);
11790         type = gen_int(n_type, 4);
11791 
11792         xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11793         call_tests++;
11794         des_const_char_ptr(n_host, (const char *)host, 0);
11795         des_int(n_port, port, 1);
11796         des_const_char_ptr(n_user, (const char *)user, 2);
11797         des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11798         des_int(n_type, type, 4);
11799         xmlResetLastError();
11800     }
11801     }
11802     }
11803     }
11804     }
11805     function_tests++;
11806 #endif
11807 
11808     return(test_ret);
11809 }
11810 
11811 
11812 static int
test_xmlNanoFTPQuit(void)11813 test_xmlNanoFTPQuit(void) {
11814     int test_ret = 0;
11815 
11816 #if defined(LIBXML_FTP_ENABLED)
11817     int mem_base;
11818     int ret_val;
11819     void * ctx; /* an FTP context */
11820     int n_ctx;
11821 
11822     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11823         mem_base = xmlMemBlocks();
11824         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11825 
11826         ret_val = xmlNanoFTPQuit(ctx);
11827         desret_int(ret_val);
11828         call_tests++;
11829         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11830         xmlResetLastError();
11831         if (mem_base != xmlMemBlocks()) {
11832             printf("Leak of %d blocks found in xmlNanoFTPQuit",
11833 	           xmlMemBlocks() - mem_base);
11834 	    test_ret++;
11835             printf(" %d", n_ctx);
11836             printf("\n");
11837         }
11838     }
11839     function_tests++;
11840 #endif
11841 
11842     return(test_ret);
11843 }
11844 
11845 
11846 static int
test_xmlNanoFTPRead(void)11847 test_xmlNanoFTPRead(void) {
11848     int test_ret = 0;
11849 
11850 #if defined(LIBXML_FTP_ENABLED)
11851     int mem_base;
11852     int ret_val;
11853     void * ctx; /* the FTP context */
11854     int n_ctx;
11855     void * dest; /* a buffer */
11856     int n_dest;
11857     int len; /* the buffer length */
11858     int n_len;
11859 
11860     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11861     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11862     for (n_len = 0;n_len < gen_nb_int;n_len++) {
11863         mem_base = xmlMemBlocks();
11864         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11865         dest = gen_void_ptr(n_dest, 1);
11866         len = gen_int(n_len, 2);
11867 
11868         ret_val = xmlNanoFTPRead(ctx, dest, len);
11869         desret_int(ret_val);
11870         call_tests++;
11871         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11872         des_void_ptr(n_dest, dest, 1);
11873         des_int(n_len, len, 2);
11874         xmlResetLastError();
11875         if (mem_base != xmlMemBlocks()) {
11876             printf("Leak of %d blocks found in xmlNanoFTPRead",
11877 	           xmlMemBlocks() - mem_base);
11878 	    test_ret++;
11879             printf(" %d", n_ctx);
11880             printf(" %d", n_dest);
11881             printf(" %d", n_len);
11882             printf("\n");
11883         }
11884     }
11885     }
11886     }
11887     function_tests++;
11888 #endif
11889 
11890     return(test_ret);
11891 }
11892 
11893 
11894 static int
test_xmlNanoFTPScanProxy(void)11895 test_xmlNanoFTPScanProxy(void) {
11896     int test_ret = 0;
11897 
11898 #if defined(LIBXML_FTP_ENABLED)
11899     const char * URL; /* The proxy URL used to initialize the proxy context */
11900     int n_URL;
11901 
11902     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11903         URL = gen_filepath(n_URL, 0);
11904 
11905         xmlNanoFTPScanProxy(URL);
11906         call_tests++;
11907         des_filepath(n_URL, URL, 0);
11908         xmlResetLastError();
11909     }
11910     function_tests++;
11911 #endif
11912 
11913     return(test_ret);
11914 }
11915 
11916 
11917 static int
test_xmlNanoFTPUpdateURL(void)11918 test_xmlNanoFTPUpdateURL(void) {
11919     int test_ret = 0;
11920 
11921 #if defined(LIBXML_FTP_ENABLED)
11922     int mem_base;
11923     int ret_val;
11924     void * ctx; /* an FTP context */
11925     int n_ctx;
11926     const char * URL; /* The URL used to update the context */
11927     int n_URL;
11928 
11929     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11930     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11931         mem_base = xmlMemBlocks();
11932         ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11933         URL = gen_filepath(n_URL, 1);
11934 
11935         ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11936         desret_int(ret_val);
11937         call_tests++;
11938         des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11939         des_filepath(n_URL, URL, 1);
11940         xmlResetLastError();
11941         if (mem_base != xmlMemBlocks()) {
11942             printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11943 	           xmlMemBlocks() - mem_base);
11944 	    test_ret++;
11945             printf(" %d", n_ctx);
11946             printf(" %d", n_URL);
11947             printf("\n");
11948         }
11949     }
11950     }
11951     function_tests++;
11952 #endif
11953 
11954     return(test_ret);
11955 }
11956 
11957 static int
test_nanoftp(void)11958 test_nanoftp(void) {
11959     int test_ret = 0;
11960 
11961     if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
11962     test_ret += test_xmlNanoFTPCheckResponse();
11963     test_ret += test_xmlNanoFTPCleanup();
11964     test_ret += test_xmlNanoFTPCloseConnection();
11965     test_ret += test_xmlNanoFTPCwd();
11966     test_ret += test_xmlNanoFTPDele();
11967     test_ret += test_xmlNanoFTPGet();
11968     test_ret += test_xmlNanoFTPGetConnection();
11969     test_ret += test_xmlNanoFTPGetResponse();
11970     test_ret += test_xmlNanoFTPGetSocket();
11971     test_ret += test_xmlNanoFTPInit();
11972     test_ret += test_xmlNanoFTPList();
11973     test_ret += test_xmlNanoFTPNewCtxt();
11974     test_ret += test_xmlNanoFTPOpen();
11975     test_ret += test_xmlNanoFTPProxy();
11976     test_ret += test_xmlNanoFTPQuit();
11977     test_ret += test_xmlNanoFTPRead();
11978     test_ret += test_xmlNanoFTPScanProxy();
11979     test_ret += test_xmlNanoFTPUpdateURL();
11980 
11981     if (test_ret != 0)
11982 	printf("Module nanoftp: %d errors\n", test_ret);
11983     return(test_ret);
11984 }
11985 
11986 static int
test_xmlNanoHTTPAuthHeader(void)11987 test_xmlNanoHTTPAuthHeader(void) {
11988     int test_ret = 0;
11989 
11990 #if defined(LIBXML_HTTP_ENABLED)
11991     int mem_base;
11992     const char * ret_val;
11993     void * ctx; /* the HTTP context */
11994     int n_ctx;
11995 
11996     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
11997         mem_base = xmlMemBlocks();
11998         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
11999 
12000         ret_val = xmlNanoHTTPAuthHeader(ctx);
12001         desret_const_char_ptr(ret_val);
12002         call_tests++;
12003         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12004         xmlResetLastError();
12005         if (mem_base != xmlMemBlocks()) {
12006             printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12007 	           xmlMemBlocks() - mem_base);
12008 	    test_ret++;
12009             printf(" %d", n_ctx);
12010             printf("\n");
12011         }
12012     }
12013     function_tests++;
12014 #endif
12015 
12016     return(test_ret);
12017 }
12018 
12019 
12020 static int
test_xmlNanoHTTPCleanup(void)12021 test_xmlNanoHTTPCleanup(void) {
12022     int test_ret = 0;
12023 
12024 #if defined(LIBXML_HTTP_ENABLED)
12025     int mem_base;
12026 
12027         mem_base = xmlMemBlocks();
12028 
12029         xmlNanoHTTPCleanup();
12030         call_tests++;
12031         xmlResetLastError();
12032         if (mem_base != xmlMemBlocks()) {
12033             printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12034 	           xmlMemBlocks() - mem_base);
12035 	    test_ret++;
12036             printf("\n");
12037         }
12038     function_tests++;
12039 #endif
12040 
12041     return(test_ret);
12042 }
12043 
12044 
12045 static int
test_xmlNanoHTTPContentLength(void)12046 test_xmlNanoHTTPContentLength(void) {
12047     int test_ret = 0;
12048 
12049 #if defined(LIBXML_HTTP_ENABLED)
12050     int mem_base;
12051     int ret_val;
12052     void * ctx; /* the HTTP context */
12053     int n_ctx;
12054 
12055     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12056         mem_base = xmlMemBlocks();
12057         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12058 
12059         ret_val = xmlNanoHTTPContentLength(ctx);
12060         desret_int(ret_val);
12061         call_tests++;
12062         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12063         xmlResetLastError();
12064         if (mem_base != xmlMemBlocks()) {
12065             printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12066 	           xmlMemBlocks() - mem_base);
12067 	    test_ret++;
12068             printf(" %d", n_ctx);
12069             printf("\n");
12070         }
12071     }
12072     function_tests++;
12073 #endif
12074 
12075     return(test_ret);
12076 }
12077 
12078 
12079 static int
test_xmlNanoHTTPEncoding(void)12080 test_xmlNanoHTTPEncoding(void) {
12081     int test_ret = 0;
12082 
12083 #if defined(LIBXML_HTTP_ENABLED)
12084     int mem_base;
12085     const char * ret_val;
12086     void * ctx; /* the HTTP context */
12087     int n_ctx;
12088 
12089     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12090         mem_base = xmlMemBlocks();
12091         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12092 
12093         ret_val = xmlNanoHTTPEncoding(ctx);
12094         desret_const_char_ptr(ret_val);
12095         call_tests++;
12096         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12097         xmlResetLastError();
12098         if (mem_base != xmlMemBlocks()) {
12099             printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12100 	           xmlMemBlocks() - mem_base);
12101 	    test_ret++;
12102             printf(" %d", n_ctx);
12103             printf("\n");
12104         }
12105     }
12106     function_tests++;
12107 #endif
12108 
12109     return(test_ret);
12110 }
12111 
12112 
12113 #define gen_nb_char_ptr_ptr 1
gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)12114 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12115     return(NULL);
12116 }
des_char_ptr_ptr(int no ATTRIBUTE_UNUSED,char ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)12117 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12118 }
12119 
12120 static int
test_xmlNanoHTTPFetch(void)12121 test_xmlNanoHTTPFetch(void) {
12122     int test_ret = 0;
12123 
12124 #if defined(LIBXML_HTTP_ENABLED)
12125     int mem_base;
12126     int ret_val;
12127     const char * URL; /* The URL to load */
12128     int n_URL;
12129     const char * filename; /* the filename where the content should be saved */
12130     int n_filename;
12131     char ** contentType; /* if available the Content-Type information will be returned at that location */
12132     int n_contentType;
12133 
12134     for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12135     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12136     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12137         mem_base = xmlMemBlocks();
12138         URL = gen_fileoutput(n_URL, 0);
12139         filename = gen_fileoutput(n_filename, 1);
12140         contentType = gen_char_ptr_ptr(n_contentType, 2);
12141 
12142         ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12143         desret_int(ret_val);
12144         call_tests++;
12145         des_fileoutput(n_URL, URL, 0);
12146         des_fileoutput(n_filename, filename, 1);
12147         des_char_ptr_ptr(n_contentType, contentType, 2);
12148         xmlResetLastError();
12149         if (mem_base != xmlMemBlocks()) {
12150             printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12151 	           xmlMemBlocks() - mem_base);
12152 	    test_ret++;
12153             printf(" %d", n_URL);
12154             printf(" %d", n_filename);
12155             printf(" %d", n_contentType);
12156             printf("\n");
12157         }
12158     }
12159     }
12160     }
12161     function_tests++;
12162 #endif
12163 
12164     return(test_ret);
12165 }
12166 
12167 
12168 static int
test_xmlNanoHTTPInit(void)12169 test_xmlNanoHTTPInit(void) {
12170     int test_ret = 0;
12171 
12172 #if defined(LIBXML_HTTP_ENABLED)
12173     int mem_base;
12174 
12175         mem_base = xmlMemBlocks();
12176 
12177         xmlNanoHTTPInit();
12178         call_tests++;
12179         xmlResetLastError();
12180         if (mem_base != xmlMemBlocks()) {
12181             printf("Leak of %d blocks found in xmlNanoHTTPInit",
12182 	           xmlMemBlocks() - mem_base);
12183 	    test_ret++;
12184             printf("\n");
12185         }
12186     function_tests++;
12187 #endif
12188 
12189     return(test_ret);
12190 }
12191 
12192 
12193 static int
test_xmlNanoHTTPMimeType(void)12194 test_xmlNanoHTTPMimeType(void) {
12195     int test_ret = 0;
12196 
12197 #if defined(LIBXML_HTTP_ENABLED)
12198     int mem_base;
12199     const char * ret_val;
12200     void * ctx; /* the HTTP context */
12201     int n_ctx;
12202 
12203     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12204         mem_base = xmlMemBlocks();
12205         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12206 
12207         ret_val = xmlNanoHTTPMimeType(ctx);
12208         desret_const_char_ptr(ret_val);
12209         call_tests++;
12210         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12211         xmlResetLastError();
12212         if (mem_base != xmlMemBlocks()) {
12213             printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12214 	           xmlMemBlocks() - mem_base);
12215 	    test_ret++;
12216             printf(" %d", n_ctx);
12217             printf("\n");
12218         }
12219     }
12220     function_tests++;
12221 #endif
12222 
12223     return(test_ret);
12224 }
12225 
12226 
12227 static int
test_xmlNanoHTTPOpen(void)12228 test_xmlNanoHTTPOpen(void) {
12229     int test_ret = 0;
12230 
12231 #if defined(LIBXML_HTTP_ENABLED)
12232     int mem_base;
12233     void * ret_val;
12234     const char * URL; /* The URL to load */
12235     int n_URL;
12236     char ** contentType; /* if available the Content-Type information will be returned at that location */
12237     int n_contentType;
12238 
12239     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12240     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12241         mem_base = xmlMemBlocks();
12242         URL = gen_filepath(n_URL, 0);
12243         contentType = gen_char_ptr_ptr(n_contentType, 1);
12244 
12245         ret_val = xmlNanoHTTPOpen(URL, contentType);
12246         desret_xmlNanoHTTPCtxtPtr(ret_val);
12247         call_tests++;
12248         des_filepath(n_URL, URL, 0);
12249         des_char_ptr_ptr(n_contentType, contentType, 1);
12250         xmlResetLastError();
12251         if (mem_base != xmlMemBlocks()) {
12252             printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12253 	           xmlMemBlocks() - mem_base);
12254 	    test_ret++;
12255             printf(" %d", n_URL);
12256             printf(" %d", n_contentType);
12257             printf("\n");
12258         }
12259     }
12260     }
12261     function_tests++;
12262 #endif
12263 
12264     return(test_ret);
12265 }
12266 
12267 
12268 static int
test_xmlNanoHTTPOpenRedir(void)12269 test_xmlNanoHTTPOpenRedir(void) {
12270     int test_ret = 0;
12271 
12272 #if defined(LIBXML_HTTP_ENABLED)
12273     int mem_base;
12274     void * ret_val;
12275     const char * URL; /* The URL to load */
12276     int n_URL;
12277     char ** contentType; /* if available the Content-Type information will be returned at that location */
12278     int n_contentType;
12279     char ** redir; /* if available the redirected URL will be returned */
12280     int n_redir;
12281 
12282     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12283     for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12284     for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12285         mem_base = xmlMemBlocks();
12286         URL = gen_filepath(n_URL, 0);
12287         contentType = gen_char_ptr_ptr(n_contentType, 1);
12288         redir = gen_char_ptr_ptr(n_redir, 2);
12289 
12290         ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12291         desret_xmlNanoHTTPCtxtPtr(ret_val);
12292         call_tests++;
12293         des_filepath(n_URL, URL, 0);
12294         des_char_ptr_ptr(n_contentType, contentType, 1);
12295         des_char_ptr_ptr(n_redir, redir, 2);
12296         xmlResetLastError();
12297         if (mem_base != xmlMemBlocks()) {
12298             printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12299 	           xmlMemBlocks() - mem_base);
12300 	    test_ret++;
12301             printf(" %d", n_URL);
12302             printf(" %d", n_contentType);
12303             printf(" %d", n_redir);
12304             printf("\n");
12305         }
12306     }
12307     }
12308     }
12309     function_tests++;
12310 #endif
12311 
12312     return(test_ret);
12313 }
12314 
12315 
12316 static int
test_xmlNanoHTTPRead(void)12317 test_xmlNanoHTTPRead(void) {
12318     int test_ret = 0;
12319 
12320 #if defined(LIBXML_HTTP_ENABLED)
12321     int mem_base;
12322     int ret_val;
12323     void * ctx; /* the HTTP context */
12324     int n_ctx;
12325     void * dest; /* a buffer */
12326     int n_dest;
12327     int len; /* the buffer length */
12328     int n_len;
12329 
12330     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12331     for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12332     for (n_len = 0;n_len < gen_nb_int;n_len++) {
12333         mem_base = xmlMemBlocks();
12334         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12335         dest = gen_void_ptr(n_dest, 1);
12336         len = gen_int(n_len, 2);
12337 
12338         ret_val = xmlNanoHTTPRead(ctx, dest, len);
12339         desret_int(ret_val);
12340         call_tests++;
12341         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12342         des_void_ptr(n_dest, dest, 1);
12343         des_int(n_len, len, 2);
12344         xmlResetLastError();
12345         if (mem_base != xmlMemBlocks()) {
12346             printf("Leak of %d blocks found in xmlNanoHTTPRead",
12347 	           xmlMemBlocks() - mem_base);
12348 	    test_ret++;
12349             printf(" %d", n_ctx);
12350             printf(" %d", n_dest);
12351             printf(" %d", n_len);
12352             printf("\n");
12353         }
12354     }
12355     }
12356     }
12357     function_tests++;
12358 #endif
12359 
12360     return(test_ret);
12361 }
12362 
12363 
12364 static int
test_xmlNanoHTTPRedir(void)12365 test_xmlNanoHTTPRedir(void) {
12366     int test_ret = 0;
12367 
12368 
12369     /* missing type support */
12370     return(test_ret);
12371 }
12372 
12373 
12374 static int
test_xmlNanoHTTPReturnCode(void)12375 test_xmlNanoHTTPReturnCode(void) {
12376     int test_ret = 0;
12377 
12378 #if defined(LIBXML_HTTP_ENABLED)
12379     int mem_base;
12380     int ret_val;
12381     void * ctx; /* the HTTP context */
12382     int n_ctx;
12383 
12384     for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12385         mem_base = xmlMemBlocks();
12386         ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12387 
12388         ret_val = xmlNanoHTTPReturnCode(ctx);
12389         desret_int(ret_val);
12390         call_tests++;
12391         des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12392         xmlResetLastError();
12393         if (mem_base != xmlMemBlocks()) {
12394             printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12395 	           xmlMemBlocks() - mem_base);
12396 	    test_ret++;
12397             printf(" %d", n_ctx);
12398             printf("\n");
12399         }
12400     }
12401     function_tests++;
12402 #endif
12403 
12404     return(test_ret);
12405 }
12406 
12407 
12408 static int
test_xmlNanoHTTPSave(void)12409 test_xmlNanoHTTPSave(void) {
12410     int test_ret = 0;
12411 
12412 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12413     int mem_base;
12414     int ret_val;
12415     void * ctxt; /* the HTTP context */
12416     int n_ctxt;
12417     const char * filename; /* the filename where the content should be saved */
12418     int n_filename;
12419 
12420     for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12421     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12422         mem_base = xmlMemBlocks();
12423         ctxt = gen_void_ptr(n_ctxt, 0);
12424         filename = gen_fileoutput(n_filename, 1);
12425 
12426         ret_val = xmlNanoHTTPSave(ctxt, filename);
12427         desret_int(ret_val);
12428         call_tests++;
12429         des_void_ptr(n_ctxt, ctxt, 0);
12430         des_fileoutput(n_filename, filename, 1);
12431         xmlResetLastError();
12432         if (mem_base != xmlMemBlocks()) {
12433             printf("Leak of %d blocks found in xmlNanoHTTPSave",
12434 	           xmlMemBlocks() - mem_base);
12435 	    test_ret++;
12436             printf(" %d", n_ctxt);
12437             printf(" %d", n_filename);
12438             printf("\n");
12439         }
12440     }
12441     }
12442     function_tests++;
12443 #endif
12444 
12445     return(test_ret);
12446 }
12447 
12448 
12449 static int
test_xmlNanoHTTPScanProxy(void)12450 test_xmlNanoHTTPScanProxy(void) {
12451     int test_ret = 0;
12452 
12453 #if defined(LIBXML_HTTP_ENABLED)
12454     const char * URL; /* The proxy URL used to initialize the proxy context */
12455     int n_URL;
12456 
12457     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12458         URL = gen_filepath(n_URL, 0);
12459 
12460         xmlNanoHTTPScanProxy(URL);
12461         call_tests++;
12462         des_filepath(n_URL, URL, 0);
12463         xmlResetLastError();
12464     }
12465     function_tests++;
12466 #endif
12467 
12468     return(test_ret);
12469 }
12470 
12471 static int
test_nanohttp(void)12472 test_nanohttp(void) {
12473     int test_ret = 0;
12474 
12475     if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12476     test_ret += test_xmlNanoHTTPAuthHeader();
12477     test_ret += test_xmlNanoHTTPCleanup();
12478     test_ret += test_xmlNanoHTTPContentLength();
12479     test_ret += test_xmlNanoHTTPEncoding();
12480     test_ret += test_xmlNanoHTTPFetch();
12481     test_ret += test_xmlNanoHTTPInit();
12482     test_ret += test_xmlNanoHTTPMimeType();
12483     test_ret += test_xmlNanoHTTPOpen();
12484     test_ret += test_xmlNanoHTTPOpenRedir();
12485     test_ret += test_xmlNanoHTTPRead();
12486     test_ret += test_xmlNanoHTTPRedir();
12487     test_ret += test_xmlNanoHTTPReturnCode();
12488     test_ret += test_xmlNanoHTTPSave();
12489     test_ret += test_xmlNanoHTTPScanProxy();
12490 
12491     if (test_ret != 0)
12492 	printf("Module nanohttp: %d errors\n", test_ret);
12493     return(test_ret);
12494 }
12495 
12496 static int
test_xmlByteConsumed(void)12497 test_xmlByteConsumed(void) {
12498     int test_ret = 0;
12499 
12500     int mem_base;
12501     long ret_val;
12502     xmlParserCtxtPtr ctxt; /* an XML parser context */
12503     int n_ctxt;
12504 
12505     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12506         mem_base = xmlMemBlocks();
12507         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12508 
12509         ret_val = xmlByteConsumed(ctxt);
12510         desret_long(ret_val);
12511         call_tests++;
12512         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12513         xmlResetLastError();
12514         if (mem_base != xmlMemBlocks()) {
12515             printf("Leak of %d blocks found in xmlByteConsumed",
12516 	           xmlMemBlocks() - mem_base);
12517 	    test_ret++;
12518             printf(" %d", n_ctxt);
12519             printf("\n");
12520         }
12521     }
12522     function_tests++;
12523 
12524     return(test_ret);
12525 }
12526 
12527 
12528 static int
test_xmlClearNodeInfoSeq(void)12529 test_xmlClearNodeInfoSeq(void) {
12530     int test_ret = 0;
12531 
12532     int mem_base;
12533     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12534     int n_seq;
12535 
12536     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12537         mem_base = xmlMemBlocks();
12538         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12539 
12540         xmlClearNodeInfoSeq(seq);
12541         call_tests++;
12542         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12543         xmlResetLastError();
12544         if (mem_base != xmlMemBlocks()) {
12545             printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12546 	           xmlMemBlocks() - mem_base);
12547 	    test_ret++;
12548             printf(" %d", n_seq);
12549             printf("\n");
12550         }
12551     }
12552     function_tests++;
12553 
12554     return(test_ret);
12555 }
12556 
12557 
12558 static int
test_xmlClearParserCtxt(void)12559 test_xmlClearParserCtxt(void) {
12560     int test_ret = 0;
12561 
12562     int mem_base;
12563     xmlParserCtxtPtr ctxt; /* an XML parser context */
12564     int n_ctxt;
12565 
12566     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12567         mem_base = xmlMemBlocks();
12568         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12569 
12570         xmlClearParserCtxt(ctxt);
12571         call_tests++;
12572         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12573         xmlResetLastError();
12574         if (mem_base != xmlMemBlocks()) {
12575             printf("Leak of %d blocks found in xmlClearParserCtxt",
12576 	           xmlMemBlocks() - mem_base);
12577 	    test_ret++;
12578             printf(" %d", n_ctxt);
12579             printf("\n");
12580         }
12581     }
12582     function_tests++;
12583 
12584     return(test_ret);
12585 }
12586 
12587 
12588 static int
test_xmlCreateDocParserCtxt(void)12589 test_xmlCreateDocParserCtxt(void) {
12590     int test_ret = 0;
12591 
12592     int mem_base;
12593     xmlParserCtxtPtr ret_val;
12594     xmlChar * cur; /* a pointer to an array of xmlChar */
12595     int n_cur;
12596 
12597     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12598         mem_base = xmlMemBlocks();
12599         cur = gen_const_xmlChar_ptr(n_cur, 0);
12600 
12601         ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12602         desret_xmlParserCtxtPtr(ret_val);
12603         call_tests++;
12604         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12605         xmlResetLastError();
12606         if (mem_base != xmlMemBlocks()) {
12607             printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12608 	           xmlMemBlocks() - mem_base);
12609 	    test_ret++;
12610             printf(" %d", n_cur);
12611             printf("\n");
12612         }
12613     }
12614     function_tests++;
12615 
12616     return(test_ret);
12617 }
12618 
12619 
12620 static int
test_xmlCreatePushParserCtxt(void)12621 test_xmlCreatePushParserCtxt(void) {
12622     int test_ret = 0;
12623 
12624 #if defined(LIBXML_PUSH_ENABLED)
12625     int mem_base;
12626     xmlParserCtxtPtr ret_val;
12627     xmlSAXHandlerPtr sax; /* a SAX handler */
12628     int n_sax;
12629     void * user_data; /* The user data returned on SAX callbacks */
12630     int n_user_data;
12631     char * chunk; /* a pointer to an array of chars */
12632     int n_chunk;
12633     int size; /* number of chars in the array */
12634     int n_size;
12635     const char * filename; /* an optional file name or URI */
12636     int n_filename;
12637 
12638     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12639     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12640     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12641     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12642     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12643         mem_base = xmlMemBlocks();
12644         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12645         user_data = gen_userdata(n_user_data, 1);
12646         chunk = gen_const_char_ptr(n_chunk, 2);
12647         size = gen_int(n_size, 3);
12648         filename = gen_fileoutput(n_filename, 4);
12649 
12650         ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12651         desret_xmlParserCtxtPtr(ret_val);
12652         call_tests++;
12653         des_xmlSAXHandlerPtr(n_sax, sax, 0);
12654         des_userdata(n_user_data, user_data, 1);
12655         des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12656         des_int(n_size, size, 3);
12657         des_fileoutput(n_filename, filename, 4);
12658         xmlResetLastError();
12659         if (mem_base != xmlMemBlocks()) {
12660             printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12661 	           xmlMemBlocks() - mem_base);
12662 	    test_ret++;
12663             printf(" %d", n_sax);
12664             printf(" %d", n_user_data);
12665             printf(" %d", n_chunk);
12666             printf(" %d", n_size);
12667             printf(" %d", n_filename);
12668             printf("\n");
12669         }
12670     }
12671     }
12672     }
12673     }
12674     }
12675     function_tests++;
12676 #endif
12677 
12678     return(test_ret);
12679 }
12680 
12681 
12682 static int
test_xmlCtxtReadDoc(void)12683 test_xmlCtxtReadDoc(void) {
12684     int test_ret = 0;
12685 
12686     int mem_base;
12687     xmlDocPtr ret_val;
12688     xmlParserCtxtPtr ctxt; /* an XML parser context */
12689     int n_ctxt;
12690     xmlChar * cur; /* a pointer to a zero terminated string */
12691     int n_cur;
12692     const char * URL; /* the base URL to use for the document */
12693     int n_URL;
12694     char * encoding; /* the document encoding, or NULL */
12695     int n_encoding;
12696     int options; /* a combination of xmlParserOption */
12697     int n_options;
12698 
12699     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12700     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12701     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12702     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12703     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12704         mem_base = xmlMemBlocks();
12705         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12706         cur = gen_const_xmlChar_ptr(n_cur, 1);
12707         URL = gen_filepath(n_URL, 2);
12708         encoding = gen_const_char_ptr(n_encoding, 3);
12709         options = gen_parseroptions(n_options, 4);
12710 
12711         ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12712         desret_xmlDocPtr(ret_val);
12713         call_tests++;
12714         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12715         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12716         des_filepath(n_URL, URL, 2);
12717         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12718         des_parseroptions(n_options, options, 4);
12719         xmlResetLastError();
12720         if (mem_base != xmlMemBlocks()) {
12721             printf("Leak of %d blocks found in xmlCtxtReadDoc",
12722 	           xmlMemBlocks() - mem_base);
12723 	    test_ret++;
12724             printf(" %d", n_ctxt);
12725             printf(" %d", n_cur);
12726             printf(" %d", n_URL);
12727             printf(" %d", n_encoding);
12728             printf(" %d", n_options);
12729             printf("\n");
12730         }
12731     }
12732     }
12733     }
12734     }
12735     }
12736     function_tests++;
12737 
12738     return(test_ret);
12739 }
12740 
12741 
12742 static int
test_xmlCtxtReadFile(void)12743 test_xmlCtxtReadFile(void) {
12744     int test_ret = 0;
12745 
12746     int mem_base;
12747     xmlDocPtr ret_val;
12748     xmlParserCtxtPtr ctxt; /* an XML parser context */
12749     int n_ctxt;
12750     const char * filename; /* a file or URL */
12751     int n_filename;
12752     char * encoding; /* the document encoding, or NULL */
12753     int n_encoding;
12754     int options; /* a combination of xmlParserOption */
12755     int n_options;
12756 
12757     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12758     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12759     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12760     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12761         mem_base = xmlMemBlocks();
12762         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12763         filename = gen_filepath(n_filename, 1);
12764         encoding = gen_const_char_ptr(n_encoding, 2);
12765         options = gen_parseroptions(n_options, 3);
12766 
12767         ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12768         desret_xmlDocPtr(ret_val);
12769         call_tests++;
12770         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12771         des_filepath(n_filename, filename, 1);
12772         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12773         des_parseroptions(n_options, options, 3);
12774         xmlResetLastError();
12775         if (mem_base != xmlMemBlocks()) {
12776             printf("Leak of %d blocks found in xmlCtxtReadFile",
12777 	           xmlMemBlocks() - mem_base);
12778 	    test_ret++;
12779             printf(" %d", n_ctxt);
12780             printf(" %d", n_filename);
12781             printf(" %d", n_encoding);
12782             printf(" %d", n_options);
12783             printf("\n");
12784         }
12785     }
12786     }
12787     }
12788     }
12789     function_tests++;
12790 
12791     return(test_ret);
12792 }
12793 
12794 
12795 static int
test_xmlCtxtReadMemory(void)12796 test_xmlCtxtReadMemory(void) {
12797     int test_ret = 0;
12798 
12799     int mem_base;
12800     xmlDocPtr ret_val;
12801     xmlParserCtxtPtr ctxt; /* an XML parser context */
12802     int n_ctxt;
12803     char * buffer; /* a pointer to a char array */
12804     int n_buffer;
12805     int size; /* the size of the array */
12806     int n_size;
12807     const char * URL; /* the base URL to use for the document */
12808     int n_URL;
12809     char * encoding; /* the document encoding, or NULL */
12810     int n_encoding;
12811     int options; /* a combination of xmlParserOption */
12812     int n_options;
12813 
12814     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12815     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12816     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12817     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12818     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12819     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12820         mem_base = xmlMemBlocks();
12821         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12822         buffer = gen_const_char_ptr(n_buffer, 1);
12823         size = gen_int(n_size, 2);
12824         URL = gen_filepath(n_URL, 3);
12825         encoding = gen_const_char_ptr(n_encoding, 4);
12826         options = gen_parseroptions(n_options, 5);
12827 
12828         ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12829         desret_xmlDocPtr(ret_val);
12830         call_tests++;
12831         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12832         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12833         des_int(n_size, size, 2);
12834         des_filepath(n_URL, URL, 3);
12835         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12836         des_parseroptions(n_options, options, 5);
12837         xmlResetLastError();
12838         if (mem_base != xmlMemBlocks()) {
12839             printf("Leak of %d blocks found in xmlCtxtReadMemory",
12840 	           xmlMemBlocks() - mem_base);
12841 	    test_ret++;
12842             printf(" %d", n_ctxt);
12843             printf(" %d", n_buffer);
12844             printf(" %d", n_size);
12845             printf(" %d", n_URL);
12846             printf(" %d", n_encoding);
12847             printf(" %d", n_options);
12848             printf("\n");
12849         }
12850     }
12851     }
12852     }
12853     }
12854     }
12855     }
12856     function_tests++;
12857 
12858     return(test_ret);
12859 }
12860 
12861 
12862 static int
test_xmlCtxtReset(void)12863 test_xmlCtxtReset(void) {
12864     int test_ret = 0;
12865 
12866     int mem_base;
12867     xmlParserCtxtPtr ctxt; /* an XML parser context */
12868     int n_ctxt;
12869 
12870     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12871         mem_base = xmlMemBlocks();
12872         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12873 
12874         xmlCtxtReset(ctxt);
12875         call_tests++;
12876         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12877         xmlResetLastError();
12878         if (mem_base != xmlMemBlocks()) {
12879             printf("Leak of %d blocks found in xmlCtxtReset",
12880 	           xmlMemBlocks() - mem_base);
12881 	    test_ret++;
12882             printf(" %d", n_ctxt);
12883             printf("\n");
12884         }
12885     }
12886     function_tests++;
12887 
12888     return(test_ret);
12889 }
12890 
12891 
12892 static int
test_xmlCtxtResetPush(void)12893 test_xmlCtxtResetPush(void) {
12894     int test_ret = 0;
12895 
12896     int mem_base;
12897     int ret_val;
12898     xmlParserCtxtPtr ctxt; /* an XML parser context */
12899     int n_ctxt;
12900     char * chunk; /* a pointer to an array of chars */
12901     int n_chunk;
12902     int size; /* number of chars in the array */
12903     int n_size;
12904     const char * filename; /* an optional file name or URI */
12905     int n_filename;
12906     char * encoding; /* the document encoding, or NULL */
12907     int n_encoding;
12908 
12909     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12910     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12911     for (n_size = 0;n_size < gen_nb_int;n_size++) {
12912     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12913     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12914         mem_base = xmlMemBlocks();
12915         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12916         chunk = gen_const_char_ptr(n_chunk, 1);
12917         size = gen_int(n_size, 2);
12918         filename = gen_filepath(n_filename, 3);
12919         encoding = gen_const_char_ptr(n_encoding, 4);
12920 
12921         ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12922         desret_int(ret_val);
12923         call_tests++;
12924         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12925         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12926         des_int(n_size, size, 2);
12927         des_filepath(n_filename, filename, 3);
12928         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12929         xmlResetLastError();
12930         if (mem_base != xmlMemBlocks()) {
12931             printf("Leak of %d blocks found in xmlCtxtResetPush",
12932 	           xmlMemBlocks() - mem_base);
12933 	    test_ret++;
12934             printf(" %d", n_ctxt);
12935             printf(" %d", n_chunk);
12936             printf(" %d", n_size);
12937             printf(" %d", n_filename);
12938             printf(" %d", n_encoding);
12939             printf("\n");
12940         }
12941     }
12942     }
12943     }
12944     }
12945     }
12946     function_tests++;
12947 
12948     return(test_ret);
12949 }
12950 
12951 
12952 static int
test_xmlCtxtUseOptions(void)12953 test_xmlCtxtUseOptions(void) {
12954     int test_ret = 0;
12955 
12956     int mem_base;
12957     int ret_val;
12958     xmlParserCtxtPtr ctxt; /* an XML parser context */
12959     int n_ctxt;
12960     int options; /* a combination of xmlParserOption */
12961     int n_options;
12962 
12963     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12964     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12965         mem_base = xmlMemBlocks();
12966         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12967         options = gen_parseroptions(n_options, 1);
12968 
12969         ret_val = xmlCtxtUseOptions(ctxt, options);
12970         desret_int(ret_val);
12971         call_tests++;
12972         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12973         des_parseroptions(n_options, options, 1);
12974         xmlResetLastError();
12975         if (mem_base != xmlMemBlocks()) {
12976             printf("Leak of %d blocks found in xmlCtxtUseOptions",
12977 	           xmlMemBlocks() - mem_base);
12978 	    test_ret++;
12979             printf(" %d", n_ctxt);
12980             printf(" %d", n_options);
12981             printf("\n");
12982         }
12983     }
12984     }
12985     function_tests++;
12986 
12987     return(test_ret);
12988 }
12989 
12990 
12991 static int
test_xmlGetExternalEntityLoader(void)12992 test_xmlGetExternalEntityLoader(void) {
12993     int test_ret = 0;
12994 
12995 
12996     /* missing type support */
12997     return(test_ret);
12998 }
12999 
13000 
13001 static int
test_xmlGetFeature(void)13002 test_xmlGetFeature(void) {
13003     int test_ret = 0;
13004 
13005 #if defined(LIBXML_LEGACY_ENABLED)
13006 #ifdef LIBXML_LEGACY_ENABLED
13007     int mem_base;
13008     int ret_val;
13009     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13010     int n_ctxt;
13011     char * name; /* the feature name */
13012     int n_name;
13013     void * result; /* location to store the result */
13014     int n_result;
13015 
13016     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13017     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13018     for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13019         mem_base = xmlMemBlocks();
13020         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13021         name = gen_const_char_ptr(n_name, 1);
13022         result = gen_void_ptr(n_result, 2);
13023 
13024         ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13025         desret_int(ret_val);
13026         call_tests++;
13027         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13028         des_const_char_ptr(n_name, (const char *)name, 1);
13029         des_void_ptr(n_result, result, 2);
13030         xmlResetLastError();
13031         if (mem_base != xmlMemBlocks()) {
13032             printf("Leak of %d blocks found in xmlGetFeature",
13033 	           xmlMemBlocks() - mem_base);
13034 	    test_ret++;
13035             printf(" %d", n_ctxt);
13036             printf(" %d", n_name);
13037             printf(" %d", n_result);
13038             printf("\n");
13039         }
13040     }
13041     }
13042     }
13043     function_tests++;
13044 #endif
13045 #endif
13046 
13047     return(test_ret);
13048 }
13049 
13050 
13051 #define gen_nb_const_char_ptr_ptr 1
gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13052 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13053     return(NULL);
13054 }
des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED,const char ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13055 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13056 }
13057 
13058 static int
test_xmlGetFeaturesList(void)13059 test_xmlGetFeaturesList(void) {
13060     int test_ret = 0;
13061 
13062 #if defined(LIBXML_LEGACY_ENABLED)
13063 #ifdef LIBXML_LEGACY_ENABLED
13064     int mem_base;
13065     int ret_val;
13066     int * len; /* the length of the features name array (input/output) */
13067     int n_len;
13068     char ** result; /* an array of string to be filled with the features name. */
13069     int n_result;
13070 
13071     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13072     for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13073         mem_base = xmlMemBlocks();
13074         len = gen_int_ptr(n_len, 0);
13075         result = gen_const_char_ptr_ptr(n_result, 1);
13076 
13077         ret_val = xmlGetFeaturesList(len, (const char **)result);
13078         desret_int(ret_val);
13079         call_tests++;
13080         des_int_ptr(n_len, len, 0);
13081         des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13082         xmlResetLastError();
13083         if (mem_base != xmlMemBlocks()) {
13084             printf("Leak of %d blocks found in xmlGetFeaturesList",
13085 	           xmlMemBlocks() - mem_base);
13086 	    test_ret++;
13087             printf(" %d", n_len);
13088             printf(" %d", n_result);
13089             printf("\n");
13090         }
13091     }
13092     }
13093     function_tests++;
13094 #endif
13095 #endif
13096 
13097     return(test_ret);
13098 }
13099 
13100 
13101 static int
test_xmlHasFeature(void)13102 test_xmlHasFeature(void) {
13103     int test_ret = 0;
13104 
13105     int mem_base;
13106     int ret_val;
13107     xmlFeature feature; /* the feature to be examined */
13108     int n_feature;
13109 
13110     for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13111         mem_base = xmlMemBlocks();
13112         feature = gen_xmlFeature(n_feature, 0);
13113 
13114         ret_val = xmlHasFeature(feature);
13115         desret_int(ret_val);
13116         call_tests++;
13117         des_xmlFeature(n_feature, feature, 0);
13118         xmlResetLastError();
13119         if (mem_base != xmlMemBlocks()) {
13120             printf("Leak of %d blocks found in xmlHasFeature",
13121 	           xmlMemBlocks() - mem_base);
13122 	    test_ret++;
13123             printf(" %d", n_feature);
13124             printf("\n");
13125         }
13126     }
13127     function_tests++;
13128 
13129     return(test_ret);
13130 }
13131 
13132 
13133 static int
test_xmlIOParseDTD(void)13134 test_xmlIOParseDTD(void) {
13135     int test_ret = 0;
13136 
13137 #if defined(LIBXML_VALID_ENABLED)
13138 #ifdef LIBXML_VALID_ENABLED
13139     int mem_base;
13140     xmlDtdPtr ret_val;
13141     xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13142     int n_sax;
13143     xmlParserInputBufferPtr input; /* an Input Buffer */
13144     int n_input;
13145     xmlCharEncoding enc; /* the charset encoding if known */
13146     int n_enc;
13147 
13148     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13149     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13150     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13151         mem_base = xmlMemBlocks();
13152         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13153         input = gen_xmlParserInputBufferPtr(n_input, 1);
13154         enc = gen_xmlCharEncoding(n_enc, 2);
13155 
13156         ret_val = xmlIOParseDTD(sax, input, enc);
13157         input = NULL;
13158         desret_xmlDtdPtr(ret_val);
13159         call_tests++;
13160         des_xmlSAXHandlerPtr(n_sax, sax, 0);
13161         des_xmlParserInputBufferPtr(n_input, input, 1);
13162         des_xmlCharEncoding(n_enc, enc, 2);
13163         xmlResetLastError();
13164         if (mem_base != xmlMemBlocks()) {
13165             printf("Leak of %d blocks found in xmlIOParseDTD",
13166 	           xmlMemBlocks() - mem_base);
13167 	    test_ret++;
13168             printf(" %d", n_sax);
13169             printf(" %d", n_input);
13170             printf(" %d", n_enc);
13171             printf("\n");
13172         }
13173     }
13174     }
13175     }
13176     function_tests++;
13177 #endif
13178 #endif
13179 
13180     return(test_ret);
13181 }
13182 
13183 
13184 static int
test_xmlInitNodeInfoSeq(void)13185 test_xmlInitNodeInfoSeq(void) {
13186     int test_ret = 0;
13187 
13188     int mem_base;
13189     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13190     int n_seq;
13191 
13192     for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13193         mem_base = xmlMemBlocks();
13194         seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13195 
13196         xmlInitNodeInfoSeq(seq);
13197         call_tests++;
13198         des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13199         xmlResetLastError();
13200         if (mem_base != xmlMemBlocks()) {
13201             printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13202 	           xmlMemBlocks() - mem_base);
13203 	    test_ret++;
13204             printf(" %d", n_seq);
13205             printf("\n");
13206         }
13207     }
13208     function_tests++;
13209 
13210     return(test_ret);
13211 }
13212 
13213 
13214 static int
test_xmlInitParser(void)13215 test_xmlInitParser(void) {
13216     int test_ret = 0;
13217 
13218     int mem_base;
13219 
13220         mem_base = xmlMemBlocks();
13221 
13222         xmlInitParser();
13223         call_tests++;
13224         xmlResetLastError();
13225         if (mem_base != xmlMemBlocks()) {
13226             printf("Leak of %d blocks found in xmlInitParser",
13227 	           xmlMemBlocks() - mem_base);
13228 	    test_ret++;
13229             printf("\n");
13230         }
13231     function_tests++;
13232 
13233     return(test_ret);
13234 }
13235 
13236 
13237 static int
test_xmlInitParserCtxt(void)13238 test_xmlInitParserCtxt(void) {
13239     int test_ret = 0;
13240 
13241     int mem_base;
13242     int ret_val;
13243     xmlParserCtxtPtr ctxt; /* an XML parser context */
13244     int n_ctxt;
13245 
13246     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13247         mem_base = xmlMemBlocks();
13248         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13249 
13250         ret_val = xmlInitParserCtxt(ctxt);
13251         desret_int(ret_val);
13252         call_tests++;
13253         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13254         xmlResetLastError();
13255         if (mem_base != xmlMemBlocks()) {
13256             printf("Leak of %d blocks found in xmlInitParserCtxt",
13257 	           xmlMemBlocks() - mem_base);
13258 	    test_ret++;
13259             printf(" %d", n_ctxt);
13260             printf("\n");
13261         }
13262     }
13263     function_tests++;
13264 
13265     return(test_ret);
13266 }
13267 
13268 
13269 static int
test_xmlKeepBlanksDefault(void)13270 test_xmlKeepBlanksDefault(void) {
13271     int test_ret = 0;
13272 
13273     int mem_base;
13274     int ret_val;
13275     int val; /* int 0 or 1 */
13276     int n_val;
13277 
13278     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13279         mem_base = xmlMemBlocks();
13280         val = gen_int(n_val, 0);
13281 
13282         ret_val = xmlKeepBlanksDefault(val);
13283         desret_int(ret_val);
13284         call_tests++;
13285         des_int(n_val, val, 0);
13286         xmlResetLastError();
13287         if (mem_base != xmlMemBlocks()) {
13288             printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13289 	           xmlMemBlocks() - mem_base);
13290 	    test_ret++;
13291             printf(" %d", n_val);
13292             printf("\n");
13293         }
13294     }
13295     function_tests++;
13296 
13297     return(test_ret);
13298 }
13299 
13300 
13301 static int
test_xmlLineNumbersDefault(void)13302 test_xmlLineNumbersDefault(void) {
13303     int test_ret = 0;
13304 
13305     int mem_base;
13306     int ret_val;
13307     int val; /* int 0 or 1 */
13308     int n_val;
13309 
13310     for (n_val = 0;n_val < gen_nb_int;n_val++) {
13311         mem_base = xmlMemBlocks();
13312         val = gen_int(n_val, 0);
13313 
13314         ret_val = xmlLineNumbersDefault(val);
13315         desret_int(ret_val);
13316         call_tests++;
13317         des_int(n_val, val, 0);
13318         xmlResetLastError();
13319         if (mem_base != xmlMemBlocks()) {
13320             printf("Leak of %d blocks found in xmlLineNumbersDefault",
13321 	           xmlMemBlocks() - mem_base);
13322 	    test_ret++;
13323             printf(" %d", n_val);
13324             printf("\n");
13325         }
13326     }
13327     function_tests++;
13328 
13329     return(test_ret);
13330 }
13331 
13332 
13333 static int
test_xmlLoadExternalEntity(void)13334 test_xmlLoadExternalEntity(void) {
13335     int test_ret = 0;
13336 
13337     int mem_base;
13338     xmlParserInputPtr ret_val;
13339     const char * URL; /* the URL for the entity to load */
13340     int n_URL;
13341     char * ID; /* the Public ID for the entity to load */
13342     int n_ID;
13343     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13344     int n_ctxt;
13345 
13346     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13347     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13348     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13349         mem_base = xmlMemBlocks();
13350         URL = gen_filepath(n_URL, 0);
13351         ID = gen_const_char_ptr(n_ID, 1);
13352         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13353 
13354         ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13355         desret_xmlParserInputPtr(ret_val);
13356         call_tests++;
13357         des_filepath(n_URL, URL, 0);
13358         des_const_char_ptr(n_ID, (const char *)ID, 1);
13359         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13360         xmlResetLastError();
13361         if (mem_base != xmlMemBlocks()) {
13362             printf("Leak of %d blocks found in xmlLoadExternalEntity",
13363 	           xmlMemBlocks() - mem_base);
13364 	    test_ret++;
13365             printf(" %d", n_URL);
13366             printf(" %d", n_ID);
13367             printf(" %d", n_ctxt);
13368             printf("\n");
13369         }
13370     }
13371     }
13372     }
13373     function_tests++;
13374 
13375     return(test_ret);
13376 }
13377 
13378 
13379 static int
test_xmlNewIOInputStream(void)13380 test_xmlNewIOInputStream(void) {
13381     int test_ret = 0;
13382 
13383     int mem_base;
13384     xmlParserInputPtr ret_val;
13385     xmlParserCtxtPtr ctxt; /* an XML parser context */
13386     int n_ctxt;
13387     xmlParserInputBufferPtr input; /* an I/O Input */
13388     int n_input;
13389     xmlCharEncoding enc; /* the charset encoding if known */
13390     int n_enc;
13391 
13392     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13393     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13394     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13395         mem_base = xmlMemBlocks();
13396         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13397         input = gen_xmlParserInputBufferPtr(n_input, 1);
13398         enc = gen_xmlCharEncoding(n_enc, 2);
13399 
13400         ret_val = xmlNewIOInputStream(ctxt, input, enc);
13401         if (ret_val != NULL) input = NULL;
13402         desret_xmlParserInputPtr(ret_val);
13403         call_tests++;
13404         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13405         des_xmlParserInputBufferPtr(n_input, input, 1);
13406         des_xmlCharEncoding(n_enc, enc, 2);
13407         xmlResetLastError();
13408         if (mem_base != xmlMemBlocks()) {
13409             printf("Leak of %d blocks found in xmlNewIOInputStream",
13410 	           xmlMemBlocks() - mem_base);
13411 	    test_ret++;
13412             printf(" %d", n_ctxt);
13413             printf(" %d", n_input);
13414             printf(" %d", n_enc);
13415             printf("\n");
13416         }
13417     }
13418     }
13419     }
13420     function_tests++;
13421 
13422     return(test_ret);
13423 }
13424 
13425 
13426 static int
test_xmlNewParserCtxt(void)13427 test_xmlNewParserCtxt(void) {
13428     int test_ret = 0;
13429 
13430     int mem_base;
13431     xmlParserCtxtPtr ret_val;
13432 
13433         mem_base = xmlMemBlocks();
13434 
13435         ret_val = xmlNewParserCtxt();
13436         desret_xmlParserCtxtPtr(ret_val);
13437         call_tests++;
13438         xmlResetLastError();
13439         if (mem_base != xmlMemBlocks()) {
13440             printf("Leak of %d blocks found in xmlNewParserCtxt",
13441 	           xmlMemBlocks() - mem_base);
13442 	    test_ret++;
13443             printf("\n");
13444         }
13445     function_tests++;
13446 
13447     return(test_ret);
13448 }
13449 
13450 
13451 #define gen_nb_xmlNodePtr_ptr 1
gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13452 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13453     return(NULL);
13454 }
des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED,xmlNodePtr * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)13455 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13456 }
13457 
13458 static int
test_xmlParseBalancedChunkMemory(void)13459 test_xmlParseBalancedChunkMemory(void) {
13460     int test_ret = 0;
13461 
13462 #if defined(LIBXML_SAX1_ENABLED)
13463 #ifdef LIBXML_SAX1_ENABLED
13464     int mem_base;
13465     int ret_val;
13466     xmlDocPtr doc; /* the document the chunk pertains to */
13467     int n_doc;
13468     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13469     int n_sax;
13470     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13471     int n_user_data;
13472     int depth; /* Used for loop detection, use 0 */
13473     int n_depth;
13474     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13475     int n_string;
13476     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13477     int n_lst;
13478 
13479     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13480     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13481     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13482     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13483     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13484     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13485         mem_base = xmlMemBlocks();
13486         doc = gen_xmlDocPtr(n_doc, 0);
13487         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13488         user_data = gen_userdata(n_user_data, 2);
13489         depth = gen_int(n_depth, 3);
13490         string = gen_const_xmlChar_ptr(n_string, 4);
13491         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13492 
13493 #ifdef LIBXML_SAX1_ENABLED
13494         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13495 #endif
13496 
13497 
13498         ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13499         desret_int(ret_val);
13500         call_tests++;
13501         des_xmlDocPtr(n_doc, doc, 0);
13502         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13503         des_userdata(n_user_data, user_data, 2);
13504         des_int(n_depth, depth, 3);
13505         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13506         des_xmlNodePtr_ptr(n_lst, lst, 5);
13507         xmlResetLastError();
13508         if (mem_base != xmlMemBlocks()) {
13509             printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13510 	           xmlMemBlocks() - mem_base);
13511 	    test_ret++;
13512             printf(" %d", n_doc);
13513             printf(" %d", n_sax);
13514             printf(" %d", n_user_data);
13515             printf(" %d", n_depth);
13516             printf(" %d", n_string);
13517             printf(" %d", n_lst);
13518             printf("\n");
13519         }
13520     }
13521     }
13522     }
13523     }
13524     }
13525     }
13526     function_tests++;
13527 #endif
13528 #endif
13529 
13530     return(test_ret);
13531 }
13532 
13533 
13534 static int
test_xmlParseBalancedChunkMemoryRecover(void)13535 test_xmlParseBalancedChunkMemoryRecover(void) {
13536     int test_ret = 0;
13537 
13538 #if defined(LIBXML_SAX1_ENABLED)
13539 #ifdef LIBXML_SAX1_ENABLED
13540     int mem_base;
13541     int ret_val;
13542     xmlDocPtr doc; /* the document the chunk pertains to */
13543     int n_doc;
13544     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13545     int n_sax;
13546     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13547     int n_user_data;
13548     int depth; /* Used for loop detection, use 0 */
13549     int n_depth;
13550     xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13551     int n_string;
13552     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13553     int n_lst;
13554     int recover; /* return nodes even if the data is broken (use 0) */
13555     int n_recover;
13556 
13557     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13558     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13559     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13560     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13561     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13562     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13563     for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13564         mem_base = xmlMemBlocks();
13565         doc = gen_xmlDocPtr(n_doc, 0);
13566         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13567         user_data = gen_userdata(n_user_data, 2);
13568         depth = gen_int(n_depth, 3);
13569         string = gen_const_xmlChar_ptr(n_string, 4);
13570         lst = gen_xmlNodePtr_ptr(n_lst, 5);
13571         recover = gen_int(n_recover, 6);
13572 
13573 #ifdef LIBXML_SAX1_ENABLED
13574         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13575 #endif
13576 
13577 
13578         ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13579         desret_int(ret_val);
13580         call_tests++;
13581         des_xmlDocPtr(n_doc, doc, 0);
13582         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13583         des_userdata(n_user_data, user_data, 2);
13584         des_int(n_depth, depth, 3);
13585         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13586         des_xmlNodePtr_ptr(n_lst, lst, 5);
13587         des_int(n_recover, recover, 6);
13588         xmlResetLastError();
13589         if (mem_base != xmlMemBlocks()) {
13590             printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13591 	           xmlMemBlocks() - mem_base);
13592 	    test_ret++;
13593             printf(" %d", n_doc);
13594             printf(" %d", n_sax);
13595             printf(" %d", n_user_data);
13596             printf(" %d", n_depth);
13597             printf(" %d", n_string);
13598             printf(" %d", n_lst);
13599             printf(" %d", n_recover);
13600             printf("\n");
13601         }
13602     }
13603     }
13604     }
13605     }
13606     }
13607     }
13608     }
13609     function_tests++;
13610 #endif
13611 #endif
13612 
13613     return(test_ret);
13614 }
13615 
13616 
13617 static int
test_xmlParseChunk(void)13618 test_xmlParseChunk(void) {
13619     int test_ret = 0;
13620 
13621 #if defined(LIBXML_PUSH_ENABLED)
13622     int mem_base;
13623     int ret_val;
13624     xmlParserCtxtPtr ctxt; /* an XML parser context */
13625     int n_ctxt;
13626     char * chunk; /* an char array */
13627     int n_chunk;
13628     int size; /* the size in byte of the chunk */
13629     int n_size;
13630     int terminate; /* last chunk indicator */
13631     int n_terminate;
13632 
13633     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13634     for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13635     for (n_size = 0;n_size < gen_nb_int;n_size++) {
13636     for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13637         mem_base = xmlMemBlocks();
13638         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13639         chunk = gen_const_char_ptr(n_chunk, 1);
13640         size = gen_int(n_size, 2);
13641         terminate = gen_int(n_terminate, 3);
13642 
13643         ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13644         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13645         desret_int(ret_val);
13646         call_tests++;
13647         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13648         des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13649         des_int(n_size, size, 2);
13650         des_int(n_terminate, terminate, 3);
13651         xmlResetLastError();
13652         if (mem_base != xmlMemBlocks()) {
13653             printf("Leak of %d blocks found in xmlParseChunk",
13654 	           xmlMemBlocks() - mem_base);
13655 	    test_ret++;
13656             printf(" %d", n_ctxt);
13657             printf(" %d", n_chunk);
13658             printf(" %d", n_size);
13659             printf(" %d", n_terminate);
13660             printf("\n");
13661         }
13662     }
13663     }
13664     }
13665     }
13666     function_tests++;
13667 #endif
13668 
13669     return(test_ret);
13670 }
13671 
13672 
13673 static int
test_xmlParseCtxtExternalEntity(void)13674 test_xmlParseCtxtExternalEntity(void) {
13675     int test_ret = 0;
13676 
13677     int mem_base;
13678     int ret_val;
13679     xmlParserCtxtPtr ctx; /* the existing parsing context */
13680     int n_ctx;
13681     xmlChar * URL; /* the URL for the entity to load */
13682     int n_URL;
13683     xmlChar * ID; /* the System ID for the entity to load */
13684     int n_ID;
13685     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13686     int n_lst;
13687 
13688     for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13689     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13690     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13691     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13692         mem_base = xmlMemBlocks();
13693         ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13694         URL = gen_const_xmlChar_ptr(n_URL, 1);
13695         ID = gen_const_xmlChar_ptr(n_ID, 2);
13696         lst = gen_xmlNodePtr_ptr(n_lst, 3);
13697 
13698         ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13699         desret_int(ret_val);
13700         call_tests++;
13701         des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13702         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13703         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13704         des_xmlNodePtr_ptr(n_lst, lst, 3);
13705         xmlResetLastError();
13706         if (mem_base != xmlMemBlocks()) {
13707             printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13708 	           xmlMemBlocks() - mem_base);
13709 	    test_ret++;
13710             printf(" %d", n_ctx);
13711             printf(" %d", n_URL);
13712             printf(" %d", n_ID);
13713             printf(" %d", n_lst);
13714             printf("\n");
13715         }
13716     }
13717     }
13718     }
13719     }
13720     function_tests++;
13721 
13722     return(test_ret);
13723 }
13724 
13725 
13726 static int
test_xmlParseDTD(void)13727 test_xmlParseDTD(void) {
13728     int test_ret = 0;
13729 
13730 #if defined(LIBXML_VALID_ENABLED)
13731 #ifdef LIBXML_VALID_ENABLED
13732     int mem_base;
13733     xmlDtdPtr ret_val;
13734     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13735     int n_ExternalID;
13736     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13737     int n_SystemID;
13738 
13739     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13740     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13741         mem_base = xmlMemBlocks();
13742         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13743         SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13744 
13745         ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13746         desret_xmlDtdPtr(ret_val);
13747         call_tests++;
13748         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13749         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13750         xmlResetLastError();
13751         if (mem_base != xmlMemBlocks()) {
13752             printf("Leak of %d blocks found in xmlParseDTD",
13753 	           xmlMemBlocks() - mem_base);
13754 	    test_ret++;
13755             printf(" %d", n_ExternalID);
13756             printf(" %d", n_SystemID);
13757             printf("\n");
13758         }
13759     }
13760     }
13761     function_tests++;
13762 #endif
13763 #endif
13764 
13765     return(test_ret);
13766 }
13767 
13768 
13769 static int
test_xmlParseDoc(void)13770 test_xmlParseDoc(void) {
13771     int test_ret = 0;
13772 
13773 #if defined(LIBXML_SAX1_ENABLED)
13774 #ifdef LIBXML_SAX1_ENABLED
13775     int mem_base;
13776     xmlDocPtr ret_val;
13777     xmlChar * cur; /* a pointer to an array of xmlChar */
13778     int n_cur;
13779 
13780     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13781         mem_base = xmlMemBlocks();
13782         cur = gen_const_xmlChar_ptr(n_cur, 0);
13783 
13784         ret_val = xmlParseDoc((const xmlChar *)cur);
13785         desret_xmlDocPtr(ret_val);
13786         call_tests++;
13787         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13788         xmlResetLastError();
13789         if (mem_base != xmlMemBlocks()) {
13790             printf("Leak of %d blocks found in xmlParseDoc",
13791 	           xmlMemBlocks() - mem_base);
13792 	    test_ret++;
13793             printf(" %d", n_cur);
13794             printf("\n");
13795         }
13796     }
13797     function_tests++;
13798 #endif
13799 #endif
13800 
13801     return(test_ret);
13802 }
13803 
13804 
13805 static int
test_xmlParseDocument(void)13806 test_xmlParseDocument(void) {
13807     int test_ret = 0;
13808 
13809     int mem_base;
13810     int ret_val;
13811     xmlParserCtxtPtr ctxt; /* an XML parser context */
13812     int n_ctxt;
13813 
13814     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13815         mem_base = xmlMemBlocks();
13816         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13817 
13818         ret_val = xmlParseDocument(ctxt);
13819         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13820         desret_int(ret_val);
13821         call_tests++;
13822         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13823         xmlResetLastError();
13824         if (mem_base != xmlMemBlocks()) {
13825             printf("Leak of %d blocks found in xmlParseDocument",
13826 	           xmlMemBlocks() - mem_base);
13827 	    test_ret++;
13828             printf(" %d", n_ctxt);
13829             printf("\n");
13830         }
13831     }
13832     function_tests++;
13833 
13834     return(test_ret);
13835 }
13836 
13837 
13838 static int
test_xmlParseEntity(void)13839 test_xmlParseEntity(void) {
13840     int test_ret = 0;
13841 
13842 #if defined(LIBXML_SAX1_ENABLED)
13843 #ifdef LIBXML_SAX1_ENABLED
13844     int mem_base;
13845     xmlDocPtr ret_val;
13846     const char * filename; /* the filename */
13847     int n_filename;
13848 
13849     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13850         mem_base = xmlMemBlocks();
13851         filename = gen_filepath(n_filename, 0);
13852 
13853         ret_val = xmlParseEntity(filename);
13854         desret_xmlDocPtr(ret_val);
13855         call_tests++;
13856         des_filepath(n_filename, filename, 0);
13857         xmlResetLastError();
13858         if (mem_base != xmlMemBlocks()) {
13859             printf("Leak of %d blocks found in xmlParseEntity",
13860 	           xmlMemBlocks() - mem_base);
13861 	    test_ret++;
13862             printf(" %d", n_filename);
13863             printf("\n");
13864         }
13865     }
13866     function_tests++;
13867 #endif
13868 #endif
13869 
13870     return(test_ret);
13871 }
13872 
13873 
13874 static int
test_xmlParseExtParsedEnt(void)13875 test_xmlParseExtParsedEnt(void) {
13876     int test_ret = 0;
13877 
13878     int mem_base;
13879     int ret_val;
13880     xmlParserCtxtPtr ctxt; /* an XML parser context */
13881     int n_ctxt;
13882 
13883     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13884         mem_base = xmlMemBlocks();
13885         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13886 
13887         ret_val = xmlParseExtParsedEnt(ctxt);
13888         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13889         desret_int(ret_val);
13890         call_tests++;
13891         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13892         xmlResetLastError();
13893         if (mem_base != xmlMemBlocks()) {
13894             printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13895 	           xmlMemBlocks() - mem_base);
13896 	    test_ret++;
13897             printf(" %d", n_ctxt);
13898             printf("\n");
13899         }
13900     }
13901     function_tests++;
13902 
13903     return(test_ret);
13904 }
13905 
13906 
13907 static int
test_xmlParseExternalEntity(void)13908 test_xmlParseExternalEntity(void) {
13909     int test_ret = 0;
13910 
13911 #if defined(LIBXML_SAX1_ENABLED)
13912 #ifdef LIBXML_SAX1_ENABLED
13913     int mem_base;
13914     int ret_val;
13915     xmlDocPtr doc; /* the document the chunk pertains to */
13916     int n_doc;
13917     xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13918     int n_sax;
13919     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13920     int n_user_data;
13921     int depth; /* Used for loop detection, use 0 */
13922     int n_depth;
13923     xmlChar * URL; /* the URL for the entity to load */
13924     int n_URL;
13925     xmlChar * ID; /* the System ID for the entity to load */
13926     int n_ID;
13927     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13928     int n_lst;
13929 
13930     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13931     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13932     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13933     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13934     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13935     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13936     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13937         mem_base = xmlMemBlocks();
13938         doc = gen_xmlDocPtr(n_doc, 0);
13939         sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13940         user_data = gen_userdata(n_user_data, 2);
13941         depth = gen_int(n_depth, 3);
13942         URL = gen_const_xmlChar_ptr(n_URL, 4);
13943         ID = gen_const_xmlChar_ptr(n_ID, 5);
13944         lst = gen_xmlNodePtr_ptr(n_lst, 6);
13945 
13946         ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13947         desret_int(ret_val);
13948         call_tests++;
13949         des_xmlDocPtr(n_doc, doc, 0);
13950         des_xmlSAXHandlerPtr(n_sax, sax, 1);
13951         des_userdata(n_user_data, user_data, 2);
13952         des_int(n_depth, depth, 3);
13953         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13954         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13955         des_xmlNodePtr_ptr(n_lst, lst, 6);
13956         xmlResetLastError();
13957         if (mem_base != xmlMemBlocks()) {
13958             printf("Leak of %d blocks found in xmlParseExternalEntity",
13959 	           xmlMemBlocks() - mem_base);
13960 	    test_ret++;
13961             printf(" %d", n_doc);
13962             printf(" %d", n_sax);
13963             printf(" %d", n_user_data);
13964             printf(" %d", n_depth);
13965             printf(" %d", n_URL);
13966             printf(" %d", n_ID);
13967             printf(" %d", n_lst);
13968             printf("\n");
13969         }
13970     }
13971     }
13972     }
13973     }
13974     }
13975     }
13976     }
13977     function_tests++;
13978 #endif
13979 #endif
13980 
13981     return(test_ret);
13982 }
13983 
13984 
13985 static int
test_xmlParseFile(void)13986 test_xmlParseFile(void) {
13987     int test_ret = 0;
13988 
13989 #if defined(LIBXML_SAX1_ENABLED)
13990 #ifdef LIBXML_SAX1_ENABLED
13991     int mem_base;
13992     xmlDocPtr ret_val;
13993     const char * filename; /* the filename */
13994     int n_filename;
13995 
13996     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13997         mem_base = xmlMemBlocks();
13998         filename = gen_filepath(n_filename, 0);
13999 
14000         ret_val = xmlParseFile(filename);
14001         desret_xmlDocPtr(ret_val);
14002         call_tests++;
14003         des_filepath(n_filename, filename, 0);
14004         xmlResetLastError();
14005         if (mem_base != xmlMemBlocks()) {
14006             printf("Leak of %d blocks found in xmlParseFile",
14007 	           xmlMemBlocks() - mem_base);
14008 	    test_ret++;
14009             printf(" %d", n_filename);
14010             printf("\n");
14011         }
14012     }
14013     function_tests++;
14014 #endif
14015 #endif
14016 
14017     return(test_ret);
14018 }
14019 
14020 
14021 static int
test_xmlParseInNodeContext(void)14022 test_xmlParseInNodeContext(void) {
14023     int test_ret = 0;
14024 
14025     int mem_base;
14026     xmlParserErrors ret_val;
14027     xmlNodePtr node; /* the context node */
14028     int n_node;
14029     char * data; /* the input string */
14030     int n_data;
14031     int datalen; /* the input string length in bytes */
14032     int n_datalen;
14033     int options; /* a combination of xmlParserOption */
14034     int n_options;
14035     xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14036     int n_lst;
14037 
14038     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14039     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14040     for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14041     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14042     for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14043         mem_base = xmlMemBlocks();
14044         node = gen_xmlNodePtr(n_node, 0);
14045         data = gen_const_char_ptr(n_data, 1);
14046         datalen = gen_int(n_datalen, 2);
14047         options = gen_parseroptions(n_options, 3);
14048         lst = gen_xmlNodePtr_ptr(n_lst, 4);
14049 
14050         ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14051         desret_xmlParserErrors(ret_val);
14052         call_tests++;
14053         des_xmlNodePtr(n_node, node, 0);
14054         des_const_char_ptr(n_data, (const char *)data, 1);
14055         des_int(n_datalen, datalen, 2);
14056         des_parseroptions(n_options, options, 3);
14057         des_xmlNodePtr_ptr(n_lst, lst, 4);
14058         xmlResetLastError();
14059         if (mem_base != xmlMemBlocks()) {
14060             printf("Leak of %d blocks found in xmlParseInNodeContext",
14061 	           xmlMemBlocks() - mem_base);
14062 	    test_ret++;
14063             printf(" %d", n_node);
14064             printf(" %d", n_data);
14065             printf(" %d", n_datalen);
14066             printf(" %d", n_options);
14067             printf(" %d", n_lst);
14068             printf("\n");
14069         }
14070     }
14071     }
14072     }
14073     }
14074     }
14075     function_tests++;
14076 
14077     return(test_ret);
14078 }
14079 
14080 
14081 static int
test_xmlParseMemory(void)14082 test_xmlParseMemory(void) {
14083     int test_ret = 0;
14084 
14085 #if defined(LIBXML_SAX1_ENABLED)
14086 #ifdef LIBXML_SAX1_ENABLED
14087     int mem_base;
14088     xmlDocPtr ret_val;
14089     char * buffer; /* an pointer to a char array */
14090     int n_buffer;
14091     int size; /* the size of the array */
14092     int n_size;
14093 
14094     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14095     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14096         mem_base = xmlMemBlocks();
14097         buffer = gen_const_char_ptr(n_buffer, 0);
14098         size = gen_int(n_size, 1);
14099 
14100         ret_val = xmlParseMemory((const char *)buffer, size);
14101         desret_xmlDocPtr(ret_val);
14102         call_tests++;
14103         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14104         des_int(n_size, size, 1);
14105         xmlResetLastError();
14106         if (mem_base != xmlMemBlocks()) {
14107             printf("Leak of %d blocks found in xmlParseMemory",
14108 	           xmlMemBlocks() - mem_base);
14109 	    test_ret++;
14110             printf(" %d", n_buffer);
14111             printf(" %d", n_size);
14112             printf("\n");
14113         }
14114     }
14115     }
14116     function_tests++;
14117 #endif
14118 #endif
14119 
14120     return(test_ret);
14121 }
14122 
14123 
14124 #define gen_nb_const_xmlParserNodeInfoPtr 1
gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14125 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14126     return(NULL);
14127 }
des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED,const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14128 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14129 }
14130 
14131 static int
test_xmlParserAddNodeInfo(void)14132 test_xmlParserAddNodeInfo(void) {
14133     int test_ret = 0;
14134 
14135     int mem_base;
14136     xmlParserCtxtPtr ctxt; /* an XML parser context */
14137     int n_ctxt;
14138     xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14139     int n_info;
14140 
14141     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14142     for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14143         mem_base = xmlMemBlocks();
14144         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14145         info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14146 
14147         xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14148         call_tests++;
14149         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14150         des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14151         xmlResetLastError();
14152         if (mem_base != xmlMemBlocks()) {
14153             printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14154 	           xmlMemBlocks() - mem_base);
14155 	    test_ret++;
14156             printf(" %d", n_ctxt);
14157             printf(" %d", n_info);
14158             printf("\n");
14159         }
14160     }
14161     }
14162     function_tests++;
14163 
14164     return(test_ret);
14165 }
14166 
14167 
14168 #define gen_nb_const_xmlParserCtxtPtr 1
gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14169 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14170     return(NULL);
14171 }
des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED,const xmlParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14172 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14173 }
14174 
14175 #define gen_nb_const_xmlNodePtr 1
gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14176 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14177     return(NULL);
14178 }
des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED,const xmlNodePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14179 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14180 }
14181 
14182 static int
test_xmlParserFindNodeInfo(void)14183 test_xmlParserFindNodeInfo(void) {
14184     int test_ret = 0;
14185 
14186     int mem_base;
14187     const xmlParserNodeInfo * ret_val;
14188     xmlParserCtxtPtr ctx; /* an XML parser context */
14189     int n_ctx;
14190     xmlNodePtr node; /* an XML node within the tree */
14191     int n_node;
14192 
14193     for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14194     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14195         mem_base = xmlMemBlocks();
14196         ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14197         node = gen_const_xmlNodePtr(n_node, 1);
14198 
14199         ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14200         desret_const_xmlParserNodeInfo_ptr(ret_val);
14201         call_tests++;
14202         des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14203         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14204         xmlResetLastError();
14205         if (mem_base != xmlMemBlocks()) {
14206             printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14207 	           xmlMemBlocks() - mem_base);
14208 	    test_ret++;
14209             printf(" %d", n_ctx);
14210             printf(" %d", n_node);
14211             printf("\n");
14212         }
14213     }
14214     }
14215     function_tests++;
14216 
14217     return(test_ret);
14218 }
14219 
14220 
14221 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14222 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14223     return(NULL);
14224 }
des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED,const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14225 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14226 }
14227 
14228 static int
test_xmlParserFindNodeInfoIndex(void)14229 test_xmlParserFindNodeInfoIndex(void) {
14230     int test_ret = 0;
14231 
14232     int mem_base;
14233     unsigned long ret_val;
14234     xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14235     int n_seq;
14236     xmlNodePtr node; /* an XML node pointer */
14237     int n_node;
14238 
14239     for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14240     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14241         mem_base = xmlMemBlocks();
14242         seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14243         node = gen_const_xmlNodePtr(n_node, 1);
14244 
14245         ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14246         desret_unsigned_long(ret_val);
14247         call_tests++;
14248         des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14249         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14250         xmlResetLastError();
14251         if (mem_base != xmlMemBlocks()) {
14252             printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14253 	           xmlMemBlocks() - mem_base);
14254 	    test_ret++;
14255             printf(" %d", n_seq);
14256             printf(" %d", n_node);
14257             printf("\n");
14258         }
14259     }
14260     }
14261     function_tests++;
14262 
14263     return(test_ret);
14264 }
14265 
14266 
14267 #define gen_nb_xmlParserInputPtr 1
gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14268 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14269     return(NULL);
14270 }
des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED,xmlParserInputPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)14271 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14272 }
14273 
14274 static int
test_xmlParserInputGrow(void)14275 test_xmlParserInputGrow(void) {
14276     int test_ret = 0;
14277 
14278     int mem_base;
14279     int ret_val;
14280     xmlParserInputPtr in; /* an XML parser input */
14281     int n_in;
14282     int len; /* an indicative size for the lookahead */
14283     int n_len;
14284 
14285     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14286     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14287         mem_base = xmlMemBlocks();
14288         in = gen_xmlParserInputPtr(n_in, 0);
14289         len = gen_int(n_len, 1);
14290 
14291         ret_val = xmlParserInputGrow(in, len);
14292         desret_int(ret_val);
14293         call_tests++;
14294         des_xmlParserInputPtr(n_in, in, 0);
14295         des_int(n_len, len, 1);
14296         xmlResetLastError();
14297         if (mem_base != xmlMemBlocks()) {
14298             printf("Leak of %d blocks found in xmlParserInputGrow",
14299 	           xmlMemBlocks() - mem_base);
14300 	    test_ret++;
14301             printf(" %d", n_in);
14302             printf(" %d", n_len);
14303             printf("\n");
14304         }
14305     }
14306     }
14307     function_tests++;
14308 
14309     return(test_ret);
14310 }
14311 
14312 
14313 static int
test_xmlParserInputRead(void)14314 test_xmlParserInputRead(void) {
14315     int test_ret = 0;
14316 
14317     int mem_base;
14318     int ret_val;
14319     xmlParserInputPtr in; /* an XML parser input */
14320     int n_in;
14321     int len; /* an indicative size for the lookahead */
14322     int n_len;
14323 
14324     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14325     for (n_len = 0;n_len < gen_nb_int;n_len++) {
14326         mem_base = xmlMemBlocks();
14327         in = gen_xmlParserInputPtr(n_in, 0);
14328         len = gen_int(n_len, 1);
14329 
14330         ret_val = xmlParserInputRead(in, len);
14331         desret_int(ret_val);
14332         call_tests++;
14333         des_xmlParserInputPtr(n_in, in, 0);
14334         des_int(n_len, len, 1);
14335         xmlResetLastError();
14336         if (mem_base != xmlMemBlocks()) {
14337             printf("Leak of %d blocks found in xmlParserInputRead",
14338 	           xmlMemBlocks() - mem_base);
14339 	    test_ret++;
14340             printf(" %d", n_in);
14341             printf(" %d", n_len);
14342             printf("\n");
14343         }
14344     }
14345     }
14346     function_tests++;
14347 
14348     return(test_ret);
14349 }
14350 
14351 
14352 static int
test_xmlPedanticParserDefault(void)14353 test_xmlPedanticParserDefault(void) {
14354     int test_ret = 0;
14355 
14356     int mem_base;
14357     int ret_val;
14358     int val; /* int 0 or 1 */
14359     int n_val;
14360 
14361     for (n_val = 0;n_val < gen_nb_int;n_val++) {
14362         mem_base = xmlMemBlocks();
14363         val = gen_int(n_val, 0);
14364 
14365         ret_val = xmlPedanticParserDefault(val);
14366         desret_int(ret_val);
14367         call_tests++;
14368         des_int(n_val, val, 0);
14369         xmlResetLastError();
14370         if (mem_base != xmlMemBlocks()) {
14371             printf("Leak of %d blocks found in xmlPedanticParserDefault",
14372 	           xmlMemBlocks() - mem_base);
14373 	    test_ret++;
14374             printf(" %d", n_val);
14375             printf("\n");
14376         }
14377     }
14378     function_tests++;
14379 
14380     return(test_ret);
14381 }
14382 
14383 
14384 static int
test_xmlReadDoc(void)14385 test_xmlReadDoc(void) {
14386     int test_ret = 0;
14387 
14388     int mem_base;
14389     xmlDocPtr ret_val;
14390     xmlChar * cur; /* a pointer to a zero terminated string */
14391     int n_cur;
14392     const char * URL; /* the base URL to use for the document */
14393     int n_URL;
14394     char * encoding; /* the document encoding, or NULL */
14395     int n_encoding;
14396     int options; /* a combination of xmlParserOption */
14397     int n_options;
14398 
14399     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14400     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14401     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14402     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14403         mem_base = xmlMemBlocks();
14404         cur = gen_const_xmlChar_ptr(n_cur, 0);
14405         URL = gen_filepath(n_URL, 1);
14406         encoding = gen_const_char_ptr(n_encoding, 2);
14407         options = gen_parseroptions(n_options, 3);
14408 
14409         ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14410         desret_xmlDocPtr(ret_val);
14411         call_tests++;
14412         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14413         des_filepath(n_URL, URL, 1);
14414         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14415         des_parseroptions(n_options, options, 3);
14416         xmlResetLastError();
14417         if (mem_base != xmlMemBlocks()) {
14418             printf("Leak of %d blocks found in xmlReadDoc",
14419 	           xmlMemBlocks() - mem_base);
14420 	    test_ret++;
14421             printf(" %d", n_cur);
14422             printf(" %d", n_URL);
14423             printf(" %d", n_encoding);
14424             printf(" %d", n_options);
14425             printf("\n");
14426         }
14427     }
14428     }
14429     }
14430     }
14431     function_tests++;
14432 
14433     return(test_ret);
14434 }
14435 
14436 
14437 static int
test_xmlReadFile(void)14438 test_xmlReadFile(void) {
14439     int test_ret = 0;
14440 
14441     int mem_base;
14442     xmlDocPtr ret_val;
14443     const char * filename; /* a file or URL */
14444     int n_filename;
14445     char * encoding; /* the document encoding, or NULL */
14446     int n_encoding;
14447     int options; /* a combination of xmlParserOption */
14448     int n_options;
14449 
14450     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14451     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14452     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14453         mem_base = xmlMemBlocks();
14454         filename = gen_filepath(n_filename, 0);
14455         encoding = gen_const_char_ptr(n_encoding, 1);
14456         options = gen_parseroptions(n_options, 2);
14457 
14458         ret_val = xmlReadFile(filename, (const char *)encoding, options);
14459         desret_xmlDocPtr(ret_val);
14460         call_tests++;
14461         des_filepath(n_filename, filename, 0);
14462         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14463         des_parseroptions(n_options, options, 2);
14464         xmlResetLastError();
14465         if (mem_base != xmlMemBlocks()) {
14466             printf("Leak of %d blocks found in xmlReadFile",
14467 	           xmlMemBlocks() - mem_base);
14468 	    test_ret++;
14469             printf(" %d", n_filename);
14470             printf(" %d", n_encoding);
14471             printf(" %d", n_options);
14472             printf("\n");
14473         }
14474     }
14475     }
14476     }
14477     function_tests++;
14478 
14479     return(test_ret);
14480 }
14481 
14482 
14483 static int
test_xmlReadMemory(void)14484 test_xmlReadMemory(void) {
14485     int test_ret = 0;
14486 
14487     int mem_base;
14488     xmlDocPtr ret_val;
14489     char * buffer; /* a pointer to a char array */
14490     int n_buffer;
14491     int size; /* the size of the array */
14492     int n_size;
14493     const char * URL; /* the base URL to use for the document */
14494     int n_URL;
14495     char * encoding; /* the document encoding, or NULL */
14496     int n_encoding;
14497     int options; /* a combination of xmlParserOption */
14498     int n_options;
14499 
14500     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14501     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14502     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14503     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14504     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14505         mem_base = xmlMemBlocks();
14506         buffer = gen_const_char_ptr(n_buffer, 0);
14507         size = gen_int(n_size, 1);
14508         URL = gen_filepath(n_URL, 2);
14509         encoding = gen_const_char_ptr(n_encoding, 3);
14510         options = gen_parseroptions(n_options, 4);
14511 
14512         ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14513         desret_xmlDocPtr(ret_val);
14514         call_tests++;
14515         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14516         des_int(n_size, size, 1);
14517         des_filepath(n_URL, URL, 2);
14518         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14519         des_parseroptions(n_options, options, 4);
14520         xmlResetLastError();
14521         if (mem_base != xmlMemBlocks()) {
14522             printf("Leak of %d blocks found in xmlReadMemory",
14523 	           xmlMemBlocks() - mem_base);
14524 	    test_ret++;
14525             printf(" %d", n_buffer);
14526             printf(" %d", n_size);
14527             printf(" %d", n_URL);
14528             printf(" %d", n_encoding);
14529             printf(" %d", n_options);
14530             printf("\n");
14531         }
14532     }
14533     }
14534     }
14535     }
14536     }
14537     function_tests++;
14538 
14539     return(test_ret);
14540 }
14541 
14542 
14543 static int
test_xmlRecoverDoc(void)14544 test_xmlRecoverDoc(void) {
14545     int test_ret = 0;
14546 
14547 #if defined(LIBXML_SAX1_ENABLED)
14548 #ifdef LIBXML_SAX1_ENABLED
14549     int mem_base;
14550     xmlDocPtr ret_val;
14551     xmlChar * cur; /* a pointer to an array of xmlChar */
14552     int n_cur;
14553 
14554     for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14555         mem_base = xmlMemBlocks();
14556         cur = gen_xmlChar_ptr(n_cur, 0);
14557 
14558         ret_val = xmlRecoverDoc(cur);
14559         desret_xmlDocPtr(ret_val);
14560         call_tests++;
14561         des_xmlChar_ptr(n_cur, cur, 0);
14562         xmlResetLastError();
14563         if (mem_base != xmlMemBlocks()) {
14564             printf("Leak of %d blocks found in xmlRecoverDoc",
14565 	           xmlMemBlocks() - mem_base);
14566 	    test_ret++;
14567             printf(" %d", n_cur);
14568             printf("\n");
14569         }
14570     }
14571     function_tests++;
14572 #endif
14573 #endif
14574 
14575     return(test_ret);
14576 }
14577 
14578 
14579 static int
test_xmlRecoverFile(void)14580 test_xmlRecoverFile(void) {
14581     int test_ret = 0;
14582 
14583 #if defined(LIBXML_SAX1_ENABLED)
14584 #ifdef LIBXML_SAX1_ENABLED
14585     int mem_base;
14586     xmlDocPtr ret_val;
14587     const char * filename; /* the filename */
14588     int n_filename;
14589 
14590     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14591         mem_base = xmlMemBlocks();
14592         filename = gen_filepath(n_filename, 0);
14593 
14594         ret_val = xmlRecoverFile(filename);
14595         desret_xmlDocPtr(ret_val);
14596         call_tests++;
14597         des_filepath(n_filename, filename, 0);
14598         xmlResetLastError();
14599         if (mem_base != xmlMemBlocks()) {
14600             printf("Leak of %d blocks found in xmlRecoverFile",
14601 	           xmlMemBlocks() - mem_base);
14602 	    test_ret++;
14603             printf(" %d", n_filename);
14604             printf("\n");
14605         }
14606     }
14607     function_tests++;
14608 #endif
14609 #endif
14610 
14611     return(test_ret);
14612 }
14613 
14614 
14615 static int
test_xmlRecoverMemory(void)14616 test_xmlRecoverMemory(void) {
14617     int test_ret = 0;
14618 
14619 #if defined(LIBXML_SAX1_ENABLED)
14620 #ifdef LIBXML_SAX1_ENABLED
14621     int mem_base;
14622     xmlDocPtr ret_val;
14623     char * buffer; /* an pointer to a char array */
14624     int n_buffer;
14625     int size; /* the size of the array */
14626     int n_size;
14627 
14628     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14629     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14630         mem_base = xmlMemBlocks();
14631         buffer = gen_const_char_ptr(n_buffer, 0);
14632         size = gen_int(n_size, 1);
14633 
14634         ret_val = xmlRecoverMemory((const char *)buffer, size);
14635         desret_xmlDocPtr(ret_val);
14636         call_tests++;
14637         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14638         des_int(n_size, size, 1);
14639         xmlResetLastError();
14640         if (mem_base != xmlMemBlocks()) {
14641             printf("Leak of %d blocks found in xmlRecoverMemory",
14642 	           xmlMemBlocks() - mem_base);
14643 	    test_ret++;
14644             printf(" %d", n_buffer);
14645             printf(" %d", n_size);
14646             printf("\n");
14647         }
14648     }
14649     }
14650     function_tests++;
14651 #endif
14652 #endif
14653 
14654     return(test_ret);
14655 }
14656 
14657 
14658 static int
test_xmlSAXParseDTD(void)14659 test_xmlSAXParseDTD(void) {
14660     int test_ret = 0;
14661 
14662 #if defined(LIBXML_VALID_ENABLED)
14663 #ifdef LIBXML_SAX1_ENABLED
14664     int mem_base;
14665     xmlDtdPtr ret_val;
14666     xmlSAXHandlerPtr sax; /* the SAX handler block */
14667     int n_sax;
14668     xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14669     int n_ExternalID;
14670     xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14671     int n_SystemID;
14672 
14673     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14674     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14675     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14676         mem_base = xmlMemBlocks();
14677         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14678         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14679         SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14680 
14681         ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14682         desret_xmlDtdPtr(ret_val);
14683         call_tests++;
14684         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14685         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14686         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14687         xmlResetLastError();
14688         if (mem_base != xmlMemBlocks()) {
14689             printf("Leak of %d blocks found in xmlSAXParseDTD",
14690 	           xmlMemBlocks() - mem_base);
14691 	    test_ret++;
14692             printf(" %d", n_sax);
14693             printf(" %d", n_ExternalID);
14694             printf(" %d", n_SystemID);
14695             printf("\n");
14696         }
14697     }
14698     }
14699     }
14700     function_tests++;
14701 #endif
14702 #endif
14703 
14704     return(test_ret);
14705 }
14706 
14707 
14708 static int
test_xmlSAXParseDoc(void)14709 test_xmlSAXParseDoc(void) {
14710     int test_ret = 0;
14711 
14712 #if defined(LIBXML_SAX1_ENABLED)
14713 #ifdef LIBXML_SAX1_ENABLED
14714     int mem_base;
14715     xmlDocPtr ret_val;
14716     xmlSAXHandlerPtr sax; /* the SAX handler block */
14717     int n_sax;
14718     xmlChar * cur; /* a pointer to an array of xmlChar */
14719     int n_cur;
14720     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14721     int n_recovery;
14722 
14723     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14724     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14725     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14726         mem_base = xmlMemBlocks();
14727         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14728         cur = gen_const_xmlChar_ptr(n_cur, 1);
14729         recovery = gen_int(n_recovery, 2);
14730 
14731         ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14732         desret_xmlDocPtr(ret_val);
14733         call_tests++;
14734         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14735         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14736         des_int(n_recovery, recovery, 2);
14737         xmlResetLastError();
14738         if (mem_base != xmlMemBlocks()) {
14739             printf("Leak of %d blocks found in xmlSAXParseDoc",
14740 	           xmlMemBlocks() - mem_base);
14741 	    test_ret++;
14742             printf(" %d", n_sax);
14743             printf(" %d", n_cur);
14744             printf(" %d", n_recovery);
14745             printf("\n");
14746         }
14747     }
14748     }
14749     }
14750     function_tests++;
14751 #endif
14752 #endif
14753 
14754     return(test_ret);
14755 }
14756 
14757 
14758 static int
test_xmlSAXParseEntity(void)14759 test_xmlSAXParseEntity(void) {
14760     int test_ret = 0;
14761 
14762 #if defined(LIBXML_SAX1_ENABLED)
14763 #ifdef LIBXML_SAX1_ENABLED
14764     int mem_base;
14765     xmlDocPtr ret_val;
14766     xmlSAXHandlerPtr sax; /* the SAX handler block */
14767     int n_sax;
14768     const char * filename; /* the filename */
14769     int n_filename;
14770 
14771     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14772     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14773         mem_base = xmlMemBlocks();
14774         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14775         filename = gen_filepath(n_filename, 1);
14776 
14777         ret_val = xmlSAXParseEntity(sax, filename);
14778         desret_xmlDocPtr(ret_val);
14779         call_tests++;
14780         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14781         des_filepath(n_filename, filename, 1);
14782         xmlResetLastError();
14783         if (mem_base != xmlMemBlocks()) {
14784             printf("Leak of %d blocks found in xmlSAXParseEntity",
14785 	           xmlMemBlocks() - mem_base);
14786 	    test_ret++;
14787             printf(" %d", n_sax);
14788             printf(" %d", n_filename);
14789             printf("\n");
14790         }
14791     }
14792     }
14793     function_tests++;
14794 #endif
14795 #endif
14796 
14797     return(test_ret);
14798 }
14799 
14800 
14801 static int
test_xmlSAXParseFile(void)14802 test_xmlSAXParseFile(void) {
14803     int test_ret = 0;
14804 
14805 #if defined(LIBXML_SAX1_ENABLED)
14806 #ifdef LIBXML_SAX1_ENABLED
14807     int mem_base;
14808     xmlDocPtr ret_val;
14809     xmlSAXHandlerPtr sax; /* the SAX handler block */
14810     int n_sax;
14811     const char * filename; /* the filename */
14812     int n_filename;
14813     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14814     int n_recovery;
14815 
14816     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14817     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14818     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14819         mem_base = xmlMemBlocks();
14820         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14821         filename = gen_filepath(n_filename, 1);
14822         recovery = gen_int(n_recovery, 2);
14823 
14824         ret_val = xmlSAXParseFile(sax, filename, recovery);
14825         desret_xmlDocPtr(ret_val);
14826         call_tests++;
14827         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14828         des_filepath(n_filename, filename, 1);
14829         des_int(n_recovery, recovery, 2);
14830         xmlResetLastError();
14831         if (mem_base != xmlMemBlocks()) {
14832             printf("Leak of %d blocks found in xmlSAXParseFile",
14833 	           xmlMemBlocks() - mem_base);
14834 	    test_ret++;
14835             printf(" %d", n_sax);
14836             printf(" %d", n_filename);
14837             printf(" %d", n_recovery);
14838             printf("\n");
14839         }
14840     }
14841     }
14842     }
14843     function_tests++;
14844 #endif
14845 #endif
14846 
14847     return(test_ret);
14848 }
14849 
14850 
14851 static int
test_xmlSAXParseFileWithData(void)14852 test_xmlSAXParseFileWithData(void) {
14853     int test_ret = 0;
14854 
14855 #if defined(LIBXML_SAX1_ENABLED)
14856 #ifdef LIBXML_SAX1_ENABLED
14857     int mem_base;
14858     xmlDocPtr ret_val;
14859     xmlSAXHandlerPtr sax; /* the SAX handler block */
14860     int n_sax;
14861     const char * filename; /* the filename */
14862     int n_filename;
14863     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14864     int n_recovery;
14865     void * data; /* the userdata */
14866     int n_data;
14867 
14868     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14869     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14870     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14871     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14872         mem_base = xmlMemBlocks();
14873         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14874         filename = gen_filepath(n_filename, 1);
14875         recovery = gen_int(n_recovery, 2);
14876         data = gen_userdata(n_data, 3);
14877 
14878         ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14879         desret_xmlDocPtr(ret_val);
14880         call_tests++;
14881         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14882         des_filepath(n_filename, filename, 1);
14883         des_int(n_recovery, recovery, 2);
14884         des_userdata(n_data, data, 3);
14885         xmlResetLastError();
14886         if (mem_base != xmlMemBlocks()) {
14887             printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14888 	           xmlMemBlocks() - mem_base);
14889 	    test_ret++;
14890             printf(" %d", n_sax);
14891             printf(" %d", n_filename);
14892             printf(" %d", n_recovery);
14893             printf(" %d", n_data);
14894             printf("\n");
14895         }
14896     }
14897     }
14898     }
14899     }
14900     function_tests++;
14901 #endif
14902 #endif
14903 
14904     return(test_ret);
14905 }
14906 
14907 
14908 static int
test_xmlSAXParseMemory(void)14909 test_xmlSAXParseMemory(void) {
14910     int test_ret = 0;
14911 
14912 #if defined(LIBXML_SAX1_ENABLED)
14913 #ifdef LIBXML_SAX1_ENABLED
14914     int mem_base;
14915     xmlDocPtr ret_val;
14916     xmlSAXHandlerPtr sax; /* the SAX handler block */
14917     int n_sax;
14918     char * buffer; /* an pointer to a char array */
14919     int n_buffer;
14920     int size; /* the size of the array */
14921     int n_size;
14922     int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14923     int n_recovery;
14924 
14925     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14926     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14927     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14928     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14929         mem_base = xmlMemBlocks();
14930         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14931         buffer = gen_const_char_ptr(n_buffer, 1);
14932         size = gen_int(n_size, 2);
14933         recovery = gen_int(n_recovery, 3);
14934 
14935         ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14936         desret_xmlDocPtr(ret_val);
14937         call_tests++;
14938         des_xmlSAXHandlerPtr(n_sax, sax, 0);
14939         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14940         des_int(n_size, size, 2);
14941         des_int(n_recovery, recovery, 3);
14942         xmlResetLastError();
14943         if (mem_base != xmlMemBlocks()) {
14944             printf("Leak of %d blocks found in xmlSAXParseMemory",
14945 	           xmlMemBlocks() - mem_base);
14946 	    test_ret++;
14947             printf(" %d", n_sax);
14948             printf(" %d", n_buffer);
14949             printf(" %d", n_size);
14950             printf(" %d", n_recovery);
14951             printf("\n");
14952         }
14953     }
14954     }
14955     }
14956     }
14957     function_tests++;
14958 #endif
14959 #endif
14960 
14961     return(test_ret);
14962 }
14963 
14964 
14965 static int
test_xmlSAXParseMemoryWithData(void)14966 test_xmlSAXParseMemoryWithData(void) {
14967     int test_ret = 0;
14968 
14969 #if defined(LIBXML_SAX1_ENABLED)
14970 #ifdef LIBXML_SAX1_ENABLED
14971     int mem_base;
14972     xmlDocPtr ret_val;
14973     xmlSAXHandlerPtr sax; /* the SAX handler block */
14974     int n_sax;
14975     char * buffer; /* an pointer to a char array */
14976     int n_buffer;
14977     int size; /* the size of the array */
14978     int n_size;
14979     int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14980     int n_recovery;
14981     void * data; /* the userdata */
14982     int n_data;
14983 
14984     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14985     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14986     for (n_size = 0;n_size < gen_nb_int;n_size++) {
14987     for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14988     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14989         mem_base = xmlMemBlocks();
14990         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14991         buffer = gen_const_char_ptr(n_buffer, 1);
14992         size = gen_int(n_size, 2);
14993         recovery = gen_int(n_recovery, 3);
14994         data = gen_userdata(n_data, 4);
14995 
14996         ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
14997         desret_xmlDocPtr(ret_val);
14998         call_tests++;
14999         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15000         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15001         des_int(n_size, size, 2);
15002         des_int(n_recovery, recovery, 3);
15003         des_userdata(n_data, data, 4);
15004         xmlResetLastError();
15005         if (mem_base != xmlMemBlocks()) {
15006             printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15007 	           xmlMemBlocks() - mem_base);
15008 	    test_ret++;
15009             printf(" %d", n_sax);
15010             printf(" %d", n_buffer);
15011             printf(" %d", n_size);
15012             printf(" %d", n_recovery);
15013             printf(" %d", n_data);
15014             printf("\n");
15015         }
15016     }
15017     }
15018     }
15019     }
15020     }
15021     function_tests++;
15022 #endif
15023 #endif
15024 
15025     return(test_ret);
15026 }
15027 
15028 
15029 static int
test_xmlSAXUserParseFile(void)15030 test_xmlSAXUserParseFile(void) {
15031     int test_ret = 0;
15032 
15033 #if defined(LIBXML_SAX1_ENABLED)
15034 #ifdef LIBXML_SAX1_ENABLED
15035     int mem_base;
15036     int ret_val;
15037     xmlSAXHandlerPtr sax; /* a SAX handler */
15038     int n_sax;
15039     void * user_data; /* The user data returned on SAX callbacks */
15040     int n_user_data;
15041     const char * filename; /* a file name */
15042     int n_filename;
15043 
15044     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15045     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15046     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15047         mem_base = xmlMemBlocks();
15048         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15049         user_data = gen_userdata(n_user_data, 1);
15050         filename = gen_filepath(n_filename, 2);
15051 
15052 #ifdef LIBXML_SAX1_ENABLED
15053         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15054 #endif
15055 
15056 
15057         ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15058         desret_int(ret_val);
15059         call_tests++;
15060         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15061         des_userdata(n_user_data, user_data, 1);
15062         des_filepath(n_filename, filename, 2);
15063         xmlResetLastError();
15064         if (mem_base != xmlMemBlocks()) {
15065             printf("Leak of %d blocks found in xmlSAXUserParseFile",
15066 	           xmlMemBlocks() - mem_base);
15067 	    test_ret++;
15068             printf(" %d", n_sax);
15069             printf(" %d", n_user_data);
15070             printf(" %d", n_filename);
15071             printf("\n");
15072         }
15073     }
15074     }
15075     }
15076     function_tests++;
15077 #endif
15078 #endif
15079 
15080     return(test_ret);
15081 }
15082 
15083 
15084 static int
test_xmlSAXUserParseMemory(void)15085 test_xmlSAXUserParseMemory(void) {
15086     int test_ret = 0;
15087 
15088 #if defined(LIBXML_SAX1_ENABLED)
15089 #ifdef LIBXML_SAX1_ENABLED
15090     int mem_base;
15091     int ret_val;
15092     xmlSAXHandlerPtr sax; /* a SAX handler */
15093     int n_sax;
15094     void * user_data; /* The user data returned on SAX callbacks */
15095     int n_user_data;
15096     char * buffer; /* an in-memory XML document input */
15097     int n_buffer;
15098     int size; /* the length of the XML document in bytes */
15099     int n_size;
15100 
15101     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15102     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15103     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15104     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15105         mem_base = xmlMemBlocks();
15106         sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15107         user_data = gen_userdata(n_user_data, 1);
15108         buffer = gen_const_char_ptr(n_buffer, 2);
15109         size = gen_int(n_size, 3);
15110 
15111 #ifdef LIBXML_SAX1_ENABLED
15112         if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15113 #endif
15114 
15115 
15116         ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15117         desret_int(ret_val);
15118         call_tests++;
15119         des_xmlSAXHandlerPtr(n_sax, sax, 0);
15120         des_userdata(n_user_data, user_data, 1);
15121         des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15122         des_int(n_size, size, 3);
15123         xmlResetLastError();
15124         if (mem_base != xmlMemBlocks()) {
15125             printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15126 	           xmlMemBlocks() - mem_base);
15127 	    test_ret++;
15128             printf(" %d", n_sax);
15129             printf(" %d", n_user_data);
15130             printf(" %d", n_buffer);
15131             printf(" %d", n_size);
15132             printf("\n");
15133         }
15134     }
15135     }
15136     }
15137     }
15138     function_tests++;
15139 #endif
15140 #endif
15141 
15142     return(test_ret);
15143 }
15144 
15145 
15146 static int
test_xmlSetExternalEntityLoader(void)15147 test_xmlSetExternalEntityLoader(void) {
15148     int test_ret = 0;
15149 
15150 
15151     /* missing type support */
15152     return(test_ret);
15153 }
15154 
15155 
15156 static int
test_xmlSetFeature(void)15157 test_xmlSetFeature(void) {
15158     int test_ret = 0;
15159 
15160 #if defined(LIBXML_LEGACY_ENABLED)
15161 #ifdef LIBXML_LEGACY_ENABLED
15162     int mem_base;
15163     int ret_val;
15164     xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15165     int n_ctxt;
15166     char * name; /* the feature name */
15167     int n_name;
15168     void * value; /* pointer to the location of the new value */
15169     int n_value;
15170 
15171     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15172     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15173     for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15174         mem_base = xmlMemBlocks();
15175         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15176         name = gen_const_char_ptr(n_name, 1);
15177         value = gen_void_ptr(n_value, 2);
15178 
15179         ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15180         desret_int(ret_val);
15181         call_tests++;
15182         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15183         des_const_char_ptr(n_name, (const char *)name, 1);
15184         des_void_ptr(n_value, value, 2);
15185         xmlResetLastError();
15186         if (mem_base != xmlMemBlocks()) {
15187             printf("Leak of %d blocks found in xmlSetFeature",
15188 	           xmlMemBlocks() - mem_base);
15189 	    test_ret++;
15190             printf(" %d", n_ctxt);
15191             printf(" %d", n_name);
15192             printf(" %d", n_value);
15193             printf("\n");
15194         }
15195     }
15196     }
15197     }
15198     function_tests++;
15199 #endif
15200 #endif
15201 
15202     return(test_ret);
15203 }
15204 
15205 
15206 static int
test_xmlSetupParserForBuffer(void)15207 test_xmlSetupParserForBuffer(void) {
15208     int test_ret = 0;
15209 
15210 #if defined(LIBXML_SAX1_ENABLED)
15211 #ifdef LIBXML_SAX1_ENABLED
15212     int mem_base;
15213     xmlParserCtxtPtr ctxt; /* an XML parser context */
15214     int n_ctxt;
15215     xmlChar * buffer; /* a xmlChar * buffer */
15216     int n_buffer;
15217     const char * filename; /* a file name */
15218     int n_filename;
15219 
15220     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15221     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15222     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15223         mem_base = xmlMemBlocks();
15224         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15225         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15226         filename = gen_filepath(n_filename, 2);
15227 
15228         xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15229         call_tests++;
15230         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15231         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15232         des_filepath(n_filename, filename, 2);
15233         xmlResetLastError();
15234         if (mem_base != xmlMemBlocks()) {
15235             printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15236 	           xmlMemBlocks() - mem_base);
15237 	    test_ret++;
15238             printf(" %d", n_ctxt);
15239             printf(" %d", n_buffer);
15240             printf(" %d", n_filename);
15241             printf("\n");
15242         }
15243     }
15244     }
15245     }
15246     function_tests++;
15247 #endif
15248 #endif
15249 
15250     return(test_ret);
15251 }
15252 
15253 
15254 static int
test_xmlStopParser(void)15255 test_xmlStopParser(void) {
15256     int test_ret = 0;
15257 
15258 #ifdef LIBXML_PUSH_ENABLED
15259     int mem_base;
15260     xmlParserCtxtPtr ctxt; /* an XML parser context */
15261     int n_ctxt;
15262 
15263     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15264         mem_base = xmlMemBlocks();
15265         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15266 
15267         xmlStopParser(ctxt);
15268         call_tests++;
15269         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15270         xmlResetLastError();
15271         if (mem_base != xmlMemBlocks()) {
15272             printf("Leak of %d blocks found in xmlStopParser",
15273 	           xmlMemBlocks() - mem_base);
15274 	    test_ret++;
15275             printf(" %d", n_ctxt);
15276             printf("\n");
15277         }
15278     }
15279     function_tests++;
15280 #endif
15281 
15282     return(test_ret);
15283 }
15284 
15285 
15286 static int
test_xmlSubstituteEntitiesDefault(void)15287 test_xmlSubstituteEntitiesDefault(void) {
15288     int test_ret = 0;
15289 
15290     int mem_base;
15291     int ret_val;
15292     int val; /* int 0 or 1 */
15293     int n_val;
15294 
15295     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15296         mem_base = xmlMemBlocks();
15297         val = gen_int(n_val, 0);
15298 
15299         ret_val = xmlSubstituteEntitiesDefault(val);
15300         desret_int(ret_val);
15301         call_tests++;
15302         des_int(n_val, val, 0);
15303         xmlResetLastError();
15304         if (mem_base != xmlMemBlocks()) {
15305             printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15306 	           xmlMemBlocks() - mem_base);
15307 	    test_ret++;
15308             printf(" %d", n_val);
15309             printf("\n");
15310         }
15311     }
15312     function_tests++;
15313 
15314     return(test_ret);
15315 }
15316 
15317 static int
test_parser(void)15318 test_parser(void) {
15319     int test_ret = 0;
15320 
15321     if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15322     test_ret += test_xmlByteConsumed();
15323     test_ret += test_xmlClearNodeInfoSeq();
15324     test_ret += test_xmlClearParserCtxt();
15325     test_ret += test_xmlCreateDocParserCtxt();
15326     test_ret += test_xmlCreatePushParserCtxt();
15327     test_ret += test_xmlCtxtReadDoc();
15328     test_ret += test_xmlCtxtReadFile();
15329     test_ret += test_xmlCtxtReadMemory();
15330     test_ret += test_xmlCtxtReset();
15331     test_ret += test_xmlCtxtResetPush();
15332     test_ret += test_xmlCtxtUseOptions();
15333     test_ret += test_xmlGetExternalEntityLoader();
15334     test_ret += test_xmlGetFeature();
15335     test_ret += test_xmlGetFeaturesList();
15336     test_ret += test_xmlHasFeature();
15337     test_ret += test_xmlIOParseDTD();
15338     test_ret += test_xmlInitNodeInfoSeq();
15339     test_ret += test_xmlInitParser();
15340     test_ret += test_xmlInitParserCtxt();
15341     test_ret += test_xmlKeepBlanksDefault();
15342     test_ret += test_xmlLineNumbersDefault();
15343     test_ret += test_xmlLoadExternalEntity();
15344     test_ret += test_xmlNewIOInputStream();
15345     test_ret += test_xmlNewParserCtxt();
15346     test_ret += test_xmlParseBalancedChunkMemory();
15347     test_ret += test_xmlParseBalancedChunkMemoryRecover();
15348     test_ret += test_xmlParseChunk();
15349     test_ret += test_xmlParseCtxtExternalEntity();
15350     test_ret += test_xmlParseDTD();
15351     test_ret += test_xmlParseDoc();
15352     test_ret += test_xmlParseDocument();
15353     test_ret += test_xmlParseEntity();
15354     test_ret += test_xmlParseExtParsedEnt();
15355     test_ret += test_xmlParseExternalEntity();
15356     test_ret += test_xmlParseFile();
15357     test_ret += test_xmlParseInNodeContext();
15358     test_ret += test_xmlParseMemory();
15359     test_ret += test_xmlParserAddNodeInfo();
15360     test_ret += test_xmlParserFindNodeInfo();
15361     test_ret += test_xmlParserFindNodeInfoIndex();
15362     test_ret += test_xmlParserInputGrow();
15363     test_ret += test_xmlParserInputRead();
15364     test_ret += test_xmlPedanticParserDefault();
15365     test_ret += test_xmlReadDoc();
15366     test_ret += test_xmlReadFile();
15367     test_ret += test_xmlReadMemory();
15368     test_ret += test_xmlRecoverDoc();
15369     test_ret += test_xmlRecoverFile();
15370     test_ret += test_xmlRecoverMemory();
15371     test_ret += test_xmlSAXParseDTD();
15372     test_ret += test_xmlSAXParseDoc();
15373     test_ret += test_xmlSAXParseEntity();
15374     test_ret += test_xmlSAXParseFile();
15375     test_ret += test_xmlSAXParseFileWithData();
15376     test_ret += test_xmlSAXParseMemory();
15377     test_ret += test_xmlSAXParseMemoryWithData();
15378     test_ret += test_xmlSAXUserParseFile();
15379     test_ret += test_xmlSAXUserParseMemory();
15380     test_ret += test_xmlSetExternalEntityLoader();
15381     test_ret += test_xmlSetFeature();
15382     test_ret += test_xmlSetupParserForBuffer();
15383     test_ret += test_xmlStopParser();
15384     test_ret += test_xmlSubstituteEntitiesDefault();
15385 
15386     if (test_ret != 0)
15387 	printf("Module parser: %d errors\n", test_ret);
15388     return(test_ret);
15389 }
15390 
15391 static int
test_htmlCreateFileParserCtxt(void)15392 test_htmlCreateFileParserCtxt(void) {
15393     int test_ret = 0;
15394 
15395 #if defined(LIBXML_HTML_ENABLED)
15396     int mem_base;
15397     htmlParserCtxtPtr ret_val;
15398     const char * filename; /* the filename */
15399     int n_filename;
15400     char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15401     int n_encoding;
15402 
15403     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15404     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15405         mem_base = xmlMemBlocks();
15406         filename = gen_fileoutput(n_filename, 0);
15407         encoding = gen_const_char_ptr(n_encoding, 1);
15408 
15409         ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15410         desret_htmlParserCtxtPtr(ret_val);
15411         call_tests++;
15412         des_fileoutput(n_filename, filename, 0);
15413         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15414         xmlResetLastError();
15415         if (mem_base != xmlMemBlocks()) {
15416             printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15417 	           xmlMemBlocks() - mem_base);
15418 	    test_ret++;
15419             printf(" %d", n_filename);
15420             printf(" %d", n_encoding);
15421             printf("\n");
15422         }
15423     }
15424     }
15425     function_tests++;
15426 #endif
15427 
15428     return(test_ret);
15429 }
15430 
15431 
15432 static int
test_htmlInitAutoClose(void)15433 test_htmlInitAutoClose(void) {
15434     int test_ret = 0;
15435 
15436 #if defined(LIBXML_HTML_ENABLED)
15437     int mem_base;
15438 
15439         mem_base = xmlMemBlocks();
15440 
15441         htmlInitAutoClose();
15442         call_tests++;
15443         xmlResetLastError();
15444         if (mem_base != xmlMemBlocks()) {
15445             printf("Leak of %d blocks found in htmlInitAutoClose",
15446 	           xmlMemBlocks() - mem_base);
15447 	    test_ret++;
15448             printf("\n");
15449         }
15450     function_tests++;
15451 #endif
15452 
15453     return(test_ret);
15454 }
15455 
15456 
15457 static int
test_inputPop(void)15458 test_inputPop(void) {
15459     int test_ret = 0;
15460 
15461     int mem_base;
15462     xmlParserInputPtr ret_val;
15463     xmlParserCtxtPtr ctxt; /* an XML parser context */
15464     int n_ctxt;
15465 
15466     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15467         mem_base = xmlMemBlocks();
15468         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15469 
15470         ret_val = inputPop(ctxt);
15471         desret_xmlParserInputPtr(ret_val);
15472         call_tests++;
15473         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15474         xmlResetLastError();
15475         if (mem_base != xmlMemBlocks()) {
15476             printf("Leak of %d blocks found in inputPop",
15477 	           xmlMemBlocks() - mem_base);
15478 	    test_ret++;
15479             printf(" %d", n_ctxt);
15480             printf("\n");
15481         }
15482     }
15483     function_tests++;
15484 
15485     return(test_ret);
15486 }
15487 
15488 
15489 static int
test_inputPush(void)15490 test_inputPush(void) {
15491     int test_ret = 0;
15492 
15493     int mem_base;
15494     int ret_val;
15495     xmlParserCtxtPtr ctxt; /* an XML parser context */
15496     int n_ctxt;
15497     xmlParserInputPtr value; /* the parser input */
15498     int n_value;
15499 
15500     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15501     for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15502         mem_base = xmlMemBlocks();
15503         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15504         value = gen_xmlParserInputPtr(n_value, 1);
15505 
15506         ret_val = inputPush(ctxt, value);
15507         desret_int(ret_val);
15508         call_tests++;
15509         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15510         des_xmlParserInputPtr(n_value, value, 1);
15511         xmlResetLastError();
15512         if (mem_base != xmlMemBlocks()) {
15513             printf("Leak of %d blocks found in inputPush",
15514 	           xmlMemBlocks() - mem_base);
15515 	    test_ret++;
15516             printf(" %d", n_ctxt);
15517             printf(" %d", n_value);
15518             printf("\n");
15519         }
15520     }
15521     }
15522     function_tests++;
15523 
15524     return(test_ret);
15525 }
15526 
15527 
15528 static int
test_namePop(void)15529 test_namePop(void) {
15530     int test_ret = 0;
15531 
15532     int mem_base;
15533     const xmlChar * ret_val;
15534     xmlParserCtxtPtr ctxt; /* an XML parser context */
15535     int n_ctxt;
15536 
15537     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15538         mem_base = xmlMemBlocks();
15539         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15540 
15541         ret_val = namePop(ctxt);
15542         desret_const_xmlChar_ptr(ret_val);
15543         call_tests++;
15544         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15545         xmlResetLastError();
15546         if (mem_base != xmlMemBlocks()) {
15547             printf("Leak of %d blocks found in namePop",
15548 	           xmlMemBlocks() - mem_base);
15549 	    test_ret++;
15550             printf(" %d", n_ctxt);
15551             printf("\n");
15552         }
15553     }
15554     function_tests++;
15555 
15556     return(test_ret);
15557 }
15558 
15559 
15560 static int
test_namePush(void)15561 test_namePush(void) {
15562     int test_ret = 0;
15563 
15564     int mem_base;
15565     int ret_val;
15566     xmlParserCtxtPtr ctxt; /* an XML parser context */
15567     int n_ctxt;
15568     xmlChar * value; /* the element name */
15569     int n_value;
15570 
15571     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15572     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15573         mem_base = xmlMemBlocks();
15574         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15575         value = gen_const_xmlChar_ptr(n_value, 1);
15576 
15577         ret_val = namePush(ctxt, (const xmlChar *)value);
15578         desret_int(ret_val);
15579         call_tests++;
15580         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15581         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15582         xmlResetLastError();
15583         if (mem_base != xmlMemBlocks()) {
15584             printf("Leak of %d blocks found in namePush",
15585 	           xmlMemBlocks() - mem_base);
15586 	    test_ret++;
15587             printf(" %d", n_ctxt);
15588             printf(" %d", n_value);
15589             printf("\n");
15590         }
15591     }
15592     }
15593     function_tests++;
15594 
15595     return(test_ret);
15596 }
15597 
15598 
15599 static int
test_nodePop(void)15600 test_nodePop(void) {
15601     int test_ret = 0;
15602 
15603     int mem_base;
15604     xmlNodePtr ret_val;
15605     xmlParserCtxtPtr ctxt; /* an XML parser context */
15606     int n_ctxt;
15607 
15608     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15609         mem_base = xmlMemBlocks();
15610         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15611 
15612         ret_val = nodePop(ctxt);
15613         desret_xmlNodePtr(ret_val);
15614         call_tests++;
15615         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15616         xmlResetLastError();
15617         if (mem_base != xmlMemBlocks()) {
15618             printf("Leak of %d blocks found in nodePop",
15619 	           xmlMemBlocks() - mem_base);
15620 	    test_ret++;
15621             printf(" %d", n_ctxt);
15622             printf("\n");
15623         }
15624     }
15625     function_tests++;
15626 
15627     return(test_ret);
15628 }
15629 
15630 
15631 static int
test_nodePush(void)15632 test_nodePush(void) {
15633     int test_ret = 0;
15634 
15635     int mem_base;
15636     int ret_val;
15637     xmlParserCtxtPtr ctxt; /* an XML parser context */
15638     int n_ctxt;
15639     xmlNodePtr value; /* the element node */
15640     int n_value;
15641 
15642     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15643     for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15644         mem_base = xmlMemBlocks();
15645         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15646         value = gen_xmlNodePtr(n_value, 1);
15647 
15648         ret_val = nodePush(ctxt, value);
15649         desret_int(ret_val);
15650         call_tests++;
15651         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15652         des_xmlNodePtr(n_value, value, 1);
15653         xmlResetLastError();
15654         if (mem_base != xmlMemBlocks()) {
15655             printf("Leak of %d blocks found in nodePush",
15656 	           xmlMemBlocks() - mem_base);
15657 	    test_ret++;
15658             printf(" %d", n_ctxt);
15659             printf(" %d", n_value);
15660             printf("\n");
15661         }
15662     }
15663     }
15664     function_tests++;
15665 
15666     return(test_ret);
15667 }
15668 
15669 
15670 static int
test_xmlCheckLanguageID(void)15671 test_xmlCheckLanguageID(void) {
15672     int test_ret = 0;
15673 
15674     int mem_base;
15675     int ret_val;
15676     xmlChar * lang; /* pointer to the string value */
15677     int n_lang;
15678 
15679     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15680         mem_base = xmlMemBlocks();
15681         lang = gen_const_xmlChar_ptr(n_lang, 0);
15682 
15683         ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15684         desret_int(ret_val);
15685         call_tests++;
15686         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15687         xmlResetLastError();
15688         if (mem_base != xmlMemBlocks()) {
15689             printf("Leak of %d blocks found in xmlCheckLanguageID",
15690 	           xmlMemBlocks() - mem_base);
15691 	    test_ret++;
15692             printf(" %d", n_lang);
15693             printf("\n");
15694         }
15695     }
15696     function_tests++;
15697 
15698     return(test_ret);
15699 }
15700 
15701 
15702 static int
test_xmlCopyChar(void)15703 test_xmlCopyChar(void) {
15704     int test_ret = 0;
15705 
15706     int mem_base;
15707     int ret_val;
15708     int len; /* Ignored, compatibility */
15709     int n_len;
15710     xmlChar * out; /* pointer to an array of xmlChar */
15711     int n_out;
15712     int val; /* the char value */
15713     int n_val;
15714 
15715     for (n_len = 0;n_len < gen_nb_int;n_len++) {
15716     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15717     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15718         mem_base = xmlMemBlocks();
15719         len = gen_int(n_len, 0);
15720         out = gen_xmlChar_ptr(n_out, 1);
15721         val = gen_int(n_val, 2);
15722 
15723         ret_val = xmlCopyChar(len, out, val);
15724         desret_int(ret_val);
15725         call_tests++;
15726         des_int(n_len, len, 0);
15727         des_xmlChar_ptr(n_out, out, 1);
15728         des_int(n_val, val, 2);
15729         xmlResetLastError();
15730         if (mem_base != xmlMemBlocks()) {
15731             printf("Leak of %d blocks found in xmlCopyChar",
15732 	           xmlMemBlocks() - mem_base);
15733 	    test_ret++;
15734             printf(" %d", n_len);
15735             printf(" %d", n_out);
15736             printf(" %d", n_val);
15737             printf("\n");
15738         }
15739     }
15740     }
15741     }
15742     function_tests++;
15743 
15744     return(test_ret);
15745 }
15746 
15747 
15748 static int
test_xmlCopyCharMultiByte(void)15749 test_xmlCopyCharMultiByte(void) {
15750     int test_ret = 0;
15751 
15752     int mem_base;
15753     int ret_val;
15754     xmlChar * out; /* pointer to an array of xmlChar */
15755     int n_out;
15756     int val; /* the char value */
15757     int n_val;
15758 
15759     for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15760     for (n_val = 0;n_val < gen_nb_int;n_val++) {
15761         mem_base = xmlMemBlocks();
15762         out = gen_xmlChar_ptr(n_out, 0);
15763         val = gen_int(n_val, 1);
15764 
15765         ret_val = xmlCopyCharMultiByte(out, val);
15766         desret_int(ret_val);
15767         call_tests++;
15768         des_xmlChar_ptr(n_out, out, 0);
15769         des_int(n_val, val, 1);
15770         xmlResetLastError();
15771         if (mem_base != xmlMemBlocks()) {
15772             printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15773 	           xmlMemBlocks() - mem_base);
15774 	    test_ret++;
15775             printf(" %d", n_out);
15776             printf(" %d", n_val);
15777             printf("\n");
15778         }
15779     }
15780     }
15781     function_tests++;
15782 
15783     return(test_ret);
15784 }
15785 
15786 
15787 static int
test_xmlCreateEntityParserCtxt(void)15788 test_xmlCreateEntityParserCtxt(void) {
15789     int test_ret = 0;
15790 
15791     int mem_base;
15792     xmlParserCtxtPtr ret_val;
15793     xmlChar * URL; /* the entity URL */
15794     int n_URL;
15795     xmlChar * ID; /* the entity PUBLIC ID */
15796     int n_ID;
15797     xmlChar * base; /* a possible base for the target URI */
15798     int n_base;
15799 
15800     for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15801     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15802     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15803         mem_base = xmlMemBlocks();
15804         URL = gen_const_xmlChar_ptr(n_URL, 0);
15805         ID = gen_const_xmlChar_ptr(n_ID, 1);
15806         base = gen_const_xmlChar_ptr(n_base, 2);
15807 
15808         ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15809         desret_xmlParserCtxtPtr(ret_val);
15810         call_tests++;
15811         des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15812         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15813         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15814         xmlResetLastError();
15815         if (mem_base != xmlMemBlocks()) {
15816             printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15817 	           xmlMemBlocks() - mem_base);
15818 	    test_ret++;
15819             printf(" %d", n_URL);
15820             printf(" %d", n_ID);
15821             printf(" %d", n_base);
15822             printf("\n");
15823         }
15824     }
15825     }
15826     }
15827     function_tests++;
15828 
15829     return(test_ret);
15830 }
15831 
15832 
15833 static int
test_xmlCreateFileParserCtxt(void)15834 test_xmlCreateFileParserCtxt(void) {
15835     int test_ret = 0;
15836 
15837     int mem_base;
15838     xmlParserCtxtPtr ret_val;
15839     const char * filename; /* the filename */
15840     int n_filename;
15841 
15842     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15843         mem_base = xmlMemBlocks();
15844         filename = gen_fileoutput(n_filename, 0);
15845 
15846         ret_val = xmlCreateFileParserCtxt(filename);
15847         desret_xmlParserCtxtPtr(ret_val);
15848         call_tests++;
15849         des_fileoutput(n_filename, filename, 0);
15850         xmlResetLastError();
15851         if (mem_base != xmlMemBlocks()) {
15852             printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15853 	           xmlMemBlocks() - mem_base);
15854 	    test_ret++;
15855             printf(" %d", n_filename);
15856             printf("\n");
15857         }
15858     }
15859     function_tests++;
15860 
15861     return(test_ret);
15862 }
15863 
15864 
15865 static int
test_xmlCreateMemoryParserCtxt(void)15866 test_xmlCreateMemoryParserCtxt(void) {
15867     int test_ret = 0;
15868 
15869     int mem_base;
15870     xmlParserCtxtPtr ret_val;
15871     char * buffer; /* a pointer to a char array */
15872     int n_buffer;
15873     int size; /* the size of the array */
15874     int n_size;
15875 
15876     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15877     for (n_size = 0;n_size < gen_nb_int;n_size++) {
15878         mem_base = xmlMemBlocks();
15879         buffer = gen_const_char_ptr(n_buffer, 0);
15880         size = gen_int(n_size, 1);
15881 
15882         ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15883         desret_xmlParserCtxtPtr(ret_val);
15884         call_tests++;
15885         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15886         des_int(n_size, size, 1);
15887         xmlResetLastError();
15888         if (mem_base != xmlMemBlocks()) {
15889             printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15890 	           xmlMemBlocks() - mem_base);
15891 	    test_ret++;
15892             printf(" %d", n_buffer);
15893             printf(" %d", n_size);
15894             printf("\n");
15895         }
15896     }
15897     }
15898     function_tests++;
15899 
15900     return(test_ret);
15901 }
15902 
15903 
15904 static int
test_xmlCreateURLParserCtxt(void)15905 test_xmlCreateURLParserCtxt(void) {
15906     int test_ret = 0;
15907 
15908     int mem_base;
15909     xmlParserCtxtPtr ret_val;
15910     const char * filename; /* the filename or URL */
15911     int n_filename;
15912     int options; /* a combination of xmlParserOption */
15913     int n_options;
15914 
15915     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15916     for (n_options = 0;n_options < gen_nb_int;n_options++) {
15917         mem_base = xmlMemBlocks();
15918         filename = gen_fileoutput(n_filename, 0);
15919         options = gen_int(n_options, 1);
15920 
15921         ret_val = xmlCreateURLParserCtxt(filename, options);
15922         desret_xmlParserCtxtPtr(ret_val);
15923         call_tests++;
15924         des_fileoutput(n_filename, filename, 0);
15925         des_int(n_options, options, 1);
15926         xmlResetLastError();
15927         if (mem_base != xmlMemBlocks()) {
15928             printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15929 	           xmlMemBlocks() - mem_base);
15930 	    test_ret++;
15931             printf(" %d", n_filename);
15932             printf(" %d", n_options);
15933             printf("\n");
15934         }
15935     }
15936     }
15937     function_tests++;
15938 
15939     return(test_ret);
15940 }
15941 
15942 
15943 static int
test_xmlCurrentChar(void)15944 test_xmlCurrentChar(void) {
15945     int test_ret = 0;
15946 
15947     int mem_base;
15948     int ret_val;
15949     xmlParserCtxtPtr ctxt; /* the XML parser context */
15950     int n_ctxt;
15951     int * len; /* pointer to the length of the char read */
15952     int n_len;
15953 
15954     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15955     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15956         mem_base = xmlMemBlocks();
15957         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15958         len = gen_int_ptr(n_len, 1);
15959 
15960         ret_val = xmlCurrentChar(ctxt, len);
15961         desret_int(ret_val);
15962         call_tests++;
15963         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15964         des_int_ptr(n_len, len, 1);
15965         xmlResetLastError();
15966         if (mem_base != xmlMemBlocks()) {
15967             printf("Leak of %d blocks found in xmlCurrentChar",
15968 	           xmlMemBlocks() - mem_base);
15969 	    test_ret++;
15970             printf(" %d", n_ctxt);
15971             printf(" %d", n_len);
15972             printf("\n");
15973         }
15974     }
15975     }
15976     function_tests++;
15977 
15978     return(test_ret);
15979 }
15980 
15981 
15982 static int
test_xmlErrMemory(void)15983 test_xmlErrMemory(void) {
15984     int test_ret = 0;
15985 
15986     int mem_base;
15987     xmlParserCtxtPtr ctxt; /* an XML parser context */
15988     int n_ctxt;
15989     char * extra; /* extra informations */
15990     int n_extra;
15991 
15992     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15993     for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
15994         mem_base = xmlMemBlocks();
15995         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15996         extra = gen_const_char_ptr(n_extra, 1);
15997 
15998         xmlErrMemory(ctxt, (const char *)extra);
15999         call_tests++;
16000         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16001         des_const_char_ptr(n_extra, (const char *)extra, 1);
16002         xmlResetLastError();
16003         if (mem_base != xmlMemBlocks()) {
16004             printf("Leak of %d blocks found in xmlErrMemory",
16005 	           xmlMemBlocks() - mem_base);
16006 	    test_ret++;
16007             printf(" %d", n_ctxt);
16008             printf(" %d", n_extra);
16009             printf("\n");
16010         }
16011     }
16012     }
16013     function_tests++;
16014 
16015     return(test_ret);
16016 }
16017 
16018 
16019 static int
test_xmlIsLetter(void)16020 test_xmlIsLetter(void) {
16021     int test_ret = 0;
16022 
16023     int mem_base;
16024     int ret_val;
16025     int c; /* an unicode character (int) */
16026     int n_c;
16027 
16028     for (n_c = 0;n_c < gen_nb_int;n_c++) {
16029         mem_base = xmlMemBlocks();
16030         c = gen_int(n_c, 0);
16031 
16032         ret_val = xmlIsLetter(c);
16033         desret_int(ret_val);
16034         call_tests++;
16035         des_int(n_c, c, 0);
16036         xmlResetLastError();
16037         if (mem_base != xmlMemBlocks()) {
16038             printf("Leak of %d blocks found in xmlIsLetter",
16039 	           xmlMemBlocks() - mem_base);
16040 	    test_ret++;
16041             printf(" %d", n_c);
16042             printf("\n");
16043         }
16044     }
16045     function_tests++;
16046 
16047     return(test_ret);
16048 }
16049 
16050 
16051 static int
test_xmlNewEntityInputStream(void)16052 test_xmlNewEntityInputStream(void) {
16053     int test_ret = 0;
16054 
16055     int mem_base;
16056     xmlParserInputPtr ret_val;
16057     xmlParserCtxtPtr ctxt; /* an XML parser context */
16058     int n_ctxt;
16059     xmlEntityPtr entity; /* an Entity pointer */
16060     int n_entity;
16061 
16062     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16063     for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16064         mem_base = xmlMemBlocks();
16065         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16066         entity = gen_xmlEntityPtr(n_entity, 1);
16067 
16068         ret_val = xmlNewEntityInputStream(ctxt, entity);
16069         desret_xmlParserInputPtr(ret_val);
16070         call_tests++;
16071         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16072         des_xmlEntityPtr(n_entity, entity, 1);
16073         xmlResetLastError();
16074         if (mem_base != xmlMemBlocks()) {
16075             printf("Leak of %d blocks found in xmlNewEntityInputStream",
16076 	           xmlMemBlocks() - mem_base);
16077 	    test_ret++;
16078             printf(" %d", n_ctxt);
16079             printf(" %d", n_entity);
16080             printf("\n");
16081         }
16082     }
16083     }
16084     function_tests++;
16085 
16086     return(test_ret);
16087 }
16088 
16089 
16090 static int
test_xmlNewInputFromFile(void)16091 test_xmlNewInputFromFile(void) {
16092     int test_ret = 0;
16093 
16094     int mem_base;
16095     xmlParserInputPtr ret_val;
16096     xmlParserCtxtPtr ctxt; /* an XML parser context */
16097     int n_ctxt;
16098     const char * filename; /* the filename to use as entity */
16099     int n_filename;
16100 
16101     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16102     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16103         mem_base = xmlMemBlocks();
16104         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16105         filename = gen_filepath(n_filename, 1);
16106 
16107         ret_val = xmlNewInputFromFile(ctxt, filename);
16108         desret_xmlParserInputPtr(ret_val);
16109         call_tests++;
16110         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16111         des_filepath(n_filename, filename, 1);
16112         xmlResetLastError();
16113         if (mem_base != xmlMemBlocks()) {
16114             printf("Leak of %d blocks found in xmlNewInputFromFile",
16115 	           xmlMemBlocks() - mem_base);
16116 	    test_ret++;
16117             printf(" %d", n_ctxt);
16118             printf(" %d", n_filename);
16119             printf("\n");
16120         }
16121     }
16122     }
16123     function_tests++;
16124 
16125     return(test_ret);
16126 }
16127 
16128 
16129 static int
test_xmlNewInputStream(void)16130 test_xmlNewInputStream(void) {
16131     int test_ret = 0;
16132 
16133     int mem_base;
16134     xmlParserInputPtr ret_val;
16135     xmlParserCtxtPtr ctxt; /* an XML parser context */
16136     int n_ctxt;
16137 
16138     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16139         mem_base = xmlMemBlocks();
16140         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16141 
16142         ret_val = xmlNewInputStream(ctxt);
16143         desret_xmlParserInputPtr(ret_val);
16144         call_tests++;
16145         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16146         xmlResetLastError();
16147         if (mem_base != xmlMemBlocks()) {
16148             printf("Leak of %d blocks found in xmlNewInputStream",
16149 	           xmlMemBlocks() - mem_base);
16150 	    test_ret++;
16151             printf(" %d", n_ctxt);
16152             printf("\n");
16153         }
16154     }
16155     function_tests++;
16156 
16157     return(test_ret);
16158 }
16159 
16160 
16161 static int
test_xmlNewStringInputStream(void)16162 test_xmlNewStringInputStream(void) {
16163     int test_ret = 0;
16164 
16165     int mem_base;
16166     xmlParserInputPtr ret_val;
16167     xmlParserCtxtPtr ctxt; /* an XML parser context */
16168     int n_ctxt;
16169     xmlChar * buffer; /* an memory buffer */
16170     int n_buffer;
16171 
16172     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16173     for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16174         mem_base = xmlMemBlocks();
16175         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16176         buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16177 
16178         ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16179         desret_xmlParserInputPtr(ret_val);
16180         call_tests++;
16181         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16182         des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16183         xmlResetLastError();
16184         if (mem_base != xmlMemBlocks()) {
16185             printf("Leak of %d blocks found in xmlNewStringInputStream",
16186 	           xmlMemBlocks() - mem_base);
16187 	    test_ret++;
16188             printf(" %d", n_ctxt);
16189             printf(" %d", n_buffer);
16190             printf("\n");
16191         }
16192     }
16193     }
16194     function_tests++;
16195 
16196     return(test_ret);
16197 }
16198 
16199 
16200 static int
test_xmlNextChar(void)16201 test_xmlNextChar(void) {
16202     int test_ret = 0;
16203 
16204     int mem_base;
16205     xmlParserCtxtPtr ctxt; /* the XML parser context */
16206     int n_ctxt;
16207 
16208     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16209         mem_base = xmlMemBlocks();
16210         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16211 
16212         xmlNextChar(ctxt);
16213         call_tests++;
16214         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16215         xmlResetLastError();
16216         if (mem_base != xmlMemBlocks()) {
16217             printf("Leak of %d blocks found in xmlNextChar",
16218 	           xmlMemBlocks() - mem_base);
16219 	    test_ret++;
16220             printf(" %d", n_ctxt);
16221             printf("\n");
16222         }
16223     }
16224     function_tests++;
16225 
16226     return(test_ret);
16227 }
16228 
16229 
16230 static int
test_xmlParserInputShrink(void)16231 test_xmlParserInputShrink(void) {
16232     int test_ret = 0;
16233 
16234     int mem_base;
16235     xmlParserInputPtr in; /* an XML parser input */
16236     int n_in;
16237 
16238     for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16239         mem_base = xmlMemBlocks();
16240         in = gen_xmlParserInputPtr(n_in, 0);
16241 
16242         xmlParserInputShrink(in);
16243         call_tests++;
16244         des_xmlParserInputPtr(n_in, in, 0);
16245         xmlResetLastError();
16246         if (mem_base != xmlMemBlocks()) {
16247             printf("Leak of %d blocks found in xmlParserInputShrink",
16248 	           xmlMemBlocks() - mem_base);
16249 	    test_ret++;
16250             printf(" %d", n_in);
16251             printf("\n");
16252         }
16253     }
16254     function_tests++;
16255 
16256     return(test_ret);
16257 }
16258 
16259 
16260 static int
test_xmlPopInput(void)16261 test_xmlPopInput(void) {
16262     int test_ret = 0;
16263 
16264     int mem_base;
16265     xmlChar ret_val;
16266     xmlParserCtxtPtr ctxt; /* an XML parser context */
16267     int n_ctxt;
16268 
16269     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16270         mem_base = xmlMemBlocks();
16271         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16272 
16273         ret_val = xmlPopInput(ctxt);
16274         desret_xmlChar(ret_val);
16275         call_tests++;
16276         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16277         xmlResetLastError();
16278         if (mem_base != xmlMemBlocks()) {
16279             printf("Leak of %d blocks found in xmlPopInput",
16280 	           xmlMemBlocks() - mem_base);
16281 	    test_ret++;
16282             printf(" %d", n_ctxt);
16283             printf("\n");
16284         }
16285     }
16286     function_tests++;
16287 
16288     return(test_ret);
16289 }
16290 
16291 
16292 static int
test_xmlPushInput(void)16293 test_xmlPushInput(void) {
16294     int test_ret = 0;
16295 
16296     int mem_base;
16297     xmlParserCtxtPtr ctxt; /* an XML parser context */
16298     int n_ctxt;
16299     xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16300     int n_input;
16301 
16302     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16303     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16304         mem_base = xmlMemBlocks();
16305         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16306         input = gen_xmlParserInputPtr(n_input, 1);
16307 
16308         xmlPushInput(ctxt, input);
16309         call_tests++;
16310         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16311         des_xmlParserInputPtr(n_input, input, 1);
16312         xmlResetLastError();
16313         if (mem_base != xmlMemBlocks()) {
16314             printf("Leak of %d blocks found in xmlPushInput",
16315 	           xmlMemBlocks() - mem_base);
16316 	    test_ret++;
16317             printf(" %d", n_ctxt);
16318             printf(" %d", n_input);
16319             printf("\n");
16320         }
16321     }
16322     }
16323     function_tests++;
16324 
16325     return(test_ret);
16326 }
16327 
16328 
16329 static int
test_xmlSetEntityReferenceFunc(void)16330 test_xmlSetEntityReferenceFunc(void) {
16331     int test_ret = 0;
16332 
16333 
16334     /* missing type support */
16335     return(test_ret);
16336 }
16337 
16338 
16339 static int
test_xmlSplitQName(void)16340 test_xmlSplitQName(void) {
16341     int test_ret = 0;
16342 
16343     int mem_base;
16344     xmlChar * ret_val;
16345     xmlParserCtxtPtr ctxt; /* an XML parser context */
16346     int n_ctxt;
16347     xmlChar * name; /* an XML parser context */
16348     int n_name;
16349     xmlChar ** prefix; /* a xmlChar ** */
16350     int n_prefix;
16351 
16352     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16353     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16354     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16355         mem_base = xmlMemBlocks();
16356         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16357         name = gen_const_xmlChar_ptr(n_name, 1);
16358         prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16359 
16360         ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16361         desret_xmlChar_ptr(ret_val);
16362         call_tests++;
16363         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16364         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16365         des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16366         xmlResetLastError();
16367         if (mem_base != xmlMemBlocks()) {
16368             printf("Leak of %d blocks found in xmlSplitQName",
16369 	           xmlMemBlocks() - mem_base);
16370 	    test_ret++;
16371             printf(" %d", n_ctxt);
16372             printf(" %d", n_name);
16373             printf(" %d", n_prefix);
16374             printf("\n");
16375         }
16376     }
16377     }
16378     }
16379     function_tests++;
16380 
16381     return(test_ret);
16382 }
16383 
16384 
16385 static int
test_xmlStringCurrentChar(void)16386 test_xmlStringCurrentChar(void) {
16387     int test_ret = 0;
16388 
16389     int mem_base;
16390     int ret_val;
16391     xmlParserCtxtPtr ctxt; /* the XML parser context */
16392     int n_ctxt;
16393     xmlChar * cur; /* pointer to the beginning of the char */
16394     int n_cur;
16395     int * len; /* pointer to the length of the char read */
16396     int n_len;
16397 
16398     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16399     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16400     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16401         mem_base = xmlMemBlocks();
16402         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16403         cur = gen_const_xmlChar_ptr(n_cur, 1);
16404         len = gen_int_ptr(n_len, 2);
16405 
16406         ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16407         desret_int(ret_val);
16408         call_tests++;
16409         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16410         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16411         des_int_ptr(n_len, len, 2);
16412         xmlResetLastError();
16413         if (mem_base != xmlMemBlocks()) {
16414             printf("Leak of %d blocks found in xmlStringCurrentChar",
16415 	           xmlMemBlocks() - mem_base);
16416 	    test_ret++;
16417             printf(" %d", n_ctxt);
16418             printf(" %d", n_cur);
16419             printf(" %d", n_len);
16420             printf("\n");
16421         }
16422     }
16423     }
16424     }
16425     function_tests++;
16426 
16427     return(test_ret);
16428 }
16429 
16430 
16431 static int
test_xmlStringDecodeEntities(void)16432 test_xmlStringDecodeEntities(void) {
16433     int test_ret = 0;
16434 
16435     int mem_base;
16436     xmlChar * ret_val;
16437     xmlParserCtxtPtr ctxt; /* the parser context */
16438     int n_ctxt;
16439     xmlChar * str; /* the input string */
16440     int n_str;
16441     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16442     int n_what;
16443     xmlChar end; /* an end marker xmlChar, 0 if none */
16444     int n_end;
16445     xmlChar end2; /* an end marker xmlChar, 0 if none */
16446     int n_end2;
16447     xmlChar end3; /* an end marker xmlChar, 0 if none */
16448     int n_end3;
16449 
16450     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16451     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16452     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16453     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16454     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16455     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16456         mem_base = xmlMemBlocks();
16457         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16458         str = gen_const_xmlChar_ptr(n_str, 1);
16459         what = gen_int(n_what, 2);
16460         end = gen_xmlChar(n_end, 3);
16461         end2 = gen_xmlChar(n_end2, 4);
16462         end3 = gen_xmlChar(n_end3, 5);
16463 
16464         ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16465         desret_xmlChar_ptr(ret_val);
16466         call_tests++;
16467         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16468         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16469         des_int(n_what, what, 2);
16470         des_xmlChar(n_end, end, 3);
16471         des_xmlChar(n_end2, end2, 4);
16472         des_xmlChar(n_end3, end3, 5);
16473         xmlResetLastError();
16474         if (mem_base != xmlMemBlocks()) {
16475             printf("Leak of %d blocks found in xmlStringDecodeEntities",
16476 	           xmlMemBlocks() - mem_base);
16477 	    test_ret++;
16478             printf(" %d", n_ctxt);
16479             printf(" %d", n_str);
16480             printf(" %d", n_what);
16481             printf(" %d", n_end);
16482             printf(" %d", n_end2);
16483             printf(" %d", n_end3);
16484             printf("\n");
16485         }
16486     }
16487     }
16488     }
16489     }
16490     }
16491     }
16492     function_tests++;
16493 
16494     return(test_ret);
16495 }
16496 
16497 
16498 static int
test_xmlStringLenDecodeEntities(void)16499 test_xmlStringLenDecodeEntities(void) {
16500     int test_ret = 0;
16501 
16502     int mem_base;
16503     xmlChar * ret_val;
16504     xmlParserCtxtPtr ctxt; /* the parser context */
16505     int n_ctxt;
16506     xmlChar * str; /* the input string */
16507     int n_str;
16508     int len; /* the string length */
16509     int n_len;
16510     int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16511     int n_what;
16512     xmlChar end; /* an end marker xmlChar, 0 if none */
16513     int n_end;
16514     xmlChar end2; /* an end marker xmlChar, 0 if none */
16515     int n_end2;
16516     xmlChar end3; /* an end marker xmlChar, 0 if none */
16517     int n_end3;
16518 
16519     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16520     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16521     for (n_len = 0;n_len < gen_nb_int;n_len++) {
16522     for (n_what = 0;n_what < gen_nb_int;n_what++) {
16523     for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16524     for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16525     for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16526         mem_base = xmlMemBlocks();
16527         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16528         str = gen_const_xmlChar_ptr(n_str, 1);
16529         len = gen_int(n_len, 2);
16530         what = gen_int(n_what, 3);
16531         end = gen_xmlChar(n_end, 4);
16532         end2 = gen_xmlChar(n_end2, 5);
16533         end3 = gen_xmlChar(n_end3, 6);
16534 
16535         ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16536         desret_xmlChar_ptr(ret_val);
16537         call_tests++;
16538         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16539         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16540         des_int(n_len, len, 2);
16541         des_int(n_what, what, 3);
16542         des_xmlChar(n_end, end, 4);
16543         des_xmlChar(n_end2, end2, 5);
16544         des_xmlChar(n_end3, end3, 6);
16545         xmlResetLastError();
16546         if (mem_base != xmlMemBlocks()) {
16547             printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16548 	           xmlMemBlocks() - mem_base);
16549 	    test_ret++;
16550             printf(" %d", n_ctxt);
16551             printf(" %d", n_str);
16552             printf(" %d", n_len);
16553             printf(" %d", n_what);
16554             printf(" %d", n_end);
16555             printf(" %d", n_end2);
16556             printf(" %d", n_end3);
16557             printf("\n");
16558         }
16559     }
16560     }
16561     }
16562     }
16563     }
16564     }
16565     }
16566     function_tests++;
16567 
16568     return(test_ret);
16569 }
16570 
16571 
16572 static int
test_xmlSwitchEncoding(void)16573 test_xmlSwitchEncoding(void) {
16574     int test_ret = 0;
16575 
16576     int mem_base;
16577     int ret_val;
16578     xmlParserCtxtPtr ctxt; /* the parser context */
16579     int n_ctxt;
16580     xmlCharEncoding enc; /* the encoding value (number) */
16581     int n_enc;
16582 
16583     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16584     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16585         mem_base = xmlMemBlocks();
16586         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16587         enc = gen_xmlCharEncoding(n_enc, 1);
16588 
16589         ret_val = xmlSwitchEncoding(ctxt, enc);
16590         desret_int(ret_val);
16591         call_tests++;
16592         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16593         des_xmlCharEncoding(n_enc, enc, 1);
16594         xmlResetLastError();
16595         if (mem_base != xmlMemBlocks()) {
16596             printf("Leak of %d blocks found in xmlSwitchEncoding",
16597 	           xmlMemBlocks() - mem_base);
16598 	    test_ret++;
16599             printf(" %d", n_ctxt);
16600             printf(" %d", n_enc);
16601             printf("\n");
16602         }
16603     }
16604     }
16605     function_tests++;
16606 
16607     return(test_ret);
16608 }
16609 
16610 
16611 static int
test_xmlSwitchInputEncoding(void)16612 test_xmlSwitchInputEncoding(void) {
16613     int test_ret = 0;
16614 
16615     int mem_base;
16616     int ret_val;
16617     xmlParserCtxtPtr ctxt; /* the parser context */
16618     int n_ctxt;
16619     xmlParserInputPtr input; /* the input stream */
16620     int n_input;
16621     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16622     int n_handler;
16623 
16624     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16625     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16626     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16627         mem_base = xmlMemBlocks();
16628         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16629         input = gen_xmlParserInputPtr(n_input, 1);
16630         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16631 
16632         ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16633         desret_int(ret_val);
16634         call_tests++;
16635         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16636         des_xmlParserInputPtr(n_input, input, 1);
16637         des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16638         xmlResetLastError();
16639         if (mem_base != xmlMemBlocks()) {
16640             printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16641 	           xmlMemBlocks() - mem_base);
16642 	    test_ret++;
16643             printf(" %d", n_ctxt);
16644             printf(" %d", n_input);
16645             printf(" %d", n_handler);
16646             printf("\n");
16647         }
16648     }
16649     }
16650     }
16651     function_tests++;
16652 
16653     return(test_ret);
16654 }
16655 
16656 
16657 static int
test_xmlSwitchToEncoding(void)16658 test_xmlSwitchToEncoding(void) {
16659     int test_ret = 0;
16660 
16661     int mem_base;
16662     int ret_val;
16663     xmlParserCtxtPtr ctxt; /* the parser context */
16664     int n_ctxt;
16665     xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16666     int n_handler;
16667 
16668     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16669     for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16670         mem_base = xmlMemBlocks();
16671         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16672         handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16673 
16674         ret_val = xmlSwitchToEncoding(ctxt, handler);
16675         desret_int(ret_val);
16676         call_tests++;
16677         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16678         des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16679         xmlResetLastError();
16680         if (mem_base != xmlMemBlocks()) {
16681             printf("Leak of %d blocks found in xmlSwitchToEncoding",
16682 	           xmlMemBlocks() - mem_base);
16683 	    test_ret++;
16684             printf(" %d", n_ctxt);
16685             printf(" %d", n_handler);
16686             printf("\n");
16687         }
16688     }
16689     }
16690     function_tests++;
16691 
16692     return(test_ret);
16693 }
16694 
16695 static int
test_parserInternals(void)16696 test_parserInternals(void) {
16697     int test_ret = 0;
16698 
16699     if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16700     test_ret += test_htmlCreateFileParserCtxt();
16701     test_ret += test_htmlInitAutoClose();
16702     test_ret += test_inputPop();
16703     test_ret += test_inputPush();
16704     test_ret += test_namePop();
16705     test_ret += test_namePush();
16706     test_ret += test_nodePop();
16707     test_ret += test_nodePush();
16708     test_ret += test_xmlCheckLanguageID();
16709     test_ret += test_xmlCopyChar();
16710     test_ret += test_xmlCopyCharMultiByte();
16711     test_ret += test_xmlCreateEntityParserCtxt();
16712     test_ret += test_xmlCreateFileParserCtxt();
16713     test_ret += test_xmlCreateMemoryParserCtxt();
16714     test_ret += test_xmlCreateURLParserCtxt();
16715     test_ret += test_xmlCurrentChar();
16716     test_ret += test_xmlErrMemory();
16717     test_ret += test_xmlIsLetter();
16718     test_ret += test_xmlNewEntityInputStream();
16719     test_ret += test_xmlNewInputFromFile();
16720     test_ret += test_xmlNewInputStream();
16721     test_ret += test_xmlNewStringInputStream();
16722     test_ret += test_xmlNextChar();
16723     test_ret += test_xmlParserInputShrink();
16724     test_ret += test_xmlPopInput();
16725     test_ret += test_xmlPushInput();
16726     test_ret += test_xmlSetEntityReferenceFunc();
16727     test_ret += test_xmlSplitQName();
16728     test_ret += test_xmlStringCurrentChar();
16729     test_ret += test_xmlStringDecodeEntities();
16730     test_ret += test_xmlStringLenDecodeEntities();
16731     test_ret += test_xmlSwitchEncoding();
16732     test_ret += test_xmlSwitchInputEncoding();
16733     test_ret += test_xmlSwitchToEncoding();
16734 
16735     if (test_ret != 0)
16736 	printf("Module parserInternals: %d errors\n", test_ret);
16737     return(test_ret);
16738 }
16739 
16740 static int
test_xmlPatternFromRoot(void)16741 test_xmlPatternFromRoot(void) {
16742     int test_ret = 0;
16743 
16744 #if defined(LIBXML_PATTERN_ENABLED)
16745     int mem_base;
16746     int ret_val;
16747     xmlPatternPtr comp; /* the precompiled pattern */
16748     int n_comp;
16749 
16750     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16751         mem_base = xmlMemBlocks();
16752         comp = gen_xmlPatternPtr(n_comp, 0);
16753 
16754         ret_val = xmlPatternFromRoot(comp);
16755         desret_int(ret_val);
16756         call_tests++;
16757         des_xmlPatternPtr(n_comp, comp, 0);
16758         xmlResetLastError();
16759         if (mem_base != xmlMemBlocks()) {
16760             printf("Leak of %d blocks found in xmlPatternFromRoot",
16761 	           xmlMemBlocks() - mem_base);
16762 	    test_ret++;
16763             printf(" %d", n_comp);
16764             printf("\n");
16765         }
16766     }
16767     function_tests++;
16768 #endif
16769 
16770     return(test_ret);
16771 }
16772 
16773 
16774 static int
test_xmlPatternGetStreamCtxt(void)16775 test_xmlPatternGetStreamCtxt(void) {
16776     int test_ret = 0;
16777 
16778 
16779     /* missing type support */
16780     return(test_ret);
16781 }
16782 
16783 
16784 static int
test_xmlPatternMatch(void)16785 test_xmlPatternMatch(void) {
16786     int test_ret = 0;
16787 
16788 #if defined(LIBXML_PATTERN_ENABLED)
16789     int mem_base;
16790     int ret_val;
16791     xmlPatternPtr comp; /* the precompiled pattern */
16792     int n_comp;
16793     xmlNodePtr node; /* a node */
16794     int n_node;
16795 
16796     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16797     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16798         mem_base = xmlMemBlocks();
16799         comp = gen_xmlPatternPtr(n_comp, 0);
16800         node = gen_xmlNodePtr(n_node, 1);
16801 
16802         ret_val = xmlPatternMatch(comp, node);
16803         desret_int(ret_val);
16804         call_tests++;
16805         des_xmlPatternPtr(n_comp, comp, 0);
16806         des_xmlNodePtr(n_node, node, 1);
16807         xmlResetLastError();
16808         if (mem_base != xmlMemBlocks()) {
16809             printf("Leak of %d blocks found in xmlPatternMatch",
16810 	           xmlMemBlocks() - mem_base);
16811 	    test_ret++;
16812             printf(" %d", n_comp);
16813             printf(" %d", n_node);
16814             printf("\n");
16815         }
16816     }
16817     }
16818     function_tests++;
16819 #endif
16820 
16821     return(test_ret);
16822 }
16823 
16824 
16825 static int
test_xmlPatternMaxDepth(void)16826 test_xmlPatternMaxDepth(void) {
16827     int test_ret = 0;
16828 
16829 #if defined(LIBXML_PATTERN_ENABLED)
16830     int mem_base;
16831     int ret_val;
16832     xmlPatternPtr comp; /* the precompiled pattern */
16833     int n_comp;
16834 
16835     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16836         mem_base = xmlMemBlocks();
16837         comp = gen_xmlPatternPtr(n_comp, 0);
16838 
16839         ret_val = xmlPatternMaxDepth(comp);
16840         desret_int(ret_val);
16841         call_tests++;
16842         des_xmlPatternPtr(n_comp, comp, 0);
16843         xmlResetLastError();
16844         if (mem_base != xmlMemBlocks()) {
16845             printf("Leak of %d blocks found in xmlPatternMaxDepth",
16846 	           xmlMemBlocks() - mem_base);
16847 	    test_ret++;
16848             printf(" %d", n_comp);
16849             printf("\n");
16850         }
16851     }
16852     function_tests++;
16853 #endif
16854 
16855     return(test_ret);
16856 }
16857 
16858 
16859 static int
test_xmlPatternMinDepth(void)16860 test_xmlPatternMinDepth(void) {
16861     int test_ret = 0;
16862 
16863 #if defined(LIBXML_PATTERN_ENABLED)
16864     int mem_base;
16865     int ret_val;
16866     xmlPatternPtr comp; /* the precompiled pattern */
16867     int n_comp;
16868 
16869     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16870         mem_base = xmlMemBlocks();
16871         comp = gen_xmlPatternPtr(n_comp, 0);
16872 
16873         ret_val = xmlPatternMinDepth(comp);
16874         desret_int(ret_val);
16875         call_tests++;
16876         des_xmlPatternPtr(n_comp, comp, 0);
16877         xmlResetLastError();
16878         if (mem_base != xmlMemBlocks()) {
16879             printf("Leak of %d blocks found in xmlPatternMinDepth",
16880 	           xmlMemBlocks() - mem_base);
16881 	    test_ret++;
16882             printf(" %d", n_comp);
16883             printf("\n");
16884         }
16885     }
16886     function_tests++;
16887 #endif
16888 
16889     return(test_ret);
16890 }
16891 
16892 
16893 static int
test_xmlPatternStreamable(void)16894 test_xmlPatternStreamable(void) {
16895     int test_ret = 0;
16896 
16897 #if defined(LIBXML_PATTERN_ENABLED)
16898     int mem_base;
16899     int ret_val;
16900     xmlPatternPtr comp; /* the precompiled pattern */
16901     int n_comp;
16902 
16903     for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16904         mem_base = xmlMemBlocks();
16905         comp = gen_xmlPatternPtr(n_comp, 0);
16906 
16907         ret_val = xmlPatternStreamable(comp);
16908         desret_int(ret_val);
16909         call_tests++;
16910         des_xmlPatternPtr(n_comp, comp, 0);
16911         xmlResetLastError();
16912         if (mem_base != xmlMemBlocks()) {
16913             printf("Leak of %d blocks found in xmlPatternStreamable",
16914 	           xmlMemBlocks() - mem_base);
16915 	    test_ret++;
16916             printf(" %d", n_comp);
16917             printf("\n");
16918         }
16919     }
16920     function_tests++;
16921 #endif
16922 
16923     return(test_ret);
16924 }
16925 
16926 
16927 static int
test_xmlPatterncompile(void)16928 test_xmlPatterncompile(void) {
16929     int test_ret = 0;
16930 
16931 
16932     /* missing type support */
16933     return(test_ret);
16934 }
16935 
16936 #ifdef LIBXML_PATTERN_ENABLED
16937 
16938 #define gen_nb_xmlStreamCtxtPtr 1
gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)16939 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16940     return(NULL);
16941 }
des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED,xmlStreamCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)16942 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16943 }
16944 #endif
16945 
16946 
16947 static int
test_xmlStreamPop(void)16948 test_xmlStreamPop(void) {
16949     int test_ret = 0;
16950 
16951 #if defined(LIBXML_PATTERN_ENABLED)
16952     int mem_base;
16953     int ret_val;
16954     xmlStreamCtxtPtr stream; /* the stream context */
16955     int n_stream;
16956 
16957     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16958         mem_base = xmlMemBlocks();
16959         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16960 
16961         ret_val = xmlStreamPop(stream);
16962         desret_int(ret_val);
16963         call_tests++;
16964         des_xmlStreamCtxtPtr(n_stream, stream, 0);
16965         xmlResetLastError();
16966         if (mem_base != xmlMemBlocks()) {
16967             printf("Leak of %d blocks found in xmlStreamPop",
16968 	           xmlMemBlocks() - mem_base);
16969 	    test_ret++;
16970             printf(" %d", n_stream);
16971             printf("\n");
16972         }
16973     }
16974     function_tests++;
16975 #endif
16976 
16977     return(test_ret);
16978 }
16979 
16980 
16981 static int
test_xmlStreamPush(void)16982 test_xmlStreamPush(void) {
16983     int test_ret = 0;
16984 
16985 #if defined(LIBXML_PATTERN_ENABLED)
16986     int mem_base;
16987     int ret_val;
16988     xmlStreamCtxtPtr stream; /* the stream context */
16989     int n_stream;
16990     xmlChar * name; /* the current name */
16991     int n_name;
16992     xmlChar * ns; /* the namespace name */
16993     int n_ns;
16994 
16995     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16996     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16997     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
16998         mem_base = xmlMemBlocks();
16999         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17000         name = gen_const_xmlChar_ptr(n_name, 1);
17001         ns = gen_const_xmlChar_ptr(n_ns, 2);
17002 
17003         ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17004         desret_int(ret_val);
17005         call_tests++;
17006         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17007         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17008         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17009         xmlResetLastError();
17010         if (mem_base != xmlMemBlocks()) {
17011             printf("Leak of %d blocks found in xmlStreamPush",
17012 	           xmlMemBlocks() - mem_base);
17013 	    test_ret++;
17014             printf(" %d", n_stream);
17015             printf(" %d", n_name);
17016             printf(" %d", n_ns);
17017             printf("\n");
17018         }
17019     }
17020     }
17021     }
17022     function_tests++;
17023 #endif
17024 
17025     return(test_ret);
17026 }
17027 
17028 
17029 static int
test_xmlStreamPushAttr(void)17030 test_xmlStreamPushAttr(void) {
17031     int test_ret = 0;
17032 
17033 #if defined(LIBXML_PATTERN_ENABLED)
17034     int mem_base;
17035     int ret_val;
17036     xmlStreamCtxtPtr stream; /* the stream context */
17037     int n_stream;
17038     xmlChar * name; /* the current name */
17039     int n_name;
17040     xmlChar * ns; /* the namespace name */
17041     int n_ns;
17042 
17043     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17044     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17045     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17046         mem_base = xmlMemBlocks();
17047         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17048         name = gen_const_xmlChar_ptr(n_name, 1);
17049         ns = gen_const_xmlChar_ptr(n_ns, 2);
17050 
17051         ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17052         desret_int(ret_val);
17053         call_tests++;
17054         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17055         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17056         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17057         xmlResetLastError();
17058         if (mem_base != xmlMemBlocks()) {
17059             printf("Leak of %d blocks found in xmlStreamPushAttr",
17060 	           xmlMemBlocks() - mem_base);
17061 	    test_ret++;
17062             printf(" %d", n_stream);
17063             printf(" %d", n_name);
17064             printf(" %d", n_ns);
17065             printf("\n");
17066         }
17067     }
17068     }
17069     }
17070     function_tests++;
17071 #endif
17072 
17073     return(test_ret);
17074 }
17075 
17076 
17077 static int
test_xmlStreamPushNode(void)17078 test_xmlStreamPushNode(void) {
17079     int test_ret = 0;
17080 
17081 #if defined(LIBXML_PATTERN_ENABLED)
17082     int mem_base;
17083     int ret_val;
17084     xmlStreamCtxtPtr stream; /* the stream context */
17085     int n_stream;
17086     xmlChar * name; /* the current name */
17087     int n_name;
17088     xmlChar * ns; /* the namespace name */
17089     int n_ns;
17090     int nodeType; /* the type of the node being pushed */
17091     int n_nodeType;
17092 
17093     for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17094     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17095     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17096     for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17097         mem_base = xmlMemBlocks();
17098         stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17099         name = gen_const_xmlChar_ptr(n_name, 1);
17100         ns = gen_const_xmlChar_ptr(n_ns, 2);
17101         nodeType = gen_int(n_nodeType, 3);
17102 
17103         ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17104         desret_int(ret_val);
17105         call_tests++;
17106         des_xmlStreamCtxtPtr(n_stream, stream, 0);
17107         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17108         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17109         des_int(n_nodeType, nodeType, 3);
17110         xmlResetLastError();
17111         if (mem_base != xmlMemBlocks()) {
17112             printf("Leak of %d blocks found in xmlStreamPushNode",
17113 	           xmlMemBlocks() - mem_base);
17114 	    test_ret++;
17115             printf(" %d", n_stream);
17116             printf(" %d", n_name);
17117             printf(" %d", n_ns);
17118             printf(" %d", n_nodeType);
17119             printf("\n");
17120         }
17121     }
17122     }
17123     }
17124     }
17125     function_tests++;
17126 #endif
17127 
17128     return(test_ret);
17129 }
17130 
17131 
17132 static int
test_xmlStreamWantsAnyNode(void)17133 test_xmlStreamWantsAnyNode(void) {
17134     int test_ret = 0;
17135 
17136 #if defined(LIBXML_PATTERN_ENABLED)
17137     int mem_base;
17138     int ret_val;
17139     xmlStreamCtxtPtr streamCtxt; /* the stream context */
17140     int n_streamCtxt;
17141 
17142     for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17143         mem_base = xmlMemBlocks();
17144         streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17145 
17146         ret_val = xmlStreamWantsAnyNode(streamCtxt);
17147         desret_int(ret_val);
17148         call_tests++;
17149         des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17150         xmlResetLastError();
17151         if (mem_base != xmlMemBlocks()) {
17152             printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17153 	           xmlMemBlocks() - mem_base);
17154 	    test_ret++;
17155             printf(" %d", n_streamCtxt);
17156             printf("\n");
17157         }
17158     }
17159     function_tests++;
17160 #endif
17161 
17162     return(test_ret);
17163 }
17164 
17165 static int
test_pattern(void)17166 test_pattern(void) {
17167     int test_ret = 0;
17168 
17169     if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17170     test_ret += test_xmlPatternFromRoot();
17171     test_ret += test_xmlPatternGetStreamCtxt();
17172     test_ret += test_xmlPatternMatch();
17173     test_ret += test_xmlPatternMaxDepth();
17174     test_ret += test_xmlPatternMinDepth();
17175     test_ret += test_xmlPatternStreamable();
17176     test_ret += test_xmlPatterncompile();
17177     test_ret += test_xmlStreamPop();
17178     test_ret += test_xmlStreamPush();
17179     test_ret += test_xmlStreamPushAttr();
17180     test_ret += test_xmlStreamPushNode();
17181     test_ret += test_xmlStreamWantsAnyNode();
17182 
17183     if (test_ret != 0)
17184 	printf("Module pattern: %d errors\n", test_ret);
17185     return(test_ret);
17186 }
17187 #ifdef LIBXML_SCHEMAS_ENABLED
17188 
17189 #define gen_nb_xmlRelaxNGPtr 1
gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17190 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17191     return(NULL);
17192 }
des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED,xmlRelaxNGPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17193 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17194 }
17195 #endif
17196 
17197 
17198 static int
test_xmlRelaxNGDump(void)17199 test_xmlRelaxNGDump(void) {
17200     int test_ret = 0;
17201 
17202 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17203     int mem_base;
17204     FILE * output; /* the file output */
17205     int n_output;
17206     xmlRelaxNGPtr schema; /* a schema structure */
17207     int n_schema;
17208 
17209     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17210     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17211         mem_base = xmlMemBlocks();
17212         output = gen_FILE_ptr(n_output, 0);
17213         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17214 
17215         xmlRelaxNGDump(output, schema);
17216         call_tests++;
17217         des_FILE_ptr(n_output, output, 0);
17218         des_xmlRelaxNGPtr(n_schema, schema, 1);
17219         xmlResetLastError();
17220         if (mem_base != xmlMemBlocks()) {
17221             printf("Leak of %d blocks found in xmlRelaxNGDump",
17222 	           xmlMemBlocks() - mem_base);
17223 	    test_ret++;
17224             printf(" %d", n_output);
17225             printf(" %d", n_schema);
17226             printf("\n");
17227         }
17228     }
17229     }
17230     function_tests++;
17231 #endif
17232 
17233     return(test_ret);
17234 }
17235 
17236 
17237 static int
test_xmlRelaxNGDumpTree(void)17238 test_xmlRelaxNGDumpTree(void) {
17239     int test_ret = 0;
17240 
17241 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17242     int mem_base;
17243     FILE * output; /* the file output */
17244     int n_output;
17245     xmlRelaxNGPtr schema; /* a schema structure */
17246     int n_schema;
17247 
17248     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17249     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17250         mem_base = xmlMemBlocks();
17251         output = gen_FILE_ptr(n_output, 0);
17252         schema = gen_xmlRelaxNGPtr(n_schema, 1);
17253 
17254         xmlRelaxNGDumpTree(output, schema);
17255         call_tests++;
17256         des_FILE_ptr(n_output, output, 0);
17257         des_xmlRelaxNGPtr(n_schema, schema, 1);
17258         xmlResetLastError();
17259         if (mem_base != xmlMemBlocks()) {
17260             printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17261 	           xmlMemBlocks() - mem_base);
17262 	    test_ret++;
17263             printf(" %d", n_output);
17264             printf(" %d", n_schema);
17265             printf("\n");
17266         }
17267     }
17268     }
17269     function_tests++;
17270 #endif
17271 
17272     return(test_ret);
17273 }
17274 
17275 #ifdef LIBXML_SCHEMAS_ENABLED
17276 
17277 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17278 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17279     return(NULL);
17280 }
des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17281 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17282 }
17283 #endif
17284 
17285 #ifdef LIBXML_SCHEMAS_ENABLED
17286 
17287 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17288 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17289     return(NULL);
17290 }
des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17291 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17292 }
17293 #endif
17294 
17295 #ifdef LIBXML_SCHEMAS_ENABLED
17296 
17297 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17298 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17299     return(NULL);
17300 }
des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17301 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17302 }
17303 #endif
17304 
17305 #ifdef LIBXML_SCHEMAS_ENABLED
17306 
17307 #define gen_nb_void_ptr_ptr 1
gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17308 static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17309     return(NULL);
17310 }
des_void_ptr_ptr(int no ATTRIBUTE_UNUSED,void ** val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17311 static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17312 }
17313 #endif
17314 
17315 
17316 static int
test_xmlRelaxNGGetParserErrors(void)17317 test_xmlRelaxNGGetParserErrors(void) {
17318     int test_ret = 0;
17319 
17320 #if defined(LIBXML_SCHEMAS_ENABLED)
17321     int mem_base;
17322     int ret_val;
17323     xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17324     int n_ctxt;
17325     xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17326     int n_err;
17327     xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17328     int n_warn;
17329     void ** ctx; /* contextual data for the callbacks result */
17330     int n_ctx;
17331 
17332     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17333     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17334     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17335     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17336         mem_base = xmlMemBlocks();
17337         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17338         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17339         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17340         ctx = gen_void_ptr_ptr(n_ctx, 3);
17341 
17342         ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17343         desret_int(ret_val);
17344         call_tests++;
17345         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17346         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17347         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17348         des_void_ptr_ptr(n_ctx, ctx, 3);
17349         xmlResetLastError();
17350         if (mem_base != xmlMemBlocks()) {
17351             printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17352 	           xmlMemBlocks() - mem_base);
17353 	    test_ret++;
17354             printf(" %d", n_ctxt);
17355             printf(" %d", n_err);
17356             printf(" %d", n_warn);
17357             printf(" %d", n_ctx);
17358             printf("\n");
17359         }
17360     }
17361     }
17362     }
17363     }
17364     function_tests++;
17365 #endif
17366 
17367     return(test_ret);
17368 }
17369 
17370 #ifdef LIBXML_SCHEMAS_ENABLED
17371 
17372 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17373 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17374     return(NULL);
17375 }
des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17376 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17377 }
17378 #endif
17379 
17380 
17381 static int
test_xmlRelaxNGGetValidErrors(void)17382 test_xmlRelaxNGGetValidErrors(void) {
17383     int test_ret = 0;
17384 
17385 #if defined(LIBXML_SCHEMAS_ENABLED)
17386     int mem_base;
17387     int ret_val;
17388     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17389     int n_ctxt;
17390     xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17391     int n_err;
17392     xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17393     int n_warn;
17394     void ** ctx; /* the functions context result */
17395     int n_ctx;
17396 
17397     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17398     for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17399     for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17400     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17401         mem_base = xmlMemBlocks();
17402         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17403         err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17404         warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17405         ctx = gen_void_ptr_ptr(n_ctx, 3);
17406 
17407         ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17408         desret_int(ret_val);
17409         call_tests++;
17410         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17411         des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17412         des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17413         des_void_ptr_ptr(n_ctx, ctx, 3);
17414         xmlResetLastError();
17415         if (mem_base != xmlMemBlocks()) {
17416             printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17417 	           xmlMemBlocks() - mem_base);
17418 	    test_ret++;
17419             printf(" %d", n_ctxt);
17420             printf(" %d", n_err);
17421             printf(" %d", n_warn);
17422             printf(" %d", n_ctx);
17423             printf("\n");
17424         }
17425     }
17426     }
17427     }
17428     }
17429     function_tests++;
17430 #endif
17431 
17432     return(test_ret);
17433 }
17434 
17435 
17436 static int
test_xmlRelaxNGInitTypes(void)17437 test_xmlRelaxNGInitTypes(void) {
17438     int test_ret = 0;
17439 
17440 #if defined(LIBXML_SCHEMAS_ENABLED)
17441     int mem_base;
17442     int ret_val;
17443 
17444         mem_base = xmlMemBlocks();
17445 
17446         ret_val = xmlRelaxNGInitTypes();
17447         desret_int(ret_val);
17448         call_tests++;
17449         xmlResetLastError();
17450         if (mem_base != xmlMemBlocks()) {
17451             printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17452 	           xmlMemBlocks() - mem_base);
17453 	    test_ret++;
17454             printf("\n");
17455         }
17456     function_tests++;
17457 #endif
17458 
17459     return(test_ret);
17460 }
17461 
17462 
17463 static int
test_xmlRelaxNGNewDocParserCtxt(void)17464 test_xmlRelaxNGNewDocParserCtxt(void) {
17465     int test_ret = 0;
17466 
17467 #if defined(LIBXML_SCHEMAS_ENABLED)
17468     int mem_base;
17469     xmlRelaxNGParserCtxtPtr ret_val;
17470     xmlDocPtr doc; /* a preparsed document tree */
17471     int n_doc;
17472 
17473     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17474         mem_base = xmlMemBlocks();
17475         doc = gen_xmlDocPtr(n_doc, 0);
17476 
17477         ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17478         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17479         call_tests++;
17480         des_xmlDocPtr(n_doc, doc, 0);
17481         xmlResetLastError();
17482         if (mem_base != xmlMemBlocks()) {
17483             printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17484 	           xmlMemBlocks() - mem_base);
17485 	    test_ret++;
17486             printf(" %d", n_doc);
17487             printf("\n");
17488         }
17489     }
17490     function_tests++;
17491 #endif
17492 
17493     return(test_ret);
17494 }
17495 
17496 
17497 static int
test_xmlRelaxNGNewMemParserCtxt(void)17498 test_xmlRelaxNGNewMemParserCtxt(void) {
17499     int test_ret = 0;
17500 
17501 #if defined(LIBXML_SCHEMAS_ENABLED)
17502     int mem_base;
17503     xmlRelaxNGParserCtxtPtr ret_val;
17504     char * buffer; /* a pointer to a char array containing the schemas */
17505     int n_buffer;
17506     int size; /* the size of the array */
17507     int n_size;
17508 
17509     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17510     for (n_size = 0;n_size < gen_nb_int;n_size++) {
17511         mem_base = xmlMemBlocks();
17512         buffer = gen_const_char_ptr(n_buffer, 0);
17513         size = gen_int(n_size, 1);
17514 
17515         ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17516         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17517         call_tests++;
17518         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17519         des_int(n_size, size, 1);
17520         xmlResetLastError();
17521         if (mem_base != xmlMemBlocks()) {
17522             printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17523 	           xmlMemBlocks() - mem_base);
17524 	    test_ret++;
17525             printf(" %d", n_buffer);
17526             printf(" %d", n_size);
17527             printf("\n");
17528         }
17529     }
17530     }
17531     function_tests++;
17532 #endif
17533 
17534     return(test_ret);
17535 }
17536 
17537 
17538 static int
test_xmlRelaxNGNewParserCtxt(void)17539 test_xmlRelaxNGNewParserCtxt(void) {
17540     int test_ret = 0;
17541 
17542 #if defined(LIBXML_SCHEMAS_ENABLED)
17543     int mem_base;
17544     xmlRelaxNGParserCtxtPtr ret_val;
17545     char * URL; /* the location of the schema */
17546     int n_URL;
17547 
17548     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17549         mem_base = xmlMemBlocks();
17550         URL = gen_const_char_ptr(n_URL, 0);
17551 
17552         ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17553         desret_xmlRelaxNGParserCtxtPtr(ret_val);
17554         call_tests++;
17555         des_const_char_ptr(n_URL, (const char *)URL, 0);
17556         xmlResetLastError();
17557         if (mem_base != xmlMemBlocks()) {
17558             printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17559 	           xmlMemBlocks() - mem_base);
17560 	    test_ret++;
17561             printf(" %d", n_URL);
17562             printf("\n");
17563         }
17564     }
17565     function_tests++;
17566 #endif
17567 
17568     return(test_ret);
17569 }
17570 
17571 
17572 static int
test_xmlRelaxNGNewValidCtxt(void)17573 test_xmlRelaxNGNewValidCtxt(void) {
17574     int test_ret = 0;
17575 
17576 
17577     /* missing type support */
17578     return(test_ret);
17579 }
17580 
17581 
17582 static int
test_xmlRelaxNGParse(void)17583 test_xmlRelaxNGParse(void) {
17584     int test_ret = 0;
17585 
17586 
17587     /* missing type support */
17588     return(test_ret);
17589 }
17590 
17591 
17592 static int
test_xmlRelaxNGSetParserErrors(void)17593 test_xmlRelaxNGSetParserErrors(void) {
17594     int test_ret = 0;
17595 
17596 
17597     /* missing type support */
17598     return(test_ret);
17599 }
17600 
17601 
17602 static int
test_xmlRelaxNGSetParserStructuredErrors(void)17603 test_xmlRelaxNGSetParserStructuredErrors(void) {
17604     int test_ret = 0;
17605 
17606 
17607     /* missing type support */
17608     return(test_ret);
17609 }
17610 
17611 
17612 static int
test_xmlRelaxNGSetValidErrors(void)17613 test_xmlRelaxNGSetValidErrors(void) {
17614     int test_ret = 0;
17615 
17616 
17617     /* missing type support */
17618     return(test_ret);
17619 }
17620 
17621 
17622 static int
test_xmlRelaxNGSetValidStructuredErrors(void)17623 test_xmlRelaxNGSetValidStructuredErrors(void) {
17624     int test_ret = 0;
17625 
17626 
17627     /* missing type support */
17628     return(test_ret);
17629 }
17630 
17631 
17632 static int
test_xmlRelaxNGValidateDoc(void)17633 test_xmlRelaxNGValidateDoc(void) {
17634     int test_ret = 0;
17635 
17636 #if defined(LIBXML_SCHEMAS_ENABLED)
17637     int mem_base;
17638     int ret_val;
17639     xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17640     int n_ctxt;
17641     xmlDocPtr doc; /* a parsed document tree */
17642     int n_doc;
17643 
17644     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17645     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17646         mem_base = xmlMemBlocks();
17647         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17648         doc = gen_xmlDocPtr(n_doc, 1);
17649 
17650         ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17651         desret_int(ret_val);
17652         call_tests++;
17653         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17654         des_xmlDocPtr(n_doc, doc, 1);
17655         xmlResetLastError();
17656         if (mem_base != xmlMemBlocks()) {
17657             printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17658 	           xmlMemBlocks() - mem_base);
17659 	    test_ret++;
17660             printf(" %d", n_ctxt);
17661             printf(" %d", n_doc);
17662             printf("\n");
17663         }
17664     }
17665     }
17666     function_tests++;
17667 #endif
17668 
17669     return(test_ret);
17670 }
17671 
17672 
17673 static int
test_xmlRelaxNGValidateFullElement(void)17674 test_xmlRelaxNGValidateFullElement(void) {
17675     int test_ret = 0;
17676 
17677 #if defined(LIBXML_SCHEMAS_ENABLED)
17678     int mem_base;
17679     int ret_val;
17680     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17681     int n_ctxt;
17682     xmlDocPtr doc; /* a document instance */
17683     int n_doc;
17684     xmlNodePtr elem; /* an element instance */
17685     int n_elem;
17686 
17687     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17688     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17689     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17690         mem_base = xmlMemBlocks();
17691         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17692         doc = gen_xmlDocPtr(n_doc, 1);
17693         elem = gen_xmlNodePtr(n_elem, 2);
17694 
17695         ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17696         desret_int(ret_val);
17697         call_tests++;
17698         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17699         des_xmlDocPtr(n_doc, doc, 1);
17700         des_xmlNodePtr(n_elem, elem, 2);
17701         xmlResetLastError();
17702         if (mem_base != xmlMemBlocks()) {
17703             printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17704 	           xmlMemBlocks() - mem_base);
17705 	    test_ret++;
17706             printf(" %d", n_ctxt);
17707             printf(" %d", n_doc);
17708             printf(" %d", n_elem);
17709             printf("\n");
17710         }
17711     }
17712     }
17713     }
17714     function_tests++;
17715 #endif
17716 
17717     return(test_ret);
17718 }
17719 
17720 
17721 static int
test_xmlRelaxNGValidatePopElement(void)17722 test_xmlRelaxNGValidatePopElement(void) {
17723     int test_ret = 0;
17724 
17725 #if defined(LIBXML_SCHEMAS_ENABLED)
17726     int mem_base;
17727     int ret_val;
17728     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17729     int n_ctxt;
17730     xmlDocPtr doc; /* a document instance */
17731     int n_doc;
17732     xmlNodePtr elem; /* an element instance */
17733     int n_elem;
17734 
17735     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17736     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17737     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17738         mem_base = xmlMemBlocks();
17739         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17740         doc = gen_xmlDocPtr(n_doc, 1);
17741         elem = gen_xmlNodePtr(n_elem, 2);
17742 
17743         ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17744         desret_int(ret_val);
17745         call_tests++;
17746         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17747         des_xmlDocPtr(n_doc, doc, 1);
17748         des_xmlNodePtr(n_elem, elem, 2);
17749         xmlResetLastError();
17750         if (mem_base != xmlMemBlocks()) {
17751             printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17752 	           xmlMemBlocks() - mem_base);
17753 	    test_ret++;
17754             printf(" %d", n_ctxt);
17755             printf(" %d", n_doc);
17756             printf(" %d", n_elem);
17757             printf("\n");
17758         }
17759     }
17760     }
17761     }
17762     function_tests++;
17763 #endif
17764 
17765     return(test_ret);
17766 }
17767 
17768 
17769 static int
test_xmlRelaxNGValidatePushCData(void)17770 test_xmlRelaxNGValidatePushCData(void) {
17771     int test_ret = 0;
17772 
17773 #if defined(LIBXML_SCHEMAS_ENABLED)
17774     int mem_base;
17775     int ret_val;
17776     xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17777     int n_ctxt;
17778     xmlChar * data; /* some character data read */
17779     int n_data;
17780     int len; /* the lenght of the data */
17781     int n_len;
17782 
17783     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17784     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17785     for (n_len = 0;n_len < gen_nb_int;n_len++) {
17786         mem_base = xmlMemBlocks();
17787         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17788         data = gen_const_xmlChar_ptr(n_data, 1);
17789         len = gen_int(n_len, 2);
17790 
17791         ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17792         desret_int(ret_val);
17793         call_tests++;
17794         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17795         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17796         des_int(n_len, len, 2);
17797         xmlResetLastError();
17798         if (mem_base != xmlMemBlocks()) {
17799             printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17800 	           xmlMemBlocks() - mem_base);
17801 	    test_ret++;
17802             printf(" %d", n_ctxt);
17803             printf(" %d", n_data);
17804             printf(" %d", n_len);
17805             printf("\n");
17806         }
17807     }
17808     }
17809     }
17810     function_tests++;
17811 #endif
17812 
17813     return(test_ret);
17814 }
17815 
17816 
17817 static int
test_xmlRelaxNGValidatePushElement(void)17818 test_xmlRelaxNGValidatePushElement(void) {
17819     int test_ret = 0;
17820 
17821 #if defined(LIBXML_SCHEMAS_ENABLED)
17822     int mem_base;
17823     int ret_val;
17824     xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17825     int n_ctxt;
17826     xmlDocPtr doc; /* a document instance */
17827     int n_doc;
17828     xmlNodePtr elem; /* an element instance */
17829     int n_elem;
17830 
17831     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17832     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17833     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17834         mem_base = xmlMemBlocks();
17835         ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17836         doc = gen_xmlDocPtr(n_doc, 1);
17837         elem = gen_xmlNodePtr(n_elem, 2);
17838 
17839         ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17840         desret_int(ret_val);
17841         call_tests++;
17842         des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17843         des_xmlDocPtr(n_doc, doc, 1);
17844         des_xmlNodePtr(n_elem, elem, 2);
17845         xmlResetLastError();
17846         if (mem_base != xmlMemBlocks()) {
17847             printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17848 	           xmlMemBlocks() - mem_base);
17849 	    test_ret++;
17850             printf(" %d", n_ctxt);
17851             printf(" %d", n_doc);
17852             printf(" %d", n_elem);
17853             printf("\n");
17854         }
17855     }
17856     }
17857     }
17858     function_tests++;
17859 #endif
17860 
17861     return(test_ret);
17862 }
17863 
17864 
17865 static int
test_xmlRelaxParserSetFlag(void)17866 test_xmlRelaxParserSetFlag(void) {
17867     int test_ret = 0;
17868 
17869 #if defined(LIBXML_SCHEMAS_ENABLED)
17870     int mem_base;
17871     int ret_val;
17872     xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17873     int n_ctxt;
17874     int flags; /* a set of flags values */
17875     int n_flags;
17876 
17877     for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17878     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17879         mem_base = xmlMemBlocks();
17880         ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17881         flags = gen_int(n_flags, 1);
17882 
17883         ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17884         desret_int(ret_val);
17885         call_tests++;
17886         des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17887         des_int(n_flags, flags, 1);
17888         xmlResetLastError();
17889         if (mem_base != xmlMemBlocks()) {
17890             printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17891 	           xmlMemBlocks() - mem_base);
17892 	    test_ret++;
17893             printf(" %d", n_ctxt);
17894             printf(" %d", n_flags);
17895             printf("\n");
17896         }
17897     }
17898     }
17899     function_tests++;
17900 #endif
17901 
17902     return(test_ret);
17903 }
17904 
17905 static int
test_relaxng(void)17906 test_relaxng(void) {
17907     int test_ret = 0;
17908 
17909     if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17910     test_ret += test_xmlRelaxNGDump();
17911     test_ret += test_xmlRelaxNGDumpTree();
17912     test_ret += test_xmlRelaxNGGetParserErrors();
17913     test_ret += test_xmlRelaxNGGetValidErrors();
17914     test_ret += test_xmlRelaxNGInitTypes();
17915     test_ret += test_xmlRelaxNGNewDocParserCtxt();
17916     test_ret += test_xmlRelaxNGNewMemParserCtxt();
17917     test_ret += test_xmlRelaxNGNewParserCtxt();
17918     test_ret += test_xmlRelaxNGNewValidCtxt();
17919     test_ret += test_xmlRelaxNGParse();
17920     test_ret += test_xmlRelaxNGSetParserErrors();
17921     test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17922     test_ret += test_xmlRelaxNGSetValidErrors();
17923     test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17924     test_ret += test_xmlRelaxNGValidateDoc();
17925     test_ret += test_xmlRelaxNGValidateFullElement();
17926     test_ret += test_xmlRelaxNGValidatePopElement();
17927     test_ret += test_xmlRelaxNGValidatePushCData();
17928     test_ret += test_xmlRelaxNGValidatePushElement();
17929     test_ret += test_xmlRelaxParserSetFlag();
17930 
17931     if (test_ret != 0)
17932 	printf("Module relaxng: %d errors\n", test_ret);
17933     return(test_ret);
17934 }
17935 static int
test_schemasInternals(void)17936 test_schemasInternals(void) {
17937     int test_ret = 0;
17938 
17939     if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17940 
17941     if (test_ret != 0)
17942 	printf("Module schemasInternals: %d errors\n", test_ret);
17943     return(test_ret);
17944 }
17945 
17946 static int
test_xmlSchematronNewDocParserCtxt(void)17947 test_xmlSchematronNewDocParserCtxt(void) {
17948     int test_ret = 0;
17949 
17950 
17951     /* missing type support */
17952     return(test_ret);
17953 }
17954 
17955 
17956 static int
test_xmlSchematronNewMemParserCtxt(void)17957 test_xmlSchematronNewMemParserCtxt(void) {
17958     int test_ret = 0;
17959 
17960 
17961     /* missing type support */
17962     return(test_ret);
17963 }
17964 
17965 
17966 static int
test_xmlSchematronNewParserCtxt(void)17967 test_xmlSchematronNewParserCtxt(void) {
17968     int test_ret = 0;
17969 
17970 
17971     /* missing type support */
17972     return(test_ret);
17973 }
17974 
17975 #ifdef LIBXML_SCHEMATRON_ENABLED
17976 
17977 #define gen_nb_xmlSchematronPtr 1
gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17978 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17979     return(NULL);
17980 }
des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED,xmlSchematronPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17981 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17982 }
17983 #endif
17984 
17985 
17986 static int
test_xmlSchematronNewValidCtxt(void)17987 test_xmlSchematronNewValidCtxt(void) {
17988     int test_ret = 0;
17989 
17990 
17991     /* missing type support */
17992     return(test_ret);
17993 }
17994 
17995 #ifdef LIBXML_SCHEMATRON_ENABLED
17996 
17997 #define gen_nb_xmlSchematronParserCtxtPtr 1
gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)17998 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17999     return(NULL);
18000 }
des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18001 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18002 }
18003 #endif
18004 
18005 
18006 static int
test_xmlSchematronParse(void)18007 test_xmlSchematronParse(void) {
18008     int test_ret = 0;
18009 
18010 
18011     /* missing type support */
18012     return(test_ret);
18013 }
18014 
18015 #ifdef LIBXML_SCHEMATRON_ENABLED
18016 
18017 #define gen_nb_xmlSchematronValidCtxtPtr 1
gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18018 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18019     return(NULL);
18020 }
des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18021 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18022 }
18023 #endif
18024 
18025 
18026 static int
test_xmlSchematronSetValidStructuredErrors(void)18027 test_xmlSchematronSetValidStructuredErrors(void) {
18028     int test_ret = 0;
18029 
18030 
18031     /* missing type support */
18032     return(test_ret);
18033 }
18034 
18035 
18036 static int
test_xmlSchematronValidateDoc(void)18037 test_xmlSchematronValidateDoc(void) {
18038     int test_ret = 0;
18039 
18040 #if defined(LIBXML_SCHEMATRON_ENABLED)
18041     int mem_base;
18042     int ret_val;
18043     xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18044     int n_ctxt;
18045     xmlDocPtr instance; /* the document instace tree */
18046     int n_instance;
18047 
18048     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18049     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18050         mem_base = xmlMemBlocks();
18051         ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18052         instance = gen_xmlDocPtr(n_instance, 1);
18053 
18054         ret_val = xmlSchematronValidateDoc(ctxt, instance);
18055         desret_int(ret_val);
18056         call_tests++;
18057         des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18058         des_xmlDocPtr(n_instance, instance, 1);
18059         xmlResetLastError();
18060         if (mem_base != xmlMemBlocks()) {
18061             printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18062 	           xmlMemBlocks() - mem_base);
18063 	    test_ret++;
18064             printf(" %d", n_ctxt);
18065             printf(" %d", n_instance);
18066             printf("\n");
18067         }
18068     }
18069     }
18070     function_tests++;
18071 #endif
18072 
18073     return(test_ret);
18074 }
18075 
18076 static int
test_schematron(void)18077 test_schematron(void) {
18078     int test_ret = 0;
18079 
18080     if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18081     test_ret += test_xmlSchematronNewDocParserCtxt();
18082     test_ret += test_xmlSchematronNewMemParserCtxt();
18083     test_ret += test_xmlSchematronNewParserCtxt();
18084     test_ret += test_xmlSchematronNewValidCtxt();
18085     test_ret += test_xmlSchematronParse();
18086     test_ret += test_xmlSchematronSetValidStructuredErrors();
18087     test_ret += test_xmlSchematronValidateDoc();
18088 
18089     if (test_ret != 0)
18090 	printf("Module schematron: %d errors\n", test_ret);
18091     return(test_ret);
18092 }
18093 
18094 static int
test_xmlAddChild(void)18095 test_xmlAddChild(void) {
18096     int test_ret = 0;
18097 
18098     int mem_base;
18099     xmlNodePtr ret_val;
18100     xmlNodePtr parent; /* the parent node */
18101     int n_parent;
18102     xmlNodePtr cur; /* the child node */
18103     int n_cur;
18104 
18105     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18106     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18107         mem_base = xmlMemBlocks();
18108         parent = gen_xmlNodePtr(n_parent, 0);
18109         cur = gen_xmlNodePtr_in(n_cur, 1);
18110 
18111         ret_val = xmlAddChild(parent, cur);
18112         if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18113         desret_xmlNodePtr(ret_val);
18114         call_tests++;
18115         des_xmlNodePtr(n_parent, parent, 0);
18116         des_xmlNodePtr_in(n_cur, cur, 1);
18117         xmlResetLastError();
18118         if (mem_base != xmlMemBlocks()) {
18119             printf("Leak of %d blocks found in xmlAddChild",
18120 	           xmlMemBlocks() - mem_base);
18121 	    test_ret++;
18122             printf(" %d", n_parent);
18123             printf(" %d", n_cur);
18124             printf("\n");
18125         }
18126     }
18127     }
18128     function_tests++;
18129 
18130     return(test_ret);
18131 }
18132 
18133 
18134 static int
test_xmlAddChildList(void)18135 test_xmlAddChildList(void) {
18136     int test_ret = 0;
18137 
18138     int mem_base;
18139     xmlNodePtr ret_val;
18140     xmlNodePtr parent; /* the parent node */
18141     int n_parent;
18142     xmlNodePtr cur; /* the first node in the list */
18143     int n_cur;
18144 
18145     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18146     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18147         mem_base = xmlMemBlocks();
18148         parent = gen_xmlNodePtr(n_parent, 0);
18149         cur = gen_xmlNodePtr_in(n_cur, 1);
18150 
18151         ret_val = xmlAddChildList(parent, cur);
18152         if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18153         desret_xmlNodePtr(ret_val);
18154         call_tests++;
18155         des_xmlNodePtr(n_parent, parent, 0);
18156         des_xmlNodePtr_in(n_cur, cur, 1);
18157         xmlResetLastError();
18158         if (mem_base != xmlMemBlocks()) {
18159             printf("Leak of %d blocks found in xmlAddChildList",
18160 	           xmlMemBlocks() - mem_base);
18161 	    test_ret++;
18162             printf(" %d", n_parent);
18163             printf(" %d", n_cur);
18164             printf("\n");
18165         }
18166     }
18167     }
18168     function_tests++;
18169 
18170     return(test_ret);
18171 }
18172 
18173 
18174 static int
test_xmlAddNextSibling(void)18175 test_xmlAddNextSibling(void) {
18176     int test_ret = 0;
18177 
18178     int mem_base;
18179     xmlNodePtr ret_val;
18180     xmlNodePtr cur; /* the child node */
18181     int n_cur;
18182     xmlNodePtr elem; /* the new node */
18183     int n_elem;
18184 
18185     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18186     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18187         mem_base = xmlMemBlocks();
18188         cur = gen_xmlNodePtr(n_cur, 0);
18189         elem = gen_xmlNodePtr_in(n_elem, 1);
18190 
18191         ret_val = xmlAddNextSibling(cur, elem);
18192         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18193         desret_xmlNodePtr(ret_val);
18194         call_tests++;
18195         des_xmlNodePtr(n_cur, cur, 0);
18196         des_xmlNodePtr_in(n_elem, elem, 1);
18197         xmlResetLastError();
18198         if (mem_base != xmlMemBlocks()) {
18199             printf("Leak of %d blocks found in xmlAddNextSibling",
18200 	           xmlMemBlocks() - mem_base);
18201 	    test_ret++;
18202             printf(" %d", n_cur);
18203             printf(" %d", n_elem);
18204             printf("\n");
18205         }
18206     }
18207     }
18208     function_tests++;
18209 
18210     return(test_ret);
18211 }
18212 
18213 
18214 static int
test_xmlAddPrevSibling(void)18215 test_xmlAddPrevSibling(void) {
18216     int test_ret = 0;
18217 
18218 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18219     int mem_base;
18220     xmlNodePtr ret_val;
18221     xmlNodePtr cur; /* the child node */
18222     int n_cur;
18223     xmlNodePtr elem; /* the new node */
18224     int n_elem;
18225 
18226     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18227     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18228         mem_base = xmlMemBlocks();
18229         cur = gen_xmlNodePtr(n_cur, 0);
18230         elem = gen_xmlNodePtr_in(n_elem, 1);
18231 
18232         ret_val = xmlAddPrevSibling(cur, elem);
18233         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18234         desret_xmlNodePtr(ret_val);
18235         call_tests++;
18236         des_xmlNodePtr(n_cur, cur, 0);
18237         des_xmlNodePtr_in(n_elem, elem, 1);
18238         xmlResetLastError();
18239         if (mem_base != xmlMemBlocks()) {
18240             printf("Leak of %d blocks found in xmlAddPrevSibling",
18241 	           xmlMemBlocks() - mem_base);
18242 	    test_ret++;
18243             printf(" %d", n_cur);
18244             printf(" %d", n_elem);
18245             printf("\n");
18246         }
18247     }
18248     }
18249     function_tests++;
18250 #endif
18251 
18252     return(test_ret);
18253 }
18254 
18255 
18256 static int
test_xmlAddSibling(void)18257 test_xmlAddSibling(void) {
18258     int test_ret = 0;
18259 
18260     int mem_base;
18261     xmlNodePtr ret_val;
18262     xmlNodePtr cur; /* the child node */
18263     int n_cur;
18264     xmlNodePtr elem; /* the new node */
18265     int n_elem;
18266 
18267     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18268     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18269         mem_base = xmlMemBlocks();
18270         cur = gen_xmlNodePtr(n_cur, 0);
18271         elem = gen_xmlNodePtr_in(n_elem, 1);
18272 
18273         ret_val = xmlAddSibling(cur, elem);
18274         if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18275         desret_xmlNodePtr(ret_val);
18276         call_tests++;
18277         des_xmlNodePtr(n_cur, cur, 0);
18278         des_xmlNodePtr_in(n_elem, elem, 1);
18279         xmlResetLastError();
18280         if (mem_base != xmlMemBlocks()) {
18281             printf("Leak of %d blocks found in xmlAddSibling",
18282 	           xmlMemBlocks() - mem_base);
18283 	    test_ret++;
18284             printf(" %d", n_cur);
18285             printf(" %d", n_elem);
18286             printf("\n");
18287         }
18288     }
18289     }
18290     function_tests++;
18291 
18292     return(test_ret);
18293 }
18294 
18295 
18296 static int
test_xmlAttrSerializeTxtContent(void)18297 test_xmlAttrSerializeTxtContent(void) {
18298     int test_ret = 0;
18299 
18300 #if defined(LIBXML_OUTPUT_ENABLED)
18301 #ifdef LIBXML_OUTPUT_ENABLED
18302     int mem_base;
18303     xmlBufferPtr buf; /* the XML buffer output */
18304     int n_buf;
18305     xmlDocPtr doc; /* the document */
18306     int n_doc;
18307     xmlAttrPtr attr; /* the attribute node */
18308     int n_attr;
18309     xmlChar * string; /* the text content */
18310     int n_string;
18311 
18312     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18313     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18314     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18315     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18316         mem_base = xmlMemBlocks();
18317         buf = gen_xmlBufferPtr(n_buf, 0);
18318         doc = gen_xmlDocPtr(n_doc, 1);
18319         attr = gen_xmlAttrPtr(n_attr, 2);
18320         string = gen_const_xmlChar_ptr(n_string, 3);
18321 
18322         xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18323         call_tests++;
18324         des_xmlBufferPtr(n_buf, buf, 0);
18325         des_xmlDocPtr(n_doc, doc, 1);
18326         des_xmlAttrPtr(n_attr, attr, 2);
18327         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18328         xmlResetLastError();
18329         if (mem_base != xmlMemBlocks()) {
18330             printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18331 	           xmlMemBlocks() - mem_base);
18332 	    test_ret++;
18333             printf(" %d", n_buf);
18334             printf(" %d", n_doc);
18335             printf(" %d", n_attr);
18336             printf(" %d", n_string);
18337             printf("\n");
18338         }
18339     }
18340     }
18341     }
18342     }
18343     function_tests++;
18344 #endif
18345 #endif
18346 
18347     return(test_ret);
18348 }
18349 
18350 
18351 static int
test_xmlBufferAdd(void)18352 test_xmlBufferAdd(void) {
18353     int test_ret = 0;
18354 
18355     int mem_base;
18356     int ret_val;
18357     xmlBufferPtr buf; /* the buffer to dump */
18358     int n_buf;
18359     xmlChar * str; /* the #xmlChar string */
18360     int n_str;
18361     int len; /* the number of #xmlChar to add */
18362     int n_len;
18363 
18364     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18365     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18366     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18367         mem_base = xmlMemBlocks();
18368         buf = gen_xmlBufferPtr(n_buf, 0);
18369         str = gen_const_xmlChar_ptr(n_str, 1);
18370         len = gen_int(n_len, 2);
18371 
18372         ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18373         desret_int(ret_val);
18374         call_tests++;
18375         des_xmlBufferPtr(n_buf, buf, 0);
18376         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18377         des_int(n_len, len, 2);
18378         xmlResetLastError();
18379         if (mem_base != xmlMemBlocks()) {
18380             printf("Leak of %d blocks found in xmlBufferAdd",
18381 	           xmlMemBlocks() - mem_base);
18382 	    test_ret++;
18383             printf(" %d", n_buf);
18384             printf(" %d", n_str);
18385             printf(" %d", n_len);
18386             printf("\n");
18387         }
18388     }
18389     }
18390     }
18391     function_tests++;
18392 
18393     return(test_ret);
18394 }
18395 
18396 
18397 static int
test_xmlBufferAddHead(void)18398 test_xmlBufferAddHead(void) {
18399     int test_ret = 0;
18400 
18401     int mem_base;
18402     int ret_val;
18403     xmlBufferPtr buf; /* the buffer */
18404     int n_buf;
18405     xmlChar * str; /* the #xmlChar string */
18406     int n_str;
18407     int len; /* the number of #xmlChar to add */
18408     int n_len;
18409 
18410     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18411     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18412     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18413         mem_base = xmlMemBlocks();
18414         buf = gen_xmlBufferPtr(n_buf, 0);
18415         str = gen_const_xmlChar_ptr(n_str, 1);
18416         len = gen_int(n_len, 2);
18417 
18418         ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18419         desret_int(ret_val);
18420         call_tests++;
18421         des_xmlBufferPtr(n_buf, buf, 0);
18422         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18423         des_int(n_len, len, 2);
18424         xmlResetLastError();
18425         if (mem_base != xmlMemBlocks()) {
18426             printf("Leak of %d blocks found in xmlBufferAddHead",
18427 	           xmlMemBlocks() - mem_base);
18428 	    test_ret++;
18429             printf(" %d", n_buf);
18430             printf(" %d", n_str);
18431             printf(" %d", n_len);
18432             printf("\n");
18433         }
18434     }
18435     }
18436     }
18437     function_tests++;
18438 
18439     return(test_ret);
18440 }
18441 
18442 
18443 static int
test_xmlBufferCCat(void)18444 test_xmlBufferCCat(void) {
18445     int test_ret = 0;
18446 
18447     int mem_base;
18448     int ret_val;
18449     xmlBufferPtr buf; /* the buffer to dump */
18450     int n_buf;
18451     char * str; /* the C char string */
18452     int n_str;
18453 
18454     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18455     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18456         mem_base = xmlMemBlocks();
18457         buf = gen_xmlBufferPtr(n_buf, 0);
18458         str = gen_const_char_ptr(n_str, 1);
18459 
18460         ret_val = xmlBufferCCat(buf, (const char *)str);
18461         desret_int(ret_val);
18462         call_tests++;
18463         des_xmlBufferPtr(n_buf, buf, 0);
18464         des_const_char_ptr(n_str, (const char *)str, 1);
18465         xmlResetLastError();
18466         if (mem_base != xmlMemBlocks()) {
18467             printf("Leak of %d blocks found in xmlBufferCCat",
18468 	           xmlMemBlocks() - mem_base);
18469 	    test_ret++;
18470             printf(" %d", n_buf);
18471             printf(" %d", n_str);
18472             printf("\n");
18473         }
18474     }
18475     }
18476     function_tests++;
18477 
18478     return(test_ret);
18479 }
18480 
18481 
18482 static int
test_xmlBufferCat(void)18483 test_xmlBufferCat(void) {
18484     int test_ret = 0;
18485 
18486     int mem_base;
18487     int ret_val;
18488     xmlBufferPtr buf; /* the buffer to add to */
18489     int n_buf;
18490     xmlChar * str; /* the #xmlChar string */
18491     int n_str;
18492 
18493     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18494     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18495         mem_base = xmlMemBlocks();
18496         buf = gen_xmlBufferPtr(n_buf, 0);
18497         str = gen_const_xmlChar_ptr(n_str, 1);
18498 
18499         ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18500         desret_int(ret_val);
18501         call_tests++;
18502         des_xmlBufferPtr(n_buf, buf, 0);
18503         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18504         xmlResetLastError();
18505         if (mem_base != xmlMemBlocks()) {
18506             printf("Leak of %d blocks found in xmlBufferCat",
18507 	           xmlMemBlocks() - mem_base);
18508 	    test_ret++;
18509             printf(" %d", n_buf);
18510             printf(" %d", n_str);
18511             printf("\n");
18512         }
18513     }
18514     }
18515     function_tests++;
18516 
18517     return(test_ret);
18518 }
18519 
18520 
18521 #define gen_nb_const_xmlBufferPtr 1
gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18522 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18523     return(NULL);
18524 }
des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED,const xmlBufferPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)18525 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18526 }
18527 
18528 static int
test_xmlBufferContent(void)18529 test_xmlBufferContent(void) {
18530     int test_ret = 0;
18531 
18532     int mem_base;
18533     const xmlChar * ret_val;
18534     xmlBufferPtr buf; /* the buffer */
18535     int n_buf;
18536 
18537     for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18538         mem_base = xmlMemBlocks();
18539         buf = gen_const_xmlBufferPtr(n_buf, 0);
18540 
18541         ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18542         desret_const_xmlChar_ptr(ret_val);
18543         call_tests++;
18544         des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18545         xmlResetLastError();
18546         if (mem_base != xmlMemBlocks()) {
18547             printf("Leak of %d blocks found in xmlBufferContent",
18548 	           xmlMemBlocks() - mem_base);
18549 	    test_ret++;
18550             printf(" %d", n_buf);
18551             printf("\n");
18552         }
18553     }
18554     function_tests++;
18555 
18556     return(test_ret);
18557 }
18558 
18559 
18560 static int
test_xmlBufferCreate(void)18561 test_xmlBufferCreate(void) {
18562     int test_ret = 0;
18563 
18564     int mem_base;
18565     xmlBufferPtr ret_val;
18566 
18567         mem_base = xmlMemBlocks();
18568 
18569         ret_val = xmlBufferCreate();
18570         desret_xmlBufferPtr(ret_val);
18571         call_tests++;
18572         xmlResetLastError();
18573         if (mem_base != xmlMemBlocks()) {
18574             printf("Leak of %d blocks found in xmlBufferCreate",
18575 	           xmlMemBlocks() - mem_base);
18576 	    test_ret++;
18577             printf("\n");
18578         }
18579     function_tests++;
18580 
18581     return(test_ret);
18582 }
18583 
18584 
18585 static int
test_xmlBufferCreateSize(void)18586 test_xmlBufferCreateSize(void) {
18587     int test_ret = 0;
18588 
18589 
18590     /* missing type support */
18591     return(test_ret);
18592 }
18593 
18594 
18595 static int
test_xmlBufferCreateStatic(void)18596 test_xmlBufferCreateStatic(void) {
18597     int test_ret = 0;
18598 
18599 
18600     /* missing type support */
18601     return(test_ret);
18602 }
18603 
18604 
18605 static int
test_xmlBufferEmpty(void)18606 test_xmlBufferEmpty(void) {
18607     int test_ret = 0;
18608 
18609     int mem_base;
18610     xmlBufferPtr buf; /* the buffer */
18611     int n_buf;
18612 
18613     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18614         mem_base = xmlMemBlocks();
18615         buf = gen_xmlBufferPtr(n_buf, 0);
18616 
18617         xmlBufferEmpty(buf);
18618         call_tests++;
18619         des_xmlBufferPtr(n_buf, buf, 0);
18620         xmlResetLastError();
18621         if (mem_base != xmlMemBlocks()) {
18622             printf("Leak of %d blocks found in xmlBufferEmpty",
18623 	           xmlMemBlocks() - mem_base);
18624 	    test_ret++;
18625             printf(" %d", n_buf);
18626             printf("\n");
18627         }
18628     }
18629     function_tests++;
18630 
18631     return(test_ret);
18632 }
18633 
18634 
18635 static int
test_xmlBufferGrow(void)18636 test_xmlBufferGrow(void) {
18637     int test_ret = 0;
18638 
18639     int mem_base;
18640     int ret_val;
18641     xmlBufferPtr buf; /* the buffer */
18642     int n_buf;
18643     unsigned int len; /* the minimum free size to allocate */
18644     int n_len;
18645 
18646     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18647     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18648         mem_base = xmlMemBlocks();
18649         buf = gen_xmlBufferPtr(n_buf, 0);
18650         len = gen_unsigned_int(n_len, 1);
18651 
18652         ret_val = xmlBufferGrow(buf, len);
18653         desret_int(ret_val);
18654         call_tests++;
18655         des_xmlBufferPtr(n_buf, buf, 0);
18656         des_unsigned_int(n_len, len, 1);
18657         xmlResetLastError();
18658         if (mem_base != xmlMemBlocks()) {
18659             printf("Leak of %d blocks found in xmlBufferGrow",
18660 	           xmlMemBlocks() - mem_base);
18661 	    test_ret++;
18662             printf(" %d", n_buf);
18663             printf(" %d", n_len);
18664             printf("\n");
18665         }
18666     }
18667     }
18668     function_tests++;
18669 
18670     return(test_ret);
18671 }
18672 
18673 
18674 static int
test_xmlBufferLength(void)18675 test_xmlBufferLength(void) {
18676     int test_ret = 0;
18677 
18678     int mem_base;
18679     int ret_val;
18680     xmlBufferPtr buf; /* the buffer */
18681     int n_buf;
18682 
18683     for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18684         mem_base = xmlMemBlocks();
18685         buf = gen_const_xmlBufferPtr(n_buf, 0);
18686 
18687         ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18688         desret_int(ret_val);
18689         call_tests++;
18690         des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18691         xmlResetLastError();
18692         if (mem_base != xmlMemBlocks()) {
18693             printf("Leak of %d blocks found in xmlBufferLength",
18694 	           xmlMemBlocks() - mem_base);
18695 	    test_ret++;
18696             printf(" %d", n_buf);
18697             printf("\n");
18698         }
18699     }
18700     function_tests++;
18701 
18702     return(test_ret);
18703 }
18704 
18705 
18706 static int
test_xmlBufferResize(void)18707 test_xmlBufferResize(void) {
18708     int test_ret = 0;
18709 
18710     int mem_base;
18711     int ret_val;
18712     xmlBufferPtr buf; /* the buffer to resize */
18713     int n_buf;
18714     unsigned int size; /* the desired size */
18715     int n_size;
18716 
18717     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18718     for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18719         mem_base = xmlMemBlocks();
18720         buf = gen_xmlBufferPtr(n_buf, 0);
18721         size = gen_unsigned_int(n_size, 1);
18722 
18723         ret_val = xmlBufferResize(buf, size);
18724         desret_int(ret_val);
18725         call_tests++;
18726         des_xmlBufferPtr(n_buf, buf, 0);
18727         des_unsigned_int(n_size, size, 1);
18728         xmlResetLastError();
18729         if (mem_base != xmlMemBlocks()) {
18730             printf("Leak of %d blocks found in xmlBufferResize",
18731 	           xmlMemBlocks() - mem_base);
18732 	    test_ret++;
18733             printf(" %d", n_buf);
18734             printf(" %d", n_size);
18735             printf("\n");
18736         }
18737     }
18738     }
18739     function_tests++;
18740 
18741     return(test_ret);
18742 }
18743 
18744 
18745 static int
test_xmlBufferSetAllocationScheme(void)18746 test_xmlBufferSetAllocationScheme(void) {
18747     int test_ret = 0;
18748 
18749     int mem_base;
18750     xmlBufferPtr buf; /* the buffer to tune */
18751     int n_buf;
18752     xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18753     int n_scheme;
18754 
18755     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18756     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18757         mem_base = xmlMemBlocks();
18758         buf = gen_xmlBufferPtr(n_buf, 0);
18759         scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18760 
18761         xmlBufferSetAllocationScheme(buf, scheme);
18762         call_tests++;
18763         des_xmlBufferPtr(n_buf, buf, 0);
18764         des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18765         xmlResetLastError();
18766         if (mem_base != xmlMemBlocks()) {
18767             printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18768 	           xmlMemBlocks() - mem_base);
18769 	    test_ret++;
18770             printf(" %d", n_buf);
18771             printf(" %d", n_scheme);
18772             printf("\n");
18773         }
18774     }
18775     }
18776     function_tests++;
18777 
18778     return(test_ret);
18779 }
18780 
18781 
18782 static int
test_xmlBufferShrink(void)18783 test_xmlBufferShrink(void) {
18784     int test_ret = 0;
18785 
18786     int mem_base;
18787     int ret_val;
18788     xmlBufferPtr buf; /* the buffer to dump */
18789     int n_buf;
18790     unsigned int len; /* the number of xmlChar to remove */
18791     int n_len;
18792 
18793     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18794     for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18795         mem_base = xmlMemBlocks();
18796         buf = gen_xmlBufferPtr(n_buf, 0);
18797         len = gen_unsigned_int(n_len, 1);
18798 
18799         ret_val = xmlBufferShrink(buf, len);
18800         desret_int(ret_val);
18801         call_tests++;
18802         des_xmlBufferPtr(n_buf, buf, 0);
18803         des_unsigned_int(n_len, len, 1);
18804         xmlResetLastError();
18805         if (mem_base != xmlMemBlocks()) {
18806             printf("Leak of %d blocks found in xmlBufferShrink",
18807 	           xmlMemBlocks() - mem_base);
18808 	    test_ret++;
18809             printf(" %d", n_buf);
18810             printf(" %d", n_len);
18811             printf("\n");
18812         }
18813     }
18814     }
18815     function_tests++;
18816 
18817     return(test_ret);
18818 }
18819 
18820 
18821 static int
test_xmlBufferWriteCHAR(void)18822 test_xmlBufferWriteCHAR(void) {
18823     int test_ret = 0;
18824 
18825     int mem_base;
18826     xmlBufferPtr buf; /* the XML buffer */
18827     int n_buf;
18828     xmlChar * string; /* the string to add */
18829     int n_string;
18830 
18831     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18832     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18833         mem_base = xmlMemBlocks();
18834         buf = gen_xmlBufferPtr(n_buf, 0);
18835         string = gen_const_xmlChar_ptr(n_string, 1);
18836 
18837         xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18838         call_tests++;
18839         des_xmlBufferPtr(n_buf, buf, 0);
18840         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18841         xmlResetLastError();
18842         if (mem_base != xmlMemBlocks()) {
18843             printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18844 	           xmlMemBlocks() - mem_base);
18845 	    test_ret++;
18846             printf(" %d", n_buf);
18847             printf(" %d", n_string);
18848             printf("\n");
18849         }
18850     }
18851     }
18852     function_tests++;
18853 
18854     return(test_ret);
18855 }
18856 
18857 
18858 static int
test_xmlBufferWriteChar(void)18859 test_xmlBufferWriteChar(void) {
18860     int test_ret = 0;
18861 
18862     int mem_base;
18863     xmlBufferPtr buf; /* the XML buffer output */
18864     int n_buf;
18865     char * string; /* the string to add */
18866     int n_string;
18867 
18868     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18869     for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18870         mem_base = xmlMemBlocks();
18871         buf = gen_xmlBufferPtr(n_buf, 0);
18872         string = gen_const_char_ptr(n_string, 1);
18873 
18874         xmlBufferWriteChar(buf, (const char *)string);
18875         call_tests++;
18876         des_xmlBufferPtr(n_buf, buf, 0);
18877         des_const_char_ptr(n_string, (const char *)string, 1);
18878         xmlResetLastError();
18879         if (mem_base != xmlMemBlocks()) {
18880             printf("Leak of %d blocks found in xmlBufferWriteChar",
18881 	           xmlMemBlocks() - mem_base);
18882 	    test_ret++;
18883             printf(" %d", n_buf);
18884             printf(" %d", n_string);
18885             printf("\n");
18886         }
18887     }
18888     }
18889     function_tests++;
18890 
18891     return(test_ret);
18892 }
18893 
18894 
18895 static int
test_xmlBufferWriteQuotedString(void)18896 test_xmlBufferWriteQuotedString(void) {
18897     int test_ret = 0;
18898 
18899     int mem_base;
18900     xmlBufferPtr buf; /* the XML buffer output */
18901     int n_buf;
18902     xmlChar * string; /* the string to add */
18903     int n_string;
18904 
18905     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18906     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18907         mem_base = xmlMemBlocks();
18908         buf = gen_xmlBufferPtr(n_buf, 0);
18909         string = gen_const_xmlChar_ptr(n_string, 1);
18910 
18911         xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18912         call_tests++;
18913         des_xmlBufferPtr(n_buf, buf, 0);
18914         des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18915         xmlResetLastError();
18916         if (mem_base != xmlMemBlocks()) {
18917             printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18918 	           xmlMemBlocks() - mem_base);
18919 	    test_ret++;
18920             printf(" %d", n_buf);
18921             printf(" %d", n_string);
18922             printf("\n");
18923         }
18924     }
18925     }
18926     function_tests++;
18927 
18928     return(test_ret);
18929 }
18930 
18931 
18932 static int
test_xmlBuildQName(void)18933 test_xmlBuildQName(void) {
18934     int test_ret = 0;
18935 
18936     int mem_base;
18937     xmlChar * ret_val;
18938     xmlChar * ncname; /* the Name */
18939     int n_ncname;
18940     xmlChar * prefix; /* the prefix */
18941     int n_prefix;
18942     xmlChar * memory; /* preallocated memory */
18943     int n_memory;
18944     int len; /* preallocated memory length */
18945     int n_len;
18946 
18947     for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18948     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18949     for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18950     for (n_len = 0;n_len < gen_nb_int;n_len++) {
18951         mem_base = xmlMemBlocks();
18952         ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18953         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18954         memory = gen_xmlChar_ptr(n_memory, 2);
18955         len = gen_int(n_len, 3);
18956 
18957         ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18958         if ((ret_val != NULL) && (ret_val != ncname) &&
18959               (ret_val != prefix) && (ret_val != memory))
18960               xmlFree(ret_val);
18961 	  ret_val = NULL;
18962         desret_xmlChar_ptr(ret_val);
18963         call_tests++;
18964         des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18965         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18966         des_xmlChar_ptr(n_memory, memory, 2);
18967         des_int(n_len, len, 3);
18968         xmlResetLastError();
18969         if (mem_base != xmlMemBlocks()) {
18970             printf("Leak of %d blocks found in xmlBuildQName",
18971 	           xmlMemBlocks() - mem_base);
18972 	    test_ret++;
18973             printf(" %d", n_ncname);
18974             printf(" %d", n_prefix);
18975             printf(" %d", n_memory);
18976             printf(" %d", n_len);
18977             printf("\n");
18978         }
18979     }
18980     }
18981     }
18982     }
18983     function_tests++;
18984 
18985     return(test_ret);
18986 }
18987 
18988 
18989 static int
test_xmlCopyDoc(void)18990 test_xmlCopyDoc(void) {
18991     int test_ret = 0;
18992 
18993 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18994     int mem_base;
18995     xmlDocPtr ret_val;
18996     xmlDocPtr doc; /* the document */
18997     int n_doc;
18998     int recursive; /* if not zero do a recursive copy. */
18999     int n_recursive;
19000 
19001     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19002     for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19003         mem_base = xmlMemBlocks();
19004         doc = gen_xmlDocPtr(n_doc, 0);
19005         recursive = gen_int(n_recursive, 1);
19006 
19007         ret_val = xmlCopyDoc(doc, recursive);
19008         desret_xmlDocPtr(ret_val);
19009         call_tests++;
19010         des_xmlDocPtr(n_doc, doc, 0);
19011         des_int(n_recursive, recursive, 1);
19012         xmlResetLastError();
19013         if (mem_base != xmlMemBlocks()) {
19014             printf("Leak of %d blocks found in xmlCopyDoc",
19015 	           xmlMemBlocks() - mem_base);
19016 	    test_ret++;
19017             printf(" %d", n_doc);
19018             printf(" %d", n_recursive);
19019             printf("\n");
19020         }
19021     }
19022     }
19023     function_tests++;
19024 #endif
19025 
19026     return(test_ret);
19027 }
19028 
19029 
19030 static int
test_xmlCopyDtd(void)19031 test_xmlCopyDtd(void) {
19032     int test_ret = 0;
19033 
19034 #if defined(LIBXML_TREE_ENABLED)
19035     int mem_base;
19036     xmlDtdPtr ret_val;
19037     xmlDtdPtr dtd; /* the dtd */
19038     int n_dtd;
19039 
19040     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19041         mem_base = xmlMemBlocks();
19042         dtd = gen_xmlDtdPtr(n_dtd, 0);
19043 
19044         ret_val = xmlCopyDtd(dtd);
19045         desret_xmlDtdPtr(ret_val);
19046         call_tests++;
19047         des_xmlDtdPtr(n_dtd, dtd, 0);
19048         xmlResetLastError();
19049         if (mem_base != xmlMemBlocks()) {
19050             printf("Leak of %d blocks found in xmlCopyDtd",
19051 	           xmlMemBlocks() - mem_base);
19052 	    test_ret++;
19053             printf(" %d", n_dtd);
19054             printf("\n");
19055         }
19056     }
19057     function_tests++;
19058 #endif
19059 
19060     return(test_ret);
19061 }
19062 
19063 
19064 static int
test_xmlCopyNamespace(void)19065 test_xmlCopyNamespace(void) {
19066     int test_ret = 0;
19067 
19068     int mem_base;
19069     xmlNsPtr ret_val;
19070     xmlNsPtr cur; /* the namespace */
19071     int n_cur;
19072 
19073     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19074         mem_base = xmlMemBlocks();
19075         cur = gen_xmlNsPtr(n_cur, 0);
19076 
19077         ret_val = xmlCopyNamespace(cur);
19078         if (ret_val != NULL) xmlFreeNs(ret_val);
19079         desret_xmlNsPtr(ret_val);
19080         call_tests++;
19081         des_xmlNsPtr(n_cur, cur, 0);
19082         xmlResetLastError();
19083         if (mem_base != xmlMemBlocks()) {
19084             printf("Leak of %d blocks found in xmlCopyNamespace",
19085 	           xmlMemBlocks() - mem_base);
19086 	    test_ret++;
19087             printf(" %d", n_cur);
19088             printf("\n");
19089         }
19090     }
19091     function_tests++;
19092 
19093     return(test_ret);
19094 }
19095 
19096 
19097 static int
test_xmlCopyNamespaceList(void)19098 test_xmlCopyNamespaceList(void) {
19099     int test_ret = 0;
19100 
19101     int mem_base;
19102     xmlNsPtr ret_val;
19103     xmlNsPtr cur; /* the first namespace */
19104     int n_cur;
19105 
19106     for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19107         mem_base = xmlMemBlocks();
19108         cur = gen_xmlNsPtr(n_cur, 0);
19109 
19110         ret_val = xmlCopyNamespaceList(cur);
19111         if (ret_val != NULL) xmlFreeNsList(ret_val);
19112         desret_xmlNsPtr(ret_val);
19113         call_tests++;
19114         des_xmlNsPtr(n_cur, cur, 0);
19115         xmlResetLastError();
19116         if (mem_base != xmlMemBlocks()) {
19117             printf("Leak of %d blocks found in xmlCopyNamespaceList",
19118 	           xmlMemBlocks() - mem_base);
19119 	    test_ret++;
19120             printf(" %d", n_cur);
19121             printf("\n");
19122         }
19123     }
19124     function_tests++;
19125 
19126     return(test_ret);
19127 }
19128 
19129 
19130 static int
test_xmlCopyNode(void)19131 test_xmlCopyNode(void) {
19132     int test_ret = 0;
19133 
19134     int mem_base;
19135     xmlNodePtr ret_val;
19136     xmlNodePtr node; /* the node */
19137     int n_node;
19138     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19139     int n_extended;
19140 
19141     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19142     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19143         mem_base = xmlMemBlocks();
19144         node = gen_const_xmlNodePtr(n_node, 0);
19145         extended = gen_int(n_extended, 1);
19146 
19147         ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19148         desret_xmlNodePtr(ret_val);
19149         call_tests++;
19150         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19151         des_int(n_extended, extended, 1);
19152         xmlResetLastError();
19153         if (mem_base != xmlMemBlocks()) {
19154             printf("Leak of %d blocks found in xmlCopyNode",
19155 	           xmlMemBlocks() - mem_base);
19156 	    test_ret++;
19157             printf(" %d", n_node);
19158             printf(" %d", n_extended);
19159             printf("\n");
19160         }
19161     }
19162     }
19163     function_tests++;
19164 
19165     return(test_ret);
19166 }
19167 
19168 
19169 static int
test_xmlCopyNodeList(void)19170 test_xmlCopyNodeList(void) {
19171     int test_ret = 0;
19172 
19173     int mem_base;
19174     xmlNodePtr ret_val;
19175     xmlNodePtr node; /* the first node in the list. */
19176     int n_node;
19177 
19178     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19179         mem_base = xmlMemBlocks();
19180         node = gen_const_xmlNodePtr(n_node, 0);
19181 
19182         ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19183         desret_xmlNodePtr(ret_val);
19184         call_tests++;
19185         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19186         xmlResetLastError();
19187         if (mem_base != xmlMemBlocks()) {
19188             printf("Leak of %d blocks found in xmlCopyNodeList",
19189 	           xmlMemBlocks() - mem_base);
19190 	    test_ret++;
19191             printf(" %d", n_node);
19192             printf("\n");
19193         }
19194     }
19195     function_tests++;
19196 
19197     return(test_ret);
19198 }
19199 
19200 
19201 static int
test_xmlCopyProp(void)19202 test_xmlCopyProp(void) {
19203     int test_ret = 0;
19204 
19205     int mem_base;
19206     xmlAttrPtr ret_val;
19207     xmlNodePtr target; /* the element where the attribute will be grafted */
19208     int n_target;
19209     xmlAttrPtr cur; /* the attribute */
19210     int n_cur;
19211 
19212     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19213     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19214         mem_base = xmlMemBlocks();
19215         target = gen_xmlNodePtr(n_target, 0);
19216         cur = gen_xmlAttrPtr(n_cur, 1);
19217 
19218         ret_val = xmlCopyProp(target, cur);
19219         desret_xmlAttrPtr(ret_val);
19220         call_tests++;
19221         des_xmlNodePtr(n_target, target, 0);
19222         des_xmlAttrPtr(n_cur, cur, 1);
19223         xmlResetLastError();
19224         if (mem_base != xmlMemBlocks()) {
19225             printf("Leak of %d blocks found in xmlCopyProp",
19226 	           xmlMemBlocks() - mem_base);
19227 	    test_ret++;
19228             printf(" %d", n_target);
19229             printf(" %d", n_cur);
19230             printf("\n");
19231         }
19232     }
19233     }
19234     function_tests++;
19235 
19236     return(test_ret);
19237 }
19238 
19239 
19240 static int
test_xmlCopyPropList(void)19241 test_xmlCopyPropList(void) {
19242     int test_ret = 0;
19243 
19244     int mem_base;
19245     xmlAttrPtr ret_val;
19246     xmlNodePtr target; /* the element where the attributes will be grafted */
19247     int n_target;
19248     xmlAttrPtr cur; /* the first attribute */
19249     int n_cur;
19250 
19251     for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19252     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19253         mem_base = xmlMemBlocks();
19254         target = gen_xmlNodePtr(n_target, 0);
19255         cur = gen_xmlAttrPtr(n_cur, 1);
19256 
19257         ret_val = xmlCopyPropList(target, cur);
19258         desret_xmlAttrPtr(ret_val);
19259         call_tests++;
19260         des_xmlNodePtr(n_target, target, 0);
19261         des_xmlAttrPtr(n_cur, cur, 1);
19262         xmlResetLastError();
19263         if (mem_base != xmlMemBlocks()) {
19264             printf("Leak of %d blocks found in xmlCopyPropList",
19265 	           xmlMemBlocks() - mem_base);
19266 	    test_ret++;
19267             printf(" %d", n_target);
19268             printf(" %d", n_cur);
19269             printf("\n");
19270         }
19271     }
19272     }
19273     function_tests++;
19274 
19275     return(test_ret);
19276 }
19277 
19278 
19279 static int
test_xmlCreateIntSubset(void)19280 test_xmlCreateIntSubset(void) {
19281     int test_ret = 0;
19282 
19283     int mem_base;
19284     xmlDtdPtr ret_val;
19285     xmlDocPtr doc; /* the document pointer */
19286     int n_doc;
19287     xmlChar * name; /* the DTD name */
19288     int n_name;
19289     xmlChar * ExternalID; /* the external (PUBLIC) ID */
19290     int n_ExternalID;
19291     xmlChar * SystemID; /* the system ID */
19292     int n_SystemID;
19293 
19294     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19295     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19296     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19297     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19298         mem_base = xmlMemBlocks();
19299         doc = gen_xmlDocPtr(n_doc, 0);
19300         name = gen_const_xmlChar_ptr(n_name, 1);
19301         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19302         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19303 
19304         ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19305         desret_xmlDtdPtr(ret_val);
19306         call_tests++;
19307         des_xmlDocPtr(n_doc, doc, 0);
19308         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19309         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19310         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19311         xmlResetLastError();
19312         if (mem_base != xmlMemBlocks()) {
19313             printf("Leak of %d blocks found in xmlCreateIntSubset",
19314 	           xmlMemBlocks() - mem_base);
19315 	    test_ret++;
19316             printf(" %d", n_doc);
19317             printf(" %d", n_name);
19318             printf(" %d", n_ExternalID);
19319             printf(" %d", n_SystemID);
19320             printf("\n");
19321         }
19322     }
19323     }
19324     }
19325     }
19326     function_tests++;
19327 
19328     return(test_ret);
19329 }
19330 
19331 
19332 #define gen_nb_xmlDOMWrapCtxtPtr 1
gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)19333 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19334     return(NULL);
19335 }
des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED,xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)19336 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19337 }
19338 
19339 static int
test_xmlDOMWrapAdoptNode(void)19340 test_xmlDOMWrapAdoptNode(void) {
19341     int test_ret = 0;
19342 
19343     int mem_base;
19344     int ret_val;
19345     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19346     int n_ctxt;
19347     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19348     int n_sourceDoc;
19349     xmlNodePtr node; /* the node to start with */
19350     int n_node;
19351     xmlDocPtr destDoc; /* the destination doc */
19352     int n_destDoc;
19353     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19354     int n_destParent;
19355     int options; /* option flags */
19356     int n_options;
19357 
19358     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19359     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19360     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19361     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19362     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19363     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19364         mem_base = xmlMemBlocks();
19365         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19366         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19367         node = gen_xmlNodePtr(n_node, 2);
19368         destDoc = gen_xmlDocPtr(n_destDoc, 3);
19369         destParent = gen_xmlNodePtr(n_destParent, 4);
19370         options = gen_int(n_options, 5);
19371 
19372         ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19373         if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19374         desret_int(ret_val);
19375         call_tests++;
19376         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19377         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19378         des_xmlNodePtr(n_node, node, 2);
19379         des_xmlDocPtr(n_destDoc, destDoc, 3);
19380         des_xmlNodePtr(n_destParent, destParent, 4);
19381         des_int(n_options, options, 5);
19382         xmlResetLastError();
19383         if (mem_base != xmlMemBlocks()) {
19384             printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19385 	           xmlMemBlocks() - mem_base);
19386 	    test_ret++;
19387             printf(" %d", n_ctxt);
19388             printf(" %d", n_sourceDoc);
19389             printf(" %d", n_node);
19390             printf(" %d", n_destDoc);
19391             printf(" %d", n_destParent);
19392             printf(" %d", n_options);
19393             printf("\n");
19394         }
19395     }
19396     }
19397     }
19398     }
19399     }
19400     }
19401     function_tests++;
19402 
19403     return(test_ret);
19404 }
19405 
19406 
19407 static int
test_xmlDOMWrapCloneNode(void)19408 test_xmlDOMWrapCloneNode(void) {
19409     int test_ret = 0;
19410 
19411     int mem_base;
19412     int ret_val;
19413     xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19414     int n_ctxt;
19415     xmlDocPtr sourceDoc; /* the optional sourceDoc */
19416     int n_sourceDoc;
19417     xmlNodePtr node; /* the node to start with */
19418     int n_node;
19419     xmlNodePtr * resNode; /* the clone of the given @node */
19420     int n_resNode;
19421     xmlDocPtr destDoc; /* the destination doc */
19422     int n_destDoc;
19423     xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19424     int n_destParent;
19425     int deep; /* descend into child if set */
19426     int n_deep;
19427     int options; /* option flags */
19428     int n_options;
19429 
19430     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19431     for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19432     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19433     for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19434     for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19435     for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19436     for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19437     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19438         mem_base = xmlMemBlocks();
19439         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19440         sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19441         node = gen_xmlNodePtr(n_node, 2);
19442         resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19443         destDoc = gen_xmlDocPtr(n_destDoc, 4);
19444         destParent = gen_xmlNodePtr(n_destParent, 5);
19445         deep = gen_int(n_deep, 6);
19446         options = gen_int(n_options, 7);
19447 
19448         ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19449         desret_int(ret_val);
19450         call_tests++;
19451         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19452         des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19453         des_xmlNodePtr(n_node, node, 2);
19454         des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19455         des_xmlDocPtr(n_destDoc, destDoc, 4);
19456         des_xmlNodePtr(n_destParent, destParent, 5);
19457         des_int(n_deep, deep, 6);
19458         des_int(n_options, options, 7);
19459         xmlResetLastError();
19460         if (mem_base != xmlMemBlocks()) {
19461             printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19462 	           xmlMemBlocks() - mem_base);
19463 	    test_ret++;
19464             printf(" %d", n_ctxt);
19465             printf(" %d", n_sourceDoc);
19466             printf(" %d", n_node);
19467             printf(" %d", n_resNode);
19468             printf(" %d", n_destDoc);
19469             printf(" %d", n_destParent);
19470             printf(" %d", n_deep);
19471             printf(" %d", n_options);
19472             printf("\n");
19473         }
19474     }
19475     }
19476     }
19477     }
19478     }
19479     }
19480     }
19481     }
19482     function_tests++;
19483 
19484     return(test_ret);
19485 }
19486 
19487 
19488 static int
test_xmlDOMWrapNewCtxt(void)19489 test_xmlDOMWrapNewCtxt(void) {
19490     int test_ret = 0;
19491 
19492 
19493     /* missing type support */
19494     return(test_ret);
19495 }
19496 
19497 
19498 static int
test_xmlDOMWrapReconcileNamespaces(void)19499 test_xmlDOMWrapReconcileNamespaces(void) {
19500     int test_ret = 0;
19501 
19502     int mem_base;
19503     int ret_val;
19504     xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19505     int n_ctxt;
19506     xmlNodePtr elem; /* the element-node */
19507     int n_elem;
19508     int options; /* option flags */
19509     int n_options;
19510 
19511     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19512     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19513     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19514         mem_base = xmlMemBlocks();
19515         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19516         elem = gen_xmlNodePtr(n_elem, 1);
19517         options = gen_int(n_options, 2);
19518 
19519         ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19520         desret_int(ret_val);
19521         call_tests++;
19522         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19523         des_xmlNodePtr(n_elem, elem, 1);
19524         des_int(n_options, options, 2);
19525         xmlResetLastError();
19526         if (mem_base != xmlMemBlocks()) {
19527             printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19528 	           xmlMemBlocks() - mem_base);
19529 	    test_ret++;
19530             printf(" %d", n_ctxt);
19531             printf(" %d", n_elem);
19532             printf(" %d", n_options);
19533             printf("\n");
19534         }
19535     }
19536     }
19537     }
19538     function_tests++;
19539 
19540     return(test_ret);
19541 }
19542 
19543 
19544 static int
test_xmlDOMWrapRemoveNode(void)19545 test_xmlDOMWrapRemoveNode(void) {
19546     int test_ret = 0;
19547 
19548     int mem_base;
19549     int ret_val;
19550     xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19551     int n_ctxt;
19552     xmlDocPtr doc; /* the doc */
19553     int n_doc;
19554     xmlNodePtr node; /* the node to be removed. */
19555     int n_node;
19556     int options; /* set of options, unused at the moment */
19557     int n_options;
19558 
19559     for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19560     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19561     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19562     for (n_options = 0;n_options < gen_nb_int;n_options++) {
19563         mem_base = xmlMemBlocks();
19564         ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19565         doc = gen_xmlDocPtr(n_doc, 1);
19566         node = gen_xmlNodePtr(n_node, 2);
19567         options = gen_int(n_options, 3);
19568 
19569         ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19570         desret_int(ret_val);
19571         call_tests++;
19572         des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19573         des_xmlDocPtr(n_doc, doc, 1);
19574         des_xmlNodePtr(n_node, node, 2);
19575         des_int(n_options, options, 3);
19576         xmlResetLastError();
19577         if (mem_base != xmlMemBlocks()) {
19578             printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19579 	           xmlMemBlocks() - mem_base);
19580 	    test_ret++;
19581             printf(" %d", n_ctxt);
19582             printf(" %d", n_doc);
19583             printf(" %d", n_node);
19584             printf(" %d", n_options);
19585             printf("\n");
19586         }
19587     }
19588     }
19589     }
19590     }
19591     function_tests++;
19592 
19593     return(test_ret);
19594 }
19595 
19596 
19597 static int
test_xmlDocCopyNode(void)19598 test_xmlDocCopyNode(void) {
19599     int test_ret = 0;
19600 
19601     int mem_base;
19602     xmlNodePtr ret_val;
19603     xmlNodePtr node; /* the node */
19604     int n_node;
19605     xmlDocPtr doc; /* the document */
19606     int n_doc;
19607     int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19608     int n_extended;
19609 
19610     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19611     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19612     for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19613         mem_base = xmlMemBlocks();
19614         node = gen_const_xmlNodePtr(n_node, 0);
19615         doc = gen_xmlDocPtr(n_doc, 1);
19616         extended = gen_int(n_extended, 2);
19617 
19618         ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19619         desret_xmlNodePtr(ret_val);
19620         call_tests++;
19621         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19622         des_xmlDocPtr(n_doc, doc, 1);
19623         des_int(n_extended, extended, 2);
19624         xmlResetLastError();
19625         if (mem_base != xmlMemBlocks()) {
19626             printf("Leak of %d blocks found in xmlDocCopyNode",
19627 	           xmlMemBlocks() - mem_base);
19628 	    test_ret++;
19629             printf(" %d", n_node);
19630             printf(" %d", n_doc);
19631             printf(" %d", n_extended);
19632             printf("\n");
19633         }
19634     }
19635     }
19636     }
19637     function_tests++;
19638 
19639     return(test_ret);
19640 }
19641 
19642 
19643 static int
test_xmlDocCopyNodeList(void)19644 test_xmlDocCopyNodeList(void) {
19645     int test_ret = 0;
19646 
19647     int mem_base;
19648     xmlNodePtr ret_val;
19649     xmlDocPtr doc; /* the target document */
19650     int n_doc;
19651     xmlNodePtr node; /* the first node in the list. */
19652     int n_node;
19653 
19654     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19655     for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19656         mem_base = xmlMemBlocks();
19657         doc = gen_xmlDocPtr(n_doc, 0);
19658         node = gen_const_xmlNodePtr(n_node, 1);
19659 
19660         ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19661         desret_xmlNodePtr(ret_val);
19662         call_tests++;
19663         des_xmlDocPtr(n_doc, doc, 0);
19664         des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19665         xmlResetLastError();
19666         if (mem_base != xmlMemBlocks()) {
19667             printf("Leak of %d blocks found in xmlDocCopyNodeList",
19668 	           xmlMemBlocks() - mem_base);
19669 	    test_ret++;
19670             printf(" %d", n_doc);
19671             printf(" %d", n_node);
19672             printf("\n");
19673         }
19674     }
19675     }
19676     function_tests++;
19677 
19678     return(test_ret);
19679 }
19680 
19681 
19682 static int
test_xmlDocDump(void)19683 test_xmlDocDump(void) {
19684     int test_ret = 0;
19685 
19686 #if defined(LIBXML_OUTPUT_ENABLED)
19687     int mem_base;
19688     int ret_val;
19689     FILE * f; /* the FILE* */
19690     int n_f;
19691     xmlDocPtr cur; /* the document */
19692     int n_cur;
19693 
19694     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19695     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19696         mem_base = xmlMemBlocks();
19697         f = gen_FILE_ptr(n_f, 0);
19698         cur = gen_xmlDocPtr(n_cur, 1);
19699 
19700         ret_val = xmlDocDump(f, cur);
19701         desret_int(ret_val);
19702         call_tests++;
19703         des_FILE_ptr(n_f, f, 0);
19704         des_xmlDocPtr(n_cur, cur, 1);
19705         xmlResetLastError();
19706         if (mem_base != xmlMemBlocks()) {
19707             printf("Leak of %d blocks found in xmlDocDump",
19708 	           xmlMemBlocks() - mem_base);
19709 	    test_ret++;
19710             printf(" %d", n_f);
19711             printf(" %d", n_cur);
19712             printf("\n");
19713         }
19714     }
19715     }
19716     function_tests++;
19717 #endif
19718 
19719     return(test_ret);
19720 }
19721 
19722 
19723 static int
test_xmlDocDumpFormatMemory(void)19724 test_xmlDocDumpFormatMemory(void) {
19725     int test_ret = 0;
19726 
19727 #if defined(LIBXML_OUTPUT_ENABLED)
19728     int mem_base;
19729     xmlDocPtr cur; /* the document */
19730     int n_cur;
19731     xmlChar ** mem; /* OUT: the memory pointer */
19732     int n_mem;
19733     int * size; /* OUT: the memory length */
19734     int n_size;
19735     int format; /* should formatting spaces been added */
19736     int n_format;
19737 
19738     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19739     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19740     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19741     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19742         mem_base = xmlMemBlocks();
19743         cur = gen_xmlDocPtr(n_cur, 0);
19744         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19745         size = gen_int_ptr(n_size, 2);
19746         format = gen_int(n_format, 3);
19747 
19748         xmlDocDumpFormatMemory(cur, mem, size, format);
19749         call_tests++;
19750         des_xmlDocPtr(n_cur, cur, 0);
19751         des_xmlChar_ptr_ptr(n_mem, mem, 1);
19752         des_int_ptr(n_size, size, 2);
19753         des_int(n_format, format, 3);
19754         xmlResetLastError();
19755         if (mem_base != xmlMemBlocks()) {
19756             printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19757 	           xmlMemBlocks() - mem_base);
19758 	    test_ret++;
19759             printf(" %d", n_cur);
19760             printf(" %d", n_mem);
19761             printf(" %d", n_size);
19762             printf(" %d", n_format);
19763             printf("\n");
19764         }
19765     }
19766     }
19767     }
19768     }
19769     function_tests++;
19770 #endif
19771 
19772     return(test_ret);
19773 }
19774 
19775 
19776 static int
test_xmlDocDumpFormatMemoryEnc(void)19777 test_xmlDocDumpFormatMemoryEnc(void) {
19778     int test_ret = 0;
19779 
19780 #if defined(LIBXML_OUTPUT_ENABLED)
19781     int mem_base;
19782     xmlDocPtr out_doc; /* Document to generate XML text from */
19783     int n_out_doc;
19784     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19785     int n_doc_txt_ptr;
19786     int * doc_txt_len; /* Length of the generated XML text */
19787     int n_doc_txt_len;
19788     char * txt_encoding; /* Character encoding to use when generating XML text */
19789     int n_txt_encoding;
19790     int format; /* should formatting spaces been added */
19791     int n_format;
19792 
19793     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19794     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19795     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19796     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19797     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19798         mem_base = xmlMemBlocks();
19799         out_doc = gen_xmlDocPtr(n_out_doc, 0);
19800         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19801         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19802         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19803         format = gen_int(n_format, 4);
19804 
19805         xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19806         call_tests++;
19807         des_xmlDocPtr(n_out_doc, out_doc, 0);
19808         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19809         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19810         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19811         des_int(n_format, format, 4);
19812         xmlResetLastError();
19813         if (mem_base != xmlMemBlocks()) {
19814             printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19815 	           xmlMemBlocks() - mem_base);
19816 	    test_ret++;
19817             printf(" %d", n_out_doc);
19818             printf(" %d", n_doc_txt_ptr);
19819             printf(" %d", n_doc_txt_len);
19820             printf(" %d", n_txt_encoding);
19821             printf(" %d", n_format);
19822             printf("\n");
19823         }
19824     }
19825     }
19826     }
19827     }
19828     }
19829     function_tests++;
19830 #endif
19831 
19832     return(test_ret);
19833 }
19834 
19835 
19836 static int
test_xmlDocDumpMemory(void)19837 test_xmlDocDumpMemory(void) {
19838     int test_ret = 0;
19839 
19840 #if defined(LIBXML_OUTPUT_ENABLED)
19841     int mem_base;
19842     xmlDocPtr cur; /* the document */
19843     int n_cur;
19844     xmlChar ** mem; /* OUT: the memory pointer */
19845     int n_mem;
19846     int * size; /* OUT: the memory length */
19847     int n_size;
19848 
19849     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19850     for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19851     for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19852         mem_base = xmlMemBlocks();
19853         cur = gen_xmlDocPtr(n_cur, 0);
19854         mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19855         size = gen_int_ptr(n_size, 2);
19856 
19857         xmlDocDumpMemory(cur, mem, size);
19858         call_tests++;
19859         des_xmlDocPtr(n_cur, cur, 0);
19860         des_xmlChar_ptr_ptr(n_mem, mem, 1);
19861         des_int_ptr(n_size, size, 2);
19862         xmlResetLastError();
19863         if (mem_base != xmlMemBlocks()) {
19864             printf("Leak of %d blocks found in xmlDocDumpMemory",
19865 	           xmlMemBlocks() - mem_base);
19866 	    test_ret++;
19867             printf(" %d", n_cur);
19868             printf(" %d", n_mem);
19869             printf(" %d", n_size);
19870             printf("\n");
19871         }
19872     }
19873     }
19874     }
19875     function_tests++;
19876 #endif
19877 
19878     return(test_ret);
19879 }
19880 
19881 
19882 static int
test_xmlDocDumpMemoryEnc(void)19883 test_xmlDocDumpMemoryEnc(void) {
19884     int test_ret = 0;
19885 
19886 #if defined(LIBXML_OUTPUT_ENABLED)
19887     int mem_base;
19888     xmlDocPtr out_doc; /* Document to generate XML text from */
19889     int n_out_doc;
19890     xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19891     int n_doc_txt_ptr;
19892     int * doc_txt_len; /* Length of the generated XML text */
19893     int n_doc_txt_len;
19894     char * txt_encoding; /* Character encoding to use when generating XML text */
19895     int n_txt_encoding;
19896 
19897     for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19898     for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19899     for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19900     for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19901         mem_base = xmlMemBlocks();
19902         out_doc = gen_xmlDocPtr(n_out_doc, 0);
19903         doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19904         doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19905         txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19906 
19907         xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19908         call_tests++;
19909         des_xmlDocPtr(n_out_doc, out_doc, 0);
19910         des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19911         des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19912         des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19913         xmlResetLastError();
19914         if (mem_base != xmlMemBlocks()) {
19915             printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19916 	           xmlMemBlocks() - mem_base);
19917 	    test_ret++;
19918             printf(" %d", n_out_doc);
19919             printf(" %d", n_doc_txt_ptr);
19920             printf(" %d", n_doc_txt_len);
19921             printf(" %d", n_txt_encoding);
19922             printf("\n");
19923         }
19924     }
19925     }
19926     }
19927     }
19928     function_tests++;
19929 #endif
19930 
19931     return(test_ret);
19932 }
19933 
19934 
19935 static int
test_xmlDocFormatDump(void)19936 test_xmlDocFormatDump(void) {
19937     int test_ret = 0;
19938 
19939 #if defined(LIBXML_OUTPUT_ENABLED)
19940     int mem_base;
19941     int ret_val;
19942     FILE * f; /* the FILE* */
19943     int n_f;
19944     xmlDocPtr cur; /* the document */
19945     int n_cur;
19946     int format; /* should formatting spaces been added */
19947     int n_format;
19948 
19949     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19950     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19951     for (n_format = 0;n_format < gen_nb_int;n_format++) {
19952         mem_base = xmlMemBlocks();
19953         f = gen_FILE_ptr(n_f, 0);
19954         cur = gen_xmlDocPtr(n_cur, 1);
19955         format = gen_int(n_format, 2);
19956 
19957         ret_val = xmlDocFormatDump(f, cur, format);
19958         desret_int(ret_val);
19959         call_tests++;
19960         des_FILE_ptr(n_f, f, 0);
19961         des_xmlDocPtr(n_cur, cur, 1);
19962         des_int(n_format, format, 2);
19963         xmlResetLastError();
19964         if (mem_base != xmlMemBlocks()) {
19965             printf("Leak of %d blocks found in xmlDocFormatDump",
19966 	           xmlMemBlocks() - mem_base);
19967 	    test_ret++;
19968             printf(" %d", n_f);
19969             printf(" %d", n_cur);
19970             printf(" %d", n_format);
19971             printf("\n");
19972         }
19973     }
19974     }
19975     }
19976     function_tests++;
19977 #endif
19978 
19979     return(test_ret);
19980 }
19981 
19982 
19983 static int
test_xmlDocGetRootElement(void)19984 test_xmlDocGetRootElement(void) {
19985     int test_ret = 0;
19986 
19987     int mem_base;
19988     xmlNodePtr ret_val;
19989     xmlDocPtr doc; /* the document */
19990     int n_doc;
19991 
19992     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19993         mem_base = xmlMemBlocks();
19994         doc = gen_xmlDocPtr(n_doc, 0);
19995 
19996         ret_val = xmlDocGetRootElement(doc);
19997         desret_xmlNodePtr(ret_val);
19998         call_tests++;
19999         des_xmlDocPtr(n_doc, doc, 0);
20000         xmlResetLastError();
20001         if (mem_base != xmlMemBlocks()) {
20002             printf("Leak of %d blocks found in xmlDocGetRootElement",
20003 	           xmlMemBlocks() - mem_base);
20004 	    test_ret++;
20005             printf(" %d", n_doc);
20006             printf("\n");
20007         }
20008     }
20009     function_tests++;
20010 
20011     return(test_ret);
20012 }
20013 
20014 
20015 static int
test_xmlDocSetRootElement(void)20016 test_xmlDocSetRootElement(void) {
20017     int test_ret = 0;
20018 
20019 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20020     int mem_base;
20021     xmlNodePtr ret_val;
20022     xmlDocPtr doc; /* the document */
20023     int n_doc;
20024     xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */
20025     int n_root;
20026 
20027     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20028     for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20029         mem_base = xmlMemBlocks();
20030         doc = gen_xmlDocPtr(n_doc, 0);
20031         root = gen_xmlNodePtr_in(n_root, 1);
20032 
20033         ret_val = xmlDocSetRootElement(doc, root);
20034         if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20035         desret_xmlNodePtr(ret_val);
20036         call_tests++;
20037         des_xmlDocPtr(n_doc, doc, 0);
20038         des_xmlNodePtr_in(n_root, root, 1);
20039         xmlResetLastError();
20040         if (mem_base != xmlMemBlocks()) {
20041             printf("Leak of %d blocks found in xmlDocSetRootElement",
20042 	           xmlMemBlocks() - mem_base);
20043 	    test_ret++;
20044             printf(" %d", n_doc);
20045             printf(" %d", n_root);
20046             printf("\n");
20047         }
20048     }
20049     }
20050     function_tests++;
20051 #endif
20052 
20053     return(test_ret);
20054 }
20055 
20056 
20057 static int
test_xmlElemDump(void)20058 test_xmlElemDump(void) {
20059     int test_ret = 0;
20060 
20061 #if defined(LIBXML_OUTPUT_ENABLED)
20062     int mem_base;
20063     FILE * f; /* the FILE * for the output */
20064     int n_f;
20065     xmlDocPtr doc; /* the document */
20066     int n_doc;
20067     xmlNodePtr cur; /* the current node */
20068     int n_cur;
20069 
20070     for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20071     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20072     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20073         mem_base = xmlMemBlocks();
20074         f = gen_FILE_ptr(n_f, 0);
20075         doc = gen_xmlDocPtr(n_doc, 1);
20076         cur = gen_xmlNodePtr(n_cur, 2);
20077 
20078         xmlElemDump(f, doc, cur);
20079         call_tests++;
20080         des_FILE_ptr(n_f, f, 0);
20081         des_xmlDocPtr(n_doc, doc, 1);
20082         des_xmlNodePtr(n_cur, cur, 2);
20083         xmlResetLastError();
20084         if (mem_base != xmlMemBlocks()) {
20085             printf("Leak of %d blocks found in xmlElemDump",
20086 	           xmlMemBlocks() - mem_base);
20087 	    test_ret++;
20088             printf(" %d", n_f);
20089             printf(" %d", n_doc);
20090             printf(" %d", n_cur);
20091             printf("\n");
20092         }
20093     }
20094     }
20095     }
20096     function_tests++;
20097 #endif
20098 
20099     return(test_ret);
20100 }
20101 
20102 
20103 static int
test_xmlGetBufferAllocationScheme(void)20104 test_xmlGetBufferAllocationScheme(void) {
20105     int test_ret = 0;
20106 
20107     int mem_base;
20108     xmlBufferAllocationScheme ret_val;
20109 
20110         mem_base = xmlMemBlocks();
20111 
20112         ret_val = xmlGetBufferAllocationScheme();
20113         desret_xmlBufferAllocationScheme(ret_val);
20114         call_tests++;
20115         xmlResetLastError();
20116         if (mem_base != xmlMemBlocks()) {
20117             printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20118 	           xmlMemBlocks() - mem_base);
20119 	    test_ret++;
20120             printf("\n");
20121         }
20122     function_tests++;
20123 
20124     return(test_ret);
20125 }
20126 
20127 
20128 static int
test_xmlGetCompressMode(void)20129 test_xmlGetCompressMode(void) {
20130     int test_ret = 0;
20131 
20132     int mem_base;
20133     int ret_val;
20134 
20135         mem_base = xmlMemBlocks();
20136 
20137         ret_val = xmlGetCompressMode();
20138         desret_int(ret_val);
20139         call_tests++;
20140         xmlResetLastError();
20141         if (mem_base != xmlMemBlocks()) {
20142             printf("Leak of %d blocks found in xmlGetCompressMode",
20143 	           xmlMemBlocks() - mem_base);
20144 	    test_ret++;
20145             printf("\n");
20146         }
20147     function_tests++;
20148 
20149     return(test_ret);
20150 }
20151 
20152 
20153 static int
test_xmlGetDocCompressMode(void)20154 test_xmlGetDocCompressMode(void) {
20155     int test_ret = 0;
20156 
20157     int mem_base;
20158     int ret_val;
20159     xmlDocPtr doc; /* the document */
20160     int n_doc;
20161 
20162     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20163         mem_base = xmlMemBlocks();
20164         doc = gen_xmlDocPtr(n_doc, 0);
20165 
20166         ret_val = xmlGetDocCompressMode(doc);
20167         desret_int(ret_val);
20168         call_tests++;
20169         des_xmlDocPtr(n_doc, doc, 0);
20170         xmlResetLastError();
20171         if (mem_base != xmlMemBlocks()) {
20172             printf("Leak of %d blocks found in xmlGetDocCompressMode",
20173 	           xmlMemBlocks() - mem_base);
20174 	    test_ret++;
20175             printf(" %d", n_doc);
20176             printf("\n");
20177         }
20178     }
20179     function_tests++;
20180 
20181     return(test_ret);
20182 }
20183 
20184 
20185 static int
test_xmlGetIntSubset(void)20186 test_xmlGetIntSubset(void) {
20187     int test_ret = 0;
20188 
20189     int mem_base;
20190     xmlDtdPtr ret_val;
20191     xmlDocPtr doc; /* the document pointer */
20192     int n_doc;
20193 
20194     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20195         mem_base = xmlMemBlocks();
20196         doc = gen_xmlDocPtr(n_doc, 0);
20197 
20198         ret_val = xmlGetIntSubset(doc);
20199         desret_xmlDtdPtr(ret_val);
20200         call_tests++;
20201         des_xmlDocPtr(n_doc, doc, 0);
20202         xmlResetLastError();
20203         if (mem_base != xmlMemBlocks()) {
20204             printf("Leak of %d blocks found in xmlGetIntSubset",
20205 	           xmlMemBlocks() - mem_base);
20206 	    test_ret++;
20207             printf(" %d", n_doc);
20208             printf("\n");
20209         }
20210     }
20211     function_tests++;
20212 
20213     return(test_ret);
20214 }
20215 
20216 
20217 static int
test_xmlGetLastChild(void)20218 test_xmlGetLastChild(void) {
20219     int test_ret = 0;
20220 
20221     int mem_base;
20222     xmlNodePtr ret_val;
20223     xmlNodePtr parent; /* the parent node */
20224     int n_parent;
20225 
20226     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20227         mem_base = xmlMemBlocks();
20228         parent = gen_xmlNodePtr(n_parent, 0);
20229 
20230         ret_val = xmlGetLastChild(parent);
20231         desret_xmlNodePtr(ret_val);
20232         call_tests++;
20233         des_xmlNodePtr(n_parent, parent, 0);
20234         xmlResetLastError();
20235         if (mem_base != xmlMemBlocks()) {
20236             printf("Leak of %d blocks found in xmlGetLastChild",
20237 	           xmlMemBlocks() - mem_base);
20238 	    test_ret++;
20239             printf(" %d", n_parent);
20240             printf("\n");
20241         }
20242     }
20243     function_tests++;
20244 
20245     return(test_ret);
20246 }
20247 
20248 
20249 static int
test_xmlGetLineNo(void)20250 test_xmlGetLineNo(void) {
20251     int test_ret = 0;
20252 
20253     int mem_base;
20254     long ret_val;
20255     xmlNodePtr node; /* valid node */
20256     int n_node;
20257 
20258     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20259         mem_base = xmlMemBlocks();
20260         node = gen_xmlNodePtr(n_node, 0);
20261 
20262         ret_val = xmlGetLineNo(node);
20263         desret_long(ret_val);
20264         call_tests++;
20265         des_xmlNodePtr(n_node, node, 0);
20266         xmlResetLastError();
20267         if (mem_base != xmlMemBlocks()) {
20268             printf("Leak of %d blocks found in xmlGetLineNo",
20269 	           xmlMemBlocks() - mem_base);
20270 	    test_ret++;
20271             printf(" %d", n_node);
20272             printf("\n");
20273         }
20274     }
20275     function_tests++;
20276 
20277     return(test_ret);
20278 }
20279 
20280 
20281 static int
test_xmlGetNoNsProp(void)20282 test_xmlGetNoNsProp(void) {
20283     int test_ret = 0;
20284 
20285     int mem_base;
20286     xmlChar * ret_val;
20287     xmlNodePtr node; /* the node */
20288     int n_node;
20289     xmlChar * name; /* the attribute name */
20290     int n_name;
20291 
20292     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20293     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20294         mem_base = xmlMemBlocks();
20295         node = gen_xmlNodePtr(n_node, 0);
20296         name = gen_const_xmlChar_ptr(n_name, 1);
20297 
20298         ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20299         desret_xmlChar_ptr(ret_val);
20300         call_tests++;
20301         des_xmlNodePtr(n_node, node, 0);
20302         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20303         xmlResetLastError();
20304         if (mem_base != xmlMemBlocks()) {
20305             printf("Leak of %d blocks found in xmlGetNoNsProp",
20306 	           xmlMemBlocks() - mem_base);
20307 	    test_ret++;
20308             printf(" %d", n_node);
20309             printf(" %d", n_name);
20310             printf("\n");
20311         }
20312     }
20313     }
20314     function_tests++;
20315 
20316     return(test_ret);
20317 }
20318 
20319 
20320 static int
test_xmlGetNodePath(void)20321 test_xmlGetNodePath(void) {
20322     int test_ret = 0;
20323 
20324 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20325     int mem_base;
20326     xmlChar * ret_val;
20327     xmlNodePtr node; /* a node */
20328     int n_node;
20329 
20330     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20331         mem_base = xmlMemBlocks();
20332         node = gen_xmlNodePtr(n_node, 0);
20333 
20334         ret_val = xmlGetNodePath(node);
20335         desret_xmlChar_ptr(ret_val);
20336         call_tests++;
20337         des_xmlNodePtr(n_node, node, 0);
20338         xmlResetLastError();
20339         if (mem_base != xmlMemBlocks()) {
20340             printf("Leak of %d blocks found in xmlGetNodePath",
20341 	           xmlMemBlocks() - mem_base);
20342 	    test_ret++;
20343             printf(" %d", n_node);
20344             printf("\n");
20345         }
20346     }
20347     function_tests++;
20348 #endif
20349 
20350     return(test_ret);
20351 }
20352 
20353 
20354 static int
test_xmlGetNsList(void)20355 test_xmlGetNsList(void) {
20356     int test_ret = 0;
20357 
20358 
20359     /* missing type support */
20360     return(test_ret);
20361 }
20362 
20363 
20364 static int
test_xmlGetNsProp(void)20365 test_xmlGetNsProp(void) {
20366     int test_ret = 0;
20367 
20368     int mem_base;
20369     xmlChar * ret_val;
20370     xmlNodePtr node; /* the node */
20371     int n_node;
20372     xmlChar * name; /* the attribute name */
20373     int n_name;
20374     xmlChar * nameSpace; /* the URI of the namespace */
20375     int n_nameSpace;
20376 
20377     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20378     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20379     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20380         mem_base = xmlMemBlocks();
20381         node = gen_xmlNodePtr(n_node, 0);
20382         name = gen_const_xmlChar_ptr(n_name, 1);
20383         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20384 
20385         ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20386         desret_xmlChar_ptr(ret_val);
20387         call_tests++;
20388         des_xmlNodePtr(n_node, node, 0);
20389         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20390         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20391         xmlResetLastError();
20392         if (mem_base != xmlMemBlocks()) {
20393             printf("Leak of %d blocks found in xmlGetNsProp",
20394 	           xmlMemBlocks() - mem_base);
20395 	    test_ret++;
20396             printf(" %d", n_node);
20397             printf(" %d", n_name);
20398             printf(" %d", n_nameSpace);
20399             printf("\n");
20400         }
20401     }
20402     }
20403     }
20404     function_tests++;
20405 
20406     return(test_ret);
20407 }
20408 
20409 
20410 static int
test_xmlGetProp(void)20411 test_xmlGetProp(void) {
20412     int test_ret = 0;
20413 
20414     int mem_base;
20415     xmlChar * ret_val;
20416     xmlNodePtr node; /* the node */
20417     int n_node;
20418     xmlChar * name; /* the attribute name */
20419     int n_name;
20420 
20421     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20422     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20423         mem_base = xmlMemBlocks();
20424         node = gen_xmlNodePtr(n_node, 0);
20425         name = gen_const_xmlChar_ptr(n_name, 1);
20426 
20427         ret_val = xmlGetProp(node, (const xmlChar *)name);
20428         desret_xmlChar_ptr(ret_val);
20429         call_tests++;
20430         des_xmlNodePtr(n_node, node, 0);
20431         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20432         xmlResetLastError();
20433         if (mem_base != xmlMemBlocks()) {
20434             printf("Leak of %d blocks found in xmlGetProp",
20435 	           xmlMemBlocks() - mem_base);
20436 	    test_ret++;
20437             printf(" %d", n_node);
20438             printf(" %d", n_name);
20439             printf("\n");
20440         }
20441     }
20442     }
20443     function_tests++;
20444 
20445     return(test_ret);
20446 }
20447 
20448 
20449 static int
test_xmlHasNsProp(void)20450 test_xmlHasNsProp(void) {
20451     int test_ret = 0;
20452 
20453     int mem_base;
20454     xmlAttrPtr ret_val;
20455     xmlNodePtr node; /* the node */
20456     int n_node;
20457     xmlChar * name; /* the attribute name */
20458     int n_name;
20459     xmlChar * nameSpace; /* the URI of the namespace */
20460     int n_nameSpace;
20461 
20462     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20463     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20464     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20465         mem_base = xmlMemBlocks();
20466         node = gen_xmlNodePtr(n_node, 0);
20467         name = gen_const_xmlChar_ptr(n_name, 1);
20468         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20469 
20470         ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20471         desret_xmlAttrPtr(ret_val);
20472         call_tests++;
20473         des_xmlNodePtr(n_node, node, 0);
20474         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20475         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20476         xmlResetLastError();
20477         if (mem_base != xmlMemBlocks()) {
20478             printf("Leak of %d blocks found in xmlHasNsProp",
20479 	           xmlMemBlocks() - mem_base);
20480 	    test_ret++;
20481             printf(" %d", n_node);
20482             printf(" %d", n_name);
20483             printf(" %d", n_nameSpace);
20484             printf("\n");
20485         }
20486     }
20487     }
20488     }
20489     function_tests++;
20490 
20491     return(test_ret);
20492 }
20493 
20494 
20495 static int
test_xmlHasProp(void)20496 test_xmlHasProp(void) {
20497     int test_ret = 0;
20498 
20499     int mem_base;
20500     xmlAttrPtr ret_val;
20501     xmlNodePtr node; /* the node */
20502     int n_node;
20503     xmlChar * name; /* the attribute name */
20504     int n_name;
20505 
20506     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20507     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20508         mem_base = xmlMemBlocks();
20509         node = gen_xmlNodePtr(n_node, 0);
20510         name = gen_const_xmlChar_ptr(n_name, 1);
20511 
20512         ret_val = xmlHasProp(node, (const xmlChar *)name);
20513         desret_xmlAttrPtr(ret_val);
20514         call_tests++;
20515         des_xmlNodePtr(n_node, node, 0);
20516         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20517         xmlResetLastError();
20518         if (mem_base != xmlMemBlocks()) {
20519             printf("Leak of %d blocks found in xmlHasProp",
20520 	           xmlMemBlocks() - mem_base);
20521 	    test_ret++;
20522             printf(" %d", n_node);
20523             printf(" %d", n_name);
20524             printf("\n");
20525         }
20526     }
20527     }
20528     function_tests++;
20529 
20530     return(test_ret);
20531 }
20532 
20533 
20534 static int
test_xmlIsBlankNode(void)20535 test_xmlIsBlankNode(void) {
20536     int test_ret = 0;
20537 
20538     int mem_base;
20539     int ret_val;
20540     xmlNodePtr node; /* the node */
20541     int n_node;
20542 
20543     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20544         mem_base = xmlMemBlocks();
20545         node = gen_xmlNodePtr(n_node, 0);
20546 
20547         ret_val = xmlIsBlankNode(node);
20548         desret_int(ret_val);
20549         call_tests++;
20550         des_xmlNodePtr(n_node, node, 0);
20551         xmlResetLastError();
20552         if (mem_base != xmlMemBlocks()) {
20553             printf("Leak of %d blocks found in xmlIsBlankNode",
20554 	           xmlMemBlocks() - mem_base);
20555 	    test_ret++;
20556             printf(" %d", n_node);
20557             printf("\n");
20558         }
20559     }
20560     function_tests++;
20561 
20562     return(test_ret);
20563 }
20564 
20565 
20566 static int
test_xmlIsXHTML(void)20567 test_xmlIsXHTML(void) {
20568     int test_ret = 0;
20569 
20570     int mem_base;
20571     int ret_val;
20572     xmlChar * systemID; /* the system identifier */
20573     int n_systemID;
20574     xmlChar * publicID; /* the public identifier */
20575     int n_publicID;
20576 
20577     for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20578     for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20579         mem_base = xmlMemBlocks();
20580         systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20581         publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20582 
20583         ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20584         desret_int(ret_val);
20585         call_tests++;
20586         des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20587         des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20588         xmlResetLastError();
20589         if (mem_base != xmlMemBlocks()) {
20590             printf("Leak of %d blocks found in xmlIsXHTML",
20591 	           xmlMemBlocks() - mem_base);
20592 	    test_ret++;
20593             printf(" %d", n_systemID);
20594             printf(" %d", n_publicID);
20595             printf("\n");
20596         }
20597     }
20598     }
20599     function_tests++;
20600 
20601     return(test_ret);
20602 }
20603 
20604 
20605 static int
test_xmlNewCDataBlock(void)20606 test_xmlNewCDataBlock(void) {
20607     int test_ret = 0;
20608 
20609     int mem_base;
20610     xmlNodePtr ret_val;
20611     xmlDocPtr doc; /* the document */
20612     int n_doc;
20613     xmlChar * content; /* the CDATA block content content */
20614     int n_content;
20615     int len; /* the length of the block */
20616     int n_len;
20617 
20618     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20619     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20620     for (n_len = 0;n_len < gen_nb_int;n_len++) {
20621         mem_base = xmlMemBlocks();
20622         doc = gen_xmlDocPtr(n_doc, 0);
20623         content = gen_const_xmlChar_ptr(n_content, 1);
20624         len = gen_int(n_len, 2);
20625 
20626         ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20627         desret_xmlNodePtr(ret_val);
20628         call_tests++;
20629         des_xmlDocPtr(n_doc, doc, 0);
20630         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20631         des_int(n_len, len, 2);
20632         xmlResetLastError();
20633         if (mem_base != xmlMemBlocks()) {
20634             printf("Leak of %d blocks found in xmlNewCDataBlock",
20635 	           xmlMemBlocks() - mem_base);
20636 	    test_ret++;
20637             printf(" %d", n_doc);
20638             printf(" %d", n_content);
20639             printf(" %d", n_len);
20640             printf("\n");
20641         }
20642     }
20643     }
20644     }
20645     function_tests++;
20646 
20647     return(test_ret);
20648 }
20649 
20650 
20651 static int
test_xmlNewCharRef(void)20652 test_xmlNewCharRef(void) {
20653     int test_ret = 0;
20654 
20655     int mem_base;
20656     xmlNodePtr ret_val;
20657     xmlDocPtr doc; /* the document */
20658     int n_doc;
20659     xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20660     int n_name;
20661 
20662     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20663     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20664         mem_base = xmlMemBlocks();
20665         doc = gen_xmlDocPtr(n_doc, 0);
20666         name = gen_const_xmlChar_ptr(n_name, 1);
20667 
20668         ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20669         desret_xmlNodePtr(ret_val);
20670         call_tests++;
20671         des_xmlDocPtr(n_doc, doc, 0);
20672         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20673         xmlResetLastError();
20674         if (mem_base != xmlMemBlocks()) {
20675             printf("Leak of %d blocks found in xmlNewCharRef",
20676 	           xmlMemBlocks() - mem_base);
20677 	    test_ret++;
20678             printf(" %d", n_doc);
20679             printf(" %d", n_name);
20680             printf("\n");
20681         }
20682     }
20683     }
20684     function_tests++;
20685 
20686     return(test_ret);
20687 }
20688 
20689 
20690 static int
test_xmlNewChild(void)20691 test_xmlNewChild(void) {
20692     int test_ret = 0;
20693 
20694 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20695 #ifdef LIBXML_TREE_ENABLED
20696     int mem_base;
20697     xmlNodePtr ret_val;
20698     xmlNodePtr parent; /* the parent node */
20699     int n_parent;
20700     xmlNsPtr ns; /* a namespace if any */
20701     int n_ns;
20702     xmlChar * name; /* the name of the child */
20703     int n_name;
20704     xmlChar * content; /* the XML content of the child if any. */
20705     int n_content;
20706 
20707     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20708     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20709     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20710     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20711         mem_base = xmlMemBlocks();
20712         parent = gen_xmlNodePtr(n_parent, 0);
20713         ns = gen_xmlNsPtr(n_ns, 1);
20714         name = gen_const_xmlChar_ptr(n_name, 2);
20715         content = gen_const_xmlChar_ptr(n_content, 3);
20716 
20717         ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20718         desret_xmlNodePtr(ret_val);
20719         call_tests++;
20720         des_xmlNodePtr(n_parent, parent, 0);
20721         des_xmlNsPtr(n_ns, ns, 1);
20722         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20723         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20724         xmlResetLastError();
20725         if (mem_base != xmlMemBlocks()) {
20726             printf("Leak of %d blocks found in xmlNewChild",
20727 	           xmlMemBlocks() - mem_base);
20728 	    test_ret++;
20729             printf(" %d", n_parent);
20730             printf(" %d", n_ns);
20731             printf(" %d", n_name);
20732             printf(" %d", n_content);
20733             printf("\n");
20734         }
20735     }
20736     }
20737     }
20738     }
20739     function_tests++;
20740 #endif
20741 #endif
20742 
20743     return(test_ret);
20744 }
20745 
20746 
20747 static int
test_xmlNewComment(void)20748 test_xmlNewComment(void) {
20749     int test_ret = 0;
20750 
20751     int mem_base;
20752     xmlNodePtr ret_val;
20753     xmlChar * content; /* the comment content */
20754     int n_content;
20755 
20756     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20757         mem_base = xmlMemBlocks();
20758         content = gen_const_xmlChar_ptr(n_content, 0);
20759 
20760         ret_val = xmlNewComment((const xmlChar *)content);
20761         desret_xmlNodePtr(ret_val);
20762         call_tests++;
20763         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20764         xmlResetLastError();
20765         if (mem_base != xmlMemBlocks()) {
20766             printf("Leak of %d blocks found in xmlNewComment",
20767 	           xmlMemBlocks() - mem_base);
20768 	    test_ret++;
20769             printf(" %d", n_content);
20770             printf("\n");
20771         }
20772     }
20773     function_tests++;
20774 
20775     return(test_ret);
20776 }
20777 
20778 
20779 static int
test_xmlNewDoc(void)20780 test_xmlNewDoc(void) {
20781     int test_ret = 0;
20782 
20783     int mem_base;
20784     xmlDocPtr ret_val;
20785     xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20786     int n_version;
20787 
20788     for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20789         mem_base = xmlMemBlocks();
20790         version = gen_const_xmlChar_ptr(n_version, 0);
20791 
20792         ret_val = xmlNewDoc((const xmlChar *)version);
20793         desret_xmlDocPtr(ret_val);
20794         call_tests++;
20795         des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20796         xmlResetLastError();
20797         if (mem_base != xmlMemBlocks()) {
20798             printf("Leak of %d blocks found in xmlNewDoc",
20799 	           xmlMemBlocks() - mem_base);
20800 	    test_ret++;
20801             printf(" %d", n_version);
20802             printf("\n");
20803         }
20804     }
20805     function_tests++;
20806 
20807     return(test_ret);
20808 }
20809 
20810 
20811 static int
test_xmlNewDocComment(void)20812 test_xmlNewDocComment(void) {
20813     int test_ret = 0;
20814 
20815     int mem_base;
20816     xmlNodePtr ret_val;
20817     xmlDocPtr doc; /* the document */
20818     int n_doc;
20819     xmlChar * content; /* the comment content */
20820     int n_content;
20821 
20822     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20823     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20824         mem_base = xmlMemBlocks();
20825         doc = gen_xmlDocPtr(n_doc, 0);
20826         content = gen_const_xmlChar_ptr(n_content, 1);
20827 
20828         ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20829         desret_xmlNodePtr(ret_val);
20830         call_tests++;
20831         des_xmlDocPtr(n_doc, doc, 0);
20832         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20833         xmlResetLastError();
20834         if (mem_base != xmlMemBlocks()) {
20835             printf("Leak of %d blocks found in xmlNewDocComment",
20836 	           xmlMemBlocks() - mem_base);
20837 	    test_ret++;
20838             printf(" %d", n_doc);
20839             printf(" %d", n_content);
20840             printf("\n");
20841         }
20842     }
20843     }
20844     function_tests++;
20845 
20846     return(test_ret);
20847 }
20848 
20849 
20850 static int
test_xmlNewDocFragment(void)20851 test_xmlNewDocFragment(void) {
20852     int test_ret = 0;
20853 
20854 #if defined(LIBXML_TREE_ENABLED)
20855     int mem_base;
20856     xmlNodePtr ret_val;
20857     xmlDocPtr doc; /* the document owning the fragment */
20858     int n_doc;
20859 
20860     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20861         mem_base = xmlMemBlocks();
20862         doc = gen_xmlDocPtr(n_doc, 0);
20863 
20864         ret_val = xmlNewDocFragment(doc);
20865         desret_xmlNodePtr(ret_val);
20866         call_tests++;
20867         des_xmlDocPtr(n_doc, doc, 0);
20868         xmlResetLastError();
20869         if (mem_base != xmlMemBlocks()) {
20870             printf("Leak of %d blocks found in xmlNewDocFragment",
20871 	           xmlMemBlocks() - mem_base);
20872 	    test_ret++;
20873             printf(" %d", n_doc);
20874             printf("\n");
20875         }
20876     }
20877     function_tests++;
20878 #endif
20879 
20880     return(test_ret);
20881 }
20882 
20883 
20884 static int
test_xmlNewDocNode(void)20885 test_xmlNewDocNode(void) {
20886     int test_ret = 0;
20887 
20888     int mem_base;
20889     xmlNodePtr ret_val;
20890     xmlDocPtr doc; /* the document */
20891     int n_doc;
20892     xmlNsPtr ns; /* namespace if any */
20893     int n_ns;
20894     xmlChar * name; /* the node name */
20895     int n_name;
20896     xmlChar * content; /* the XML text content if any */
20897     int n_content;
20898 
20899     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20900     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20901     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20902     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20903         mem_base = xmlMemBlocks();
20904         doc = gen_xmlDocPtr(n_doc, 0);
20905         ns = gen_xmlNsPtr(n_ns, 1);
20906         name = gen_const_xmlChar_ptr(n_name, 2);
20907         content = gen_const_xmlChar_ptr(n_content, 3);
20908 
20909         ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20910         desret_xmlNodePtr(ret_val);
20911         call_tests++;
20912         des_xmlDocPtr(n_doc, doc, 0);
20913         des_xmlNsPtr(n_ns, ns, 1);
20914         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20915         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20916         xmlResetLastError();
20917         if (mem_base != xmlMemBlocks()) {
20918             printf("Leak of %d blocks found in xmlNewDocNode",
20919 	           xmlMemBlocks() - mem_base);
20920 	    test_ret++;
20921             printf(" %d", n_doc);
20922             printf(" %d", n_ns);
20923             printf(" %d", n_name);
20924             printf(" %d", n_content);
20925             printf("\n");
20926         }
20927     }
20928     }
20929     }
20930     }
20931     function_tests++;
20932 
20933     return(test_ret);
20934 }
20935 
20936 
20937 static int
test_xmlNewDocNodeEatName(void)20938 test_xmlNewDocNodeEatName(void) {
20939     int test_ret = 0;
20940 
20941     int mem_base;
20942     xmlNodePtr ret_val;
20943     xmlDocPtr doc; /* the document */
20944     int n_doc;
20945     xmlNsPtr ns; /* namespace if any */
20946     int n_ns;
20947     xmlChar * name; /* the node name */
20948     int n_name;
20949     xmlChar * content; /* the XML text content if any */
20950     int n_content;
20951 
20952     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20953     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20954     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
20955     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20956         mem_base = xmlMemBlocks();
20957         doc = gen_xmlDocPtr(n_doc, 0);
20958         ns = gen_xmlNsPtr(n_ns, 1);
20959         name = gen_eaten_name(n_name, 2);
20960         content = gen_const_xmlChar_ptr(n_content, 3);
20961 
20962         ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
20963         desret_xmlNodePtr(ret_val);
20964         call_tests++;
20965         des_xmlDocPtr(n_doc, doc, 0);
20966         des_xmlNsPtr(n_ns, ns, 1);
20967         des_eaten_name(n_name, name, 2);
20968         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20969         xmlResetLastError();
20970         if (mem_base != xmlMemBlocks()) {
20971             printf("Leak of %d blocks found in xmlNewDocNodeEatName",
20972 	           xmlMemBlocks() - mem_base);
20973 	    test_ret++;
20974             printf(" %d", n_doc);
20975             printf(" %d", n_ns);
20976             printf(" %d", n_name);
20977             printf(" %d", n_content);
20978             printf("\n");
20979         }
20980     }
20981     }
20982     }
20983     }
20984     function_tests++;
20985 
20986     return(test_ret);
20987 }
20988 
20989 
20990 static int
test_xmlNewDocPI(void)20991 test_xmlNewDocPI(void) {
20992     int test_ret = 0;
20993 
20994     int mem_base;
20995     xmlNodePtr ret_val;
20996     xmlDocPtr doc; /* the target document */
20997     int n_doc;
20998     xmlChar * name; /* the processing instruction name */
20999     int n_name;
21000     xmlChar * content; /* the PI content */
21001     int n_content;
21002 
21003     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21004     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21005     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21006         mem_base = xmlMemBlocks();
21007         doc = gen_xmlDocPtr(n_doc, 0);
21008         name = gen_const_xmlChar_ptr(n_name, 1);
21009         content = gen_const_xmlChar_ptr(n_content, 2);
21010 
21011         ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21012         desret_xmlNodePtr(ret_val);
21013         call_tests++;
21014         des_xmlDocPtr(n_doc, doc, 0);
21015         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21016         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21017         xmlResetLastError();
21018         if (mem_base != xmlMemBlocks()) {
21019             printf("Leak of %d blocks found in xmlNewDocPI",
21020 	           xmlMemBlocks() - mem_base);
21021 	    test_ret++;
21022             printf(" %d", n_doc);
21023             printf(" %d", n_name);
21024             printf(" %d", n_content);
21025             printf("\n");
21026         }
21027     }
21028     }
21029     }
21030     function_tests++;
21031 
21032     return(test_ret);
21033 }
21034 
21035 
21036 static int
test_xmlNewDocProp(void)21037 test_xmlNewDocProp(void) {
21038     int test_ret = 0;
21039 
21040     int mem_base;
21041     xmlAttrPtr ret_val;
21042     xmlDocPtr doc; /* the document */
21043     int n_doc;
21044     xmlChar * name; /* the name of the attribute */
21045     int n_name;
21046     xmlChar * value; /* the value of the attribute */
21047     int n_value;
21048 
21049     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21050     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21051     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21052         mem_base = xmlMemBlocks();
21053         doc = gen_xmlDocPtr(n_doc, 0);
21054         name = gen_const_xmlChar_ptr(n_name, 1);
21055         value = gen_const_xmlChar_ptr(n_value, 2);
21056 
21057         ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21058         desret_xmlAttrPtr(ret_val);
21059         call_tests++;
21060         des_xmlDocPtr(n_doc, doc, 0);
21061         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21062         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21063         xmlResetLastError();
21064         if (mem_base != xmlMemBlocks()) {
21065             printf("Leak of %d blocks found in xmlNewDocProp",
21066 	           xmlMemBlocks() - mem_base);
21067 	    test_ret++;
21068             printf(" %d", n_doc);
21069             printf(" %d", n_name);
21070             printf(" %d", n_value);
21071             printf("\n");
21072         }
21073     }
21074     }
21075     }
21076     function_tests++;
21077 
21078     return(test_ret);
21079 }
21080 
21081 
21082 static int
test_xmlNewDocRawNode(void)21083 test_xmlNewDocRawNode(void) {
21084     int test_ret = 0;
21085 
21086 #if defined(LIBXML_TREE_ENABLED)
21087 #ifdef LIBXML_TREE_ENABLED
21088     int mem_base;
21089     xmlNodePtr ret_val;
21090     xmlDocPtr doc; /* the document */
21091     int n_doc;
21092     xmlNsPtr ns; /* namespace if any */
21093     int n_ns;
21094     xmlChar * name; /* the node name */
21095     int n_name;
21096     xmlChar * content; /* the text content if any */
21097     int n_content;
21098 
21099     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21100     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21101     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21102     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21103         mem_base = xmlMemBlocks();
21104         doc = gen_xmlDocPtr(n_doc, 0);
21105         ns = gen_xmlNsPtr(n_ns, 1);
21106         name = gen_const_xmlChar_ptr(n_name, 2);
21107         content = gen_const_xmlChar_ptr(n_content, 3);
21108 
21109         ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21110         desret_xmlNodePtr(ret_val);
21111         call_tests++;
21112         des_xmlDocPtr(n_doc, doc, 0);
21113         des_xmlNsPtr(n_ns, ns, 1);
21114         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21115         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21116         xmlResetLastError();
21117         if (mem_base != xmlMemBlocks()) {
21118             printf("Leak of %d blocks found in xmlNewDocRawNode",
21119 	           xmlMemBlocks() - mem_base);
21120 	    test_ret++;
21121             printf(" %d", n_doc);
21122             printf(" %d", n_ns);
21123             printf(" %d", n_name);
21124             printf(" %d", n_content);
21125             printf("\n");
21126         }
21127     }
21128     }
21129     }
21130     }
21131     function_tests++;
21132 #endif
21133 #endif
21134 
21135     return(test_ret);
21136 }
21137 
21138 
21139 static int
test_xmlNewDocText(void)21140 test_xmlNewDocText(void) {
21141     int test_ret = 0;
21142 
21143     int mem_base;
21144     xmlNodePtr ret_val;
21145     xmlDocPtr doc; /* the document */
21146     int n_doc;
21147     xmlChar * content; /* the text content */
21148     int n_content;
21149 
21150     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21151     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21152         mem_base = xmlMemBlocks();
21153         doc = gen_xmlDocPtr(n_doc, 0);
21154         content = gen_const_xmlChar_ptr(n_content, 1);
21155 
21156         ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21157         desret_xmlNodePtr(ret_val);
21158         call_tests++;
21159         des_xmlDocPtr(n_doc, doc, 0);
21160         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21161         xmlResetLastError();
21162         if (mem_base != xmlMemBlocks()) {
21163             printf("Leak of %d blocks found in xmlNewDocText",
21164 	           xmlMemBlocks() - mem_base);
21165 	    test_ret++;
21166             printf(" %d", n_doc);
21167             printf(" %d", n_content);
21168             printf("\n");
21169         }
21170     }
21171     }
21172     function_tests++;
21173 
21174     return(test_ret);
21175 }
21176 
21177 
21178 static int
test_xmlNewDocTextLen(void)21179 test_xmlNewDocTextLen(void) {
21180     int test_ret = 0;
21181 
21182     int mem_base;
21183     xmlNodePtr ret_val;
21184     xmlDocPtr doc; /* the document */
21185     int n_doc;
21186     xmlChar * content; /* the text content */
21187     int n_content;
21188     int len; /* the text len. */
21189     int n_len;
21190 
21191     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21192     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21193     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21194         mem_base = xmlMemBlocks();
21195         doc = gen_xmlDocPtr(n_doc, 0);
21196         content = gen_const_xmlChar_ptr(n_content, 1);
21197         len = gen_int(n_len, 2);
21198 
21199         ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21200         desret_xmlNodePtr(ret_val);
21201         call_tests++;
21202         des_xmlDocPtr(n_doc, doc, 0);
21203         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21204         des_int(n_len, len, 2);
21205         xmlResetLastError();
21206         if (mem_base != xmlMemBlocks()) {
21207             printf("Leak of %d blocks found in xmlNewDocTextLen",
21208 	           xmlMemBlocks() - mem_base);
21209 	    test_ret++;
21210             printf(" %d", n_doc);
21211             printf(" %d", n_content);
21212             printf(" %d", n_len);
21213             printf("\n");
21214         }
21215     }
21216     }
21217     }
21218     function_tests++;
21219 
21220     return(test_ret);
21221 }
21222 
21223 
21224 static int
test_xmlNewDtd(void)21225 test_xmlNewDtd(void) {
21226     int test_ret = 0;
21227 
21228     int mem_base;
21229     xmlDtdPtr ret_val;
21230     xmlDocPtr doc; /* the document pointer */
21231     int n_doc;
21232     xmlChar * name; /* the DTD name */
21233     int n_name;
21234     xmlChar * ExternalID; /* the external ID */
21235     int n_ExternalID;
21236     xmlChar * SystemID; /* the system ID */
21237     int n_SystemID;
21238 
21239     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21240     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21241     for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21242     for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21243         mem_base = xmlMemBlocks();
21244         doc = gen_xmlDocPtr(n_doc, 0);
21245         name = gen_const_xmlChar_ptr(n_name, 1);
21246         ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21247         SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21248 
21249         ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21250         desret_xmlDtdPtr(ret_val);
21251         call_tests++;
21252         des_xmlDocPtr(n_doc, doc, 0);
21253         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21254         des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21255         des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21256         xmlResetLastError();
21257         if (mem_base != xmlMemBlocks()) {
21258             printf("Leak of %d blocks found in xmlNewDtd",
21259 	           xmlMemBlocks() - mem_base);
21260 	    test_ret++;
21261             printf(" %d", n_doc);
21262             printf(" %d", n_name);
21263             printf(" %d", n_ExternalID);
21264             printf(" %d", n_SystemID);
21265             printf("\n");
21266         }
21267     }
21268     }
21269     }
21270     }
21271     function_tests++;
21272 
21273     return(test_ret);
21274 }
21275 
21276 
21277 static int
test_xmlNewNode(void)21278 test_xmlNewNode(void) {
21279     int test_ret = 0;
21280 
21281     int mem_base;
21282     xmlNodePtr ret_val;
21283     xmlNsPtr ns; /* namespace if any */
21284     int n_ns;
21285     xmlChar * name; /* the node name */
21286     int n_name;
21287 
21288     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21289     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21290         mem_base = xmlMemBlocks();
21291         ns = gen_xmlNsPtr(n_ns, 0);
21292         name = gen_const_xmlChar_ptr(n_name, 1);
21293 
21294         ret_val = xmlNewNode(ns, (const xmlChar *)name);
21295         desret_xmlNodePtr(ret_val);
21296         call_tests++;
21297         des_xmlNsPtr(n_ns, ns, 0);
21298         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21299         xmlResetLastError();
21300         if (mem_base != xmlMemBlocks()) {
21301             printf("Leak of %d blocks found in xmlNewNode",
21302 	           xmlMemBlocks() - mem_base);
21303 	    test_ret++;
21304             printf(" %d", n_ns);
21305             printf(" %d", n_name);
21306             printf("\n");
21307         }
21308     }
21309     }
21310     function_tests++;
21311 
21312     return(test_ret);
21313 }
21314 
21315 
21316 static int
test_xmlNewNodeEatName(void)21317 test_xmlNewNodeEatName(void) {
21318     int test_ret = 0;
21319 
21320     int mem_base;
21321     xmlNodePtr ret_val;
21322     xmlNsPtr ns; /* namespace if any */
21323     int n_ns;
21324     xmlChar * name; /* the node name */
21325     int n_name;
21326 
21327     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21328     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21329         mem_base = xmlMemBlocks();
21330         ns = gen_xmlNsPtr(n_ns, 0);
21331         name = gen_eaten_name(n_name, 1);
21332 
21333         ret_val = xmlNewNodeEatName(ns, name);
21334         desret_xmlNodePtr(ret_val);
21335         call_tests++;
21336         des_xmlNsPtr(n_ns, ns, 0);
21337         des_eaten_name(n_name, name, 1);
21338         xmlResetLastError();
21339         if (mem_base != xmlMemBlocks()) {
21340             printf("Leak of %d blocks found in xmlNewNodeEatName",
21341 	           xmlMemBlocks() - mem_base);
21342 	    test_ret++;
21343             printf(" %d", n_ns);
21344             printf(" %d", n_name);
21345             printf("\n");
21346         }
21347     }
21348     }
21349     function_tests++;
21350 
21351     return(test_ret);
21352 }
21353 
21354 
21355 static int
test_xmlNewNs(void)21356 test_xmlNewNs(void) {
21357     int test_ret = 0;
21358 
21359     int mem_base;
21360     xmlNsPtr ret_val;
21361     xmlNodePtr node; /* the element carrying the namespace */
21362     int n_node;
21363     xmlChar * href; /* the URI associated */
21364     int n_href;
21365     xmlChar * prefix; /* the prefix for the namespace */
21366     int n_prefix;
21367 
21368     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21369     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21370     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21371         mem_base = xmlMemBlocks();
21372         node = gen_xmlNodePtr(n_node, 0);
21373         href = gen_const_xmlChar_ptr(n_href, 1);
21374         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21375 
21376         ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21377         if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21378         desret_xmlNsPtr(ret_val);
21379         call_tests++;
21380         des_xmlNodePtr(n_node, node, 0);
21381         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21382         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21383         xmlResetLastError();
21384         if (mem_base != xmlMemBlocks()) {
21385             printf("Leak of %d blocks found in xmlNewNs",
21386 	           xmlMemBlocks() - mem_base);
21387 	    test_ret++;
21388             printf(" %d", n_node);
21389             printf(" %d", n_href);
21390             printf(" %d", n_prefix);
21391             printf("\n");
21392         }
21393     }
21394     }
21395     }
21396     function_tests++;
21397 
21398     return(test_ret);
21399 }
21400 
21401 
21402 static int
test_xmlNewNsProp(void)21403 test_xmlNewNsProp(void) {
21404     int test_ret = 0;
21405 
21406     int mem_base;
21407     xmlAttrPtr ret_val;
21408     xmlNodePtr node; /* the holding node */
21409     int n_node;
21410     xmlNsPtr ns; /* the namespace */
21411     int n_ns;
21412     xmlChar * name; /* the name of the attribute */
21413     int n_name;
21414     xmlChar * value; /* the value of the attribute */
21415     int n_value;
21416 
21417     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21418     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21419     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21420     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21421         mem_base = xmlMemBlocks();
21422         node = gen_xmlNodePtr(n_node, 0);
21423         ns = gen_xmlNsPtr(n_ns, 1);
21424         name = gen_const_xmlChar_ptr(n_name, 2);
21425         value = gen_const_xmlChar_ptr(n_value, 3);
21426 
21427         ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21428         desret_xmlAttrPtr(ret_val);
21429         call_tests++;
21430         des_xmlNodePtr(n_node, node, 0);
21431         des_xmlNsPtr(n_ns, ns, 1);
21432         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21433         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21434         xmlResetLastError();
21435         if (mem_base != xmlMemBlocks()) {
21436             printf("Leak of %d blocks found in xmlNewNsProp",
21437 	           xmlMemBlocks() - mem_base);
21438 	    test_ret++;
21439             printf(" %d", n_node);
21440             printf(" %d", n_ns);
21441             printf(" %d", n_name);
21442             printf(" %d", n_value);
21443             printf("\n");
21444         }
21445     }
21446     }
21447     }
21448     }
21449     function_tests++;
21450 
21451     return(test_ret);
21452 }
21453 
21454 
21455 static int
test_xmlNewNsPropEatName(void)21456 test_xmlNewNsPropEatName(void) {
21457     int test_ret = 0;
21458 
21459     int mem_base;
21460     xmlAttrPtr ret_val;
21461     xmlNodePtr node; /* the holding node */
21462     int n_node;
21463     xmlNsPtr ns; /* the namespace */
21464     int n_ns;
21465     xmlChar * name; /* the name of the attribute */
21466     int n_name;
21467     xmlChar * value; /* the value of the attribute */
21468     int n_value;
21469 
21470     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21471     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21472     for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21473     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21474         mem_base = xmlMemBlocks();
21475         node = gen_xmlNodePtr(n_node, 0);
21476         ns = gen_xmlNsPtr(n_ns, 1);
21477         name = gen_eaten_name(n_name, 2);
21478         value = gen_const_xmlChar_ptr(n_value, 3);
21479 
21480         ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21481         desret_xmlAttrPtr(ret_val);
21482         call_tests++;
21483         des_xmlNodePtr(n_node, node, 0);
21484         des_xmlNsPtr(n_ns, ns, 1);
21485         des_eaten_name(n_name, name, 2);
21486         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21487         xmlResetLastError();
21488         if (mem_base != xmlMemBlocks()) {
21489             printf("Leak of %d blocks found in xmlNewNsPropEatName",
21490 	           xmlMemBlocks() - mem_base);
21491 	    test_ret++;
21492             printf(" %d", n_node);
21493             printf(" %d", n_ns);
21494             printf(" %d", n_name);
21495             printf(" %d", n_value);
21496             printf("\n");
21497         }
21498     }
21499     }
21500     }
21501     }
21502     function_tests++;
21503 
21504     return(test_ret);
21505 }
21506 
21507 
21508 static int
test_xmlNewPI(void)21509 test_xmlNewPI(void) {
21510     int test_ret = 0;
21511 
21512     int mem_base;
21513     xmlNodePtr ret_val;
21514     xmlChar * name; /* the processing instruction name */
21515     int n_name;
21516     xmlChar * content; /* the PI content */
21517     int n_content;
21518 
21519     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21520     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21521         mem_base = xmlMemBlocks();
21522         name = gen_const_xmlChar_ptr(n_name, 0);
21523         content = gen_const_xmlChar_ptr(n_content, 1);
21524 
21525         ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21526         desret_xmlNodePtr(ret_val);
21527         call_tests++;
21528         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21529         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21530         xmlResetLastError();
21531         if (mem_base != xmlMemBlocks()) {
21532             printf("Leak of %d blocks found in xmlNewPI",
21533 	           xmlMemBlocks() - mem_base);
21534 	    test_ret++;
21535             printf(" %d", n_name);
21536             printf(" %d", n_content);
21537             printf("\n");
21538         }
21539     }
21540     }
21541     function_tests++;
21542 
21543     return(test_ret);
21544 }
21545 
21546 
21547 static int
test_xmlNewProp(void)21548 test_xmlNewProp(void) {
21549     int test_ret = 0;
21550 
21551 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21552 #ifdef LIBXML_TREE_ENABLED
21553     int mem_base;
21554     xmlAttrPtr ret_val;
21555     xmlNodePtr node; /* the holding node */
21556     int n_node;
21557     xmlChar * name; /* the name of the attribute */
21558     int n_name;
21559     xmlChar * value; /* the value of the attribute */
21560     int n_value;
21561 
21562     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21563     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21564     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21565         mem_base = xmlMemBlocks();
21566         node = gen_xmlNodePtr(n_node, 0);
21567         name = gen_const_xmlChar_ptr(n_name, 1);
21568         value = gen_const_xmlChar_ptr(n_value, 2);
21569 
21570         ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21571         desret_xmlAttrPtr(ret_val);
21572         call_tests++;
21573         des_xmlNodePtr(n_node, node, 0);
21574         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21575         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21576         xmlResetLastError();
21577         if (mem_base != xmlMemBlocks()) {
21578             printf("Leak of %d blocks found in xmlNewProp",
21579 	           xmlMemBlocks() - mem_base);
21580 	    test_ret++;
21581             printf(" %d", n_node);
21582             printf(" %d", n_name);
21583             printf(" %d", n_value);
21584             printf("\n");
21585         }
21586     }
21587     }
21588     }
21589     function_tests++;
21590 #endif
21591 #endif
21592 
21593     return(test_ret);
21594 }
21595 
21596 
21597 static int
test_xmlNewReference(void)21598 test_xmlNewReference(void) {
21599     int test_ret = 0;
21600 
21601     int mem_base;
21602     xmlNodePtr ret_val;
21603     xmlDocPtr doc; /* the document */
21604     int n_doc;
21605     xmlChar * name; /* the reference name, or the reference string with & and ; */
21606     int n_name;
21607 
21608     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21609     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21610         mem_base = xmlMemBlocks();
21611         doc = gen_xmlDocPtr(n_doc, 0);
21612         name = gen_const_xmlChar_ptr(n_name, 1);
21613 
21614         ret_val = xmlNewReference(doc, (const xmlChar *)name);
21615         desret_xmlNodePtr(ret_val);
21616         call_tests++;
21617         des_xmlDocPtr(n_doc, doc, 0);
21618         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21619         xmlResetLastError();
21620         if (mem_base != xmlMemBlocks()) {
21621             printf("Leak of %d blocks found in xmlNewReference",
21622 	           xmlMemBlocks() - mem_base);
21623 	    test_ret++;
21624             printf(" %d", n_doc);
21625             printf(" %d", n_name);
21626             printf("\n");
21627         }
21628     }
21629     }
21630     function_tests++;
21631 
21632     return(test_ret);
21633 }
21634 
21635 
21636 static int
test_xmlNewText(void)21637 test_xmlNewText(void) {
21638     int test_ret = 0;
21639 
21640     int mem_base;
21641     xmlNodePtr ret_val;
21642     xmlChar * content; /* the text content */
21643     int n_content;
21644 
21645     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21646         mem_base = xmlMemBlocks();
21647         content = gen_const_xmlChar_ptr(n_content, 0);
21648 
21649         ret_val = xmlNewText((const xmlChar *)content);
21650         desret_xmlNodePtr(ret_val);
21651         call_tests++;
21652         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21653         xmlResetLastError();
21654         if (mem_base != xmlMemBlocks()) {
21655             printf("Leak of %d blocks found in xmlNewText",
21656 	           xmlMemBlocks() - mem_base);
21657 	    test_ret++;
21658             printf(" %d", n_content);
21659             printf("\n");
21660         }
21661     }
21662     function_tests++;
21663 
21664     return(test_ret);
21665 }
21666 
21667 
21668 static int
test_xmlNewTextChild(void)21669 test_xmlNewTextChild(void) {
21670     int test_ret = 0;
21671 
21672 #if defined(LIBXML_TREE_ENABLED)
21673 #ifdef LIBXML_TREE_ENABLED
21674     int mem_base;
21675     xmlNodePtr ret_val;
21676     xmlNodePtr parent; /* the parent node */
21677     int n_parent;
21678     xmlNsPtr ns; /* a namespace if any */
21679     int n_ns;
21680     xmlChar * name; /* the name of the child */
21681     int n_name;
21682     xmlChar * content; /* the text content of the child if any. */
21683     int n_content;
21684 
21685     for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21686     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21687     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21688     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21689         mem_base = xmlMemBlocks();
21690         parent = gen_xmlNodePtr(n_parent, 0);
21691         ns = gen_xmlNsPtr(n_ns, 1);
21692         name = gen_const_xmlChar_ptr(n_name, 2);
21693         content = gen_const_xmlChar_ptr(n_content, 3);
21694 
21695         ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21696         desret_xmlNodePtr(ret_val);
21697         call_tests++;
21698         des_xmlNodePtr(n_parent, parent, 0);
21699         des_xmlNsPtr(n_ns, ns, 1);
21700         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21701         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21702         xmlResetLastError();
21703         if (mem_base != xmlMemBlocks()) {
21704             printf("Leak of %d blocks found in xmlNewTextChild",
21705 	           xmlMemBlocks() - mem_base);
21706 	    test_ret++;
21707             printf(" %d", n_parent);
21708             printf(" %d", n_ns);
21709             printf(" %d", n_name);
21710             printf(" %d", n_content);
21711             printf("\n");
21712         }
21713     }
21714     }
21715     }
21716     }
21717     function_tests++;
21718 #endif
21719 #endif
21720 
21721     return(test_ret);
21722 }
21723 
21724 
21725 static int
test_xmlNewTextLen(void)21726 test_xmlNewTextLen(void) {
21727     int test_ret = 0;
21728 
21729     int mem_base;
21730     xmlNodePtr ret_val;
21731     xmlChar * content; /* the text content */
21732     int n_content;
21733     int len; /* the text len. */
21734     int n_len;
21735 
21736     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21737     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21738         mem_base = xmlMemBlocks();
21739         content = gen_const_xmlChar_ptr(n_content, 0);
21740         len = gen_int(n_len, 1);
21741 
21742         ret_val = xmlNewTextLen((const xmlChar *)content, len);
21743         desret_xmlNodePtr(ret_val);
21744         call_tests++;
21745         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21746         des_int(n_len, len, 1);
21747         xmlResetLastError();
21748         if (mem_base != xmlMemBlocks()) {
21749             printf("Leak of %d blocks found in xmlNewTextLen",
21750 	           xmlMemBlocks() - mem_base);
21751 	    test_ret++;
21752             printf(" %d", n_content);
21753             printf(" %d", n_len);
21754             printf("\n");
21755         }
21756     }
21757     }
21758     function_tests++;
21759 
21760     return(test_ret);
21761 }
21762 
21763 
21764 static int
test_xmlNodeAddContent(void)21765 test_xmlNodeAddContent(void) {
21766     int test_ret = 0;
21767 
21768     int mem_base;
21769     xmlNodePtr cur; /* the node being modified */
21770     int n_cur;
21771     xmlChar * content; /* extra content */
21772     int n_content;
21773 
21774     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21775     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21776         mem_base = xmlMemBlocks();
21777         cur = gen_xmlNodePtr(n_cur, 0);
21778         content = gen_const_xmlChar_ptr(n_content, 1);
21779 
21780         xmlNodeAddContent(cur, (const xmlChar *)content);
21781         call_tests++;
21782         des_xmlNodePtr(n_cur, cur, 0);
21783         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21784         xmlResetLastError();
21785         if (mem_base != xmlMemBlocks()) {
21786             printf("Leak of %d blocks found in xmlNodeAddContent",
21787 	           xmlMemBlocks() - mem_base);
21788 	    test_ret++;
21789             printf(" %d", n_cur);
21790             printf(" %d", n_content);
21791             printf("\n");
21792         }
21793     }
21794     }
21795     function_tests++;
21796 
21797     return(test_ret);
21798 }
21799 
21800 
21801 static int
test_xmlNodeAddContentLen(void)21802 test_xmlNodeAddContentLen(void) {
21803     int test_ret = 0;
21804 
21805     int mem_base;
21806     xmlNodePtr cur; /* the node being modified */
21807     int n_cur;
21808     xmlChar * content; /* extra content */
21809     int n_content;
21810     int len; /* the size of @content */
21811     int n_len;
21812 
21813     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21814     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21815     for (n_len = 0;n_len < gen_nb_int;n_len++) {
21816         mem_base = xmlMemBlocks();
21817         cur = gen_xmlNodePtr(n_cur, 0);
21818         content = gen_const_xmlChar_ptr(n_content, 1);
21819         len = gen_int(n_len, 2);
21820 
21821         xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21822         call_tests++;
21823         des_xmlNodePtr(n_cur, cur, 0);
21824         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21825         des_int(n_len, len, 2);
21826         xmlResetLastError();
21827         if (mem_base != xmlMemBlocks()) {
21828             printf("Leak of %d blocks found in xmlNodeAddContentLen",
21829 	           xmlMemBlocks() - mem_base);
21830 	    test_ret++;
21831             printf(" %d", n_cur);
21832             printf(" %d", n_content);
21833             printf(" %d", n_len);
21834             printf("\n");
21835         }
21836     }
21837     }
21838     }
21839     function_tests++;
21840 
21841     return(test_ret);
21842 }
21843 
21844 
21845 static int
test_xmlNodeBufGetContent(void)21846 test_xmlNodeBufGetContent(void) {
21847     int test_ret = 0;
21848 
21849     int mem_base;
21850     int ret_val;
21851     xmlBufferPtr buffer; /* a buffer */
21852     int n_buffer;
21853     xmlNodePtr cur; /* the node being read */
21854     int n_cur;
21855 
21856     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21857     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21858         mem_base = xmlMemBlocks();
21859         buffer = gen_xmlBufferPtr(n_buffer, 0);
21860         cur = gen_xmlNodePtr(n_cur, 1);
21861 
21862         ret_val = xmlNodeBufGetContent(buffer, cur);
21863         desret_int(ret_val);
21864         call_tests++;
21865         des_xmlBufferPtr(n_buffer, buffer, 0);
21866         des_xmlNodePtr(n_cur, cur, 1);
21867         xmlResetLastError();
21868         if (mem_base != xmlMemBlocks()) {
21869             printf("Leak of %d blocks found in xmlNodeBufGetContent",
21870 	           xmlMemBlocks() - mem_base);
21871 	    test_ret++;
21872             printf(" %d", n_buffer);
21873             printf(" %d", n_cur);
21874             printf("\n");
21875         }
21876     }
21877     }
21878     function_tests++;
21879 
21880     return(test_ret);
21881 }
21882 
21883 
21884 static int
test_xmlNodeDump(void)21885 test_xmlNodeDump(void) {
21886     int test_ret = 0;
21887 
21888 #if defined(LIBXML_OUTPUT_ENABLED)
21889     int mem_base;
21890     int ret_val;
21891     xmlBufferPtr buf; /* the XML buffer output */
21892     int n_buf;
21893     xmlDocPtr doc; /* the document */
21894     int n_doc;
21895     xmlNodePtr cur; /* the current node */
21896     int n_cur;
21897     int level; /* the imbrication level for indenting */
21898     int n_level;
21899     int format; /* is formatting allowed */
21900     int n_format;
21901 
21902     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21903     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21904     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21905     for (n_level = 0;n_level < gen_nb_int;n_level++) {
21906     for (n_format = 0;n_format < gen_nb_int;n_format++) {
21907         mem_base = xmlMemBlocks();
21908         buf = gen_xmlBufferPtr(n_buf, 0);
21909         doc = gen_xmlDocPtr(n_doc, 1);
21910         cur = gen_xmlNodePtr(n_cur, 2);
21911         level = gen_int(n_level, 3);
21912         format = gen_int(n_format, 4);
21913 
21914         ret_val = xmlNodeDump(buf, doc, cur, level, format);
21915         desret_int(ret_val);
21916         call_tests++;
21917         des_xmlBufferPtr(n_buf, buf, 0);
21918         des_xmlDocPtr(n_doc, doc, 1);
21919         des_xmlNodePtr(n_cur, cur, 2);
21920         des_int(n_level, level, 3);
21921         des_int(n_format, format, 4);
21922         xmlResetLastError();
21923         if (mem_base != xmlMemBlocks()) {
21924             printf("Leak of %d blocks found in xmlNodeDump",
21925 	           xmlMemBlocks() - mem_base);
21926 	    test_ret++;
21927             printf(" %d", n_buf);
21928             printf(" %d", n_doc);
21929             printf(" %d", n_cur);
21930             printf(" %d", n_level);
21931             printf(" %d", n_format);
21932             printf("\n");
21933         }
21934     }
21935     }
21936     }
21937     }
21938     }
21939     function_tests++;
21940 #endif
21941 
21942     return(test_ret);
21943 }
21944 
21945 
21946 static int
test_xmlNodeDumpOutput(void)21947 test_xmlNodeDumpOutput(void) {
21948     int test_ret = 0;
21949 
21950 #if defined(LIBXML_OUTPUT_ENABLED)
21951     int mem_base;
21952     xmlOutputBufferPtr buf; /* the XML buffer output */
21953     int n_buf;
21954     xmlDocPtr doc; /* the document */
21955     int n_doc;
21956     xmlNodePtr cur; /* the current node */
21957     int n_cur;
21958     int level; /* the imbrication level for indenting */
21959     int n_level;
21960     int format; /* is formatting allowed */
21961     int n_format;
21962     char * encoding; /* an optional encoding string */
21963     int n_encoding;
21964 
21965     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
21966     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21967     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21968     for (n_level = 0;n_level < gen_nb_int;n_level++) {
21969     for (n_format = 0;n_format < gen_nb_int;n_format++) {
21970     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
21971         mem_base = xmlMemBlocks();
21972         buf = gen_xmlOutputBufferPtr(n_buf, 0);
21973         doc = gen_xmlDocPtr(n_doc, 1);
21974         cur = gen_xmlNodePtr(n_cur, 2);
21975         level = gen_int(n_level, 3);
21976         format = gen_int(n_format, 4);
21977         encoding = gen_const_char_ptr(n_encoding, 5);
21978 
21979         xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
21980         call_tests++;
21981         des_xmlOutputBufferPtr(n_buf, buf, 0);
21982         des_xmlDocPtr(n_doc, doc, 1);
21983         des_xmlNodePtr(n_cur, cur, 2);
21984         des_int(n_level, level, 3);
21985         des_int(n_format, format, 4);
21986         des_const_char_ptr(n_encoding, (const char *)encoding, 5);
21987         xmlResetLastError();
21988         if (mem_base != xmlMemBlocks()) {
21989             printf("Leak of %d blocks found in xmlNodeDumpOutput",
21990 	           xmlMemBlocks() - mem_base);
21991 	    test_ret++;
21992             printf(" %d", n_buf);
21993             printf(" %d", n_doc);
21994             printf(" %d", n_cur);
21995             printf(" %d", n_level);
21996             printf(" %d", n_format);
21997             printf(" %d", n_encoding);
21998             printf("\n");
21999         }
22000     }
22001     }
22002     }
22003     }
22004     }
22005     }
22006     function_tests++;
22007 #endif
22008 
22009     return(test_ret);
22010 }
22011 
22012 
22013 static int
test_xmlNodeGetBase(void)22014 test_xmlNodeGetBase(void) {
22015     int test_ret = 0;
22016 
22017     int mem_base;
22018     xmlChar * ret_val;
22019     xmlDocPtr doc; /* the document the node pertains to */
22020     int n_doc;
22021     xmlNodePtr cur; /* the node being checked */
22022     int n_cur;
22023 
22024     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22025     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22026         mem_base = xmlMemBlocks();
22027         doc = gen_xmlDocPtr(n_doc, 0);
22028         cur = gen_xmlNodePtr(n_cur, 1);
22029 
22030         ret_val = xmlNodeGetBase(doc, cur);
22031         desret_xmlChar_ptr(ret_val);
22032         call_tests++;
22033         des_xmlDocPtr(n_doc, doc, 0);
22034         des_xmlNodePtr(n_cur, cur, 1);
22035         xmlResetLastError();
22036         if (mem_base != xmlMemBlocks()) {
22037             printf("Leak of %d blocks found in xmlNodeGetBase",
22038 	           xmlMemBlocks() - mem_base);
22039 	    test_ret++;
22040             printf(" %d", n_doc);
22041             printf(" %d", n_cur);
22042             printf("\n");
22043         }
22044     }
22045     }
22046     function_tests++;
22047 
22048     return(test_ret);
22049 }
22050 
22051 
22052 static int
test_xmlNodeGetContent(void)22053 test_xmlNodeGetContent(void) {
22054     int test_ret = 0;
22055 
22056     int mem_base;
22057     xmlChar * ret_val;
22058     xmlNodePtr cur; /* the node being read */
22059     int n_cur;
22060 
22061     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22062         mem_base = xmlMemBlocks();
22063         cur = gen_xmlNodePtr(n_cur, 0);
22064 
22065         ret_val = xmlNodeGetContent(cur);
22066         desret_xmlChar_ptr(ret_val);
22067         call_tests++;
22068         des_xmlNodePtr(n_cur, cur, 0);
22069         xmlResetLastError();
22070         if (mem_base != xmlMemBlocks()) {
22071             printf("Leak of %d blocks found in xmlNodeGetContent",
22072 	           xmlMemBlocks() - mem_base);
22073 	    test_ret++;
22074             printf(" %d", n_cur);
22075             printf("\n");
22076         }
22077     }
22078     function_tests++;
22079 
22080     return(test_ret);
22081 }
22082 
22083 
22084 static int
test_xmlNodeGetLang(void)22085 test_xmlNodeGetLang(void) {
22086     int test_ret = 0;
22087 
22088     int mem_base;
22089     xmlChar * ret_val;
22090     xmlNodePtr cur; /* the node being checked */
22091     int n_cur;
22092 
22093     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22094         mem_base = xmlMemBlocks();
22095         cur = gen_xmlNodePtr(n_cur, 0);
22096 
22097         ret_val = xmlNodeGetLang(cur);
22098         desret_xmlChar_ptr(ret_val);
22099         call_tests++;
22100         des_xmlNodePtr(n_cur, cur, 0);
22101         xmlResetLastError();
22102         if (mem_base != xmlMemBlocks()) {
22103             printf("Leak of %d blocks found in xmlNodeGetLang",
22104 	           xmlMemBlocks() - mem_base);
22105 	    test_ret++;
22106             printf(" %d", n_cur);
22107             printf("\n");
22108         }
22109     }
22110     function_tests++;
22111 
22112     return(test_ret);
22113 }
22114 
22115 
22116 static int
test_xmlNodeGetSpacePreserve(void)22117 test_xmlNodeGetSpacePreserve(void) {
22118     int test_ret = 0;
22119 
22120     int mem_base;
22121     int ret_val;
22122     xmlNodePtr cur; /* the node being checked */
22123     int n_cur;
22124 
22125     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22126         mem_base = xmlMemBlocks();
22127         cur = gen_xmlNodePtr(n_cur, 0);
22128 
22129         ret_val = xmlNodeGetSpacePreserve(cur);
22130         desret_int(ret_val);
22131         call_tests++;
22132         des_xmlNodePtr(n_cur, cur, 0);
22133         xmlResetLastError();
22134         if (mem_base != xmlMemBlocks()) {
22135             printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22136 	           xmlMemBlocks() - mem_base);
22137 	    test_ret++;
22138             printf(" %d", n_cur);
22139             printf("\n");
22140         }
22141     }
22142     function_tests++;
22143 
22144     return(test_ret);
22145 }
22146 
22147 
22148 static int
test_xmlNodeIsText(void)22149 test_xmlNodeIsText(void) {
22150     int test_ret = 0;
22151 
22152     int mem_base;
22153     int ret_val;
22154     xmlNodePtr node; /* the node */
22155     int n_node;
22156 
22157     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22158         mem_base = xmlMemBlocks();
22159         node = gen_xmlNodePtr(n_node, 0);
22160 
22161         ret_val = xmlNodeIsText(node);
22162         desret_int(ret_val);
22163         call_tests++;
22164         des_xmlNodePtr(n_node, node, 0);
22165         xmlResetLastError();
22166         if (mem_base != xmlMemBlocks()) {
22167             printf("Leak of %d blocks found in xmlNodeIsText",
22168 	           xmlMemBlocks() - mem_base);
22169 	    test_ret++;
22170             printf(" %d", n_node);
22171             printf("\n");
22172         }
22173     }
22174     function_tests++;
22175 
22176     return(test_ret);
22177 }
22178 
22179 
22180 static int
test_xmlNodeListGetRawString(void)22181 test_xmlNodeListGetRawString(void) {
22182     int test_ret = 0;
22183 
22184 #if defined(LIBXML_TREE_ENABLED)
22185     int mem_base;
22186     xmlChar * ret_val;
22187     xmlDocPtr doc; /* the document */
22188     int n_doc;
22189     xmlNodePtr list; /* a Node list */
22190     int n_list;
22191     int inLine; /* should we replace entity contents or show their external form */
22192     int n_inLine;
22193 
22194     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22195     for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22196     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22197         mem_base = xmlMemBlocks();
22198         doc = gen_xmlDocPtr(n_doc, 0);
22199         list = gen_xmlNodePtr(n_list, 1);
22200         inLine = gen_int(n_inLine, 2);
22201 
22202         ret_val = xmlNodeListGetRawString(doc, list, inLine);
22203         desret_xmlChar_ptr(ret_val);
22204         call_tests++;
22205         des_xmlDocPtr(n_doc, doc, 0);
22206         des_xmlNodePtr(n_list, list, 1);
22207         des_int(n_inLine, inLine, 2);
22208         xmlResetLastError();
22209         if (mem_base != xmlMemBlocks()) {
22210             printf("Leak of %d blocks found in xmlNodeListGetRawString",
22211 	           xmlMemBlocks() - mem_base);
22212 	    test_ret++;
22213             printf(" %d", n_doc);
22214             printf(" %d", n_list);
22215             printf(" %d", n_inLine);
22216             printf("\n");
22217         }
22218     }
22219     }
22220     }
22221     function_tests++;
22222 #endif
22223 
22224     return(test_ret);
22225 }
22226 
22227 
22228 static int
test_xmlNodeListGetString(void)22229 test_xmlNodeListGetString(void) {
22230     int test_ret = 0;
22231 
22232     int mem_base;
22233     xmlChar * ret_val;
22234     xmlDocPtr doc; /* the document */
22235     int n_doc;
22236     xmlNodePtr list; /* a Node list */
22237     int n_list;
22238     int inLine; /* should we replace entity contents or show their external form */
22239     int n_inLine;
22240 
22241     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22242     for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22243     for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22244         mem_base = xmlMemBlocks();
22245         doc = gen_xmlDocPtr(n_doc, 0);
22246         list = gen_xmlNodePtr(n_list, 1);
22247         inLine = gen_int(n_inLine, 2);
22248 
22249         ret_val = xmlNodeListGetString(doc, list, inLine);
22250         desret_xmlChar_ptr(ret_val);
22251         call_tests++;
22252         des_xmlDocPtr(n_doc, doc, 0);
22253         des_xmlNodePtr(n_list, list, 1);
22254         des_int(n_inLine, inLine, 2);
22255         xmlResetLastError();
22256         if (mem_base != xmlMemBlocks()) {
22257             printf("Leak of %d blocks found in xmlNodeListGetString",
22258 	           xmlMemBlocks() - mem_base);
22259 	    test_ret++;
22260             printf(" %d", n_doc);
22261             printf(" %d", n_list);
22262             printf(" %d", n_inLine);
22263             printf("\n");
22264         }
22265     }
22266     }
22267     }
22268     function_tests++;
22269 
22270     return(test_ret);
22271 }
22272 
22273 
22274 static int
test_xmlNodeSetBase(void)22275 test_xmlNodeSetBase(void) {
22276     int test_ret = 0;
22277 
22278 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22279     int mem_base;
22280     xmlNodePtr cur; /* the node being changed */
22281     int n_cur;
22282     xmlChar * uri; /* the new base URI */
22283     int n_uri;
22284 
22285     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22286     for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22287         mem_base = xmlMemBlocks();
22288         cur = gen_xmlNodePtr(n_cur, 0);
22289         uri = gen_const_xmlChar_ptr(n_uri, 1);
22290 
22291         xmlNodeSetBase(cur, (const xmlChar *)uri);
22292         call_tests++;
22293         des_xmlNodePtr(n_cur, cur, 0);
22294         des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22295         xmlResetLastError();
22296         if (mem_base != xmlMemBlocks()) {
22297             printf("Leak of %d blocks found in xmlNodeSetBase",
22298 	           xmlMemBlocks() - mem_base);
22299 	    test_ret++;
22300             printf(" %d", n_cur);
22301             printf(" %d", n_uri);
22302             printf("\n");
22303         }
22304     }
22305     }
22306     function_tests++;
22307 #endif
22308 
22309     return(test_ret);
22310 }
22311 
22312 
22313 static int
test_xmlNodeSetContent(void)22314 test_xmlNodeSetContent(void) {
22315     int test_ret = 0;
22316 
22317     int mem_base;
22318     xmlNodePtr cur; /* the node being modified */
22319     int n_cur;
22320     xmlChar * content; /* the new value of the content */
22321     int n_content;
22322 
22323     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22324     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22325         mem_base = xmlMemBlocks();
22326         cur = gen_xmlNodePtr(n_cur, 0);
22327         content = gen_const_xmlChar_ptr(n_content, 1);
22328 
22329         xmlNodeSetContent(cur, (const xmlChar *)content);
22330         call_tests++;
22331         des_xmlNodePtr(n_cur, cur, 0);
22332         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22333         xmlResetLastError();
22334         if (mem_base != xmlMemBlocks()) {
22335             printf("Leak of %d blocks found in xmlNodeSetContent",
22336 	           xmlMemBlocks() - mem_base);
22337 	    test_ret++;
22338             printf(" %d", n_cur);
22339             printf(" %d", n_content);
22340             printf("\n");
22341         }
22342     }
22343     }
22344     function_tests++;
22345 
22346     return(test_ret);
22347 }
22348 
22349 
22350 static int
test_xmlNodeSetContentLen(void)22351 test_xmlNodeSetContentLen(void) {
22352     int test_ret = 0;
22353 
22354 #if defined(LIBXML_TREE_ENABLED)
22355     int mem_base;
22356     xmlNodePtr cur; /* the node being modified */
22357     int n_cur;
22358     xmlChar * content; /* the new value of the content */
22359     int n_content;
22360     int len; /* the size of @content */
22361     int n_len;
22362 
22363     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22364     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22365     for (n_len = 0;n_len < gen_nb_int;n_len++) {
22366         mem_base = xmlMemBlocks();
22367         cur = gen_xmlNodePtr(n_cur, 0);
22368         content = gen_const_xmlChar_ptr(n_content, 1);
22369         len = gen_int(n_len, 2);
22370 
22371         xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22372         call_tests++;
22373         des_xmlNodePtr(n_cur, cur, 0);
22374         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22375         des_int(n_len, len, 2);
22376         xmlResetLastError();
22377         if (mem_base != xmlMemBlocks()) {
22378             printf("Leak of %d blocks found in xmlNodeSetContentLen",
22379 	           xmlMemBlocks() - mem_base);
22380 	    test_ret++;
22381             printf(" %d", n_cur);
22382             printf(" %d", n_content);
22383             printf(" %d", n_len);
22384             printf("\n");
22385         }
22386     }
22387     }
22388     }
22389     function_tests++;
22390 #endif
22391 
22392     return(test_ret);
22393 }
22394 
22395 
22396 static int
test_xmlNodeSetLang(void)22397 test_xmlNodeSetLang(void) {
22398     int test_ret = 0;
22399 
22400 #if defined(LIBXML_TREE_ENABLED)
22401     int mem_base;
22402     xmlNodePtr cur; /* the node being changed */
22403     int n_cur;
22404     xmlChar * lang; /* the language description */
22405     int n_lang;
22406 
22407     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22408     for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22409         mem_base = xmlMemBlocks();
22410         cur = gen_xmlNodePtr(n_cur, 0);
22411         lang = gen_const_xmlChar_ptr(n_lang, 1);
22412 
22413         xmlNodeSetLang(cur, (const xmlChar *)lang);
22414         call_tests++;
22415         des_xmlNodePtr(n_cur, cur, 0);
22416         des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22417         xmlResetLastError();
22418         if (mem_base != xmlMemBlocks()) {
22419             printf("Leak of %d blocks found in xmlNodeSetLang",
22420 	           xmlMemBlocks() - mem_base);
22421 	    test_ret++;
22422             printf(" %d", n_cur);
22423             printf(" %d", n_lang);
22424             printf("\n");
22425         }
22426     }
22427     }
22428     function_tests++;
22429 #endif
22430 
22431     return(test_ret);
22432 }
22433 
22434 
22435 static int
test_xmlNodeSetName(void)22436 test_xmlNodeSetName(void) {
22437     int test_ret = 0;
22438 
22439 #if defined(LIBXML_TREE_ENABLED)
22440     int mem_base;
22441     xmlNodePtr cur; /* the node being changed */
22442     int n_cur;
22443     xmlChar * name; /* the new tag name */
22444     int n_name;
22445 
22446     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22447     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22448         mem_base = xmlMemBlocks();
22449         cur = gen_xmlNodePtr(n_cur, 0);
22450         name = gen_const_xmlChar_ptr(n_name, 1);
22451 
22452         xmlNodeSetName(cur, (const xmlChar *)name);
22453         call_tests++;
22454         des_xmlNodePtr(n_cur, cur, 0);
22455         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22456         xmlResetLastError();
22457         if (mem_base != xmlMemBlocks()) {
22458             printf("Leak of %d blocks found in xmlNodeSetName",
22459 	           xmlMemBlocks() - mem_base);
22460 	    test_ret++;
22461             printf(" %d", n_cur);
22462             printf(" %d", n_name);
22463             printf("\n");
22464         }
22465     }
22466     }
22467     function_tests++;
22468 #endif
22469 
22470     return(test_ret);
22471 }
22472 
22473 
22474 static int
test_xmlNodeSetSpacePreserve(void)22475 test_xmlNodeSetSpacePreserve(void) {
22476     int test_ret = 0;
22477 
22478 #if defined(LIBXML_TREE_ENABLED)
22479     int mem_base;
22480     xmlNodePtr cur; /* the node being changed */
22481     int n_cur;
22482     int val; /* the xml:space value ("0": default, 1: "preserve") */
22483     int n_val;
22484 
22485     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22486     for (n_val = 0;n_val < gen_nb_int;n_val++) {
22487         mem_base = xmlMemBlocks();
22488         cur = gen_xmlNodePtr(n_cur, 0);
22489         val = gen_int(n_val, 1);
22490 
22491         xmlNodeSetSpacePreserve(cur, val);
22492         call_tests++;
22493         des_xmlNodePtr(n_cur, cur, 0);
22494         des_int(n_val, val, 1);
22495         xmlResetLastError();
22496         if (mem_base != xmlMemBlocks()) {
22497             printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22498 	           xmlMemBlocks() - mem_base);
22499 	    test_ret++;
22500             printf(" %d", n_cur);
22501             printf(" %d", n_val);
22502             printf("\n");
22503         }
22504     }
22505     }
22506     function_tests++;
22507 #endif
22508 
22509     return(test_ret);
22510 }
22511 
22512 
22513 static int
test_xmlReconciliateNs(void)22514 test_xmlReconciliateNs(void) {
22515     int test_ret = 0;
22516 
22517 #if defined(LIBXML_TREE_ENABLED)
22518 #ifdef LIBXML_TREE_ENABLED
22519     int mem_base;
22520     int ret_val;
22521     xmlDocPtr doc; /* the document */
22522     int n_doc;
22523     xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22524     int n_tree;
22525 
22526     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22527     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22528         mem_base = xmlMemBlocks();
22529         doc = gen_xmlDocPtr(n_doc, 0);
22530         tree = gen_xmlNodePtr(n_tree, 1);
22531 
22532         ret_val = xmlReconciliateNs(doc, tree);
22533         desret_int(ret_val);
22534         call_tests++;
22535         des_xmlDocPtr(n_doc, doc, 0);
22536         des_xmlNodePtr(n_tree, tree, 1);
22537         xmlResetLastError();
22538         if (mem_base != xmlMemBlocks()) {
22539             printf("Leak of %d blocks found in xmlReconciliateNs",
22540 	           xmlMemBlocks() - mem_base);
22541 	    test_ret++;
22542             printf(" %d", n_doc);
22543             printf(" %d", n_tree);
22544             printf("\n");
22545         }
22546     }
22547     }
22548     function_tests++;
22549 #endif
22550 #endif
22551 
22552     return(test_ret);
22553 }
22554 
22555 
22556 static int
test_xmlRemoveProp(void)22557 test_xmlRemoveProp(void) {
22558     int test_ret = 0;
22559 
22560     int mem_base;
22561     int ret_val;
22562     xmlAttrPtr cur; /* an attribute */
22563     int n_cur;
22564 
22565     for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22566         mem_base = xmlMemBlocks();
22567         cur = gen_xmlAttrPtr(n_cur, 0);
22568 
22569         ret_val = xmlRemoveProp(cur);
22570         cur = NULL;
22571         desret_int(ret_val);
22572         call_tests++;
22573         des_xmlAttrPtr(n_cur, cur, 0);
22574         xmlResetLastError();
22575         if (mem_base != xmlMemBlocks()) {
22576             printf("Leak of %d blocks found in xmlRemoveProp",
22577 	           xmlMemBlocks() - mem_base);
22578 	    test_ret++;
22579             printf(" %d", n_cur);
22580             printf("\n");
22581         }
22582     }
22583     function_tests++;
22584 
22585     return(test_ret);
22586 }
22587 
22588 
22589 static int
test_xmlReplaceNode(void)22590 test_xmlReplaceNode(void) {
22591     int test_ret = 0;
22592 
22593 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22594     int mem_base;
22595     xmlNodePtr ret_val;
22596     xmlNodePtr old; /* the old node */
22597     int n_old;
22598     xmlNodePtr cur; /* the node */
22599     int n_cur;
22600 
22601     for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22602     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22603         mem_base = xmlMemBlocks();
22604         old = gen_xmlNodePtr(n_old, 0);
22605         cur = gen_xmlNodePtr_in(n_cur, 1);
22606 
22607         ret_val = xmlReplaceNode(old, cur);
22608         if (cur != NULL) {
22609               xmlUnlinkNode(cur);
22610               xmlFreeNode(cur) ; cur = NULL ; }
22611           if (old != NULL) {
22612               xmlUnlinkNode(old);
22613               xmlFreeNode(old) ; old = NULL ; }
22614 	  ret_val = NULL;
22615         desret_xmlNodePtr(ret_val);
22616         call_tests++;
22617         des_xmlNodePtr(n_old, old, 0);
22618         des_xmlNodePtr_in(n_cur, cur, 1);
22619         xmlResetLastError();
22620         if (mem_base != xmlMemBlocks()) {
22621             printf("Leak of %d blocks found in xmlReplaceNode",
22622 	           xmlMemBlocks() - mem_base);
22623 	    test_ret++;
22624             printf(" %d", n_old);
22625             printf(" %d", n_cur);
22626             printf("\n");
22627         }
22628     }
22629     }
22630     function_tests++;
22631 #endif
22632 
22633     return(test_ret);
22634 }
22635 
22636 
22637 static int
test_xmlSaveFile(void)22638 test_xmlSaveFile(void) {
22639     int test_ret = 0;
22640 
22641 #if defined(LIBXML_OUTPUT_ENABLED)
22642     int mem_base;
22643     int ret_val;
22644     const char * filename; /* the filename (or URL) */
22645     int n_filename;
22646     xmlDocPtr cur; /* the document */
22647     int n_cur;
22648 
22649     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22650     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22651         mem_base = xmlMemBlocks();
22652         filename = gen_fileoutput(n_filename, 0);
22653         cur = gen_xmlDocPtr(n_cur, 1);
22654 
22655         ret_val = xmlSaveFile(filename, cur);
22656         desret_int(ret_val);
22657         call_tests++;
22658         des_fileoutput(n_filename, filename, 0);
22659         des_xmlDocPtr(n_cur, cur, 1);
22660         xmlResetLastError();
22661         if (mem_base != xmlMemBlocks()) {
22662             printf("Leak of %d blocks found in xmlSaveFile",
22663 	           xmlMemBlocks() - mem_base);
22664 	    test_ret++;
22665             printf(" %d", n_filename);
22666             printf(" %d", n_cur);
22667             printf("\n");
22668         }
22669     }
22670     }
22671     function_tests++;
22672 #endif
22673 
22674     return(test_ret);
22675 }
22676 
22677 
22678 static int
test_xmlSaveFileEnc(void)22679 test_xmlSaveFileEnc(void) {
22680     int test_ret = 0;
22681 
22682 #if defined(LIBXML_OUTPUT_ENABLED)
22683     int mem_base;
22684     int ret_val;
22685     const char * filename; /* the filename (or URL) */
22686     int n_filename;
22687     xmlDocPtr cur; /* the document */
22688     int n_cur;
22689     char * encoding; /* the name of an encoding (or NULL) */
22690     int n_encoding;
22691 
22692     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22693     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22694     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22695         mem_base = xmlMemBlocks();
22696         filename = gen_fileoutput(n_filename, 0);
22697         cur = gen_xmlDocPtr(n_cur, 1);
22698         encoding = gen_const_char_ptr(n_encoding, 2);
22699 
22700         ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22701         desret_int(ret_val);
22702         call_tests++;
22703         des_fileoutput(n_filename, filename, 0);
22704         des_xmlDocPtr(n_cur, cur, 1);
22705         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22706         xmlResetLastError();
22707         if (mem_base != xmlMemBlocks()) {
22708             printf("Leak of %d blocks found in xmlSaveFileEnc",
22709 	           xmlMemBlocks() - mem_base);
22710 	    test_ret++;
22711             printf(" %d", n_filename);
22712             printf(" %d", n_cur);
22713             printf(" %d", n_encoding);
22714             printf("\n");
22715         }
22716     }
22717     }
22718     }
22719     function_tests++;
22720 #endif
22721 
22722     return(test_ret);
22723 }
22724 
22725 
22726 static int
test_xmlSaveFileTo(void)22727 test_xmlSaveFileTo(void) {
22728     int test_ret = 0;
22729 
22730 #if defined(LIBXML_OUTPUT_ENABLED)
22731     int mem_base;
22732     int ret_val;
22733     xmlOutputBufferPtr buf; /* an output I/O buffer */
22734     int n_buf;
22735     xmlDocPtr cur; /* the document */
22736     int n_cur;
22737     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22738     int n_encoding;
22739 
22740     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22741     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22742     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22743         mem_base = xmlMemBlocks();
22744         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22745         cur = gen_xmlDocPtr(n_cur, 1);
22746         encoding = gen_const_char_ptr(n_encoding, 2);
22747 
22748         ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22749         buf = NULL;
22750         desret_int(ret_val);
22751         call_tests++;
22752         des_xmlOutputBufferPtr(n_buf, buf, 0);
22753         des_xmlDocPtr(n_cur, cur, 1);
22754         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22755         xmlResetLastError();
22756         if (mem_base != xmlMemBlocks()) {
22757             printf("Leak of %d blocks found in xmlSaveFileTo",
22758 	           xmlMemBlocks() - mem_base);
22759 	    test_ret++;
22760             printf(" %d", n_buf);
22761             printf(" %d", n_cur);
22762             printf(" %d", n_encoding);
22763             printf("\n");
22764         }
22765     }
22766     }
22767     }
22768     function_tests++;
22769 #endif
22770 
22771     return(test_ret);
22772 }
22773 
22774 
22775 static int
test_xmlSaveFormatFile(void)22776 test_xmlSaveFormatFile(void) {
22777     int test_ret = 0;
22778 
22779 #if defined(LIBXML_OUTPUT_ENABLED)
22780     int mem_base;
22781     int ret_val;
22782     const char * filename; /* the filename (or URL) */
22783     int n_filename;
22784     xmlDocPtr cur; /* the document */
22785     int n_cur;
22786     int format; /* should formatting spaces been added */
22787     int n_format;
22788 
22789     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22790     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22791     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22792         mem_base = xmlMemBlocks();
22793         filename = gen_fileoutput(n_filename, 0);
22794         cur = gen_xmlDocPtr(n_cur, 1);
22795         format = gen_int(n_format, 2);
22796 
22797         ret_val = xmlSaveFormatFile(filename, cur, format);
22798         desret_int(ret_val);
22799         call_tests++;
22800         des_fileoutput(n_filename, filename, 0);
22801         des_xmlDocPtr(n_cur, cur, 1);
22802         des_int(n_format, format, 2);
22803         xmlResetLastError();
22804         if (mem_base != xmlMemBlocks()) {
22805             printf("Leak of %d blocks found in xmlSaveFormatFile",
22806 	           xmlMemBlocks() - mem_base);
22807 	    test_ret++;
22808             printf(" %d", n_filename);
22809             printf(" %d", n_cur);
22810             printf(" %d", n_format);
22811             printf("\n");
22812         }
22813     }
22814     }
22815     }
22816     function_tests++;
22817 #endif
22818 
22819     return(test_ret);
22820 }
22821 
22822 
22823 static int
test_xmlSaveFormatFileEnc(void)22824 test_xmlSaveFormatFileEnc(void) {
22825     int test_ret = 0;
22826 
22827 #if defined(LIBXML_OUTPUT_ENABLED)
22828     int mem_base;
22829     int ret_val;
22830     const char * filename; /* the filename or URL to output */
22831     int n_filename;
22832     xmlDocPtr cur; /* the document being saved */
22833     int n_cur;
22834     char * encoding; /* the name of the encoding to use or NULL. */
22835     int n_encoding;
22836     int format; /* should formatting spaces be added. */
22837     int n_format;
22838 
22839     for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22840     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22841     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22842     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22843         mem_base = xmlMemBlocks();
22844         filename = gen_fileoutput(n_filename, 0);
22845         cur = gen_xmlDocPtr(n_cur, 1);
22846         encoding = gen_const_char_ptr(n_encoding, 2);
22847         format = gen_int(n_format, 3);
22848 
22849         ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22850         desret_int(ret_val);
22851         call_tests++;
22852         des_fileoutput(n_filename, filename, 0);
22853         des_xmlDocPtr(n_cur, cur, 1);
22854         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22855         des_int(n_format, format, 3);
22856         xmlResetLastError();
22857         if (mem_base != xmlMemBlocks()) {
22858             printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22859 	           xmlMemBlocks() - mem_base);
22860 	    test_ret++;
22861             printf(" %d", n_filename);
22862             printf(" %d", n_cur);
22863             printf(" %d", n_encoding);
22864             printf(" %d", n_format);
22865             printf("\n");
22866         }
22867     }
22868     }
22869     }
22870     }
22871     function_tests++;
22872 #endif
22873 
22874     return(test_ret);
22875 }
22876 
22877 
22878 static int
test_xmlSaveFormatFileTo(void)22879 test_xmlSaveFormatFileTo(void) {
22880     int test_ret = 0;
22881 
22882 #if defined(LIBXML_OUTPUT_ENABLED)
22883     int mem_base;
22884     int ret_val;
22885     xmlOutputBufferPtr buf; /* an output I/O buffer */
22886     int n_buf;
22887     xmlDocPtr cur; /* the document */
22888     int n_cur;
22889     char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22890     int n_encoding;
22891     int format; /* should formatting spaces been added */
22892     int n_format;
22893 
22894     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22895     for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22896     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22897     for (n_format = 0;n_format < gen_nb_int;n_format++) {
22898         mem_base = xmlMemBlocks();
22899         buf = gen_xmlOutputBufferPtr(n_buf, 0);
22900         cur = gen_xmlDocPtr(n_cur, 1);
22901         encoding = gen_const_char_ptr(n_encoding, 2);
22902         format = gen_int(n_format, 3);
22903 
22904         ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22905         buf = NULL;
22906         desret_int(ret_val);
22907         call_tests++;
22908         des_xmlOutputBufferPtr(n_buf, buf, 0);
22909         des_xmlDocPtr(n_cur, cur, 1);
22910         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22911         des_int(n_format, format, 3);
22912         xmlResetLastError();
22913         if (mem_base != xmlMemBlocks()) {
22914             printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22915 	           xmlMemBlocks() - mem_base);
22916 	    test_ret++;
22917             printf(" %d", n_buf);
22918             printf(" %d", n_cur);
22919             printf(" %d", n_encoding);
22920             printf(" %d", n_format);
22921             printf("\n");
22922         }
22923     }
22924     }
22925     }
22926     }
22927     function_tests++;
22928 #endif
22929 
22930     return(test_ret);
22931 }
22932 
22933 
22934 static int
test_xmlSearchNs(void)22935 test_xmlSearchNs(void) {
22936     int test_ret = 0;
22937 
22938     int mem_base;
22939     xmlNsPtr ret_val;
22940     xmlDocPtr doc; /* the document */
22941     int n_doc;
22942     xmlNodePtr node; /* the current node */
22943     int n_node;
22944     xmlChar * nameSpace; /* the namespace prefix */
22945     int n_nameSpace;
22946 
22947     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22948     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22949     for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
22950         mem_base = xmlMemBlocks();
22951         doc = gen_xmlDocPtr(n_doc, 0);
22952         node = gen_xmlNodePtr(n_node, 1);
22953         nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
22954 
22955         ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
22956         desret_xmlNsPtr(ret_val);
22957         call_tests++;
22958         des_xmlDocPtr(n_doc, doc, 0);
22959         des_xmlNodePtr(n_node, node, 1);
22960         des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
22961         xmlResetLastError();
22962         if (mem_base != xmlMemBlocks()) {
22963             printf("Leak of %d blocks found in xmlSearchNs",
22964 	           xmlMemBlocks() - mem_base);
22965 	    test_ret++;
22966             printf(" %d", n_doc);
22967             printf(" %d", n_node);
22968             printf(" %d", n_nameSpace);
22969             printf("\n");
22970         }
22971     }
22972     }
22973     }
22974     function_tests++;
22975 
22976     return(test_ret);
22977 }
22978 
22979 
22980 static int
test_xmlSearchNsByHref(void)22981 test_xmlSearchNsByHref(void) {
22982     int test_ret = 0;
22983 
22984     int mem_base;
22985     xmlNsPtr ret_val;
22986     xmlDocPtr doc; /* the document */
22987     int n_doc;
22988     xmlNodePtr node; /* the current node */
22989     int n_node;
22990     xmlChar * href; /* the namespace value */
22991     int n_href;
22992 
22993     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22994     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22995     for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
22996         mem_base = xmlMemBlocks();
22997         doc = gen_xmlDocPtr(n_doc, 0);
22998         node = gen_xmlNodePtr(n_node, 1);
22999         href = gen_const_xmlChar_ptr(n_href, 2);
23000 
23001         ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23002         desret_xmlNsPtr(ret_val);
23003         call_tests++;
23004         des_xmlDocPtr(n_doc, doc, 0);
23005         des_xmlNodePtr(n_node, node, 1);
23006         des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23007         xmlResetLastError();
23008         if (mem_base != xmlMemBlocks()) {
23009             printf("Leak of %d blocks found in xmlSearchNsByHref",
23010 	           xmlMemBlocks() - mem_base);
23011 	    test_ret++;
23012             printf(" %d", n_doc);
23013             printf(" %d", n_node);
23014             printf(" %d", n_href);
23015             printf("\n");
23016         }
23017     }
23018     }
23019     }
23020     function_tests++;
23021 
23022     return(test_ret);
23023 }
23024 
23025 
23026 static int
test_xmlSetBufferAllocationScheme(void)23027 test_xmlSetBufferAllocationScheme(void) {
23028     int test_ret = 0;
23029 
23030     int mem_base;
23031     xmlBufferAllocationScheme scheme; /* allocation method to use */
23032     int n_scheme;
23033 
23034     for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23035         mem_base = xmlMemBlocks();
23036         scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23037 
23038         xmlSetBufferAllocationScheme(scheme);
23039         call_tests++;
23040         des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23041         xmlResetLastError();
23042         if (mem_base != xmlMemBlocks()) {
23043             printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23044 	           xmlMemBlocks() - mem_base);
23045 	    test_ret++;
23046             printf(" %d", n_scheme);
23047             printf("\n");
23048         }
23049     }
23050     function_tests++;
23051 
23052     return(test_ret);
23053 }
23054 
23055 
23056 static int
test_xmlSetCompressMode(void)23057 test_xmlSetCompressMode(void) {
23058     int test_ret = 0;
23059 
23060     int mem_base;
23061     int mode; /* the compression ratio */
23062     int n_mode;
23063 
23064     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23065         mem_base = xmlMemBlocks();
23066         mode = gen_int(n_mode, 0);
23067 
23068         xmlSetCompressMode(mode);
23069         call_tests++;
23070         des_int(n_mode, mode, 0);
23071         xmlResetLastError();
23072         if (mem_base != xmlMemBlocks()) {
23073             printf("Leak of %d blocks found in xmlSetCompressMode",
23074 	           xmlMemBlocks() - mem_base);
23075 	    test_ret++;
23076             printf(" %d", n_mode);
23077             printf("\n");
23078         }
23079     }
23080     function_tests++;
23081 
23082     return(test_ret);
23083 }
23084 
23085 
23086 static int
test_xmlSetDocCompressMode(void)23087 test_xmlSetDocCompressMode(void) {
23088     int test_ret = 0;
23089 
23090     int mem_base;
23091     xmlDocPtr doc; /* the document */
23092     int n_doc;
23093     int mode; /* the compression ratio */
23094     int n_mode;
23095 
23096     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23097     for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23098         mem_base = xmlMemBlocks();
23099         doc = gen_xmlDocPtr(n_doc, 0);
23100         mode = gen_int(n_mode, 1);
23101 
23102         xmlSetDocCompressMode(doc, mode);
23103         call_tests++;
23104         des_xmlDocPtr(n_doc, doc, 0);
23105         des_int(n_mode, mode, 1);
23106         xmlResetLastError();
23107         if (mem_base != xmlMemBlocks()) {
23108             printf("Leak of %d blocks found in xmlSetDocCompressMode",
23109 	           xmlMemBlocks() - mem_base);
23110 	    test_ret++;
23111             printf(" %d", n_doc);
23112             printf(" %d", n_mode);
23113             printf("\n");
23114         }
23115     }
23116     }
23117     function_tests++;
23118 
23119     return(test_ret);
23120 }
23121 
23122 
23123 static int
test_xmlSetNs(void)23124 test_xmlSetNs(void) {
23125     int test_ret = 0;
23126 
23127     int mem_base;
23128     xmlNodePtr node; /* a node in the document */
23129     int n_node;
23130     xmlNsPtr ns; /* a namespace pointer */
23131     int n_ns;
23132 
23133     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23134     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23135         mem_base = xmlMemBlocks();
23136         node = gen_xmlNodePtr(n_node, 0);
23137         ns = gen_xmlNsPtr(n_ns, 1);
23138 
23139         xmlSetNs(node, ns);
23140         call_tests++;
23141         des_xmlNodePtr(n_node, node, 0);
23142         des_xmlNsPtr(n_ns, ns, 1);
23143         xmlResetLastError();
23144         if (mem_base != xmlMemBlocks()) {
23145             printf("Leak of %d blocks found in xmlSetNs",
23146 	           xmlMemBlocks() - mem_base);
23147 	    test_ret++;
23148             printf(" %d", n_node);
23149             printf(" %d", n_ns);
23150             printf("\n");
23151         }
23152     }
23153     }
23154     function_tests++;
23155 
23156     return(test_ret);
23157 }
23158 
23159 
23160 static int
test_xmlSetNsProp(void)23161 test_xmlSetNsProp(void) {
23162     int test_ret = 0;
23163 
23164 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23165     int mem_base;
23166     xmlAttrPtr ret_val;
23167     xmlNodePtr node; /* the node */
23168     int n_node;
23169     xmlNsPtr ns; /* the namespace definition */
23170     int n_ns;
23171     xmlChar * name; /* the attribute name */
23172     int n_name;
23173     xmlChar * value; /* the attribute value */
23174     int n_value;
23175 
23176     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23177     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23178     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23179     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23180         mem_base = xmlMemBlocks();
23181         node = gen_xmlNodePtr(n_node, 0);
23182         ns = gen_xmlNsPtr(n_ns, 1);
23183         name = gen_const_xmlChar_ptr(n_name, 2);
23184         value = gen_const_xmlChar_ptr(n_value, 3);
23185 
23186         ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23187         desret_xmlAttrPtr(ret_val);
23188         call_tests++;
23189         des_xmlNodePtr(n_node, node, 0);
23190         des_xmlNsPtr(n_ns, ns, 1);
23191         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23192         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23193         xmlResetLastError();
23194         if (mem_base != xmlMemBlocks()) {
23195             printf("Leak of %d blocks found in xmlSetNsProp",
23196 	           xmlMemBlocks() - mem_base);
23197 	    test_ret++;
23198             printf(" %d", n_node);
23199             printf(" %d", n_ns);
23200             printf(" %d", n_name);
23201             printf(" %d", n_value);
23202             printf("\n");
23203         }
23204     }
23205     }
23206     }
23207     }
23208     function_tests++;
23209 #endif
23210 
23211     return(test_ret);
23212 }
23213 
23214 
23215 static int
test_xmlSetProp(void)23216 test_xmlSetProp(void) {
23217     int test_ret = 0;
23218 
23219 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23220     int mem_base;
23221     xmlAttrPtr ret_val;
23222     xmlNodePtr node; /* the node */
23223     int n_node;
23224     xmlChar * name; /* the attribute name (a QName) */
23225     int n_name;
23226     xmlChar * value; /* the attribute value */
23227     int n_value;
23228 
23229     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23230     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23231     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23232         mem_base = xmlMemBlocks();
23233         node = gen_xmlNodePtr(n_node, 0);
23234         name = gen_const_xmlChar_ptr(n_name, 1);
23235         value = gen_const_xmlChar_ptr(n_value, 2);
23236 
23237         ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23238         desret_xmlAttrPtr(ret_val);
23239         call_tests++;
23240         des_xmlNodePtr(n_node, node, 0);
23241         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23242         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23243         xmlResetLastError();
23244         if (mem_base != xmlMemBlocks()) {
23245             printf("Leak of %d blocks found in xmlSetProp",
23246 	           xmlMemBlocks() - mem_base);
23247 	    test_ret++;
23248             printf(" %d", n_node);
23249             printf(" %d", n_name);
23250             printf(" %d", n_value);
23251             printf("\n");
23252         }
23253     }
23254     }
23255     }
23256     function_tests++;
23257 #endif
23258 
23259     return(test_ret);
23260 }
23261 
23262 
23263 static int
test_xmlSplitQName2(void)23264 test_xmlSplitQName2(void) {
23265     int test_ret = 0;
23266 
23267     int mem_base;
23268     xmlChar * ret_val;
23269     xmlChar * name; /* the full QName */
23270     int n_name;
23271     xmlChar ** prefix; /* a xmlChar ** */
23272     int n_prefix;
23273 
23274     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23275     for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23276         mem_base = xmlMemBlocks();
23277         name = gen_const_xmlChar_ptr(n_name, 0);
23278         prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23279 
23280         ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23281         desret_xmlChar_ptr(ret_val);
23282         call_tests++;
23283         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23284         des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23285         xmlResetLastError();
23286         if (mem_base != xmlMemBlocks()) {
23287             printf("Leak of %d blocks found in xmlSplitQName2",
23288 	           xmlMemBlocks() - mem_base);
23289 	    test_ret++;
23290             printf(" %d", n_name);
23291             printf(" %d", n_prefix);
23292             printf("\n");
23293         }
23294     }
23295     }
23296     function_tests++;
23297 
23298     return(test_ret);
23299 }
23300 
23301 
23302 static int
test_xmlSplitQName3(void)23303 test_xmlSplitQName3(void) {
23304     int test_ret = 0;
23305 
23306     int mem_base;
23307     const xmlChar * ret_val;
23308     xmlChar * name; /* the full QName */
23309     int n_name;
23310     int * len; /* an int * */
23311     int n_len;
23312 
23313     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23314     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23315         mem_base = xmlMemBlocks();
23316         name = gen_const_xmlChar_ptr(n_name, 0);
23317         len = gen_int_ptr(n_len, 1);
23318 
23319         ret_val = xmlSplitQName3((const xmlChar *)name, len);
23320         desret_const_xmlChar_ptr(ret_val);
23321         call_tests++;
23322         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23323         des_int_ptr(n_len, len, 1);
23324         xmlResetLastError();
23325         if (mem_base != xmlMemBlocks()) {
23326             printf("Leak of %d blocks found in xmlSplitQName3",
23327 	           xmlMemBlocks() - mem_base);
23328 	    test_ret++;
23329             printf(" %d", n_name);
23330             printf(" %d", n_len);
23331             printf("\n");
23332         }
23333     }
23334     }
23335     function_tests++;
23336 
23337     return(test_ret);
23338 }
23339 
23340 
23341 static int
test_xmlStringGetNodeList(void)23342 test_xmlStringGetNodeList(void) {
23343     int test_ret = 0;
23344 
23345     int mem_base;
23346     xmlNodePtr ret_val;
23347     xmlDocPtr doc; /* the document */
23348     int n_doc;
23349     xmlChar * value; /* the value of the attribute */
23350     int n_value;
23351 
23352     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23353     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23354         mem_base = xmlMemBlocks();
23355         doc = gen_xmlDocPtr(n_doc, 0);
23356         value = gen_const_xmlChar_ptr(n_value, 1);
23357 
23358         ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23359         desret_xmlNodePtr(ret_val);
23360         call_tests++;
23361         des_xmlDocPtr(n_doc, doc, 0);
23362         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23363         xmlResetLastError();
23364         if (mem_base != xmlMemBlocks()) {
23365             printf("Leak of %d blocks found in xmlStringGetNodeList",
23366 	           xmlMemBlocks() - mem_base);
23367 	    test_ret++;
23368             printf(" %d", n_doc);
23369             printf(" %d", n_value);
23370             printf("\n");
23371         }
23372     }
23373     }
23374     function_tests++;
23375 
23376     return(test_ret);
23377 }
23378 
23379 
23380 static int
test_xmlStringLenGetNodeList(void)23381 test_xmlStringLenGetNodeList(void) {
23382     int test_ret = 0;
23383 
23384     int mem_base;
23385     xmlNodePtr ret_val;
23386     xmlDocPtr doc; /* the document */
23387     int n_doc;
23388     xmlChar * value; /* the value of the text */
23389     int n_value;
23390     int len; /* the length of the string value */
23391     int n_len;
23392 
23393     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23394     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23395     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23396         mem_base = xmlMemBlocks();
23397         doc = gen_xmlDocPtr(n_doc, 0);
23398         value = gen_const_xmlChar_ptr(n_value, 1);
23399         len = gen_int(n_len, 2);
23400 
23401         ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23402         desret_xmlNodePtr(ret_val);
23403         call_tests++;
23404         des_xmlDocPtr(n_doc, doc, 0);
23405         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23406         des_int(n_len, len, 2);
23407         xmlResetLastError();
23408         if (mem_base != xmlMemBlocks()) {
23409             printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23410 	           xmlMemBlocks() - mem_base);
23411 	    test_ret++;
23412             printf(" %d", n_doc);
23413             printf(" %d", n_value);
23414             printf(" %d", n_len);
23415             printf("\n");
23416         }
23417     }
23418     }
23419     }
23420     function_tests++;
23421 
23422     return(test_ret);
23423 }
23424 
23425 
23426 static int
test_xmlTextConcat(void)23427 test_xmlTextConcat(void) {
23428     int test_ret = 0;
23429 
23430     int mem_base;
23431     int ret_val;
23432     xmlNodePtr node; /* the node */
23433     int n_node;
23434     xmlChar * content; /* the content */
23435     int n_content;
23436     int len; /* @content length */
23437     int n_len;
23438 
23439     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23440     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23441     for (n_len = 0;n_len < gen_nb_int;n_len++) {
23442         mem_base = xmlMemBlocks();
23443         node = gen_xmlNodePtr(n_node, 0);
23444         content = gen_const_xmlChar_ptr(n_content, 1);
23445         len = gen_int(n_len, 2);
23446 
23447         ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23448         desret_int(ret_val);
23449         call_tests++;
23450         des_xmlNodePtr(n_node, node, 0);
23451         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23452         des_int(n_len, len, 2);
23453         xmlResetLastError();
23454         if (mem_base != xmlMemBlocks()) {
23455             printf("Leak of %d blocks found in xmlTextConcat",
23456 	           xmlMemBlocks() - mem_base);
23457 	    test_ret++;
23458             printf(" %d", n_node);
23459             printf(" %d", n_content);
23460             printf(" %d", n_len);
23461             printf("\n");
23462         }
23463     }
23464     }
23465     }
23466     function_tests++;
23467 
23468     return(test_ret);
23469 }
23470 
23471 
23472 static int
test_xmlTextMerge(void)23473 test_xmlTextMerge(void) {
23474     int test_ret = 0;
23475 
23476     int mem_base;
23477     xmlNodePtr ret_val;
23478     xmlNodePtr first; /* the first text node */
23479     int n_first;
23480     xmlNodePtr second; /* the second text node being merged */
23481     int n_second;
23482 
23483     for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23484     for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23485         mem_base = xmlMemBlocks();
23486         first = gen_xmlNodePtr_in(n_first, 0);
23487         second = gen_xmlNodePtr_in(n_second, 1);
23488 
23489         ret_val = xmlTextMerge(first, second);
23490         if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23491               xmlUnlinkNode(second);
23492               xmlFreeNode(second) ; second = NULL ; }
23493         desret_xmlNodePtr(ret_val);
23494         call_tests++;
23495         des_xmlNodePtr_in(n_first, first, 0);
23496         des_xmlNodePtr_in(n_second, second, 1);
23497         xmlResetLastError();
23498         if (mem_base != xmlMemBlocks()) {
23499             printf("Leak of %d blocks found in xmlTextMerge",
23500 	           xmlMemBlocks() - mem_base);
23501 	    test_ret++;
23502             printf(" %d", n_first);
23503             printf(" %d", n_second);
23504             printf("\n");
23505         }
23506     }
23507     }
23508     function_tests++;
23509 
23510     return(test_ret);
23511 }
23512 
23513 
23514 static int
test_xmlUnsetNsProp(void)23515 test_xmlUnsetNsProp(void) {
23516     int test_ret = 0;
23517 
23518 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23519     int mem_base;
23520     int ret_val;
23521     xmlNodePtr node; /* the node */
23522     int n_node;
23523     xmlNsPtr ns; /* the namespace definition */
23524     int n_ns;
23525     xmlChar * name; /* the attribute name */
23526     int n_name;
23527 
23528     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23529     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23530     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23531         mem_base = xmlMemBlocks();
23532         node = gen_xmlNodePtr(n_node, 0);
23533         ns = gen_xmlNsPtr(n_ns, 1);
23534         name = gen_const_xmlChar_ptr(n_name, 2);
23535 
23536         ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23537         desret_int(ret_val);
23538         call_tests++;
23539         des_xmlNodePtr(n_node, node, 0);
23540         des_xmlNsPtr(n_ns, ns, 1);
23541         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23542         xmlResetLastError();
23543         if (mem_base != xmlMemBlocks()) {
23544             printf("Leak of %d blocks found in xmlUnsetNsProp",
23545 	           xmlMemBlocks() - mem_base);
23546 	    test_ret++;
23547             printf(" %d", n_node);
23548             printf(" %d", n_ns);
23549             printf(" %d", n_name);
23550             printf("\n");
23551         }
23552     }
23553     }
23554     }
23555     function_tests++;
23556 #endif
23557 
23558     return(test_ret);
23559 }
23560 
23561 
23562 static int
test_xmlUnsetProp(void)23563 test_xmlUnsetProp(void) {
23564     int test_ret = 0;
23565 
23566 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23567     int mem_base;
23568     int ret_val;
23569     xmlNodePtr node; /* the node */
23570     int n_node;
23571     xmlChar * name; /* the attribute name */
23572     int n_name;
23573 
23574     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23575     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23576         mem_base = xmlMemBlocks();
23577         node = gen_xmlNodePtr(n_node, 0);
23578         name = gen_const_xmlChar_ptr(n_name, 1);
23579 
23580         ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23581         desret_int(ret_val);
23582         call_tests++;
23583         des_xmlNodePtr(n_node, node, 0);
23584         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23585         xmlResetLastError();
23586         if (mem_base != xmlMemBlocks()) {
23587             printf("Leak of %d blocks found in xmlUnsetProp",
23588 	           xmlMemBlocks() - mem_base);
23589 	    test_ret++;
23590             printf(" %d", n_node);
23591             printf(" %d", n_name);
23592             printf("\n");
23593         }
23594     }
23595     }
23596     function_tests++;
23597 #endif
23598 
23599     return(test_ret);
23600 }
23601 
23602 
23603 static int
test_xmlValidateNCName(void)23604 test_xmlValidateNCName(void) {
23605     int test_ret = 0;
23606 
23607 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
23608 #ifdef LIBXML_TREE_ENABLED
23609     int mem_base;
23610     int ret_val;
23611     xmlChar * value; /* the value to check */
23612     int n_value;
23613     int space; /* allow spaces in front and end of the string */
23614     int n_space;
23615 
23616     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23617     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23618         mem_base = xmlMemBlocks();
23619         value = gen_const_xmlChar_ptr(n_value, 0);
23620         space = gen_int(n_space, 1);
23621 
23622         ret_val = xmlValidateNCName((const xmlChar *)value, space);
23623         desret_int(ret_val);
23624         call_tests++;
23625         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23626         des_int(n_space, space, 1);
23627         xmlResetLastError();
23628         if (mem_base != xmlMemBlocks()) {
23629             printf("Leak of %d blocks found in xmlValidateNCName",
23630 	           xmlMemBlocks() - mem_base);
23631 	    test_ret++;
23632             printf(" %d", n_value);
23633             printf(" %d", n_space);
23634             printf("\n");
23635         }
23636     }
23637     }
23638     function_tests++;
23639 #endif
23640 #endif
23641 
23642     return(test_ret);
23643 }
23644 
23645 
23646 static int
test_xmlValidateNMToken(void)23647 test_xmlValidateNMToken(void) {
23648     int test_ret = 0;
23649 
23650 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23651 #ifdef LIBXML_TREE_ENABLED
23652     int mem_base;
23653     int ret_val;
23654     xmlChar * value; /* the value to check */
23655     int n_value;
23656     int space; /* allow spaces in front and end of the string */
23657     int n_space;
23658 
23659     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23660     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23661         mem_base = xmlMemBlocks();
23662         value = gen_const_xmlChar_ptr(n_value, 0);
23663         space = gen_int(n_space, 1);
23664 
23665         ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23666         desret_int(ret_val);
23667         call_tests++;
23668         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23669         des_int(n_space, space, 1);
23670         xmlResetLastError();
23671         if (mem_base != xmlMemBlocks()) {
23672             printf("Leak of %d blocks found in xmlValidateNMToken",
23673 	           xmlMemBlocks() - mem_base);
23674 	    test_ret++;
23675             printf(" %d", n_value);
23676             printf(" %d", n_space);
23677             printf("\n");
23678         }
23679     }
23680     }
23681     function_tests++;
23682 #endif
23683 #endif
23684 
23685     return(test_ret);
23686 }
23687 
23688 
23689 static int
test_xmlValidateName(void)23690 test_xmlValidateName(void) {
23691     int test_ret = 0;
23692 
23693 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23694 #ifdef LIBXML_TREE_ENABLED
23695     int mem_base;
23696     int ret_val;
23697     xmlChar * value; /* the value to check */
23698     int n_value;
23699     int space; /* allow spaces in front and end of the string */
23700     int n_space;
23701 
23702     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23703     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23704         mem_base = xmlMemBlocks();
23705         value = gen_const_xmlChar_ptr(n_value, 0);
23706         space = gen_int(n_space, 1);
23707 
23708         ret_val = xmlValidateName((const xmlChar *)value, space);
23709         desret_int(ret_val);
23710         call_tests++;
23711         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23712         des_int(n_space, space, 1);
23713         xmlResetLastError();
23714         if (mem_base != xmlMemBlocks()) {
23715             printf("Leak of %d blocks found in xmlValidateName",
23716 	           xmlMemBlocks() - mem_base);
23717 	    test_ret++;
23718             printf(" %d", n_value);
23719             printf(" %d", n_space);
23720             printf("\n");
23721         }
23722     }
23723     }
23724     function_tests++;
23725 #endif
23726 #endif
23727 
23728     return(test_ret);
23729 }
23730 
23731 
23732 static int
test_xmlValidateQName(void)23733 test_xmlValidateQName(void) {
23734     int test_ret = 0;
23735 
23736 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23737 #ifdef LIBXML_TREE_ENABLED
23738     int mem_base;
23739     int ret_val;
23740     xmlChar * value; /* the value to check */
23741     int n_value;
23742     int space; /* allow spaces in front and end of the string */
23743     int n_space;
23744 
23745     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23746     for (n_space = 0;n_space < gen_nb_int;n_space++) {
23747         mem_base = xmlMemBlocks();
23748         value = gen_const_xmlChar_ptr(n_value, 0);
23749         space = gen_int(n_space, 1);
23750 
23751         ret_val = xmlValidateQName((const xmlChar *)value, space);
23752         desret_int(ret_val);
23753         call_tests++;
23754         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23755         des_int(n_space, space, 1);
23756         xmlResetLastError();
23757         if (mem_base != xmlMemBlocks()) {
23758             printf("Leak of %d blocks found in xmlValidateQName",
23759 	           xmlMemBlocks() - mem_base);
23760 	    test_ret++;
23761             printf(" %d", n_value);
23762             printf(" %d", n_space);
23763             printf("\n");
23764         }
23765     }
23766     }
23767     function_tests++;
23768 #endif
23769 #endif
23770 
23771     return(test_ret);
23772 }
23773 
23774 static int
test_tree(void)23775 test_tree(void) {
23776     int test_ret = 0;
23777 
23778     if (quiet == 0) printf("Testing tree : 133 of 152 functions ...\n");
23779     test_ret += test_xmlAddChild();
23780     test_ret += test_xmlAddChildList();
23781     test_ret += test_xmlAddNextSibling();
23782     test_ret += test_xmlAddPrevSibling();
23783     test_ret += test_xmlAddSibling();
23784     test_ret += test_xmlAttrSerializeTxtContent();
23785     test_ret += test_xmlBufferAdd();
23786     test_ret += test_xmlBufferAddHead();
23787     test_ret += test_xmlBufferCCat();
23788     test_ret += test_xmlBufferCat();
23789     test_ret += test_xmlBufferContent();
23790     test_ret += test_xmlBufferCreate();
23791     test_ret += test_xmlBufferCreateSize();
23792     test_ret += test_xmlBufferCreateStatic();
23793     test_ret += test_xmlBufferEmpty();
23794     test_ret += test_xmlBufferGrow();
23795     test_ret += test_xmlBufferLength();
23796     test_ret += test_xmlBufferResize();
23797     test_ret += test_xmlBufferSetAllocationScheme();
23798     test_ret += test_xmlBufferShrink();
23799     test_ret += test_xmlBufferWriteCHAR();
23800     test_ret += test_xmlBufferWriteChar();
23801     test_ret += test_xmlBufferWriteQuotedString();
23802     test_ret += test_xmlBuildQName();
23803     test_ret += test_xmlCopyDoc();
23804     test_ret += test_xmlCopyDtd();
23805     test_ret += test_xmlCopyNamespace();
23806     test_ret += test_xmlCopyNamespaceList();
23807     test_ret += test_xmlCopyNode();
23808     test_ret += test_xmlCopyNodeList();
23809     test_ret += test_xmlCopyProp();
23810     test_ret += test_xmlCopyPropList();
23811     test_ret += test_xmlCreateIntSubset();
23812     test_ret += test_xmlDOMWrapAdoptNode();
23813     test_ret += test_xmlDOMWrapCloneNode();
23814     test_ret += test_xmlDOMWrapNewCtxt();
23815     test_ret += test_xmlDOMWrapReconcileNamespaces();
23816     test_ret += test_xmlDOMWrapRemoveNode();
23817     test_ret += test_xmlDocCopyNode();
23818     test_ret += test_xmlDocCopyNodeList();
23819     test_ret += test_xmlDocDump();
23820     test_ret += test_xmlDocDumpFormatMemory();
23821     test_ret += test_xmlDocDumpFormatMemoryEnc();
23822     test_ret += test_xmlDocDumpMemory();
23823     test_ret += test_xmlDocDumpMemoryEnc();
23824     test_ret += test_xmlDocFormatDump();
23825     test_ret += test_xmlDocGetRootElement();
23826     test_ret += test_xmlDocSetRootElement();
23827     test_ret += test_xmlElemDump();
23828     test_ret += test_xmlGetBufferAllocationScheme();
23829     test_ret += test_xmlGetCompressMode();
23830     test_ret += test_xmlGetDocCompressMode();
23831     test_ret += test_xmlGetIntSubset();
23832     test_ret += test_xmlGetLastChild();
23833     test_ret += test_xmlGetLineNo();
23834     test_ret += test_xmlGetNoNsProp();
23835     test_ret += test_xmlGetNodePath();
23836     test_ret += test_xmlGetNsList();
23837     test_ret += test_xmlGetNsProp();
23838     test_ret += test_xmlGetProp();
23839     test_ret += test_xmlHasNsProp();
23840     test_ret += test_xmlHasProp();
23841     test_ret += test_xmlIsBlankNode();
23842     test_ret += test_xmlIsXHTML();
23843     test_ret += test_xmlNewCDataBlock();
23844     test_ret += test_xmlNewCharRef();
23845     test_ret += test_xmlNewChild();
23846     test_ret += test_xmlNewComment();
23847     test_ret += test_xmlNewDoc();
23848     test_ret += test_xmlNewDocComment();
23849     test_ret += test_xmlNewDocFragment();
23850     test_ret += test_xmlNewDocNode();
23851     test_ret += test_xmlNewDocNodeEatName();
23852     test_ret += test_xmlNewDocPI();
23853     test_ret += test_xmlNewDocProp();
23854     test_ret += test_xmlNewDocRawNode();
23855     test_ret += test_xmlNewDocText();
23856     test_ret += test_xmlNewDocTextLen();
23857     test_ret += test_xmlNewDtd();
23858     test_ret += test_xmlNewNode();
23859     test_ret += test_xmlNewNodeEatName();
23860     test_ret += test_xmlNewNs();
23861     test_ret += test_xmlNewNsProp();
23862     test_ret += test_xmlNewNsPropEatName();
23863     test_ret += test_xmlNewPI();
23864     test_ret += test_xmlNewProp();
23865     test_ret += test_xmlNewReference();
23866     test_ret += test_xmlNewText();
23867     test_ret += test_xmlNewTextChild();
23868     test_ret += test_xmlNewTextLen();
23869     test_ret += test_xmlNodeAddContent();
23870     test_ret += test_xmlNodeAddContentLen();
23871     test_ret += test_xmlNodeBufGetContent();
23872     test_ret += test_xmlNodeDump();
23873     test_ret += test_xmlNodeDumpOutput();
23874     test_ret += test_xmlNodeGetBase();
23875     test_ret += test_xmlNodeGetContent();
23876     test_ret += test_xmlNodeGetLang();
23877     test_ret += test_xmlNodeGetSpacePreserve();
23878     test_ret += test_xmlNodeIsText();
23879     test_ret += test_xmlNodeListGetRawString();
23880     test_ret += test_xmlNodeListGetString();
23881     test_ret += test_xmlNodeSetBase();
23882     test_ret += test_xmlNodeSetContent();
23883     test_ret += test_xmlNodeSetContentLen();
23884     test_ret += test_xmlNodeSetLang();
23885     test_ret += test_xmlNodeSetName();
23886     test_ret += test_xmlNodeSetSpacePreserve();
23887     test_ret += test_xmlReconciliateNs();
23888     test_ret += test_xmlRemoveProp();
23889     test_ret += test_xmlReplaceNode();
23890     test_ret += test_xmlSaveFile();
23891     test_ret += test_xmlSaveFileEnc();
23892     test_ret += test_xmlSaveFileTo();
23893     test_ret += test_xmlSaveFormatFile();
23894     test_ret += test_xmlSaveFormatFileEnc();
23895     test_ret += test_xmlSaveFormatFileTo();
23896     test_ret += test_xmlSearchNs();
23897     test_ret += test_xmlSearchNsByHref();
23898     test_ret += test_xmlSetBufferAllocationScheme();
23899     test_ret += test_xmlSetCompressMode();
23900     test_ret += test_xmlSetDocCompressMode();
23901     test_ret += test_xmlSetNs();
23902     test_ret += test_xmlSetNsProp();
23903     test_ret += test_xmlSetProp();
23904     test_ret += test_xmlSplitQName2();
23905     test_ret += test_xmlSplitQName3();
23906     test_ret += test_xmlStringGetNodeList();
23907     test_ret += test_xmlStringLenGetNodeList();
23908     test_ret += test_xmlTextConcat();
23909     test_ret += test_xmlTextMerge();
23910     test_ret += test_xmlUnsetNsProp();
23911     test_ret += test_xmlUnsetProp();
23912     test_ret += test_xmlValidateNCName();
23913     test_ret += test_xmlValidateNMToken();
23914     test_ret += test_xmlValidateName();
23915     test_ret += test_xmlValidateQName();
23916 
23917     if (test_ret != 0)
23918 	printf("Module tree: %d errors\n", test_ret);
23919     return(test_ret);
23920 }
23921 
23922 static int
test_xmlBuildRelativeURI(void)23923 test_xmlBuildRelativeURI(void) {
23924     int test_ret = 0;
23925 
23926     int mem_base;
23927     xmlChar * ret_val;
23928     xmlChar * URI; /* the URI reference under consideration */
23929     int n_URI;
23930     xmlChar * base; /* the base value */
23931     int n_base;
23932 
23933     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23934     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23935         mem_base = xmlMemBlocks();
23936         URI = gen_const_xmlChar_ptr(n_URI, 0);
23937         base = gen_const_xmlChar_ptr(n_base, 1);
23938 
23939         ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
23940         desret_xmlChar_ptr(ret_val);
23941         call_tests++;
23942         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23943         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23944         xmlResetLastError();
23945         if (mem_base != xmlMemBlocks()) {
23946             printf("Leak of %d blocks found in xmlBuildRelativeURI",
23947 	           xmlMemBlocks() - mem_base);
23948 	    test_ret++;
23949             printf(" %d", n_URI);
23950             printf(" %d", n_base);
23951             printf("\n");
23952         }
23953     }
23954     }
23955     function_tests++;
23956 
23957     return(test_ret);
23958 }
23959 
23960 
23961 static int
test_xmlBuildURI(void)23962 test_xmlBuildURI(void) {
23963     int test_ret = 0;
23964 
23965     int mem_base;
23966     xmlChar * ret_val;
23967     xmlChar * URI; /* the URI instance found in the document */
23968     int n_URI;
23969     xmlChar * base; /* the base value */
23970     int n_base;
23971 
23972     for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23973     for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
23974         mem_base = xmlMemBlocks();
23975         URI = gen_const_xmlChar_ptr(n_URI, 0);
23976         base = gen_const_xmlChar_ptr(n_base, 1);
23977 
23978         ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
23979         desret_xmlChar_ptr(ret_val);
23980         call_tests++;
23981         des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
23982         des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
23983         xmlResetLastError();
23984         if (mem_base != xmlMemBlocks()) {
23985             printf("Leak of %d blocks found in xmlBuildURI",
23986 	           xmlMemBlocks() - mem_base);
23987 	    test_ret++;
23988             printf(" %d", n_URI);
23989             printf(" %d", n_base);
23990             printf("\n");
23991         }
23992     }
23993     }
23994     function_tests++;
23995 
23996     return(test_ret);
23997 }
23998 
23999 
24000 static int
test_xmlCanonicPath(void)24001 test_xmlCanonicPath(void) {
24002     int test_ret = 0;
24003 
24004     int mem_base;
24005     xmlChar * ret_val;
24006     xmlChar * path; /* the resource locator in a filesystem notation */
24007     int n_path;
24008 
24009     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24010         mem_base = xmlMemBlocks();
24011         path = gen_const_xmlChar_ptr(n_path, 0);
24012 
24013         ret_val = xmlCanonicPath((const xmlChar *)path);
24014         desret_xmlChar_ptr(ret_val);
24015         call_tests++;
24016         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24017         xmlResetLastError();
24018         if (mem_base != xmlMemBlocks()) {
24019             printf("Leak of %d blocks found in xmlCanonicPath",
24020 	           xmlMemBlocks() - mem_base);
24021 	    test_ret++;
24022             printf(" %d", n_path);
24023             printf("\n");
24024         }
24025     }
24026     function_tests++;
24027 
24028     return(test_ret);
24029 }
24030 
24031 
24032 static int
test_xmlCreateURI(void)24033 test_xmlCreateURI(void) {
24034     int test_ret = 0;
24035 
24036 
24037     /* missing type support */
24038     return(test_ret);
24039 }
24040 
24041 
24042 static int
test_xmlNormalizeURIPath(void)24043 test_xmlNormalizeURIPath(void) {
24044     int test_ret = 0;
24045 
24046     int mem_base;
24047     int ret_val;
24048     char * path; /* pointer to the path string */
24049     int n_path;
24050 
24051     for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24052         mem_base = xmlMemBlocks();
24053         path = gen_char_ptr(n_path, 0);
24054 
24055         ret_val = xmlNormalizeURIPath(path);
24056         desret_int(ret_val);
24057         call_tests++;
24058         des_char_ptr(n_path, path, 0);
24059         xmlResetLastError();
24060         if (mem_base != xmlMemBlocks()) {
24061             printf("Leak of %d blocks found in xmlNormalizeURIPath",
24062 	           xmlMemBlocks() - mem_base);
24063 	    test_ret++;
24064             printf(" %d", n_path);
24065             printf("\n");
24066         }
24067     }
24068     function_tests++;
24069 
24070     return(test_ret);
24071 }
24072 
24073 
24074 static int
test_xmlParseURI(void)24075 test_xmlParseURI(void) {
24076     int test_ret = 0;
24077 
24078 
24079     /* missing type support */
24080     return(test_ret);
24081 }
24082 
24083 
24084 static int
test_xmlParseURIRaw(void)24085 test_xmlParseURIRaw(void) {
24086     int test_ret = 0;
24087 
24088 
24089     /* missing type support */
24090     return(test_ret);
24091 }
24092 
24093 
24094 #define gen_nb_xmlURIPtr 1
gen_xmlURIPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24095 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24096     return(NULL);
24097 }
des_xmlURIPtr(int no ATTRIBUTE_UNUSED,xmlURIPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24098 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24099 }
24100 
24101 static int
test_xmlParseURIReference(void)24102 test_xmlParseURIReference(void) {
24103     int test_ret = 0;
24104 
24105     int mem_base;
24106     int ret_val;
24107     xmlURIPtr uri; /* pointer to an URI structure */
24108     int n_uri;
24109     char * str; /* the string to analyze */
24110     int n_str;
24111 
24112     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24113     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24114         mem_base = xmlMemBlocks();
24115         uri = gen_xmlURIPtr(n_uri, 0);
24116         str = gen_const_char_ptr(n_str, 1);
24117 
24118         ret_val = xmlParseURIReference(uri, (const char *)str);
24119         desret_int(ret_val);
24120         call_tests++;
24121         des_xmlURIPtr(n_uri, uri, 0);
24122         des_const_char_ptr(n_str, (const char *)str, 1);
24123         xmlResetLastError();
24124         if (mem_base != xmlMemBlocks()) {
24125             printf("Leak of %d blocks found in xmlParseURIReference",
24126 	           xmlMemBlocks() - mem_base);
24127 	    test_ret++;
24128             printf(" %d", n_uri);
24129             printf(" %d", n_str);
24130             printf("\n");
24131         }
24132     }
24133     }
24134     function_tests++;
24135 
24136     return(test_ret);
24137 }
24138 
24139 
24140 static int
test_xmlPathToURI(void)24141 test_xmlPathToURI(void) {
24142     int test_ret = 0;
24143 
24144     int mem_base;
24145     xmlChar * ret_val;
24146     xmlChar * path; /* the resource locator in a filesystem notation */
24147     int n_path;
24148 
24149     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24150         mem_base = xmlMemBlocks();
24151         path = gen_const_xmlChar_ptr(n_path, 0);
24152 
24153         ret_val = xmlPathToURI((const xmlChar *)path);
24154         desret_xmlChar_ptr(ret_val);
24155         call_tests++;
24156         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24157         xmlResetLastError();
24158         if (mem_base != xmlMemBlocks()) {
24159             printf("Leak of %d blocks found in xmlPathToURI",
24160 	           xmlMemBlocks() - mem_base);
24161 	    test_ret++;
24162             printf(" %d", n_path);
24163             printf("\n");
24164         }
24165     }
24166     function_tests++;
24167 
24168     return(test_ret);
24169 }
24170 
24171 
24172 static int
test_xmlPrintURI(void)24173 test_xmlPrintURI(void) {
24174     int test_ret = 0;
24175 
24176     int mem_base;
24177     FILE * stream; /* a FILE* for the output */
24178     int n_stream;
24179     xmlURIPtr uri; /* pointer to an xmlURI */
24180     int n_uri;
24181 
24182     for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24183     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24184         mem_base = xmlMemBlocks();
24185         stream = gen_FILE_ptr(n_stream, 0);
24186         uri = gen_xmlURIPtr(n_uri, 1);
24187 
24188         xmlPrintURI(stream, uri);
24189         call_tests++;
24190         des_FILE_ptr(n_stream, stream, 0);
24191         des_xmlURIPtr(n_uri, uri, 1);
24192         xmlResetLastError();
24193         if (mem_base != xmlMemBlocks()) {
24194             printf("Leak of %d blocks found in xmlPrintURI",
24195 	           xmlMemBlocks() - mem_base);
24196 	    test_ret++;
24197             printf(" %d", n_stream);
24198             printf(" %d", n_uri);
24199             printf("\n");
24200         }
24201     }
24202     }
24203     function_tests++;
24204 
24205     return(test_ret);
24206 }
24207 
24208 
24209 static int
test_xmlSaveUri(void)24210 test_xmlSaveUri(void) {
24211     int test_ret = 0;
24212 
24213     int mem_base;
24214     xmlChar * ret_val;
24215     xmlURIPtr uri; /* pointer to an xmlURI */
24216     int n_uri;
24217 
24218     for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24219         mem_base = xmlMemBlocks();
24220         uri = gen_xmlURIPtr(n_uri, 0);
24221 
24222         ret_val = xmlSaveUri(uri);
24223         desret_xmlChar_ptr(ret_val);
24224         call_tests++;
24225         des_xmlURIPtr(n_uri, uri, 0);
24226         xmlResetLastError();
24227         if (mem_base != xmlMemBlocks()) {
24228             printf("Leak of %d blocks found in xmlSaveUri",
24229 	           xmlMemBlocks() - mem_base);
24230 	    test_ret++;
24231             printf(" %d", n_uri);
24232             printf("\n");
24233         }
24234     }
24235     function_tests++;
24236 
24237     return(test_ret);
24238 }
24239 
24240 
24241 static int
test_xmlURIEscape(void)24242 test_xmlURIEscape(void) {
24243     int test_ret = 0;
24244 
24245     int mem_base;
24246     xmlChar * ret_val;
24247     xmlChar * str; /* the string of the URI to escape */
24248     int n_str;
24249 
24250     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24251         mem_base = xmlMemBlocks();
24252         str = gen_const_xmlChar_ptr(n_str, 0);
24253 
24254         ret_val = xmlURIEscape((const xmlChar *)str);
24255         desret_xmlChar_ptr(ret_val);
24256         call_tests++;
24257         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24258         xmlResetLastError();
24259         if (mem_base != xmlMemBlocks()) {
24260             printf("Leak of %d blocks found in xmlURIEscape",
24261 	           xmlMemBlocks() - mem_base);
24262 	    test_ret++;
24263             printf(" %d", n_str);
24264             printf("\n");
24265         }
24266     }
24267     function_tests++;
24268 
24269     return(test_ret);
24270 }
24271 
24272 
24273 static int
test_xmlURIEscapeStr(void)24274 test_xmlURIEscapeStr(void) {
24275     int test_ret = 0;
24276 
24277     int mem_base;
24278     xmlChar * ret_val;
24279     xmlChar * str; /* string to escape */
24280     int n_str;
24281     xmlChar * list; /* exception list string of chars not to escape */
24282     int n_list;
24283 
24284     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24285     for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24286         mem_base = xmlMemBlocks();
24287         str = gen_const_xmlChar_ptr(n_str, 0);
24288         list = gen_const_xmlChar_ptr(n_list, 1);
24289 
24290         ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24291         desret_xmlChar_ptr(ret_val);
24292         call_tests++;
24293         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24294         des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24295         xmlResetLastError();
24296         if (mem_base != xmlMemBlocks()) {
24297             printf("Leak of %d blocks found in xmlURIEscapeStr",
24298 	           xmlMemBlocks() - mem_base);
24299 	    test_ret++;
24300             printf(" %d", n_str);
24301             printf(" %d", n_list);
24302             printf("\n");
24303         }
24304     }
24305     }
24306     function_tests++;
24307 
24308     return(test_ret);
24309 }
24310 
24311 
24312 static int
test_xmlURIUnescapeString(void)24313 test_xmlURIUnescapeString(void) {
24314     int test_ret = 0;
24315 
24316 
24317     /* missing type support */
24318     return(test_ret);
24319 }
24320 
24321 static int
test_uri(void)24322 test_uri(void) {
24323     int test_ret = 0;
24324 
24325     if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24326     test_ret += test_xmlBuildRelativeURI();
24327     test_ret += test_xmlBuildURI();
24328     test_ret += test_xmlCanonicPath();
24329     test_ret += test_xmlCreateURI();
24330     test_ret += test_xmlNormalizeURIPath();
24331     test_ret += test_xmlParseURI();
24332     test_ret += test_xmlParseURIRaw();
24333     test_ret += test_xmlParseURIReference();
24334     test_ret += test_xmlPathToURI();
24335     test_ret += test_xmlPrintURI();
24336     test_ret += test_xmlSaveUri();
24337     test_ret += test_xmlURIEscape();
24338     test_ret += test_xmlURIEscapeStr();
24339     test_ret += test_xmlURIUnescapeString();
24340 
24341     if (test_ret != 0)
24342 	printf("Module uri: %d errors\n", test_ret);
24343     return(test_ret);
24344 }
24345 
24346 static int
test_xmlAddAttributeDecl(void)24347 test_xmlAddAttributeDecl(void) {
24348     int test_ret = 0;
24349 
24350     int mem_base;
24351     xmlAttributePtr ret_val;
24352     xmlValidCtxtPtr ctxt; /* the validation context */
24353     int n_ctxt;
24354     xmlDtdPtr dtd; /* pointer to the DTD */
24355     int n_dtd;
24356     xmlChar * elem; /* the element name */
24357     int n_elem;
24358     xmlChar * name; /* the attribute name */
24359     int n_name;
24360     xmlChar * ns; /* the attribute namespace prefix */
24361     int n_ns;
24362     xmlAttributeType type; /* the attribute type */
24363     int n_type;
24364     xmlAttributeDefault def; /* the attribute default type */
24365     int n_def;
24366     xmlChar * defaultValue; /* the attribute default value */
24367     int n_defaultValue;
24368     xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24369     int n_tree;
24370 
24371     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24372     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24373     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24374     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24375     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24376     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24377     for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24378     for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24379     for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24380         mem_base = xmlMemBlocks();
24381         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24382         dtd = gen_xmlDtdPtr(n_dtd, 1);
24383         elem = gen_const_xmlChar_ptr(n_elem, 2);
24384         name = gen_const_xmlChar_ptr(n_name, 3);
24385         ns = gen_const_xmlChar_ptr(n_ns, 4);
24386         type = gen_xmlAttributeType(n_type, 5);
24387         def = gen_xmlAttributeDefault(n_def, 6);
24388         defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24389         tree = gen_xmlEnumerationPtr(n_tree, 8);
24390 
24391         ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24392         desret_xmlAttributePtr(ret_val);
24393         call_tests++;
24394         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24395         des_xmlDtdPtr(n_dtd, dtd, 1);
24396         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24397         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24398         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24399         des_xmlAttributeType(n_type, type, 5);
24400         des_xmlAttributeDefault(n_def, def, 6);
24401         des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24402         des_xmlEnumerationPtr(n_tree, tree, 8);
24403         xmlResetLastError();
24404         if (mem_base != xmlMemBlocks()) {
24405             printf("Leak of %d blocks found in xmlAddAttributeDecl",
24406 	           xmlMemBlocks() - mem_base);
24407 	    test_ret++;
24408             printf(" %d", n_ctxt);
24409             printf(" %d", n_dtd);
24410             printf(" %d", n_elem);
24411             printf(" %d", n_name);
24412             printf(" %d", n_ns);
24413             printf(" %d", n_type);
24414             printf(" %d", n_def);
24415             printf(" %d", n_defaultValue);
24416             printf(" %d", n_tree);
24417             printf("\n");
24418         }
24419     }
24420     }
24421     }
24422     }
24423     }
24424     }
24425     }
24426     }
24427     }
24428     function_tests++;
24429 
24430     return(test_ret);
24431 }
24432 
24433 
24434 static int
test_xmlAddElementDecl(void)24435 test_xmlAddElementDecl(void) {
24436     int test_ret = 0;
24437 
24438     int mem_base;
24439     xmlElementPtr ret_val;
24440     xmlValidCtxtPtr ctxt; /* the validation context */
24441     int n_ctxt;
24442     xmlDtdPtr dtd; /* pointer to the DTD */
24443     int n_dtd;
24444     xmlChar * name; /* the entity name */
24445     int n_name;
24446     xmlElementTypeVal type; /* the element type */
24447     int n_type;
24448     xmlElementContentPtr content; /* the element content tree or NULL */
24449     int n_content;
24450 
24451     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24452     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24453     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24454     for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24455     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24456         mem_base = xmlMemBlocks();
24457         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24458         dtd = gen_xmlDtdPtr(n_dtd, 1);
24459         name = gen_const_xmlChar_ptr(n_name, 2);
24460         type = gen_xmlElementTypeVal(n_type, 3);
24461         content = gen_xmlElementContentPtr(n_content, 4);
24462 
24463         ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24464         desret_xmlElementPtr(ret_val);
24465         call_tests++;
24466         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24467         des_xmlDtdPtr(n_dtd, dtd, 1);
24468         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24469         des_xmlElementTypeVal(n_type, type, 3);
24470         des_xmlElementContentPtr(n_content, content, 4);
24471         xmlResetLastError();
24472         if (mem_base != xmlMemBlocks()) {
24473             printf("Leak of %d blocks found in xmlAddElementDecl",
24474 	           xmlMemBlocks() - mem_base);
24475 	    test_ret++;
24476             printf(" %d", n_ctxt);
24477             printf(" %d", n_dtd);
24478             printf(" %d", n_name);
24479             printf(" %d", n_type);
24480             printf(" %d", n_content);
24481             printf("\n");
24482         }
24483     }
24484     }
24485     }
24486     }
24487     }
24488     function_tests++;
24489 
24490     return(test_ret);
24491 }
24492 
24493 
24494 static int
test_xmlAddID(void)24495 test_xmlAddID(void) {
24496     int test_ret = 0;
24497 
24498 
24499     /* missing type support */
24500     return(test_ret);
24501 }
24502 
24503 
24504 static int
test_xmlAddNotationDecl(void)24505 test_xmlAddNotationDecl(void) {
24506     int test_ret = 0;
24507 
24508 
24509     /* missing type support */
24510     return(test_ret);
24511 }
24512 
24513 
24514 static int
test_xmlAddRef(void)24515 test_xmlAddRef(void) {
24516     int test_ret = 0;
24517 
24518 
24519     /* missing type support */
24520     return(test_ret);
24521 }
24522 
24523 
24524 #define gen_nb_xmlAttributeTablePtr 1
gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24525 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24526     return(NULL);
24527 }
des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED,xmlAttributeTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24528 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24529 }
24530 
24531 static int
test_xmlCopyAttributeTable(void)24532 test_xmlCopyAttributeTable(void) {
24533     int test_ret = 0;
24534 
24535 
24536     /* missing type support */
24537     return(test_ret);
24538 }
24539 
24540 
24541 static int
test_xmlCopyDocElementContent(void)24542 test_xmlCopyDocElementContent(void) {
24543     int test_ret = 0;
24544 
24545     int mem_base;
24546     xmlElementContentPtr ret_val;
24547     xmlDocPtr doc; /* the document owning the element declaration */
24548     int n_doc;
24549     xmlElementContentPtr cur; /* An element content pointer. */
24550     int n_cur;
24551 
24552     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24553     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24554         mem_base = xmlMemBlocks();
24555         doc = gen_xmlDocPtr(n_doc, 0);
24556         cur = gen_xmlElementContentPtr(n_cur, 1);
24557 
24558         ret_val = xmlCopyDocElementContent(doc, cur);
24559         desret_xmlElementContentPtr(ret_val);
24560         call_tests++;
24561         des_xmlDocPtr(n_doc, doc, 0);
24562         des_xmlElementContentPtr(n_cur, cur, 1);
24563         xmlResetLastError();
24564         if (mem_base != xmlMemBlocks()) {
24565             printf("Leak of %d blocks found in xmlCopyDocElementContent",
24566 	           xmlMemBlocks() - mem_base);
24567 	    test_ret++;
24568             printf(" %d", n_doc);
24569             printf(" %d", n_cur);
24570             printf("\n");
24571         }
24572     }
24573     }
24574     function_tests++;
24575 
24576     return(test_ret);
24577 }
24578 
24579 
24580 static int
test_xmlCopyElementContent(void)24581 test_xmlCopyElementContent(void) {
24582     int test_ret = 0;
24583 
24584     int mem_base;
24585     xmlElementContentPtr ret_val;
24586     xmlElementContentPtr cur; /* An element content pointer. */
24587     int n_cur;
24588 
24589     for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24590         mem_base = xmlMemBlocks();
24591         cur = gen_xmlElementContentPtr(n_cur, 0);
24592 
24593         ret_val = xmlCopyElementContent(cur);
24594         desret_xmlElementContentPtr(ret_val);
24595         call_tests++;
24596         des_xmlElementContentPtr(n_cur, cur, 0);
24597         xmlResetLastError();
24598         if (mem_base != xmlMemBlocks()) {
24599             printf("Leak of %d blocks found in xmlCopyElementContent",
24600 	           xmlMemBlocks() - mem_base);
24601 	    test_ret++;
24602             printf(" %d", n_cur);
24603             printf("\n");
24604         }
24605     }
24606     function_tests++;
24607 
24608     return(test_ret);
24609 }
24610 
24611 
24612 #define gen_nb_xmlElementTablePtr 1
gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24613 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24614     return(NULL);
24615 }
des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED,xmlElementTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24616 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24617 }
24618 
24619 static int
test_xmlCopyElementTable(void)24620 test_xmlCopyElementTable(void) {
24621     int test_ret = 0;
24622 
24623 
24624     /* missing type support */
24625     return(test_ret);
24626 }
24627 
24628 
24629 static int
test_xmlCopyEnumeration(void)24630 test_xmlCopyEnumeration(void) {
24631     int test_ret = 0;
24632 
24633 
24634     /* missing type support */
24635     return(test_ret);
24636 }
24637 
24638 
24639 #define gen_nb_xmlNotationTablePtr 1
gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24640 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24641     return(NULL);
24642 }
des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED,xmlNotationTablePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24643 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24644 }
24645 
24646 static int
test_xmlCopyNotationTable(void)24647 test_xmlCopyNotationTable(void) {
24648     int test_ret = 0;
24649 
24650 
24651     /* missing type support */
24652     return(test_ret);
24653 }
24654 
24655 
24656 static int
test_xmlCreateEnumeration(void)24657 test_xmlCreateEnumeration(void) {
24658     int test_ret = 0;
24659 
24660 
24661     /* missing type support */
24662     return(test_ret);
24663 }
24664 
24665 
24666 #define gen_nb_xmlAttributePtr 1
gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24667 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24668     return(NULL);
24669 }
des_xmlAttributePtr(int no ATTRIBUTE_UNUSED,xmlAttributePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24670 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24671 }
24672 
24673 static int
test_xmlDumpAttributeDecl(void)24674 test_xmlDumpAttributeDecl(void) {
24675     int test_ret = 0;
24676 
24677 #if defined(LIBXML_OUTPUT_ENABLED)
24678     int mem_base;
24679     xmlBufferPtr buf; /* the XML buffer output */
24680     int n_buf;
24681     xmlAttributePtr attr; /* An attribute declaration */
24682     int n_attr;
24683 
24684     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24685     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24686         mem_base = xmlMemBlocks();
24687         buf = gen_xmlBufferPtr(n_buf, 0);
24688         attr = gen_xmlAttributePtr(n_attr, 1);
24689 
24690         xmlDumpAttributeDecl(buf, attr);
24691         call_tests++;
24692         des_xmlBufferPtr(n_buf, buf, 0);
24693         des_xmlAttributePtr(n_attr, attr, 1);
24694         xmlResetLastError();
24695         if (mem_base != xmlMemBlocks()) {
24696             printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24697 	           xmlMemBlocks() - mem_base);
24698 	    test_ret++;
24699             printf(" %d", n_buf);
24700             printf(" %d", n_attr);
24701             printf("\n");
24702         }
24703     }
24704     }
24705     function_tests++;
24706 #endif
24707 
24708     return(test_ret);
24709 }
24710 
24711 
24712 static int
test_xmlDumpAttributeTable(void)24713 test_xmlDumpAttributeTable(void) {
24714     int test_ret = 0;
24715 
24716 #if defined(LIBXML_OUTPUT_ENABLED)
24717     int mem_base;
24718     xmlBufferPtr buf; /* the XML buffer output */
24719     int n_buf;
24720     xmlAttributeTablePtr table; /* An attribute table */
24721     int n_table;
24722 
24723     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24724     for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24725         mem_base = xmlMemBlocks();
24726         buf = gen_xmlBufferPtr(n_buf, 0);
24727         table = gen_xmlAttributeTablePtr(n_table, 1);
24728 
24729         xmlDumpAttributeTable(buf, table);
24730         call_tests++;
24731         des_xmlBufferPtr(n_buf, buf, 0);
24732         des_xmlAttributeTablePtr(n_table, table, 1);
24733         xmlResetLastError();
24734         if (mem_base != xmlMemBlocks()) {
24735             printf("Leak of %d blocks found in xmlDumpAttributeTable",
24736 	           xmlMemBlocks() - mem_base);
24737 	    test_ret++;
24738             printf(" %d", n_buf);
24739             printf(" %d", n_table);
24740             printf("\n");
24741         }
24742     }
24743     }
24744     function_tests++;
24745 #endif
24746 
24747     return(test_ret);
24748 }
24749 
24750 
24751 #define gen_nb_xmlElementPtr 1
gen_xmlElementPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24752 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24753     return(NULL);
24754 }
des_xmlElementPtr(int no ATTRIBUTE_UNUSED,xmlElementPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24755 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24756 }
24757 
24758 static int
test_xmlDumpElementDecl(void)24759 test_xmlDumpElementDecl(void) {
24760     int test_ret = 0;
24761 
24762 #if defined(LIBXML_OUTPUT_ENABLED)
24763     int mem_base;
24764     xmlBufferPtr buf; /* the XML buffer output */
24765     int n_buf;
24766     xmlElementPtr elem; /* An element table */
24767     int n_elem;
24768 
24769     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24770     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24771         mem_base = xmlMemBlocks();
24772         buf = gen_xmlBufferPtr(n_buf, 0);
24773         elem = gen_xmlElementPtr(n_elem, 1);
24774 
24775         xmlDumpElementDecl(buf, elem);
24776         call_tests++;
24777         des_xmlBufferPtr(n_buf, buf, 0);
24778         des_xmlElementPtr(n_elem, elem, 1);
24779         xmlResetLastError();
24780         if (mem_base != xmlMemBlocks()) {
24781             printf("Leak of %d blocks found in xmlDumpElementDecl",
24782 	           xmlMemBlocks() - mem_base);
24783 	    test_ret++;
24784             printf(" %d", n_buf);
24785             printf(" %d", n_elem);
24786             printf("\n");
24787         }
24788     }
24789     }
24790     function_tests++;
24791 #endif
24792 
24793     return(test_ret);
24794 }
24795 
24796 
24797 static int
test_xmlDumpElementTable(void)24798 test_xmlDumpElementTable(void) {
24799     int test_ret = 0;
24800 
24801 #if defined(LIBXML_OUTPUT_ENABLED)
24802     int mem_base;
24803     xmlBufferPtr buf; /* the XML buffer output */
24804     int n_buf;
24805     xmlElementTablePtr table; /* An element table */
24806     int n_table;
24807 
24808     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24809     for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24810         mem_base = xmlMemBlocks();
24811         buf = gen_xmlBufferPtr(n_buf, 0);
24812         table = gen_xmlElementTablePtr(n_table, 1);
24813 
24814         xmlDumpElementTable(buf, table);
24815         call_tests++;
24816         des_xmlBufferPtr(n_buf, buf, 0);
24817         des_xmlElementTablePtr(n_table, table, 1);
24818         xmlResetLastError();
24819         if (mem_base != xmlMemBlocks()) {
24820             printf("Leak of %d blocks found in xmlDumpElementTable",
24821 	           xmlMemBlocks() - mem_base);
24822 	    test_ret++;
24823             printf(" %d", n_buf);
24824             printf(" %d", n_table);
24825             printf("\n");
24826         }
24827     }
24828     }
24829     function_tests++;
24830 #endif
24831 
24832     return(test_ret);
24833 }
24834 
24835 
24836 #define gen_nb_xmlNotationPtr 1
gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24837 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24838     return(NULL);
24839 }
des_xmlNotationPtr(int no ATTRIBUTE_UNUSED,xmlNotationPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)24840 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24841 }
24842 
24843 static int
test_xmlDumpNotationDecl(void)24844 test_xmlDumpNotationDecl(void) {
24845     int test_ret = 0;
24846 
24847 #if defined(LIBXML_OUTPUT_ENABLED)
24848     int mem_base;
24849     xmlBufferPtr buf; /* the XML buffer output */
24850     int n_buf;
24851     xmlNotationPtr nota; /* A notation declaration */
24852     int n_nota;
24853 
24854     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24855     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24856         mem_base = xmlMemBlocks();
24857         buf = gen_xmlBufferPtr(n_buf, 0);
24858         nota = gen_xmlNotationPtr(n_nota, 1);
24859 
24860         xmlDumpNotationDecl(buf, nota);
24861         call_tests++;
24862         des_xmlBufferPtr(n_buf, buf, 0);
24863         des_xmlNotationPtr(n_nota, nota, 1);
24864         xmlResetLastError();
24865         if (mem_base != xmlMemBlocks()) {
24866             printf("Leak of %d blocks found in xmlDumpNotationDecl",
24867 	           xmlMemBlocks() - mem_base);
24868 	    test_ret++;
24869             printf(" %d", n_buf);
24870             printf(" %d", n_nota);
24871             printf("\n");
24872         }
24873     }
24874     }
24875     function_tests++;
24876 #endif
24877 
24878     return(test_ret);
24879 }
24880 
24881 
24882 static int
test_xmlDumpNotationTable(void)24883 test_xmlDumpNotationTable(void) {
24884     int test_ret = 0;
24885 
24886 #if defined(LIBXML_OUTPUT_ENABLED)
24887     int mem_base;
24888     xmlBufferPtr buf; /* the XML buffer output */
24889     int n_buf;
24890     xmlNotationTablePtr table; /* A notation table */
24891     int n_table;
24892 
24893     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24894     for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24895         mem_base = xmlMemBlocks();
24896         buf = gen_xmlBufferPtr(n_buf, 0);
24897         table = gen_xmlNotationTablePtr(n_table, 1);
24898 
24899         xmlDumpNotationTable(buf, table);
24900         call_tests++;
24901         des_xmlBufferPtr(n_buf, buf, 0);
24902         des_xmlNotationTablePtr(n_table, table, 1);
24903         xmlResetLastError();
24904         if (mem_base != xmlMemBlocks()) {
24905             printf("Leak of %d blocks found in xmlDumpNotationTable",
24906 	           xmlMemBlocks() - mem_base);
24907 	    test_ret++;
24908             printf(" %d", n_buf);
24909             printf(" %d", n_table);
24910             printf("\n");
24911         }
24912     }
24913     }
24914     function_tests++;
24915 #endif
24916 
24917     return(test_ret);
24918 }
24919 
24920 
24921 static int
test_xmlGetDtdAttrDesc(void)24922 test_xmlGetDtdAttrDesc(void) {
24923     int test_ret = 0;
24924 
24925     int mem_base;
24926     xmlAttributePtr ret_val;
24927     xmlDtdPtr dtd; /* a pointer to the DtD to search */
24928     int n_dtd;
24929     xmlChar * elem; /* the element name */
24930     int n_elem;
24931     xmlChar * name; /* the attribute name */
24932     int n_name;
24933 
24934     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24935     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24936     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24937         mem_base = xmlMemBlocks();
24938         dtd = gen_xmlDtdPtr(n_dtd, 0);
24939         elem = gen_const_xmlChar_ptr(n_elem, 1);
24940         name = gen_const_xmlChar_ptr(n_name, 2);
24941 
24942         ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
24943         desret_xmlAttributePtr(ret_val);
24944         call_tests++;
24945         des_xmlDtdPtr(n_dtd, dtd, 0);
24946         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
24947         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24948         xmlResetLastError();
24949         if (mem_base != xmlMemBlocks()) {
24950             printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
24951 	           xmlMemBlocks() - mem_base);
24952 	    test_ret++;
24953             printf(" %d", n_dtd);
24954             printf(" %d", n_elem);
24955             printf(" %d", n_name);
24956             printf("\n");
24957         }
24958     }
24959     }
24960     }
24961     function_tests++;
24962 
24963     return(test_ret);
24964 }
24965 
24966 
24967 static int
test_xmlGetDtdElementDesc(void)24968 test_xmlGetDtdElementDesc(void) {
24969     int test_ret = 0;
24970 
24971     int mem_base;
24972     xmlElementPtr ret_val;
24973     xmlDtdPtr dtd; /* a pointer to the DtD to search */
24974     int n_dtd;
24975     xmlChar * name; /* the element name */
24976     int n_name;
24977 
24978     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24979     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24980         mem_base = xmlMemBlocks();
24981         dtd = gen_xmlDtdPtr(n_dtd, 0);
24982         name = gen_const_xmlChar_ptr(n_name, 1);
24983 
24984         ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
24985         desret_xmlElementPtr(ret_val);
24986         call_tests++;
24987         des_xmlDtdPtr(n_dtd, dtd, 0);
24988         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
24989         xmlResetLastError();
24990         if (mem_base != xmlMemBlocks()) {
24991             printf("Leak of %d blocks found in xmlGetDtdElementDesc",
24992 	           xmlMemBlocks() - mem_base);
24993 	    test_ret++;
24994             printf(" %d", n_dtd);
24995             printf(" %d", n_name);
24996             printf("\n");
24997         }
24998     }
24999     }
25000     function_tests++;
25001 
25002     return(test_ret);
25003 }
25004 
25005 
25006 static int
test_xmlGetDtdNotationDesc(void)25007 test_xmlGetDtdNotationDesc(void) {
25008     int test_ret = 0;
25009 
25010 
25011     /* missing type support */
25012     return(test_ret);
25013 }
25014 
25015 
25016 static int
test_xmlGetDtdQAttrDesc(void)25017 test_xmlGetDtdQAttrDesc(void) {
25018     int test_ret = 0;
25019 
25020     int mem_base;
25021     xmlAttributePtr ret_val;
25022     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25023     int n_dtd;
25024     xmlChar * elem; /* the element name */
25025     int n_elem;
25026     xmlChar * name; /* the attribute name */
25027     int n_name;
25028     xmlChar * prefix; /* the attribute namespace prefix */
25029     int n_prefix;
25030 
25031     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25032     for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25033     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25034     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25035         mem_base = xmlMemBlocks();
25036         dtd = gen_xmlDtdPtr(n_dtd, 0);
25037         elem = gen_const_xmlChar_ptr(n_elem, 1);
25038         name = gen_const_xmlChar_ptr(n_name, 2);
25039         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25040 
25041         ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25042         desret_xmlAttributePtr(ret_val);
25043         call_tests++;
25044         des_xmlDtdPtr(n_dtd, dtd, 0);
25045         des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25046         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25047         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25048         xmlResetLastError();
25049         if (mem_base != xmlMemBlocks()) {
25050             printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25051 	           xmlMemBlocks() - mem_base);
25052 	    test_ret++;
25053             printf(" %d", n_dtd);
25054             printf(" %d", n_elem);
25055             printf(" %d", n_name);
25056             printf(" %d", n_prefix);
25057             printf("\n");
25058         }
25059     }
25060     }
25061     }
25062     }
25063     function_tests++;
25064 
25065     return(test_ret);
25066 }
25067 
25068 
25069 static int
test_xmlGetDtdQElementDesc(void)25070 test_xmlGetDtdQElementDesc(void) {
25071     int test_ret = 0;
25072 
25073     int mem_base;
25074     xmlElementPtr ret_val;
25075     xmlDtdPtr dtd; /* a pointer to the DtD to search */
25076     int n_dtd;
25077     xmlChar * name; /* the element name */
25078     int n_name;
25079     xmlChar * prefix; /* the element namespace prefix */
25080     int n_prefix;
25081 
25082     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25083     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25084     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25085         mem_base = xmlMemBlocks();
25086         dtd = gen_xmlDtdPtr(n_dtd, 0);
25087         name = gen_const_xmlChar_ptr(n_name, 1);
25088         prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25089 
25090         ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25091         desret_xmlElementPtr(ret_val);
25092         call_tests++;
25093         des_xmlDtdPtr(n_dtd, dtd, 0);
25094         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25095         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25096         xmlResetLastError();
25097         if (mem_base != xmlMemBlocks()) {
25098             printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25099 	           xmlMemBlocks() - mem_base);
25100 	    test_ret++;
25101             printf(" %d", n_dtd);
25102             printf(" %d", n_name);
25103             printf(" %d", n_prefix);
25104             printf("\n");
25105         }
25106     }
25107     }
25108     }
25109     function_tests++;
25110 
25111     return(test_ret);
25112 }
25113 
25114 
25115 static int
test_xmlGetID(void)25116 test_xmlGetID(void) {
25117     int test_ret = 0;
25118 
25119     int mem_base;
25120     xmlAttrPtr ret_val;
25121     xmlDocPtr doc; /* pointer to the document */
25122     int n_doc;
25123     xmlChar * ID; /* the ID value */
25124     int n_ID;
25125 
25126     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25127     for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25128         mem_base = xmlMemBlocks();
25129         doc = gen_xmlDocPtr(n_doc, 0);
25130         ID = gen_const_xmlChar_ptr(n_ID, 1);
25131 
25132         ret_val = xmlGetID(doc, (const xmlChar *)ID);
25133         desret_xmlAttrPtr(ret_val);
25134         call_tests++;
25135         des_xmlDocPtr(n_doc, doc, 0);
25136         des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25137         xmlResetLastError();
25138         if (mem_base != xmlMemBlocks()) {
25139             printf("Leak of %d blocks found in xmlGetID",
25140 	           xmlMemBlocks() - mem_base);
25141 	    test_ret++;
25142             printf(" %d", n_doc);
25143             printf(" %d", n_ID);
25144             printf("\n");
25145         }
25146     }
25147     }
25148     function_tests++;
25149 
25150     return(test_ret);
25151 }
25152 
25153 
25154 static int
test_xmlGetRefs(void)25155 test_xmlGetRefs(void) {
25156     int test_ret = 0;
25157 
25158 
25159     /* missing type support */
25160     return(test_ret);
25161 }
25162 
25163 
25164 static int
test_xmlIsID(void)25165 test_xmlIsID(void) {
25166     int test_ret = 0;
25167 
25168     int mem_base;
25169     int ret_val;
25170     xmlDocPtr doc; /* the document */
25171     int n_doc;
25172     xmlNodePtr elem; /* the element carrying the attribute */
25173     int n_elem;
25174     xmlAttrPtr attr; /* the attribute */
25175     int n_attr;
25176 
25177     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25178     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25179     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25180         mem_base = xmlMemBlocks();
25181         doc = gen_xmlDocPtr(n_doc, 0);
25182         elem = gen_xmlNodePtr(n_elem, 1);
25183         attr = gen_xmlAttrPtr(n_attr, 2);
25184 
25185         ret_val = xmlIsID(doc, elem, attr);
25186         desret_int(ret_val);
25187         call_tests++;
25188         des_xmlDocPtr(n_doc, doc, 0);
25189         des_xmlNodePtr(n_elem, elem, 1);
25190         des_xmlAttrPtr(n_attr, attr, 2);
25191         xmlResetLastError();
25192         if (mem_base != xmlMemBlocks()) {
25193             printf("Leak of %d blocks found in xmlIsID",
25194 	           xmlMemBlocks() - mem_base);
25195 	    test_ret++;
25196             printf(" %d", n_doc);
25197             printf(" %d", n_elem);
25198             printf(" %d", n_attr);
25199             printf("\n");
25200         }
25201     }
25202     }
25203     }
25204     function_tests++;
25205 
25206     return(test_ret);
25207 }
25208 
25209 
25210 static int
test_xmlIsMixedElement(void)25211 test_xmlIsMixedElement(void) {
25212     int test_ret = 0;
25213 
25214     int mem_base;
25215     int ret_val;
25216     xmlDocPtr doc; /* the document */
25217     int n_doc;
25218     xmlChar * name; /* the element name */
25219     int n_name;
25220 
25221     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25222     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25223         mem_base = xmlMemBlocks();
25224         doc = gen_xmlDocPtr(n_doc, 0);
25225         name = gen_const_xmlChar_ptr(n_name, 1);
25226 
25227         ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25228         desret_int(ret_val);
25229         call_tests++;
25230         des_xmlDocPtr(n_doc, doc, 0);
25231         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25232         xmlResetLastError();
25233         if (mem_base != xmlMemBlocks()) {
25234             printf("Leak of %d blocks found in xmlIsMixedElement",
25235 	           xmlMemBlocks() - mem_base);
25236 	    test_ret++;
25237             printf(" %d", n_doc);
25238             printf(" %d", n_name);
25239             printf("\n");
25240         }
25241     }
25242     }
25243     function_tests++;
25244 
25245     return(test_ret);
25246 }
25247 
25248 
25249 static int
test_xmlIsRef(void)25250 test_xmlIsRef(void) {
25251     int test_ret = 0;
25252 
25253     int mem_base;
25254     int ret_val;
25255     xmlDocPtr doc; /* the document */
25256     int n_doc;
25257     xmlNodePtr elem; /* the element carrying the attribute */
25258     int n_elem;
25259     xmlAttrPtr attr; /* the attribute */
25260     int n_attr;
25261 
25262     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25263     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25264     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25265         mem_base = xmlMemBlocks();
25266         doc = gen_xmlDocPtr(n_doc, 0);
25267         elem = gen_xmlNodePtr(n_elem, 1);
25268         attr = gen_xmlAttrPtr(n_attr, 2);
25269 
25270         ret_val = xmlIsRef(doc, elem, attr);
25271         desret_int(ret_val);
25272         call_tests++;
25273         des_xmlDocPtr(n_doc, doc, 0);
25274         des_xmlNodePtr(n_elem, elem, 1);
25275         des_xmlAttrPtr(n_attr, attr, 2);
25276         xmlResetLastError();
25277         if (mem_base != xmlMemBlocks()) {
25278             printf("Leak of %d blocks found in xmlIsRef",
25279 	           xmlMemBlocks() - mem_base);
25280 	    test_ret++;
25281             printf(" %d", n_doc);
25282             printf(" %d", n_elem);
25283             printf(" %d", n_attr);
25284             printf("\n");
25285         }
25286     }
25287     }
25288     }
25289     function_tests++;
25290 
25291     return(test_ret);
25292 }
25293 
25294 
25295 static int
test_xmlNewDocElementContent(void)25296 test_xmlNewDocElementContent(void) {
25297     int test_ret = 0;
25298 
25299     int mem_base;
25300     xmlElementContentPtr ret_val;
25301     xmlDocPtr doc; /* the document */
25302     int n_doc;
25303     xmlChar * name; /* the subelement name or NULL */
25304     int n_name;
25305     xmlElementContentType type; /* the type of element content decl */
25306     int n_type;
25307 
25308     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25309     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25310     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25311         mem_base = xmlMemBlocks();
25312         doc = gen_xmlDocPtr(n_doc, 0);
25313         name = gen_const_xmlChar_ptr(n_name, 1);
25314         type = gen_xmlElementContentType(n_type, 2);
25315 
25316         ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25317         xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25318         desret_xmlElementContentPtr(ret_val);
25319         call_tests++;
25320         des_xmlDocPtr(n_doc, doc, 0);
25321         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25322         des_xmlElementContentType(n_type, type, 2);
25323         xmlResetLastError();
25324         if (mem_base != xmlMemBlocks()) {
25325             printf("Leak of %d blocks found in xmlNewDocElementContent",
25326 	           xmlMemBlocks() - mem_base);
25327 	    test_ret++;
25328             printf(" %d", n_doc);
25329             printf(" %d", n_name);
25330             printf(" %d", n_type);
25331             printf("\n");
25332         }
25333     }
25334     }
25335     }
25336     function_tests++;
25337 
25338     return(test_ret);
25339 }
25340 
25341 
25342 static int
test_xmlNewElementContent(void)25343 test_xmlNewElementContent(void) {
25344     int test_ret = 0;
25345 
25346     int mem_base;
25347     xmlElementContentPtr ret_val;
25348     xmlChar * name; /* the subelement name or NULL */
25349     int n_name;
25350     xmlElementContentType type; /* the type of element content decl */
25351     int n_type;
25352 
25353     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25354     for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25355         mem_base = xmlMemBlocks();
25356         name = gen_const_xmlChar_ptr(n_name, 0);
25357         type = gen_xmlElementContentType(n_type, 1);
25358 
25359         ret_val = xmlNewElementContent((const xmlChar *)name, type);
25360         desret_xmlElementContentPtr(ret_val);
25361         call_tests++;
25362         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25363         des_xmlElementContentType(n_type, type, 1);
25364         xmlResetLastError();
25365         if (mem_base != xmlMemBlocks()) {
25366             printf("Leak of %d blocks found in xmlNewElementContent",
25367 	           xmlMemBlocks() - mem_base);
25368 	    test_ret++;
25369             printf(" %d", n_name);
25370             printf(" %d", n_type);
25371             printf("\n");
25372         }
25373     }
25374     }
25375     function_tests++;
25376 
25377     return(test_ret);
25378 }
25379 
25380 
25381 static int
test_xmlNewValidCtxt(void)25382 test_xmlNewValidCtxt(void) {
25383     int test_ret = 0;
25384 
25385 
25386     /* missing type support */
25387     return(test_ret);
25388 }
25389 
25390 
25391 static int
test_xmlRemoveID(void)25392 test_xmlRemoveID(void) {
25393     int test_ret = 0;
25394 
25395     int mem_base;
25396     int ret_val;
25397     xmlDocPtr doc; /* the document */
25398     int n_doc;
25399     xmlAttrPtr attr; /* the attribute */
25400     int n_attr;
25401 
25402     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25403     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25404         mem_base = xmlMemBlocks();
25405         doc = gen_xmlDocPtr(n_doc, 0);
25406         attr = gen_xmlAttrPtr(n_attr, 1);
25407 
25408         ret_val = xmlRemoveID(doc, attr);
25409         desret_int(ret_val);
25410         call_tests++;
25411         des_xmlDocPtr(n_doc, doc, 0);
25412         des_xmlAttrPtr(n_attr, attr, 1);
25413         xmlResetLastError();
25414         if (mem_base != xmlMemBlocks()) {
25415             printf("Leak of %d blocks found in xmlRemoveID",
25416 	           xmlMemBlocks() - mem_base);
25417 	    test_ret++;
25418             printf(" %d", n_doc);
25419             printf(" %d", n_attr);
25420             printf("\n");
25421         }
25422     }
25423     }
25424     function_tests++;
25425 
25426     return(test_ret);
25427 }
25428 
25429 
25430 static int
test_xmlRemoveRef(void)25431 test_xmlRemoveRef(void) {
25432     int test_ret = 0;
25433 
25434     int mem_base;
25435     int ret_val;
25436     xmlDocPtr doc; /* the document */
25437     int n_doc;
25438     xmlAttrPtr attr; /* the attribute */
25439     int n_attr;
25440 
25441     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25442     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25443         mem_base = xmlMemBlocks();
25444         doc = gen_xmlDocPtr(n_doc, 0);
25445         attr = gen_xmlAttrPtr(n_attr, 1);
25446 
25447         ret_val = xmlRemoveRef(doc, attr);
25448         desret_int(ret_val);
25449         call_tests++;
25450         des_xmlDocPtr(n_doc, doc, 0);
25451         des_xmlAttrPtr(n_attr, attr, 1);
25452         xmlResetLastError();
25453         if (mem_base != xmlMemBlocks()) {
25454             printf("Leak of %d blocks found in xmlRemoveRef",
25455 	           xmlMemBlocks() - mem_base);
25456 	    test_ret++;
25457             printf(" %d", n_doc);
25458             printf(" %d", n_attr);
25459             printf("\n");
25460         }
25461     }
25462     }
25463     function_tests++;
25464 
25465     return(test_ret);
25466 }
25467 
25468 
25469 static int
test_xmlSnprintfElementContent(void)25470 test_xmlSnprintfElementContent(void) {
25471     int test_ret = 0;
25472 
25473     int mem_base;
25474     char * buf; /* an output buffer */
25475     int n_buf;
25476     int size; /* the buffer size */
25477     int n_size;
25478     xmlElementContentPtr content; /* An element table */
25479     int n_content;
25480     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25481     int n_englob;
25482 
25483     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25484     for (n_size = 0;n_size < gen_nb_int;n_size++) {
25485     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25486     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25487         mem_base = xmlMemBlocks();
25488         buf = gen_char_ptr(n_buf, 0);
25489         size = gen_int(n_size, 1);
25490         content = gen_xmlElementContentPtr(n_content, 2);
25491         englob = gen_int(n_englob, 3);
25492 
25493         xmlSnprintfElementContent(buf, size, content, englob);
25494         call_tests++;
25495         des_char_ptr(n_buf, buf, 0);
25496         des_int(n_size, size, 1);
25497         des_xmlElementContentPtr(n_content, content, 2);
25498         des_int(n_englob, englob, 3);
25499         xmlResetLastError();
25500         if (mem_base != xmlMemBlocks()) {
25501             printf("Leak of %d blocks found in xmlSnprintfElementContent",
25502 	           xmlMemBlocks() - mem_base);
25503 	    test_ret++;
25504             printf(" %d", n_buf);
25505             printf(" %d", n_size);
25506             printf(" %d", n_content);
25507             printf(" %d", n_englob);
25508             printf("\n");
25509         }
25510     }
25511     }
25512     }
25513     }
25514     function_tests++;
25515 
25516     return(test_ret);
25517 }
25518 
25519 
25520 static int
test_xmlSprintfElementContent(void)25521 test_xmlSprintfElementContent(void) {
25522     int test_ret = 0;
25523 
25524 #if defined(LIBXML_OUTPUT_ENABLED)
25525 #ifdef LIBXML_OUTPUT_ENABLED
25526     int mem_base;
25527     char * buf; /* an output buffer */
25528     int n_buf;
25529     xmlElementContentPtr content; /* An element table */
25530     int n_content;
25531     int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25532     int n_englob;
25533 
25534     for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25535     for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25536     for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25537         mem_base = xmlMemBlocks();
25538         buf = gen_char_ptr(n_buf, 0);
25539         content = gen_xmlElementContentPtr(n_content, 1);
25540         englob = gen_int(n_englob, 2);
25541 
25542         xmlSprintfElementContent(buf, content, englob);
25543         call_tests++;
25544         des_char_ptr(n_buf, buf, 0);
25545         des_xmlElementContentPtr(n_content, content, 1);
25546         des_int(n_englob, englob, 2);
25547         xmlResetLastError();
25548         if (mem_base != xmlMemBlocks()) {
25549             printf("Leak of %d blocks found in xmlSprintfElementContent",
25550 	           xmlMemBlocks() - mem_base);
25551 	    test_ret++;
25552             printf(" %d", n_buf);
25553             printf(" %d", n_content);
25554             printf(" %d", n_englob);
25555             printf("\n");
25556         }
25557     }
25558     }
25559     }
25560     function_tests++;
25561 #endif
25562 #endif
25563 
25564     return(test_ret);
25565 }
25566 
25567 
25568 static int
test_xmlValidBuildContentModel(void)25569 test_xmlValidBuildContentModel(void) {
25570     int test_ret = 0;
25571 
25572 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25573     int mem_base;
25574     int ret_val;
25575     xmlValidCtxtPtr ctxt; /* a validation context */
25576     int n_ctxt;
25577     xmlElementPtr elem; /* an element declaration node */
25578     int n_elem;
25579 
25580     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25581     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25582         mem_base = xmlMemBlocks();
25583         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25584         elem = gen_xmlElementPtr(n_elem, 1);
25585 
25586         ret_val = xmlValidBuildContentModel(ctxt, elem);
25587         desret_int(ret_val);
25588         call_tests++;
25589         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25590         des_xmlElementPtr(n_elem, elem, 1);
25591         xmlResetLastError();
25592         if (mem_base != xmlMemBlocks()) {
25593             printf("Leak of %d blocks found in xmlValidBuildContentModel",
25594 	           xmlMemBlocks() - mem_base);
25595 	    test_ret++;
25596             printf(" %d", n_ctxt);
25597             printf(" %d", n_elem);
25598             printf("\n");
25599         }
25600     }
25601     }
25602     function_tests++;
25603 #endif
25604 
25605     return(test_ret);
25606 }
25607 
25608 
25609 static int
test_xmlValidCtxtNormalizeAttributeValue(void)25610 test_xmlValidCtxtNormalizeAttributeValue(void) {
25611     int test_ret = 0;
25612 
25613 #if defined(LIBXML_VALID_ENABLED)
25614     int mem_base;
25615     xmlChar * ret_val;
25616     xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25617     int n_ctxt;
25618     xmlDocPtr doc; /* the document */
25619     int n_doc;
25620     xmlNodePtr elem; /* the parent */
25621     int n_elem;
25622     xmlChar * name; /* the attribute name */
25623     int n_name;
25624     xmlChar * value; /* the attribute value */
25625     int n_value;
25626 
25627     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25628     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25629     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25630     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25631     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25632         mem_base = xmlMemBlocks();
25633         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25634         doc = gen_xmlDocPtr(n_doc, 1);
25635         elem = gen_xmlNodePtr(n_elem, 2);
25636         name = gen_const_xmlChar_ptr(n_name, 3);
25637         value = gen_const_xmlChar_ptr(n_value, 4);
25638 
25639         ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25640         desret_xmlChar_ptr(ret_val);
25641         call_tests++;
25642         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25643         des_xmlDocPtr(n_doc, doc, 1);
25644         des_xmlNodePtr(n_elem, elem, 2);
25645         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25646         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25647         xmlResetLastError();
25648         if (mem_base != xmlMemBlocks()) {
25649             printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25650 	           xmlMemBlocks() - mem_base);
25651 	    test_ret++;
25652             printf(" %d", n_ctxt);
25653             printf(" %d", n_doc);
25654             printf(" %d", n_elem);
25655             printf(" %d", n_name);
25656             printf(" %d", n_value);
25657             printf("\n");
25658         }
25659     }
25660     }
25661     }
25662     }
25663     }
25664     function_tests++;
25665 #endif
25666 
25667     return(test_ret);
25668 }
25669 
25670 
25671 #define gen_nb_xmlElementContent_ptr 1
gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25672 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25673     return(NULL);
25674 }
des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED,xmlElementContent * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)25675 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25676 }
25677 
25678 static int
test_xmlValidGetPotentialChildren(void)25679 test_xmlValidGetPotentialChildren(void) {
25680     int test_ret = 0;
25681 
25682 #if defined(LIBXML_VALID_ENABLED)
25683 #ifdef LIBXML_VALID_ENABLED
25684     int mem_base;
25685     int ret_val;
25686     xmlElementContent * ctree; /* an element content tree */
25687     int n_ctree;
25688     xmlChar ** names; /* an array to store the list of child names */
25689     int n_names;
25690     int * len; /* a pointer to the number of element in the list */
25691     int n_len;
25692     int max; /* the size of the array */
25693     int n_max;
25694 
25695     for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25696     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25697     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25698     for (n_max = 0;n_max < gen_nb_int;n_max++) {
25699         mem_base = xmlMemBlocks();
25700         ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25701         names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25702         len = gen_int_ptr(n_len, 2);
25703         max = gen_int(n_max, 3);
25704 
25705         ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25706         desret_int(ret_val);
25707         call_tests++;
25708         des_xmlElementContent_ptr(n_ctree, ctree, 0);
25709         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25710         des_int_ptr(n_len, len, 2);
25711         des_int(n_max, max, 3);
25712         xmlResetLastError();
25713         if (mem_base != xmlMemBlocks()) {
25714             printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25715 	           xmlMemBlocks() - mem_base);
25716 	    test_ret++;
25717             printf(" %d", n_ctree);
25718             printf(" %d", n_names);
25719             printf(" %d", n_len);
25720             printf(" %d", n_max);
25721             printf("\n");
25722         }
25723     }
25724     }
25725     }
25726     }
25727     function_tests++;
25728 #endif
25729 #endif
25730 
25731     return(test_ret);
25732 }
25733 
25734 
25735 static int
test_xmlValidGetValidElements(void)25736 test_xmlValidGetValidElements(void) {
25737     int test_ret = 0;
25738 
25739 #if defined(LIBXML_VALID_ENABLED)
25740 #ifdef LIBXML_VALID_ENABLED
25741     int mem_base;
25742     int ret_val;
25743     xmlNode * prev; /* an element to insert after */
25744     int n_prev;
25745     xmlNode * next; /* an element to insert next */
25746     int n_next;
25747     xmlChar ** names; /* an array to store the list of child names */
25748     int n_names;
25749     int max; /* the size of the array */
25750     int n_max;
25751 
25752     for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25753     for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25754     for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25755     for (n_max = 0;n_max < gen_nb_int;n_max++) {
25756         mem_base = xmlMemBlocks();
25757         prev = gen_xmlNodePtr(n_prev, 0);
25758         next = gen_xmlNodePtr(n_next, 1);
25759         names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25760         max = gen_int(n_max, 3);
25761 
25762         ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25763         desret_int(ret_val);
25764         call_tests++;
25765         des_xmlNodePtr(n_prev, prev, 0);
25766         des_xmlNodePtr(n_next, next, 1);
25767         des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25768         des_int(n_max, max, 3);
25769         xmlResetLastError();
25770         if (mem_base != xmlMemBlocks()) {
25771             printf("Leak of %d blocks found in xmlValidGetValidElements",
25772 	           xmlMemBlocks() - mem_base);
25773 	    test_ret++;
25774             printf(" %d", n_prev);
25775             printf(" %d", n_next);
25776             printf(" %d", n_names);
25777             printf(" %d", n_max);
25778             printf("\n");
25779         }
25780     }
25781     }
25782     }
25783     }
25784     function_tests++;
25785 #endif
25786 #endif
25787 
25788     return(test_ret);
25789 }
25790 
25791 
25792 static int
test_xmlValidNormalizeAttributeValue(void)25793 test_xmlValidNormalizeAttributeValue(void) {
25794     int test_ret = 0;
25795 
25796 #if defined(LIBXML_VALID_ENABLED)
25797     int mem_base;
25798     xmlChar * ret_val;
25799     xmlDocPtr doc; /* the document */
25800     int n_doc;
25801     xmlNodePtr elem; /* the parent */
25802     int n_elem;
25803     xmlChar * name; /* the attribute name */
25804     int n_name;
25805     xmlChar * value; /* the attribute value */
25806     int n_value;
25807 
25808     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25809     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25810     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25811     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25812         mem_base = xmlMemBlocks();
25813         doc = gen_xmlDocPtr(n_doc, 0);
25814         elem = gen_xmlNodePtr(n_elem, 1);
25815         name = gen_const_xmlChar_ptr(n_name, 2);
25816         value = gen_const_xmlChar_ptr(n_value, 3);
25817 
25818         ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25819         desret_xmlChar_ptr(ret_val);
25820         call_tests++;
25821         des_xmlDocPtr(n_doc, doc, 0);
25822         des_xmlNodePtr(n_elem, elem, 1);
25823         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25824         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25825         xmlResetLastError();
25826         if (mem_base != xmlMemBlocks()) {
25827             printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25828 	           xmlMemBlocks() - mem_base);
25829 	    test_ret++;
25830             printf(" %d", n_doc);
25831             printf(" %d", n_elem);
25832             printf(" %d", n_name);
25833             printf(" %d", n_value);
25834             printf("\n");
25835         }
25836     }
25837     }
25838     }
25839     }
25840     function_tests++;
25841 #endif
25842 
25843     return(test_ret);
25844 }
25845 
25846 
25847 static int
test_xmlValidateAttributeDecl(void)25848 test_xmlValidateAttributeDecl(void) {
25849     int test_ret = 0;
25850 
25851 #if defined(LIBXML_VALID_ENABLED)
25852     int mem_base;
25853     int ret_val;
25854     xmlValidCtxtPtr ctxt; /* the validation context */
25855     int n_ctxt;
25856     xmlDocPtr doc; /* a document instance */
25857     int n_doc;
25858     xmlAttributePtr attr; /* an attribute definition */
25859     int n_attr;
25860 
25861     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25862     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25863     for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25864         mem_base = xmlMemBlocks();
25865         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25866         doc = gen_xmlDocPtr(n_doc, 1);
25867         attr = gen_xmlAttributePtr(n_attr, 2);
25868 
25869         ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25870         desret_int(ret_val);
25871         call_tests++;
25872         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25873         des_xmlDocPtr(n_doc, doc, 1);
25874         des_xmlAttributePtr(n_attr, attr, 2);
25875         xmlResetLastError();
25876         if (mem_base != xmlMemBlocks()) {
25877             printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25878 	           xmlMemBlocks() - mem_base);
25879 	    test_ret++;
25880             printf(" %d", n_ctxt);
25881             printf(" %d", n_doc);
25882             printf(" %d", n_attr);
25883             printf("\n");
25884         }
25885     }
25886     }
25887     }
25888     function_tests++;
25889 #endif
25890 
25891     return(test_ret);
25892 }
25893 
25894 
25895 static int
test_xmlValidateAttributeValue(void)25896 test_xmlValidateAttributeValue(void) {
25897     int test_ret = 0;
25898 
25899 #if defined(LIBXML_VALID_ENABLED)
25900     int mem_base;
25901     int ret_val;
25902     xmlAttributeType type; /* an attribute type */
25903     int n_type;
25904     xmlChar * value; /* an attribute value */
25905     int n_value;
25906 
25907     for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25908     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25909         mem_base = xmlMemBlocks();
25910         type = gen_xmlAttributeType(n_type, 0);
25911         value = gen_const_xmlChar_ptr(n_value, 1);
25912 
25913         ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25914         desret_int(ret_val);
25915         call_tests++;
25916         des_xmlAttributeType(n_type, type, 0);
25917         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25918         xmlResetLastError();
25919         if (mem_base != xmlMemBlocks()) {
25920             printf("Leak of %d blocks found in xmlValidateAttributeValue",
25921 	           xmlMemBlocks() - mem_base);
25922 	    test_ret++;
25923             printf(" %d", n_type);
25924             printf(" %d", n_value);
25925             printf("\n");
25926         }
25927     }
25928     }
25929     function_tests++;
25930 #endif
25931 
25932     return(test_ret);
25933 }
25934 
25935 
25936 static int
test_xmlValidateDocument(void)25937 test_xmlValidateDocument(void) {
25938     int test_ret = 0;
25939 
25940 #if defined(LIBXML_VALID_ENABLED)
25941     int mem_base;
25942     int ret_val;
25943     xmlValidCtxtPtr ctxt; /* the validation context */
25944     int n_ctxt;
25945     xmlDocPtr doc; /* a document instance */
25946     int n_doc;
25947 
25948     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25949     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25950         mem_base = xmlMemBlocks();
25951         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25952         doc = gen_xmlDocPtr(n_doc, 1);
25953 
25954         ret_val = xmlValidateDocument(ctxt, doc);
25955         desret_int(ret_val);
25956         call_tests++;
25957         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25958         des_xmlDocPtr(n_doc, doc, 1);
25959         xmlResetLastError();
25960         if (mem_base != xmlMemBlocks()) {
25961             printf("Leak of %d blocks found in xmlValidateDocument",
25962 	           xmlMemBlocks() - mem_base);
25963 	    test_ret++;
25964             printf(" %d", n_ctxt);
25965             printf(" %d", n_doc);
25966             printf("\n");
25967         }
25968     }
25969     }
25970     function_tests++;
25971 #endif
25972 
25973     return(test_ret);
25974 }
25975 
25976 
25977 static int
test_xmlValidateDocumentFinal(void)25978 test_xmlValidateDocumentFinal(void) {
25979     int test_ret = 0;
25980 
25981 #if defined(LIBXML_VALID_ENABLED)
25982     int mem_base;
25983     int ret_val;
25984     xmlValidCtxtPtr ctxt; /* the validation context */
25985     int n_ctxt;
25986     xmlDocPtr doc; /* a document instance */
25987     int n_doc;
25988 
25989     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25990     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25991         mem_base = xmlMemBlocks();
25992         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25993         doc = gen_xmlDocPtr(n_doc, 1);
25994 
25995         ret_val = xmlValidateDocumentFinal(ctxt, doc);
25996         desret_int(ret_val);
25997         call_tests++;
25998         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25999         des_xmlDocPtr(n_doc, doc, 1);
26000         xmlResetLastError();
26001         if (mem_base != xmlMemBlocks()) {
26002             printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26003 	           xmlMemBlocks() - mem_base);
26004 	    test_ret++;
26005             printf(" %d", n_ctxt);
26006             printf(" %d", n_doc);
26007             printf("\n");
26008         }
26009     }
26010     }
26011     function_tests++;
26012 #endif
26013 
26014     return(test_ret);
26015 }
26016 
26017 
26018 static int
test_xmlValidateDtd(void)26019 test_xmlValidateDtd(void) {
26020     int test_ret = 0;
26021 
26022 #if defined(LIBXML_VALID_ENABLED)
26023     int mem_base;
26024     int ret_val;
26025     xmlValidCtxtPtr ctxt; /* the validation context */
26026     int n_ctxt;
26027     xmlDocPtr doc; /* a document instance */
26028     int n_doc;
26029     xmlDtdPtr dtd; /* a dtd instance */
26030     int n_dtd;
26031 
26032     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26033     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26034     for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26035         mem_base = xmlMemBlocks();
26036         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26037         doc = gen_xmlDocPtr(n_doc, 1);
26038         dtd = gen_xmlDtdPtr(n_dtd, 2);
26039 
26040         ret_val = xmlValidateDtd(ctxt, doc, dtd);
26041         desret_int(ret_val);
26042         call_tests++;
26043         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26044         des_xmlDocPtr(n_doc, doc, 1);
26045         des_xmlDtdPtr(n_dtd, dtd, 2);
26046         xmlResetLastError();
26047         if (mem_base != xmlMemBlocks()) {
26048             printf("Leak of %d blocks found in xmlValidateDtd",
26049 	           xmlMemBlocks() - mem_base);
26050 	    test_ret++;
26051             printf(" %d", n_ctxt);
26052             printf(" %d", n_doc);
26053             printf(" %d", n_dtd);
26054             printf("\n");
26055         }
26056     }
26057     }
26058     }
26059     function_tests++;
26060 #endif
26061 
26062     return(test_ret);
26063 }
26064 
26065 
26066 static int
test_xmlValidateDtdFinal(void)26067 test_xmlValidateDtdFinal(void) {
26068     int test_ret = 0;
26069 
26070 #if defined(LIBXML_VALID_ENABLED)
26071     int mem_base;
26072     int ret_val;
26073     xmlValidCtxtPtr ctxt; /* the validation context */
26074     int n_ctxt;
26075     xmlDocPtr doc; /* a document instance */
26076     int n_doc;
26077 
26078     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26079     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26080         mem_base = xmlMemBlocks();
26081         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26082         doc = gen_xmlDocPtr(n_doc, 1);
26083 
26084         ret_val = xmlValidateDtdFinal(ctxt, doc);
26085         desret_int(ret_val);
26086         call_tests++;
26087         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26088         des_xmlDocPtr(n_doc, doc, 1);
26089         xmlResetLastError();
26090         if (mem_base != xmlMemBlocks()) {
26091             printf("Leak of %d blocks found in xmlValidateDtdFinal",
26092 	           xmlMemBlocks() - mem_base);
26093 	    test_ret++;
26094             printf(" %d", n_ctxt);
26095             printf(" %d", n_doc);
26096             printf("\n");
26097         }
26098     }
26099     }
26100     function_tests++;
26101 #endif
26102 
26103     return(test_ret);
26104 }
26105 
26106 
26107 static int
test_xmlValidateElement(void)26108 test_xmlValidateElement(void) {
26109     int test_ret = 0;
26110 
26111 #if defined(LIBXML_VALID_ENABLED)
26112     int mem_base;
26113     int ret_val;
26114     xmlValidCtxtPtr ctxt; /* the validation context */
26115     int n_ctxt;
26116     xmlDocPtr doc; /* a document instance */
26117     int n_doc;
26118     xmlNodePtr elem; /* an element instance */
26119     int n_elem;
26120 
26121     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26122     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26123     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26124         mem_base = xmlMemBlocks();
26125         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26126         doc = gen_xmlDocPtr(n_doc, 1);
26127         elem = gen_xmlNodePtr(n_elem, 2);
26128 
26129         ret_val = xmlValidateElement(ctxt, doc, elem);
26130         desret_int(ret_val);
26131         call_tests++;
26132         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26133         des_xmlDocPtr(n_doc, doc, 1);
26134         des_xmlNodePtr(n_elem, elem, 2);
26135         xmlResetLastError();
26136         if (mem_base != xmlMemBlocks()) {
26137             printf("Leak of %d blocks found in xmlValidateElement",
26138 	           xmlMemBlocks() - mem_base);
26139 	    test_ret++;
26140             printf(" %d", n_ctxt);
26141             printf(" %d", n_doc);
26142             printf(" %d", n_elem);
26143             printf("\n");
26144         }
26145     }
26146     }
26147     }
26148     function_tests++;
26149 #endif
26150 
26151     return(test_ret);
26152 }
26153 
26154 
26155 static int
test_xmlValidateElementDecl(void)26156 test_xmlValidateElementDecl(void) {
26157     int test_ret = 0;
26158 
26159 #if defined(LIBXML_VALID_ENABLED)
26160     int mem_base;
26161     int ret_val;
26162     xmlValidCtxtPtr ctxt; /* the validation context */
26163     int n_ctxt;
26164     xmlDocPtr doc; /* a document instance */
26165     int n_doc;
26166     xmlElementPtr elem; /* an element definition */
26167     int n_elem;
26168 
26169     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26170     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26171     for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26172         mem_base = xmlMemBlocks();
26173         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26174         doc = gen_xmlDocPtr(n_doc, 1);
26175         elem = gen_xmlElementPtr(n_elem, 2);
26176 
26177         ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26178         desret_int(ret_val);
26179         call_tests++;
26180         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26181         des_xmlDocPtr(n_doc, doc, 1);
26182         des_xmlElementPtr(n_elem, elem, 2);
26183         xmlResetLastError();
26184         if (mem_base != xmlMemBlocks()) {
26185             printf("Leak of %d blocks found in xmlValidateElementDecl",
26186 	           xmlMemBlocks() - mem_base);
26187 	    test_ret++;
26188             printf(" %d", n_ctxt);
26189             printf(" %d", n_doc);
26190             printf(" %d", n_elem);
26191             printf("\n");
26192         }
26193     }
26194     }
26195     }
26196     function_tests++;
26197 #endif
26198 
26199     return(test_ret);
26200 }
26201 
26202 
26203 static int
test_xmlValidateNameValue(void)26204 test_xmlValidateNameValue(void) {
26205     int test_ret = 0;
26206 
26207 #if defined(LIBXML_VALID_ENABLED)
26208     int mem_base;
26209     int ret_val;
26210     xmlChar * value; /* an Name value */
26211     int n_value;
26212 
26213     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26214         mem_base = xmlMemBlocks();
26215         value = gen_const_xmlChar_ptr(n_value, 0);
26216 
26217         ret_val = xmlValidateNameValue((const xmlChar *)value);
26218         desret_int(ret_val);
26219         call_tests++;
26220         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26221         xmlResetLastError();
26222         if (mem_base != xmlMemBlocks()) {
26223             printf("Leak of %d blocks found in xmlValidateNameValue",
26224 	           xmlMemBlocks() - mem_base);
26225 	    test_ret++;
26226             printf(" %d", n_value);
26227             printf("\n");
26228         }
26229     }
26230     function_tests++;
26231 #endif
26232 
26233     return(test_ret);
26234 }
26235 
26236 
26237 static int
test_xmlValidateNamesValue(void)26238 test_xmlValidateNamesValue(void) {
26239     int test_ret = 0;
26240 
26241 #if defined(LIBXML_VALID_ENABLED)
26242     int mem_base;
26243     int ret_val;
26244     xmlChar * value; /* an Names value */
26245     int n_value;
26246 
26247     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26248         mem_base = xmlMemBlocks();
26249         value = gen_const_xmlChar_ptr(n_value, 0);
26250 
26251         ret_val = xmlValidateNamesValue((const xmlChar *)value);
26252         desret_int(ret_val);
26253         call_tests++;
26254         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26255         xmlResetLastError();
26256         if (mem_base != xmlMemBlocks()) {
26257             printf("Leak of %d blocks found in xmlValidateNamesValue",
26258 	           xmlMemBlocks() - mem_base);
26259 	    test_ret++;
26260             printf(" %d", n_value);
26261             printf("\n");
26262         }
26263     }
26264     function_tests++;
26265 #endif
26266 
26267     return(test_ret);
26268 }
26269 
26270 
26271 static int
test_xmlValidateNmtokenValue(void)26272 test_xmlValidateNmtokenValue(void) {
26273     int test_ret = 0;
26274 
26275 #if defined(LIBXML_VALID_ENABLED)
26276     int mem_base;
26277     int ret_val;
26278     xmlChar * value; /* an Nmtoken value */
26279     int n_value;
26280 
26281     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26282         mem_base = xmlMemBlocks();
26283         value = gen_const_xmlChar_ptr(n_value, 0);
26284 
26285         ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26286         desret_int(ret_val);
26287         call_tests++;
26288         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26289         xmlResetLastError();
26290         if (mem_base != xmlMemBlocks()) {
26291             printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26292 	           xmlMemBlocks() - mem_base);
26293 	    test_ret++;
26294             printf(" %d", n_value);
26295             printf("\n");
26296         }
26297     }
26298     function_tests++;
26299 #endif
26300 
26301     return(test_ret);
26302 }
26303 
26304 
26305 static int
test_xmlValidateNmtokensValue(void)26306 test_xmlValidateNmtokensValue(void) {
26307     int test_ret = 0;
26308 
26309 #if defined(LIBXML_VALID_ENABLED)
26310     int mem_base;
26311     int ret_val;
26312     xmlChar * value; /* an Nmtokens value */
26313     int n_value;
26314 
26315     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26316         mem_base = xmlMemBlocks();
26317         value = gen_const_xmlChar_ptr(n_value, 0);
26318 
26319         ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26320         desret_int(ret_val);
26321         call_tests++;
26322         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26323         xmlResetLastError();
26324         if (mem_base != xmlMemBlocks()) {
26325             printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26326 	           xmlMemBlocks() - mem_base);
26327 	    test_ret++;
26328             printf(" %d", n_value);
26329             printf("\n");
26330         }
26331     }
26332     function_tests++;
26333 #endif
26334 
26335     return(test_ret);
26336 }
26337 
26338 
26339 static int
test_xmlValidateNotationDecl(void)26340 test_xmlValidateNotationDecl(void) {
26341     int test_ret = 0;
26342 
26343 #if defined(LIBXML_VALID_ENABLED)
26344     int mem_base;
26345     int ret_val;
26346     xmlValidCtxtPtr ctxt; /* the validation context */
26347     int n_ctxt;
26348     xmlDocPtr doc; /* a document instance */
26349     int n_doc;
26350     xmlNotationPtr nota; /* a notation definition */
26351     int n_nota;
26352 
26353     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26354     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26355     for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26356         mem_base = xmlMemBlocks();
26357         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26358         doc = gen_xmlDocPtr(n_doc, 1);
26359         nota = gen_xmlNotationPtr(n_nota, 2);
26360 
26361         ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26362         desret_int(ret_val);
26363         call_tests++;
26364         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26365         des_xmlDocPtr(n_doc, doc, 1);
26366         des_xmlNotationPtr(n_nota, nota, 2);
26367         xmlResetLastError();
26368         if (mem_base != xmlMemBlocks()) {
26369             printf("Leak of %d blocks found in xmlValidateNotationDecl",
26370 	           xmlMemBlocks() - mem_base);
26371 	    test_ret++;
26372             printf(" %d", n_ctxt);
26373             printf(" %d", n_doc);
26374             printf(" %d", n_nota);
26375             printf("\n");
26376         }
26377     }
26378     }
26379     }
26380     function_tests++;
26381 #endif
26382 
26383     return(test_ret);
26384 }
26385 
26386 
26387 static int
test_xmlValidateNotationUse(void)26388 test_xmlValidateNotationUse(void) {
26389     int test_ret = 0;
26390 
26391 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26392     int mem_base;
26393     int ret_val;
26394     xmlValidCtxtPtr ctxt; /* the validation context */
26395     int n_ctxt;
26396     xmlDocPtr doc; /* the document */
26397     int n_doc;
26398     xmlChar * notationName; /* the notation name to check */
26399     int n_notationName;
26400 
26401     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26402     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26403     for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26404         mem_base = xmlMemBlocks();
26405         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26406         doc = gen_xmlDocPtr(n_doc, 1);
26407         notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26408 
26409         ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26410         desret_int(ret_val);
26411         call_tests++;
26412         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26413         des_xmlDocPtr(n_doc, doc, 1);
26414         des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26415         xmlResetLastError();
26416         if (mem_base != xmlMemBlocks()) {
26417             printf("Leak of %d blocks found in xmlValidateNotationUse",
26418 	           xmlMemBlocks() - mem_base);
26419 	    test_ret++;
26420             printf(" %d", n_ctxt);
26421             printf(" %d", n_doc);
26422             printf(" %d", n_notationName);
26423             printf("\n");
26424         }
26425     }
26426     }
26427     }
26428     function_tests++;
26429 #endif
26430 
26431     return(test_ret);
26432 }
26433 
26434 
26435 static int
test_xmlValidateOneAttribute(void)26436 test_xmlValidateOneAttribute(void) {
26437     int test_ret = 0;
26438 
26439 #if defined(LIBXML_VALID_ENABLED)
26440     int mem_base;
26441     int ret_val;
26442     xmlValidCtxtPtr ctxt; /* the validation context */
26443     int n_ctxt;
26444     xmlDocPtr doc; /* a document instance */
26445     int n_doc;
26446     xmlNodePtr elem; /* an element instance */
26447     int n_elem;
26448     xmlAttrPtr attr; /* an attribute instance */
26449     int n_attr;
26450     xmlChar * value; /* the attribute value (without entities processing) */
26451     int n_value;
26452 
26453     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26454     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26455     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26456     for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26457     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26458         mem_base = xmlMemBlocks();
26459         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26460         doc = gen_xmlDocPtr(n_doc, 1);
26461         elem = gen_xmlNodePtr(n_elem, 2);
26462         attr = gen_xmlAttrPtr(n_attr, 3);
26463         value = gen_const_xmlChar_ptr(n_value, 4);
26464 
26465         ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26466         desret_int(ret_val);
26467         call_tests++;
26468         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26469         des_xmlDocPtr(n_doc, doc, 1);
26470         des_xmlNodePtr(n_elem, elem, 2);
26471         des_xmlAttrPtr(n_attr, attr, 3);
26472         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26473         xmlResetLastError();
26474         if (mem_base != xmlMemBlocks()) {
26475             printf("Leak of %d blocks found in xmlValidateOneAttribute",
26476 	           xmlMemBlocks() - mem_base);
26477 	    test_ret++;
26478             printf(" %d", n_ctxt);
26479             printf(" %d", n_doc);
26480             printf(" %d", n_elem);
26481             printf(" %d", n_attr);
26482             printf(" %d", n_value);
26483             printf("\n");
26484         }
26485     }
26486     }
26487     }
26488     }
26489     }
26490     function_tests++;
26491 #endif
26492 
26493     return(test_ret);
26494 }
26495 
26496 
26497 static int
test_xmlValidateOneElement(void)26498 test_xmlValidateOneElement(void) {
26499     int test_ret = 0;
26500 
26501 #if defined(LIBXML_VALID_ENABLED)
26502     int mem_base;
26503     int ret_val;
26504     xmlValidCtxtPtr ctxt; /* the validation context */
26505     int n_ctxt;
26506     xmlDocPtr doc; /* a document instance */
26507     int n_doc;
26508     xmlNodePtr elem; /* an element instance */
26509     int n_elem;
26510 
26511     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26512     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26513     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26514         mem_base = xmlMemBlocks();
26515         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26516         doc = gen_xmlDocPtr(n_doc, 1);
26517         elem = gen_xmlNodePtr(n_elem, 2);
26518 
26519         ret_val = xmlValidateOneElement(ctxt, doc, elem);
26520         desret_int(ret_val);
26521         call_tests++;
26522         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26523         des_xmlDocPtr(n_doc, doc, 1);
26524         des_xmlNodePtr(n_elem, elem, 2);
26525         xmlResetLastError();
26526         if (mem_base != xmlMemBlocks()) {
26527             printf("Leak of %d blocks found in xmlValidateOneElement",
26528 	           xmlMemBlocks() - mem_base);
26529 	    test_ret++;
26530             printf(" %d", n_ctxt);
26531             printf(" %d", n_doc);
26532             printf(" %d", n_elem);
26533             printf("\n");
26534         }
26535     }
26536     }
26537     }
26538     function_tests++;
26539 #endif
26540 
26541     return(test_ret);
26542 }
26543 
26544 
26545 static int
test_xmlValidateOneNamespace(void)26546 test_xmlValidateOneNamespace(void) {
26547     int test_ret = 0;
26548 
26549 #if defined(LIBXML_VALID_ENABLED)
26550     int mem_base;
26551     int ret_val;
26552     xmlValidCtxtPtr ctxt; /* the validation context */
26553     int n_ctxt;
26554     xmlDocPtr doc; /* a document instance */
26555     int n_doc;
26556     xmlNodePtr elem; /* an element instance */
26557     int n_elem;
26558     xmlChar * prefix; /* the namespace prefix */
26559     int n_prefix;
26560     xmlNsPtr ns; /* an namespace declaration instance */
26561     int n_ns;
26562     xmlChar * value; /* the attribute value (without entities processing) */
26563     int n_value;
26564 
26565     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26566     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26567     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26568     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26569     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26570     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26571         mem_base = xmlMemBlocks();
26572         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26573         doc = gen_xmlDocPtr(n_doc, 1);
26574         elem = gen_xmlNodePtr(n_elem, 2);
26575         prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26576         ns = gen_xmlNsPtr(n_ns, 4);
26577         value = gen_const_xmlChar_ptr(n_value, 5);
26578 
26579         ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26580         desret_int(ret_val);
26581         call_tests++;
26582         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26583         des_xmlDocPtr(n_doc, doc, 1);
26584         des_xmlNodePtr(n_elem, elem, 2);
26585         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26586         des_xmlNsPtr(n_ns, ns, 4);
26587         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26588         xmlResetLastError();
26589         if (mem_base != xmlMemBlocks()) {
26590             printf("Leak of %d blocks found in xmlValidateOneNamespace",
26591 	           xmlMemBlocks() - mem_base);
26592 	    test_ret++;
26593             printf(" %d", n_ctxt);
26594             printf(" %d", n_doc);
26595             printf(" %d", n_elem);
26596             printf(" %d", n_prefix);
26597             printf(" %d", n_ns);
26598             printf(" %d", n_value);
26599             printf("\n");
26600         }
26601     }
26602     }
26603     }
26604     }
26605     }
26606     }
26607     function_tests++;
26608 #endif
26609 
26610     return(test_ret);
26611 }
26612 
26613 
26614 static int
test_xmlValidatePopElement(void)26615 test_xmlValidatePopElement(void) {
26616     int test_ret = 0;
26617 
26618 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26619     int mem_base;
26620     int ret_val;
26621     xmlValidCtxtPtr ctxt; /* the validation context */
26622     int n_ctxt;
26623     xmlDocPtr doc; /* a document instance */
26624     int n_doc;
26625     xmlNodePtr elem; /* an element instance */
26626     int n_elem;
26627     xmlChar * qname; /* the qualified name as appearing in the serialization */
26628     int n_qname;
26629 
26630     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26631     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26632     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26633     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26634         mem_base = xmlMemBlocks();
26635         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26636         doc = gen_xmlDocPtr(n_doc, 1);
26637         elem = gen_xmlNodePtr(n_elem, 2);
26638         qname = gen_const_xmlChar_ptr(n_qname, 3);
26639 
26640         ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26641         desret_int(ret_val);
26642         call_tests++;
26643         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26644         des_xmlDocPtr(n_doc, doc, 1);
26645         des_xmlNodePtr(n_elem, elem, 2);
26646         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26647         xmlResetLastError();
26648         if (mem_base != xmlMemBlocks()) {
26649             printf("Leak of %d blocks found in xmlValidatePopElement",
26650 	           xmlMemBlocks() - mem_base);
26651 	    test_ret++;
26652             printf(" %d", n_ctxt);
26653             printf(" %d", n_doc);
26654             printf(" %d", n_elem);
26655             printf(" %d", n_qname);
26656             printf("\n");
26657         }
26658     }
26659     }
26660     }
26661     }
26662     function_tests++;
26663 #endif
26664 
26665     return(test_ret);
26666 }
26667 
26668 
26669 static int
test_xmlValidatePushCData(void)26670 test_xmlValidatePushCData(void) {
26671     int test_ret = 0;
26672 
26673 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26674     int mem_base;
26675     int ret_val;
26676     xmlValidCtxtPtr ctxt; /* the validation context */
26677     int n_ctxt;
26678     xmlChar * data; /* some character data read */
26679     int n_data;
26680     int len; /* the lenght of the data */
26681     int n_len;
26682 
26683     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26684     for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26685     for (n_len = 0;n_len < gen_nb_int;n_len++) {
26686         mem_base = xmlMemBlocks();
26687         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26688         data = gen_const_xmlChar_ptr(n_data, 1);
26689         len = gen_int(n_len, 2);
26690 
26691         ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26692         desret_int(ret_val);
26693         call_tests++;
26694         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26695         des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26696         des_int(n_len, len, 2);
26697         xmlResetLastError();
26698         if (mem_base != xmlMemBlocks()) {
26699             printf("Leak of %d blocks found in xmlValidatePushCData",
26700 	           xmlMemBlocks() - mem_base);
26701 	    test_ret++;
26702             printf(" %d", n_ctxt);
26703             printf(" %d", n_data);
26704             printf(" %d", n_len);
26705             printf("\n");
26706         }
26707     }
26708     }
26709     }
26710     function_tests++;
26711 #endif
26712 
26713     return(test_ret);
26714 }
26715 
26716 
26717 static int
test_xmlValidatePushElement(void)26718 test_xmlValidatePushElement(void) {
26719     int test_ret = 0;
26720 
26721 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26722     int mem_base;
26723     int ret_val;
26724     xmlValidCtxtPtr ctxt; /* the validation context */
26725     int n_ctxt;
26726     xmlDocPtr doc; /* a document instance */
26727     int n_doc;
26728     xmlNodePtr elem; /* an element instance */
26729     int n_elem;
26730     xmlChar * qname; /* the qualified name as appearing in the serialization */
26731     int n_qname;
26732 
26733     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26734     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26735     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26736     for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26737         mem_base = xmlMemBlocks();
26738         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26739         doc = gen_xmlDocPtr(n_doc, 1);
26740         elem = gen_xmlNodePtr(n_elem, 2);
26741         qname = gen_const_xmlChar_ptr(n_qname, 3);
26742 
26743         ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26744         desret_int(ret_val);
26745         call_tests++;
26746         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26747         des_xmlDocPtr(n_doc, doc, 1);
26748         des_xmlNodePtr(n_elem, elem, 2);
26749         des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26750         xmlResetLastError();
26751         if (mem_base != xmlMemBlocks()) {
26752             printf("Leak of %d blocks found in xmlValidatePushElement",
26753 	           xmlMemBlocks() - mem_base);
26754 	    test_ret++;
26755             printf(" %d", n_ctxt);
26756             printf(" %d", n_doc);
26757             printf(" %d", n_elem);
26758             printf(" %d", n_qname);
26759             printf("\n");
26760         }
26761     }
26762     }
26763     }
26764     }
26765     function_tests++;
26766 #endif
26767 
26768     return(test_ret);
26769 }
26770 
26771 
26772 static int
test_xmlValidateRoot(void)26773 test_xmlValidateRoot(void) {
26774     int test_ret = 0;
26775 
26776 #if defined(LIBXML_VALID_ENABLED)
26777     int mem_base;
26778     int ret_val;
26779     xmlValidCtxtPtr ctxt; /* the validation context */
26780     int n_ctxt;
26781     xmlDocPtr doc; /* a document instance */
26782     int n_doc;
26783 
26784     for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26785     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26786         mem_base = xmlMemBlocks();
26787         ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26788         doc = gen_xmlDocPtr(n_doc, 1);
26789 
26790         ret_val = xmlValidateRoot(ctxt, doc);
26791         desret_int(ret_val);
26792         call_tests++;
26793         des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26794         des_xmlDocPtr(n_doc, doc, 1);
26795         xmlResetLastError();
26796         if (mem_base != xmlMemBlocks()) {
26797             printf("Leak of %d blocks found in xmlValidateRoot",
26798 	           xmlMemBlocks() - mem_base);
26799 	    test_ret++;
26800             printf(" %d", n_ctxt);
26801             printf(" %d", n_doc);
26802             printf("\n");
26803         }
26804     }
26805     }
26806     function_tests++;
26807 #endif
26808 
26809     return(test_ret);
26810 }
26811 
26812 static int
test_valid(void)26813 test_valid(void) {
26814     int test_ret = 0;
26815 
26816     if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26817     test_ret += test_xmlAddAttributeDecl();
26818     test_ret += test_xmlAddElementDecl();
26819     test_ret += test_xmlAddID();
26820     test_ret += test_xmlAddNotationDecl();
26821     test_ret += test_xmlAddRef();
26822     test_ret += test_xmlCopyAttributeTable();
26823     test_ret += test_xmlCopyDocElementContent();
26824     test_ret += test_xmlCopyElementContent();
26825     test_ret += test_xmlCopyElementTable();
26826     test_ret += test_xmlCopyEnumeration();
26827     test_ret += test_xmlCopyNotationTable();
26828     test_ret += test_xmlCreateEnumeration();
26829     test_ret += test_xmlDumpAttributeDecl();
26830     test_ret += test_xmlDumpAttributeTable();
26831     test_ret += test_xmlDumpElementDecl();
26832     test_ret += test_xmlDumpElementTable();
26833     test_ret += test_xmlDumpNotationDecl();
26834     test_ret += test_xmlDumpNotationTable();
26835     test_ret += test_xmlGetDtdAttrDesc();
26836     test_ret += test_xmlGetDtdElementDesc();
26837     test_ret += test_xmlGetDtdNotationDesc();
26838     test_ret += test_xmlGetDtdQAttrDesc();
26839     test_ret += test_xmlGetDtdQElementDesc();
26840     test_ret += test_xmlGetID();
26841     test_ret += test_xmlGetRefs();
26842     test_ret += test_xmlIsID();
26843     test_ret += test_xmlIsMixedElement();
26844     test_ret += test_xmlIsRef();
26845     test_ret += test_xmlNewDocElementContent();
26846     test_ret += test_xmlNewElementContent();
26847     test_ret += test_xmlNewValidCtxt();
26848     test_ret += test_xmlRemoveID();
26849     test_ret += test_xmlRemoveRef();
26850     test_ret += test_xmlSnprintfElementContent();
26851     test_ret += test_xmlSprintfElementContent();
26852     test_ret += test_xmlValidBuildContentModel();
26853     test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26854     test_ret += test_xmlValidGetPotentialChildren();
26855     test_ret += test_xmlValidGetValidElements();
26856     test_ret += test_xmlValidNormalizeAttributeValue();
26857     test_ret += test_xmlValidateAttributeDecl();
26858     test_ret += test_xmlValidateAttributeValue();
26859     test_ret += test_xmlValidateDocument();
26860     test_ret += test_xmlValidateDocumentFinal();
26861     test_ret += test_xmlValidateDtd();
26862     test_ret += test_xmlValidateDtdFinal();
26863     test_ret += test_xmlValidateElement();
26864     test_ret += test_xmlValidateElementDecl();
26865     test_ret += test_xmlValidateNameValue();
26866     test_ret += test_xmlValidateNamesValue();
26867     test_ret += test_xmlValidateNmtokenValue();
26868     test_ret += test_xmlValidateNmtokensValue();
26869     test_ret += test_xmlValidateNotationDecl();
26870     test_ret += test_xmlValidateNotationUse();
26871     test_ret += test_xmlValidateOneAttribute();
26872     test_ret += test_xmlValidateOneElement();
26873     test_ret += test_xmlValidateOneNamespace();
26874     test_ret += test_xmlValidatePopElement();
26875     test_ret += test_xmlValidatePushCData();
26876     test_ret += test_xmlValidatePushElement();
26877     test_ret += test_xmlValidateRoot();
26878 
26879     if (test_ret != 0)
26880 	printf("Module valid: %d errors\n", test_ret);
26881     return(test_ret);
26882 }
26883 
26884 static int
test_xmlXIncludeNewContext(void)26885 test_xmlXIncludeNewContext(void) {
26886     int test_ret = 0;
26887 
26888 
26889     /* missing type support */
26890     return(test_ret);
26891 }
26892 
26893 
26894 static int
test_xmlXIncludeProcess(void)26895 test_xmlXIncludeProcess(void) {
26896     int test_ret = 0;
26897 
26898 #if defined(LIBXML_XINCLUDE_ENABLED)
26899     int mem_base;
26900     int ret_val;
26901     xmlDocPtr doc; /* an XML document */
26902     int n_doc;
26903 
26904     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26905         mem_base = xmlMemBlocks();
26906         doc = gen_xmlDocPtr(n_doc, 0);
26907 
26908         ret_val = xmlXIncludeProcess(doc);
26909         desret_int(ret_val);
26910         call_tests++;
26911         des_xmlDocPtr(n_doc, doc, 0);
26912         xmlResetLastError();
26913         if (mem_base != xmlMemBlocks()) {
26914             printf("Leak of %d blocks found in xmlXIncludeProcess",
26915 	           xmlMemBlocks() - mem_base);
26916 	    test_ret++;
26917             printf(" %d", n_doc);
26918             printf("\n");
26919         }
26920     }
26921     function_tests++;
26922 #endif
26923 
26924     return(test_ret);
26925 }
26926 
26927 
26928 static int
test_xmlXIncludeProcessFlags(void)26929 test_xmlXIncludeProcessFlags(void) {
26930     int test_ret = 0;
26931 
26932 #if defined(LIBXML_XINCLUDE_ENABLED)
26933     int mem_base;
26934     int ret_val;
26935     xmlDocPtr doc; /* an XML document */
26936     int n_doc;
26937     int flags; /* a set of xmlParserOption used for parsing XML includes */
26938     int n_flags;
26939 
26940     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26941     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26942         mem_base = xmlMemBlocks();
26943         doc = gen_xmlDocPtr(n_doc, 0);
26944         flags = gen_int(n_flags, 1);
26945 
26946         ret_val = xmlXIncludeProcessFlags(doc, flags);
26947         desret_int(ret_val);
26948         call_tests++;
26949         des_xmlDocPtr(n_doc, doc, 0);
26950         des_int(n_flags, flags, 1);
26951         xmlResetLastError();
26952         if (mem_base != xmlMemBlocks()) {
26953             printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
26954 	           xmlMemBlocks() - mem_base);
26955 	    test_ret++;
26956             printf(" %d", n_doc);
26957             printf(" %d", n_flags);
26958             printf("\n");
26959         }
26960     }
26961     }
26962     function_tests++;
26963 #endif
26964 
26965     return(test_ret);
26966 }
26967 
26968 
26969 static int
test_xmlXIncludeProcessFlagsData(void)26970 test_xmlXIncludeProcessFlagsData(void) {
26971     int test_ret = 0;
26972 
26973 #if defined(LIBXML_XINCLUDE_ENABLED)
26974     int mem_base;
26975     int ret_val;
26976     xmlDocPtr doc; /* an XML document */
26977     int n_doc;
26978     int flags; /* a set of xmlParserOption used for parsing XML includes */
26979     int n_flags;
26980     void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
26981     int n_data;
26982 
26983     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26984     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
26985     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
26986         mem_base = xmlMemBlocks();
26987         doc = gen_xmlDocPtr(n_doc, 0);
26988         flags = gen_int(n_flags, 1);
26989         data = gen_userdata(n_data, 2);
26990 
26991         ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
26992         desret_int(ret_val);
26993         call_tests++;
26994         des_xmlDocPtr(n_doc, doc, 0);
26995         des_int(n_flags, flags, 1);
26996         des_userdata(n_data, data, 2);
26997         xmlResetLastError();
26998         if (mem_base != xmlMemBlocks()) {
26999             printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27000 	           xmlMemBlocks() - mem_base);
27001 	    test_ret++;
27002             printf(" %d", n_doc);
27003             printf(" %d", n_flags);
27004             printf(" %d", n_data);
27005             printf("\n");
27006         }
27007     }
27008     }
27009     }
27010     function_tests++;
27011 #endif
27012 
27013     return(test_ret);
27014 }
27015 
27016 #ifdef LIBXML_XINCLUDE_ENABLED
27017 
27018 #define gen_nb_xmlXIncludeCtxtPtr 1
gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)27019 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27020     return(NULL);
27021 }
des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED,xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)27022 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27023 }
27024 #endif
27025 
27026 
27027 static int
test_xmlXIncludeProcessNode(void)27028 test_xmlXIncludeProcessNode(void) {
27029     int test_ret = 0;
27030 
27031 #if defined(LIBXML_XINCLUDE_ENABLED)
27032     int mem_base;
27033     int ret_val;
27034     xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27035     int n_ctxt;
27036     xmlNodePtr node; /* a node in an XML document */
27037     int n_node;
27038 
27039     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27040     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27041         mem_base = xmlMemBlocks();
27042         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27043         node = gen_xmlNodePtr(n_node, 1);
27044 
27045         ret_val = xmlXIncludeProcessNode(ctxt, node);
27046         desret_int(ret_val);
27047         call_tests++;
27048         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27049         des_xmlNodePtr(n_node, node, 1);
27050         xmlResetLastError();
27051         if (mem_base != xmlMemBlocks()) {
27052             printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27053 	           xmlMemBlocks() - mem_base);
27054 	    test_ret++;
27055             printf(" %d", n_ctxt);
27056             printf(" %d", n_node);
27057             printf("\n");
27058         }
27059     }
27060     }
27061     function_tests++;
27062 #endif
27063 
27064     return(test_ret);
27065 }
27066 
27067 
27068 static int
test_xmlXIncludeProcessTree(void)27069 test_xmlXIncludeProcessTree(void) {
27070     int test_ret = 0;
27071 
27072 #if defined(LIBXML_XINCLUDE_ENABLED)
27073     int mem_base;
27074     int ret_val;
27075     xmlNodePtr tree; /* a node in an XML document */
27076     int n_tree;
27077 
27078     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27079         mem_base = xmlMemBlocks();
27080         tree = gen_xmlNodePtr(n_tree, 0);
27081 
27082         ret_val = xmlXIncludeProcessTree(tree);
27083         desret_int(ret_val);
27084         call_tests++;
27085         des_xmlNodePtr(n_tree, tree, 0);
27086         xmlResetLastError();
27087         if (mem_base != xmlMemBlocks()) {
27088             printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27089 	           xmlMemBlocks() - mem_base);
27090 	    test_ret++;
27091             printf(" %d", n_tree);
27092             printf("\n");
27093         }
27094     }
27095     function_tests++;
27096 #endif
27097 
27098     return(test_ret);
27099 }
27100 
27101 
27102 static int
test_xmlXIncludeProcessTreeFlags(void)27103 test_xmlXIncludeProcessTreeFlags(void) {
27104     int test_ret = 0;
27105 
27106 #if defined(LIBXML_XINCLUDE_ENABLED)
27107     int mem_base;
27108     int ret_val;
27109     xmlNodePtr tree; /* a node in an XML document */
27110     int n_tree;
27111     int flags; /* a set of xmlParserOption used for parsing XML includes */
27112     int n_flags;
27113 
27114     for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27115     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27116         mem_base = xmlMemBlocks();
27117         tree = gen_xmlNodePtr(n_tree, 0);
27118         flags = gen_int(n_flags, 1);
27119 
27120         ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27121         desret_int(ret_val);
27122         call_tests++;
27123         des_xmlNodePtr(n_tree, tree, 0);
27124         des_int(n_flags, flags, 1);
27125         xmlResetLastError();
27126         if (mem_base != xmlMemBlocks()) {
27127             printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27128 	           xmlMemBlocks() - mem_base);
27129 	    test_ret++;
27130             printf(" %d", n_tree);
27131             printf(" %d", n_flags);
27132             printf("\n");
27133         }
27134     }
27135     }
27136     function_tests++;
27137 #endif
27138 
27139     return(test_ret);
27140 }
27141 
27142 
27143 static int
test_xmlXIncludeSetFlags(void)27144 test_xmlXIncludeSetFlags(void) {
27145     int test_ret = 0;
27146 
27147 #if defined(LIBXML_XINCLUDE_ENABLED)
27148     int mem_base;
27149     int ret_val;
27150     xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27151     int n_ctxt;
27152     int flags; /* a set of xmlParserOption used for parsing XML includes */
27153     int n_flags;
27154 
27155     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27156     for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27157         mem_base = xmlMemBlocks();
27158         ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27159         flags = gen_int(n_flags, 1);
27160 
27161         ret_val = xmlXIncludeSetFlags(ctxt, flags);
27162         desret_int(ret_val);
27163         call_tests++;
27164         des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27165         des_int(n_flags, flags, 1);
27166         xmlResetLastError();
27167         if (mem_base != xmlMemBlocks()) {
27168             printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27169 	           xmlMemBlocks() - mem_base);
27170 	    test_ret++;
27171             printf(" %d", n_ctxt);
27172             printf(" %d", n_flags);
27173             printf("\n");
27174         }
27175     }
27176     }
27177     function_tests++;
27178 #endif
27179 
27180     return(test_ret);
27181 }
27182 
27183 static int
test_xinclude(void)27184 test_xinclude(void) {
27185     int test_ret = 0;
27186 
27187     if (quiet == 0) printf("Testing xinclude : 7 of 9 functions ...\n");
27188     test_ret += test_xmlXIncludeNewContext();
27189     test_ret += test_xmlXIncludeProcess();
27190     test_ret += test_xmlXIncludeProcessFlags();
27191     test_ret += test_xmlXIncludeProcessFlagsData();
27192     test_ret += test_xmlXIncludeProcessNode();
27193     test_ret += test_xmlXIncludeProcessTree();
27194     test_ret += test_xmlXIncludeProcessTreeFlags();
27195     test_ret += test_xmlXIncludeSetFlags();
27196 
27197     if (test_ret != 0)
27198 	printf("Module xinclude: %d errors\n", test_ret);
27199     return(test_ret);
27200 }
27201 
27202 static int
test_xmlAllocOutputBuffer(void)27203 test_xmlAllocOutputBuffer(void) {
27204     int test_ret = 0;
27205 
27206 #if defined(LIBXML_OUTPUT_ENABLED)
27207     int mem_base;
27208     xmlOutputBufferPtr ret_val;
27209     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27210     int n_encoder;
27211 
27212     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27213         mem_base = xmlMemBlocks();
27214         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27215 
27216         ret_val = xmlAllocOutputBuffer(encoder);
27217         desret_xmlOutputBufferPtr(ret_val);
27218         call_tests++;
27219         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27220         xmlResetLastError();
27221         if (mem_base != xmlMemBlocks()) {
27222             printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27223 	           xmlMemBlocks() - mem_base);
27224 	    test_ret++;
27225             printf(" %d", n_encoder);
27226             printf("\n");
27227         }
27228     }
27229     function_tests++;
27230 #endif
27231 
27232     return(test_ret);
27233 }
27234 
27235 
27236 static int
test_xmlAllocParserInputBuffer(void)27237 test_xmlAllocParserInputBuffer(void) {
27238     int test_ret = 0;
27239 
27240     int mem_base;
27241     xmlParserInputBufferPtr ret_val;
27242     xmlCharEncoding enc; /* the charset encoding if known */
27243     int n_enc;
27244 
27245     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27246         mem_base = xmlMemBlocks();
27247         enc = gen_xmlCharEncoding(n_enc, 0);
27248 
27249         ret_val = xmlAllocParserInputBuffer(enc);
27250         desret_xmlParserInputBufferPtr(ret_val);
27251         call_tests++;
27252         des_xmlCharEncoding(n_enc, enc, 0);
27253         xmlResetLastError();
27254         if (mem_base != xmlMemBlocks()) {
27255             printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27256 	           xmlMemBlocks() - mem_base);
27257 	    test_ret++;
27258             printf(" %d", n_enc);
27259             printf("\n");
27260         }
27261     }
27262     function_tests++;
27263 
27264     return(test_ret);
27265 }
27266 
27267 
27268 static int
test_xmlCheckFilename(void)27269 test_xmlCheckFilename(void) {
27270     int test_ret = 0;
27271 
27272     int mem_base;
27273     int ret_val;
27274     char * path; /* the path to check */
27275     int n_path;
27276 
27277     for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27278         mem_base = xmlMemBlocks();
27279         path = gen_const_char_ptr(n_path, 0);
27280 
27281         ret_val = xmlCheckFilename((const char *)path);
27282         desret_int(ret_val);
27283         call_tests++;
27284         des_const_char_ptr(n_path, (const char *)path, 0);
27285         xmlResetLastError();
27286         if (mem_base != xmlMemBlocks()) {
27287             printf("Leak of %d blocks found in xmlCheckFilename",
27288 	           xmlMemBlocks() - mem_base);
27289 	    test_ret++;
27290             printf(" %d", n_path);
27291             printf("\n");
27292         }
27293     }
27294     function_tests++;
27295 
27296     return(test_ret);
27297 }
27298 
27299 
27300 static int
test_xmlCheckHTTPInput(void)27301 test_xmlCheckHTTPInput(void) {
27302     int test_ret = 0;
27303 
27304     int mem_base;
27305     xmlParserInputPtr ret_val;
27306     xmlParserCtxtPtr ctxt; /* an XML parser context */
27307     int n_ctxt;
27308     xmlParserInputPtr ret; /* an XML parser input */
27309     int n_ret;
27310 
27311     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27312     for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27313         mem_base = xmlMemBlocks();
27314         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27315         ret = gen_xmlParserInputPtr(n_ret, 1);
27316 
27317         ret_val = xmlCheckHTTPInput(ctxt, ret);
27318         desret_xmlParserInputPtr(ret_val);
27319         call_tests++;
27320         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27321         des_xmlParserInputPtr(n_ret, ret, 1);
27322         xmlResetLastError();
27323         if (mem_base != xmlMemBlocks()) {
27324             printf("Leak of %d blocks found in xmlCheckHTTPInput",
27325 	           xmlMemBlocks() - mem_base);
27326 	    test_ret++;
27327             printf(" %d", n_ctxt);
27328             printf(" %d", n_ret);
27329             printf("\n");
27330         }
27331     }
27332     }
27333     function_tests++;
27334 
27335     return(test_ret);
27336 }
27337 
27338 
27339 static int
test_xmlCleanupInputCallbacks(void)27340 test_xmlCleanupInputCallbacks(void) {
27341     int test_ret = 0;
27342 
27343     int mem_base;
27344 
27345         mem_base = xmlMemBlocks();
27346 
27347         xmlCleanupInputCallbacks();
27348         call_tests++;
27349         xmlResetLastError();
27350         if (mem_base != xmlMemBlocks()) {
27351             printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27352 	           xmlMemBlocks() - mem_base);
27353 	    test_ret++;
27354             printf("\n");
27355         }
27356     function_tests++;
27357 
27358     return(test_ret);
27359 }
27360 
27361 
27362 static int
test_xmlCleanupOutputCallbacks(void)27363 test_xmlCleanupOutputCallbacks(void) {
27364     int test_ret = 0;
27365 
27366 #if defined(LIBXML_OUTPUT_ENABLED)
27367     int mem_base;
27368 
27369         mem_base = xmlMemBlocks();
27370 
27371         xmlCleanupOutputCallbacks();
27372         call_tests++;
27373         xmlResetLastError();
27374         if (mem_base != xmlMemBlocks()) {
27375             printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27376 	           xmlMemBlocks() - mem_base);
27377 	    test_ret++;
27378             printf("\n");
27379         }
27380     function_tests++;
27381 #endif
27382 
27383     return(test_ret);
27384 }
27385 
27386 
27387 static int
test_xmlFileClose(void)27388 test_xmlFileClose(void) {
27389     int test_ret = 0;
27390 
27391     int mem_base;
27392     int ret_val;
27393     void * context; /* the I/O context */
27394     int n_context;
27395 
27396     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27397         mem_base = xmlMemBlocks();
27398         context = gen_void_ptr(n_context, 0);
27399 
27400         ret_val = xmlFileClose(context);
27401         desret_int(ret_val);
27402         call_tests++;
27403         des_void_ptr(n_context, context, 0);
27404         xmlResetLastError();
27405         if (mem_base != xmlMemBlocks()) {
27406             printf("Leak of %d blocks found in xmlFileClose",
27407 	           xmlMemBlocks() - mem_base);
27408 	    test_ret++;
27409             printf(" %d", n_context);
27410             printf("\n");
27411         }
27412     }
27413     function_tests++;
27414 
27415     return(test_ret);
27416 }
27417 
27418 
27419 static int
test_xmlFileMatch(void)27420 test_xmlFileMatch(void) {
27421     int test_ret = 0;
27422 
27423     int mem_base;
27424     int ret_val;
27425     const char * filename; /* the URI for matching */
27426     int n_filename;
27427 
27428     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27429         mem_base = xmlMemBlocks();
27430         filename = gen_filepath(n_filename, 0);
27431 
27432         ret_val = xmlFileMatch(filename);
27433         desret_int(ret_val);
27434         call_tests++;
27435         des_filepath(n_filename, filename, 0);
27436         xmlResetLastError();
27437         if (mem_base != xmlMemBlocks()) {
27438             printf("Leak of %d blocks found in xmlFileMatch",
27439 	           xmlMemBlocks() - mem_base);
27440 	    test_ret++;
27441             printf(" %d", n_filename);
27442             printf("\n");
27443         }
27444     }
27445     function_tests++;
27446 
27447     return(test_ret);
27448 }
27449 
27450 
27451 static int
test_xmlFileOpen(void)27452 test_xmlFileOpen(void) {
27453     int test_ret = 0;
27454 
27455     int mem_base;
27456     void * ret_val;
27457     const char * filename; /* the URI for matching */
27458     int n_filename;
27459 
27460     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27461         mem_base = xmlMemBlocks();
27462         filename = gen_filepath(n_filename, 0);
27463 
27464         ret_val = xmlFileOpen(filename);
27465         desret_void_ptr(ret_val);
27466         call_tests++;
27467         des_filepath(n_filename, filename, 0);
27468         xmlResetLastError();
27469         if (mem_base != xmlMemBlocks()) {
27470             printf("Leak of %d blocks found in xmlFileOpen",
27471 	           xmlMemBlocks() - mem_base);
27472 	    test_ret++;
27473             printf(" %d", n_filename);
27474             printf("\n");
27475         }
27476     }
27477     function_tests++;
27478 
27479     return(test_ret);
27480 }
27481 
27482 
27483 static int
test_xmlFileRead(void)27484 test_xmlFileRead(void) {
27485     int test_ret = 0;
27486 
27487     int mem_base;
27488     int ret_val;
27489     void * context; /* the I/O context */
27490     int n_context;
27491     char * buffer; /* where to drop data */
27492     int n_buffer;
27493     int len; /* number of bytes to write */
27494     int n_len;
27495 
27496     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27497     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27498     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27499         mem_base = xmlMemBlocks();
27500         context = gen_void_ptr(n_context, 0);
27501         buffer = gen_char_ptr(n_buffer, 1);
27502         len = gen_int(n_len, 2);
27503 
27504         ret_val = xmlFileRead(context, buffer, len);
27505         desret_int(ret_val);
27506         call_tests++;
27507         des_void_ptr(n_context, context, 0);
27508         des_char_ptr(n_buffer, buffer, 1);
27509         des_int(n_len, len, 2);
27510         xmlResetLastError();
27511         if (mem_base != xmlMemBlocks()) {
27512             printf("Leak of %d blocks found in xmlFileRead",
27513 	           xmlMemBlocks() - mem_base);
27514 	    test_ret++;
27515             printf(" %d", n_context);
27516             printf(" %d", n_buffer);
27517             printf(" %d", n_len);
27518             printf("\n");
27519         }
27520     }
27521     }
27522     }
27523     function_tests++;
27524 
27525     return(test_ret);
27526 }
27527 
27528 
27529 static int
test_xmlIOFTPClose(void)27530 test_xmlIOFTPClose(void) {
27531     int test_ret = 0;
27532 
27533 #if defined(LIBXML_FTP_ENABLED)
27534     int mem_base;
27535     int ret_val;
27536     void * context; /* the I/O context */
27537     int n_context;
27538 
27539     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27540         mem_base = xmlMemBlocks();
27541         context = gen_void_ptr(n_context, 0);
27542 
27543         ret_val = xmlIOFTPClose(context);
27544         desret_int(ret_val);
27545         call_tests++;
27546         des_void_ptr(n_context, context, 0);
27547         xmlResetLastError();
27548         if (mem_base != xmlMemBlocks()) {
27549             printf("Leak of %d blocks found in xmlIOFTPClose",
27550 	           xmlMemBlocks() - mem_base);
27551 	    test_ret++;
27552             printf(" %d", n_context);
27553             printf("\n");
27554         }
27555     }
27556     function_tests++;
27557 #endif
27558 
27559     return(test_ret);
27560 }
27561 
27562 
27563 static int
test_xmlIOFTPMatch(void)27564 test_xmlIOFTPMatch(void) {
27565     int test_ret = 0;
27566 
27567 #if defined(LIBXML_FTP_ENABLED)
27568     int mem_base;
27569     int ret_val;
27570     const char * filename; /* the URI for matching */
27571     int n_filename;
27572 
27573     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27574         mem_base = xmlMemBlocks();
27575         filename = gen_filepath(n_filename, 0);
27576 
27577         ret_val = xmlIOFTPMatch(filename);
27578         desret_int(ret_val);
27579         call_tests++;
27580         des_filepath(n_filename, filename, 0);
27581         xmlResetLastError();
27582         if (mem_base != xmlMemBlocks()) {
27583             printf("Leak of %d blocks found in xmlIOFTPMatch",
27584 	           xmlMemBlocks() - mem_base);
27585 	    test_ret++;
27586             printf(" %d", n_filename);
27587             printf("\n");
27588         }
27589     }
27590     function_tests++;
27591 #endif
27592 
27593     return(test_ret);
27594 }
27595 
27596 
27597 static int
test_xmlIOFTPOpen(void)27598 test_xmlIOFTPOpen(void) {
27599     int test_ret = 0;
27600 
27601 #if defined(LIBXML_FTP_ENABLED)
27602     int mem_base;
27603     void * ret_val;
27604     const char * filename; /* the URI for matching */
27605     int n_filename;
27606 
27607     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27608         mem_base = xmlMemBlocks();
27609         filename = gen_filepath(n_filename, 0);
27610 
27611         ret_val = xmlIOFTPOpen(filename);
27612         desret_void_ptr(ret_val);
27613         call_tests++;
27614         des_filepath(n_filename, filename, 0);
27615         xmlResetLastError();
27616         if (mem_base != xmlMemBlocks()) {
27617             printf("Leak of %d blocks found in xmlIOFTPOpen",
27618 	           xmlMemBlocks() - mem_base);
27619 	    test_ret++;
27620             printf(" %d", n_filename);
27621             printf("\n");
27622         }
27623     }
27624     function_tests++;
27625 #endif
27626 
27627     return(test_ret);
27628 }
27629 
27630 
27631 static int
test_xmlIOFTPRead(void)27632 test_xmlIOFTPRead(void) {
27633     int test_ret = 0;
27634 
27635 #if defined(LIBXML_FTP_ENABLED)
27636     int mem_base;
27637     int ret_val;
27638     void * context; /* the I/O context */
27639     int n_context;
27640     char * buffer; /* where to drop data */
27641     int n_buffer;
27642     int len; /* number of bytes to write */
27643     int n_len;
27644 
27645     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27646     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27647     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27648         mem_base = xmlMemBlocks();
27649         context = gen_void_ptr(n_context, 0);
27650         buffer = gen_char_ptr(n_buffer, 1);
27651         len = gen_int(n_len, 2);
27652 
27653         ret_val = xmlIOFTPRead(context, buffer, len);
27654         desret_int(ret_val);
27655         call_tests++;
27656         des_void_ptr(n_context, context, 0);
27657         des_char_ptr(n_buffer, buffer, 1);
27658         des_int(n_len, len, 2);
27659         xmlResetLastError();
27660         if (mem_base != xmlMemBlocks()) {
27661             printf("Leak of %d blocks found in xmlIOFTPRead",
27662 	           xmlMemBlocks() - mem_base);
27663 	    test_ret++;
27664             printf(" %d", n_context);
27665             printf(" %d", n_buffer);
27666             printf(" %d", n_len);
27667             printf("\n");
27668         }
27669     }
27670     }
27671     }
27672     function_tests++;
27673 #endif
27674 
27675     return(test_ret);
27676 }
27677 
27678 
27679 static int
test_xmlIOHTTPClose(void)27680 test_xmlIOHTTPClose(void) {
27681     int test_ret = 0;
27682 
27683 #if defined(LIBXML_HTTP_ENABLED)
27684     int mem_base;
27685     int ret_val;
27686     void * context; /* the I/O context */
27687     int n_context;
27688 
27689     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27690         mem_base = xmlMemBlocks();
27691         context = gen_void_ptr(n_context, 0);
27692 
27693         ret_val = xmlIOHTTPClose(context);
27694         desret_int(ret_val);
27695         call_tests++;
27696         des_void_ptr(n_context, context, 0);
27697         xmlResetLastError();
27698         if (mem_base != xmlMemBlocks()) {
27699             printf("Leak of %d blocks found in xmlIOHTTPClose",
27700 	           xmlMemBlocks() - mem_base);
27701 	    test_ret++;
27702             printf(" %d", n_context);
27703             printf("\n");
27704         }
27705     }
27706     function_tests++;
27707 #endif
27708 
27709     return(test_ret);
27710 }
27711 
27712 
27713 static int
test_xmlIOHTTPMatch(void)27714 test_xmlIOHTTPMatch(void) {
27715     int test_ret = 0;
27716 
27717 #if defined(LIBXML_HTTP_ENABLED)
27718     int mem_base;
27719     int ret_val;
27720     const char * filename; /* the URI for matching */
27721     int n_filename;
27722 
27723     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27724         mem_base = xmlMemBlocks();
27725         filename = gen_filepath(n_filename, 0);
27726 
27727         ret_val = xmlIOHTTPMatch(filename);
27728         desret_int(ret_val);
27729         call_tests++;
27730         des_filepath(n_filename, filename, 0);
27731         xmlResetLastError();
27732         if (mem_base != xmlMemBlocks()) {
27733             printf("Leak of %d blocks found in xmlIOHTTPMatch",
27734 	           xmlMemBlocks() - mem_base);
27735 	    test_ret++;
27736             printf(" %d", n_filename);
27737             printf("\n");
27738         }
27739     }
27740     function_tests++;
27741 #endif
27742 
27743     return(test_ret);
27744 }
27745 
27746 
27747 static int
test_xmlIOHTTPOpen(void)27748 test_xmlIOHTTPOpen(void) {
27749     int test_ret = 0;
27750 
27751 #if defined(LIBXML_HTTP_ENABLED)
27752     int mem_base;
27753     void * ret_val;
27754     const char * filename; /* the URI for matching */
27755     int n_filename;
27756 
27757     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27758         mem_base = xmlMemBlocks();
27759         filename = gen_filepath(n_filename, 0);
27760 
27761         ret_val = xmlIOHTTPOpen(filename);
27762         desret_xmlNanoHTTPCtxtPtr(ret_val);
27763         call_tests++;
27764         des_filepath(n_filename, filename, 0);
27765         xmlResetLastError();
27766         if (mem_base != xmlMemBlocks()) {
27767             printf("Leak of %d blocks found in xmlIOHTTPOpen",
27768 	           xmlMemBlocks() - mem_base);
27769 	    test_ret++;
27770             printf(" %d", n_filename);
27771             printf("\n");
27772         }
27773     }
27774     function_tests++;
27775 #endif
27776 
27777     return(test_ret);
27778 }
27779 
27780 
27781 static int
test_xmlIOHTTPRead(void)27782 test_xmlIOHTTPRead(void) {
27783     int test_ret = 0;
27784 
27785 #if defined(LIBXML_HTTP_ENABLED)
27786     int mem_base;
27787     int ret_val;
27788     void * context; /* the I/O context */
27789     int n_context;
27790     char * buffer; /* where to drop data */
27791     int n_buffer;
27792     int len; /* number of bytes to write */
27793     int n_len;
27794 
27795     for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27796     for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27797     for (n_len = 0;n_len < gen_nb_int;n_len++) {
27798         mem_base = xmlMemBlocks();
27799         context = gen_void_ptr(n_context, 0);
27800         buffer = gen_char_ptr(n_buffer, 1);
27801         len = gen_int(n_len, 2);
27802 
27803         ret_val = xmlIOHTTPRead(context, buffer, len);
27804         desret_int(ret_val);
27805         call_tests++;
27806         des_void_ptr(n_context, context, 0);
27807         des_char_ptr(n_buffer, buffer, 1);
27808         des_int(n_len, len, 2);
27809         xmlResetLastError();
27810         if (mem_base != xmlMemBlocks()) {
27811             printf("Leak of %d blocks found in xmlIOHTTPRead",
27812 	           xmlMemBlocks() - mem_base);
27813 	    test_ret++;
27814             printf(" %d", n_context);
27815             printf(" %d", n_buffer);
27816             printf(" %d", n_len);
27817             printf("\n");
27818         }
27819     }
27820     }
27821     }
27822     function_tests++;
27823 #endif
27824 
27825     return(test_ret);
27826 }
27827 
27828 
27829 static int
test_xmlNoNetExternalEntityLoader(void)27830 test_xmlNoNetExternalEntityLoader(void) {
27831     int test_ret = 0;
27832 
27833     int mem_base;
27834     xmlParserInputPtr ret_val;
27835     const char * URL; /* the URL for the entity to load */
27836     int n_URL;
27837     char * ID; /* the System ID for the entity to load */
27838     int n_ID;
27839     xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27840     int n_ctxt;
27841 
27842     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27843     for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27844     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27845         mem_base = xmlMemBlocks();
27846         URL = gen_filepath(n_URL, 0);
27847         ID = gen_const_char_ptr(n_ID, 1);
27848         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27849 
27850         ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27851         desret_xmlParserInputPtr(ret_val);
27852         call_tests++;
27853         des_filepath(n_URL, URL, 0);
27854         des_const_char_ptr(n_ID, (const char *)ID, 1);
27855         des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27856         xmlResetLastError();
27857         if (mem_base != xmlMemBlocks()) {
27858             printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27859 	           xmlMemBlocks() - mem_base);
27860 	    test_ret++;
27861             printf(" %d", n_URL);
27862             printf(" %d", n_ID);
27863             printf(" %d", n_ctxt);
27864             printf("\n");
27865         }
27866     }
27867     }
27868     }
27869     function_tests++;
27870 
27871     return(test_ret);
27872 }
27873 
27874 
27875 static int
test_xmlNormalizeWindowsPath(void)27876 test_xmlNormalizeWindowsPath(void) {
27877     int test_ret = 0;
27878 
27879     int mem_base;
27880     xmlChar * ret_val;
27881     xmlChar * path; /* the input file path */
27882     int n_path;
27883 
27884     for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27885         mem_base = xmlMemBlocks();
27886         path = gen_const_xmlChar_ptr(n_path, 0);
27887 
27888         ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27889         desret_xmlChar_ptr(ret_val);
27890         call_tests++;
27891         des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27892         xmlResetLastError();
27893         if (mem_base != xmlMemBlocks()) {
27894             printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27895 	           xmlMemBlocks() - mem_base);
27896 	    test_ret++;
27897             printf(" %d", n_path);
27898             printf("\n");
27899         }
27900     }
27901     function_tests++;
27902 
27903     return(test_ret);
27904 }
27905 
27906 
27907 static int
test_xmlOutputBufferCreateBuffer(void)27908 test_xmlOutputBufferCreateBuffer(void) {
27909     int test_ret = 0;
27910 
27911 #if defined(LIBXML_OUTPUT_ENABLED)
27912     int mem_base;
27913     xmlOutputBufferPtr ret_val;
27914     xmlBufferPtr buffer; /* a xmlBufferPtr */
27915     int n_buffer;
27916     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27917     int n_encoder;
27918 
27919     for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
27920     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27921         mem_base = xmlMemBlocks();
27922         buffer = gen_xmlBufferPtr(n_buffer, 0);
27923         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27924 
27925         ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
27926         desret_xmlOutputBufferPtr(ret_val);
27927         call_tests++;
27928         des_xmlBufferPtr(n_buffer, buffer, 0);
27929         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27930         xmlResetLastError();
27931         if (mem_base != xmlMemBlocks()) {
27932             printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
27933 	           xmlMemBlocks() - mem_base);
27934 	    test_ret++;
27935             printf(" %d", n_buffer);
27936             printf(" %d", n_encoder);
27937             printf("\n");
27938         }
27939     }
27940     }
27941     function_tests++;
27942 #endif
27943 
27944     return(test_ret);
27945 }
27946 
27947 
27948 static int
test_xmlOutputBufferCreateFd(void)27949 test_xmlOutputBufferCreateFd(void) {
27950     int test_ret = 0;
27951 
27952 #if defined(LIBXML_OUTPUT_ENABLED)
27953     int mem_base;
27954     xmlOutputBufferPtr ret_val;
27955     int fd; /* a file descriptor number */
27956     int n_fd;
27957     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27958     int n_encoder;
27959 
27960     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
27961     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27962         mem_base = xmlMemBlocks();
27963         fd = gen_int(n_fd, 0);
27964         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27965 
27966         ret_val = xmlOutputBufferCreateFd(fd, encoder);
27967         desret_xmlOutputBufferPtr(ret_val);
27968         call_tests++;
27969         des_int(n_fd, fd, 0);
27970         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27971         xmlResetLastError();
27972         if (mem_base != xmlMemBlocks()) {
27973             printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
27974 	           xmlMemBlocks() - mem_base);
27975 	    test_ret++;
27976             printf(" %d", n_fd);
27977             printf(" %d", n_encoder);
27978             printf("\n");
27979         }
27980     }
27981     }
27982     function_tests++;
27983 #endif
27984 
27985     return(test_ret);
27986 }
27987 
27988 
27989 static int
test_xmlOutputBufferCreateFile(void)27990 test_xmlOutputBufferCreateFile(void) {
27991     int test_ret = 0;
27992 
27993 #if defined(LIBXML_OUTPUT_ENABLED)
27994     int mem_base;
27995     xmlOutputBufferPtr ret_val;
27996     FILE * file; /* a FILE* */
27997     int n_file;
27998     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27999     int n_encoder;
28000 
28001     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28002     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28003         mem_base = xmlMemBlocks();
28004         file = gen_FILE_ptr(n_file, 0);
28005         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28006 
28007         ret_val = xmlOutputBufferCreateFile(file, encoder);
28008         desret_xmlOutputBufferPtr(ret_val);
28009         call_tests++;
28010         des_FILE_ptr(n_file, file, 0);
28011         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28012         xmlResetLastError();
28013         if (mem_base != xmlMemBlocks()) {
28014             printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28015 	           xmlMemBlocks() - mem_base);
28016 	    test_ret++;
28017             printf(" %d", n_file);
28018             printf(" %d", n_encoder);
28019             printf("\n");
28020         }
28021     }
28022     }
28023     function_tests++;
28024 #endif
28025 
28026     return(test_ret);
28027 }
28028 
28029 
28030 static int
test_xmlOutputBufferCreateFilename(void)28031 test_xmlOutputBufferCreateFilename(void) {
28032     int test_ret = 0;
28033 
28034 #if defined(LIBXML_OUTPUT_ENABLED)
28035     int mem_base;
28036     xmlOutputBufferPtr ret_val;
28037     const char * URI; /* a C string containing the URI or filename */
28038     int n_URI;
28039     xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28040     int n_encoder;
28041     int compression; /* the compression ration (0 none, 9 max). */
28042     int n_compression;
28043 
28044     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28045     for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28046     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28047         mem_base = xmlMemBlocks();
28048         URI = gen_fileoutput(n_URI, 0);
28049         encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28050         compression = gen_int(n_compression, 2);
28051 
28052         ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28053         desret_xmlOutputBufferPtr(ret_val);
28054         call_tests++;
28055         des_fileoutput(n_URI, URI, 0);
28056         des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28057         des_int(n_compression, compression, 2);
28058         xmlResetLastError();
28059         if (mem_base != xmlMemBlocks()) {
28060             printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28061 	           xmlMemBlocks() - mem_base);
28062 	    test_ret++;
28063             printf(" %d", n_URI);
28064             printf(" %d", n_encoder);
28065             printf(" %d", n_compression);
28066             printf("\n");
28067         }
28068     }
28069     }
28070     }
28071     function_tests++;
28072 #endif
28073 
28074     return(test_ret);
28075 }
28076 
28077 
28078 static int
test_xmlOutputBufferFlush(void)28079 test_xmlOutputBufferFlush(void) {
28080     int test_ret = 0;
28081 
28082 #if defined(LIBXML_OUTPUT_ENABLED)
28083     int mem_base;
28084     int ret_val;
28085     xmlOutputBufferPtr out; /* a buffered output */
28086     int n_out;
28087 
28088     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28089         mem_base = xmlMemBlocks();
28090         out = gen_xmlOutputBufferPtr(n_out, 0);
28091 
28092         ret_val = xmlOutputBufferFlush(out);
28093         desret_int(ret_val);
28094         call_tests++;
28095         des_xmlOutputBufferPtr(n_out, out, 0);
28096         xmlResetLastError();
28097         if (mem_base != xmlMemBlocks()) {
28098             printf("Leak of %d blocks found in xmlOutputBufferFlush",
28099 	           xmlMemBlocks() - mem_base);
28100 	    test_ret++;
28101             printf(" %d", n_out);
28102             printf("\n");
28103         }
28104     }
28105     function_tests++;
28106 #endif
28107 
28108     return(test_ret);
28109 }
28110 
28111 
28112 static int
test_xmlOutputBufferWrite(void)28113 test_xmlOutputBufferWrite(void) {
28114     int test_ret = 0;
28115 
28116 #if defined(LIBXML_OUTPUT_ENABLED)
28117     int mem_base;
28118     int ret_val;
28119     xmlOutputBufferPtr out; /* a buffered parser output */
28120     int n_out;
28121     int len; /* the size in bytes of the array. */
28122     int n_len;
28123     char * buf; /* an char array */
28124     int n_buf;
28125 
28126     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28127     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28128     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28129         mem_base = xmlMemBlocks();
28130         out = gen_xmlOutputBufferPtr(n_out, 0);
28131         len = gen_int(n_len, 1);
28132         buf = gen_const_char_ptr(n_buf, 2);
28133 
28134         ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28135         desret_int(ret_val);
28136         call_tests++;
28137         des_xmlOutputBufferPtr(n_out, out, 0);
28138         des_int(n_len, len, 1);
28139         des_const_char_ptr(n_buf, (const char *)buf, 2);
28140         xmlResetLastError();
28141         if (mem_base != xmlMemBlocks()) {
28142             printf("Leak of %d blocks found in xmlOutputBufferWrite",
28143 	           xmlMemBlocks() - mem_base);
28144 	    test_ret++;
28145             printf(" %d", n_out);
28146             printf(" %d", n_len);
28147             printf(" %d", n_buf);
28148             printf("\n");
28149         }
28150     }
28151     }
28152     }
28153     function_tests++;
28154 #endif
28155 
28156     return(test_ret);
28157 }
28158 
28159 
28160 static int
test_xmlOutputBufferWriteEscape(void)28161 test_xmlOutputBufferWriteEscape(void) {
28162     int test_ret = 0;
28163 
28164 
28165     /* missing type support */
28166     return(test_ret);
28167 }
28168 
28169 
28170 static int
test_xmlOutputBufferWriteString(void)28171 test_xmlOutputBufferWriteString(void) {
28172     int test_ret = 0;
28173 
28174 #if defined(LIBXML_OUTPUT_ENABLED)
28175     int mem_base;
28176     int ret_val;
28177     xmlOutputBufferPtr out; /* a buffered parser output */
28178     int n_out;
28179     char * str; /* a zero terminated C string */
28180     int n_str;
28181 
28182     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28183     for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28184         mem_base = xmlMemBlocks();
28185         out = gen_xmlOutputBufferPtr(n_out, 0);
28186         str = gen_const_char_ptr(n_str, 1);
28187 
28188         ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28189         desret_int(ret_val);
28190         call_tests++;
28191         des_xmlOutputBufferPtr(n_out, out, 0);
28192         des_const_char_ptr(n_str, (const char *)str, 1);
28193         xmlResetLastError();
28194         if (mem_base != xmlMemBlocks()) {
28195             printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28196 	           xmlMemBlocks() - mem_base);
28197 	    test_ret++;
28198             printf(" %d", n_out);
28199             printf(" %d", n_str);
28200             printf("\n");
28201         }
28202     }
28203     }
28204     function_tests++;
28205 #endif
28206 
28207     return(test_ret);
28208 }
28209 
28210 
28211 static int
test_xmlParserGetDirectory(void)28212 test_xmlParserGetDirectory(void) {
28213     int test_ret = 0;
28214 
28215 
28216     /* missing type support */
28217     return(test_ret);
28218 }
28219 
28220 
28221 static int
test_xmlParserInputBufferCreateFd(void)28222 test_xmlParserInputBufferCreateFd(void) {
28223     int test_ret = 0;
28224 
28225     int mem_base;
28226     xmlParserInputBufferPtr ret_val;
28227     int fd; /* a file descriptor number */
28228     int n_fd;
28229     xmlCharEncoding enc; /* the charset encoding if known */
28230     int n_enc;
28231 
28232     for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28233     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28234         mem_base = xmlMemBlocks();
28235         fd = gen_int(n_fd, 0);
28236         enc = gen_xmlCharEncoding(n_enc, 1);
28237         if (fd >= 0) fd = -1;
28238 
28239         ret_val = xmlParserInputBufferCreateFd(fd, enc);
28240         desret_xmlParserInputBufferPtr(ret_val);
28241         call_tests++;
28242         des_int(n_fd, fd, 0);
28243         des_xmlCharEncoding(n_enc, enc, 1);
28244         xmlResetLastError();
28245         if (mem_base != xmlMemBlocks()) {
28246             printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28247 	           xmlMemBlocks() - mem_base);
28248 	    test_ret++;
28249             printf(" %d", n_fd);
28250             printf(" %d", n_enc);
28251             printf("\n");
28252         }
28253     }
28254     }
28255     function_tests++;
28256 
28257     return(test_ret);
28258 }
28259 
28260 
28261 static int
test_xmlParserInputBufferCreateFile(void)28262 test_xmlParserInputBufferCreateFile(void) {
28263     int test_ret = 0;
28264 
28265     int mem_base;
28266     xmlParserInputBufferPtr ret_val;
28267     FILE * file; /* a FILE* */
28268     int n_file;
28269     xmlCharEncoding enc; /* the charset encoding if known */
28270     int n_enc;
28271 
28272     for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28273     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28274         mem_base = xmlMemBlocks();
28275         file = gen_FILE_ptr(n_file, 0);
28276         enc = gen_xmlCharEncoding(n_enc, 1);
28277 
28278         ret_val = xmlParserInputBufferCreateFile(file, enc);
28279         desret_xmlParserInputBufferPtr(ret_val);
28280         call_tests++;
28281         des_FILE_ptr(n_file, file, 0);
28282         des_xmlCharEncoding(n_enc, enc, 1);
28283         xmlResetLastError();
28284         if (mem_base != xmlMemBlocks()) {
28285             printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28286 	           xmlMemBlocks() - mem_base);
28287 	    test_ret++;
28288             printf(" %d", n_file);
28289             printf(" %d", n_enc);
28290             printf("\n");
28291         }
28292     }
28293     }
28294     function_tests++;
28295 
28296     return(test_ret);
28297 }
28298 
28299 
28300 static int
test_xmlParserInputBufferCreateFilename(void)28301 test_xmlParserInputBufferCreateFilename(void) {
28302     int test_ret = 0;
28303 
28304     int mem_base;
28305     xmlParserInputBufferPtr ret_val;
28306     const char * URI; /* a C string containing the URI or filename */
28307     int n_URI;
28308     xmlCharEncoding enc; /* the charset encoding if known */
28309     int n_enc;
28310 
28311     for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28312     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28313         mem_base = xmlMemBlocks();
28314         URI = gen_fileoutput(n_URI, 0);
28315         enc = gen_xmlCharEncoding(n_enc, 1);
28316 
28317         ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28318         desret_xmlParserInputBufferPtr(ret_val);
28319         call_tests++;
28320         des_fileoutput(n_URI, URI, 0);
28321         des_xmlCharEncoding(n_enc, enc, 1);
28322         xmlResetLastError();
28323         if (mem_base != xmlMemBlocks()) {
28324             printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28325 	           xmlMemBlocks() - mem_base);
28326 	    test_ret++;
28327             printf(" %d", n_URI);
28328             printf(" %d", n_enc);
28329             printf("\n");
28330         }
28331     }
28332     }
28333     function_tests++;
28334 
28335     return(test_ret);
28336 }
28337 
28338 
28339 static int
test_xmlParserInputBufferCreateMem(void)28340 test_xmlParserInputBufferCreateMem(void) {
28341     int test_ret = 0;
28342 
28343     int mem_base;
28344     xmlParserInputBufferPtr ret_val;
28345     char * mem; /* the memory input */
28346     int n_mem;
28347     int size; /* the length of the memory block */
28348     int n_size;
28349     xmlCharEncoding enc; /* the charset encoding if known */
28350     int n_enc;
28351 
28352     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28353     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28354     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28355         mem_base = xmlMemBlocks();
28356         mem = gen_const_char_ptr(n_mem, 0);
28357         size = gen_int(n_size, 1);
28358         enc = gen_xmlCharEncoding(n_enc, 2);
28359 
28360         ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28361         desret_xmlParserInputBufferPtr(ret_val);
28362         call_tests++;
28363         des_const_char_ptr(n_mem, (const char *)mem, 0);
28364         des_int(n_size, size, 1);
28365         des_xmlCharEncoding(n_enc, enc, 2);
28366         xmlResetLastError();
28367         if (mem_base != xmlMemBlocks()) {
28368             printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28369 	           xmlMemBlocks() - mem_base);
28370 	    test_ret++;
28371             printf(" %d", n_mem);
28372             printf(" %d", n_size);
28373             printf(" %d", n_enc);
28374             printf("\n");
28375         }
28376     }
28377     }
28378     }
28379     function_tests++;
28380 
28381     return(test_ret);
28382 }
28383 
28384 
28385 static int
test_xmlParserInputBufferCreateStatic(void)28386 test_xmlParserInputBufferCreateStatic(void) {
28387     int test_ret = 0;
28388 
28389     int mem_base;
28390     xmlParserInputBufferPtr ret_val;
28391     char * mem; /* the memory input */
28392     int n_mem;
28393     int size; /* the length of the memory block */
28394     int n_size;
28395     xmlCharEncoding enc; /* the charset encoding if known */
28396     int n_enc;
28397 
28398     for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28399     for (n_size = 0;n_size < gen_nb_int;n_size++) {
28400     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28401         mem_base = xmlMemBlocks();
28402         mem = gen_const_char_ptr(n_mem, 0);
28403         size = gen_int(n_size, 1);
28404         enc = gen_xmlCharEncoding(n_enc, 2);
28405 
28406         ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28407         desret_xmlParserInputBufferPtr(ret_val);
28408         call_tests++;
28409         des_const_char_ptr(n_mem, (const char *)mem, 0);
28410         des_int(n_size, size, 1);
28411         des_xmlCharEncoding(n_enc, enc, 2);
28412         xmlResetLastError();
28413         if (mem_base != xmlMemBlocks()) {
28414             printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28415 	           xmlMemBlocks() - mem_base);
28416 	    test_ret++;
28417             printf(" %d", n_mem);
28418             printf(" %d", n_size);
28419             printf(" %d", n_enc);
28420             printf("\n");
28421         }
28422     }
28423     }
28424     }
28425     function_tests++;
28426 
28427     return(test_ret);
28428 }
28429 
28430 
28431 static int
test_xmlParserInputBufferGrow(void)28432 test_xmlParserInputBufferGrow(void) {
28433     int test_ret = 0;
28434 
28435     int mem_base;
28436     int ret_val;
28437     xmlParserInputBufferPtr in; /* a buffered parser input */
28438     int n_in;
28439     int len; /* indicative value of the amount of chars to read */
28440     int n_len;
28441 
28442     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28443     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28444         mem_base = xmlMemBlocks();
28445         in = gen_xmlParserInputBufferPtr(n_in, 0);
28446         len = gen_int(n_len, 1);
28447 
28448         ret_val = xmlParserInputBufferGrow(in, len);
28449         desret_int(ret_val);
28450         call_tests++;
28451         des_xmlParserInputBufferPtr(n_in, in, 0);
28452         des_int(n_len, len, 1);
28453         xmlResetLastError();
28454         if (mem_base != xmlMemBlocks()) {
28455             printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28456 	           xmlMemBlocks() - mem_base);
28457 	    test_ret++;
28458             printf(" %d", n_in);
28459             printf(" %d", n_len);
28460             printf("\n");
28461         }
28462     }
28463     }
28464     function_tests++;
28465 
28466     return(test_ret);
28467 }
28468 
28469 
28470 static int
test_xmlParserInputBufferPush(void)28471 test_xmlParserInputBufferPush(void) {
28472     int test_ret = 0;
28473 
28474     int mem_base;
28475     int ret_val;
28476     xmlParserInputBufferPtr in; /* a buffered parser input */
28477     int n_in;
28478     int len; /* the size in bytes of the array. */
28479     int n_len;
28480     char * buf; /* an char array */
28481     int n_buf;
28482 
28483     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28484     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28485     for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28486         mem_base = xmlMemBlocks();
28487         in = gen_xmlParserInputBufferPtr(n_in, 0);
28488         len = gen_int(n_len, 1);
28489         buf = gen_const_char_ptr(n_buf, 2);
28490 
28491         ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28492         desret_int(ret_val);
28493         call_tests++;
28494         des_xmlParserInputBufferPtr(n_in, in, 0);
28495         des_int(n_len, len, 1);
28496         des_const_char_ptr(n_buf, (const char *)buf, 2);
28497         xmlResetLastError();
28498         if (mem_base != xmlMemBlocks()) {
28499             printf("Leak of %d blocks found in xmlParserInputBufferPush",
28500 	           xmlMemBlocks() - mem_base);
28501 	    test_ret++;
28502             printf(" %d", n_in);
28503             printf(" %d", n_len);
28504             printf(" %d", n_buf);
28505             printf("\n");
28506         }
28507     }
28508     }
28509     }
28510     function_tests++;
28511 
28512     return(test_ret);
28513 }
28514 
28515 
28516 static int
test_xmlParserInputBufferRead(void)28517 test_xmlParserInputBufferRead(void) {
28518     int test_ret = 0;
28519 
28520     int mem_base;
28521     int ret_val;
28522     xmlParserInputBufferPtr in; /* a buffered parser input */
28523     int n_in;
28524     int len; /* indicative value of the amount of chars to read */
28525     int n_len;
28526 
28527     for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28528     for (n_len = 0;n_len < gen_nb_int;n_len++) {
28529         mem_base = xmlMemBlocks();
28530         in = gen_xmlParserInputBufferPtr(n_in, 0);
28531         len = gen_int(n_len, 1);
28532 
28533         ret_val = xmlParserInputBufferRead(in, len);
28534         desret_int(ret_val);
28535         call_tests++;
28536         des_xmlParserInputBufferPtr(n_in, in, 0);
28537         des_int(n_len, len, 1);
28538         xmlResetLastError();
28539         if (mem_base != xmlMemBlocks()) {
28540             printf("Leak of %d blocks found in xmlParserInputBufferRead",
28541 	           xmlMemBlocks() - mem_base);
28542 	    test_ret++;
28543             printf(" %d", n_in);
28544             printf(" %d", n_len);
28545             printf("\n");
28546         }
28547     }
28548     }
28549     function_tests++;
28550 
28551     return(test_ret);
28552 }
28553 
28554 
28555 static int
test_xmlPopInputCallbacks(void)28556 test_xmlPopInputCallbacks(void) {
28557     int test_ret = 0;
28558 
28559     int mem_base;
28560     int ret_val;
28561 
28562         mem_base = xmlMemBlocks();
28563 
28564         ret_val = xmlPopInputCallbacks();
28565         desret_int(ret_val);
28566         call_tests++;
28567         xmlResetLastError();
28568         if (mem_base != xmlMemBlocks()) {
28569             printf("Leak of %d blocks found in xmlPopInputCallbacks",
28570 	           xmlMemBlocks() - mem_base);
28571 	    test_ret++;
28572             printf("\n");
28573         }
28574     function_tests++;
28575 
28576     return(test_ret);
28577 }
28578 
28579 
28580 static int
test_xmlRegisterDefaultInputCallbacks(void)28581 test_xmlRegisterDefaultInputCallbacks(void) {
28582     int test_ret = 0;
28583 
28584     int mem_base;
28585 
28586         mem_base = xmlMemBlocks();
28587 
28588         xmlRegisterDefaultInputCallbacks();
28589         call_tests++;
28590         xmlResetLastError();
28591         if (mem_base != xmlMemBlocks()) {
28592             printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28593 	           xmlMemBlocks() - mem_base);
28594 	    test_ret++;
28595             printf("\n");
28596         }
28597     function_tests++;
28598 
28599     return(test_ret);
28600 }
28601 
28602 
28603 static int
test_xmlRegisterDefaultOutputCallbacks(void)28604 test_xmlRegisterDefaultOutputCallbacks(void) {
28605     int test_ret = 0;
28606 
28607 #if defined(LIBXML_OUTPUT_ENABLED)
28608     int mem_base;
28609 
28610         mem_base = xmlMemBlocks();
28611 
28612         xmlRegisterDefaultOutputCallbacks();
28613         call_tests++;
28614         xmlResetLastError();
28615         if (mem_base != xmlMemBlocks()) {
28616             printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28617 	           xmlMemBlocks() - mem_base);
28618 	    test_ret++;
28619             printf("\n");
28620         }
28621     function_tests++;
28622 #endif
28623 
28624     return(test_ret);
28625 }
28626 
28627 
28628 static int
test_xmlRegisterHTTPPostCallbacks(void)28629 test_xmlRegisterHTTPPostCallbacks(void) {
28630     int test_ret = 0;
28631 
28632 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28633     int mem_base;
28634 
28635         mem_base = xmlMemBlocks();
28636 
28637         xmlRegisterHTTPPostCallbacks();
28638         call_tests++;
28639         xmlResetLastError();
28640         if (mem_base != xmlMemBlocks()) {
28641             printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28642 	           xmlMemBlocks() - mem_base);
28643 	    test_ret++;
28644             printf("\n");
28645         }
28646     function_tests++;
28647 #endif
28648 
28649     return(test_ret);
28650 }
28651 
28652 static int
test_xmlIO(void)28653 test_xmlIO(void) {
28654     int test_ret = 0;
28655 
28656     if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28657     test_ret += test_xmlAllocOutputBuffer();
28658     test_ret += test_xmlAllocParserInputBuffer();
28659     test_ret += test_xmlCheckFilename();
28660     test_ret += test_xmlCheckHTTPInput();
28661     test_ret += test_xmlCleanupInputCallbacks();
28662     test_ret += test_xmlCleanupOutputCallbacks();
28663     test_ret += test_xmlFileClose();
28664     test_ret += test_xmlFileMatch();
28665     test_ret += test_xmlFileOpen();
28666     test_ret += test_xmlFileRead();
28667     test_ret += test_xmlIOFTPClose();
28668     test_ret += test_xmlIOFTPMatch();
28669     test_ret += test_xmlIOFTPOpen();
28670     test_ret += test_xmlIOFTPRead();
28671     test_ret += test_xmlIOHTTPClose();
28672     test_ret += test_xmlIOHTTPMatch();
28673     test_ret += test_xmlIOHTTPOpen();
28674     test_ret += test_xmlIOHTTPRead();
28675     test_ret += test_xmlNoNetExternalEntityLoader();
28676     test_ret += test_xmlNormalizeWindowsPath();
28677     test_ret += test_xmlOutputBufferCreateBuffer();
28678     test_ret += test_xmlOutputBufferCreateFd();
28679     test_ret += test_xmlOutputBufferCreateFile();
28680     test_ret += test_xmlOutputBufferCreateFilename();
28681     test_ret += test_xmlOutputBufferFlush();
28682     test_ret += test_xmlOutputBufferWrite();
28683     test_ret += test_xmlOutputBufferWriteEscape();
28684     test_ret += test_xmlOutputBufferWriteString();
28685     test_ret += test_xmlParserGetDirectory();
28686     test_ret += test_xmlParserInputBufferCreateFd();
28687     test_ret += test_xmlParserInputBufferCreateFile();
28688     test_ret += test_xmlParserInputBufferCreateFilename();
28689     test_ret += test_xmlParserInputBufferCreateMem();
28690     test_ret += test_xmlParserInputBufferCreateStatic();
28691     test_ret += test_xmlParserInputBufferGrow();
28692     test_ret += test_xmlParserInputBufferPush();
28693     test_ret += test_xmlParserInputBufferRead();
28694     test_ret += test_xmlPopInputCallbacks();
28695     test_ret += test_xmlRegisterDefaultInputCallbacks();
28696     test_ret += test_xmlRegisterDefaultOutputCallbacks();
28697     test_ret += test_xmlRegisterHTTPPostCallbacks();
28698 
28699     if (test_ret != 0)
28700 	printf("Module xmlIO: %d errors\n", test_ret);
28701     return(test_ret);
28702 }
28703 #ifdef LIBXML_AUTOMATA_ENABLED
28704 
28705 #define gen_nb_xmlAutomataPtr 1
gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)28706 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28707     return(NULL);
28708 }
des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED,xmlAutomataPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)28709 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28710 }
28711 #endif
28712 
28713 
28714 static int
test_xmlAutomataCompile(void)28715 test_xmlAutomataCompile(void) {
28716     int test_ret = 0;
28717 
28718 
28719     /* missing type support */
28720     return(test_ret);
28721 }
28722 
28723 
28724 static int
test_xmlAutomataGetInitState(void)28725 test_xmlAutomataGetInitState(void) {
28726     int test_ret = 0;
28727 
28728 
28729     /* missing type support */
28730     return(test_ret);
28731 }
28732 
28733 
28734 static int
test_xmlAutomataIsDeterminist(void)28735 test_xmlAutomataIsDeterminist(void) {
28736     int test_ret = 0;
28737 
28738 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28739     int mem_base;
28740     int ret_val;
28741     xmlAutomataPtr am; /* an automata */
28742     int n_am;
28743 
28744     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28745         mem_base = xmlMemBlocks();
28746         am = gen_xmlAutomataPtr(n_am, 0);
28747 
28748         ret_val = xmlAutomataIsDeterminist(am);
28749         desret_int(ret_val);
28750         call_tests++;
28751         des_xmlAutomataPtr(n_am, am, 0);
28752         xmlResetLastError();
28753         if (mem_base != xmlMemBlocks()) {
28754             printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28755 	           xmlMemBlocks() - mem_base);
28756 	    test_ret++;
28757             printf(" %d", n_am);
28758             printf("\n");
28759         }
28760     }
28761     function_tests++;
28762 #endif
28763 
28764     return(test_ret);
28765 }
28766 
28767 #ifdef LIBXML_AUTOMATA_ENABLED
28768 
28769 #define gen_nb_xmlAutomataStatePtr 1
gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)28770 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28771     return(NULL);
28772 }
des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED,xmlAutomataStatePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)28773 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28774 }
28775 #endif
28776 
28777 
28778 static int
test_xmlAutomataNewAllTrans(void)28779 test_xmlAutomataNewAllTrans(void) {
28780     int test_ret = 0;
28781 
28782 
28783     /* missing type support */
28784     return(test_ret);
28785 }
28786 
28787 
28788 static int
test_xmlAutomataNewCountTrans(void)28789 test_xmlAutomataNewCountTrans(void) {
28790     int test_ret = 0;
28791 
28792 
28793     /* missing type support */
28794     return(test_ret);
28795 }
28796 
28797 
28798 static int
test_xmlAutomataNewCountTrans2(void)28799 test_xmlAutomataNewCountTrans2(void) {
28800     int test_ret = 0;
28801 
28802 
28803     /* missing type support */
28804     return(test_ret);
28805 }
28806 
28807 
28808 static int
test_xmlAutomataNewCountedTrans(void)28809 test_xmlAutomataNewCountedTrans(void) {
28810     int test_ret = 0;
28811 
28812 
28813     /* missing type support */
28814     return(test_ret);
28815 }
28816 
28817 
28818 static int
test_xmlAutomataNewCounter(void)28819 test_xmlAutomataNewCounter(void) {
28820     int test_ret = 0;
28821 
28822 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28823     int mem_base;
28824     int ret_val;
28825     xmlAutomataPtr am; /* an automata */
28826     int n_am;
28827     int min; /* the minimal value on the counter */
28828     int n_min;
28829     int max; /* the maximal value on the counter */
28830     int n_max;
28831 
28832     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28833     for (n_min = 0;n_min < gen_nb_int;n_min++) {
28834     for (n_max = 0;n_max < gen_nb_int;n_max++) {
28835         mem_base = xmlMemBlocks();
28836         am = gen_xmlAutomataPtr(n_am, 0);
28837         min = gen_int(n_min, 1);
28838         max = gen_int(n_max, 2);
28839 
28840         ret_val = xmlAutomataNewCounter(am, min, max);
28841         desret_int(ret_val);
28842         call_tests++;
28843         des_xmlAutomataPtr(n_am, am, 0);
28844         des_int(n_min, min, 1);
28845         des_int(n_max, max, 2);
28846         xmlResetLastError();
28847         if (mem_base != xmlMemBlocks()) {
28848             printf("Leak of %d blocks found in xmlAutomataNewCounter",
28849 	           xmlMemBlocks() - mem_base);
28850 	    test_ret++;
28851             printf(" %d", n_am);
28852             printf(" %d", n_min);
28853             printf(" %d", n_max);
28854             printf("\n");
28855         }
28856     }
28857     }
28858     }
28859     function_tests++;
28860 #endif
28861 
28862     return(test_ret);
28863 }
28864 
28865 
28866 static int
test_xmlAutomataNewCounterTrans(void)28867 test_xmlAutomataNewCounterTrans(void) {
28868     int test_ret = 0;
28869 
28870 
28871     /* missing type support */
28872     return(test_ret);
28873 }
28874 
28875 
28876 static int
test_xmlAutomataNewEpsilon(void)28877 test_xmlAutomataNewEpsilon(void) {
28878     int test_ret = 0;
28879 
28880 
28881     /* missing type support */
28882     return(test_ret);
28883 }
28884 
28885 
28886 static int
test_xmlAutomataNewNegTrans(void)28887 test_xmlAutomataNewNegTrans(void) {
28888     int test_ret = 0;
28889 
28890 
28891     /* missing type support */
28892     return(test_ret);
28893 }
28894 
28895 
28896 static int
test_xmlAutomataNewOnceTrans(void)28897 test_xmlAutomataNewOnceTrans(void) {
28898     int test_ret = 0;
28899 
28900 
28901     /* missing type support */
28902     return(test_ret);
28903 }
28904 
28905 
28906 static int
test_xmlAutomataNewOnceTrans2(void)28907 test_xmlAutomataNewOnceTrans2(void) {
28908     int test_ret = 0;
28909 
28910 
28911     /* missing type support */
28912     return(test_ret);
28913 }
28914 
28915 
28916 static int
test_xmlAutomataNewState(void)28917 test_xmlAutomataNewState(void) {
28918     int test_ret = 0;
28919 
28920 
28921     /* missing type support */
28922     return(test_ret);
28923 }
28924 
28925 
28926 static int
test_xmlAutomataNewTransition(void)28927 test_xmlAutomataNewTransition(void) {
28928     int test_ret = 0;
28929 
28930 
28931     /* missing type support */
28932     return(test_ret);
28933 }
28934 
28935 
28936 static int
test_xmlAutomataNewTransition2(void)28937 test_xmlAutomataNewTransition2(void) {
28938     int test_ret = 0;
28939 
28940 
28941     /* missing type support */
28942     return(test_ret);
28943 }
28944 
28945 
28946 static int
test_xmlAutomataSetFinalState(void)28947 test_xmlAutomataSetFinalState(void) {
28948     int test_ret = 0;
28949 
28950 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28951     int mem_base;
28952     int ret_val;
28953     xmlAutomataPtr am; /* an automata */
28954     int n_am;
28955     xmlAutomataStatePtr state; /* a state in this automata */
28956     int n_state;
28957 
28958     for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28959     for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
28960         mem_base = xmlMemBlocks();
28961         am = gen_xmlAutomataPtr(n_am, 0);
28962         state = gen_xmlAutomataStatePtr(n_state, 1);
28963 
28964         ret_val = xmlAutomataSetFinalState(am, state);
28965         desret_int(ret_val);
28966         call_tests++;
28967         des_xmlAutomataPtr(n_am, am, 0);
28968         des_xmlAutomataStatePtr(n_state, state, 1);
28969         xmlResetLastError();
28970         if (mem_base != xmlMemBlocks()) {
28971             printf("Leak of %d blocks found in xmlAutomataSetFinalState",
28972 	           xmlMemBlocks() - mem_base);
28973 	    test_ret++;
28974             printf(" %d", n_am);
28975             printf(" %d", n_state);
28976             printf("\n");
28977         }
28978     }
28979     }
28980     function_tests++;
28981 #endif
28982 
28983     return(test_ret);
28984 }
28985 
28986 
28987 static int
test_xmlNewAutomata(void)28988 test_xmlNewAutomata(void) {
28989     int test_ret = 0;
28990 
28991 
28992     /* missing type support */
28993     return(test_ret);
28994 }
28995 
28996 static int
test_xmlautomata(void)28997 test_xmlautomata(void) {
28998     int test_ret = 0;
28999 
29000     if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29001     test_ret += test_xmlAutomataCompile();
29002     test_ret += test_xmlAutomataGetInitState();
29003     test_ret += test_xmlAutomataIsDeterminist();
29004     test_ret += test_xmlAutomataNewAllTrans();
29005     test_ret += test_xmlAutomataNewCountTrans();
29006     test_ret += test_xmlAutomataNewCountTrans2();
29007     test_ret += test_xmlAutomataNewCountedTrans();
29008     test_ret += test_xmlAutomataNewCounter();
29009     test_ret += test_xmlAutomataNewCounterTrans();
29010     test_ret += test_xmlAutomataNewEpsilon();
29011     test_ret += test_xmlAutomataNewNegTrans();
29012     test_ret += test_xmlAutomataNewOnceTrans();
29013     test_ret += test_xmlAutomataNewOnceTrans2();
29014     test_ret += test_xmlAutomataNewState();
29015     test_ret += test_xmlAutomataNewTransition();
29016     test_ret += test_xmlAutomataNewTransition2();
29017     test_ret += test_xmlAutomataSetFinalState();
29018     test_ret += test_xmlNewAutomata();
29019 
29020     if (test_ret != 0)
29021 	printf("Module xmlautomata: %d errors\n", test_ret);
29022     return(test_ret);
29023 }
29024 
29025 #define gen_nb_xmlGenericErrorFunc_ptr 1
gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29026 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29027     return(NULL);
29028 }
des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlGenericErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29029 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29030 }
29031 
29032 static int
test_initGenericErrorDefaultFunc(void)29033 test_initGenericErrorDefaultFunc(void) {
29034     int test_ret = 0;
29035 
29036     int mem_base;
29037     xmlGenericErrorFunc * handler; /* the handler */
29038     int n_handler;
29039 
29040     for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29041         mem_base = xmlMemBlocks();
29042         handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29043 
29044         initGenericErrorDefaultFunc(handler);
29045         call_tests++;
29046         des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29047         xmlResetLastError();
29048         if (mem_base != xmlMemBlocks()) {
29049             printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29050 	           xmlMemBlocks() - mem_base);
29051 	    test_ret++;
29052             printf(" %d", n_handler);
29053             printf("\n");
29054         }
29055     }
29056     function_tests++;
29057 
29058     return(test_ret);
29059 }
29060 
29061 
29062 #define gen_nb_xmlErrorPtr 1
gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29063 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29064     return(NULL);
29065 }
des_xmlErrorPtr(int no ATTRIBUTE_UNUSED,xmlErrorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29066 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29067 }
29068 
29069 static int
test_xmlCopyError(void)29070 test_xmlCopyError(void) {
29071     int test_ret = 0;
29072 
29073     int mem_base;
29074     int ret_val;
29075     xmlErrorPtr from; /* a source error */
29076     int n_from;
29077     xmlErrorPtr to; /* a target error */
29078     int n_to;
29079 
29080     for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29081     for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29082         mem_base = xmlMemBlocks();
29083         from = gen_xmlErrorPtr(n_from, 0);
29084         to = gen_xmlErrorPtr(n_to, 1);
29085 
29086         ret_val = xmlCopyError(from, to);
29087         desret_int(ret_val);
29088         call_tests++;
29089         des_xmlErrorPtr(n_from, from, 0);
29090         des_xmlErrorPtr(n_to, to, 1);
29091         xmlResetLastError();
29092         if (mem_base != xmlMemBlocks()) {
29093             printf("Leak of %d blocks found in xmlCopyError",
29094 	           xmlMemBlocks() - mem_base);
29095 	    test_ret++;
29096             printf(" %d", n_from);
29097             printf(" %d", n_to);
29098             printf("\n");
29099         }
29100     }
29101     }
29102     function_tests++;
29103 
29104     return(test_ret);
29105 }
29106 
29107 
29108 static int
test_xmlCtxtGetLastError(void)29109 test_xmlCtxtGetLastError(void) {
29110     int test_ret = 0;
29111 
29112 
29113     /* missing type support */
29114     return(test_ret);
29115 }
29116 
29117 
29118 static int
test_xmlCtxtResetLastError(void)29119 test_xmlCtxtResetLastError(void) {
29120     int test_ret = 0;
29121 
29122     int mem_base;
29123     void * ctx; /* an XML parser context */
29124     int n_ctx;
29125 
29126     for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29127         mem_base = xmlMemBlocks();
29128         ctx = gen_void_ptr(n_ctx, 0);
29129 
29130         xmlCtxtResetLastError(ctx);
29131         call_tests++;
29132         des_void_ptr(n_ctx, ctx, 0);
29133         xmlResetLastError();
29134         if (mem_base != xmlMemBlocks()) {
29135             printf("Leak of %d blocks found in xmlCtxtResetLastError",
29136 	           xmlMemBlocks() - mem_base);
29137 	    test_ret++;
29138             printf(" %d", n_ctx);
29139             printf("\n");
29140         }
29141     }
29142     function_tests++;
29143 
29144     return(test_ret);
29145 }
29146 
29147 
29148 static int
test_xmlGetLastError(void)29149 test_xmlGetLastError(void) {
29150     int test_ret = 0;
29151 
29152 
29153     /* missing type support */
29154     return(test_ret);
29155 }
29156 
29157 
29158 static int
test_xmlParserError(void)29159 test_xmlParserError(void) {
29160     int test_ret = 0;
29161 
29162 
29163     /* missing type support */
29164     return(test_ret);
29165 }
29166 
29167 
29168 static int
test_xmlParserPrintFileContext(void)29169 test_xmlParserPrintFileContext(void) {
29170     int test_ret = 0;
29171 
29172     int mem_base;
29173     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29174     int n_input;
29175 
29176     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29177         mem_base = xmlMemBlocks();
29178         input = gen_xmlParserInputPtr(n_input, 0);
29179 
29180         xmlParserPrintFileContext(input);
29181         call_tests++;
29182         des_xmlParserInputPtr(n_input, input, 0);
29183         xmlResetLastError();
29184         if (mem_base != xmlMemBlocks()) {
29185             printf("Leak of %d blocks found in xmlParserPrintFileContext",
29186 	           xmlMemBlocks() - mem_base);
29187 	    test_ret++;
29188             printf(" %d", n_input);
29189             printf("\n");
29190         }
29191     }
29192     function_tests++;
29193 
29194     return(test_ret);
29195 }
29196 
29197 
29198 static int
test_xmlParserPrintFileInfo(void)29199 test_xmlParserPrintFileInfo(void) {
29200     int test_ret = 0;
29201 
29202     int mem_base;
29203     xmlParserInputPtr input; /* an xmlParserInputPtr input */
29204     int n_input;
29205 
29206     for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29207         mem_base = xmlMemBlocks();
29208         input = gen_xmlParserInputPtr(n_input, 0);
29209 
29210         xmlParserPrintFileInfo(input);
29211         call_tests++;
29212         des_xmlParserInputPtr(n_input, input, 0);
29213         xmlResetLastError();
29214         if (mem_base != xmlMemBlocks()) {
29215             printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29216 	           xmlMemBlocks() - mem_base);
29217 	    test_ret++;
29218             printf(" %d", n_input);
29219             printf("\n");
29220         }
29221     }
29222     function_tests++;
29223 
29224     return(test_ret);
29225 }
29226 
29227 
29228 static int
test_xmlParserValidityError(void)29229 test_xmlParserValidityError(void) {
29230     int test_ret = 0;
29231 
29232 
29233     /* missing type support */
29234     return(test_ret);
29235 }
29236 
29237 
29238 static int
test_xmlParserValidityWarning(void)29239 test_xmlParserValidityWarning(void) {
29240     int test_ret = 0;
29241 
29242 
29243     /* missing type support */
29244     return(test_ret);
29245 }
29246 
29247 
29248 static int
test_xmlParserWarning(void)29249 test_xmlParserWarning(void) {
29250     int test_ret = 0;
29251 
29252 
29253     /* missing type support */
29254     return(test_ret);
29255 }
29256 
29257 
29258 static int
test_xmlResetError(void)29259 test_xmlResetError(void) {
29260     int test_ret = 0;
29261 
29262     int mem_base;
29263     xmlErrorPtr err; /* pointer to the error. */
29264     int n_err;
29265 
29266     for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29267         mem_base = xmlMemBlocks();
29268         err = gen_xmlErrorPtr(n_err, 0);
29269 
29270         xmlResetError(err);
29271         call_tests++;
29272         des_xmlErrorPtr(n_err, err, 0);
29273         xmlResetLastError();
29274         if (mem_base != xmlMemBlocks()) {
29275             printf("Leak of %d blocks found in xmlResetError",
29276 	           xmlMemBlocks() - mem_base);
29277 	    test_ret++;
29278             printf(" %d", n_err);
29279             printf("\n");
29280         }
29281     }
29282     function_tests++;
29283 
29284     return(test_ret);
29285 }
29286 
29287 
29288 static int
test_xmlResetLastError(void)29289 test_xmlResetLastError(void) {
29290     int test_ret = 0;
29291 
29292 
29293 
29294         xmlResetLastError();
29295         call_tests++;
29296         xmlResetLastError();
29297     function_tests++;
29298 
29299     return(test_ret);
29300 }
29301 
29302 
29303 static int
test_xmlSetGenericErrorFunc(void)29304 test_xmlSetGenericErrorFunc(void) {
29305     int test_ret = 0;
29306 
29307 
29308     /* missing type support */
29309     return(test_ret);
29310 }
29311 
29312 
29313 static int
test_xmlSetStructuredErrorFunc(void)29314 test_xmlSetStructuredErrorFunc(void) {
29315     int test_ret = 0;
29316 
29317 
29318     /* missing type support */
29319     return(test_ret);
29320 }
29321 
29322 static int
test_xmlerror(void)29323 test_xmlerror(void) {
29324     int test_ret = 0;
29325 
29326     if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29327     test_ret += test_initGenericErrorDefaultFunc();
29328     test_ret += test_xmlCopyError();
29329     test_ret += test_xmlCtxtGetLastError();
29330     test_ret += test_xmlCtxtResetLastError();
29331     test_ret += test_xmlGetLastError();
29332     test_ret += test_xmlParserError();
29333     test_ret += test_xmlParserPrintFileContext();
29334     test_ret += test_xmlParserPrintFileInfo();
29335     test_ret += test_xmlParserValidityError();
29336     test_ret += test_xmlParserValidityWarning();
29337     test_ret += test_xmlParserWarning();
29338     test_ret += test_xmlResetError();
29339     test_ret += test_xmlResetLastError();
29340     test_ret += test_xmlSetGenericErrorFunc();
29341     test_ret += test_xmlSetStructuredErrorFunc();
29342 
29343     if (test_ret != 0)
29344 	printf("Module xmlerror: %d errors\n", test_ret);
29345     return(test_ret);
29346 }
29347 #ifdef LIBXML_MODULES_ENABLED
29348 
29349 #define gen_nb_xmlModulePtr 1
gen_xmlModulePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29350 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29351     return(NULL);
29352 }
des_xmlModulePtr(int no ATTRIBUTE_UNUSED,xmlModulePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)29353 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29354 }
29355 #endif
29356 
29357 
29358 static int
test_xmlModuleClose(void)29359 test_xmlModuleClose(void) {
29360     int test_ret = 0;
29361 
29362 #if defined(LIBXML_MODULES_ENABLED)
29363     int mem_base;
29364     int ret_val;
29365     xmlModulePtr module; /* the module handle */
29366     int n_module;
29367 
29368     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29369         mem_base = xmlMemBlocks();
29370         module = gen_xmlModulePtr(n_module, 0);
29371 
29372         ret_val = xmlModuleClose(module);
29373         desret_int(ret_val);
29374         call_tests++;
29375         des_xmlModulePtr(n_module, module, 0);
29376         xmlResetLastError();
29377         if (mem_base != xmlMemBlocks()) {
29378             printf("Leak of %d blocks found in xmlModuleClose",
29379 	           xmlMemBlocks() - mem_base);
29380 	    test_ret++;
29381             printf(" %d", n_module);
29382             printf("\n");
29383         }
29384     }
29385     function_tests++;
29386 #endif
29387 
29388     return(test_ret);
29389 }
29390 
29391 
29392 static int
test_xmlModuleOpen(void)29393 test_xmlModuleOpen(void) {
29394     int test_ret = 0;
29395 
29396 
29397     /* missing type support */
29398     return(test_ret);
29399 }
29400 
29401 
29402 static int
test_xmlModuleSymbol(void)29403 test_xmlModuleSymbol(void) {
29404     int test_ret = 0;
29405 
29406 #if defined(LIBXML_MODULES_ENABLED)
29407     int mem_base;
29408     int ret_val;
29409     xmlModulePtr module; /* the module */
29410     int n_module;
29411     char * name; /* the name of the symbol */
29412     int n_name;
29413     void ** symbol; /* the resulting symbol address */
29414     int n_symbol;
29415 
29416     for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29417     for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29418     for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29419         mem_base = xmlMemBlocks();
29420         module = gen_xmlModulePtr(n_module, 0);
29421         name = gen_const_char_ptr(n_name, 1);
29422         symbol = gen_void_ptr_ptr(n_symbol, 2);
29423 
29424         ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29425         desret_int(ret_val);
29426         call_tests++;
29427         des_xmlModulePtr(n_module, module, 0);
29428         des_const_char_ptr(n_name, (const char *)name, 1);
29429         des_void_ptr_ptr(n_symbol, symbol, 2);
29430         xmlResetLastError();
29431         if (mem_base != xmlMemBlocks()) {
29432             printf("Leak of %d blocks found in xmlModuleSymbol",
29433 	           xmlMemBlocks() - mem_base);
29434 	    test_ret++;
29435             printf(" %d", n_module);
29436             printf(" %d", n_name);
29437             printf(" %d", n_symbol);
29438             printf("\n");
29439         }
29440     }
29441     }
29442     }
29443     function_tests++;
29444 #endif
29445 
29446     return(test_ret);
29447 }
29448 
29449 static int
test_xmlmodule(void)29450 test_xmlmodule(void) {
29451     int test_ret = 0;
29452 
29453     if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29454     test_ret += test_xmlModuleClose();
29455     test_ret += test_xmlModuleOpen();
29456     test_ret += test_xmlModuleSymbol();
29457 
29458     if (test_ret != 0)
29459 	printf("Module xmlmodule: %d errors\n", test_ret);
29460     return(test_ret);
29461 }
29462 
29463 static int
test_xmlNewTextReader(void)29464 test_xmlNewTextReader(void) {
29465     int test_ret = 0;
29466 
29467 #if defined(LIBXML_READER_ENABLED)
29468     int mem_base;
29469     xmlTextReaderPtr ret_val;
29470     xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29471     int n_input;
29472     const char * URI; /* the URI information for the source if available */
29473     int n_URI;
29474 
29475     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29476     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29477         mem_base = xmlMemBlocks();
29478         input = gen_xmlParserInputBufferPtr(n_input, 0);
29479         URI = gen_filepath(n_URI, 1);
29480 
29481         ret_val = xmlNewTextReader(input, URI);
29482         desret_xmlTextReaderPtr(ret_val);
29483         call_tests++;
29484         des_xmlParserInputBufferPtr(n_input, input, 0);
29485         des_filepath(n_URI, URI, 1);
29486         xmlResetLastError();
29487         if (mem_base != xmlMemBlocks()) {
29488             printf("Leak of %d blocks found in xmlNewTextReader",
29489 	           xmlMemBlocks() - mem_base);
29490 	    test_ret++;
29491             printf(" %d", n_input);
29492             printf(" %d", n_URI);
29493             printf("\n");
29494         }
29495     }
29496     }
29497     function_tests++;
29498 #endif
29499 
29500     return(test_ret);
29501 }
29502 
29503 
29504 static int
test_xmlNewTextReaderFilename(void)29505 test_xmlNewTextReaderFilename(void) {
29506     int test_ret = 0;
29507 
29508 #if defined(LIBXML_READER_ENABLED)
29509     int mem_base;
29510     xmlTextReaderPtr ret_val;
29511     const char * URI; /* the URI of the resource to process */
29512     int n_URI;
29513 
29514     for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29515         mem_base = xmlMemBlocks();
29516         URI = gen_filepath(n_URI, 0);
29517 
29518         ret_val = xmlNewTextReaderFilename(URI);
29519         desret_xmlTextReaderPtr(ret_val);
29520         call_tests++;
29521         des_filepath(n_URI, URI, 0);
29522         xmlResetLastError();
29523         if (mem_base != xmlMemBlocks()) {
29524             printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29525 	           xmlMemBlocks() - mem_base);
29526 	    test_ret++;
29527             printf(" %d", n_URI);
29528             printf("\n");
29529         }
29530     }
29531     function_tests++;
29532 #endif
29533 
29534     return(test_ret);
29535 }
29536 
29537 
29538 static int
test_xmlReaderForDoc(void)29539 test_xmlReaderForDoc(void) {
29540     int test_ret = 0;
29541 
29542 #if defined(LIBXML_READER_ENABLED)
29543     int mem_base;
29544     xmlTextReaderPtr ret_val;
29545     xmlChar * cur; /* a pointer to a zero terminated string */
29546     int n_cur;
29547     const char * URL; /* the base URL to use for the document */
29548     int n_URL;
29549     char * encoding; /* the document encoding, or NULL */
29550     int n_encoding;
29551     int options; /* a combination of xmlParserOption */
29552     int n_options;
29553 
29554     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29555     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29556     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29557     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29558         mem_base = xmlMemBlocks();
29559         cur = gen_const_xmlChar_ptr(n_cur, 0);
29560         URL = gen_filepath(n_URL, 1);
29561         encoding = gen_const_char_ptr(n_encoding, 2);
29562         options = gen_parseroptions(n_options, 3);
29563 
29564         ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29565         desret_xmlTextReaderPtr(ret_val);
29566         call_tests++;
29567         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29568         des_filepath(n_URL, URL, 1);
29569         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29570         des_parseroptions(n_options, options, 3);
29571         xmlResetLastError();
29572         if (mem_base != xmlMemBlocks()) {
29573             printf("Leak of %d blocks found in xmlReaderForDoc",
29574 	           xmlMemBlocks() - mem_base);
29575 	    test_ret++;
29576             printf(" %d", n_cur);
29577             printf(" %d", n_URL);
29578             printf(" %d", n_encoding);
29579             printf(" %d", n_options);
29580             printf("\n");
29581         }
29582     }
29583     }
29584     }
29585     }
29586     function_tests++;
29587 #endif
29588 
29589     return(test_ret);
29590 }
29591 
29592 
29593 static int
test_xmlReaderForFile(void)29594 test_xmlReaderForFile(void) {
29595     int test_ret = 0;
29596 
29597 #if defined(LIBXML_READER_ENABLED)
29598     int mem_base;
29599     xmlTextReaderPtr ret_val;
29600     const char * filename; /* a file or URL */
29601     int n_filename;
29602     char * encoding; /* the document encoding, or NULL */
29603     int n_encoding;
29604     int options; /* a combination of xmlParserOption */
29605     int n_options;
29606 
29607     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29608     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29609     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29610         mem_base = xmlMemBlocks();
29611         filename = gen_filepath(n_filename, 0);
29612         encoding = gen_const_char_ptr(n_encoding, 1);
29613         options = gen_parseroptions(n_options, 2);
29614 
29615         ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29616         desret_xmlTextReaderPtr(ret_val);
29617         call_tests++;
29618         des_filepath(n_filename, filename, 0);
29619         des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29620         des_parseroptions(n_options, options, 2);
29621         xmlResetLastError();
29622         if (mem_base != xmlMemBlocks()) {
29623             printf("Leak of %d blocks found in xmlReaderForFile",
29624 	           xmlMemBlocks() - mem_base);
29625 	    test_ret++;
29626             printf(" %d", n_filename);
29627             printf(" %d", n_encoding);
29628             printf(" %d", n_options);
29629             printf("\n");
29630         }
29631     }
29632     }
29633     }
29634     function_tests++;
29635 #endif
29636 
29637     return(test_ret);
29638 }
29639 
29640 
29641 static int
test_xmlReaderForMemory(void)29642 test_xmlReaderForMemory(void) {
29643     int test_ret = 0;
29644 
29645 #if defined(LIBXML_READER_ENABLED)
29646     int mem_base;
29647     xmlTextReaderPtr ret_val;
29648     char * buffer; /* a pointer to a char array */
29649     int n_buffer;
29650     int size; /* the size of the array */
29651     int n_size;
29652     const char * URL; /* the base URL to use for the document */
29653     int n_URL;
29654     char * encoding; /* the document encoding, or NULL */
29655     int n_encoding;
29656     int options; /* a combination of xmlParserOption */
29657     int n_options;
29658 
29659     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29660     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29661     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29662     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29663     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29664         mem_base = xmlMemBlocks();
29665         buffer = gen_const_char_ptr(n_buffer, 0);
29666         size = gen_int(n_size, 1);
29667         URL = gen_filepath(n_URL, 2);
29668         encoding = gen_const_char_ptr(n_encoding, 3);
29669         options = gen_parseroptions(n_options, 4);
29670 
29671         ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29672         desret_xmlTextReaderPtr(ret_val);
29673         call_tests++;
29674         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29675         des_int(n_size, size, 1);
29676         des_filepath(n_URL, URL, 2);
29677         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29678         des_parseroptions(n_options, options, 4);
29679         xmlResetLastError();
29680         if (mem_base != xmlMemBlocks()) {
29681             printf("Leak of %d blocks found in xmlReaderForMemory",
29682 	           xmlMemBlocks() - mem_base);
29683 	    test_ret++;
29684             printf(" %d", n_buffer);
29685             printf(" %d", n_size);
29686             printf(" %d", n_URL);
29687             printf(" %d", n_encoding);
29688             printf(" %d", n_options);
29689             printf("\n");
29690         }
29691     }
29692     }
29693     }
29694     }
29695     }
29696     function_tests++;
29697 #endif
29698 
29699     return(test_ret);
29700 }
29701 
29702 
29703 static int
test_xmlReaderNewDoc(void)29704 test_xmlReaderNewDoc(void) {
29705     int test_ret = 0;
29706 
29707 #if defined(LIBXML_READER_ENABLED)
29708     int mem_base;
29709     int ret_val;
29710     xmlTextReaderPtr reader; /* an XML reader */
29711     int n_reader;
29712     xmlChar * cur; /* a pointer to a zero terminated string */
29713     int n_cur;
29714     const char * URL; /* the base URL to use for the document */
29715     int n_URL;
29716     char * encoding; /* the document encoding, or NULL */
29717     int n_encoding;
29718     int options; /* a combination of xmlParserOption */
29719     int n_options;
29720 
29721     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29722     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29723     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29724     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29725     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29726         mem_base = xmlMemBlocks();
29727         reader = gen_xmlTextReaderPtr(n_reader, 0);
29728         cur = gen_const_xmlChar_ptr(n_cur, 1);
29729         URL = gen_filepath(n_URL, 2);
29730         encoding = gen_const_char_ptr(n_encoding, 3);
29731         options = gen_parseroptions(n_options, 4);
29732 
29733         ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29734         desret_int(ret_val);
29735         call_tests++;
29736         des_xmlTextReaderPtr(n_reader, reader, 0);
29737         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29738         des_filepath(n_URL, URL, 2);
29739         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29740         des_parseroptions(n_options, options, 4);
29741         xmlResetLastError();
29742         if (mem_base != xmlMemBlocks()) {
29743             printf("Leak of %d blocks found in xmlReaderNewDoc",
29744 	           xmlMemBlocks() - mem_base);
29745 	    test_ret++;
29746             printf(" %d", n_reader);
29747             printf(" %d", n_cur);
29748             printf(" %d", n_URL);
29749             printf(" %d", n_encoding);
29750             printf(" %d", n_options);
29751             printf("\n");
29752         }
29753     }
29754     }
29755     }
29756     }
29757     }
29758     function_tests++;
29759 #endif
29760 
29761     return(test_ret);
29762 }
29763 
29764 
29765 static int
test_xmlReaderNewFile(void)29766 test_xmlReaderNewFile(void) {
29767     int test_ret = 0;
29768 
29769 #if defined(LIBXML_READER_ENABLED)
29770     int mem_base;
29771     int ret_val;
29772     xmlTextReaderPtr reader; /* an XML reader */
29773     int n_reader;
29774     const char * filename; /* a file or URL */
29775     int n_filename;
29776     char * encoding; /* the document encoding, or NULL */
29777     int n_encoding;
29778     int options; /* a combination of xmlParserOption */
29779     int n_options;
29780 
29781     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29782     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29783     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29784     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29785         mem_base = xmlMemBlocks();
29786         reader = gen_xmlTextReaderPtr(n_reader, 0);
29787         filename = gen_filepath(n_filename, 1);
29788         encoding = gen_const_char_ptr(n_encoding, 2);
29789         options = gen_parseroptions(n_options, 3);
29790 
29791         ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29792         desret_int(ret_val);
29793         call_tests++;
29794         des_xmlTextReaderPtr(n_reader, reader, 0);
29795         des_filepath(n_filename, filename, 1);
29796         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29797         des_parseroptions(n_options, options, 3);
29798         xmlResetLastError();
29799         if (mem_base != xmlMemBlocks()) {
29800             printf("Leak of %d blocks found in xmlReaderNewFile",
29801 	           xmlMemBlocks() - mem_base);
29802 	    test_ret++;
29803             printf(" %d", n_reader);
29804             printf(" %d", n_filename);
29805             printf(" %d", n_encoding);
29806             printf(" %d", n_options);
29807             printf("\n");
29808         }
29809     }
29810     }
29811     }
29812     }
29813     function_tests++;
29814 #endif
29815 
29816     return(test_ret);
29817 }
29818 
29819 
29820 static int
test_xmlReaderNewMemory(void)29821 test_xmlReaderNewMemory(void) {
29822     int test_ret = 0;
29823 
29824 #if defined(LIBXML_READER_ENABLED)
29825     int mem_base;
29826     int ret_val;
29827     xmlTextReaderPtr reader; /* an XML reader */
29828     int n_reader;
29829     char * buffer; /* a pointer to a char array */
29830     int n_buffer;
29831     int size; /* the size of the array */
29832     int n_size;
29833     const char * URL; /* the base URL to use for the document */
29834     int n_URL;
29835     char * encoding; /* the document encoding, or NULL */
29836     int n_encoding;
29837     int options; /* a combination of xmlParserOption */
29838     int n_options;
29839 
29840     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29841     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29842     for (n_size = 0;n_size < gen_nb_int;n_size++) {
29843     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29844     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29845     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29846         mem_base = xmlMemBlocks();
29847         reader = gen_xmlTextReaderPtr(n_reader, 0);
29848         buffer = gen_const_char_ptr(n_buffer, 1);
29849         size = gen_int(n_size, 2);
29850         URL = gen_filepath(n_URL, 3);
29851         encoding = gen_const_char_ptr(n_encoding, 4);
29852         options = gen_parseroptions(n_options, 5);
29853 
29854         ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29855         desret_int(ret_val);
29856         call_tests++;
29857         des_xmlTextReaderPtr(n_reader, reader, 0);
29858         des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29859         des_int(n_size, size, 2);
29860         des_filepath(n_URL, URL, 3);
29861         des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29862         des_parseroptions(n_options, options, 5);
29863         xmlResetLastError();
29864         if (mem_base != xmlMemBlocks()) {
29865             printf("Leak of %d blocks found in xmlReaderNewMemory",
29866 	           xmlMemBlocks() - mem_base);
29867 	    test_ret++;
29868             printf(" %d", n_reader);
29869             printf(" %d", n_buffer);
29870             printf(" %d", n_size);
29871             printf(" %d", n_URL);
29872             printf(" %d", n_encoding);
29873             printf(" %d", n_options);
29874             printf("\n");
29875         }
29876     }
29877     }
29878     }
29879     }
29880     }
29881     }
29882     function_tests++;
29883 #endif
29884 
29885     return(test_ret);
29886 }
29887 
29888 
29889 static int
test_xmlReaderNewWalker(void)29890 test_xmlReaderNewWalker(void) {
29891     int test_ret = 0;
29892 
29893 #if defined(LIBXML_READER_ENABLED)
29894     int mem_base;
29895     int ret_val;
29896     xmlTextReaderPtr reader; /* an XML reader */
29897     int n_reader;
29898     xmlDocPtr doc; /* a preparsed document */
29899     int n_doc;
29900 
29901     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29902     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29903         mem_base = xmlMemBlocks();
29904         reader = gen_xmlTextReaderPtr(n_reader, 0);
29905         doc = gen_xmlDocPtr(n_doc, 1);
29906 
29907         ret_val = xmlReaderNewWalker(reader, doc);
29908         desret_int(ret_val);
29909         call_tests++;
29910         des_xmlTextReaderPtr(n_reader, reader, 0);
29911         des_xmlDocPtr(n_doc, doc, 1);
29912         xmlResetLastError();
29913         if (mem_base != xmlMemBlocks()) {
29914             printf("Leak of %d blocks found in xmlReaderNewWalker",
29915 	           xmlMemBlocks() - mem_base);
29916 	    test_ret++;
29917             printf(" %d", n_reader);
29918             printf(" %d", n_doc);
29919             printf("\n");
29920         }
29921     }
29922     }
29923     function_tests++;
29924 #endif
29925 
29926     return(test_ret);
29927 }
29928 
29929 
29930 static int
test_xmlReaderWalker(void)29931 test_xmlReaderWalker(void) {
29932     int test_ret = 0;
29933 
29934 #if defined(LIBXML_READER_ENABLED)
29935     int mem_base;
29936     xmlTextReaderPtr ret_val;
29937     xmlDocPtr doc; /* a preparsed document */
29938     int n_doc;
29939 
29940     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29941         mem_base = xmlMemBlocks();
29942         doc = gen_xmlDocPtr(n_doc, 0);
29943 
29944         ret_val = xmlReaderWalker(doc);
29945         desret_xmlTextReaderPtr(ret_val);
29946         call_tests++;
29947         des_xmlDocPtr(n_doc, doc, 0);
29948         xmlResetLastError();
29949         if (mem_base != xmlMemBlocks()) {
29950             printf("Leak of %d blocks found in xmlReaderWalker",
29951 	           xmlMemBlocks() - mem_base);
29952 	    test_ret++;
29953             printf(" %d", n_doc);
29954             printf("\n");
29955         }
29956     }
29957     function_tests++;
29958 #endif
29959 
29960     return(test_ret);
29961 }
29962 
29963 
29964 static int
test_xmlTextReaderAttributeCount(void)29965 test_xmlTextReaderAttributeCount(void) {
29966     int test_ret = 0;
29967 
29968 #if defined(LIBXML_READER_ENABLED)
29969     int mem_base;
29970     int ret_val;
29971     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
29972     int n_reader;
29973 
29974     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29975         mem_base = xmlMemBlocks();
29976         reader = gen_xmlTextReaderPtr(n_reader, 0);
29977 
29978         ret_val = xmlTextReaderAttributeCount(reader);
29979         desret_int(ret_val);
29980         call_tests++;
29981         des_xmlTextReaderPtr(n_reader, reader, 0);
29982         xmlResetLastError();
29983         if (mem_base != xmlMemBlocks()) {
29984             printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
29985 	           xmlMemBlocks() - mem_base);
29986 	    test_ret++;
29987             printf(" %d", n_reader);
29988             printf("\n");
29989         }
29990     }
29991     function_tests++;
29992 #endif
29993 
29994     return(test_ret);
29995 }
29996 
29997 
29998 static int
test_xmlTextReaderBaseUri(void)29999 test_xmlTextReaderBaseUri(void) {
30000     int test_ret = 0;
30001 
30002 #if defined(LIBXML_READER_ENABLED)
30003     int mem_base;
30004     xmlChar * ret_val;
30005     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30006     int n_reader;
30007 
30008     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30009         mem_base = xmlMemBlocks();
30010         reader = gen_xmlTextReaderPtr(n_reader, 0);
30011 
30012         ret_val = xmlTextReaderBaseUri(reader);
30013         desret_xmlChar_ptr(ret_val);
30014         call_tests++;
30015         des_xmlTextReaderPtr(n_reader, reader, 0);
30016         xmlResetLastError();
30017         if (mem_base != xmlMemBlocks()) {
30018             printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30019 	           xmlMemBlocks() - mem_base);
30020 	    test_ret++;
30021             printf(" %d", n_reader);
30022             printf("\n");
30023         }
30024     }
30025     function_tests++;
30026 #endif
30027 
30028     return(test_ret);
30029 }
30030 
30031 
30032 static int
test_xmlTextReaderByteConsumed(void)30033 test_xmlTextReaderByteConsumed(void) {
30034     int test_ret = 0;
30035 
30036 #if defined(LIBXML_READER_ENABLED)
30037     int mem_base;
30038     long ret_val;
30039     xmlTextReaderPtr reader; /* an XML reader */
30040     int n_reader;
30041 
30042     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30043         mem_base = xmlMemBlocks();
30044         reader = gen_xmlTextReaderPtr(n_reader, 0);
30045 
30046         ret_val = xmlTextReaderByteConsumed(reader);
30047         desret_long(ret_val);
30048         call_tests++;
30049         des_xmlTextReaderPtr(n_reader, reader, 0);
30050         xmlResetLastError();
30051         if (mem_base != xmlMemBlocks()) {
30052             printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30053 	           xmlMemBlocks() - mem_base);
30054 	    test_ret++;
30055             printf(" %d", n_reader);
30056             printf("\n");
30057         }
30058     }
30059     function_tests++;
30060 #endif
30061 
30062     return(test_ret);
30063 }
30064 
30065 
30066 static int
test_xmlTextReaderClose(void)30067 test_xmlTextReaderClose(void) {
30068     int test_ret = 0;
30069 
30070 #if defined(LIBXML_READER_ENABLED)
30071     int mem_base;
30072     int ret_val;
30073     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30074     int n_reader;
30075 
30076     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30077         mem_base = xmlMemBlocks();
30078         reader = gen_xmlTextReaderPtr(n_reader, 0);
30079 
30080         ret_val = xmlTextReaderClose(reader);
30081         desret_int(ret_val);
30082         call_tests++;
30083         des_xmlTextReaderPtr(n_reader, reader, 0);
30084         xmlResetLastError();
30085         if (mem_base != xmlMemBlocks()) {
30086             printf("Leak of %d blocks found in xmlTextReaderClose",
30087 	           xmlMemBlocks() - mem_base);
30088 	    test_ret++;
30089             printf(" %d", n_reader);
30090             printf("\n");
30091         }
30092     }
30093     function_tests++;
30094 #endif
30095 
30096     return(test_ret);
30097 }
30098 
30099 
30100 static int
test_xmlTextReaderConstBaseUri(void)30101 test_xmlTextReaderConstBaseUri(void) {
30102     int test_ret = 0;
30103 
30104 #if defined(LIBXML_READER_ENABLED)
30105     int mem_base;
30106     const xmlChar * ret_val;
30107     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30108     int n_reader;
30109 
30110     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30111         mem_base = xmlMemBlocks();
30112         reader = gen_xmlTextReaderPtr(n_reader, 0);
30113 
30114         ret_val = xmlTextReaderConstBaseUri(reader);
30115         desret_const_xmlChar_ptr(ret_val);
30116         call_tests++;
30117         des_xmlTextReaderPtr(n_reader, reader, 0);
30118         xmlResetLastError();
30119         if (mem_base != xmlMemBlocks()) {
30120             printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30121 	           xmlMemBlocks() - mem_base);
30122 	    test_ret++;
30123             printf(" %d", n_reader);
30124             printf("\n");
30125         }
30126     }
30127     function_tests++;
30128 #endif
30129 
30130     return(test_ret);
30131 }
30132 
30133 
30134 static int
test_xmlTextReaderConstEncoding(void)30135 test_xmlTextReaderConstEncoding(void) {
30136     int test_ret = 0;
30137 
30138 #if defined(LIBXML_READER_ENABLED)
30139     int mem_base;
30140     const xmlChar * ret_val;
30141     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30142     int n_reader;
30143 
30144     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30145         mem_base = xmlMemBlocks();
30146         reader = gen_xmlTextReaderPtr(n_reader, 0);
30147 
30148         ret_val = xmlTextReaderConstEncoding(reader);
30149         desret_const_xmlChar_ptr(ret_val);
30150         call_tests++;
30151         des_xmlTextReaderPtr(n_reader, reader, 0);
30152         xmlResetLastError();
30153         if (mem_base != xmlMemBlocks()) {
30154             printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30155 	           xmlMemBlocks() - mem_base);
30156 	    test_ret++;
30157             printf(" %d", n_reader);
30158             printf("\n");
30159         }
30160     }
30161     function_tests++;
30162 #endif
30163 
30164     return(test_ret);
30165 }
30166 
30167 
30168 static int
test_xmlTextReaderConstLocalName(void)30169 test_xmlTextReaderConstLocalName(void) {
30170     int test_ret = 0;
30171 
30172 #if defined(LIBXML_READER_ENABLED)
30173     int mem_base;
30174     const xmlChar * ret_val;
30175     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30176     int n_reader;
30177 
30178     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30179         mem_base = xmlMemBlocks();
30180         reader = gen_xmlTextReaderPtr(n_reader, 0);
30181 
30182         ret_val = xmlTextReaderConstLocalName(reader);
30183         desret_const_xmlChar_ptr(ret_val);
30184         call_tests++;
30185         des_xmlTextReaderPtr(n_reader, reader, 0);
30186         xmlResetLastError();
30187         if (mem_base != xmlMemBlocks()) {
30188             printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30189 	           xmlMemBlocks() - mem_base);
30190 	    test_ret++;
30191             printf(" %d", n_reader);
30192             printf("\n");
30193         }
30194     }
30195     function_tests++;
30196 #endif
30197 
30198     return(test_ret);
30199 }
30200 
30201 
30202 static int
test_xmlTextReaderConstName(void)30203 test_xmlTextReaderConstName(void) {
30204     int test_ret = 0;
30205 
30206 #if defined(LIBXML_READER_ENABLED)
30207     int mem_base;
30208     const xmlChar * ret_val;
30209     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30210     int n_reader;
30211 
30212     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30213         mem_base = xmlMemBlocks();
30214         reader = gen_xmlTextReaderPtr(n_reader, 0);
30215 
30216         ret_val = xmlTextReaderConstName(reader);
30217         desret_const_xmlChar_ptr(ret_val);
30218         call_tests++;
30219         des_xmlTextReaderPtr(n_reader, reader, 0);
30220         xmlResetLastError();
30221         if (mem_base != xmlMemBlocks()) {
30222             printf("Leak of %d blocks found in xmlTextReaderConstName",
30223 	           xmlMemBlocks() - mem_base);
30224 	    test_ret++;
30225             printf(" %d", n_reader);
30226             printf("\n");
30227         }
30228     }
30229     function_tests++;
30230 #endif
30231 
30232     return(test_ret);
30233 }
30234 
30235 
30236 static int
test_xmlTextReaderConstNamespaceUri(void)30237 test_xmlTextReaderConstNamespaceUri(void) {
30238     int test_ret = 0;
30239 
30240 #if defined(LIBXML_READER_ENABLED)
30241     int mem_base;
30242     const xmlChar * ret_val;
30243     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30244     int n_reader;
30245 
30246     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30247         mem_base = xmlMemBlocks();
30248         reader = gen_xmlTextReaderPtr(n_reader, 0);
30249 
30250         ret_val = xmlTextReaderConstNamespaceUri(reader);
30251         desret_const_xmlChar_ptr(ret_val);
30252         call_tests++;
30253         des_xmlTextReaderPtr(n_reader, reader, 0);
30254         xmlResetLastError();
30255         if (mem_base != xmlMemBlocks()) {
30256             printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30257 	           xmlMemBlocks() - mem_base);
30258 	    test_ret++;
30259             printf(" %d", n_reader);
30260             printf("\n");
30261         }
30262     }
30263     function_tests++;
30264 #endif
30265 
30266     return(test_ret);
30267 }
30268 
30269 
30270 static int
test_xmlTextReaderConstPrefix(void)30271 test_xmlTextReaderConstPrefix(void) {
30272     int test_ret = 0;
30273 
30274 #if defined(LIBXML_READER_ENABLED)
30275     int mem_base;
30276     const xmlChar * ret_val;
30277     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30278     int n_reader;
30279 
30280     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30281         mem_base = xmlMemBlocks();
30282         reader = gen_xmlTextReaderPtr(n_reader, 0);
30283 
30284         ret_val = xmlTextReaderConstPrefix(reader);
30285         desret_const_xmlChar_ptr(ret_val);
30286         call_tests++;
30287         des_xmlTextReaderPtr(n_reader, reader, 0);
30288         xmlResetLastError();
30289         if (mem_base != xmlMemBlocks()) {
30290             printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30291 	           xmlMemBlocks() - mem_base);
30292 	    test_ret++;
30293             printf(" %d", n_reader);
30294             printf("\n");
30295         }
30296     }
30297     function_tests++;
30298 #endif
30299 
30300     return(test_ret);
30301 }
30302 
30303 
30304 static int
test_xmlTextReaderConstString(void)30305 test_xmlTextReaderConstString(void) {
30306     int test_ret = 0;
30307 
30308 #if defined(LIBXML_READER_ENABLED)
30309     int mem_base;
30310     const xmlChar * ret_val;
30311     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30312     int n_reader;
30313     xmlChar * str; /* the string to intern. */
30314     int n_str;
30315 
30316     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30317     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30318         mem_base = xmlMemBlocks();
30319         reader = gen_xmlTextReaderPtr(n_reader, 0);
30320         str = gen_const_xmlChar_ptr(n_str, 1);
30321 
30322         ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30323         desret_const_xmlChar_ptr(ret_val);
30324         call_tests++;
30325         des_xmlTextReaderPtr(n_reader, reader, 0);
30326         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30327         xmlResetLastError();
30328         if (mem_base != xmlMemBlocks()) {
30329             printf("Leak of %d blocks found in xmlTextReaderConstString",
30330 	           xmlMemBlocks() - mem_base);
30331 	    test_ret++;
30332             printf(" %d", n_reader);
30333             printf(" %d", n_str);
30334             printf("\n");
30335         }
30336     }
30337     }
30338     function_tests++;
30339 #endif
30340 
30341     return(test_ret);
30342 }
30343 
30344 
30345 static int
test_xmlTextReaderConstValue(void)30346 test_xmlTextReaderConstValue(void) {
30347     int test_ret = 0;
30348 
30349 #if defined(LIBXML_READER_ENABLED)
30350     int mem_base;
30351     const xmlChar * ret_val;
30352     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30353     int n_reader;
30354 
30355     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30356         mem_base = xmlMemBlocks();
30357         reader = gen_xmlTextReaderPtr(n_reader, 0);
30358 
30359         ret_val = xmlTextReaderConstValue(reader);
30360         desret_const_xmlChar_ptr(ret_val);
30361         call_tests++;
30362         des_xmlTextReaderPtr(n_reader, reader, 0);
30363         xmlResetLastError();
30364         if (mem_base != xmlMemBlocks()) {
30365             printf("Leak of %d blocks found in xmlTextReaderConstValue",
30366 	           xmlMemBlocks() - mem_base);
30367 	    test_ret++;
30368             printf(" %d", n_reader);
30369             printf("\n");
30370         }
30371     }
30372     function_tests++;
30373 #endif
30374 
30375     return(test_ret);
30376 }
30377 
30378 
30379 static int
test_xmlTextReaderConstXmlLang(void)30380 test_xmlTextReaderConstXmlLang(void) {
30381     int test_ret = 0;
30382 
30383 #if defined(LIBXML_READER_ENABLED)
30384     int mem_base;
30385     const xmlChar * ret_val;
30386     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30387     int n_reader;
30388 
30389     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30390         mem_base = xmlMemBlocks();
30391         reader = gen_xmlTextReaderPtr(n_reader, 0);
30392 
30393         ret_val = xmlTextReaderConstXmlLang(reader);
30394         desret_const_xmlChar_ptr(ret_val);
30395         call_tests++;
30396         des_xmlTextReaderPtr(n_reader, reader, 0);
30397         xmlResetLastError();
30398         if (mem_base != xmlMemBlocks()) {
30399             printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30400 	           xmlMemBlocks() - mem_base);
30401 	    test_ret++;
30402             printf(" %d", n_reader);
30403             printf("\n");
30404         }
30405     }
30406     function_tests++;
30407 #endif
30408 
30409     return(test_ret);
30410 }
30411 
30412 
30413 static int
test_xmlTextReaderConstXmlVersion(void)30414 test_xmlTextReaderConstXmlVersion(void) {
30415     int test_ret = 0;
30416 
30417 #if defined(LIBXML_READER_ENABLED)
30418     int mem_base;
30419     const xmlChar * ret_val;
30420     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30421     int n_reader;
30422 
30423     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30424         mem_base = xmlMemBlocks();
30425         reader = gen_xmlTextReaderPtr(n_reader, 0);
30426 
30427         ret_val = xmlTextReaderConstXmlVersion(reader);
30428         desret_const_xmlChar_ptr(ret_val);
30429         call_tests++;
30430         des_xmlTextReaderPtr(n_reader, reader, 0);
30431         xmlResetLastError();
30432         if (mem_base != xmlMemBlocks()) {
30433             printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30434 	           xmlMemBlocks() - mem_base);
30435 	    test_ret++;
30436             printf(" %d", n_reader);
30437             printf("\n");
30438         }
30439     }
30440     function_tests++;
30441 #endif
30442 
30443     return(test_ret);
30444 }
30445 
30446 
30447 static int
test_xmlTextReaderCurrentDoc(void)30448 test_xmlTextReaderCurrentDoc(void) {
30449     int test_ret = 0;
30450 
30451 #if defined(LIBXML_READER_ENABLED)
30452     int mem_base;
30453     xmlDocPtr ret_val;
30454     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30455     int n_reader;
30456 
30457     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30458         mem_base = xmlMemBlocks();
30459         reader = gen_xmlTextReaderPtr(n_reader, 0);
30460 
30461         ret_val = xmlTextReaderCurrentDoc(reader);
30462         desret_xmlDocPtr(ret_val);
30463         call_tests++;
30464         des_xmlTextReaderPtr(n_reader, reader, 0);
30465         xmlResetLastError();
30466         if (mem_base != xmlMemBlocks()) {
30467             printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30468 	           xmlMemBlocks() - mem_base);
30469 	    test_ret++;
30470             printf(" %d", n_reader);
30471             printf("\n");
30472         }
30473     }
30474     function_tests++;
30475 #endif
30476 
30477     return(test_ret);
30478 }
30479 
30480 
30481 static int
test_xmlTextReaderCurrentNode(void)30482 test_xmlTextReaderCurrentNode(void) {
30483     int test_ret = 0;
30484 
30485 #if defined(LIBXML_READER_ENABLED)
30486     int mem_base;
30487     xmlNodePtr ret_val;
30488     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30489     int n_reader;
30490 
30491     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30492         mem_base = xmlMemBlocks();
30493         reader = gen_xmlTextReaderPtr(n_reader, 0);
30494 
30495         ret_val = xmlTextReaderCurrentNode(reader);
30496         desret_xmlNodePtr(ret_val);
30497         call_tests++;
30498         des_xmlTextReaderPtr(n_reader, reader, 0);
30499         xmlResetLastError();
30500         if (mem_base != xmlMemBlocks()) {
30501             printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30502 	           xmlMemBlocks() - mem_base);
30503 	    test_ret++;
30504             printf(" %d", n_reader);
30505             printf("\n");
30506         }
30507     }
30508     function_tests++;
30509 #endif
30510 
30511     return(test_ret);
30512 }
30513 
30514 
30515 static int
test_xmlTextReaderDepth(void)30516 test_xmlTextReaderDepth(void) {
30517     int test_ret = 0;
30518 
30519 #if defined(LIBXML_READER_ENABLED)
30520     int mem_base;
30521     int ret_val;
30522     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30523     int n_reader;
30524 
30525     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30526         mem_base = xmlMemBlocks();
30527         reader = gen_xmlTextReaderPtr(n_reader, 0);
30528 
30529         ret_val = xmlTextReaderDepth(reader);
30530         desret_int(ret_val);
30531         call_tests++;
30532         des_xmlTextReaderPtr(n_reader, reader, 0);
30533         xmlResetLastError();
30534         if (mem_base != xmlMemBlocks()) {
30535             printf("Leak of %d blocks found in xmlTextReaderDepth",
30536 	           xmlMemBlocks() - mem_base);
30537 	    test_ret++;
30538             printf(" %d", n_reader);
30539             printf("\n");
30540         }
30541     }
30542     function_tests++;
30543 #endif
30544 
30545     return(test_ret);
30546 }
30547 
30548 
30549 static int
test_xmlTextReaderExpand(void)30550 test_xmlTextReaderExpand(void) {
30551     int test_ret = 0;
30552 
30553 #if defined(LIBXML_READER_ENABLED)
30554     int mem_base;
30555     xmlNodePtr ret_val;
30556     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30557     int n_reader;
30558 
30559     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30560         mem_base = xmlMemBlocks();
30561         reader = gen_xmlTextReaderPtr(n_reader, 0);
30562 
30563         ret_val = xmlTextReaderExpand(reader);
30564         desret_xmlNodePtr(ret_val);
30565         call_tests++;
30566         des_xmlTextReaderPtr(n_reader, reader, 0);
30567         xmlResetLastError();
30568         if (mem_base != xmlMemBlocks()) {
30569             printf("Leak of %d blocks found in xmlTextReaderExpand",
30570 	           xmlMemBlocks() - mem_base);
30571 	    test_ret++;
30572             printf(" %d", n_reader);
30573             printf("\n");
30574         }
30575     }
30576     function_tests++;
30577 #endif
30578 
30579     return(test_ret);
30580 }
30581 
30582 
30583 static int
test_xmlTextReaderGetAttribute(void)30584 test_xmlTextReaderGetAttribute(void) {
30585     int test_ret = 0;
30586 
30587 #if defined(LIBXML_READER_ENABLED)
30588     int mem_base;
30589     xmlChar * ret_val;
30590     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30591     int n_reader;
30592     xmlChar * name; /* the qualified name of the attribute. */
30593     int n_name;
30594 
30595     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30596     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30597         mem_base = xmlMemBlocks();
30598         reader = gen_xmlTextReaderPtr(n_reader, 0);
30599         name = gen_const_xmlChar_ptr(n_name, 1);
30600 
30601         ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30602         desret_xmlChar_ptr(ret_val);
30603         call_tests++;
30604         des_xmlTextReaderPtr(n_reader, reader, 0);
30605         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30606         xmlResetLastError();
30607         if (mem_base != xmlMemBlocks()) {
30608             printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30609 	           xmlMemBlocks() - mem_base);
30610 	    test_ret++;
30611             printf(" %d", n_reader);
30612             printf(" %d", n_name);
30613             printf("\n");
30614         }
30615     }
30616     }
30617     function_tests++;
30618 #endif
30619 
30620     return(test_ret);
30621 }
30622 
30623 
30624 static int
test_xmlTextReaderGetAttributeNo(void)30625 test_xmlTextReaderGetAttributeNo(void) {
30626     int test_ret = 0;
30627 
30628 #if defined(LIBXML_READER_ENABLED)
30629     int mem_base;
30630     xmlChar * ret_val;
30631     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30632     int n_reader;
30633     int no; /* the zero-based index of the attribute relative to the containing element */
30634     int n_no;
30635 
30636     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30637     for (n_no = 0;n_no < gen_nb_int;n_no++) {
30638         mem_base = xmlMemBlocks();
30639         reader = gen_xmlTextReaderPtr(n_reader, 0);
30640         no = gen_int(n_no, 1);
30641 
30642         ret_val = xmlTextReaderGetAttributeNo(reader, no);
30643         desret_xmlChar_ptr(ret_val);
30644         call_tests++;
30645         des_xmlTextReaderPtr(n_reader, reader, 0);
30646         des_int(n_no, no, 1);
30647         xmlResetLastError();
30648         if (mem_base != xmlMemBlocks()) {
30649             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30650 	           xmlMemBlocks() - mem_base);
30651 	    test_ret++;
30652             printf(" %d", n_reader);
30653             printf(" %d", n_no);
30654             printf("\n");
30655         }
30656     }
30657     }
30658     function_tests++;
30659 #endif
30660 
30661     return(test_ret);
30662 }
30663 
30664 
30665 static int
test_xmlTextReaderGetAttributeNs(void)30666 test_xmlTextReaderGetAttributeNs(void) {
30667     int test_ret = 0;
30668 
30669 #if defined(LIBXML_READER_ENABLED)
30670     int mem_base;
30671     xmlChar * ret_val;
30672     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30673     int n_reader;
30674     xmlChar * localName; /* the local name of the attribute. */
30675     int n_localName;
30676     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30677     int n_namespaceURI;
30678 
30679     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30680     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30681     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30682         mem_base = xmlMemBlocks();
30683         reader = gen_xmlTextReaderPtr(n_reader, 0);
30684         localName = gen_const_xmlChar_ptr(n_localName, 1);
30685         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30686 
30687         ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30688         desret_xmlChar_ptr(ret_val);
30689         call_tests++;
30690         des_xmlTextReaderPtr(n_reader, reader, 0);
30691         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30692         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30693         xmlResetLastError();
30694         if (mem_base != xmlMemBlocks()) {
30695             printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30696 	           xmlMemBlocks() - mem_base);
30697 	    test_ret++;
30698             printf(" %d", n_reader);
30699             printf(" %d", n_localName);
30700             printf(" %d", n_namespaceURI);
30701             printf("\n");
30702         }
30703     }
30704     }
30705     }
30706     function_tests++;
30707 #endif
30708 
30709     return(test_ret);
30710 }
30711 
30712 #ifdef LIBXML_READER_ENABLED
30713 
30714 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)30715 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30716     return(NULL);
30717 }
des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)30718 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30719 }
30720 #endif
30721 
30722 
30723 static int
test_xmlTextReaderGetErrorHandler(void)30724 test_xmlTextReaderGetErrorHandler(void) {
30725     int test_ret = 0;
30726 
30727 #if defined(LIBXML_READER_ENABLED)
30728     int mem_base;
30729     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30730     int n_reader;
30731     xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30732     int n_f;
30733     void ** arg; /* a user argument */
30734     int n_arg;
30735 
30736     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30737     for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30738     for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30739         mem_base = xmlMemBlocks();
30740         reader = gen_xmlTextReaderPtr(n_reader, 0);
30741         f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30742         arg = gen_void_ptr_ptr(n_arg, 2);
30743 
30744         xmlTextReaderGetErrorHandler(reader, f, arg);
30745         call_tests++;
30746         des_xmlTextReaderPtr(n_reader, reader, 0);
30747         des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30748         des_void_ptr_ptr(n_arg, arg, 2);
30749         xmlResetLastError();
30750         if (mem_base != xmlMemBlocks()) {
30751             printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30752 	           xmlMemBlocks() - mem_base);
30753 	    test_ret++;
30754             printf(" %d", n_reader);
30755             printf(" %d", n_f);
30756             printf(" %d", n_arg);
30757             printf("\n");
30758         }
30759     }
30760     }
30761     }
30762     function_tests++;
30763 #endif
30764 
30765     return(test_ret);
30766 }
30767 
30768 
30769 static int
test_xmlTextReaderGetParserColumnNumber(void)30770 test_xmlTextReaderGetParserColumnNumber(void) {
30771     int test_ret = 0;
30772 
30773 #if defined(LIBXML_READER_ENABLED)
30774     int mem_base;
30775     int ret_val;
30776     xmlTextReaderPtr reader; /* the user data (XML reader context) */
30777     int n_reader;
30778 
30779     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30780         mem_base = xmlMemBlocks();
30781         reader = gen_xmlTextReaderPtr(n_reader, 0);
30782 
30783         ret_val = xmlTextReaderGetParserColumnNumber(reader);
30784         desret_int(ret_val);
30785         call_tests++;
30786         des_xmlTextReaderPtr(n_reader, reader, 0);
30787         xmlResetLastError();
30788         if (mem_base != xmlMemBlocks()) {
30789             printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30790 	           xmlMemBlocks() - mem_base);
30791 	    test_ret++;
30792             printf(" %d", n_reader);
30793             printf("\n");
30794         }
30795     }
30796     function_tests++;
30797 #endif
30798 
30799     return(test_ret);
30800 }
30801 
30802 
30803 static int
test_xmlTextReaderGetParserLineNumber(void)30804 test_xmlTextReaderGetParserLineNumber(void) {
30805     int test_ret = 0;
30806 
30807 #if defined(LIBXML_READER_ENABLED)
30808     int mem_base;
30809     int ret_val;
30810     xmlTextReaderPtr reader; /* the user data (XML reader context) */
30811     int n_reader;
30812 
30813     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30814         mem_base = xmlMemBlocks();
30815         reader = gen_xmlTextReaderPtr(n_reader, 0);
30816 
30817         ret_val = xmlTextReaderGetParserLineNumber(reader);
30818         desret_int(ret_val);
30819         call_tests++;
30820         des_xmlTextReaderPtr(n_reader, reader, 0);
30821         xmlResetLastError();
30822         if (mem_base != xmlMemBlocks()) {
30823             printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30824 	           xmlMemBlocks() - mem_base);
30825 	    test_ret++;
30826             printf(" %d", n_reader);
30827             printf("\n");
30828         }
30829     }
30830     function_tests++;
30831 #endif
30832 
30833     return(test_ret);
30834 }
30835 
30836 
30837 static int
test_xmlTextReaderGetParserProp(void)30838 test_xmlTextReaderGetParserProp(void) {
30839     int test_ret = 0;
30840 
30841 #if defined(LIBXML_READER_ENABLED)
30842     int mem_base;
30843     int ret_val;
30844     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30845     int n_reader;
30846     int prop; /* the xmlParserProperties to get */
30847     int n_prop;
30848 
30849     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30850     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30851         mem_base = xmlMemBlocks();
30852         reader = gen_xmlTextReaderPtr(n_reader, 0);
30853         prop = gen_int(n_prop, 1);
30854 
30855         ret_val = xmlTextReaderGetParserProp(reader, prop);
30856         desret_int(ret_val);
30857         call_tests++;
30858         des_xmlTextReaderPtr(n_reader, reader, 0);
30859         des_int(n_prop, prop, 1);
30860         xmlResetLastError();
30861         if (mem_base != xmlMemBlocks()) {
30862             printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30863 	           xmlMemBlocks() - mem_base);
30864 	    test_ret++;
30865             printf(" %d", n_reader);
30866             printf(" %d", n_prop);
30867             printf("\n");
30868         }
30869     }
30870     }
30871     function_tests++;
30872 #endif
30873 
30874     return(test_ret);
30875 }
30876 
30877 
30878 static int
test_xmlTextReaderGetRemainder(void)30879 test_xmlTextReaderGetRemainder(void) {
30880     int test_ret = 0;
30881 
30882 #if defined(LIBXML_READER_ENABLED)
30883     int mem_base;
30884     xmlParserInputBufferPtr ret_val;
30885     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30886     int n_reader;
30887 
30888     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30889         mem_base = xmlMemBlocks();
30890         reader = gen_xmlTextReaderPtr(n_reader, 0);
30891 
30892         ret_val = xmlTextReaderGetRemainder(reader);
30893         desret_xmlParserInputBufferPtr(ret_val);
30894         call_tests++;
30895         des_xmlTextReaderPtr(n_reader, reader, 0);
30896         xmlResetLastError();
30897         if (mem_base != xmlMemBlocks()) {
30898             printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30899 	           xmlMemBlocks() - mem_base);
30900 	    test_ret++;
30901             printf(" %d", n_reader);
30902             printf("\n");
30903         }
30904     }
30905     function_tests++;
30906 #endif
30907 
30908     return(test_ret);
30909 }
30910 
30911 
30912 static int
test_xmlTextReaderHasAttributes(void)30913 test_xmlTextReaderHasAttributes(void) {
30914     int test_ret = 0;
30915 
30916 #if defined(LIBXML_READER_ENABLED)
30917     int mem_base;
30918     int ret_val;
30919     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30920     int n_reader;
30921 
30922     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30923         mem_base = xmlMemBlocks();
30924         reader = gen_xmlTextReaderPtr(n_reader, 0);
30925 
30926         ret_val = xmlTextReaderHasAttributes(reader);
30927         desret_int(ret_val);
30928         call_tests++;
30929         des_xmlTextReaderPtr(n_reader, reader, 0);
30930         xmlResetLastError();
30931         if (mem_base != xmlMemBlocks()) {
30932             printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
30933 	           xmlMemBlocks() - mem_base);
30934 	    test_ret++;
30935             printf(" %d", n_reader);
30936             printf("\n");
30937         }
30938     }
30939     function_tests++;
30940 #endif
30941 
30942     return(test_ret);
30943 }
30944 
30945 
30946 static int
test_xmlTextReaderHasValue(void)30947 test_xmlTextReaderHasValue(void) {
30948     int test_ret = 0;
30949 
30950 #if defined(LIBXML_READER_ENABLED)
30951     int mem_base;
30952     int ret_val;
30953     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30954     int n_reader;
30955 
30956     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30957         mem_base = xmlMemBlocks();
30958         reader = gen_xmlTextReaderPtr(n_reader, 0);
30959 
30960         ret_val = xmlTextReaderHasValue(reader);
30961         desret_int(ret_val);
30962         call_tests++;
30963         des_xmlTextReaderPtr(n_reader, reader, 0);
30964         xmlResetLastError();
30965         if (mem_base != xmlMemBlocks()) {
30966             printf("Leak of %d blocks found in xmlTextReaderHasValue",
30967 	           xmlMemBlocks() - mem_base);
30968 	    test_ret++;
30969             printf(" %d", n_reader);
30970             printf("\n");
30971         }
30972     }
30973     function_tests++;
30974 #endif
30975 
30976     return(test_ret);
30977 }
30978 
30979 
30980 static int
test_xmlTextReaderIsDefault(void)30981 test_xmlTextReaderIsDefault(void) {
30982     int test_ret = 0;
30983 
30984 #if defined(LIBXML_READER_ENABLED)
30985     int mem_base;
30986     int ret_val;
30987     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30988     int n_reader;
30989 
30990     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30991         mem_base = xmlMemBlocks();
30992         reader = gen_xmlTextReaderPtr(n_reader, 0);
30993 
30994         ret_val = xmlTextReaderIsDefault(reader);
30995         desret_int(ret_val);
30996         call_tests++;
30997         des_xmlTextReaderPtr(n_reader, reader, 0);
30998         xmlResetLastError();
30999         if (mem_base != xmlMemBlocks()) {
31000             printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31001 	           xmlMemBlocks() - mem_base);
31002 	    test_ret++;
31003             printf(" %d", n_reader);
31004             printf("\n");
31005         }
31006     }
31007     function_tests++;
31008 #endif
31009 
31010     return(test_ret);
31011 }
31012 
31013 
31014 static int
test_xmlTextReaderIsEmptyElement(void)31015 test_xmlTextReaderIsEmptyElement(void) {
31016     int test_ret = 0;
31017 
31018 #if defined(LIBXML_READER_ENABLED)
31019     int mem_base;
31020     int ret_val;
31021     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31022     int n_reader;
31023 
31024     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31025         mem_base = xmlMemBlocks();
31026         reader = gen_xmlTextReaderPtr(n_reader, 0);
31027 
31028         ret_val = xmlTextReaderIsEmptyElement(reader);
31029         desret_int(ret_val);
31030         call_tests++;
31031         des_xmlTextReaderPtr(n_reader, reader, 0);
31032         xmlResetLastError();
31033         if (mem_base != xmlMemBlocks()) {
31034             printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31035 	           xmlMemBlocks() - mem_base);
31036 	    test_ret++;
31037             printf(" %d", n_reader);
31038             printf("\n");
31039         }
31040     }
31041     function_tests++;
31042 #endif
31043 
31044     return(test_ret);
31045 }
31046 
31047 
31048 static int
test_xmlTextReaderIsNamespaceDecl(void)31049 test_xmlTextReaderIsNamespaceDecl(void) {
31050     int test_ret = 0;
31051 
31052 #if defined(LIBXML_READER_ENABLED)
31053     int mem_base;
31054     int ret_val;
31055     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31056     int n_reader;
31057 
31058     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31059         mem_base = xmlMemBlocks();
31060         reader = gen_xmlTextReaderPtr(n_reader, 0);
31061 
31062         ret_val = xmlTextReaderIsNamespaceDecl(reader);
31063         desret_int(ret_val);
31064         call_tests++;
31065         des_xmlTextReaderPtr(n_reader, reader, 0);
31066         xmlResetLastError();
31067         if (mem_base != xmlMemBlocks()) {
31068             printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31069 	           xmlMemBlocks() - mem_base);
31070 	    test_ret++;
31071             printf(" %d", n_reader);
31072             printf("\n");
31073         }
31074     }
31075     function_tests++;
31076 #endif
31077 
31078     return(test_ret);
31079 }
31080 
31081 
31082 static int
test_xmlTextReaderIsValid(void)31083 test_xmlTextReaderIsValid(void) {
31084     int test_ret = 0;
31085 
31086 #if defined(LIBXML_READER_ENABLED)
31087     int mem_base;
31088     int ret_val;
31089     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31090     int n_reader;
31091 
31092     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31093         mem_base = xmlMemBlocks();
31094         reader = gen_xmlTextReaderPtr(n_reader, 0);
31095 
31096         ret_val = xmlTextReaderIsValid(reader);
31097         desret_int(ret_val);
31098         call_tests++;
31099         des_xmlTextReaderPtr(n_reader, reader, 0);
31100         xmlResetLastError();
31101         if (mem_base != xmlMemBlocks()) {
31102             printf("Leak of %d blocks found in xmlTextReaderIsValid",
31103 	           xmlMemBlocks() - mem_base);
31104 	    test_ret++;
31105             printf(" %d", n_reader);
31106             printf("\n");
31107         }
31108     }
31109     function_tests++;
31110 #endif
31111 
31112     return(test_ret);
31113 }
31114 
31115 
31116 static int
test_xmlTextReaderLocalName(void)31117 test_xmlTextReaderLocalName(void) {
31118     int test_ret = 0;
31119 
31120 #if defined(LIBXML_READER_ENABLED)
31121     int mem_base;
31122     xmlChar * ret_val;
31123     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31124     int n_reader;
31125 
31126     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31127         mem_base = xmlMemBlocks();
31128         reader = gen_xmlTextReaderPtr(n_reader, 0);
31129 
31130         ret_val = xmlTextReaderLocalName(reader);
31131         desret_xmlChar_ptr(ret_val);
31132         call_tests++;
31133         des_xmlTextReaderPtr(n_reader, reader, 0);
31134         xmlResetLastError();
31135         if (mem_base != xmlMemBlocks()) {
31136             printf("Leak of %d blocks found in xmlTextReaderLocalName",
31137 	           xmlMemBlocks() - mem_base);
31138 	    test_ret++;
31139             printf(" %d", n_reader);
31140             printf("\n");
31141         }
31142     }
31143     function_tests++;
31144 #endif
31145 
31146     return(test_ret);
31147 }
31148 
31149 #ifdef LIBXML_READER_ENABLED
31150 
31151 #define gen_nb_xmlTextReaderLocatorPtr 1
gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31152 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31153     return(NULL);
31154 }
des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED,xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)31155 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31156 }
31157 #endif
31158 
31159 
31160 static int
test_xmlTextReaderLocatorBaseURI(void)31161 test_xmlTextReaderLocatorBaseURI(void) {
31162     int test_ret = 0;
31163 
31164 #if defined(LIBXML_READER_ENABLED)
31165     int mem_base;
31166     xmlChar * ret_val;
31167     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31168     int n_locator;
31169 
31170     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31171         mem_base = xmlMemBlocks();
31172         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31173 
31174         ret_val = xmlTextReaderLocatorBaseURI(locator);
31175         desret_xmlChar_ptr(ret_val);
31176         call_tests++;
31177         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31178         xmlResetLastError();
31179         if (mem_base != xmlMemBlocks()) {
31180             printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31181 	           xmlMemBlocks() - mem_base);
31182 	    test_ret++;
31183             printf(" %d", n_locator);
31184             printf("\n");
31185         }
31186     }
31187     function_tests++;
31188 #endif
31189 
31190     return(test_ret);
31191 }
31192 
31193 
31194 static int
test_xmlTextReaderLocatorLineNumber(void)31195 test_xmlTextReaderLocatorLineNumber(void) {
31196     int test_ret = 0;
31197 
31198 #if defined(LIBXML_READER_ENABLED)
31199     int mem_base;
31200     int ret_val;
31201     xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31202     int n_locator;
31203 
31204     for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31205         mem_base = xmlMemBlocks();
31206         locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31207 
31208         ret_val = xmlTextReaderLocatorLineNumber(locator);
31209         desret_int(ret_val);
31210         call_tests++;
31211         des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31212         xmlResetLastError();
31213         if (mem_base != xmlMemBlocks()) {
31214             printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31215 	           xmlMemBlocks() - mem_base);
31216 	    test_ret++;
31217             printf(" %d", n_locator);
31218             printf("\n");
31219         }
31220     }
31221     function_tests++;
31222 #endif
31223 
31224     return(test_ret);
31225 }
31226 
31227 
31228 static int
test_xmlTextReaderLookupNamespace(void)31229 test_xmlTextReaderLookupNamespace(void) {
31230     int test_ret = 0;
31231 
31232 #if defined(LIBXML_READER_ENABLED)
31233     int mem_base;
31234     xmlChar * ret_val;
31235     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31236     int n_reader;
31237     xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31238     int n_prefix;
31239 
31240     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31241     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31242         mem_base = xmlMemBlocks();
31243         reader = gen_xmlTextReaderPtr(n_reader, 0);
31244         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31245 
31246         ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31247         desret_xmlChar_ptr(ret_val);
31248         call_tests++;
31249         des_xmlTextReaderPtr(n_reader, reader, 0);
31250         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31251         xmlResetLastError();
31252         if (mem_base != xmlMemBlocks()) {
31253             printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31254 	           xmlMemBlocks() - mem_base);
31255 	    test_ret++;
31256             printf(" %d", n_reader);
31257             printf(" %d", n_prefix);
31258             printf("\n");
31259         }
31260     }
31261     }
31262     function_tests++;
31263 #endif
31264 
31265     return(test_ret);
31266 }
31267 
31268 
31269 static int
test_xmlTextReaderMoveToAttribute(void)31270 test_xmlTextReaderMoveToAttribute(void) {
31271     int test_ret = 0;
31272 
31273 #if defined(LIBXML_READER_ENABLED)
31274     int mem_base;
31275     int ret_val;
31276     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31277     int n_reader;
31278     xmlChar * name; /* the qualified name of the attribute. */
31279     int n_name;
31280 
31281     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31282     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31283         mem_base = xmlMemBlocks();
31284         reader = gen_xmlTextReaderPtr(n_reader, 0);
31285         name = gen_const_xmlChar_ptr(n_name, 1);
31286 
31287         ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31288         desret_int(ret_val);
31289         call_tests++;
31290         des_xmlTextReaderPtr(n_reader, reader, 0);
31291         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31292         xmlResetLastError();
31293         if (mem_base != xmlMemBlocks()) {
31294             printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31295 	           xmlMemBlocks() - mem_base);
31296 	    test_ret++;
31297             printf(" %d", n_reader);
31298             printf(" %d", n_name);
31299             printf("\n");
31300         }
31301     }
31302     }
31303     function_tests++;
31304 #endif
31305 
31306     return(test_ret);
31307 }
31308 
31309 
31310 static int
test_xmlTextReaderMoveToAttributeNo(void)31311 test_xmlTextReaderMoveToAttributeNo(void) {
31312     int test_ret = 0;
31313 
31314 #if defined(LIBXML_READER_ENABLED)
31315     int mem_base;
31316     int ret_val;
31317     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31318     int n_reader;
31319     int no; /* the zero-based index of the attribute relative to the containing element. */
31320     int n_no;
31321 
31322     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31323     for (n_no = 0;n_no < gen_nb_int;n_no++) {
31324         mem_base = xmlMemBlocks();
31325         reader = gen_xmlTextReaderPtr(n_reader, 0);
31326         no = gen_int(n_no, 1);
31327 
31328         ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31329         desret_int(ret_val);
31330         call_tests++;
31331         des_xmlTextReaderPtr(n_reader, reader, 0);
31332         des_int(n_no, no, 1);
31333         xmlResetLastError();
31334         if (mem_base != xmlMemBlocks()) {
31335             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31336 	           xmlMemBlocks() - mem_base);
31337 	    test_ret++;
31338             printf(" %d", n_reader);
31339             printf(" %d", n_no);
31340             printf("\n");
31341         }
31342     }
31343     }
31344     function_tests++;
31345 #endif
31346 
31347     return(test_ret);
31348 }
31349 
31350 
31351 static int
test_xmlTextReaderMoveToAttributeNs(void)31352 test_xmlTextReaderMoveToAttributeNs(void) {
31353     int test_ret = 0;
31354 
31355 #if defined(LIBXML_READER_ENABLED)
31356     int mem_base;
31357     int ret_val;
31358     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31359     int n_reader;
31360     xmlChar * localName; /* the local name of the attribute. */
31361     int n_localName;
31362     xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31363     int n_namespaceURI;
31364 
31365     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31366     for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31367     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31368         mem_base = xmlMemBlocks();
31369         reader = gen_xmlTextReaderPtr(n_reader, 0);
31370         localName = gen_const_xmlChar_ptr(n_localName, 1);
31371         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31372 
31373         ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31374         desret_int(ret_val);
31375         call_tests++;
31376         des_xmlTextReaderPtr(n_reader, reader, 0);
31377         des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31378         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31379         xmlResetLastError();
31380         if (mem_base != xmlMemBlocks()) {
31381             printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31382 	           xmlMemBlocks() - mem_base);
31383 	    test_ret++;
31384             printf(" %d", n_reader);
31385             printf(" %d", n_localName);
31386             printf(" %d", n_namespaceURI);
31387             printf("\n");
31388         }
31389     }
31390     }
31391     }
31392     function_tests++;
31393 #endif
31394 
31395     return(test_ret);
31396 }
31397 
31398 
31399 static int
test_xmlTextReaderMoveToElement(void)31400 test_xmlTextReaderMoveToElement(void) {
31401     int test_ret = 0;
31402 
31403 #if defined(LIBXML_READER_ENABLED)
31404     int mem_base;
31405     int ret_val;
31406     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31407     int n_reader;
31408 
31409     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31410         mem_base = xmlMemBlocks();
31411         reader = gen_xmlTextReaderPtr(n_reader, 0);
31412 
31413         ret_val = xmlTextReaderMoveToElement(reader);
31414         desret_int(ret_val);
31415         call_tests++;
31416         des_xmlTextReaderPtr(n_reader, reader, 0);
31417         xmlResetLastError();
31418         if (mem_base != xmlMemBlocks()) {
31419             printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31420 	           xmlMemBlocks() - mem_base);
31421 	    test_ret++;
31422             printf(" %d", n_reader);
31423             printf("\n");
31424         }
31425     }
31426     function_tests++;
31427 #endif
31428 
31429     return(test_ret);
31430 }
31431 
31432 
31433 static int
test_xmlTextReaderMoveToFirstAttribute(void)31434 test_xmlTextReaderMoveToFirstAttribute(void) {
31435     int test_ret = 0;
31436 
31437 #if defined(LIBXML_READER_ENABLED)
31438     int mem_base;
31439     int ret_val;
31440     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31441     int n_reader;
31442 
31443     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31444         mem_base = xmlMemBlocks();
31445         reader = gen_xmlTextReaderPtr(n_reader, 0);
31446 
31447         ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31448         desret_int(ret_val);
31449         call_tests++;
31450         des_xmlTextReaderPtr(n_reader, reader, 0);
31451         xmlResetLastError();
31452         if (mem_base != xmlMemBlocks()) {
31453             printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31454 	           xmlMemBlocks() - mem_base);
31455 	    test_ret++;
31456             printf(" %d", n_reader);
31457             printf("\n");
31458         }
31459     }
31460     function_tests++;
31461 #endif
31462 
31463     return(test_ret);
31464 }
31465 
31466 
31467 static int
test_xmlTextReaderMoveToNextAttribute(void)31468 test_xmlTextReaderMoveToNextAttribute(void) {
31469     int test_ret = 0;
31470 
31471 #if defined(LIBXML_READER_ENABLED)
31472     int mem_base;
31473     int ret_val;
31474     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31475     int n_reader;
31476 
31477     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31478         mem_base = xmlMemBlocks();
31479         reader = gen_xmlTextReaderPtr(n_reader, 0);
31480 
31481         ret_val = xmlTextReaderMoveToNextAttribute(reader);
31482         desret_int(ret_val);
31483         call_tests++;
31484         des_xmlTextReaderPtr(n_reader, reader, 0);
31485         xmlResetLastError();
31486         if (mem_base != xmlMemBlocks()) {
31487             printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31488 	           xmlMemBlocks() - mem_base);
31489 	    test_ret++;
31490             printf(" %d", n_reader);
31491             printf("\n");
31492         }
31493     }
31494     function_tests++;
31495 #endif
31496 
31497     return(test_ret);
31498 }
31499 
31500 
31501 static int
test_xmlTextReaderName(void)31502 test_xmlTextReaderName(void) {
31503     int test_ret = 0;
31504 
31505 #if defined(LIBXML_READER_ENABLED)
31506     int mem_base;
31507     xmlChar * ret_val;
31508     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31509     int n_reader;
31510 
31511     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31512         mem_base = xmlMemBlocks();
31513         reader = gen_xmlTextReaderPtr(n_reader, 0);
31514 
31515         ret_val = xmlTextReaderName(reader);
31516         desret_xmlChar_ptr(ret_val);
31517         call_tests++;
31518         des_xmlTextReaderPtr(n_reader, reader, 0);
31519         xmlResetLastError();
31520         if (mem_base != xmlMemBlocks()) {
31521             printf("Leak of %d blocks found in xmlTextReaderName",
31522 	           xmlMemBlocks() - mem_base);
31523 	    test_ret++;
31524             printf(" %d", n_reader);
31525             printf("\n");
31526         }
31527     }
31528     function_tests++;
31529 #endif
31530 
31531     return(test_ret);
31532 }
31533 
31534 
31535 static int
test_xmlTextReaderNamespaceUri(void)31536 test_xmlTextReaderNamespaceUri(void) {
31537     int test_ret = 0;
31538 
31539 #if defined(LIBXML_READER_ENABLED)
31540     int mem_base;
31541     xmlChar * ret_val;
31542     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31543     int n_reader;
31544 
31545     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31546         mem_base = xmlMemBlocks();
31547         reader = gen_xmlTextReaderPtr(n_reader, 0);
31548 
31549         ret_val = xmlTextReaderNamespaceUri(reader);
31550         desret_xmlChar_ptr(ret_val);
31551         call_tests++;
31552         des_xmlTextReaderPtr(n_reader, reader, 0);
31553         xmlResetLastError();
31554         if (mem_base != xmlMemBlocks()) {
31555             printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31556 	           xmlMemBlocks() - mem_base);
31557 	    test_ret++;
31558             printf(" %d", n_reader);
31559             printf("\n");
31560         }
31561     }
31562     function_tests++;
31563 #endif
31564 
31565     return(test_ret);
31566 }
31567 
31568 
31569 static int
test_xmlTextReaderNext(void)31570 test_xmlTextReaderNext(void) {
31571     int test_ret = 0;
31572 
31573 #if defined(LIBXML_READER_ENABLED)
31574     int mem_base;
31575     int ret_val;
31576     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31577     int n_reader;
31578 
31579     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31580         mem_base = xmlMemBlocks();
31581         reader = gen_xmlTextReaderPtr(n_reader, 0);
31582 
31583         ret_val = xmlTextReaderNext(reader);
31584         desret_int(ret_val);
31585         call_tests++;
31586         des_xmlTextReaderPtr(n_reader, reader, 0);
31587         xmlResetLastError();
31588         if (mem_base != xmlMemBlocks()) {
31589             printf("Leak of %d blocks found in xmlTextReaderNext",
31590 	           xmlMemBlocks() - mem_base);
31591 	    test_ret++;
31592             printf(" %d", n_reader);
31593             printf("\n");
31594         }
31595     }
31596     function_tests++;
31597 #endif
31598 
31599     return(test_ret);
31600 }
31601 
31602 
31603 static int
test_xmlTextReaderNextSibling(void)31604 test_xmlTextReaderNextSibling(void) {
31605     int test_ret = 0;
31606 
31607 #if defined(LIBXML_READER_ENABLED)
31608     int mem_base;
31609     int ret_val;
31610     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31611     int n_reader;
31612 
31613     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31614         mem_base = xmlMemBlocks();
31615         reader = gen_xmlTextReaderPtr(n_reader, 0);
31616 
31617         ret_val = xmlTextReaderNextSibling(reader);
31618         desret_int(ret_val);
31619         call_tests++;
31620         des_xmlTextReaderPtr(n_reader, reader, 0);
31621         xmlResetLastError();
31622         if (mem_base != xmlMemBlocks()) {
31623             printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31624 	           xmlMemBlocks() - mem_base);
31625 	    test_ret++;
31626             printf(" %d", n_reader);
31627             printf("\n");
31628         }
31629     }
31630     function_tests++;
31631 #endif
31632 
31633     return(test_ret);
31634 }
31635 
31636 
31637 static int
test_xmlTextReaderNodeType(void)31638 test_xmlTextReaderNodeType(void) {
31639     int test_ret = 0;
31640 
31641 #if defined(LIBXML_READER_ENABLED)
31642     int mem_base;
31643     int ret_val;
31644     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31645     int n_reader;
31646 
31647     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31648         mem_base = xmlMemBlocks();
31649         reader = gen_xmlTextReaderPtr(n_reader, 0);
31650 
31651         ret_val = xmlTextReaderNodeType(reader);
31652         desret_int(ret_val);
31653         call_tests++;
31654         des_xmlTextReaderPtr(n_reader, reader, 0);
31655         xmlResetLastError();
31656         if (mem_base != xmlMemBlocks()) {
31657             printf("Leak of %d blocks found in xmlTextReaderNodeType",
31658 	           xmlMemBlocks() - mem_base);
31659 	    test_ret++;
31660             printf(" %d", n_reader);
31661             printf("\n");
31662         }
31663     }
31664     function_tests++;
31665 #endif
31666 
31667     return(test_ret);
31668 }
31669 
31670 
31671 static int
test_xmlTextReaderNormalization(void)31672 test_xmlTextReaderNormalization(void) {
31673     int test_ret = 0;
31674 
31675 #if defined(LIBXML_READER_ENABLED)
31676     int mem_base;
31677     int ret_val;
31678     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31679     int n_reader;
31680 
31681     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31682         mem_base = xmlMemBlocks();
31683         reader = gen_xmlTextReaderPtr(n_reader, 0);
31684 
31685         ret_val = xmlTextReaderNormalization(reader);
31686         desret_int(ret_val);
31687         call_tests++;
31688         des_xmlTextReaderPtr(n_reader, reader, 0);
31689         xmlResetLastError();
31690         if (mem_base != xmlMemBlocks()) {
31691             printf("Leak of %d blocks found in xmlTextReaderNormalization",
31692 	           xmlMemBlocks() - mem_base);
31693 	    test_ret++;
31694             printf(" %d", n_reader);
31695             printf("\n");
31696         }
31697     }
31698     function_tests++;
31699 #endif
31700 
31701     return(test_ret);
31702 }
31703 
31704 
31705 static int
test_xmlTextReaderPrefix(void)31706 test_xmlTextReaderPrefix(void) {
31707     int test_ret = 0;
31708 
31709 #if defined(LIBXML_READER_ENABLED)
31710     int mem_base;
31711     xmlChar * ret_val;
31712     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31713     int n_reader;
31714 
31715     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31716         mem_base = xmlMemBlocks();
31717         reader = gen_xmlTextReaderPtr(n_reader, 0);
31718 
31719         ret_val = xmlTextReaderPrefix(reader);
31720         desret_xmlChar_ptr(ret_val);
31721         call_tests++;
31722         des_xmlTextReaderPtr(n_reader, reader, 0);
31723         xmlResetLastError();
31724         if (mem_base != xmlMemBlocks()) {
31725             printf("Leak of %d blocks found in xmlTextReaderPrefix",
31726 	           xmlMemBlocks() - mem_base);
31727 	    test_ret++;
31728             printf(" %d", n_reader);
31729             printf("\n");
31730         }
31731     }
31732     function_tests++;
31733 #endif
31734 
31735     return(test_ret);
31736 }
31737 
31738 
31739 static int
test_xmlTextReaderPreserve(void)31740 test_xmlTextReaderPreserve(void) {
31741     int test_ret = 0;
31742 
31743 #if defined(LIBXML_READER_ENABLED)
31744     int mem_base;
31745     xmlNodePtr ret_val;
31746     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31747     int n_reader;
31748 
31749     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31750         mem_base = xmlMemBlocks();
31751         reader = gen_xmlTextReaderPtr(n_reader, 0);
31752 
31753         ret_val = xmlTextReaderPreserve(reader);
31754         desret_xmlNodePtr(ret_val);
31755         call_tests++;
31756         des_xmlTextReaderPtr(n_reader, reader, 0);
31757         xmlResetLastError();
31758         if (mem_base != xmlMemBlocks()) {
31759             printf("Leak of %d blocks found in xmlTextReaderPreserve",
31760 	           xmlMemBlocks() - mem_base);
31761 	    test_ret++;
31762             printf(" %d", n_reader);
31763             printf("\n");
31764         }
31765     }
31766     function_tests++;
31767 #endif
31768 
31769     return(test_ret);
31770 }
31771 
31772 
31773 static int
test_xmlTextReaderPreservePattern(void)31774 test_xmlTextReaderPreservePattern(void) {
31775     int test_ret = 0;
31776 
31777 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31778 #ifdef LIBXML_PATTERN_ENABLED
31779     int mem_base;
31780     int ret_val;
31781     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31782     int n_reader;
31783     xmlChar * pattern; /* an XPath subset pattern */
31784     int n_pattern;
31785     xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31786     int n_namespaces;
31787 
31788     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31789     for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31790     for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31791         mem_base = xmlMemBlocks();
31792         reader = gen_xmlTextReaderPtr(n_reader, 0);
31793         pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31794         namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31795 
31796         ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31797         desret_int(ret_val);
31798         call_tests++;
31799         des_xmlTextReaderPtr(n_reader, reader, 0);
31800         des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31801         des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31802         xmlResetLastError();
31803         if (mem_base != xmlMemBlocks()) {
31804             printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31805 	           xmlMemBlocks() - mem_base);
31806 	    test_ret++;
31807             printf(" %d", n_reader);
31808             printf(" %d", n_pattern);
31809             printf(" %d", n_namespaces);
31810             printf("\n");
31811         }
31812     }
31813     }
31814     }
31815     function_tests++;
31816 #endif
31817 #endif
31818 
31819     return(test_ret);
31820 }
31821 
31822 
31823 static int
test_xmlTextReaderQuoteChar(void)31824 test_xmlTextReaderQuoteChar(void) {
31825     int test_ret = 0;
31826 
31827 #if defined(LIBXML_READER_ENABLED)
31828     int mem_base;
31829     int ret_val;
31830     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31831     int n_reader;
31832 
31833     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31834         mem_base = xmlMemBlocks();
31835         reader = gen_xmlTextReaderPtr(n_reader, 0);
31836 
31837         ret_val = xmlTextReaderQuoteChar(reader);
31838         desret_int(ret_val);
31839         call_tests++;
31840         des_xmlTextReaderPtr(n_reader, reader, 0);
31841         xmlResetLastError();
31842         if (mem_base != xmlMemBlocks()) {
31843             printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31844 	           xmlMemBlocks() - mem_base);
31845 	    test_ret++;
31846             printf(" %d", n_reader);
31847             printf("\n");
31848         }
31849     }
31850     function_tests++;
31851 #endif
31852 
31853     return(test_ret);
31854 }
31855 
31856 
31857 static int
test_xmlTextReaderRead(void)31858 test_xmlTextReaderRead(void) {
31859     int test_ret = 0;
31860 
31861 #if defined(LIBXML_READER_ENABLED)
31862     int mem_base;
31863     int ret_val;
31864     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31865     int n_reader;
31866 
31867     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31868         mem_base = xmlMemBlocks();
31869         reader = gen_xmlTextReaderPtr(n_reader, 0);
31870 
31871         ret_val = xmlTextReaderRead(reader);
31872         desret_int(ret_val);
31873         call_tests++;
31874         des_xmlTextReaderPtr(n_reader, reader, 0);
31875         xmlResetLastError();
31876         if (mem_base != xmlMemBlocks()) {
31877             printf("Leak of %d blocks found in xmlTextReaderRead",
31878 	           xmlMemBlocks() - mem_base);
31879 	    test_ret++;
31880             printf(" %d", n_reader);
31881             printf("\n");
31882         }
31883     }
31884     function_tests++;
31885 #endif
31886 
31887     return(test_ret);
31888 }
31889 
31890 
31891 static int
test_xmlTextReaderReadAttributeValue(void)31892 test_xmlTextReaderReadAttributeValue(void) {
31893     int test_ret = 0;
31894 
31895 #if defined(LIBXML_READER_ENABLED)
31896     int mem_base;
31897     int ret_val;
31898     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31899     int n_reader;
31900 
31901     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31902         mem_base = xmlMemBlocks();
31903         reader = gen_xmlTextReaderPtr(n_reader, 0);
31904 
31905         ret_val = xmlTextReaderReadAttributeValue(reader);
31906         desret_int(ret_val);
31907         call_tests++;
31908         des_xmlTextReaderPtr(n_reader, reader, 0);
31909         xmlResetLastError();
31910         if (mem_base != xmlMemBlocks()) {
31911             printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31912 	           xmlMemBlocks() - mem_base);
31913 	    test_ret++;
31914             printf(" %d", n_reader);
31915             printf("\n");
31916         }
31917     }
31918     function_tests++;
31919 #endif
31920 
31921     return(test_ret);
31922 }
31923 
31924 
31925 static int
test_xmlTextReaderReadState(void)31926 test_xmlTextReaderReadState(void) {
31927     int test_ret = 0;
31928 
31929 #if defined(LIBXML_READER_ENABLED)
31930     int mem_base;
31931     int ret_val;
31932     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31933     int n_reader;
31934 
31935     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31936         mem_base = xmlMemBlocks();
31937         reader = gen_xmlTextReaderPtr(n_reader, 0);
31938 
31939         ret_val = xmlTextReaderReadState(reader);
31940         desret_int(ret_val);
31941         call_tests++;
31942         des_xmlTextReaderPtr(n_reader, reader, 0);
31943         xmlResetLastError();
31944         if (mem_base != xmlMemBlocks()) {
31945             printf("Leak of %d blocks found in xmlTextReaderReadState",
31946 	           xmlMemBlocks() - mem_base);
31947 	    test_ret++;
31948             printf(" %d", n_reader);
31949             printf("\n");
31950         }
31951     }
31952     function_tests++;
31953 #endif
31954 
31955     return(test_ret);
31956 }
31957 
31958 
31959 static int
test_xmlTextReaderRelaxNGSetSchema(void)31960 test_xmlTextReaderRelaxNGSetSchema(void) {
31961     int test_ret = 0;
31962 
31963 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
31964     int mem_base;
31965     int ret_val;
31966     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31967     int n_reader;
31968     xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
31969     int n_schema;
31970 
31971     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31972     for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
31973         mem_base = xmlMemBlocks();
31974         reader = gen_xmlTextReaderPtr(n_reader, 0);
31975         schema = gen_xmlRelaxNGPtr(n_schema, 1);
31976 
31977         ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
31978         desret_int(ret_val);
31979         call_tests++;
31980         des_xmlTextReaderPtr(n_reader, reader, 0);
31981         des_xmlRelaxNGPtr(n_schema, schema, 1);
31982         xmlResetLastError();
31983         if (mem_base != xmlMemBlocks()) {
31984             printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
31985 	           xmlMemBlocks() - mem_base);
31986 	    test_ret++;
31987             printf(" %d", n_reader);
31988             printf(" %d", n_schema);
31989             printf("\n");
31990         }
31991     }
31992     }
31993     function_tests++;
31994 #endif
31995 
31996     return(test_ret);
31997 }
31998 
31999 
32000 static int
test_xmlTextReaderRelaxNGValidate(void)32001 test_xmlTextReaderRelaxNGValidate(void) {
32002     int test_ret = 0;
32003 
32004 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32005     int mem_base;
32006     int ret_val;
32007     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32008     int n_reader;
32009     char * rng; /* the path to a RelaxNG schema or NULL */
32010     int n_rng;
32011 
32012     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32013     for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32014         mem_base = xmlMemBlocks();
32015         reader = gen_xmlTextReaderPtr(n_reader, 0);
32016         rng = gen_const_char_ptr(n_rng, 1);
32017 
32018         ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32019         desret_int(ret_val);
32020         call_tests++;
32021         des_xmlTextReaderPtr(n_reader, reader, 0);
32022         des_const_char_ptr(n_rng, (const char *)rng, 1);
32023         xmlResetLastError();
32024         if (mem_base != xmlMemBlocks()) {
32025             printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32026 	           xmlMemBlocks() - mem_base);
32027 	    test_ret++;
32028             printf(" %d", n_reader);
32029             printf(" %d", n_rng);
32030             printf("\n");
32031         }
32032     }
32033     }
32034     function_tests++;
32035 #endif
32036 
32037     return(test_ret);
32038 }
32039 
32040 
32041 static int
test_xmlTextReaderSchemaValidate(void)32042 test_xmlTextReaderSchemaValidate(void) {
32043     int test_ret = 0;
32044 
32045 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32046     int ret_val;
32047     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32048     int n_reader;
32049     char * xsd; /* the path to a W3C XSD schema or NULL */
32050     int n_xsd;
32051 
32052     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32053     for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32054         reader = gen_xmlTextReaderPtr(n_reader, 0);
32055         xsd = gen_const_char_ptr(n_xsd, 1);
32056 
32057         ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32058         desret_int(ret_val);
32059         call_tests++;
32060         des_xmlTextReaderPtr(n_reader, reader, 0);
32061         des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32062         xmlResetLastError();
32063     }
32064     }
32065     function_tests++;
32066 #endif
32067 
32068     return(test_ret);
32069 }
32070 
32071 #ifdef LIBXML_READER_ENABLED
32072 
32073 #define gen_nb_xmlSchemaValidCtxtPtr 1
gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)32074 static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32075     return(NULL);
32076 }
des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)32077 static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32078 }
32079 #endif
32080 
32081 
32082 static int
test_xmlTextReaderSchemaValidateCtxt(void)32083 test_xmlTextReaderSchemaValidateCtxt(void) {
32084     int test_ret = 0;
32085 
32086 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32087     int mem_base;
32088     int ret_val;
32089     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32090     int n_reader;
32091     xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32092     int n_ctxt;
32093     int options; /* options (not used yet) */
32094     int n_options;
32095 
32096     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32097     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32098     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32099         mem_base = xmlMemBlocks();
32100         reader = gen_xmlTextReaderPtr(n_reader, 0);
32101         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32102         options = gen_parseroptions(n_options, 2);
32103 
32104         ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32105         desret_int(ret_val);
32106         call_tests++;
32107         des_xmlTextReaderPtr(n_reader, reader, 0);
32108         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32109         des_parseroptions(n_options, options, 2);
32110         xmlResetLastError();
32111         if (mem_base != xmlMemBlocks()) {
32112             printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32113 	           xmlMemBlocks() - mem_base);
32114 	    test_ret++;
32115             printf(" %d", n_reader);
32116             printf(" %d", n_ctxt);
32117             printf(" %d", n_options);
32118             printf("\n");
32119         }
32120     }
32121     }
32122     }
32123     function_tests++;
32124 #endif
32125 
32126     return(test_ret);
32127 }
32128 
32129 
32130 static int
test_xmlTextReaderSetErrorHandler(void)32131 test_xmlTextReaderSetErrorHandler(void) {
32132     int test_ret = 0;
32133 
32134 
32135     /* missing type support */
32136     return(test_ret);
32137 }
32138 
32139 
32140 static int
test_xmlTextReaderSetParserProp(void)32141 test_xmlTextReaderSetParserProp(void) {
32142     int test_ret = 0;
32143 
32144 #if defined(LIBXML_READER_ENABLED)
32145     int mem_base;
32146     int ret_val;
32147     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32148     int n_reader;
32149     int prop; /* the xmlParserProperties to set */
32150     int n_prop;
32151     int value; /* usually 0 or 1 to (de)activate it */
32152     int n_value;
32153 
32154     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32155     for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32156     for (n_value = 0;n_value < gen_nb_int;n_value++) {
32157         mem_base = xmlMemBlocks();
32158         reader = gen_xmlTextReaderPtr(n_reader, 0);
32159         prop = gen_int(n_prop, 1);
32160         value = gen_int(n_value, 2);
32161 
32162         ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32163         desret_int(ret_val);
32164         call_tests++;
32165         des_xmlTextReaderPtr(n_reader, reader, 0);
32166         des_int(n_prop, prop, 1);
32167         des_int(n_value, value, 2);
32168         xmlResetLastError();
32169         if (mem_base != xmlMemBlocks()) {
32170             printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32171 	           xmlMemBlocks() - mem_base);
32172 	    test_ret++;
32173             printf(" %d", n_reader);
32174             printf(" %d", n_prop);
32175             printf(" %d", n_value);
32176             printf("\n");
32177         }
32178     }
32179     }
32180     }
32181     function_tests++;
32182 #endif
32183 
32184     return(test_ret);
32185 }
32186 
32187 #ifdef LIBXML_READER_ENABLED
32188 
32189 #define gen_nb_xmlSchemaPtr 1
gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)32190 static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32191     return(NULL);
32192 }
des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED,xmlSchemaPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)32193 static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32194 }
32195 #endif
32196 
32197 
32198 static int
test_xmlTextReaderSetSchema(void)32199 test_xmlTextReaderSetSchema(void) {
32200     int test_ret = 0;
32201 
32202 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32203     int mem_base;
32204     int ret_val;
32205     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32206     int n_reader;
32207     xmlSchemaPtr schema; /* a precompiled Schema schema */
32208     int n_schema;
32209 
32210     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32211     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32212         mem_base = xmlMemBlocks();
32213         reader = gen_xmlTextReaderPtr(n_reader, 0);
32214         schema = gen_xmlSchemaPtr(n_schema, 1);
32215 
32216         ret_val = xmlTextReaderSetSchema(reader, schema);
32217         desret_int(ret_val);
32218         call_tests++;
32219         des_xmlTextReaderPtr(n_reader, reader, 0);
32220         des_xmlSchemaPtr(n_schema, schema, 1);
32221         xmlResetLastError();
32222         if (mem_base != xmlMemBlocks()) {
32223             printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32224 	           xmlMemBlocks() - mem_base);
32225 	    test_ret++;
32226             printf(" %d", n_reader);
32227             printf(" %d", n_schema);
32228             printf("\n");
32229         }
32230     }
32231     }
32232     function_tests++;
32233 #endif
32234 
32235     return(test_ret);
32236 }
32237 
32238 
32239 static int
test_xmlTextReaderSetStructuredErrorHandler(void)32240 test_xmlTextReaderSetStructuredErrorHandler(void) {
32241     int test_ret = 0;
32242 
32243 
32244     /* missing type support */
32245     return(test_ret);
32246 }
32247 
32248 
32249 static int
test_xmlTextReaderSetup(void)32250 test_xmlTextReaderSetup(void) {
32251     int test_ret = 0;
32252 
32253 #if defined(LIBXML_READER_ENABLED)
32254     int mem_base;
32255     int ret_val;
32256     xmlTextReaderPtr reader; /* an XML reader */
32257     int n_reader;
32258     xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32259     int n_input;
32260     const char * URL; /* the base URL to use for the document */
32261     int n_URL;
32262     char * encoding; /* the document encoding, or NULL */
32263     int n_encoding;
32264     int options; /* a combination of xmlParserOption */
32265     int n_options;
32266 
32267     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32268     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32269     for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32270     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32271     for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32272         mem_base = xmlMemBlocks();
32273         reader = gen_xmlTextReaderPtr(n_reader, 0);
32274         input = gen_xmlParserInputBufferPtr(n_input, 1);
32275         URL = gen_filepath(n_URL, 2);
32276         encoding = gen_const_char_ptr(n_encoding, 3);
32277         options = gen_parseroptions(n_options, 4);
32278 
32279         ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32280         desret_int(ret_val);
32281         call_tests++;
32282         des_xmlTextReaderPtr(n_reader, reader, 0);
32283         des_filepath(n_URL, URL, 2);
32284         des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32285         des_parseroptions(n_options, options, 4);
32286         xmlResetLastError();
32287         if (mem_base != xmlMemBlocks()) {
32288             printf("Leak of %d blocks found in xmlTextReaderSetup",
32289 	           xmlMemBlocks() - mem_base);
32290 	    test_ret++;
32291             printf(" %d", n_reader);
32292             printf(" %d", n_input);
32293             printf(" %d", n_URL);
32294             printf(" %d", n_encoding);
32295             printf(" %d", n_options);
32296             printf("\n");
32297         }
32298     }
32299     }
32300     }
32301     }
32302     }
32303     function_tests++;
32304 #endif
32305 
32306     return(test_ret);
32307 }
32308 
32309 
32310 static int
test_xmlTextReaderStandalone(void)32311 test_xmlTextReaderStandalone(void) {
32312     int test_ret = 0;
32313 
32314 #if defined(LIBXML_READER_ENABLED)
32315     int mem_base;
32316     int ret_val;
32317     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32318     int n_reader;
32319 
32320     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32321         mem_base = xmlMemBlocks();
32322         reader = gen_xmlTextReaderPtr(n_reader, 0);
32323 
32324         ret_val = xmlTextReaderStandalone(reader);
32325         desret_int(ret_val);
32326         call_tests++;
32327         des_xmlTextReaderPtr(n_reader, reader, 0);
32328         xmlResetLastError();
32329         if (mem_base != xmlMemBlocks()) {
32330             printf("Leak of %d blocks found in xmlTextReaderStandalone",
32331 	           xmlMemBlocks() - mem_base);
32332 	    test_ret++;
32333             printf(" %d", n_reader);
32334             printf("\n");
32335         }
32336     }
32337     function_tests++;
32338 #endif
32339 
32340     return(test_ret);
32341 }
32342 
32343 
32344 static int
test_xmlTextReaderValue(void)32345 test_xmlTextReaderValue(void) {
32346     int test_ret = 0;
32347 
32348 #if defined(LIBXML_READER_ENABLED)
32349     int mem_base;
32350     xmlChar * ret_val;
32351     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32352     int n_reader;
32353 
32354     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32355         mem_base = xmlMemBlocks();
32356         reader = gen_xmlTextReaderPtr(n_reader, 0);
32357 
32358         ret_val = xmlTextReaderValue(reader);
32359         desret_xmlChar_ptr(ret_val);
32360         call_tests++;
32361         des_xmlTextReaderPtr(n_reader, reader, 0);
32362         xmlResetLastError();
32363         if (mem_base != xmlMemBlocks()) {
32364             printf("Leak of %d blocks found in xmlTextReaderValue",
32365 	           xmlMemBlocks() - mem_base);
32366 	    test_ret++;
32367             printf(" %d", n_reader);
32368             printf("\n");
32369         }
32370     }
32371     function_tests++;
32372 #endif
32373 
32374     return(test_ret);
32375 }
32376 
32377 
32378 static int
test_xmlTextReaderXmlLang(void)32379 test_xmlTextReaderXmlLang(void) {
32380     int test_ret = 0;
32381 
32382 #if defined(LIBXML_READER_ENABLED)
32383     int mem_base;
32384     xmlChar * ret_val;
32385     xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32386     int n_reader;
32387 
32388     for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32389         mem_base = xmlMemBlocks();
32390         reader = gen_xmlTextReaderPtr(n_reader, 0);
32391 
32392         ret_val = xmlTextReaderXmlLang(reader);
32393         desret_xmlChar_ptr(ret_val);
32394         call_tests++;
32395         des_xmlTextReaderPtr(n_reader, reader, 0);
32396         xmlResetLastError();
32397         if (mem_base != xmlMemBlocks()) {
32398             printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32399 	           xmlMemBlocks() - mem_base);
32400 	    test_ret++;
32401             printf(" %d", n_reader);
32402             printf("\n");
32403         }
32404     }
32405     function_tests++;
32406 #endif
32407 
32408     return(test_ret);
32409 }
32410 
32411 static int
test_xmlreader(void)32412 test_xmlreader(void) {
32413     int test_ret = 0;
32414 
32415     if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32416     test_ret += test_xmlNewTextReader();
32417     test_ret += test_xmlNewTextReaderFilename();
32418     test_ret += test_xmlReaderForDoc();
32419     test_ret += test_xmlReaderForFile();
32420     test_ret += test_xmlReaderForMemory();
32421     test_ret += test_xmlReaderNewDoc();
32422     test_ret += test_xmlReaderNewFile();
32423     test_ret += test_xmlReaderNewMemory();
32424     test_ret += test_xmlReaderNewWalker();
32425     test_ret += test_xmlReaderWalker();
32426     test_ret += test_xmlTextReaderAttributeCount();
32427     test_ret += test_xmlTextReaderBaseUri();
32428     test_ret += test_xmlTextReaderByteConsumed();
32429     test_ret += test_xmlTextReaderClose();
32430     test_ret += test_xmlTextReaderConstBaseUri();
32431     test_ret += test_xmlTextReaderConstEncoding();
32432     test_ret += test_xmlTextReaderConstLocalName();
32433     test_ret += test_xmlTextReaderConstName();
32434     test_ret += test_xmlTextReaderConstNamespaceUri();
32435     test_ret += test_xmlTextReaderConstPrefix();
32436     test_ret += test_xmlTextReaderConstString();
32437     test_ret += test_xmlTextReaderConstValue();
32438     test_ret += test_xmlTextReaderConstXmlLang();
32439     test_ret += test_xmlTextReaderConstXmlVersion();
32440     test_ret += test_xmlTextReaderCurrentDoc();
32441     test_ret += test_xmlTextReaderCurrentNode();
32442     test_ret += test_xmlTextReaderDepth();
32443     test_ret += test_xmlTextReaderExpand();
32444     test_ret += test_xmlTextReaderGetAttribute();
32445     test_ret += test_xmlTextReaderGetAttributeNo();
32446     test_ret += test_xmlTextReaderGetAttributeNs();
32447     test_ret += test_xmlTextReaderGetErrorHandler();
32448     test_ret += test_xmlTextReaderGetParserColumnNumber();
32449     test_ret += test_xmlTextReaderGetParserLineNumber();
32450     test_ret += test_xmlTextReaderGetParserProp();
32451     test_ret += test_xmlTextReaderGetRemainder();
32452     test_ret += test_xmlTextReaderHasAttributes();
32453     test_ret += test_xmlTextReaderHasValue();
32454     test_ret += test_xmlTextReaderIsDefault();
32455     test_ret += test_xmlTextReaderIsEmptyElement();
32456     test_ret += test_xmlTextReaderIsNamespaceDecl();
32457     test_ret += test_xmlTextReaderIsValid();
32458     test_ret += test_xmlTextReaderLocalName();
32459     test_ret += test_xmlTextReaderLocatorBaseURI();
32460     test_ret += test_xmlTextReaderLocatorLineNumber();
32461     test_ret += test_xmlTextReaderLookupNamespace();
32462     test_ret += test_xmlTextReaderMoveToAttribute();
32463     test_ret += test_xmlTextReaderMoveToAttributeNo();
32464     test_ret += test_xmlTextReaderMoveToAttributeNs();
32465     test_ret += test_xmlTextReaderMoveToElement();
32466     test_ret += test_xmlTextReaderMoveToFirstAttribute();
32467     test_ret += test_xmlTextReaderMoveToNextAttribute();
32468     test_ret += test_xmlTextReaderName();
32469     test_ret += test_xmlTextReaderNamespaceUri();
32470     test_ret += test_xmlTextReaderNext();
32471     test_ret += test_xmlTextReaderNextSibling();
32472     test_ret += test_xmlTextReaderNodeType();
32473     test_ret += test_xmlTextReaderNormalization();
32474     test_ret += test_xmlTextReaderPrefix();
32475     test_ret += test_xmlTextReaderPreserve();
32476     test_ret += test_xmlTextReaderPreservePattern();
32477     test_ret += test_xmlTextReaderQuoteChar();
32478     test_ret += test_xmlTextReaderRead();
32479     test_ret += test_xmlTextReaderReadAttributeValue();
32480     test_ret += test_xmlTextReaderReadState();
32481     test_ret += test_xmlTextReaderRelaxNGSetSchema();
32482     test_ret += test_xmlTextReaderRelaxNGValidate();
32483     test_ret += test_xmlTextReaderSchemaValidate();
32484     test_ret += test_xmlTextReaderSchemaValidateCtxt();
32485     test_ret += test_xmlTextReaderSetErrorHandler();
32486     test_ret += test_xmlTextReaderSetParserProp();
32487     test_ret += test_xmlTextReaderSetSchema();
32488     test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32489     test_ret += test_xmlTextReaderSetup();
32490     test_ret += test_xmlTextReaderStandalone();
32491     test_ret += test_xmlTextReaderValue();
32492     test_ret += test_xmlTextReaderXmlLang();
32493 
32494     if (test_ret != 0)
32495 	printf("Module xmlreader: %d errors\n", test_ret);
32496     return(test_ret);
32497 }
32498 
32499 static int
test_xmlExpCtxtNbCons(void)32500 test_xmlExpCtxtNbCons(void) {
32501     int test_ret = 0;
32502 
32503 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32504     int mem_base;
32505     int ret_val;
32506     xmlExpCtxtPtr ctxt; /* an expression context */
32507     int n_ctxt;
32508 
32509     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32510         mem_base = xmlMemBlocks();
32511         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32512 
32513         ret_val = xmlExpCtxtNbCons(ctxt);
32514         desret_int(ret_val);
32515         call_tests++;
32516         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32517         xmlResetLastError();
32518         if (mem_base != xmlMemBlocks()) {
32519             printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32520 	           xmlMemBlocks() - mem_base);
32521 	    test_ret++;
32522             printf(" %d", n_ctxt);
32523             printf("\n");
32524         }
32525     }
32526     function_tests++;
32527 #endif
32528 
32529     return(test_ret);
32530 }
32531 
32532 
32533 static int
test_xmlExpCtxtNbNodes(void)32534 test_xmlExpCtxtNbNodes(void) {
32535     int test_ret = 0;
32536 
32537 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32538     int mem_base;
32539     int ret_val;
32540     xmlExpCtxtPtr ctxt; /* an expression context */
32541     int n_ctxt;
32542 
32543     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32544         mem_base = xmlMemBlocks();
32545         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32546 
32547         ret_val = xmlExpCtxtNbNodes(ctxt);
32548         desret_int(ret_val);
32549         call_tests++;
32550         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32551         xmlResetLastError();
32552         if (mem_base != xmlMemBlocks()) {
32553             printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32554 	           xmlMemBlocks() - mem_base);
32555 	    test_ret++;
32556             printf(" %d", n_ctxt);
32557             printf("\n");
32558         }
32559     }
32560     function_tests++;
32561 #endif
32562 
32563     return(test_ret);
32564 }
32565 
32566 
32567 static int
test_xmlExpDump(void)32568 test_xmlExpDump(void) {
32569     int test_ret = 0;
32570 
32571 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32572     int mem_base;
32573     xmlBufferPtr buf; /* a buffer to receive the output */
32574     int n_buf;
32575     xmlExpNodePtr expr; /* the compiled expression */
32576     int n_expr;
32577 
32578     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32579     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32580         mem_base = xmlMemBlocks();
32581         buf = gen_xmlBufferPtr(n_buf, 0);
32582         expr = gen_xmlExpNodePtr(n_expr, 1);
32583 
32584         xmlExpDump(buf, expr);
32585         call_tests++;
32586         des_xmlBufferPtr(n_buf, buf, 0);
32587         des_xmlExpNodePtr(n_expr, expr, 1);
32588         xmlResetLastError();
32589         if (mem_base != xmlMemBlocks()) {
32590             printf("Leak of %d blocks found in xmlExpDump",
32591 	           xmlMemBlocks() - mem_base);
32592 	    test_ret++;
32593             printf(" %d", n_buf);
32594             printf(" %d", n_expr);
32595             printf("\n");
32596         }
32597     }
32598     }
32599     function_tests++;
32600 #endif
32601 
32602     return(test_ret);
32603 }
32604 
32605 
32606 static int
test_xmlExpExpDerive(void)32607 test_xmlExpExpDerive(void) {
32608     int test_ret = 0;
32609 
32610 
32611     /* missing type support */
32612     return(test_ret);
32613 }
32614 
32615 
32616 static int
test_xmlExpGetLanguage(void)32617 test_xmlExpGetLanguage(void) {
32618     int test_ret = 0;
32619 
32620 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32621     int mem_base;
32622     int ret_val;
32623     xmlExpCtxtPtr ctxt; /* the expression context */
32624     int n_ctxt;
32625     xmlExpNodePtr exp; /* the expression */
32626     int n_exp;
32627     xmlChar ** langList; /* where to store the tokens */
32628     int n_langList;
32629     int len; /* the allocated lenght of @list */
32630     int n_len;
32631 
32632     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32633     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32634     for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32635     for (n_len = 0;n_len < gen_nb_int;n_len++) {
32636         mem_base = xmlMemBlocks();
32637         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32638         exp = gen_xmlExpNodePtr(n_exp, 1);
32639         langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32640         len = gen_int(n_len, 3);
32641 
32642         ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32643         desret_int(ret_val);
32644         call_tests++;
32645         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32646         des_xmlExpNodePtr(n_exp, exp, 1);
32647         des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32648         des_int(n_len, len, 3);
32649         xmlResetLastError();
32650         if (mem_base != xmlMemBlocks()) {
32651             printf("Leak of %d blocks found in xmlExpGetLanguage",
32652 	           xmlMemBlocks() - mem_base);
32653 	    test_ret++;
32654             printf(" %d", n_ctxt);
32655             printf(" %d", n_exp);
32656             printf(" %d", n_langList);
32657             printf(" %d", n_len);
32658             printf("\n");
32659         }
32660     }
32661     }
32662     }
32663     }
32664     function_tests++;
32665 #endif
32666 
32667     return(test_ret);
32668 }
32669 
32670 
32671 static int
test_xmlExpGetStart(void)32672 test_xmlExpGetStart(void) {
32673     int test_ret = 0;
32674 
32675 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32676     int mem_base;
32677     int ret_val;
32678     xmlExpCtxtPtr ctxt; /* the expression context */
32679     int n_ctxt;
32680     xmlExpNodePtr exp; /* the expression */
32681     int n_exp;
32682     xmlChar ** tokList; /* where to store the tokens */
32683     int n_tokList;
32684     int len; /* the allocated lenght of @list */
32685     int n_len;
32686 
32687     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32688     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32689     for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32690     for (n_len = 0;n_len < gen_nb_int;n_len++) {
32691         mem_base = xmlMemBlocks();
32692         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32693         exp = gen_xmlExpNodePtr(n_exp, 1);
32694         tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32695         len = gen_int(n_len, 3);
32696 
32697         ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32698         desret_int(ret_val);
32699         call_tests++;
32700         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32701         des_xmlExpNodePtr(n_exp, exp, 1);
32702         des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32703         des_int(n_len, len, 3);
32704         xmlResetLastError();
32705         if (mem_base != xmlMemBlocks()) {
32706             printf("Leak of %d blocks found in xmlExpGetStart",
32707 	           xmlMemBlocks() - mem_base);
32708 	    test_ret++;
32709             printf(" %d", n_ctxt);
32710             printf(" %d", n_exp);
32711             printf(" %d", n_tokList);
32712             printf(" %d", n_len);
32713             printf("\n");
32714         }
32715     }
32716     }
32717     }
32718     }
32719     function_tests++;
32720 #endif
32721 
32722     return(test_ret);
32723 }
32724 
32725 
32726 static int
test_xmlExpIsNillable(void)32727 test_xmlExpIsNillable(void) {
32728     int test_ret = 0;
32729 
32730 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32731     int mem_base;
32732     int ret_val;
32733     xmlExpNodePtr exp; /* the expression */
32734     int n_exp;
32735 
32736     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32737         mem_base = xmlMemBlocks();
32738         exp = gen_xmlExpNodePtr(n_exp, 0);
32739 
32740         ret_val = xmlExpIsNillable(exp);
32741         desret_int(ret_val);
32742         call_tests++;
32743         des_xmlExpNodePtr(n_exp, exp, 0);
32744         xmlResetLastError();
32745         if (mem_base != xmlMemBlocks()) {
32746             printf("Leak of %d blocks found in xmlExpIsNillable",
32747 	           xmlMemBlocks() - mem_base);
32748 	    test_ret++;
32749             printf(" %d", n_exp);
32750             printf("\n");
32751         }
32752     }
32753     function_tests++;
32754 #endif
32755 
32756     return(test_ret);
32757 }
32758 
32759 
32760 static int
test_xmlExpMaxToken(void)32761 test_xmlExpMaxToken(void) {
32762     int test_ret = 0;
32763 
32764 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32765     int mem_base;
32766     int ret_val;
32767     xmlExpNodePtr expr; /* a compiled expression */
32768     int n_expr;
32769 
32770     for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32771         mem_base = xmlMemBlocks();
32772         expr = gen_xmlExpNodePtr(n_expr, 0);
32773 
32774         ret_val = xmlExpMaxToken(expr);
32775         desret_int(ret_val);
32776         call_tests++;
32777         des_xmlExpNodePtr(n_expr, expr, 0);
32778         xmlResetLastError();
32779         if (mem_base != xmlMemBlocks()) {
32780             printf("Leak of %d blocks found in xmlExpMaxToken",
32781 	           xmlMemBlocks() - mem_base);
32782 	    test_ret++;
32783             printf(" %d", n_expr);
32784             printf("\n");
32785         }
32786     }
32787     function_tests++;
32788 #endif
32789 
32790     return(test_ret);
32791 }
32792 
32793 
32794 static int
test_xmlExpNewAtom(void)32795 test_xmlExpNewAtom(void) {
32796     int test_ret = 0;
32797 
32798 
32799     /* missing type support */
32800     return(test_ret);
32801 }
32802 
32803 
32804 static int
test_xmlExpNewCtxt(void)32805 test_xmlExpNewCtxt(void) {
32806     int test_ret = 0;
32807 
32808 
32809     /* missing type support */
32810     return(test_ret);
32811 }
32812 
32813 
32814 static int
test_xmlExpNewOr(void)32815 test_xmlExpNewOr(void) {
32816     int test_ret = 0;
32817 
32818 
32819     /* missing type support */
32820     return(test_ret);
32821 }
32822 
32823 
32824 static int
test_xmlExpNewRange(void)32825 test_xmlExpNewRange(void) {
32826     int test_ret = 0;
32827 
32828 
32829     /* missing type support */
32830     return(test_ret);
32831 }
32832 
32833 
32834 static int
test_xmlExpNewSeq(void)32835 test_xmlExpNewSeq(void) {
32836     int test_ret = 0;
32837 
32838 
32839     /* missing type support */
32840     return(test_ret);
32841 }
32842 
32843 
32844 static int
test_xmlExpParse(void)32845 test_xmlExpParse(void) {
32846     int test_ret = 0;
32847 
32848 
32849     /* missing type support */
32850     return(test_ret);
32851 }
32852 
32853 
32854 static int
test_xmlExpRef(void)32855 test_xmlExpRef(void) {
32856     int test_ret = 0;
32857 
32858 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32859     int mem_base;
32860     xmlExpNodePtr exp; /* the expression */
32861     int n_exp;
32862 
32863     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32864         mem_base = xmlMemBlocks();
32865         exp = gen_xmlExpNodePtr(n_exp, 0);
32866 
32867         xmlExpRef(exp);
32868         call_tests++;
32869         des_xmlExpNodePtr(n_exp, exp, 0);
32870         xmlResetLastError();
32871         if (mem_base != xmlMemBlocks()) {
32872             printf("Leak of %d blocks found in xmlExpRef",
32873 	           xmlMemBlocks() - mem_base);
32874 	    test_ret++;
32875             printf(" %d", n_exp);
32876             printf("\n");
32877         }
32878     }
32879     function_tests++;
32880 #endif
32881 
32882     return(test_ret);
32883 }
32884 
32885 
32886 static int
test_xmlExpStringDerive(void)32887 test_xmlExpStringDerive(void) {
32888     int test_ret = 0;
32889 
32890 
32891     /* missing type support */
32892     return(test_ret);
32893 }
32894 
32895 
32896 static int
test_xmlExpSubsume(void)32897 test_xmlExpSubsume(void) {
32898     int test_ret = 0;
32899 
32900 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32901     int mem_base;
32902     int ret_val;
32903     xmlExpCtxtPtr ctxt; /* the expressions context */
32904     int n_ctxt;
32905     xmlExpNodePtr exp; /* the englobing expression */
32906     int n_exp;
32907     xmlExpNodePtr sub; /* the subexpression */
32908     int n_sub;
32909 
32910     for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32911     for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32912     for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32913         mem_base = xmlMemBlocks();
32914         ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32915         exp = gen_xmlExpNodePtr(n_exp, 1);
32916         sub = gen_xmlExpNodePtr(n_sub, 2);
32917 
32918         ret_val = xmlExpSubsume(ctxt, exp, sub);
32919         desret_int(ret_val);
32920         call_tests++;
32921         des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32922         des_xmlExpNodePtr(n_exp, exp, 1);
32923         des_xmlExpNodePtr(n_sub, sub, 2);
32924         xmlResetLastError();
32925         if (mem_base != xmlMemBlocks()) {
32926             printf("Leak of %d blocks found in xmlExpSubsume",
32927 	           xmlMemBlocks() - mem_base);
32928 	    test_ret++;
32929             printf(" %d", n_ctxt);
32930             printf(" %d", n_exp);
32931             printf(" %d", n_sub);
32932             printf("\n");
32933         }
32934     }
32935     }
32936     }
32937     function_tests++;
32938 #endif
32939 
32940     return(test_ret);
32941 }
32942 
32943 #ifdef LIBXML_REGEXP_ENABLED
32944 
32945 #define gen_nb_xmlRegExecCtxtPtr 1
gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)32946 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32947     return(NULL);
32948 }
des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED,xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)32949 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32950 }
32951 #endif
32952 
32953 
32954 static int
test_xmlRegExecErrInfo(void)32955 test_xmlRegExecErrInfo(void) {
32956     int test_ret = 0;
32957 
32958 #if defined(LIBXML_REGEXP_ENABLED)
32959     int mem_base;
32960     int ret_val;
32961     xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
32962     int n_exec;
32963     xmlChar ** string; /* return value for the error string */
32964     int n_string;
32965     int * nbval; /* pointer to the number of accepted values IN/OUT */
32966     int n_nbval;
32967     int * nbneg; /* return number of negative transitions */
32968     int n_nbneg;
32969     xmlChar ** values; /* pointer to the array of acceptable values */
32970     int n_values;
32971     int * terminal; /* return value if this was a terminal state */
32972     int n_terminal;
32973 
32974     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
32975     for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
32976     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
32977     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
32978     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
32979     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
32980         mem_base = xmlMemBlocks();
32981         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
32982         string = gen_const_xmlChar_ptr_ptr(n_string, 1);
32983         nbval = gen_int_ptr(n_nbval, 2);
32984         nbneg = gen_int_ptr(n_nbneg, 3);
32985         values = gen_xmlChar_ptr_ptr(n_values, 4);
32986         terminal = gen_int_ptr(n_terminal, 5);
32987 
32988         ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
32989         desret_int(ret_val);
32990         call_tests++;
32991         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
32992         des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
32993         des_int_ptr(n_nbval, nbval, 2);
32994         des_int_ptr(n_nbneg, nbneg, 3);
32995         des_xmlChar_ptr_ptr(n_values, values, 4);
32996         des_int_ptr(n_terminal, terminal, 5);
32997         xmlResetLastError();
32998         if (mem_base != xmlMemBlocks()) {
32999             printf("Leak of %d blocks found in xmlRegExecErrInfo",
33000 	           xmlMemBlocks() - mem_base);
33001 	    test_ret++;
33002             printf(" %d", n_exec);
33003             printf(" %d", n_string);
33004             printf(" %d", n_nbval);
33005             printf(" %d", n_nbneg);
33006             printf(" %d", n_values);
33007             printf(" %d", n_terminal);
33008             printf("\n");
33009         }
33010     }
33011     }
33012     }
33013     }
33014     }
33015     }
33016     function_tests++;
33017 #endif
33018 
33019     return(test_ret);
33020 }
33021 
33022 
33023 static int
test_xmlRegExecNextValues(void)33024 test_xmlRegExecNextValues(void) {
33025     int test_ret = 0;
33026 
33027 #if defined(LIBXML_REGEXP_ENABLED)
33028     int mem_base;
33029     int ret_val;
33030     xmlRegExecCtxtPtr exec; /* a regexp execution context */
33031     int n_exec;
33032     int * nbval; /* pointer to the number of accepted values IN/OUT */
33033     int n_nbval;
33034     int * nbneg; /* return number of negative transitions */
33035     int n_nbneg;
33036     xmlChar ** values; /* pointer to the array of acceptable values */
33037     int n_values;
33038     int * terminal; /* return value if this was a terminal state */
33039     int n_terminal;
33040 
33041     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33042     for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33043     for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33044     for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33045     for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33046         mem_base = xmlMemBlocks();
33047         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33048         nbval = gen_int_ptr(n_nbval, 1);
33049         nbneg = gen_int_ptr(n_nbneg, 2);
33050         values = gen_xmlChar_ptr_ptr(n_values, 3);
33051         terminal = gen_int_ptr(n_terminal, 4);
33052 
33053         ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33054         desret_int(ret_val);
33055         call_tests++;
33056         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33057         des_int_ptr(n_nbval, nbval, 1);
33058         des_int_ptr(n_nbneg, nbneg, 2);
33059         des_xmlChar_ptr_ptr(n_values, values, 3);
33060         des_int_ptr(n_terminal, terminal, 4);
33061         xmlResetLastError();
33062         if (mem_base != xmlMemBlocks()) {
33063             printf("Leak of %d blocks found in xmlRegExecNextValues",
33064 	           xmlMemBlocks() - mem_base);
33065 	    test_ret++;
33066             printf(" %d", n_exec);
33067             printf(" %d", n_nbval);
33068             printf(" %d", n_nbneg);
33069             printf(" %d", n_values);
33070             printf(" %d", n_terminal);
33071             printf("\n");
33072         }
33073     }
33074     }
33075     }
33076     }
33077     }
33078     function_tests++;
33079 #endif
33080 
33081     return(test_ret);
33082 }
33083 
33084 
33085 static int
test_xmlRegExecPushString(void)33086 test_xmlRegExecPushString(void) {
33087     int test_ret = 0;
33088 
33089 #if defined(LIBXML_REGEXP_ENABLED)
33090     int mem_base;
33091     int ret_val;
33092     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33093     int n_exec;
33094     xmlChar * value; /* a string token input */
33095     int n_value;
33096     void * data; /* data associated to the token to reuse in callbacks */
33097     int n_data;
33098 
33099     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33100     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33101     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33102         mem_base = xmlMemBlocks();
33103         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33104         value = gen_const_xmlChar_ptr(n_value, 1);
33105         data = gen_userdata(n_data, 2);
33106 
33107         ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33108         desret_int(ret_val);
33109         call_tests++;
33110         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33111         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33112         des_userdata(n_data, data, 2);
33113         xmlResetLastError();
33114         if (mem_base != xmlMemBlocks()) {
33115             printf("Leak of %d blocks found in xmlRegExecPushString",
33116 	           xmlMemBlocks() - mem_base);
33117 	    test_ret++;
33118             printf(" %d", n_exec);
33119             printf(" %d", n_value);
33120             printf(" %d", n_data);
33121             printf("\n");
33122         }
33123     }
33124     }
33125     }
33126     function_tests++;
33127 #endif
33128 
33129     return(test_ret);
33130 }
33131 
33132 
33133 static int
test_xmlRegExecPushString2(void)33134 test_xmlRegExecPushString2(void) {
33135     int test_ret = 0;
33136 
33137 #if defined(LIBXML_REGEXP_ENABLED)
33138     int mem_base;
33139     int ret_val;
33140     xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33141     int n_exec;
33142     xmlChar * value; /* the first string token input */
33143     int n_value;
33144     xmlChar * value2; /* the second string token input */
33145     int n_value2;
33146     void * data; /* data associated to the token to reuse in callbacks */
33147     int n_data;
33148 
33149     for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33150     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33151     for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33152     for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33153         mem_base = xmlMemBlocks();
33154         exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33155         value = gen_const_xmlChar_ptr(n_value, 1);
33156         value2 = gen_const_xmlChar_ptr(n_value2, 2);
33157         data = gen_userdata(n_data, 3);
33158 
33159         ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33160         desret_int(ret_val);
33161         call_tests++;
33162         des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33163         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33164         des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33165         des_userdata(n_data, data, 3);
33166         xmlResetLastError();
33167         if (mem_base != xmlMemBlocks()) {
33168             printf("Leak of %d blocks found in xmlRegExecPushString2",
33169 	           xmlMemBlocks() - mem_base);
33170 	    test_ret++;
33171             printf(" %d", n_exec);
33172             printf(" %d", n_value);
33173             printf(" %d", n_value2);
33174             printf(" %d", n_data);
33175             printf("\n");
33176         }
33177     }
33178     }
33179     }
33180     }
33181     function_tests++;
33182 #endif
33183 
33184     return(test_ret);
33185 }
33186 
33187 #ifdef LIBXML_REGEXP_ENABLED
33188 
33189 #define gen_nb_xmlRegexpPtr 1
gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33190 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33191     return(NULL);
33192 }
des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED,xmlRegexpPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33193 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33194 }
33195 #endif
33196 
33197 
33198 static int
test_xmlRegNewExecCtxt(void)33199 test_xmlRegNewExecCtxt(void) {
33200     int test_ret = 0;
33201 
33202 
33203     /* missing type support */
33204     return(test_ret);
33205 }
33206 
33207 
33208 static int
test_xmlRegexpCompile(void)33209 test_xmlRegexpCompile(void) {
33210     int test_ret = 0;
33211 
33212 
33213     /* missing type support */
33214     return(test_ret);
33215 }
33216 
33217 
33218 static int
test_xmlRegexpExec(void)33219 test_xmlRegexpExec(void) {
33220     int test_ret = 0;
33221 
33222 #if defined(LIBXML_REGEXP_ENABLED)
33223     int mem_base;
33224     int ret_val;
33225     xmlRegexpPtr comp; /* the compiled regular expression */
33226     int n_comp;
33227     xmlChar * content; /* the value to check against the regular expression */
33228     int n_content;
33229 
33230     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33231     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33232         mem_base = xmlMemBlocks();
33233         comp = gen_xmlRegexpPtr(n_comp, 0);
33234         content = gen_const_xmlChar_ptr(n_content, 1);
33235 
33236         ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33237         desret_int(ret_val);
33238         call_tests++;
33239         des_xmlRegexpPtr(n_comp, comp, 0);
33240         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33241         xmlResetLastError();
33242         if (mem_base != xmlMemBlocks()) {
33243             printf("Leak of %d blocks found in xmlRegexpExec",
33244 	           xmlMemBlocks() - mem_base);
33245 	    test_ret++;
33246             printf(" %d", n_comp);
33247             printf(" %d", n_content);
33248             printf("\n");
33249         }
33250     }
33251     }
33252     function_tests++;
33253 #endif
33254 
33255     return(test_ret);
33256 }
33257 
33258 
33259 static int
test_xmlRegexpIsDeterminist(void)33260 test_xmlRegexpIsDeterminist(void) {
33261     int test_ret = 0;
33262 
33263 #if defined(LIBXML_REGEXP_ENABLED)
33264     int mem_base;
33265     int ret_val;
33266     xmlRegexpPtr comp; /* the compiled regular expression */
33267     int n_comp;
33268 
33269     for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33270         mem_base = xmlMemBlocks();
33271         comp = gen_xmlRegexpPtr(n_comp, 0);
33272 
33273         ret_val = xmlRegexpIsDeterminist(comp);
33274         desret_int(ret_val);
33275         call_tests++;
33276         des_xmlRegexpPtr(n_comp, comp, 0);
33277         xmlResetLastError();
33278         if (mem_base != xmlMemBlocks()) {
33279             printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33280 	           xmlMemBlocks() - mem_base);
33281 	    test_ret++;
33282             printf(" %d", n_comp);
33283             printf("\n");
33284         }
33285     }
33286     function_tests++;
33287 #endif
33288 
33289     return(test_ret);
33290 }
33291 
33292 
33293 static int
test_xmlRegexpPrint(void)33294 test_xmlRegexpPrint(void) {
33295     int test_ret = 0;
33296 
33297 #if defined(LIBXML_REGEXP_ENABLED)
33298     int mem_base;
33299     FILE * output; /* the file for the output debug */
33300     int n_output;
33301     xmlRegexpPtr regexp; /* the compiled regexp */
33302     int n_regexp;
33303 
33304     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33305     for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33306         mem_base = xmlMemBlocks();
33307         output = gen_FILE_ptr(n_output, 0);
33308         regexp = gen_xmlRegexpPtr(n_regexp, 1);
33309 
33310         xmlRegexpPrint(output, regexp);
33311         call_tests++;
33312         des_FILE_ptr(n_output, output, 0);
33313         des_xmlRegexpPtr(n_regexp, regexp, 1);
33314         xmlResetLastError();
33315         if (mem_base != xmlMemBlocks()) {
33316             printf("Leak of %d blocks found in xmlRegexpPrint",
33317 	           xmlMemBlocks() - mem_base);
33318 	    test_ret++;
33319             printf(" %d", n_output);
33320             printf(" %d", n_regexp);
33321             printf("\n");
33322         }
33323     }
33324     }
33325     function_tests++;
33326 #endif
33327 
33328     return(test_ret);
33329 }
33330 
33331 static int
test_xmlregexp(void)33332 test_xmlregexp(void) {
33333     int test_ret = 0;
33334 
33335     if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33336     test_ret += test_xmlExpCtxtNbCons();
33337     test_ret += test_xmlExpCtxtNbNodes();
33338     test_ret += test_xmlExpDump();
33339     test_ret += test_xmlExpExpDerive();
33340     test_ret += test_xmlExpGetLanguage();
33341     test_ret += test_xmlExpGetStart();
33342     test_ret += test_xmlExpIsNillable();
33343     test_ret += test_xmlExpMaxToken();
33344     test_ret += test_xmlExpNewAtom();
33345     test_ret += test_xmlExpNewCtxt();
33346     test_ret += test_xmlExpNewOr();
33347     test_ret += test_xmlExpNewRange();
33348     test_ret += test_xmlExpNewSeq();
33349     test_ret += test_xmlExpParse();
33350     test_ret += test_xmlExpRef();
33351     test_ret += test_xmlExpStringDerive();
33352     test_ret += test_xmlExpSubsume();
33353     test_ret += test_xmlRegExecErrInfo();
33354     test_ret += test_xmlRegExecNextValues();
33355     test_ret += test_xmlRegExecPushString();
33356     test_ret += test_xmlRegExecPushString2();
33357     test_ret += test_xmlRegNewExecCtxt();
33358     test_ret += test_xmlRegexpCompile();
33359     test_ret += test_xmlRegexpExec();
33360     test_ret += test_xmlRegexpIsDeterminist();
33361     test_ret += test_xmlRegexpPrint();
33362 
33363     if (test_ret != 0)
33364 	printf("Module xmlregexp: %d errors\n", test_ret);
33365     return(test_ret);
33366 }
33367 #ifdef LIBXML_OUTPUT_ENABLED
33368 
33369 #define gen_nb_xmlSaveCtxtPtr 1
gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33370 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33371     return(NULL);
33372 }
des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSaveCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33373 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33374 }
33375 #endif
33376 
33377 
33378 static int
test_xmlSaveClose(void)33379 test_xmlSaveClose(void) {
33380     int test_ret = 0;
33381 
33382 #if defined(LIBXML_OUTPUT_ENABLED)
33383     int mem_base;
33384     int ret_val;
33385     xmlSaveCtxtPtr ctxt; /* a document saving context */
33386     int n_ctxt;
33387 
33388     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33389         mem_base = xmlMemBlocks();
33390         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33391 
33392         ret_val = xmlSaveClose(ctxt);
33393         desret_int(ret_val);
33394         call_tests++;
33395         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33396         xmlResetLastError();
33397         if (mem_base != xmlMemBlocks()) {
33398             printf("Leak of %d blocks found in xmlSaveClose",
33399 	           xmlMemBlocks() - mem_base);
33400 	    test_ret++;
33401             printf(" %d", n_ctxt);
33402             printf("\n");
33403         }
33404     }
33405     function_tests++;
33406 #endif
33407 
33408     return(test_ret);
33409 }
33410 
33411 
33412 static int
test_xmlSaveDoc(void)33413 test_xmlSaveDoc(void) {
33414     int test_ret = 0;
33415 
33416 #if defined(LIBXML_OUTPUT_ENABLED)
33417     int mem_base;
33418     long ret_val;
33419     xmlSaveCtxtPtr ctxt; /* a document saving context */
33420     int n_ctxt;
33421     xmlDocPtr doc; /* a document */
33422     int n_doc;
33423 
33424     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33425     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33426         mem_base = xmlMemBlocks();
33427         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33428         doc = gen_xmlDocPtr(n_doc, 1);
33429 
33430         ret_val = xmlSaveDoc(ctxt, doc);
33431         desret_long(ret_val);
33432         call_tests++;
33433         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33434         des_xmlDocPtr(n_doc, doc, 1);
33435         xmlResetLastError();
33436         if (mem_base != xmlMemBlocks()) {
33437             printf("Leak of %d blocks found in xmlSaveDoc",
33438 	           xmlMemBlocks() - mem_base);
33439 	    test_ret++;
33440             printf(" %d", n_ctxt);
33441             printf(" %d", n_doc);
33442             printf("\n");
33443         }
33444     }
33445     }
33446     function_tests++;
33447 #endif
33448 
33449     return(test_ret);
33450 }
33451 
33452 
33453 static int
test_xmlSaveFlush(void)33454 test_xmlSaveFlush(void) {
33455     int test_ret = 0;
33456 
33457 #if defined(LIBXML_OUTPUT_ENABLED)
33458     int mem_base;
33459     int ret_val;
33460     xmlSaveCtxtPtr ctxt; /* a document saving context */
33461     int n_ctxt;
33462 
33463     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33464         mem_base = xmlMemBlocks();
33465         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33466 
33467         ret_val = xmlSaveFlush(ctxt);
33468         desret_int(ret_val);
33469         call_tests++;
33470         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33471         xmlResetLastError();
33472         if (mem_base != xmlMemBlocks()) {
33473             printf("Leak of %d blocks found in xmlSaveFlush",
33474 	           xmlMemBlocks() - mem_base);
33475 	    test_ret++;
33476             printf(" %d", n_ctxt);
33477             printf("\n");
33478         }
33479     }
33480     function_tests++;
33481 #endif
33482 
33483     return(test_ret);
33484 }
33485 
33486 
33487 static int
test_xmlSaveSetAttrEscape(void)33488 test_xmlSaveSetAttrEscape(void) {
33489     int test_ret = 0;
33490 
33491 
33492     /* missing type support */
33493     return(test_ret);
33494 }
33495 
33496 
33497 static int
test_xmlSaveSetEscape(void)33498 test_xmlSaveSetEscape(void) {
33499     int test_ret = 0;
33500 
33501 
33502     /* missing type support */
33503     return(test_ret);
33504 }
33505 
33506 
33507 static int
test_xmlSaveToBuffer(void)33508 test_xmlSaveToBuffer(void) {
33509     int test_ret = 0;
33510 
33511 
33512     /* missing type support */
33513     return(test_ret);
33514 }
33515 
33516 
33517 static int
test_xmlSaveToFd(void)33518 test_xmlSaveToFd(void) {
33519     int test_ret = 0;
33520 
33521 
33522     /* missing type support */
33523     return(test_ret);
33524 }
33525 
33526 
33527 static int
test_xmlSaveToFilename(void)33528 test_xmlSaveToFilename(void) {
33529     int test_ret = 0;
33530 
33531 
33532     /* missing type support */
33533     return(test_ret);
33534 }
33535 
33536 
33537 static int
test_xmlSaveTree(void)33538 test_xmlSaveTree(void) {
33539     int test_ret = 0;
33540 
33541 #if defined(LIBXML_OUTPUT_ENABLED)
33542     int mem_base;
33543     long ret_val;
33544     xmlSaveCtxtPtr ctxt; /* a document saving context */
33545     int n_ctxt;
33546     xmlNodePtr node; /* the top node of the subtree to save */
33547     int n_node;
33548 
33549     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33550     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33551         mem_base = xmlMemBlocks();
33552         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33553         node = gen_xmlNodePtr(n_node, 1);
33554 
33555         ret_val = xmlSaveTree(ctxt, node);
33556         desret_long(ret_val);
33557         call_tests++;
33558         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33559         des_xmlNodePtr(n_node, node, 1);
33560         xmlResetLastError();
33561         if (mem_base != xmlMemBlocks()) {
33562             printf("Leak of %d blocks found in xmlSaveTree",
33563 	           xmlMemBlocks() - mem_base);
33564 	    test_ret++;
33565             printf(" %d", n_ctxt);
33566             printf(" %d", n_node);
33567             printf("\n");
33568         }
33569     }
33570     }
33571     function_tests++;
33572 #endif
33573 
33574     return(test_ret);
33575 }
33576 
33577 static int
test_xmlsave(void)33578 test_xmlsave(void) {
33579     int test_ret = 0;
33580 
33581     if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33582     test_ret += test_xmlSaveClose();
33583     test_ret += test_xmlSaveDoc();
33584     test_ret += test_xmlSaveFlush();
33585     test_ret += test_xmlSaveSetAttrEscape();
33586     test_ret += test_xmlSaveSetEscape();
33587     test_ret += test_xmlSaveToBuffer();
33588     test_ret += test_xmlSaveToFd();
33589     test_ret += test_xmlSaveToFilename();
33590     test_ret += test_xmlSaveTree();
33591 
33592     if (test_ret != 0)
33593 	printf("Module xmlsave: %d errors\n", test_ret);
33594     return(test_ret);
33595 }
33596 
33597 static int
test_xmlSchemaDump(void)33598 test_xmlSchemaDump(void) {
33599     int test_ret = 0;
33600 
33601 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33602     int mem_base;
33603     FILE * output; /* the file output */
33604     int n_output;
33605     xmlSchemaPtr schema; /* a schema structure */
33606     int n_schema;
33607 
33608     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33609     for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33610         mem_base = xmlMemBlocks();
33611         output = gen_FILE_ptr(n_output, 0);
33612         schema = gen_xmlSchemaPtr(n_schema, 1);
33613 
33614         xmlSchemaDump(output, schema);
33615         call_tests++;
33616         des_FILE_ptr(n_output, output, 0);
33617         des_xmlSchemaPtr(n_schema, schema, 1);
33618         xmlResetLastError();
33619         if (mem_base != xmlMemBlocks()) {
33620             printf("Leak of %d blocks found in xmlSchemaDump",
33621 	           xmlMemBlocks() - mem_base);
33622 	    test_ret++;
33623             printf(" %d", n_output);
33624             printf(" %d", n_schema);
33625             printf("\n");
33626         }
33627     }
33628     }
33629     function_tests++;
33630 #endif
33631 
33632     return(test_ret);
33633 }
33634 
33635 #ifdef LIBXML_SCHEMAS_ENABLED
33636 
33637 #define gen_nb_xmlSchemaParserCtxtPtr 1
gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33638 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33639     return(NULL);
33640 }
des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED,xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33641 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33642 }
33643 #endif
33644 
33645 #ifdef LIBXML_SCHEMAS_ENABLED
33646 
33647 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33648 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33649     return(NULL);
33650 }
des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33651 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33652 }
33653 #endif
33654 
33655 #ifdef LIBXML_SCHEMAS_ENABLED
33656 
33657 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33658 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33659     return(NULL);
33660 }
des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33661 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33662 }
33663 #endif
33664 
33665 
33666 static int
test_xmlSchemaGetParserErrors(void)33667 test_xmlSchemaGetParserErrors(void) {
33668     int test_ret = 0;
33669 
33670 #if defined(LIBXML_SCHEMAS_ENABLED)
33671     int mem_base;
33672     int ret_val;
33673     xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33674     int n_ctxt;
33675     xmlSchemaValidityErrorFunc * err; /* the error callback result */
33676     int n_err;
33677     xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33678     int n_warn;
33679     void ** ctx; /* contextual data for the callbacks result */
33680     int n_ctx;
33681 
33682     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33683     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33684     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33685     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33686         mem_base = xmlMemBlocks();
33687         ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33688         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33689         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33690         ctx = gen_void_ptr_ptr(n_ctx, 3);
33691 
33692         ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33693         desret_int(ret_val);
33694         call_tests++;
33695         des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33696         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33697         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33698         des_void_ptr_ptr(n_ctx, ctx, 3);
33699         xmlResetLastError();
33700         if (mem_base != xmlMemBlocks()) {
33701             printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33702 	           xmlMemBlocks() - mem_base);
33703 	    test_ret++;
33704             printf(" %d", n_ctxt);
33705             printf(" %d", n_err);
33706             printf(" %d", n_warn);
33707             printf(" %d", n_ctx);
33708             printf("\n");
33709         }
33710     }
33711     }
33712     }
33713     }
33714     function_tests++;
33715 #endif
33716 
33717     return(test_ret);
33718 }
33719 
33720 
33721 static int
test_xmlSchemaGetValidErrors(void)33722 test_xmlSchemaGetValidErrors(void) {
33723     int test_ret = 0;
33724 
33725 #if defined(LIBXML_SCHEMAS_ENABLED)
33726     int mem_base;
33727     int ret_val;
33728     xmlSchemaValidCtxtPtr ctxt; /*  */
33729     int n_ctxt;
33730     xmlSchemaValidityErrorFunc * err; /*  */
33731     int n_err;
33732     xmlSchemaValidityWarningFunc * warn; /*  */
33733     int n_warn;
33734     void ** ctx; /*  */
33735     int n_ctx;
33736 
33737     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33738     for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33739     for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33740     for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33741         mem_base = xmlMemBlocks();
33742         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33743         err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33744         warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33745         ctx = gen_void_ptr_ptr(n_ctx, 3);
33746 
33747         ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33748         desret_int(ret_val);
33749         call_tests++;
33750         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33751         des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33752         des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33753         des_void_ptr_ptr(n_ctx, ctx, 3);
33754         xmlResetLastError();
33755         if (mem_base != xmlMemBlocks()) {
33756             printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33757 	           xmlMemBlocks() - mem_base);
33758 	    test_ret++;
33759             printf(" %d", n_ctxt);
33760             printf(" %d", n_err);
33761             printf(" %d", n_warn);
33762             printf(" %d", n_ctx);
33763             printf("\n");
33764         }
33765     }
33766     }
33767     }
33768     }
33769     function_tests++;
33770 #endif
33771 
33772     return(test_ret);
33773 }
33774 
33775 
33776 static int
test_xmlSchemaIsValid(void)33777 test_xmlSchemaIsValid(void) {
33778     int test_ret = 0;
33779 
33780 #if defined(LIBXML_SCHEMAS_ENABLED)
33781     int mem_base;
33782     int ret_val;
33783     xmlSchemaValidCtxtPtr ctxt; /*  */
33784     int n_ctxt;
33785 
33786     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33787         mem_base = xmlMemBlocks();
33788         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33789 
33790         ret_val = xmlSchemaIsValid(ctxt);
33791         desret_int(ret_val);
33792         call_tests++;
33793         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33794         xmlResetLastError();
33795         if (mem_base != xmlMemBlocks()) {
33796             printf("Leak of %d blocks found in xmlSchemaIsValid",
33797 	           xmlMemBlocks() - mem_base);
33798 	    test_ret++;
33799             printf(" %d", n_ctxt);
33800             printf("\n");
33801         }
33802     }
33803     function_tests++;
33804 #endif
33805 
33806     return(test_ret);
33807 }
33808 
33809 
33810 static int
test_xmlSchemaNewDocParserCtxt(void)33811 test_xmlSchemaNewDocParserCtxt(void) {
33812     int test_ret = 0;
33813 
33814 #if defined(LIBXML_SCHEMAS_ENABLED)
33815     int mem_base;
33816     xmlSchemaParserCtxtPtr ret_val;
33817     xmlDocPtr doc; /* a preparsed document tree */
33818     int n_doc;
33819 
33820     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33821         mem_base = xmlMemBlocks();
33822         doc = gen_xmlDocPtr(n_doc, 0);
33823 
33824         ret_val = xmlSchemaNewDocParserCtxt(doc);
33825         desret_xmlSchemaParserCtxtPtr(ret_val);
33826         call_tests++;
33827         des_xmlDocPtr(n_doc, doc, 0);
33828         xmlResetLastError();
33829         if (mem_base != xmlMemBlocks()) {
33830             printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33831 	           xmlMemBlocks() - mem_base);
33832 	    test_ret++;
33833             printf(" %d", n_doc);
33834             printf("\n");
33835         }
33836     }
33837     function_tests++;
33838 #endif
33839 
33840     return(test_ret);
33841 }
33842 
33843 
33844 static int
test_xmlSchemaNewMemParserCtxt(void)33845 test_xmlSchemaNewMemParserCtxt(void) {
33846     int test_ret = 0;
33847 
33848 #if defined(LIBXML_SCHEMAS_ENABLED)
33849     int mem_base;
33850     xmlSchemaParserCtxtPtr ret_val;
33851     char * buffer; /* a pointer to a char array containing the schemas */
33852     int n_buffer;
33853     int size; /* the size of the array */
33854     int n_size;
33855 
33856     for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33857     for (n_size = 0;n_size < gen_nb_int;n_size++) {
33858         mem_base = xmlMemBlocks();
33859         buffer = gen_const_char_ptr(n_buffer, 0);
33860         size = gen_int(n_size, 1);
33861 
33862         ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33863         desret_xmlSchemaParserCtxtPtr(ret_val);
33864         call_tests++;
33865         des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33866         des_int(n_size, size, 1);
33867         xmlResetLastError();
33868         if (mem_base != xmlMemBlocks()) {
33869             printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33870 	           xmlMemBlocks() - mem_base);
33871 	    test_ret++;
33872             printf(" %d", n_buffer);
33873             printf(" %d", n_size);
33874             printf("\n");
33875         }
33876     }
33877     }
33878     function_tests++;
33879 #endif
33880 
33881     return(test_ret);
33882 }
33883 
33884 
33885 static int
test_xmlSchemaNewParserCtxt(void)33886 test_xmlSchemaNewParserCtxt(void) {
33887     int test_ret = 0;
33888 
33889 #if defined(LIBXML_SCHEMAS_ENABLED)
33890     int mem_base;
33891     xmlSchemaParserCtxtPtr ret_val;
33892     char * URL; /* the location of the schema */
33893     int n_URL;
33894 
33895     for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33896         mem_base = xmlMemBlocks();
33897         URL = gen_const_char_ptr(n_URL, 0);
33898 
33899         ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33900         desret_xmlSchemaParserCtxtPtr(ret_val);
33901         call_tests++;
33902         des_const_char_ptr(n_URL, (const char *)URL, 0);
33903         xmlResetLastError();
33904         if (mem_base != xmlMemBlocks()) {
33905             printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33906 	           xmlMemBlocks() - mem_base);
33907 	    test_ret++;
33908             printf(" %d", n_URL);
33909             printf("\n");
33910         }
33911     }
33912     function_tests++;
33913 #endif
33914 
33915     return(test_ret);
33916 }
33917 
33918 
33919 static int
test_xmlSchemaNewValidCtxt(void)33920 test_xmlSchemaNewValidCtxt(void) {
33921     int test_ret = 0;
33922 
33923 
33924     /* missing type support */
33925     return(test_ret);
33926 }
33927 
33928 
33929 static int
test_xmlSchemaParse(void)33930 test_xmlSchemaParse(void) {
33931     int test_ret = 0;
33932 
33933 
33934     /* missing type support */
33935     return(test_ret);
33936 }
33937 
33938 #ifdef LIBXML_SCHEMAS_ENABLED
33939 
33940 #define gen_nb_xmlSAXHandlerPtr_ptr 1
gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33941 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33942     return(NULL);
33943 }
des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED,xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33944 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33945 }
33946 #endif
33947 
33948 
33949 static int
test_xmlSchemaSAXPlug(void)33950 test_xmlSchemaSAXPlug(void) {
33951     int test_ret = 0;
33952 
33953 
33954     /* missing type support */
33955     return(test_ret);
33956 }
33957 
33958 #ifdef LIBXML_SCHEMAS_ENABLED
33959 
33960 #define gen_nb_xmlSchemaSAXPlugPtr 1
gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33961 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33962     return(NULL);
33963 }
des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED,xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)33964 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33965 }
33966 #endif
33967 
33968 
33969 static int
test_xmlSchemaSAXUnplug(void)33970 test_xmlSchemaSAXUnplug(void) {
33971     int test_ret = 0;
33972 
33973 #if defined(LIBXML_SCHEMAS_ENABLED)
33974     int mem_base;
33975     int ret_val;
33976     xmlSchemaSAXPlugPtr plug; /*  */
33977     int n_plug;
33978 
33979     for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
33980         mem_base = xmlMemBlocks();
33981         plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
33982 
33983         ret_val = xmlSchemaSAXUnplug(plug);
33984         desret_int(ret_val);
33985         call_tests++;
33986         des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
33987         xmlResetLastError();
33988         if (mem_base != xmlMemBlocks()) {
33989             printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
33990 	           xmlMemBlocks() - mem_base);
33991 	    test_ret++;
33992             printf(" %d", n_plug);
33993             printf("\n");
33994         }
33995     }
33996     function_tests++;
33997 #endif
33998 
33999     return(test_ret);
34000 }
34001 
34002 
34003 static int
test_xmlSchemaSetParserErrors(void)34004 test_xmlSchemaSetParserErrors(void) {
34005     int test_ret = 0;
34006 
34007 
34008     /* missing type support */
34009     return(test_ret);
34010 }
34011 
34012 
34013 static int
test_xmlSchemaSetParserStructuredErrors(void)34014 test_xmlSchemaSetParserStructuredErrors(void) {
34015     int test_ret = 0;
34016 
34017 
34018     /* missing type support */
34019     return(test_ret);
34020 }
34021 
34022 
34023 static int
test_xmlSchemaSetValidErrors(void)34024 test_xmlSchemaSetValidErrors(void) {
34025     int test_ret = 0;
34026 
34027 
34028     /* missing type support */
34029     return(test_ret);
34030 }
34031 
34032 
34033 static int
test_xmlSchemaSetValidOptions(void)34034 test_xmlSchemaSetValidOptions(void) {
34035     int test_ret = 0;
34036 
34037 #if defined(LIBXML_SCHEMAS_ENABLED)
34038     int mem_base;
34039     int ret_val;
34040     xmlSchemaValidCtxtPtr ctxt; /*  */
34041     int n_ctxt;
34042     int options; /*  */
34043     int n_options;
34044 
34045     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34046     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34047         mem_base = xmlMemBlocks();
34048         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34049         options = gen_int(n_options, 1);
34050 
34051         ret_val = xmlSchemaSetValidOptions(ctxt, options);
34052         desret_int(ret_val);
34053         call_tests++;
34054         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34055         des_int(n_options, options, 1);
34056         xmlResetLastError();
34057         if (mem_base != xmlMemBlocks()) {
34058             printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34059 	           xmlMemBlocks() - mem_base);
34060 	    test_ret++;
34061             printf(" %d", n_ctxt);
34062             printf(" %d", n_options);
34063             printf("\n");
34064         }
34065     }
34066     }
34067     function_tests++;
34068 #endif
34069 
34070     return(test_ret);
34071 }
34072 
34073 
34074 static int
test_xmlSchemaSetValidStructuredErrors(void)34075 test_xmlSchemaSetValidStructuredErrors(void) {
34076     int test_ret = 0;
34077 
34078 
34079     /* missing type support */
34080     return(test_ret);
34081 }
34082 
34083 
34084 static int
test_xmlSchemaValidCtxtGetOptions(void)34085 test_xmlSchemaValidCtxtGetOptions(void) {
34086     int test_ret = 0;
34087 
34088 #if defined(LIBXML_SCHEMAS_ENABLED)
34089     int mem_base;
34090     int ret_val;
34091     xmlSchemaValidCtxtPtr ctxt; /*  */
34092     int n_ctxt;
34093 
34094     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34095         mem_base = xmlMemBlocks();
34096         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34097 
34098         ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34099         desret_int(ret_val);
34100         call_tests++;
34101         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34102         xmlResetLastError();
34103         if (mem_base != xmlMemBlocks()) {
34104             printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34105 	           xmlMemBlocks() - mem_base);
34106 	    test_ret++;
34107             printf(" %d", n_ctxt);
34108             printf("\n");
34109         }
34110     }
34111     function_tests++;
34112 #endif
34113 
34114     return(test_ret);
34115 }
34116 
34117 
34118 static int
test_xmlSchemaValidateDoc(void)34119 test_xmlSchemaValidateDoc(void) {
34120     int test_ret = 0;
34121 
34122 #if defined(LIBXML_SCHEMAS_ENABLED)
34123     int mem_base;
34124     int ret_val;
34125     xmlSchemaValidCtxtPtr ctxt; /*  */
34126     int n_ctxt;
34127     xmlDocPtr instance; /*  */
34128     int n_instance;
34129 
34130     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34131     for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
34132         mem_base = xmlMemBlocks();
34133         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34134         instance = gen_xmlDocPtr(n_instance, 1);
34135 
34136         ret_val = xmlSchemaValidateDoc(ctxt, instance);
34137         desret_int(ret_val);
34138         call_tests++;
34139         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34140         des_xmlDocPtr(n_instance, instance, 1);
34141         xmlResetLastError();
34142         if (mem_base != xmlMemBlocks()) {
34143             printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34144 	           xmlMemBlocks() - mem_base);
34145 	    test_ret++;
34146             printf(" %d", n_ctxt);
34147             printf(" %d", n_instance);
34148             printf("\n");
34149         }
34150     }
34151     }
34152     function_tests++;
34153 #endif
34154 
34155     return(test_ret);
34156 }
34157 
34158 
34159 static int
test_xmlSchemaValidateFile(void)34160 test_xmlSchemaValidateFile(void) {
34161     int test_ret = 0;
34162 
34163 #if defined(LIBXML_SCHEMAS_ENABLED)
34164     int mem_base;
34165     int ret_val;
34166     xmlSchemaValidCtxtPtr ctxt; /*  */
34167     int n_ctxt;
34168     const char * filename; /*  */
34169     int n_filename;
34170     int options; /*  */
34171     int n_options;
34172 
34173     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34174     for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34175     for (n_options = 0;n_options < gen_nb_int;n_options++) {
34176         mem_base = xmlMemBlocks();
34177         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34178         filename = gen_filepath(n_filename, 1);
34179         options = gen_int(n_options, 2);
34180 
34181         ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34182         desret_int(ret_val);
34183         call_tests++;
34184         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34185         des_filepath(n_filename, filename, 1);
34186         des_int(n_options, options, 2);
34187         xmlResetLastError();
34188         if (mem_base != xmlMemBlocks()) {
34189             printf("Leak of %d blocks found in xmlSchemaValidateFile",
34190 	           xmlMemBlocks() - mem_base);
34191 	    test_ret++;
34192             printf(" %d", n_ctxt);
34193             printf(" %d", n_filename);
34194             printf(" %d", n_options);
34195             printf("\n");
34196         }
34197     }
34198     }
34199     }
34200     function_tests++;
34201 #endif
34202 
34203     return(test_ret);
34204 }
34205 
34206 
34207 static int
test_xmlSchemaValidateOneElement(void)34208 test_xmlSchemaValidateOneElement(void) {
34209     int test_ret = 0;
34210 
34211 #if defined(LIBXML_SCHEMAS_ENABLED)
34212     int mem_base;
34213     int ret_val;
34214     xmlSchemaValidCtxtPtr ctxt; /*  */
34215     int n_ctxt;
34216     xmlNodePtr elem; /*  */
34217     int n_elem;
34218 
34219     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34220     for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34221         mem_base = xmlMemBlocks();
34222         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34223         elem = gen_xmlNodePtr(n_elem, 1);
34224 
34225         ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34226         desret_int(ret_val);
34227         call_tests++;
34228         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34229         des_xmlNodePtr(n_elem, elem, 1);
34230         xmlResetLastError();
34231         if (mem_base != xmlMemBlocks()) {
34232             printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34233 	           xmlMemBlocks() - mem_base);
34234 	    test_ret++;
34235             printf(" %d", n_ctxt);
34236             printf(" %d", n_elem);
34237             printf("\n");
34238         }
34239     }
34240     }
34241     function_tests++;
34242 #endif
34243 
34244     return(test_ret);
34245 }
34246 
34247 
34248 static int
test_xmlSchemaValidateStream(void)34249 test_xmlSchemaValidateStream(void) {
34250     int test_ret = 0;
34251 
34252 #if defined(LIBXML_SCHEMAS_ENABLED)
34253     int mem_base;
34254     int ret_val;
34255     xmlSchemaValidCtxtPtr ctxt; /*  */
34256     int n_ctxt;
34257     xmlParserInputBufferPtr input; /*  */
34258     int n_input;
34259     xmlCharEncoding enc; /*  */
34260     int n_enc;
34261     xmlSAXHandlerPtr sax; /*  */
34262     int n_sax;
34263     void * user_data; /*  */
34264     int n_user_data;
34265 
34266     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34267     for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34268     for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34269     for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34270     for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34271         mem_base = xmlMemBlocks();
34272         ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34273         input = gen_xmlParserInputBufferPtr(n_input, 1);
34274         enc = gen_xmlCharEncoding(n_enc, 2);
34275         sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34276         user_data = gen_userdata(n_user_data, 4);
34277 
34278         ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34279         desret_int(ret_val);
34280         call_tests++;
34281         des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34282         des_xmlParserInputBufferPtr(n_input, input, 1);
34283         des_xmlCharEncoding(n_enc, enc, 2);
34284         des_xmlSAXHandlerPtr(n_sax, sax, 3);
34285         des_userdata(n_user_data, user_data, 4);
34286         xmlResetLastError();
34287         if (mem_base != xmlMemBlocks()) {
34288             printf("Leak of %d blocks found in xmlSchemaValidateStream",
34289 	           xmlMemBlocks() - mem_base);
34290 	    test_ret++;
34291             printf(" %d", n_ctxt);
34292             printf(" %d", n_input);
34293             printf(" %d", n_enc);
34294             printf(" %d", n_sax);
34295             printf(" %d", n_user_data);
34296             printf("\n");
34297         }
34298     }
34299     }
34300     }
34301     }
34302     }
34303     function_tests++;
34304 #endif
34305 
34306     return(test_ret);
34307 }
34308 
34309 static int
test_xmlschemas(void)34310 test_xmlschemas(void) {
34311     int test_ret = 0;
34312 
34313     if (quiet == 0) printf("Testing xmlschemas : 14 of 24 functions ...\n");
34314     test_ret += test_xmlSchemaDump();
34315     test_ret += test_xmlSchemaGetParserErrors();
34316     test_ret += test_xmlSchemaGetValidErrors();
34317     test_ret += test_xmlSchemaIsValid();
34318     test_ret += test_xmlSchemaNewDocParserCtxt();
34319     test_ret += test_xmlSchemaNewMemParserCtxt();
34320     test_ret += test_xmlSchemaNewParserCtxt();
34321     test_ret += test_xmlSchemaNewValidCtxt();
34322     test_ret += test_xmlSchemaParse();
34323     test_ret += test_xmlSchemaSAXPlug();
34324     test_ret += test_xmlSchemaSAXUnplug();
34325     test_ret += test_xmlSchemaSetParserErrors();
34326     test_ret += test_xmlSchemaSetParserStructuredErrors();
34327     test_ret += test_xmlSchemaSetValidErrors();
34328     test_ret += test_xmlSchemaSetValidOptions();
34329     test_ret += test_xmlSchemaSetValidStructuredErrors();
34330     test_ret += test_xmlSchemaValidCtxtGetOptions();
34331     test_ret += test_xmlSchemaValidateDoc();
34332     test_ret += test_xmlSchemaValidateFile();
34333     test_ret += test_xmlSchemaValidateOneElement();
34334     test_ret += test_xmlSchemaValidateStream();
34335 
34336     if (test_ret != 0)
34337 	printf("Module xmlschemas: %d errors\n", test_ret);
34338     return(test_ret);
34339 }
34340 #ifdef LIBXML_SCHEMAS_ENABLED
34341 
34342 #define gen_nb_xmlSchemaFacetPtr 1
gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34343 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34344     return(NULL);
34345 }
des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED,xmlSchemaFacetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34346 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34347 }
34348 #endif
34349 
34350 #ifdef LIBXML_SCHEMAS_ENABLED
34351 
34352 #define gen_nb_xmlSchemaTypePtr 1
gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34353 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34354     return(NULL);
34355 }
des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED,xmlSchemaTypePtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34356 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34357 }
34358 #endif
34359 
34360 
34361 static int
test_xmlSchemaCheckFacet(void)34362 test_xmlSchemaCheckFacet(void) {
34363     int test_ret = 0;
34364 
34365 #if defined(LIBXML_SCHEMAS_ENABLED)
34366     int mem_base;
34367     int ret_val;
34368     xmlSchemaFacetPtr facet; /* the facet */
34369     int n_facet;
34370     xmlSchemaTypePtr typeDecl; /* the schema type definition */
34371     int n_typeDecl;
34372     xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34373     int n_pctxt;
34374     xmlChar * name; /* the optional name of the type */
34375     int n_name;
34376 
34377     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34378     for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34379     for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34380     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34381         mem_base = xmlMemBlocks();
34382         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34383         typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34384         pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34385         name = gen_const_xmlChar_ptr(n_name, 3);
34386 
34387         ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34388         desret_int(ret_val);
34389         call_tests++;
34390         des_xmlSchemaFacetPtr(n_facet, facet, 0);
34391         des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34392         des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34393         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34394         xmlResetLastError();
34395         if (mem_base != xmlMemBlocks()) {
34396             printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34397 	           xmlMemBlocks() - mem_base);
34398 	    test_ret++;
34399             printf(" %d", n_facet);
34400             printf(" %d", n_typeDecl);
34401             printf(" %d", n_pctxt);
34402             printf(" %d", n_name);
34403             printf("\n");
34404         }
34405     }
34406     }
34407     }
34408     }
34409     function_tests++;
34410 #endif
34411 
34412     return(test_ret);
34413 }
34414 
34415 
34416 static int
test_xmlSchemaCleanupTypes(void)34417 test_xmlSchemaCleanupTypes(void) {
34418     int test_ret = 0;
34419 
34420 #if defined(LIBXML_SCHEMAS_ENABLED)
34421 
34422 
34423         xmlSchemaCleanupTypes();
34424         call_tests++;
34425         xmlResetLastError();
34426     function_tests++;
34427 #endif
34428 
34429     return(test_ret);
34430 }
34431 
34432 
34433 static int
test_xmlSchemaCollapseString(void)34434 test_xmlSchemaCollapseString(void) {
34435     int test_ret = 0;
34436 
34437 #if defined(LIBXML_SCHEMAS_ENABLED)
34438     int mem_base;
34439     xmlChar * ret_val;
34440     xmlChar * value; /* a value */
34441     int n_value;
34442 
34443     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34444         mem_base = xmlMemBlocks();
34445         value = gen_const_xmlChar_ptr(n_value, 0);
34446 
34447         ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34448         desret_xmlChar_ptr(ret_val);
34449         call_tests++;
34450         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34451         xmlResetLastError();
34452         if (mem_base != xmlMemBlocks()) {
34453             printf("Leak of %d blocks found in xmlSchemaCollapseString",
34454 	           xmlMemBlocks() - mem_base);
34455 	    test_ret++;
34456             printf(" %d", n_value);
34457             printf("\n");
34458         }
34459     }
34460     function_tests++;
34461 #endif
34462 
34463     return(test_ret);
34464 }
34465 
34466 #ifdef LIBXML_SCHEMAS_ENABLED
34467 
34468 #define gen_nb_xmlSchemaValPtr 1
gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34469 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34470     return(NULL);
34471 }
des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED,xmlSchemaValPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34472 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34473 }
34474 #endif
34475 
34476 
34477 static int
test_xmlSchemaCompareValues(void)34478 test_xmlSchemaCompareValues(void) {
34479     int test_ret = 0;
34480 
34481 #if defined(LIBXML_SCHEMAS_ENABLED)
34482     int mem_base;
34483     int ret_val;
34484     xmlSchemaValPtr x; /* a first value */
34485     int n_x;
34486     xmlSchemaValPtr y; /* a second value */
34487     int n_y;
34488 
34489     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34490     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34491         mem_base = xmlMemBlocks();
34492         x = gen_xmlSchemaValPtr(n_x, 0);
34493         y = gen_xmlSchemaValPtr(n_y, 1);
34494 
34495         ret_val = xmlSchemaCompareValues(x, y);
34496         desret_int(ret_val);
34497         call_tests++;
34498         des_xmlSchemaValPtr(n_x, x, 0);
34499         des_xmlSchemaValPtr(n_y, y, 1);
34500         xmlResetLastError();
34501         if (mem_base != xmlMemBlocks()) {
34502             printf("Leak of %d blocks found in xmlSchemaCompareValues",
34503 	           xmlMemBlocks() - mem_base);
34504 	    test_ret++;
34505             printf(" %d", n_x);
34506             printf(" %d", n_y);
34507             printf("\n");
34508         }
34509     }
34510     }
34511     function_tests++;
34512 #endif
34513 
34514     return(test_ret);
34515 }
34516 
34517 
34518 static int
test_xmlSchemaCompareValuesWhtsp(void)34519 test_xmlSchemaCompareValuesWhtsp(void) {
34520     int test_ret = 0;
34521 
34522 #if defined(LIBXML_SCHEMAS_ENABLED)
34523     int mem_base;
34524     int ret_val;
34525     xmlSchemaValPtr x; /* a first value */
34526     int n_x;
34527     xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34528     int n_xws;
34529     xmlSchemaValPtr y; /* a second value */
34530     int n_y;
34531     xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34532     int n_yws;
34533 
34534     for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34535     for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34536     for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34537     for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34538         mem_base = xmlMemBlocks();
34539         x = gen_xmlSchemaValPtr(n_x, 0);
34540         xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34541         y = gen_xmlSchemaValPtr(n_y, 2);
34542         yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34543 
34544         ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34545         desret_int(ret_val);
34546         call_tests++;
34547         des_xmlSchemaValPtr(n_x, x, 0);
34548         des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34549         des_xmlSchemaValPtr(n_y, y, 2);
34550         des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34551         xmlResetLastError();
34552         if (mem_base != xmlMemBlocks()) {
34553             printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34554 	           xmlMemBlocks() - mem_base);
34555 	    test_ret++;
34556             printf(" %d", n_x);
34557             printf(" %d", n_xws);
34558             printf(" %d", n_y);
34559             printf(" %d", n_yws);
34560             printf("\n");
34561         }
34562     }
34563     }
34564     }
34565     }
34566     function_tests++;
34567 #endif
34568 
34569     return(test_ret);
34570 }
34571 
34572 
34573 static int
test_xmlSchemaCopyValue(void)34574 test_xmlSchemaCopyValue(void) {
34575     int test_ret = 0;
34576 
34577 
34578     /* missing type support */
34579     return(test_ret);
34580 }
34581 
34582 
34583 static int
test_xmlSchemaGetBuiltInListSimpleTypeItemType(void)34584 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34585     int test_ret = 0;
34586 
34587 #if defined(LIBXML_SCHEMAS_ENABLED)
34588     int mem_base;
34589     xmlSchemaTypePtr ret_val;
34590     xmlSchemaTypePtr type; /* the built-in simple type. */
34591     int n_type;
34592 
34593     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34594         mem_base = xmlMemBlocks();
34595         type = gen_xmlSchemaTypePtr(n_type, 0);
34596 
34597         ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34598         desret_xmlSchemaTypePtr(ret_val);
34599         call_tests++;
34600         des_xmlSchemaTypePtr(n_type, type, 0);
34601         xmlResetLastError();
34602         if (mem_base != xmlMemBlocks()) {
34603             printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34604 	           xmlMemBlocks() - mem_base);
34605 	    test_ret++;
34606             printf(" %d", n_type);
34607             printf("\n");
34608         }
34609     }
34610     function_tests++;
34611 #endif
34612 
34613     return(test_ret);
34614 }
34615 
34616 
34617 static int
test_xmlSchemaGetBuiltInType(void)34618 test_xmlSchemaGetBuiltInType(void) {
34619     int test_ret = 0;
34620 
34621 #if defined(LIBXML_SCHEMAS_ENABLED)
34622     xmlSchemaTypePtr ret_val;
34623     xmlSchemaValType type; /* the type of the built in type */
34624     int n_type;
34625 
34626     for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34627         type = gen_xmlSchemaValType(n_type, 0);
34628 
34629         ret_val = xmlSchemaGetBuiltInType(type);
34630         desret_xmlSchemaTypePtr(ret_val);
34631         call_tests++;
34632         des_xmlSchemaValType(n_type, type, 0);
34633         xmlResetLastError();
34634     }
34635     function_tests++;
34636 #endif
34637 
34638     return(test_ret);
34639 }
34640 
34641 
34642 static int
test_xmlSchemaGetCanonValue(void)34643 test_xmlSchemaGetCanonValue(void) {
34644     int test_ret = 0;
34645 
34646 #if defined(LIBXML_SCHEMAS_ENABLED)
34647     int mem_base;
34648     int ret_val;
34649     xmlSchemaValPtr val; /* the precomputed value */
34650     int n_val;
34651     xmlChar ** retValue; /* the returned value */
34652     int n_retValue;
34653 
34654     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34655     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34656         mem_base = xmlMemBlocks();
34657         val = gen_xmlSchemaValPtr(n_val, 0);
34658         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34659 
34660         ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34661         desret_int(ret_val);
34662         call_tests++;
34663         des_xmlSchemaValPtr(n_val, val, 0);
34664         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34665         xmlResetLastError();
34666         if (mem_base != xmlMemBlocks()) {
34667             printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34668 	           xmlMemBlocks() - mem_base);
34669 	    test_ret++;
34670             printf(" %d", n_val);
34671             printf(" %d", n_retValue);
34672             printf("\n");
34673         }
34674     }
34675     }
34676     function_tests++;
34677 #endif
34678 
34679     return(test_ret);
34680 }
34681 
34682 
34683 static int
test_xmlSchemaGetCanonValueWhtsp(void)34684 test_xmlSchemaGetCanonValueWhtsp(void) {
34685     int test_ret = 0;
34686 
34687 #if defined(LIBXML_SCHEMAS_ENABLED)
34688     int mem_base;
34689     int ret_val;
34690     xmlSchemaValPtr val; /* the precomputed value */
34691     int n_val;
34692     xmlChar ** retValue; /* the returned value */
34693     int n_retValue;
34694     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34695     int n_ws;
34696 
34697     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34698     for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34699     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34700         mem_base = xmlMemBlocks();
34701         val = gen_xmlSchemaValPtr(n_val, 0);
34702         retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34703         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34704 
34705         ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34706         desret_int(ret_val);
34707         call_tests++;
34708         des_xmlSchemaValPtr(n_val, val, 0);
34709         des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34710         des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34711         xmlResetLastError();
34712         if (mem_base != xmlMemBlocks()) {
34713             printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34714 	           xmlMemBlocks() - mem_base);
34715 	    test_ret++;
34716             printf(" %d", n_val);
34717             printf(" %d", n_retValue);
34718             printf(" %d", n_ws);
34719             printf("\n");
34720         }
34721     }
34722     }
34723     }
34724     function_tests++;
34725 #endif
34726 
34727     return(test_ret);
34728 }
34729 
34730 
34731 static int
test_xmlSchemaGetFacetValueAsULong(void)34732 test_xmlSchemaGetFacetValueAsULong(void) {
34733     int test_ret = 0;
34734 
34735 #if defined(LIBXML_SCHEMAS_ENABLED)
34736     int mem_base;
34737     unsigned long ret_val;
34738     xmlSchemaFacetPtr facet; /* an schemas type facet */
34739     int n_facet;
34740 
34741     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34742         mem_base = xmlMemBlocks();
34743         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34744 
34745         ret_val = xmlSchemaGetFacetValueAsULong(facet);
34746         desret_unsigned_long(ret_val);
34747         call_tests++;
34748         des_xmlSchemaFacetPtr(n_facet, facet, 0);
34749         xmlResetLastError();
34750         if (mem_base != xmlMemBlocks()) {
34751             printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34752 	           xmlMemBlocks() - mem_base);
34753 	    test_ret++;
34754             printf(" %d", n_facet);
34755             printf("\n");
34756         }
34757     }
34758     function_tests++;
34759 #endif
34760 
34761     return(test_ret);
34762 }
34763 
34764 
34765 static int
test_xmlSchemaGetPredefinedType(void)34766 test_xmlSchemaGetPredefinedType(void) {
34767     int test_ret = 0;
34768 
34769 #if defined(LIBXML_SCHEMAS_ENABLED)
34770     int mem_base;
34771     xmlSchemaTypePtr ret_val;
34772     xmlChar * name; /* the type name */
34773     int n_name;
34774     xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34775     int n_ns;
34776 
34777     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34778     for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34779         mem_base = xmlMemBlocks();
34780         name = gen_const_xmlChar_ptr(n_name, 0);
34781         ns = gen_const_xmlChar_ptr(n_ns, 1);
34782 
34783         ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34784         desret_xmlSchemaTypePtr(ret_val);
34785         call_tests++;
34786         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34787         des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34788         xmlResetLastError();
34789         if (mem_base != xmlMemBlocks()) {
34790             printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34791 	           xmlMemBlocks() - mem_base);
34792 	    test_ret++;
34793             printf(" %d", n_name);
34794             printf(" %d", n_ns);
34795             printf("\n");
34796         }
34797     }
34798     }
34799     function_tests++;
34800 #endif
34801 
34802     return(test_ret);
34803 }
34804 
34805 
34806 static int
test_xmlSchemaGetValType(void)34807 test_xmlSchemaGetValType(void) {
34808     int test_ret = 0;
34809 
34810 #if defined(LIBXML_SCHEMAS_ENABLED)
34811     int mem_base;
34812     xmlSchemaValType ret_val;
34813     xmlSchemaValPtr val; /* a schemas value */
34814     int n_val;
34815 
34816     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34817         mem_base = xmlMemBlocks();
34818         val = gen_xmlSchemaValPtr(n_val, 0);
34819 
34820         ret_val = xmlSchemaGetValType(val);
34821         desret_xmlSchemaValType(ret_val);
34822         call_tests++;
34823         des_xmlSchemaValPtr(n_val, val, 0);
34824         xmlResetLastError();
34825         if (mem_base != xmlMemBlocks()) {
34826             printf("Leak of %d blocks found in xmlSchemaGetValType",
34827 	           xmlMemBlocks() - mem_base);
34828 	    test_ret++;
34829             printf(" %d", n_val);
34830             printf("\n");
34831         }
34832     }
34833     function_tests++;
34834 #endif
34835 
34836     return(test_ret);
34837 }
34838 
34839 
34840 static int
test_xmlSchemaInitTypes(void)34841 test_xmlSchemaInitTypes(void) {
34842     int test_ret = 0;
34843 
34844 #if defined(LIBXML_SCHEMAS_ENABLED)
34845 
34846 
34847         xmlSchemaInitTypes();
34848         call_tests++;
34849         xmlResetLastError();
34850     function_tests++;
34851 #endif
34852 
34853     return(test_ret);
34854 }
34855 
34856 
34857 static int
test_xmlSchemaIsBuiltInTypeFacet(void)34858 test_xmlSchemaIsBuiltInTypeFacet(void) {
34859     int test_ret = 0;
34860 
34861 #if defined(LIBXML_SCHEMAS_ENABLED)
34862     int mem_base;
34863     int ret_val;
34864     xmlSchemaTypePtr type; /* the built-in type */
34865     int n_type;
34866     int facetType; /* the facet type */
34867     int n_facetType;
34868 
34869     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34870     for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34871         mem_base = xmlMemBlocks();
34872         type = gen_xmlSchemaTypePtr(n_type, 0);
34873         facetType = gen_int(n_facetType, 1);
34874 
34875         ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34876         desret_int(ret_val);
34877         call_tests++;
34878         des_xmlSchemaTypePtr(n_type, type, 0);
34879         des_int(n_facetType, facetType, 1);
34880         xmlResetLastError();
34881         if (mem_base != xmlMemBlocks()) {
34882             printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34883 	           xmlMemBlocks() - mem_base);
34884 	    test_ret++;
34885             printf(" %d", n_type);
34886             printf(" %d", n_facetType);
34887             printf("\n");
34888         }
34889     }
34890     }
34891     function_tests++;
34892 #endif
34893 
34894     return(test_ret);
34895 }
34896 
34897 
34898 static int
test_xmlSchemaNewFacet(void)34899 test_xmlSchemaNewFacet(void) {
34900     int test_ret = 0;
34901 
34902 
34903     /* missing type support */
34904     return(test_ret);
34905 }
34906 
34907 
34908 static int
test_xmlSchemaNewNOTATIONValue(void)34909 test_xmlSchemaNewNOTATIONValue(void) {
34910     int test_ret = 0;
34911 
34912 
34913     /* missing type support */
34914     return(test_ret);
34915 }
34916 
34917 
34918 static int
test_xmlSchemaNewQNameValue(void)34919 test_xmlSchemaNewQNameValue(void) {
34920     int test_ret = 0;
34921 
34922 
34923     /* missing type support */
34924     return(test_ret);
34925 }
34926 
34927 
34928 static int
test_xmlSchemaNewStringValue(void)34929 test_xmlSchemaNewStringValue(void) {
34930     int test_ret = 0;
34931 
34932 
34933     /* missing type support */
34934     return(test_ret);
34935 }
34936 
34937 #ifdef LIBXML_SCHEMAS_ENABLED
34938 
34939 #define gen_nb_xmlSchemaValPtr_ptr 1
gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34940 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34941     return(NULL);
34942 }
des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED,xmlSchemaValPtr * val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)34943 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34944 }
34945 #endif
34946 
34947 
34948 static int
test_xmlSchemaValPredefTypeNode(void)34949 test_xmlSchemaValPredefTypeNode(void) {
34950     int test_ret = 0;
34951 
34952 #if defined(LIBXML_SCHEMAS_ENABLED)
34953     int mem_base;
34954     int ret_val;
34955     xmlSchemaTypePtr type; /* the predefined type */
34956     int n_type;
34957     xmlChar * value; /* the value to check */
34958     int n_value;
34959     xmlSchemaValPtr * val; /* the return computed value */
34960     int n_val;
34961     xmlNodePtr node; /* the node containing the value */
34962     int n_node;
34963 
34964     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34965     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34966     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
34967     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
34968         mem_base = xmlMemBlocks();
34969         type = gen_xmlSchemaTypePtr(n_type, 0);
34970         value = gen_const_xmlChar_ptr(n_value, 1);
34971         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
34972         node = gen_xmlNodePtr(n_node, 3);
34973 
34974         ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
34975         desret_int(ret_val);
34976         call_tests++;
34977         des_xmlSchemaTypePtr(n_type, type, 0);
34978         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
34979         des_xmlSchemaValPtr_ptr(n_val, val, 2);
34980         des_xmlNodePtr(n_node, node, 3);
34981         xmlResetLastError();
34982         if (mem_base != xmlMemBlocks()) {
34983             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
34984 	           xmlMemBlocks() - mem_base);
34985 	    test_ret++;
34986             printf(" %d", n_type);
34987             printf(" %d", n_value);
34988             printf(" %d", n_val);
34989             printf(" %d", n_node);
34990             printf("\n");
34991         }
34992     }
34993     }
34994     }
34995     }
34996     function_tests++;
34997 #endif
34998 
34999     return(test_ret);
35000 }
35001 
35002 
35003 static int
test_xmlSchemaValPredefTypeNodeNoNorm(void)35004 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35005     int test_ret = 0;
35006 
35007 #if defined(LIBXML_SCHEMAS_ENABLED)
35008     int mem_base;
35009     int ret_val;
35010     xmlSchemaTypePtr type; /* the predefined type */
35011     int n_type;
35012     xmlChar * value; /* the value to check */
35013     int n_value;
35014     xmlSchemaValPtr * val; /* the return computed value */
35015     int n_val;
35016     xmlNodePtr node; /* the node containing the value */
35017     int n_node;
35018 
35019     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35020     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35021     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35022     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35023         mem_base = xmlMemBlocks();
35024         type = gen_xmlSchemaTypePtr(n_type, 0);
35025         value = gen_const_xmlChar_ptr(n_value, 1);
35026         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35027         node = gen_xmlNodePtr(n_node, 3);
35028 
35029         ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35030         desret_int(ret_val);
35031         call_tests++;
35032         des_xmlSchemaTypePtr(n_type, type, 0);
35033         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35034         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35035         des_xmlNodePtr(n_node, node, 3);
35036         xmlResetLastError();
35037         if (mem_base != xmlMemBlocks()) {
35038             printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35039 	           xmlMemBlocks() - mem_base);
35040 	    test_ret++;
35041             printf(" %d", n_type);
35042             printf(" %d", n_value);
35043             printf(" %d", n_val);
35044             printf(" %d", n_node);
35045             printf("\n");
35046         }
35047     }
35048     }
35049     }
35050     }
35051     function_tests++;
35052 #endif
35053 
35054     return(test_ret);
35055 }
35056 
35057 
35058 static int
test_xmlSchemaValidateFacet(void)35059 test_xmlSchemaValidateFacet(void) {
35060     int test_ret = 0;
35061 
35062 #if defined(LIBXML_SCHEMAS_ENABLED)
35063     int mem_base;
35064     int ret_val;
35065     xmlSchemaTypePtr base; /* the base type */
35066     int n_base;
35067     xmlSchemaFacetPtr facet; /* the facet to check */
35068     int n_facet;
35069     xmlChar * value; /* the lexical repr of the value to validate */
35070     int n_value;
35071     xmlSchemaValPtr val; /* the precomputed value */
35072     int n_val;
35073 
35074     for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35075     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35076     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35077     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35078         mem_base = xmlMemBlocks();
35079         base = gen_xmlSchemaTypePtr(n_base, 0);
35080         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35081         value = gen_const_xmlChar_ptr(n_value, 2);
35082         val = gen_xmlSchemaValPtr(n_val, 3);
35083 
35084         ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35085         desret_int(ret_val);
35086         call_tests++;
35087         des_xmlSchemaTypePtr(n_base, base, 0);
35088         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35089         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35090         des_xmlSchemaValPtr(n_val, val, 3);
35091         xmlResetLastError();
35092         if (mem_base != xmlMemBlocks()) {
35093             printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35094 	           xmlMemBlocks() - mem_base);
35095 	    test_ret++;
35096             printf(" %d", n_base);
35097             printf(" %d", n_facet);
35098             printf(" %d", n_value);
35099             printf(" %d", n_val);
35100             printf("\n");
35101         }
35102     }
35103     }
35104     }
35105     }
35106     function_tests++;
35107 #endif
35108 
35109     return(test_ret);
35110 }
35111 
35112 
35113 static int
test_xmlSchemaValidateFacetWhtsp(void)35114 test_xmlSchemaValidateFacetWhtsp(void) {
35115     int test_ret = 0;
35116 
35117 #if defined(LIBXML_SCHEMAS_ENABLED)
35118     int mem_base;
35119     int ret_val;
35120     xmlSchemaFacetPtr facet; /* the facet to check */
35121     int n_facet;
35122     xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35123     int n_fws;
35124     xmlSchemaValType valType; /* the built-in type of the value */
35125     int n_valType;
35126     xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35127     int n_value;
35128     xmlSchemaValPtr val; /* the precomputed value */
35129     int n_val;
35130     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35131     int n_ws;
35132 
35133     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35134     for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35135     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35136     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35137     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35138     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35139         mem_base = xmlMemBlocks();
35140         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35141         fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35142         valType = gen_xmlSchemaValType(n_valType, 2);
35143         value = gen_const_xmlChar_ptr(n_value, 3);
35144         val = gen_xmlSchemaValPtr(n_val, 4);
35145         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35146 
35147         ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35148         desret_int(ret_val);
35149         call_tests++;
35150         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35151         des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35152         des_xmlSchemaValType(n_valType, valType, 2);
35153         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35154         des_xmlSchemaValPtr(n_val, val, 4);
35155         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35156         xmlResetLastError();
35157         if (mem_base != xmlMemBlocks()) {
35158             printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35159 	           xmlMemBlocks() - mem_base);
35160 	    test_ret++;
35161             printf(" %d", n_facet);
35162             printf(" %d", n_fws);
35163             printf(" %d", n_valType);
35164             printf(" %d", n_value);
35165             printf(" %d", n_val);
35166             printf(" %d", n_ws);
35167             printf("\n");
35168         }
35169     }
35170     }
35171     }
35172     }
35173     }
35174     }
35175     function_tests++;
35176 #endif
35177 
35178     return(test_ret);
35179 }
35180 
35181 
35182 static int
test_xmlSchemaValidateLengthFacet(void)35183 test_xmlSchemaValidateLengthFacet(void) {
35184     int test_ret = 0;
35185 
35186 #if defined(LIBXML_SCHEMAS_ENABLED)
35187     int mem_base;
35188     int ret_val;
35189     xmlSchemaTypePtr type; /* the built-in type */
35190     int n_type;
35191     xmlSchemaFacetPtr facet; /* the facet to check */
35192     int n_facet;
35193     xmlChar * value; /* the lexical repr. of the value to be validated */
35194     int n_value;
35195     xmlSchemaValPtr val; /* the precomputed value */
35196     int n_val;
35197     unsigned long * length; /* the actual length of the value */
35198     int n_length;
35199 
35200     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35201     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35202     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35203     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35204     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35205         mem_base = xmlMemBlocks();
35206         type = gen_xmlSchemaTypePtr(n_type, 0);
35207         facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35208         value = gen_const_xmlChar_ptr(n_value, 2);
35209         val = gen_xmlSchemaValPtr(n_val, 3);
35210         length = gen_unsigned_long_ptr(n_length, 4);
35211 
35212         ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35213         desret_int(ret_val);
35214         call_tests++;
35215         des_xmlSchemaTypePtr(n_type, type, 0);
35216         des_xmlSchemaFacetPtr(n_facet, facet, 1);
35217         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35218         des_xmlSchemaValPtr(n_val, val, 3);
35219         des_unsigned_long_ptr(n_length, length, 4);
35220         xmlResetLastError();
35221         if (mem_base != xmlMemBlocks()) {
35222             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35223 	           xmlMemBlocks() - mem_base);
35224 	    test_ret++;
35225             printf(" %d", n_type);
35226             printf(" %d", n_facet);
35227             printf(" %d", n_value);
35228             printf(" %d", n_val);
35229             printf(" %d", n_length);
35230             printf("\n");
35231         }
35232     }
35233     }
35234     }
35235     }
35236     }
35237     function_tests++;
35238 #endif
35239 
35240     return(test_ret);
35241 }
35242 
35243 
35244 static int
test_xmlSchemaValidateLengthFacetWhtsp(void)35245 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35246     int test_ret = 0;
35247 
35248 #if defined(LIBXML_SCHEMAS_ENABLED)
35249     int mem_base;
35250     int ret_val;
35251     xmlSchemaFacetPtr facet; /* the facet to check */
35252     int n_facet;
35253     xmlSchemaValType valType; /* the built-in type */
35254     int n_valType;
35255     xmlChar * value; /* the lexical repr. of the value to be validated */
35256     int n_value;
35257     xmlSchemaValPtr val; /* the precomputed value */
35258     int n_val;
35259     unsigned long * length; /* the actual length of the value */
35260     int n_length;
35261     xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35262     int n_ws;
35263 
35264     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35265     for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35266     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35267     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35268     for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35269     for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35270         mem_base = xmlMemBlocks();
35271         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35272         valType = gen_xmlSchemaValType(n_valType, 1);
35273         value = gen_const_xmlChar_ptr(n_value, 2);
35274         val = gen_xmlSchemaValPtr(n_val, 3);
35275         length = gen_unsigned_long_ptr(n_length, 4);
35276         ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35277 
35278         ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35279         desret_int(ret_val);
35280         call_tests++;
35281         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35282         des_xmlSchemaValType(n_valType, valType, 1);
35283         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35284         des_xmlSchemaValPtr(n_val, val, 3);
35285         des_unsigned_long_ptr(n_length, length, 4);
35286         des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35287         xmlResetLastError();
35288         if (mem_base != xmlMemBlocks()) {
35289             printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35290 	           xmlMemBlocks() - mem_base);
35291 	    test_ret++;
35292             printf(" %d", n_facet);
35293             printf(" %d", n_valType);
35294             printf(" %d", n_value);
35295             printf(" %d", n_val);
35296             printf(" %d", n_length);
35297             printf(" %d", n_ws);
35298             printf("\n");
35299         }
35300     }
35301     }
35302     }
35303     }
35304     }
35305     }
35306     function_tests++;
35307 #endif
35308 
35309     return(test_ret);
35310 }
35311 
35312 
35313 static int
test_xmlSchemaValidateListSimpleTypeFacet(void)35314 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35315     int test_ret = 0;
35316 
35317 #if defined(LIBXML_SCHEMAS_ENABLED)
35318     int mem_base;
35319     int ret_val;
35320     xmlSchemaFacetPtr facet; /* the facet to check */
35321     int n_facet;
35322     xmlChar * value; /* the lexical repr of the value to validate */
35323     int n_value;
35324     unsigned long actualLen; /* the number of list items */
35325     int n_actualLen;
35326     unsigned long * expectedLen; /* the resulting expected number of list items */
35327     int n_expectedLen;
35328 
35329     for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35330     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35331     for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35332     for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35333         mem_base = xmlMemBlocks();
35334         facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35335         value = gen_const_xmlChar_ptr(n_value, 1);
35336         actualLen = gen_unsigned_long(n_actualLen, 2);
35337         expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35338 
35339         ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35340         desret_int(ret_val);
35341         call_tests++;
35342         des_xmlSchemaFacetPtr(n_facet, facet, 0);
35343         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35344         des_unsigned_long(n_actualLen, actualLen, 2);
35345         des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35346         xmlResetLastError();
35347         if (mem_base != xmlMemBlocks()) {
35348             printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35349 	           xmlMemBlocks() - mem_base);
35350 	    test_ret++;
35351             printf(" %d", n_facet);
35352             printf(" %d", n_value);
35353             printf(" %d", n_actualLen);
35354             printf(" %d", n_expectedLen);
35355             printf("\n");
35356         }
35357     }
35358     }
35359     }
35360     }
35361     function_tests++;
35362 #endif
35363 
35364     return(test_ret);
35365 }
35366 
35367 
35368 static int
test_xmlSchemaValidatePredefinedType(void)35369 test_xmlSchemaValidatePredefinedType(void) {
35370     int test_ret = 0;
35371 
35372 #if defined(LIBXML_SCHEMAS_ENABLED)
35373     int mem_base;
35374     int ret_val;
35375     xmlSchemaTypePtr type; /* the predefined type */
35376     int n_type;
35377     xmlChar * value; /* the value to check */
35378     int n_value;
35379     xmlSchemaValPtr * val; /* the return computed value */
35380     int n_val;
35381 
35382     for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35383     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35384     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35385         mem_base = xmlMemBlocks();
35386         type = gen_xmlSchemaTypePtr(n_type, 0);
35387         value = gen_const_xmlChar_ptr(n_value, 1);
35388         val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35389 
35390         ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35391         desret_int(ret_val);
35392         call_tests++;
35393         des_xmlSchemaTypePtr(n_type, type, 0);
35394         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35395         des_xmlSchemaValPtr_ptr(n_val, val, 2);
35396         xmlResetLastError();
35397         if (mem_base != xmlMemBlocks()) {
35398             printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35399 	           xmlMemBlocks() - mem_base);
35400 	    test_ret++;
35401             printf(" %d", n_type);
35402             printf(" %d", n_value);
35403             printf(" %d", n_val);
35404             printf("\n");
35405         }
35406     }
35407     }
35408     }
35409     function_tests++;
35410 #endif
35411 
35412     return(test_ret);
35413 }
35414 
35415 
35416 static int
test_xmlSchemaValueAppend(void)35417 test_xmlSchemaValueAppend(void) {
35418     int test_ret = 0;
35419 
35420 #if defined(LIBXML_SCHEMAS_ENABLED)
35421     int mem_base;
35422     int ret_val;
35423     xmlSchemaValPtr prev; /* the value */
35424     int n_prev;
35425     xmlSchemaValPtr cur; /* the value to be appended */
35426     int n_cur;
35427 
35428     for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35429     for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35430         mem_base = xmlMemBlocks();
35431         prev = gen_xmlSchemaValPtr(n_prev, 0);
35432         cur = gen_xmlSchemaValPtr(n_cur, 1);
35433 
35434         ret_val = xmlSchemaValueAppend(prev, cur);
35435         desret_int(ret_val);
35436         call_tests++;
35437         des_xmlSchemaValPtr(n_prev, prev, 0);
35438         des_xmlSchemaValPtr(n_cur, cur, 1);
35439         xmlResetLastError();
35440         if (mem_base != xmlMemBlocks()) {
35441             printf("Leak of %d blocks found in xmlSchemaValueAppend",
35442 	           xmlMemBlocks() - mem_base);
35443 	    test_ret++;
35444             printf(" %d", n_prev);
35445             printf(" %d", n_cur);
35446             printf("\n");
35447         }
35448     }
35449     }
35450     function_tests++;
35451 #endif
35452 
35453     return(test_ret);
35454 }
35455 
35456 
35457 static int
test_xmlSchemaValueGetAsBoolean(void)35458 test_xmlSchemaValueGetAsBoolean(void) {
35459     int test_ret = 0;
35460 
35461 #if defined(LIBXML_SCHEMAS_ENABLED)
35462     int mem_base;
35463     int ret_val;
35464     xmlSchemaValPtr val; /* the value */
35465     int n_val;
35466 
35467     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35468         mem_base = xmlMemBlocks();
35469         val = gen_xmlSchemaValPtr(n_val, 0);
35470 
35471         ret_val = xmlSchemaValueGetAsBoolean(val);
35472         desret_int(ret_val);
35473         call_tests++;
35474         des_xmlSchemaValPtr(n_val, val, 0);
35475         xmlResetLastError();
35476         if (mem_base != xmlMemBlocks()) {
35477             printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35478 	           xmlMemBlocks() - mem_base);
35479 	    test_ret++;
35480             printf(" %d", n_val);
35481             printf("\n");
35482         }
35483     }
35484     function_tests++;
35485 #endif
35486 
35487     return(test_ret);
35488 }
35489 
35490 
35491 static int
test_xmlSchemaValueGetAsString(void)35492 test_xmlSchemaValueGetAsString(void) {
35493     int test_ret = 0;
35494 
35495 #if defined(LIBXML_SCHEMAS_ENABLED)
35496     int mem_base;
35497     const xmlChar * ret_val;
35498     xmlSchemaValPtr val; /* the value */
35499     int n_val;
35500 
35501     for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35502         mem_base = xmlMemBlocks();
35503         val = gen_xmlSchemaValPtr(n_val, 0);
35504 
35505         ret_val = xmlSchemaValueGetAsString(val);
35506         desret_const_xmlChar_ptr(ret_val);
35507         call_tests++;
35508         des_xmlSchemaValPtr(n_val, val, 0);
35509         xmlResetLastError();
35510         if (mem_base != xmlMemBlocks()) {
35511             printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35512 	           xmlMemBlocks() - mem_base);
35513 	    test_ret++;
35514             printf(" %d", n_val);
35515             printf("\n");
35516         }
35517     }
35518     function_tests++;
35519 #endif
35520 
35521     return(test_ret);
35522 }
35523 
35524 
35525 static int
test_xmlSchemaValueGetNext(void)35526 test_xmlSchemaValueGetNext(void) {
35527     int test_ret = 0;
35528 
35529 
35530     /* missing type support */
35531     return(test_ret);
35532 }
35533 
35534 
35535 static int
test_xmlSchemaWhiteSpaceReplace(void)35536 test_xmlSchemaWhiteSpaceReplace(void) {
35537     int test_ret = 0;
35538 
35539 #if defined(LIBXML_SCHEMAS_ENABLED)
35540     int mem_base;
35541     xmlChar * ret_val;
35542     xmlChar * value; /* a value */
35543     int n_value;
35544 
35545     for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35546         mem_base = xmlMemBlocks();
35547         value = gen_const_xmlChar_ptr(n_value, 0);
35548 
35549         ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35550         desret_xmlChar_ptr(ret_val);
35551         call_tests++;
35552         des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35553         xmlResetLastError();
35554         if (mem_base != xmlMemBlocks()) {
35555             printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35556 	           xmlMemBlocks() - mem_base);
35557 	    test_ret++;
35558             printf(" %d", n_value);
35559             printf("\n");
35560         }
35561     }
35562     function_tests++;
35563 #endif
35564 
35565     return(test_ret);
35566 }
35567 
35568 static int
test_xmlschemastypes(void)35569 test_xmlschemastypes(void) {
35570     int test_ret = 0;
35571 
35572     if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35573     test_ret += test_xmlSchemaCheckFacet();
35574     test_ret += test_xmlSchemaCleanupTypes();
35575     test_ret += test_xmlSchemaCollapseString();
35576     test_ret += test_xmlSchemaCompareValues();
35577     test_ret += test_xmlSchemaCompareValuesWhtsp();
35578     test_ret += test_xmlSchemaCopyValue();
35579     test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35580     test_ret += test_xmlSchemaGetBuiltInType();
35581     test_ret += test_xmlSchemaGetCanonValue();
35582     test_ret += test_xmlSchemaGetCanonValueWhtsp();
35583     test_ret += test_xmlSchemaGetFacetValueAsULong();
35584     test_ret += test_xmlSchemaGetPredefinedType();
35585     test_ret += test_xmlSchemaGetValType();
35586     test_ret += test_xmlSchemaInitTypes();
35587     test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35588     test_ret += test_xmlSchemaNewFacet();
35589     test_ret += test_xmlSchemaNewNOTATIONValue();
35590     test_ret += test_xmlSchemaNewQNameValue();
35591     test_ret += test_xmlSchemaNewStringValue();
35592     test_ret += test_xmlSchemaValPredefTypeNode();
35593     test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35594     test_ret += test_xmlSchemaValidateFacet();
35595     test_ret += test_xmlSchemaValidateFacetWhtsp();
35596     test_ret += test_xmlSchemaValidateLengthFacet();
35597     test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35598     test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35599     test_ret += test_xmlSchemaValidatePredefinedType();
35600     test_ret += test_xmlSchemaValueAppend();
35601     test_ret += test_xmlSchemaValueGetAsBoolean();
35602     test_ret += test_xmlSchemaValueGetAsString();
35603     test_ret += test_xmlSchemaValueGetNext();
35604     test_ret += test_xmlSchemaWhiteSpaceReplace();
35605 
35606     if (test_ret != 0)
35607 	printf("Module xmlschemastypes: %d errors\n", test_ret);
35608     return(test_ret);
35609 }
35610 
35611 static int
test_xmlCharStrdup(void)35612 test_xmlCharStrdup(void) {
35613     int test_ret = 0;
35614 
35615     int mem_base;
35616     xmlChar * ret_val;
35617     char * cur; /* the input char * */
35618     int n_cur;
35619 
35620     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35621         mem_base = xmlMemBlocks();
35622         cur = gen_const_char_ptr(n_cur, 0);
35623 
35624         ret_val = xmlCharStrdup((const char *)cur);
35625         desret_xmlChar_ptr(ret_val);
35626         call_tests++;
35627         des_const_char_ptr(n_cur, (const char *)cur, 0);
35628         xmlResetLastError();
35629         if (mem_base != xmlMemBlocks()) {
35630             printf("Leak of %d blocks found in xmlCharStrdup",
35631 	           xmlMemBlocks() - mem_base);
35632 	    test_ret++;
35633             printf(" %d", n_cur);
35634             printf("\n");
35635         }
35636     }
35637     function_tests++;
35638 
35639     return(test_ret);
35640 }
35641 
35642 
35643 static int
test_xmlCharStrndup(void)35644 test_xmlCharStrndup(void) {
35645     int test_ret = 0;
35646 
35647     int mem_base;
35648     xmlChar * ret_val;
35649     char * cur; /* the input char * */
35650     int n_cur;
35651     int len; /* the len of @cur */
35652     int n_len;
35653 
35654     for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35655     for (n_len = 0;n_len < gen_nb_int;n_len++) {
35656         mem_base = xmlMemBlocks();
35657         cur = gen_const_char_ptr(n_cur, 0);
35658         len = gen_int(n_len, 1);
35659 
35660         ret_val = xmlCharStrndup((const char *)cur, len);
35661         desret_xmlChar_ptr(ret_val);
35662         call_tests++;
35663         des_const_char_ptr(n_cur, (const char *)cur, 0);
35664         des_int(n_len, len, 1);
35665         xmlResetLastError();
35666         if (mem_base != xmlMemBlocks()) {
35667             printf("Leak of %d blocks found in xmlCharStrndup",
35668 	           xmlMemBlocks() - mem_base);
35669 	    test_ret++;
35670             printf(" %d", n_cur);
35671             printf(" %d", n_len);
35672             printf("\n");
35673         }
35674     }
35675     }
35676     function_tests++;
35677 
35678     return(test_ret);
35679 }
35680 
35681 
35682 static int
test_xmlCheckUTF8(void)35683 test_xmlCheckUTF8(void) {
35684     int test_ret = 0;
35685 
35686     int mem_base;
35687     int ret_val;
35688     unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35689     int n_utf;
35690 
35691     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35692         mem_base = xmlMemBlocks();
35693         utf = gen_const_unsigned_char_ptr(n_utf, 0);
35694 
35695         ret_val = xmlCheckUTF8((const unsigned char *)utf);
35696         desret_int(ret_val);
35697         call_tests++;
35698         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35699         xmlResetLastError();
35700         if (mem_base != xmlMemBlocks()) {
35701             printf("Leak of %d blocks found in xmlCheckUTF8",
35702 	           xmlMemBlocks() - mem_base);
35703 	    test_ret++;
35704             printf(" %d", n_utf);
35705             printf("\n");
35706         }
35707     }
35708     function_tests++;
35709 
35710     return(test_ret);
35711 }
35712 
35713 
35714 static int
test_xmlGetUTF8Char(void)35715 test_xmlGetUTF8Char(void) {
35716     int test_ret = 0;
35717 
35718     int mem_base;
35719     int ret_val;
35720     unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35721     int n_utf;
35722     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. */
35723     int n_len;
35724 
35725     for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35726     for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35727         mem_base = xmlMemBlocks();
35728         utf = gen_const_unsigned_char_ptr(n_utf, 0);
35729         len = gen_int_ptr(n_len, 1);
35730 
35731         ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35732         desret_int(ret_val);
35733         call_tests++;
35734         des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35735         des_int_ptr(n_len, len, 1);
35736         xmlResetLastError();
35737         if (mem_base != xmlMemBlocks()) {
35738             printf("Leak of %d blocks found in xmlGetUTF8Char",
35739 	           xmlMemBlocks() - mem_base);
35740 	    test_ret++;
35741             printf(" %d", n_utf);
35742             printf(" %d", n_len);
35743             printf("\n");
35744         }
35745     }
35746     }
35747     function_tests++;
35748 
35749     return(test_ret);
35750 }
35751 
35752 
35753 static int
test_xmlStrEqual(void)35754 test_xmlStrEqual(void) {
35755     int test_ret = 0;
35756 
35757     int mem_base;
35758     int ret_val;
35759     xmlChar * str1; /* the first xmlChar * */
35760     int n_str1;
35761     xmlChar * str2; /* the second xmlChar * */
35762     int n_str2;
35763 
35764     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35765     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35766         mem_base = xmlMemBlocks();
35767         str1 = gen_const_xmlChar_ptr(n_str1, 0);
35768         str2 = gen_const_xmlChar_ptr(n_str2, 1);
35769 
35770         ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35771         desret_int(ret_val);
35772         call_tests++;
35773         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35774         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35775         xmlResetLastError();
35776         if (mem_base != xmlMemBlocks()) {
35777             printf("Leak of %d blocks found in xmlStrEqual",
35778 	           xmlMemBlocks() - mem_base);
35779 	    test_ret++;
35780             printf(" %d", n_str1);
35781             printf(" %d", n_str2);
35782             printf("\n");
35783         }
35784     }
35785     }
35786     function_tests++;
35787 
35788     return(test_ret);
35789 }
35790 
35791 
35792 static int
test_xmlStrPrintf(void)35793 test_xmlStrPrintf(void) {
35794     int test_ret = 0;
35795 
35796 
35797     /* missing type support */
35798     return(test_ret);
35799 }
35800 
35801 
35802 static int
test_xmlStrQEqual(void)35803 test_xmlStrQEqual(void) {
35804     int test_ret = 0;
35805 
35806     int mem_base;
35807     int ret_val;
35808     xmlChar * pref; /* the prefix of the QName */
35809     int n_pref;
35810     xmlChar * name; /* the localname of the QName */
35811     int n_name;
35812     xmlChar * str; /* the second xmlChar * */
35813     int n_str;
35814 
35815     for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35816     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35817     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35818         mem_base = xmlMemBlocks();
35819         pref = gen_const_xmlChar_ptr(n_pref, 0);
35820         name = gen_const_xmlChar_ptr(n_name, 1);
35821         str = gen_const_xmlChar_ptr(n_str, 2);
35822 
35823         ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35824         desret_int(ret_val);
35825         call_tests++;
35826         des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35827         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35828         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35829         xmlResetLastError();
35830         if (mem_base != xmlMemBlocks()) {
35831             printf("Leak of %d blocks found in xmlStrQEqual",
35832 	           xmlMemBlocks() - mem_base);
35833 	    test_ret++;
35834             printf(" %d", n_pref);
35835             printf(" %d", n_name);
35836             printf(" %d", n_str);
35837             printf("\n");
35838         }
35839     }
35840     }
35841     }
35842     function_tests++;
35843 
35844     return(test_ret);
35845 }
35846 
35847 
35848 static int
test_xmlStrVPrintf(void)35849 test_xmlStrVPrintf(void) {
35850     int test_ret = 0;
35851 
35852 
35853     /* missing type support */
35854     return(test_ret);
35855 }
35856 
35857 
35858 static int
test_xmlStrcasecmp(void)35859 test_xmlStrcasecmp(void) {
35860     int test_ret = 0;
35861 
35862     int mem_base;
35863     int ret_val;
35864     xmlChar * str1; /* the first xmlChar * */
35865     int n_str1;
35866     xmlChar * str2; /* the second xmlChar * */
35867     int n_str2;
35868 
35869     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35870     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35871         mem_base = xmlMemBlocks();
35872         str1 = gen_const_xmlChar_ptr(n_str1, 0);
35873         str2 = gen_const_xmlChar_ptr(n_str2, 1);
35874 
35875         ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35876         desret_int(ret_val);
35877         call_tests++;
35878         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35879         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35880         xmlResetLastError();
35881         if (mem_base != xmlMemBlocks()) {
35882             printf("Leak of %d blocks found in xmlStrcasecmp",
35883 	           xmlMemBlocks() - mem_base);
35884 	    test_ret++;
35885             printf(" %d", n_str1);
35886             printf(" %d", n_str2);
35887             printf("\n");
35888         }
35889     }
35890     }
35891     function_tests++;
35892 
35893     return(test_ret);
35894 }
35895 
35896 
35897 static int
test_xmlStrcasestr(void)35898 test_xmlStrcasestr(void) {
35899     int test_ret = 0;
35900 
35901     int mem_base;
35902     const xmlChar * ret_val;
35903     xmlChar * str; /* the xmlChar * array (haystack) */
35904     int n_str;
35905     xmlChar * val; /* the xmlChar to search (needle) */
35906     int n_val;
35907 
35908     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35909     for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35910         mem_base = xmlMemBlocks();
35911         str = gen_const_xmlChar_ptr(n_str, 0);
35912         val = gen_xmlChar_ptr(n_val, 1);
35913 
35914         ret_val = xmlStrcasestr((const xmlChar *)str, val);
35915         desret_const_xmlChar_ptr(ret_val);
35916         call_tests++;
35917         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35918         des_xmlChar_ptr(n_val, val, 1);
35919         xmlResetLastError();
35920         if (mem_base != xmlMemBlocks()) {
35921             printf("Leak of %d blocks found in xmlStrcasestr",
35922 	           xmlMemBlocks() - mem_base);
35923 	    test_ret++;
35924             printf(" %d", n_str);
35925             printf(" %d", n_val);
35926             printf("\n");
35927         }
35928     }
35929     }
35930     function_tests++;
35931 
35932     return(test_ret);
35933 }
35934 
35935 
35936 static int
test_xmlStrchr(void)35937 test_xmlStrchr(void) {
35938     int test_ret = 0;
35939 
35940     int mem_base;
35941     const xmlChar * ret_val;
35942     xmlChar * str; /* the xmlChar * array */
35943     int n_str;
35944     xmlChar val; /* the xmlChar to search */
35945     int n_val;
35946 
35947     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35948     for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
35949         mem_base = xmlMemBlocks();
35950         str = gen_const_xmlChar_ptr(n_str, 0);
35951         val = gen_xmlChar(n_val, 1);
35952 
35953         ret_val = xmlStrchr((const xmlChar *)str, val);
35954         desret_const_xmlChar_ptr(ret_val);
35955         call_tests++;
35956         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35957         des_xmlChar(n_val, val, 1);
35958         xmlResetLastError();
35959         if (mem_base != xmlMemBlocks()) {
35960             printf("Leak of %d blocks found in xmlStrchr",
35961 	           xmlMemBlocks() - mem_base);
35962 	    test_ret++;
35963             printf(" %d", n_str);
35964             printf(" %d", n_val);
35965             printf("\n");
35966         }
35967     }
35968     }
35969     function_tests++;
35970 
35971     return(test_ret);
35972 }
35973 
35974 
35975 static int
test_xmlStrcmp(void)35976 test_xmlStrcmp(void) {
35977     int test_ret = 0;
35978 
35979     int mem_base;
35980     int ret_val;
35981     xmlChar * str1; /* the first xmlChar * */
35982     int n_str1;
35983     xmlChar * str2; /* the second xmlChar * */
35984     int n_str2;
35985 
35986     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35987     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35988         mem_base = xmlMemBlocks();
35989         str1 = gen_const_xmlChar_ptr(n_str1, 0);
35990         str2 = gen_const_xmlChar_ptr(n_str2, 1);
35991 
35992         ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
35993         desret_int(ret_val);
35994         call_tests++;
35995         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35996         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35997         xmlResetLastError();
35998         if (mem_base != xmlMemBlocks()) {
35999             printf("Leak of %d blocks found in xmlStrcmp",
36000 	           xmlMemBlocks() - mem_base);
36001 	    test_ret++;
36002             printf(" %d", n_str1);
36003             printf(" %d", n_str2);
36004             printf("\n");
36005         }
36006     }
36007     }
36008     function_tests++;
36009 
36010     return(test_ret);
36011 }
36012 
36013 
36014 static int
test_xmlStrdup(void)36015 test_xmlStrdup(void) {
36016     int test_ret = 0;
36017 
36018     int mem_base;
36019     xmlChar * ret_val;
36020     xmlChar * cur; /* the input xmlChar * */
36021     int n_cur;
36022 
36023     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36024         mem_base = xmlMemBlocks();
36025         cur = gen_const_xmlChar_ptr(n_cur, 0);
36026 
36027         ret_val = xmlStrdup((const xmlChar *)cur);
36028         desret_xmlChar_ptr(ret_val);
36029         call_tests++;
36030         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36031         xmlResetLastError();
36032         if (mem_base != xmlMemBlocks()) {
36033             printf("Leak of %d blocks found in xmlStrdup",
36034 	           xmlMemBlocks() - mem_base);
36035 	    test_ret++;
36036             printf(" %d", n_cur);
36037             printf("\n");
36038         }
36039     }
36040     function_tests++;
36041 
36042     return(test_ret);
36043 }
36044 
36045 
36046 static int
test_xmlStrlen(void)36047 test_xmlStrlen(void) {
36048     int test_ret = 0;
36049 
36050     int mem_base;
36051     int ret_val;
36052     xmlChar * str; /* the xmlChar * array */
36053     int n_str;
36054 
36055     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36056         mem_base = xmlMemBlocks();
36057         str = gen_const_xmlChar_ptr(n_str, 0);
36058 
36059         ret_val = xmlStrlen((const xmlChar *)str);
36060         desret_int(ret_val);
36061         call_tests++;
36062         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36063         xmlResetLastError();
36064         if (mem_base != xmlMemBlocks()) {
36065             printf("Leak of %d blocks found in xmlStrlen",
36066 	           xmlMemBlocks() - mem_base);
36067 	    test_ret++;
36068             printf(" %d", n_str);
36069             printf("\n");
36070         }
36071     }
36072     function_tests++;
36073 
36074     return(test_ret);
36075 }
36076 
36077 
36078 static int
test_xmlStrncasecmp(void)36079 test_xmlStrncasecmp(void) {
36080     int test_ret = 0;
36081 
36082     int mem_base;
36083     int ret_val;
36084     xmlChar * str1; /* the first xmlChar * */
36085     int n_str1;
36086     xmlChar * str2; /* the second xmlChar * */
36087     int n_str2;
36088     int len; /* the max comparison length */
36089     int n_len;
36090 
36091     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36092     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36093     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36094         mem_base = xmlMemBlocks();
36095         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36096         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36097         len = gen_int(n_len, 2);
36098 
36099         ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36100         desret_int(ret_val);
36101         call_tests++;
36102         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36103         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36104         des_int(n_len, len, 2);
36105         xmlResetLastError();
36106         if (mem_base != xmlMemBlocks()) {
36107             printf("Leak of %d blocks found in xmlStrncasecmp",
36108 	           xmlMemBlocks() - mem_base);
36109 	    test_ret++;
36110             printf(" %d", n_str1);
36111             printf(" %d", n_str2);
36112             printf(" %d", n_len);
36113             printf("\n");
36114         }
36115     }
36116     }
36117     }
36118     function_tests++;
36119 
36120     return(test_ret);
36121 }
36122 
36123 
36124 static int
test_xmlStrncatNew(void)36125 test_xmlStrncatNew(void) {
36126     int test_ret = 0;
36127 
36128     int mem_base;
36129     xmlChar * ret_val;
36130     xmlChar * str1; /* first xmlChar string */
36131     int n_str1;
36132     xmlChar * str2; /* second xmlChar string */
36133     int n_str2;
36134     int len; /* the len of @str2 or < 0 */
36135     int n_len;
36136 
36137     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36138     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36139     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36140         mem_base = xmlMemBlocks();
36141         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36142         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36143         len = gen_int(n_len, 2);
36144 
36145         ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36146         desret_xmlChar_ptr(ret_val);
36147         call_tests++;
36148         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36149         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36150         des_int(n_len, len, 2);
36151         xmlResetLastError();
36152         if (mem_base != xmlMemBlocks()) {
36153             printf("Leak of %d blocks found in xmlStrncatNew",
36154 	           xmlMemBlocks() - mem_base);
36155 	    test_ret++;
36156             printf(" %d", n_str1);
36157             printf(" %d", n_str2);
36158             printf(" %d", n_len);
36159             printf("\n");
36160         }
36161     }
36162     }
36163     }
36164     function_tests++;
36165 
36166     return(test_ret);
36167 }
36168 
36169 
36170 static int
test_xmlStrncmp(void)36171 test_xmlStrncmp(void) {
36172     int test_ret = 0;
36173 
36174     int mem_base;
36175     int ret_val;
36176     xmlChar * str1; /* the first xmlChar * */
36177     int n_str1;
36178     xmlChar * str2; /* the second xmlChar * */
36179     int n_str2;
36180     int len; /* the max comparison length */
36181     int n_len;
36182 
36183     for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36184     for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36185     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36186         mem_base = xmlMemBlocks();
36187         str1 = gen_const_xmlChar_ptr(n_str1, 0);
36188         str2 = gen_const_xmlChar_ptr(n_str2, 1);
36189         len = gen_int(n_len, 2);
36190 
36191         ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36192         desret_int(ret_val);
36193         call_tests++;
36194         des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36195         des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36196         des_int(n_len, len, 2);
36197         xmlResetLastError();
36198         if (mem_base != xmlMemBlocks()) {
36199             printf("Leak of %d blocks found in xmlStrncmp",
36200 	           xmlMemBlocks() - mem_base);
36201 	    test_ret++;
36202             printf(" %d", n_str1);
36203             printf(" %d", n_str2);
36204             printf(" %d", n_len);
36205             printf("\n");
36206         }
36207     }
36208     }
36209     }
36210     function_tests++;
36211 
36212     return(test_ret);
36213 }
36214 
36215 
36216 static int
test_xmlStrndup(void)36217 test_xmlStrndup(void) {
36218     int test_ret = 0;
36219 
36220     int mem_base;
36221     xmlChar * ret_val;
36222     xmlChar * cur; /* the input xmlChar * */
36223     int n_cur;
36224     int len; /* the len of @cur */
36225     int n_len;
36226 
36227     for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36228     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36229         mem_base = xmlMemBlocks();
36230         cur = gen_const_xmlChar_ptr(n_cur, 0);
36231         len = gen_int(n_len, 1);
36232 
36233         ret_val = xmlStrndup((const xmlChar *)cur, len);
36234         desret_xmlChar_ptr(ret_val);
36235         call_tests++;
36236         des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36237         des_int(n_len, len, 1);
36238         xmlResetLastError();
36239         if (mem_base != xmlMemBlocks()) {
36240             printf("Leak of %d blocks found in xmlStrndup",
36241 	           xmlMemBlocks() - mem_base);
36242 	    test_ret++;
36243             printf(" %d", n_cur);
36244             printf(" %d", n_len);
36245             printf("\n");
36246         }
36247     }
36248     }
36249     function_tests++;
36250 
36251     return(test_ret);
36252 }
36253 
36254 
36255 static int
test_xmlStrstr(void)36256 test_xmlStrstr(void) {
36257     int test_ret = 0;
36258 
36259     int mem_base;
36260     const xmlChar * ret_val;
36261     xmlChar * str; /* the xmlChar * array (haystack) */
36262     int n_str;
36263     xmlChar * val; /* the xmlChar to search (needle) */
36264     int n_val;
36265 
36266     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36267     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36268         mem_base = xmlMemBlocks();
36269         str = gen_const_xmlChar_ptr(n_str, 0);
36270         val = gen_const_xmlChar_ptr(n_val, 1);
36271 
36272         ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36273         desret_const_xmlChar_ptr(ret_val);
36274         call_tests++;
36275         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36276         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36277         xmlResetLastError();
36278         if (mem_base != xmlMemBlocks()) {
36279             printf("Leak of %d blocks found in xmlStrstr",
36280 	           xmlMemBlocks() - mem_base);
36281 	    test_ret++;
36282             printf(" %d", n_str);
36283             printf(" %d", n_val);
36284             printf("\n");
36285         }
36286     }
36287     }
36288     function_tests++;
36289 
36290     return(test_ret);
36291 }
36292 
36293 
36294 static int
test_xmlStrsub(void)36295 test_xmlStrsub(void) {
36296     int test_ret = 0;
36297 
36298     int mem_base;
36299     xmlChar * ret_val;
36300     xmlChar * str; /* the xmlChar * array (haystack) */
36301     int n_str;
36302     int start; /* the index of the first char (zero based) */
36303     int n_start;
36304     int len; /* the length of the substring */
36305     int n_len;
36306 
36307     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36308     for (n_start = 0;n_start < gen_nb_int;n_start++) {
36309     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36310         mem_base = xmlMemBlocks();
36311         str = gen_const_xmlChar_ptr(n_str, 0);
36312         start = gen_int(n_start, 1);
36313         len = gen_int(n_len, 2);
36314 
36315         ret_val = xmlStrsub((const xmlChar *)str, start, len);
36316         desret_xmlChar_ptr(ret_val);
36317         call_tests++;
36318         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36319         des_int(n_start, start, 1);
36320         des_int(n_len, len, 2);
36321         xmlResetLastError();
36322         if (mem_base != xmlMemBlocks()) {
36323             printf("Leak of %d blocks found in xmlStrsub",
36324 	           xmlMemBlocks() - mem_base);
36325 	    test_ret++;
36326             printf(" %d", n_str);
36327             printf(" %d", n_start);
36328             printf(" %d", n_len);
36329             printf("\n");
36330         }
36331     }
36332     }
36333     }
36334     function_tests++;
36335 
36336     return(test_ret);
36337 }
36338 
36339 
36340 static int
test_xmlUTF8Charcmp(void)36341 test_xmlUTF8Charcmp(void) {
36342     int test_ret = 0;
36343 
36344     int mem_base;
36345     int ret_val;
36346     xmlChar * utf1; /* pointer to first UTF8 char */
36347     int n_utf1;
36348     xmlChar * utf2; /* pointer to second UTF8 char */
36349     int n_utf2;
36350 
36351     for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36352     for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36353         mem_base = xmlMemBlocks();
36354         utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36355         utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36356 
36357         ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36358         desret_int(ret_val);
36359         call_tests++;
36360         des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36361         des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36362         xmlResetLastError();
36363         if (mem_base != xmlMemBlocks()) {
36364             printf("Leak of %d blocks found in xmlUTF8Charcmp",
36365 	           xmlMemBlocks() - mem_base);
36366 	    test_ret++;
36367             printf(" %d", n_utf1);
36368             printf(" %d", n_utf2);
36369             printf("\n");
36370         }
36371     }
36372     }
36373     function_tests++;
36374 
36375     return(test_ret);
36376 }
36377 
36378 
36379 static int
test_xmlUTF8Size(void)36380 test_xmlUTF8Size(void) {
36381     int test_ret = 0;
36382 
36383     int mem_base;
36384     int ret_val;
36385     xmlChar * utf; /* pointer to the UTF8 character */
36386     int n_utf;
36387 
36388     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36389         mem_base = xmlMemBlocks();
36390         utf = gen_const_xmlChar_ptr(n_utf, 0);
36391 
36392         ret_val = xmlUTF8Size((const xmlChar *)utf);
36393         desret_int(ret_val);
36394         call_tests++;
36395         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36396         xmlResetLastError();
36397         if (mem_base != xmlMemBlocks()) {
36398             printf("Leak of %d blocks found in xmlUTF8Size",
36399 	           xmlMemBlocks() - mem_base);
36400 	    test_ret++;
36401             printf(" %d", n_utf);
36402             printf("\n");
36403         }
36404     }
36405     function_tests++;
36406 
36407     return(test_ret);
36408 }
36409 
36410 
36411 static int
test_xmlUTF8Strlen(void)36412 test_xmlUTF8Strlen(void) {
36413     int test_ret = 0;
36414 
36415     int mem_base;
36416     int ret_val;
36417     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36418     int n_utf;
36419 
36420     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36421         mem_base = xmlMemBlocks();
36422         utf = gen_const_xmlChar_ptr(n_utf, 0);
36423 
36424         ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36425         desret_int(ret_val);
36426         call_tests++;
36427         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36428         xmlResetLastError();
36429         if (mem_base != xmlMemBlocks()) {
36430             printf("Leak of %d blocks found in xmlUTF8Strlen",
36431 	           xmlMemBlocks() - mem_base);
36432 	    test_ret++;
36433             printf(" %d", n_utf);
36434             printf("\n");
36435         }
36436     }
36437     function_tests++;
36438 
36439     return(test_ret);
36440 }
36441 
36442 
36443 static int
test_xmlUTF8Strloc(void)36444 test_xmlUTF8Strloc(void) {
36445     int test_ret = 0;
36446 
36447     int mem_base;
36448     int ret_val;
36449     xmlChar * utf; /* the input UTF8 * */
36450     int n_utf;
36451     xmlChar * utfchar; /* the UTF8 character to be found */
36452     int n_utfchar;
36453 
36454     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36455     for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36456         mem_base = xmlMemBlocks();
36457         utf = gen_const_xmlChar_ptr(n_utf, 0);
36458         utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36459 
36460         ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36461         desret_int(ret_val);
36462         call_tests++;
36463         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36464         des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36465         xmlResetLastError();
36466         if (mem_base != xmlMemBlocks()) {
36467             printf("Leak of %d blocks found in xmlUTF8Strloc",
36468 	           xmlMemBlocks() - mem_base);
36469 	    test_ret++;
36470             printf(" %d", n_utf);
36471             printf(" %d", n_utfchar);
36472             printf("\n");
36473         }
36474     }
36475     }
36476     function_tests++;
36477 
36478     return(test_ret);
36479 }
36480 
36481 
36482 static int
test_xmlUTF8Strndup(void)36483 test_xmlUTF8Strndup(void) {
36484     int test_ret = 0;
36485 
36486     int mem_base;
36487     xmlChar * ret_val;
36488     xmlChar * utf; /* the input UTF8 * */
36489     int n_utf;
36490     int len; /* the len of @utf (in chars) */
36491     int n_len;
36492 
36493     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36494     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36495         mem_base = xmlMemBlocks();
36496         utf = gen_const_xmlChar_ptr(n_utf, 0);
36497         len = gen_int(n_len, 1);
36498 
36499         ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36500         desret_xmlChar_ptr(ret_val);
36501         call_tests++;
36502         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36503         des_int(n_len, len, 1);
36504         xmlResetLastError();
36505         if (mem_base != xmlMemBlocks()) {
36506             printf("Leak of %d blocks found in xmlUTF8Strndup",
36507 	           xmlMemBlocks() - mem_base);
36508 	    test_ret++;
36509             printf(" %d", n_utf);
36510             printf(" %d", n_len);
36511             printf("\n");
36512         }
36513     }
36514     }
36515     function_tests++;
36516 
36517     return(test_ret);
36518 }
36519 
36520 
36521 static int
test_xmlUTF8Strpos(void)36522 test_xmlUTF8Strpos(void) {
36523     int test_ret = 0;
36524 
36525     int mem_base;
36526     const xmlChar * ret_val;
36527     xmlChar * utf; /* the input UTF8 * */
36528     int n_utf;
36529     int pos; /* the position of the desired UTF8 char (in chars) */
36530     int n_pos;
36531 
36532     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36533     for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36534         mem_base = xmlMemBlocks();
36535         utf = gen_const_xmlChar_ptr(n_utf, 0);
36536         pos = gen_int(n_pos, 1);
36537 
36538         ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36539         desret_const_xmlChar_ptr(ret_val);
36540         call_tests++;
36541         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36542         des_int(n_pos, pos, 1);
36543         xmlResetLastError();
36544         if (mem_base != xmlMemBlocks()) {
36545             printf("Leak of %d blocks found in xmlUTF8Strpos",
36546 	           xmlMemBlocks() - mem_base);
36547 	    test_ret++;
36548             printf(" %d", n_utf);
36549             printf(" %d", n_pos);
36550             printf("\n");
36551         }
36552     }
36553     }
36554     function_tests++;
36555 
36556     return(test_ret);
36557 }
36558 
36559 
36560 static int
test_xmlUTF8Strsize(void)36561 test_xmlUTF8Strsize(void) {
36562     int test_ret = 0;
36563 
36564     int mem_base;
36565     int ret_val;
36566     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36567     int n_utf;
36568     int len; /* the number of characters in the array */
36569     int n_len;
36570 
36571     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36572     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36573         mem_base = xmlMemBlocks();
36574         utf = gen_const_xmlChar_ptr(n_utf, 0);
36575         len = gen_int(n_len, 1);
36576 
36577         ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36578         desret_int(ret_val);
36579         call_tests++;
36580         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36581         des_int(n_len, len, 1);
36582         xmlResetLastError();
36583         if (mem_base != xmlMemBlocks()) {
36584             printf("Leak of %d blocks found in xmlUTF8Strsize",
36585 	           xmlMemBlocks() - mem_base);
36586 	    test_ret++;
36587             printf(" %d", n_utf);
36588             printf(" %d", n_len);
36589             printf("\n");
36590         }
36591     }
36592     }
36593     function_tests++;
36594 
36595     return(test_ret);
36596 }
36597 
36598 
36599 static int
test_xmlUTF8Strsub(void)36600 test_xmlUTF8Strsub(void) {
36601     int test_ret = 0;
36602 
36603     int mem_base;
36604     xmlChar * ret_val;
36605     xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36606     int n_utf;
36607     int start; /* relative pos of first char */
36608     int n_start;
36609     int len; /* total number to copy */
36610     int n_len;
36611 
36612     for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36613     for (n_start = 0;n_start < gen_nb_int;n_start++) {
36614     for (n_len = 0;n_len < gen_nb_int;n_len++) {
36615         mem_base = xmlMemBlocks();
36616         utf = gen_const_xmlChar_ptr(n_utf, 0);
36617         start = gen_int(n_start, 1);
36618         len = gen_int(n_len, 2);
36619 
36620         ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36621         desret_xmlChar_ptr(ret_val);
36622         call_tests++;
36623         des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36624         des_int(n_start, start, 1);
36625         des_int(n_len, len, 2);
36626         xmlResetLastError();
36627         if (mem_base != xmlMemBlocks()) {
36628             printf("Leak of %d blocks found in xmlUTF8Strsub",
36629 	           xmlMemBlocks() - mem_base);
36630 	    test_ret++;
36631             printf(" %d", n_utf);
36632             printf(" %d", n_start);
36633             printf(" %d", n_len);
36634             printf("\n");
36635         }
36636     }
36637     }
36638     }
36639     function_tests++;
36640 
36641     return(test_ret);
36642 }
36643 
36644 static int
test_xmlstring(void)36645 test_xmlstring(void) {
36646     int test_ret = 0;
36647 
36648     if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36649     test_ret += test_xmlCharStrdup();
36650     test_ret += test_xmlCharStrndup();
36651     test_ret += test_xmlCheckUTF8();
36652     test_ret += test_xmlGetUTF8Char();
36653     test_ret += test_xmlStrEqual();
36654     test_ret += test_xmlStrPrintf();
36655     test_ret += test_xmlStrQEqual();
36656     test_ret += test_xmlStrVPrintf();
36657     test_ret += test_xmlStrcasecmp();
36658     test_ret += test_xmlStrcasestr();
36659     test_ret += test_xmlStrchr();
36660     test_ret += test_xmlStrcmp();
36661     test_ret += test_xmlStrdup();
36662     test_ret += test_xmlStrlen();
36663     test_ret += test_xmlStrncasecmp();
36664     test_ret += test_xmlStrncatNew();
36665     test_ret += test_xmlStrncmp();
36666     test_ret += test_xmlStrndup();
36667     test_ret += test_xmlStrstr();
36668     test_ret += test_xmlStrsub();
36669     test_ret += test_xmlUTF8Charcmp();
36670     test_ret += test_xmlUTF8Size();
36671     test_ret += test_xmlUTF8Strlen();
36672     test_ret += test_xmlUTF8Strloc();
36673     test_ret += test_xmlUTF8Strndup();
36674     test_ret += test_xmlUTF8Strpos();
36675     test_ret += test_xmlUTF8Strsize();
36676     test_ret += test_xmlUTF8Strsub();
36677 
36678     if (test_ret != 0)
36679 	printf("Module xmlstring: %d errors\n", test_ret);
36680     return(test_ret);
36681 }
36682 
36683 static int
test_xmlUCSIsAegeanNumbers(void)36684 test_xmlUCSIsAegeanNumbers(void) {
36685     int test_ret = 0;
36686 
36687 #if defined(LIBXML_UNICODE_ENABLED)
36688     int mem_base;
36689     int ret_val;
36690     int code; /* UCS code point */
36691     int n_code;
36692 
36693     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36694         mem_base = xmlMemBlocks();
36695         code = gen_int(n_code, 0);
36696 
36697         ret_val = xmlUCSIsAegeanNumbers(code);
36698         desret_int(ret_val);
36699         call_tests++;
36700         des_int(n_code, code, 0);
36701         xmlResetLastError();
36702         if (mem_base != xmlMemBlocks()) {
36703             printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36704 	           xmlMemBlocks() - mem_base);
36705 	    test_ret++;
36706             printf(" %d", n_code);
36707             printf("\n");
36708         }
36709     }
36710     function_tests++;
36711 #endif
36712 
36713     return(test_ret);
36714 }
36715 
36716 
36717 static int
test_xmlUCSIsAlphabeticPresentationForms(void)36718 test_xmlUCSIsAlphabeticPresentationForms(void) {
36719     int test_ret = 0;
36720 
36721 #if defined(LIBXML_UNICODE_ENABLED)
36722     int mem_base;
36723     int ret_val;
36724     int code; /* UCS code point */
36725     int n_code;
36726 
36727     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36728         mem_base = xmlMemBlocks();
36729         code = gen_int(n_code, 0);
36730 
36731         ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36732         desret_int(ret_val);
36733         call_tests++;
36734         des_int(n_code, code, 0);
36735         xmlResetLastError();
36736         if (mem_base != xmlMemBlocks()) {
36737             printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36738 	           xmlMemBlocks() - mem_base);
36739 	    test_ret++;
36740             printf(" %d", n_code);
36741             printf("\n");
36742         }
36743     }
36744     function_tests++;
36745 #endif
36746 
36747     return(test_ret);
36748 }
36749 
36750 
36751 static int
test_xmlUCSIsArabic(void)36752 test_xmlUCSIsArabic(void) {
36753     int test_ret = 0;
36754 
36755 #if defined(LIBXML_UNICODE_ENABLED)
36756     int mem_base;
36757     int ret_val;
36758     int code; /* UCS code point */
36759     int n_code;
36760 
36761     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36762         mem_base = xmlMemBlocks();
36763         code = gen_int(n_code, 0);
36764 
36765         ret_val = xmlUCSIsArabic(code);
36766         desret_int(ret_val);
36767         call_tests++;
36768         des_int(n_code, code, 0);
36769         xmlResetLastError();
36770         if (mem_base != xmlMemBlocks()) {
36771             printf("Leak of %d blocks found in xmlUCSIsArabic",
36772 	           xmlMemBlocks() - mem_base);
36773 	    test_ret++;
36774             printf(" %d", n_code);
36775             printf("\n");
36776         }
36777     }
36778     function_tests++;
36779 #endif
36780 
36781     return(test_ret);
36782 }
36783 
36784 
36785 static int
test_xmlUCSIsArabicPresentationFormsA(void)36786 test_xmlUCSIsArabicPresentationFormsA(void) {
36787     int test_ret = 0;
36788 
36789 #if defined(LIBXML_UNICODE_ENABLED)
36790     int mem_base;
36791     int ret_val;
36792     int code; /* UCS code point */
36793     int n_code;
36794 
36795     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36796         mem_base = xmlMemBlocks();
36797         code = gen_int(n_code, 0);
36798 
36799         ret_val = xmlUCSIsArabicPresentationFormsA(code);
36800         desret_int(ret_val);
36801         call_tests++;
36802         des_int(n_code, code, 0);
36803         xmlResetLastError();
36804         if (mem_base != xmlMemBlocks()) {
36805             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36806 	           xmlMemBlocks() - mem_base);
36807 	    test_ret++;
36808             printf(" %d", n_code);
36809             printf("\n");
36810         }
36811     }
36812     function_tests++;
36813 #endif
36814 
36815     return(test_ret);
36816 }
36817 
36818 
36819 static int
test_xmlUCSIsArabicPresentationFormsB(void)36820 test_xmlUCSIsArabicPresentationFormsB(void) {
36821     int test_ret = 0;
36822 
36823 #if defined(LIBXML_UNICODE_ENABLED)
36824     int mem_base;
36825     int ret_val;
36826     int code; /* UCS code point */
36827     int n_code;
36828 
36829     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36830         mem_base = xmlMemBlocks();
36831         code = gen_int(n_code, 0);
36832 
36833         ret_val = xmlUCSIsArabicPresentationFormsB(code);
36834         desret_int(ret_val);
36835         call_tests++;
36836         des_int(n_code, code, 0);
36837         xmlResetLastError();
36838         if (mem_base != xmlMemBlocks()) {
36839             printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36840 	           xmlMemBlocks() - mem_base);
36841 	    test_ret++;
36842             printf(" %d", n_code);
36843             printf("\n");
36844         }
36845     }
36846     function_tests++;
36847 #endif
36848 
36849     return(test_ret);
36850 }
36851 
36852 
36853 static int
test_xmlUCSIsArmenian(void)36854 test_xmlUCSIsArmenian(void) {
36855     int test_ret = 0;
36856 
36857 #if defined(LIBXML_UNICODE_ENABLED)
36858     int mem_base;
36859     int ret_val;
36860     int code; /* UCS code point */
36861     int n_code;
36862 
36863     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36864         mem_base = xmlMemBlocks();
36865         code = gen_int(n_code, 0);
36866 
36867         ret_val = xmlUCSIsArmenian(code);
36868         desret_int(ret_val);
36869         call_tests++;
36870         des_int(n_code, code, 0);
36871         xmlResetLastError();
36872         if (mem_base != xmlMemBlocks()) {
36873             printf("Leak of %d blocks found in xmlUCSIsArmenian",
36874 	           xmlMemBlocks() - mem_base);
36875 	    test_ret++;
36876             printf(" %d", n_code);
36877             printf("\n");
36878         }
36879     }
36880     function_tests++;
36881 #endif
36882 
36883     return(test_ret);
36884 }
36885 
36886 
36887 static int
test_xmlUCSIsArrows(void)36888 test_xmlUCSIsArrows(void) {
36889     int test_ret = 0;
36890 
36891 #if defined(LIBXML_UNICODE_ENABLED)
36892     int mem_base;
36893     int ret_val;
36894     int code; /* UCS code point */
36895     int n_code;
36896 
36897     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36898         mem_base = xmlMemBlocks();
36899         code = gen_int(n_code, 0);
36900 
36901         ret_val = xmlUCSIsArrows(code);
36902         desret_int(ret_val);
36903         call_tests++;
36904         des_int(n_code, code, 0);
36905         xmlResetLastError();
36906         if (mem_base != xmlMemBlocks()) {
36907             printf("Leak of %d blocks found in xmlUCSIsArrows",
36908 	           xmlMemBlocks() - mem_base);
36909 	    test_ret++;
36910             printf(" %d", n_code);
36911             printf("\n");
36912         }
36913     }
36914     function_tests++;
36915 #endif
36916 
36917     return(test_ret);
36918 }
36919 
36920 
36921 static int
test_xmlUCSIsBasicLatin(void)36922 test_xmlUCSIsBasicLatin(void) {
36923     int test_ret = 0;
36924 
36925 #if defined(LIBXML_UNICODE_ENABLED)
36926     int mem_base;
36927     int ret_val;
36928     int code; /* UCS code point */
36929     int n_code;
36930 
36931     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36932         mem_base = xmlMemBlocks();
36933         code = gen_int(n_code, 0);
36934 
36935         ret_val = xmlUCSIsBasicLatin(code);
36936         desret_int(ret_val);
36937         call_tests++;
36938         des_int(n_code, code, 0);
36939         xmlResetLastError();
36940         if (mem_base != xmlMemBlocks()) {
36941             printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
36942 	           xmlMemBlocks() - mem_base);
36943 	    test_ret++;
36944             printf(" %d", n_code);
36945             printf("\n");
36946         }
36947     }
36948     function_tests++;
36949 #endif
36950 
36951     return(test_ret);
36952 }
36953 
36954 
36955 static int
test_xmlUCSIsBengali(void)36956 test_xmlUCSIsBengali(void) {
36957     int test_ret = 0;
36958 
36959 #if defined(LIBXML_UNICODE_ENABLED)
36960     int mem_base;
36961     int ret_val;
36962     int code; /* UCS code point */
36963     int n_code;
36964 
36965     for (n_code = 0;n_code < gen_nb_int;n_code++) {
36966         mem_base = xmlMemBlocks();
36967         code = gen_int(n_code, 0);
36968 
36969         ret_val = xmlUCSIsBengali(code);
36970         desret_int(ret_val);
36971         call_tests++;
36972         des_int(n_code, code, 0);
36973         xmlResetLastError();
36974         if (mem_base != xmlMemBlocks()) {
36975             printf("Leak of %d blocks found in xmlUCSIsBengali",
36976 	           xmlMemBlocks() - mem_base);
36977 	    test_ret++;
36978             printf(" %d", n_code);
36979             printf("\n");
36980         }
36981     }
36982     function_tests++;
36983 #endif
36984 
36985     return(test_ret);
36986 }
36987 
36988 
36989 static int
test_xmlUCSIsBlock(void)36990 test_xmlUCSIsBlock(void) {
36991     int test_ret = 0;
36992 
36993 #if defined(LIBXML_UNICODE_ENABLED)
36994     int mem_base;
36995     int ret_val;
36996     int code; /* UCS code point */
36997     int n_code;
36998     char * block; /* UCS block name */
36999     int n_block;
37000 
37001     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37002     for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37003         mem_base = xmlMemBlocks();
37004         code = gen_int(n_code, 0);
37005         block = gen_const_char_ptr(n_block, 1);
37006 
37007         ret_val = xmlUCSIsBlock(code, (const char *)block);
37008         desret_int(ret_val);
37009         call_tests++;
37010         des_int(n_code, code, 0);
37011         des_const_char_ptr(n_block, (const char *)block, 1);
37012         xmlResetLastError();
37013         if (mem_base != xmlMemBlocks()) {
37014             printf("Leak of %d blocks found in xmlUCSIsBlock",
37015 	           xmlMemBlocks() - mem_base);
37016 	    test_ret++;
37017             printf(" %d", n_code);
37018             printf(" %d", n_block);
37019             printf("\n");
37020         }
37021     }
37022     }
37023     function_tests++;
37024 #endif
37025 
37026     return(test_ret);
37027 }
37028 
37029 
37030 static int
test_xmlUCSIsBlockElements(void)37031 test_xmlUCSIsBlockElements(void) {
37032     int test_ret = 0;
37033 
37034 #if defined(LIBXML_UNICODE_ENABLED)
37035     int mem_base;
37036     int ret_val;
37037     int code; /* UCS code point */
37038     int n_code;
37039 
37040     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37041         mem_base = xmlMemBlocks();
37042         code = gen_int(n_code, 0);
37043 
37044         ret_val = xmlUCSIsBlockElements(code);
37045         desret_int(ret_val);
37046         call_tests++;
37047         des_int(n_code, code, 0);
37048         xmlResetLastError();
37049         if (mem_base != xmlMemBlocks()) {
37050             printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37051 	           xmlMemBlocks() - mem_base);
37052 	    test_ret++;
37053             printf(" %d", n_code);
37054             printf("\n");
37055         }
37056     }
37057     function_tests++;
37058 #endif
37059 
37060     return(test_ret);
37061 }
37062 
37063 
37064 static int
test_xmlUCSIsBopomofo(void)37065 test_xmlUCSIsBopomofo(void) {
37066     int test_ret = 0;
37067 
37068 #if defined(LIBXML_UNICODE_ENABLED)
37069     int mem_base;
37070     int ret_val;
37071     int code; /* UCS code point */
37072     int n_code;
37073 
37074     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37075         mem_base = xmlMemBlocks();
37076         code = gen_int(n_code, 0);
37077 
37078         ret_val = xmlUCSIsBopomofo(code);
37079         desret_int(ret_val);
37080         call_tests++;
37081         des_int(n_code, code, 0);
37082         xmlResetLastError();
37083         if (mem_base != xmlMemBlocks()) {
37084             printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37085 	           xmlMemBlocks() - mem_base);
37086 	    test_ret++;
37087             printf(" %d", n_code);
37088             printf("\n");
37089         }
37090     }
37091     function_tests++;
37092 #endif
37093 
37094     return(test_ret);
37095 }
37096 
37097 
37098 static int
test_xmlUCSIsBopomofoExtended(void)37099 test_xmlUCSIsBopomofoExtended(void) {
37100     int test_ret = 0;
37101 
37102 #if defined(LIBXML_UNICODE_ENABLED)
37103     int mem_base;
37104     int ret_val;
37105     int code; /* UCS code point */
37106     int n_code;
37107 
37108     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37109         mem_base = xmlMemBlocks();
37110         code = gen_int(n_code, 0);
37111 
37112         ret_val = xmlUCSIsBopomofoExtended(code);
37113         desret_int(ret_val);
37114         call_tests++;
37115         des_int(n_code, code, 0);
37116         xmlResetLastError();
37117         if (mem_base != xmlMemBlocks()) {
37118             printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37119 	           xmlMemBlocks() - mem_base);
37120 	    test_ret++;
37121             printf(" %d", n_code);
37122             printf("\n");
37123         }
37124     }
37125     function_tests++;
37126 #endif
37127 
37128     return(test_ret);
37129 }
37130 
37131 
37132 static int
test_xmlUCSIsBoxDrawing(void)37133 test_xmlUCSIsBoxDrawing(void) {
37134     int test_ret = 0;
37135 
37136 #if defined(LIBXML_UNICODE_ENABLED)
37137     int mem_base;
37138     int ret_val;
37139     int code; /* UCS code point */
37140     int n_code;
37141 
37142     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37143         mem_base = xmlMemBlocks();
37144         code = gen_int(n_code, 0);
37145 
37146         ret_val = xmlUCSIsBoxDrawing(code);
37147         desret_int(ret_val);
37148         call_tests++;
37149         des_int(n_code, code, 0);
37150         xmlResetLastError();
37151         if (mem_base != xmlMemBlocks()) {
37152             printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37153 	           xmlMemBlocks() - mem_base);
37154 	    test_ret++;
37155             printf(" %d", n_code);
37156             printf("\n");
37157         }
37158     }
37159     function_tests++;
37160 #endif
37161 
37162     return(test_ret);
37163 }
37164 
37165 
37166 static int
test_xmlUCSIsBraillePatterns(void)37167 test_xmlUCSIsBraillePatterns(void) {
37168     int test_ret = 0;
37169 
37170 #if defined(LIBXML_UNICODE_ENABLED)
37171     int mem_base;
37172     int ret_val;
37173     int code; /* UCS code point */
37174     int n_code;
37175 
37176     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37177         mem_base = xmlMemBlocks();
37178         code = gen_int(n_code, 0);
37179 
37180         ret_val = xmlUCSIsBraillePatterns(code);
37181         desret_int(ret_val);
37182         call_tests++;
37183         des_int(n_code, code, 0);
37184         xmlResetLastError();
37185         if (mem_base != xmlMemBlocks()) {
37186             printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37187 	           xmlMemBlocks() - mem_base);
37188 	    test_ret++;
37189             printf(" %d", n_code);
37190             printf("\n");
37191         }
37192     }
37193     function_tests++;
37194 #endif
37195 
37196     return(test_ret);
37197 }
37198 
37199 
37200 static int
test_xmlUCSIsBuhid(void)37201 test_xmlUCSIsBuhid(void) {
37202     int test_ret = 0;
37203 
37204 #if defined(LIBXML_UNICODE_ENABLED)
37205     int mem_base;
37206     int ret_val;
37207     int code; /* UCS code point */
37208     int n_code;
37209 
37210     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37211         mem_base = xmlMemBlocks();
37212         code = gen_int(n_code, 0);
37213 
37214         ret_val = xmlUCSIsBuhid(code);
37215         desret_int(ret_val);
37216         call_tests++;
37217         des_int(n_code, code, 0);
37218         xmlResetLastError();
37219         if (mem_base != xmlMemBlocks()) {
37220             printf("Leak of %d blocks found in xmlUCSIsBuhid",
37221 	           xmlMemBlocks() - mem_base);
37222 	    test_ret++;
37223             printf(" %d", n_code);
37224             printf("\n");
37225         }
37226     }
37227     function_tests++;
37228 #endif
37229 
37230     return(test_ret);
37231 }
37232 
37233 
37234 static int
test_xmlUCSIsByzantineMusicalSymbols(void)37235 test_xmlUCSIsByzantineMusicalSymbols(void) {
37236     int test_ret = 0;
37237 
37238 #if defined(LIBXML_UNICODE_ENABLED)
37239     int mem_base;
37240     int ret_val;
37241     int code; /* UCS code point */
37242     int n_code;
37243 
37244     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37245         mem_base = xmlMemBlocks();
37246         code = gen_int(n_code, 0);
37247 
37248         ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37249         desret_int(ret_val);
37250         call_tests++;
37251         des_int(n_code, code, 0);
37252         xmlResetLastError();
37253         if (mem_base != xmlMemBlocks()) {
37254             printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37255 	           xmlMemBlocks() - mem_base);
37256 	    test_ret++;
37257             printf(" %d", n_code);
37258             printf("\n");
37259         }
37260     }
37261     function_tests++;
37262 #endif
37263 
37264     return(test_ret);
37265 }
37266 
37267 
37268 static int
test_xmlUCSIsCJKCompatibility(void)37269 test_xmlUCSIsCJKCompatibility(void) {
37270     int test_ret = 0;
37271 
37272 #if defined(LIBXML_UNICODE_ENABLED)
37273     int mem_base;
37274     int ret_val;
37275     int code; /* UCS code point */
37276     int n_code;
37277 
37278     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37279         mem_base = xmlMemBlocks();
37280         code = gen_int(n_code, 0);
37281 
37282         ret_val = xmlUCSIsCJKCompatibility(code);
37283         desret_int(ret_val);
37284         call_tests++;
37285         des_int(n_code, code, 0);
37286         xmlResetLastError();
37287         if (mem_base != xmlMemBlocks()) {
37288             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37289 	           xmlMemBlocks() - mem_base);
37290 	    test_ret++;
37291             printf(" %d", n_code);
37292             printf("\n");
37293         }
37294     }
37295     function_tests++;
37296 #endif
37297 
37298     return(test_ret);
37299 }
37300 
37301 
37302 static int
test_xmlUCSIsCJKCompatibilityForms(void)37303 test_xmlUCSIsCJKCompatibilityForms(void) {
37304     int test_ret = 0;
37305 
37306 #if defined(LIBXML_UNICODE_ENABLED)
37307     int mem_base;
37308     int ret_val;
37309     int code; /* UCS code point */
37310     int n_code;
37311 
37312     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37313         mem_base = xmlMemBlocks();
37314         code = gen_int(n_code, 0);
37315 
37316         ret_val = xmlUCSIsCJKCompatibilityForms(code);
37317         desret_int(ret_val);
37318         call_tests++;
37319         des_int(n_code, code, 0);
37320         xmlResetLastError();
37321         if (mem_base != xmlMemBlocks()) {
37322             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37323 	           xmlMemBlocks() - mem_base);
37324 	    test_ret++;
37325             printf(" %d", n_code);
37326             printf("\n");
37327         }
37328     }
37329     function_tests++;
37330 #endif
37331 
37332     return(test_ret);
37333 }
37334 
37335 
37336 static int
test_xmlUCSIsCJKCompatibilityIdeographs(void)37337 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37338     int test_ret = 0;
37339 
37340 #if defined(LIBXML_UNICODE_ENABLED)
37341     int mem_base;
37342     int ret_val;
37343     int code; /* UCS code point */
37344     int n_code;
37345 
37346     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37347         mem_base = xmlMemBlocks();
37348         code = gen_int(n_code, 0);
37349 
37350         ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37351         desret_int(ret_val);
37352         call_tests++;
37353         des_int(n_code, code, 0);
37354         xmlResetLastError();
37355         if (mem_base != xmlMemBlocks()) {
37356             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37357 	           xmlMemBlocks() - mem_base);
37358 	    test_ret++;
37359             printf(" %d", n_code);
37360             printf("\n");
37361         }
37362     }
37363     function_tests++;
37364 #endif
37365 
37366     return(test_ret);
37367 }
37368 
37369 
37370 static int
test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void)37371 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37372     int test_ret = 0;
37373 
37374 #if defined(LIBXML_UNICODE_ENABLED)
37375     int mem_base;
37376     int ret_val;
37377     int code; /* UCS code point */
37378     int n_code;
37379 
37380     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37381         mem_base = xmlMemBlocks();
37382         code = gen_int(n_code, 0);
37383 
37384         ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37385         desret_int(ret_val);
37386         call_tests++;
37387         des_int(n_code, code, 0);
37388         xmlResetLastError();
37389         if (mem_base != xmlMemBlocks()) {
37390             printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37391 	           xmlMemBlocks() - mem_base);
37392 	    test_ret++;
37393             printf(" %d", n_code);
37394             printf("\n");
37395         }
37396     }
37397     function_tests++;
37398 #endif
37399 
37400     return(test_ret);
37401 }
37402 
37403 
37404 static int
test_xmlUCSIsCJKRadicalsSupplement(void)37405 test_xmlUCSIsCJKRadicalsSupplement(void) {
37406     int test_ret = 0;
37407 
37408 #if defined(LIBXML_UNICODE_ENABLED)
37409     int mem_base;
37410     int ret_val;
37411     int code; /* UCS code point */
37412     int n_code;
37413 
37414     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37415         mem_base = xmlMemBlocks();
37416         code = gen_int(n_code, 0);
37417 
37418         ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37419         desret_int(ret_val);
37420         call_tests++;
37421         des_int(n_code, code, 0);
37422         xmlResetLastError();
37423         if (mem_base != xmlMemBlocks()) {
37424             printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37425 	           xmlMemBlocks() - mem_base);
37426 	    test_ret++;
37427             printf(" %d", n_code);
37428             printf("\n");
37429         }
37430     }
37431     function_tests++;
37432 #endif
37433 
37434     return(test_ret);
37435 }
37436 
37437 
37438 static int
test_xmlUCSIsCJKSymbolsandPunctuation(void)37439 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37440     int test_ret = 0;
37441 
37442 #if defined(LIBXML_UNICODE_ENABLED)
37443     int mem_base;
37444     int ret_val;
37445     int code; /* UCS code point */
37446     int n_code;
37447 
37448     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37449         mem_base = xmlMemBlocks();
37450         code = gen_int(n_code, 0);
37451 
37452         ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37453         desret_int(ret_val);
37454         call_tests++;
37455         des_int(n_code, code, 0);
37456         xmlResetLastError();
37457         if (mem_base != xmlMemBlocks()) {
37458             printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37459 	           xmlMemBlocks() - mem_base);
37460 	    test_ret++;
37461             printf(" %d", n_code);
37462             printf("\n");
37463         }
37464     }
37465     function_tests++;
37466 #endif
37467 
37468     return(test_ret);
37469 }
37470 
37471 
37472 static int
test_xmlUCSIsCJKUnifiedIdeographs(void)37473 test_xmlUCSIsCJKUnifiedIdeographs(void) {
37474     int test_ret = 0;
37475 
37476 #if defined(LIBXML_UNICODE_ENABLED)
37477     int mem_base;
37478     int ret_val;
37479     int code; /* UCS code point */
37480     int n_code;
37481 
37482     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37483         mem_base = xmlMemBlocks();
37484         code = gen_int(n_code, 0);
37485 
37486         ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37487         desret_int(ret_val);
37488         call_tests++;
37489         des_int(n_code, code, 0);
37490         xmlResetLastError();
37491         if (mem_base != xmlMemBlocks()) {
37492             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37493 	           xmlMemBlocks() - mem_base);
37494 	    test_ret++;
37495             printf(" %d", n_code);
37496             printf("\n");
37497         }
37498     }
37499     function_tests++;
37500 #endif
37501 
37502     return(test_ret);
37503 }
37504 
37505 
37506 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void)37507 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37508     int test_ret = 0;
37509 
37510 #if defined(LIBXML_UNICODE_ENABLED)
37511     int mem_base;
37512     int ret_val;
37513     int code; /* UCS code point */
37514     int n_code;
37515 
37516     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37517         mem_base = xmlMemBlocks();
37518         code = gen_int(n_code, 0);
37519 
37520         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37521         desret_int(ret_val);
37522         call_tests++;
37523         des_int(n_code, code, 0);
37524         xmlResetLastError();
37525         if (mem_base != xmlMemBlocks()) {
37526             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37527 	           xmlMemBlocks() - mem_base);
37528 	    test_ret++;
37529             printf(" %d", n_code);
37530             printf("\n");
37531         }
37532     }
37533     function_tests++;
37534 #endif
37535 
37536     return(test_ret);
37537 }
37538 
37539 
37540 static int
test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void)37541 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37542     int test_ret = 0;
37543 
37544 #if defined(LIBXML_UNICODE_ENABLED)
37545     int mem_base;
37546     int ret_val;
37547     int code; /* UCS code point */
37548     int n_code;
37549 
37550     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37551         mem_base = xmlMemBlocks();
37552         code = gen_int(n_code, 0);
37553 
37554         ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37555         desret_int(ret_val);
37556         call_tests++;
37557         des_int(n_code, code, 0);
37558         xmlResetLastError();
37559         if (mem_base != xmlMemBlocks()) {
37560             printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37561 	           xmlMemBlocks() - mem_base);
37562 	    test_ret++;
37563             printf(" %d", n_code);
37564             printf("\n");
37565         }
37566     }
37567     function_tests++;
37568 #endif
37569 
37570     return(test_ret);
37571 }
37572 
37573 
37574 static int
test_xmlUCSIsCat(void)37575 test_xmlUCSIsCat(void) {
37576     int test_ret = 0;
37577 
37578 #if defined(LIBXML_UNICODE_ENABLED)
37579     int mem_base;
37580     int ret_val;
37581     int code; /* UCS code point */
37582     int n_code;
37583     char * cat; /* UCS Category name */
37584     int n_cat;
37585 
37586     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37587     for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37588         mem_base = xmlMemBlocks();
37589         code = gen_int(n_code, 0);
37590         cat = gen_const_char_ptr(n_cat, 1);
37591 
37592         ret_val = xmlUCSIsCat(code, (const char *)cat);
37593         desret_int(ret_val);
37594         call_tests++;
37595         des_int(n_code, code, 0);
37596         des_const_char_ptr(n_cat, (const char *)cat, 1);
37597         xmlResetLastError();
37598         if (mem_base != xmlMemBlocks()) {
37599             printf("Leak of %d blocks found in xmlUCSIsCat",
37600 	           xmlMemBlocks() - mem_base);
37601 	    test_ret++;
37602             printf(" %d", n_code);
37603             printf(" %d", n_cat);
37604             printf("\n");
37605         }
37606     }
37607     }
37608     function_tests++;
37609 #endif
37610 
37611     return(test_ret);
37612 }
37613 
37614 
37615 static int
test_xmlUCSIsCatC(void)37616 test_xmlUCSIsCatC(void) {
37617     int test_ret = 0;
37618 
37619 #if defined(LIBXML_UNICODE_ENABLED)
37620     int mem_base;
37621     int ret_val;
37622     int code; /* UCS code point */
37623     int n_code;
37624 
37625     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37626         mem_base = xmlMemBlocks();
37627         code = gen_int(n_code, 0);
37628 
37629         ret_val = xmlUCSIsCatC(code);
37630         desret_int(ret_val);
37631         call_tests++;
37632         des_int(n_code, code, 0);
37633         xmlResetLastError();
37634         if (mem_base != xmlMemBlocks()) {
37635             printf("Leak of %d blocks found in xmlUCSIsCatC",
37636 	           xmlMemBlocks() - mem_base);
37637 	    test_ret++;
37638             printf(" %d", n_code);
37639             printf("\n");
37640         }
37641     }
37642     function_tests++;
37643 #endif
37644 
37645     return(test_ret);
37646 }
37647 
37648 
37649 static int
test_xmlUCSIsCatCc(void)37650 test_xmlUCSIsCatCc(void) {
37651     int test_ret = 0;
37652 
37653 #if defined(LIBXML_UNICODE_ENABLED)
37654     int mem_base;
37655     int ret_val;
37656     int code; /* UCS code point */
37657     int n_code;
37658 
37659     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37660         mem_base = xmlMemBlocks();
37661         code = gen_int(n_code, 0);
37662 
37663         ret_val = xmlUCSIsCatCc(code);
37664         desret_int(ret_val);
37665         call_tests++;
37666         des_int(n_code, code, 0);
37667         xmlResetLastError();
37668         if (mem_base != xmlMemBlocks()) {
37669             printf("Leak of %d blocks found in xmlUCSIsCatCc",
37670 	           xmlMemBlocks() - mem_base);
37671 	    test_ret++;
37672             printf(" %d", n_code);
37673             printf("\n");
37674         }
37675     }
37676     function_tests++;
37677 #endif
37678 
37679     return(test_ret);
37680 }
37681 
37682 
37683 static int
test_xmlUCSIsCatCf(void)37684 test_xmlUCSIsCatCf(void) {
37685     int test_ret = 0;
37686 
37687 #if defined(LIBXML_UNICODE_ENABLED)
37688     int mem_base;
37689     int ret_val;
37690     int code; /* UCS code point */
37691     int n_code;
37692 
37693     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37694         mem_base = xmlMemBlocks();
37695         code = gen_int(n_code, 0);
37696 
37697         ret_val = xmlUCSIsCatCf(code);
37698         desret_int(ret_val);
37699         call_tests++;
37700         des_int(n_code, code, 0);
37701         xmlResetLastError();
37702         if (mem_base != xmlMemBlocks()) {
37703             printf("Leak of %d blocks found in xmlUCSIsCatCf",
37704 	           xmlMemBlocks() - mem_base);
37705 	    test_ret++;
37706             printf(" %d", n_code);
37707             printf("\n");
37708         }
37709     }
37710     function_tests++;
37711 #endif
37712 
37713     return(test_ret);
37714 }
37715 
37716 
37717 static int
test_xmlUCSIsCatCo(void)37718 test_xmlUCSIsCatCo(void) {
37719     int test_ret = 0;
37720 
37721 #if defined(LIBXML_UNICODE_ENABLED)
37722     int mem_base;
37723     int ret_val;
37724     int code; /* UCS code point */
37725     int n_code;
37726 
37727     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37728         mem_base = xmlMemBlocks();
37729         code = gen_int(n_code, 0);
37730 
37731         ret_val = xmlUCSIsCatCo(code);
37732         desret_int(ret_val);
37733         call_tests++;
37734         des_int(n_code, code, 0);
37735         xmlResetLastError();
37736         if (mem_base != xmlMemBlocks()) {
37737             printf("Leak of %d blocks found in xmlUCSIsCatCo",
37738 	           xmlMemBlocks() - mem_base);
37739 	    test_ret++;
37740             printf(" %d", n_code);
37741             printf("\n");
37742         }
37743     }
37744     function_tests++;
37745 #endif
37746 
37747     return(test_ret);
37748 }
37749 
37750 
37751 static int
test_xmlUCSIsCatCs(void)37752 test_xmlUCSIsCatCs(void) {
37753     int test_ret = 0;
37754 
37755 #if defined(LIBXML_UNICODE_ENABLED)
37756     int mem_base;
37757     int ret_val;
37758     int code; /* UCS code point */
37759     int n_code;
37760 
37761     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37762         mem_base = xmlMemBlocks();
37763         code = gen_int(n_code, 0);
37764 
37765         ret_val = xmlUCSIsCatCs(code);
37766         desret_int(ret_val);
37767         call_tests++;
37768         des_int(n_code, code, 0);
37769         xmlResetLastError();
37770         if (mem_base != xmlMemBlocks()) {
37771             printf("Leak of %d blocks found in xmlUCSIsCatCs",
37772 	           xmlMemBlocks() - mem_base);
37773 	    test_ret++;
37774             printf(" %d", n_code);
37775             printf("\n");
37776         }
37777     }
37778     function_tests++;
37779 #endif
37780 
37781     return(test_ret);
37782 }
37783 
37784 
37785 static int
test_xmlUCSIsCatL(void)37786 test_xmlUCSIsCatL(void) {
37787     int test_ret = 0;
37788 
37789 #if defined(LIBXML_UNICODE_ENABLED)
37790     int mem_base;
37791     int ret_val;
37792     int code; /* UCS code point */
37793     int n_code;
37794 
37795     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37796         mem_base = xmlMemBlocks();
37797         code = gen_int(n_code, 0);
37798 
37799         ret_val = xmlUCSIsCatL(code);
37800         desret_int(ret_val);
37801         call_tests++;
37802         des_int(n_code, code, 0);
37803         xmlResetLastError();
37804         if (mem_base != xmlMemBlocks()) {
37805             printf("Leak of %d blocks found in xmlUCSIsCatL",
37806 	           xmlMemBlocks() - mem_base);
37807 	    test_ret++;
37808             printf(" %d", n_code);
37809             printf("\n");
37810         }
37811     }
37812     function_tests++;
37813 #endif
37814 
37815     return(test_ret);
37816 }
37817 
37818 
37819 static int
test_xmlUCSIsCatLl(void)37820 test_xmlUCSIsCatLl(void) {
37821     int test_ret = 0;
37822 
37823 #if defined(LIBXML_UNICODE_ENABLED)
37824     int mem_base;
37825     int ret_val;
37826     int code; /* UCS code point */
37827     int n_code;
37828 
37829     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37830         mem_base = xmlMemBlocks();
37831         code = gen_int(n_code, 0);
37832 
37833         ret_val = xmlUCSIsCatLl(code);
37834         desret_int(ret_val);
37835         call_tests++;
37836         des_int(n_code, code, 0);
37837         xmlResetLastError();
37838         if (mem_base != xmlMemBlocks()) {
37839             printf("Leak of %d blocks found in xmlUCSIsCatLl",
37840 	           xmlMemBlocks() - mem_base);
37841 	    test_ret++;
37842             printf(" %d", n_code);
37843             printf("\n");
37844         }
37845     }
37846     function_tests++;
37847 #endif
37848 
37849     return(test_ret);
37850 }
37851 
37852 
37853 static int
test_xmlUCSIsCatLm(void)37854 test_xmlUCSIsCatLm(void) {
37855     int test_ret = 0;
37856 
37857 #if defined(LIBXML_UNICODE_ENABLED)
37858     int mem_base;
37859     int ret_val;
37860     int code; /* UCS code point */
37861     int n_code;
37862 
37863     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37864         mem_base = xmlMemBlocks();
37865         code = gen_int(n_code, 0);
37866 
37867         ret_val = xmlUCSIsCatLm(code);
37868         desret_int(ret_val);
37869         call_tests++;
37870         des_int(n_code, code, 0);
37871         xmlResetLastError();
37872         if (mem_base != xmlMemBlocks()) {
37873             printf("Leak of %d blocks found in xmlUCSIsCatLm",
37874 	           xmlMemBlocks() - mem_base);
37875 	    test_ret++;
37876             printf(" %d", n_code);
37877             printf("\n");
37878         }
37879     }
37880     function_tests++;
37881 #endif
37882 
37883     return(test_ret);
37884 }
37885 
37886 
37887 static int
test_xmlUCSIsCatLo(void)37888 test_xmlUCSIsCatLo(void) {
37889     int test_ret = 0;
37890 
37891 #if defined(LIBXML_UNICODE_ENABLED)
37892     int mem_base;
37893     int ret_val;
37894     int code; /* UCS code point */
37895     int n_code;
37896 
37897     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37898         mem_base = xmlMemBlocks();
37899         code = gen_int(n_code, 0);
37900 
37901         ret_val = xmlUCSIsCatLo(code);
37902         desret_int(ret_val);
37903         call_tests++;
37904         des_int(n_code, code, 0);
37905         xmlResetLastError();
37906         if (mem_base != xmlMemBlocks()) {
37907             printf("Leak of %d blocks found in xmlUCSIsCatLo",
37908 	           xmlMemBlocks() - mem_base);
37909 	    test_ret++;
37910             printf(" %d", n_code);
37911             printf("\n");
37912         }
37913     }
37914     function_tests++;
37915 #endif
37916 
37917     return(test_ret);
37918 }
37919 
37920 
37921 static int
test_xmlUCSIsCatLt(void)37922 test_xmlUCSIsCatLt(void) {
37923     int test_ret = 0;
37924 
37925 #if defined(LIBXML_UNICODE_ENABLED)
37926     int mem_base;
37927     int ret_val;
37928     int code; /* UCS code point */
37929     int n_code;
37930 
37931     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37932         mem_base = xmlMemBlocks();
37933         code = gen_int(n_code, 0);
37934 
37935         ret_val = xmlUCSIsCatLt(code);
37936         desret_int(ret_val);
37937         call_tests++;
37938         des_int(n_code, code, 0);
37939         xmlResetLastError();
37940         if (mem_base != xmlMemBlocks()) {
37941             printf("Leak of %d blocks found in xmlUCSIsCatLt",
37942 	           xmlMemBlocks() - mem_base);
37943 	    test_ret++;
37944             printf(" %d", n_code);
37945             printf("\n");
37946         }
37947     }
37948     function_tests++;
37949 #endif
37950 
37951     return(test_ret);
37952 }
37953 
37954 
37955 static int
test_xmlUCSIsCatLu(void)37956 test_xmlUCSIsCatLu(void) {
37957     int test_ret = 0;
37958 
37959 #if defined(LIBXML_UNICODE_ENABLED)
37960     int mem_base;
37961     int ret_val;
37962     int code; /* UCS code point */
37963     int n_code;
37964 
37965     for (n_code = 0;n_code < gen_nb_int;n_code++) {
37966         mem_base = xmlMemBlocks();
37967         code = gen_int(n_code, 0);
37968 
37969         ret_val = xmlUCSIsCatLu(code);
37970         desret_int(ret_val);
37971         call_tests++;
37972         des_int(n_code, code, 0);
37973         xmlResetLastError();
37974         if (mem_base != xmlMemBlocks()) {
37975             printf("Leak of %d blocks found in xmlUCSIsCatLu",
37976 	           xmlMemBlocks() - mem_base);
37977 	    test_ret++;
37978             printf(" %d", n_code);
37979             printf("\n");
37980         }
37981     }
37982     function_tests++;
37983 #endif
37984 
37985     return(test_ret);
37986 }
37987 
37988 
37989 static int
test_xmlUCSIsCatM(void)37990 test_xmlUCSIsCatM(void) {
37991     int test_ret = 0;
37992 
37993 #if defined(LIBXML_UNICODE_ENABLED)
37994     int mem_base;
37995     int ret_val;
37996     int code; /* UCS code point */
37997     int n_code;
37998 
37999     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38000         mem_base = xmlMemBlocks();
38001         code = gen_int(n_code, 0);
38002 
38003         ret_val = xmlUCSIsCatM(code);
38004         desret_int(ret_val);
38005         call_tests++;
38006         des_int(n_code, code, 0);
38007         xmlResetLastError();
38008         if (mem_base != xmlMemBlocks()) {
38009             printf("Leak of %d blocks found in xmlUCSIsCatM",
38010 	           xmlMemBlocks() - mem_base);
38011 	    test_ret++;
38012             printf(" %d", n_code);
38013             printf("\n");
38014         }
38015     }
38016     function_tests++;
38017 #endif
38018 
38019     return(test_ret);
38020 }
38021 
38022 
38023 static int
test_xmlUCSIsCatMc(void)38024 test_xmlUCSIsCatMc(void) {
38025     int test_ret = 0;
38026 
38027 #if defined(LIBXML_UNICODE_ENABLED)
38028     int mem_base;
38029     int ret_val;
38030     int code; /* UCS code point */
38031     int n_code;
38032 
38033     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38034         mem_base = xmlMemBlocks();
38035         code = gen_int(n_code, 0);
38036 
38037         ret_val = xmlUCSIsCatMc(code);
38038         desret_int(ret_val);
38039         call_tests++;
38040         des_int(n_code, code, 0);
38041         xmlResetLastError();
38042         if (mem_base != xmlMemBlocks()) {
38043             printf("Leak of %d blocks found in xmlUCSIsCatMc",
38044 	           xmlMemBlocks() - mem_base);
38045 	    test_ret++;
38046             printf(" %d", n_code);
38047             printf("\n");
38048         }
38049     }
38050     function_tests++;
38051 #endif
38052 
38053     return(test_ret);
38054 }
38055 
38056 
38057 static int
test_xmlUCSIsCatMe(void)38058 test_xmlUCSIsCatMe(void) {
38059     int test_ret = 0;
38060 
38061 #if defined(LIBXML_UNICODE_ENABLED)
38062     int mem_base;
38063     int ret_val;
38064     int code; /* UCS code point */
38065     int n_code;
38066 
38067     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38068         mem_base = xmlMemBlocks();
38069         code = gen_int(n_code, 0);
38070 
38071         ret_val = xmlUCSIsCatMe(code);
38072         desret_int(ret_val);
38073         call_tests++;
38074         des_int(n_code, code, 0);
38075         xmlResetLastError();
38076         if (mem_base != xmlMemBlocks()) {
38077             printf("Leak of %d blocks found in xmlUCSIsCatMe",
38078 	           xmlMemBlocks() - mem_base);
38079 	    test_ret++;
38080             printf(" %d", n_code);
38081             printf("\n");
38082         }
38083     }
38084     function_tests++;
38085 #endif
38086 
38087     return(test_ret);
38088 }
38089 
38090 
38091 static int
test_xmlUCSIsCatMn(void)38092 test_xmlUCSIsCatMn(void) {
38093     int test_ret = 0;
38094 
38095 #if defined(LIBXML_UNICODE_ENABLED)
38096     int mem_base;
38097     int ret_val;
38098     int code; /* UCS code point */
38099     int n_code;
38100 
38101     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38102         mem_base = xmlMemBlocks();
38103         code = gen_int(n_code, 0);
38104 
38105         ret_val = xmlUCSIsCatMn(code);
38106         desret_int(ret_val);
38107         call_tests++;
38108         des_int(n_code, code, 0);
38109         xmlResetLastError();
38110         if (mem_base != xmlMemBlocks()) {
38111             printf("Leak of %d blocks found in xmlUCSIsCatMn",
38112 	           xmlMemBlocks() - mem_base);
38113 	    test_ret++;
38114             printf(" %d", n_code);
38115             printf("\n");
38116         }
38117     }
38118     function_tests++;
38119 #endif
38120 
38121     return(test_ret);
38122 }
38123 
38124 
38125 static int
test_xmlUCSIsCatN(void)38126 test_xmlUCSIsCatN(void) {
38127     int test_ret = 0;
38128 
38129 #if defined(LIBXML_UNICODE_ENABLED)
38130     int mem_base;
38131     int ret_val;
38132     int code; /* UCS code point */
38133     int n_code;
38134 
38135     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38136         mem_base = xmlMemBlocks();
38137         code = gen_int(n_code, 0);
38138 
38139         ret_val = xmlUCSIsCatN(code);
38140         desret_int(ret_val);
38141         call_tests++;
38142         des_int(n_code, code, 0);
38143         xmlResetLastError();
38144         if (mem_base != xmlMemBlocks()) {
38145             printf("Leak of %d blocks found in xmlUCSIsCatN",
38146 	           xmlMemBlocks() - mem_base);
38147 	    test_ret++;
38148             printf(" %d", n_code);
38149             printf("\n");
38150         }
38151     }
38152     function_tests++;
38153 #endif
38154 
38155     return(test_ret);
38156 }
38157 
38158 
38159 static int
test_xmlUCSIsCatNd(void)38160 test_xmlUCSIsCatNd(void) {
38161     int test_ret = 0;
38162 
38163 #if defined(LIBXML_UNICODE_ENABLED)
38164     int mem_base;
38165     int ret_val;
38166     int code; /* UCS code point */
38167     int n_code;
38168 
38169     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38170         mem_base = xmlMemBlocks();
38171         code = gen_int(n_code, 0);
38172 
38173         ret_val = xmlUCSIsCatNd(code);
38174         desret_int(ret_val);
38175         call_tests++;
38176         des_int(n_code, code, 0);
38177         xmlResetLastError();
38178         if (mem_base != xmlMemBlocks()) {
38179             printf("Leak of %d blocks found in xmlUCSIsCatNd",
38180 	           xmlMemBlocks() - mem_base);
38181 	    test_ret++;
38182             printf(" %d", n_code);
38183             printf("\n");
38184         }
38185     }
38186     function_tests++;
38187 #endif
38188 
38189     return(test_ret);
38190 }
38191 
38192 
38193 static int
test_xmlUCSIsCatNl(void)38194 test_xmlUCSIsCatNl(void) {
38195     int test_ret = 0;
38196 
38197 #if defined(LIBXML_UNICODE_ENABLED)
38198     int mem_base;
38199     int ret_val;
38200     int code; /* UCS code point */
38201     int n_code;
38202 
38203     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38204         mem_base = xmlMemBlocks();
38205         code = gen_int(n_code, 0);
38206 
38207         ret_val = xmlUCSIsCatNl(code);
38208         desret_int(ret_val);
38209         call_tests++;
38210         des_int(n_code, code, 0);
38211         xmlResetLastError();
38212         if (mem_base != xmlMemBlocks()) {
38213             printf("Leak of %d blocks found in xmlUCSIsCatNl",
38214 	           xmlMemBlocks() - mem_base);
38215 	    test_ret++;
38216             printf(" %d", n_code);
38217             printf("\n");
38218         }
38219     }
38220     function_tests++;
38221 #endif
38222 
38223     return(test_ret);
38224 }
38225 
38226 
38227 static int
test_xmlUCSIsCatNo(void)38228 test_xmlUCSIsCatNo(void) {
38229     int test_ret = 0;
38230 
38231 #if defined(LIBXML_UNICODE_ENABLED)
38232     int mem_base;
38233     int ret_val;
38234     int code; /* UCS code point */
38235     int n_code;
38236 
38237     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38238         mem_base = xmlMemBlocks();
38239         code = gen_int(n_code, 0);
38240 
38241         ret_val = xmlUCSIsCatNo(code);
38242         desret_int(ret_val);
38243         call_tests++;
38244         des_int(n_code, code, 0);
38245         xmlResetLastError();
38246         if (mem_base != xmlMemBlocks()) {
38247             printf("Leak of %d blocks found in xmlUCSIsCatNo",
38248 	           xmlMemBlocks() - mem_base);
38249 	    test_ret++;
38250             printf(" %d", n_code);
38251             printf("\n");
38252         }
38253     }
38254     function_tests++;
38255 #endif
38256 
38257     return(test_ret);
38258 }
38259 
38260 
38261 static int
test_xmlUCSIsCatP(void)38262 test_xmlUCSIsCatP(void) {
38263     int test_ret = 0;
38264 
38265 #if defined(LIBXML_UNICODE_ENABLED)
38266     int mem_base;
38267     int ret_val;
38268     int code; /* UCS code point */
38269     int n_code;
38270 
38271     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38272         mem_base = xmlMemBlocks();
38273         code = gen_int(n_code, 0);
38274 
38275         ret_val = xmlUCSIsCatP(code);
38276         desret_int(ret_val);
38277         call_tests++;
38278         des_int(n_code, code, 0);
38279         xmlResetLastError();
38280         if (mem_base != xmlMemBlocks()) {
38281             printf("Leak of %d blocks found in xmlUCSIsCatP",
38282 	           xmlMemBlocks() - mem_base);
38283 	    test_ret++;
38284             printf(" %d", n_code);
38285             printf("\n");
38286         }
38287     }
38288     function_tests++;
38289 #endif
38290 
38291     return(test_ret);
38292 }
38293 
38294 
38295 static int
test_xmlUCSIsCatPc(void)38296 test_xmlUCSIsCatPc(void) {
38297     int test_ret = 0;
38298 
38299 #if defined(LIBXML_UNICODE_ENABLED)
38300     int mem_base;
38301     int ret_val;
38302     int code; /* UCS code point */
38303     int n_code;
38304 
38305     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38306         mem_base = xmlMemBlocks();
38307         code = gen_int(n_code, 0);
38308 
38309         ret_val = xmlUCSIsCatPc(code);
38310         desret_int(ret_val);
38311         call_tests++;
38312         des_int(n_code, code, 0);
38313         xmlResetLastError();
38314         if (mem_base != xmlMemBlocks()) {
38315             printf("Leak of %d blocks found in xmlUCSIsCatPc",
38316 	           xmlMemBlocks() - mem_base);
38317 	    test_ret++;
38318             printf(" %d", n_code);
38319             printf("\n");
38320         }
38321     }
38322     function_tests++;
38323 #endif
38324 
38325     return(test_ret);
38326 }
38327 
38328 
38329 static int
test_xmlUCSIsCatPd(void)38330 test_xmlUCSIsCatPd(void) {
38331     int test_ret = 0;
38332 
38333 #if defined(LIBXML_UNICODE_ENABLED)
38334     int mem_base;
38335     int ret_val;
38336     int code; /* UCS code point */
38337     int n_code;
38338 
38339     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38340         mem_base = xmlMemBlocks();
38341         code = gen_int(n_code, 0);
38342 
38343         ret_val = xmlUCSIsCatPd(code);
38344         desret_int(ret_val);
38345         call_tests++;
38346         des_int(n_code, code, 0);
38347         xmlResetLastError();
38348         if (mem_base != xmlMemBlocks()) {
38349             printf("Leak of %d blocks found in xmlUCSIsCatPd",
38350 	           xmlMemBlocks() - mem_base);
38351 	    test_ret++;
38352             printf(" %d", n_code);
38353             printf("\n");
38354         }
38355     }
38356     function_tests++;
38357 #endif
38358 
38359     return(test_ret);
38360 }
38361 
38362 
38363 static int
test_xmlUCSIsCatPe(void)38364 test_xmlUCSIsCatPe(void) {
38365     int test_ret = 0;
38366 
38367 #if defined(LIBXML_UNICODE_ENABLED)
38368     int mem_base;
38369     int ret_val;
38370     int code; /* UCS code point */
38371     int n_code;
38372 
38373     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38374         mem_base = xmlMemBlocks();
38375         code = gen_int(n_code, 0);
38376 
38377         ret_val = xmlUCSIsCatPe(code);
38378         desret_int(ret_val);
38379         call_tests++;
38380         des_int(n_code, code, 0);
38381         xmlResetLastError();
38382         if (mem_base != xmlMemBlocks()) {
38383             printf("Leak of %d blocks found in xmlUCSIsCatPe",
38384 	           xmlMemBlocks() - mem_base);
38385 	    test_ret++;
38386             printf(" %d", n_code);
38387             printf("\n");
38388         }
38389     }
38390     function_tests++;
38391 #endif
38392 
38393     return(test_ret);
38394 }
38395 
38396 
38397 static int
test_xmlUCSIsCatPf(void)38398 test_xmlUCSIsCatPf(void) {
38399     int test_ret = 0;
38400 
38401 #if defined(LIBXML_UNICODE_ENABLED)
38402     int mem_base;
38403     int ret_val;
38404     int code; /* UCS code point */
38405     int n_code;
38406 
38407     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38408         mem_base = xmlMemBlocks();
38409         code = gen_int(n_code, 0);
38410 
38411         ret_val = xmlUCSIsCatPf(code);
38412         desret_int(ret_val);
38413         call_tests++;
38414         des_int(n_code, code, 0);
38415         xmlResetLastError();
38416         if (mem_base != xmlMemBlocks()) {
38417             printf("Leak of %d blocks found in xmlUCSIsCatPf",
38418 	           xmlMemBlocks() - mem_base);
38419 	    test_ret++;
38420             printf(" %d", n_code);
38421             printf("\n");
38422         }
38423     }
38424     function_tests++;
38425 #endif
38426 
38427     return(test_ret);
38428 }
38429 
38430 
38431 static int
test_xmlUCSIsCatPi(void)38432 test_xmlUCSIsCatPi(void) {
38433     int test_ret = 0;
38434 
38435 #if defined(LIBXML_UNICODE_ENABLED)
38436     int mem_base;
38437     int ret_val;
38438     int code; /* UCS code point */
38439     int n_code;
38440 
38441     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38442         mem_base = xmlMemBlocks();
38443         code = gen_int(n_code, 0);
38444 
38445         ret_val = xmlUCSIsCatPi(code);
38446         desret_int(ret_val);
38447         call_tests++;
38448         des_int(n_code, code, 0);
38449         xmlResetLastError();
38450         if (mem_base != xmlMemBlocks()) {
38451             printf("Leak of %d blocks found in xmlUCSIsCatPi",
38452 	           xmlMemBlocks() - mem_base);
38453 	    test_ret++;
38454             printf(" %d", n_code);
38455             printf("\n");
38456         }
38457     }
38458     function_tests++;
38459 #endif
38460 
38461     return(test_ret);
38462 }
38463 
38464 
38465 static int
test_xmlUCSIsCatPo(void)38466 test_xmlUCSIsCatPo(void) {
38467     int test_ret = 0;
38468 
38469 #if defined(LIBXML_UNICODE_ENABLED)
38470     int mem_base;
38471     int ret_val;
38472     int code; /* UCS code point */
38473     int n_code;
38474 
38475     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38476         mem_base = xmlMemBlocks();
38477         code = gen_int(n_code, 0);
38478 
38479         ret_val = xmlUCSIsCatPo(code);
38480         desret_int(ret_val);
38481         call_tests++;
38482         des_int(n_code, code, 0);
38483         xmlResetLastError();
38484         if (mem_base != xmlMemBlocks()) {
38485             printf("Leak of %d blocks found in xmlUCSIsCatPo",
38486 	           xmlMemBlocks() - mem_base);
38487 	    test_ret++;
38488             printf(" %d", n_code);
38489             printf("\n");
38490         }
38491     }
38492     function_tests++;
38493 #endif
38494 
38495     return(test_ret);
38496 }
38497 
38498 
38499 static int
test_xmlUCSIsCatPs(void)38500 test_xmlUCSIsCatPs(void) {
38501     int test_ret = 0;
38502 
38503 #if defined(LIBXML_UNICODE_ENABLED)
38504     int mem_base;
38505     int ret_val;
38506     int code; /* UCS code point */
38507     int n_code;
38508 
38509     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38510         mem_base = xmlMemBlocks();
38511         code = gen_int(n_code, 0);
38512 
38513         ret_val = xmlUCSIsCatPs(code);
38514         desret_int(ret_val);
38515         call_tests++;
38516         des_int(n_code, code, 0);
38517         xmlResetLastError();
38518         if (mem_base != xmlMemBlocks()) {
38519             printf("Leak of %d blocks found in xmlUCSIsCatPs",
38520 	           xmlMemBlocks() - mem_base);
38521 	    test_ret++;
38522             printf(" %d", n_code);
38523             printf("\n");
38524         }
38525     }
38526     function_tests++;
38527 #endif
38528 
38529     return(test_ret);
38530 }
38531 
38532 
38533 static int
test_xmlUCSIsCatS(void)38534 test_xmlUCSIsCatS(void) {
38535     int test_ret = 0;
38536 
38537 #if defined(LIBXML_UNICODE_ENABLED)
38538     int mem_base;
38539     int ret_val;
38540     int code; /* UCS code point */
38541     int n_code;
38542 
38543     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38544         mem_base = xmlMemBlocks();
38545         code = gen_int(n_code, 0);
38546 
38547         ret_val = xmlUCSIsCatS(code);
38548         desret_int(ret_val);
38549         call_tests++;
38550         des_int(n_code, code, 0);
38551         xmlResetLastError();
38552         if (mem_base != xmlMemBlocks()) {
38553             printf("Leak of %d blocks found in xmlUCSIsCatS",
38554 	           xmlMemBlocks() - mem_base);
38555 	    test_ret++;
38556             printf(" %d", n_code);
38557             printf("\n");
38558         }
38559     }
38560     function_tests++;
38561 #endif
38562 
38563     return(test_ret);
38564 }
38565 
38566 
38567 static int
test_xmlUCSIsCatSc(void)38568 test_xmlUCSIsCatSc(void) {
38569     int test_ret = 0;
38570 
38571 #if defined(LIBXML_UNICODE_ENABLED)
38572     int mem_base;
38573     int ret_val;
38574     int code; /* UCS code point */
38575     int n_code;
38576 
38577     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38578         mem_base = xmlMemBlocks();
38579         code = gen_int(n_code, 0);
38580 
38581         ret_val = xmlUCSIsCatSc(code);
38582         desret_int(ret_val);
38583         call_tests++;
38584         des_int(n_code, code, 0);
38585         xmlResetLastError();
38586         if (mem_base != xmlMemBlocks()) {
38587             printf("Leak of %d blocks found in xmlUCSIsCatSc",
38588 	           xmlMemBlocks() - mem_base);
38589 	    test_ret++;
38590             printf(" %d", n_code);
38591             printf("\n");
38592         }
38593     }
38594     function_tests++;
38595 #endif
38596 
38597     return(test_ret);
38598 }
38599 
38600 
38601 static int
test_xmlUCSIsCatSk(void)38602 test_xmlUCSIsCatSk(void) {
38603     int test_ret = 0;
38604 
38605 #if defined(LIBXML_UNICODE_ENABLED)
38606     int mem_base;
38607     int ret_val;
38608     int code; /* UCS code point */
38609     int n_code;
38610 
38611     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38612         mem_base = xmlMemBlocks();
38613         code = gen_int(n_code, 0);
38614 
38615         ret_val = xmlUCSIsCatSk(code);
38616         desret_int(ret_val);
38617         call_tests++;
38618         des_int(n_code, code, 0);
38619         xmlResetLastError();
38620         if (mem_base != xmlMemBlocks()) {
38621             printf("Leak of %d blocks found in xmlUCSIsCatSk",
38622 	           xmlMemBlocks() - mem_base);
38623 	    test_ret++;
38624             printf(" %d", n_code);
38625             printf("\n");
38626         }
38627     }
38628     function_tests++;
38629 #endif
38630 
38631     return(test_ret);
38632 }
38633 
38634 
38635 static int
test_xmlUCSIsCatSm(void)38636 test_xmlUCSIsCatSm(void) {
38637     int test_ret = 0;
38638 
38639 #if defined(LIBXML_UNICODE_ENABLED)
38640     int mem_base;
38641     int ret_val;
38642     int code; /* UCS code point */
38643     int n_code;
38644 
38645     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38646         mem_base = xmlMemBlocks();
38647         code = gen_int(n_code, 0);
38648 
38649         ret_val = xmlUCSIsCatSm(code);
38650         desret_int(ret_val);
38651         call_tests++;
38652         des_int(n_code, code, 0);
38653         xmlResetLastError();
38654         if (mem_base != xmlMemBlocks()) {
38655             printf("Leak of %d blocks found in xmlUCSIsCatSm",
38656 	           xmlMemBlocks() - mem_base);
38657 	    test_ret++;
38658             printf(" %d", n_code);
38659             printf("\n");
38660         }
38661     }
38662     function_tests++;
38663 #endif
38664 
38665     return(test_ret);
38666 }
38667 
38668 
38669 static int
test_xmlUCSIsCatSo(void)38670 test_xmlUCSIsCatSo(void) {
38671     int test_ret = 0;
38672 
38673 #if defined(LIBXML_UNICODE_ENABLED)
38674     int mem_base;
38675     int ret_val;
38676     int code; /* UCS code point */
38677     int n_code;
38678 
38679     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38680         mem_base = xmlMemBlocks();
38681         code = gen_int(n_code, 0);
38682 
38683         ret_val = xmlUCSIsCatSo(code);
38684         desret_int(ret_val);
38685         call_tests++;
38686         des_int(n_code, code, 0);
38687         xmlResetLastError();
38688         if (mem_base != xmlMemBlocks()) {
38689             printf("Leak of %d blocks found in xmlUCSIsCatSo",
38690 	           xmlMemBlocks() - mem_base);
38691 	    test_ret++;
38692             printf(" %d", n_code);
38693             printf("\n");
38694         }
38695     }
38696     function_tests++;
38697 #endif
38698 
38699     return(test_ret);
38700 }
38701 
38702 
38703 static int
test_xmlUCSIsCatZ(void)38704 test_xmlUCSIsCatZ(void) {
38705     int test_ret = 0;
38706 
38707 #if defined(LIBXML_UNICODE_ENABLED)
38708     int mem_base;
38709     int ret_val;
38710     int code; /* UCS code point */
38711     int n_code;
38712 
38713     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38714         mem_base = xmlMemBlocks();
38715         code = gen_int(n_code, 0);
38716 
38717         ret_val = xmlUCSIsCatZ(code);
38718         desret_int(ret_val);
38719         call_tests++;
38720         des_int(n_code, code, 0);
38721         xmlResetLastError();
38722         if (mem_base != xmlMemBlocks()) {
38723             printf("Leak of %d blocks found in xmlUCSIsCatZ",
38724 	           xmlMemBlocks() - mem_base);
38725 	    test_ret++;
38726             printf(" %d", n_code);
38727             printf("\n");
38728         }
38729     }
38730     function_tests++;
38731 #endif
38732 
38733     return(test_ret);
38734 }
38735 
38736 
38737 static int
test_xmlUCSIsCatZl(void)38738 test_xmlUCSIsCatZl(void) {
38739     int test_ret = 0;
38740 
38741 #if defined(LIBXML_UNICODE_ENABLED)
38742     int mem_base;
38743     int ret_val;
38744     int code; /* UCS code point */
38745     int n_code;
38746 
38747     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38748         mem_base = xmlMemBlocks();
38749         code = gen_int(n_code, 0);
38750 
38751         ret_val = xmlUCSIsCatZl(code);
38752         desret_int(ret_val);
38753         call_tests++;
38754         des_int(n_code, code, 0);
38755         xmlResetLastError();
38756         if (mem_base != xmlMemBlocks()) {
38757             printf("Leak of %d blocks found in xmlUCSIsCatZl",
38758 	           xmlMemBlocks() - mem_base);
38759 	    test_ret++;
38760             printf(" %d", n_code);
38761             printf("\n");
38762         }
38763     }
38764     function_tests++;
38765 #endif
38766 
38767     return(test_ret);
38768 }
38769 
38770 
38771 static int
test_xmlUCSIsCatZp(void)38772 test_xmlUCSIsCatZp(void) {
38773     int test_ret = 0;
38774 
38775 #if defined(LIBXML_UNICODE_ENABLED)
38776     int mem_base;
38777     int ret_val;
38778     int code; /* UCS code point */
38779     int n_code;
38780 
38781     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38782         mem_base = xmlMemBlocks();
38783         code = gen_int(n_code, 0);
38784 
38785         ret_val = xmlUCSIsCatZp(code);
38786         desret_int(ret_val);
38787         call_tests++;
38788         des_int(n_code, code, 0);
38789         xmlResetLastError();
38790         if (mem_base != xmlMemBlocks()) {
38791             printf("Leak of %d blocks found in xmlUCSIsCatZp",
38792 	           xmlMemBlocks() - mem_base);
38793 	    test_ret++;
38794             printf(" %d", n_code);
38795             printf("\n");
38796         }
38797     }
38798     function_tests++;
38799 #endif
38800 
38801     return(test_ret);
38802 }
38803 
38804 
38805 static int
test_xmlUCSIsCatZs(void)38806 test_xmlUCSIsCatZs(void) {
38807     int test_ret = 0;
38808 
38809 #if defined(LIBXML_UNICODE_ENABLED)
38810     int mem_base;
38811     int ret_val;
38812     int code; /* UCS code point */
38813     int n_code;
38814 
38815     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38816         mem_base = xmlMemBlocks();
38817         code = gen_int(n_code, 0);
38818 
38819         ret_val = xmlUCSIsCatZs(code);
38820         desret_int(ret_val);
38821         call_tests++;
38822         des_int(n_code, code, 0);
38823         xmlResetLastError();
38824         if (mem_base != xmlMemBlocks()) {
38825             printf("Leak of %d blocks found in xmlUCSIsCatZs",
38826 	           xmlMemBlocks() - mem_base);
38827 	    test_ret++;
38828             printf(" %d", n_code);
38829             printf("\n");
38830         }
38831     }
38832     function_tests++;
38833 #endif
38834 
38835     return(test_ret);
38836 }
38837 
38838 
38839 static int
test_xmlUCSIsCherokee(void)38840 test_xmlUCSIsCherokee(void) {
38841     int test_ret = 0;
38842 
38843 #if defined(LIBXML_UNICODE_ENABLED)
38844     int mem_base;
38845     int ret_val;
38846     int code; /* UCS code point */
38847     int n_code;
38848 
38849     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38850         mem_base = xmlMemBlocks();
38851         code = gen_int(n_code, 0);
38852 
38853         ret_val = xmlUCSIsCherokee(code);
38854         desret_int(ret_val);
38855         call_tests++;
38856         des_int(n_code, code, 0);
38857         xmlResetLastError();
38858         if (mem_base != xmlMemBlocks()) {
38859             printf("Leak of %d blocks found in xmlUCSIsCherokee",
38860 	           xmlMemBlocks() - mem_base);
38861 	    test_ret++;
38862             printf(" %d", n_code);
38863             printf("\n");
38864         }
38865     }
38866     function_tests++;
38867 #endif
38868 
38869     return(test_ret);
38870 }
38871 
38872 
38873 static int
test_xmlUCSIsCombiningDiacriticalMarks(void)38874 test_xmlUCSIsCombiningDiacriticalMarks(void) {
38875     int test_ret = 0;
38876 
38877 #if defined(LIBXML_UNICODE_ENABLED)
38878     int mem_base;
38879     int ret_val;
38880     int code; /* UCS code point */
38881     int n_code;
38882 
38883     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38884         mem_base = xmlMemBlocks();
38885         code = gen_int(n_code, 0);
38886 
38887         ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
38888         desret_int(ret_val);
38889         call_tests++;
38890         des_int(n_code, code, 0);
38891         xmlResetLastError();
38892         if (mem_base != xmlMemBlocks()) {
38893             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
38894 	           xmlMemBlocks() - mem_base);
38895 	    test_ret++;
38896             printf(" %d", n_code);
38897             printf("\n");
38898         }
38899     }
38900     function_tests++;
38901 #endif
38902 
38903     return(test_ret);
38904 }
38905 
38906 
38907 static int
test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void)38908 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
38909     int test_ret = 0;
38910 
38911 #if defined(LIBXML_UNICODE_ENABLED)
38912     int mem_base;
38913     int ret_val;
38914     int code; /* UCS code point */
38915     int n_code;
38916 
38917     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38918         mem_base = xmlMemBlocks();
38919         code = gen_int(n_code, 0);
38920 
38921         ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
38922         desret_int(ret_val);
38923         call_tests++;
38924         des_int(n_code, code, 0);
38925         xmlResetLastError();
38926         if (mem_base != xmlMemBlocks()) {
38927             printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
38928 	           xmlMemBlocks() - mem_base);
38929 	    test_ret++;
38930             printf(" %d", n_code);
38931             printf("\n");
38932         }
38933     }
38934     function_tests++;
38935 #endif
38936 
38937     return(test_ret);
38938 }
38939 
38940 
38941 static int
test_xmlUCSIsCombiningHalfMarks(void)38942 test_xmlUCSIsCombiningHalfMarks(void) {
38943     int test_ret = 0;
38944 
38945 #if defined(LIBXML_UNICODE_ENABLED)
38946     int mem_base;
38947     int ret_val;
38948     int code; /* UCS code point */
38949     int n_code;
38950 
38951     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38952         mem_base = xmlMemBlocks();
38953         code = gen_int(n_code, 0);
38954 
38955         ret_val = xmlUCSIsCombiningHalfMarks(code);
38956         desret_int(ret_val);
38957         call_tests++;
38958         des_int(n_code, code, 0);
38959         xmlResetLastError();
38960         if (mem_base != xmlMemBlocks()) {
38961             printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
38962 	           xmlMemBlocks() - mem_base);
38963 	    test_ret++;
38964             printf(" %d", n_code);
38965             printf("\n");
38966         }
38967     }
38968     function_tests++;
38969 #endif
38970 
38971     return(test_ret);
38972 }
38973 
38974 
38975 static int
test_xmlUCSIsCombiningMarksforSymbols(void)38976 test_xmlUCSIsCombiningMarksforSymbols(void) {
38977     int test_ret = 0;
38978 
38979 #if defined(LIBXML_UNICODE_ENABLED)
38980     int mem_base;
38981     int ret_val;
38982     int code; /* UCS code point */
38983     int n_code;
38984 
38985     for (n_code = 0;n_code < gen_nb_int;n_code++) {
38986         mem_base = xmlMemBlocks();
38987         code = gen_int(n_code, 0);
38988 
38989         ret_val = xmlUCSIsCombiningMarksforSymbols(code);
38990         desret_int(ret_val);
38991         call_tests++;
38992         des_int(n_code, code, 0);
38993         xmlResetLastError();
38994         if (mem_base != xmlMemBlocks()) {
38995             printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
38996 	           xmlMemBlocks() - mem_base);
38997 	    test_ret++;
38998             printf(" %d", n_code);
38999             printf("\n");
39000         }
39001     }
39002     function_tests++;
39003 #endif
39004 
39005     return(test_ret);
39006 }
39007 
39008 
39009 static int
test_xmlUCSIsControlPictures(void)39010 test_xmlUCSIsControlPictures(void) {
39011     int test_ret = 0;
39012 
39013 #if defined(LIBXML_UNICODE_ENABLED)
39014     int mem_base;
39015     int ret_val;
39016     int code; /* UCS code point */
39017     int n_code;
39018 
39019     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39020         mem_base = xmlMemBlocks();
39021         code = gen_int(n_code, 0);
39022 
39023         ret_val = xmlUCSIsControlPictures(code);
39024         desret_int(ret_val);
39025         call_tests++;
39026         des_int(n_code, code, 0);
39027         xmlResetLastError();
39028         if (mem_base != xmlMemBlocks()) {
39029             printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39030 	           xmlMemBlocks() - mem_base);
39031 	    test_ret++;
39032             printf(" %d", n_code);
39033             printf("\n");
39034         }
39035     }
39036     function_tests++;
39037 #endif
39038 
39039     return(test_ret);
39040 }
39041 
39042 
39043 static int
test_xmlUCSIsCurrencySymbols(void)39044 test_xmlUCSIsCurrencySymbols(void) {
39045     int test_ret = 0;
39046 
39047 #if defined(LIBXML_UNICODE_ENABLED)
39048     int mem_base;
39049     int ret_val;
39050     int code; /* UCS code point */
39051     int n_code;
39052 
39053     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39054         mem_base = xmlMemBlocks();
39055         code = gen_int(n_code, 0);
39056 
39057         ret_val = xmlUCSIsCurrencySymbols(code);
39058         desret_int(ret_val);
39059         call_tests++;
39060         des_int(n_code, code, 0);
39061         xmlResetLastError();
39062         if (mem_base != xmlMemBlocks()) {
39063             printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39064 	           xmlMemBlocks() - mem_base);
39065 	    test_ret++;
39066             printf(" %d", n_code);
39067             printf("\n");
39068         }
39069     }
39070     function_tests++;
39071 #endif
39072 
39073     return(test_ret);
39074 }
39075 
39076 
39077 static int
test_xmlUCSIsCypriotSyllabary(void)39078 test_xmlUCSIsCypriotSyllabary(void) {
39079     int test_ret = 0;
39080 
39081 #if defined(LIBXML_UNICODE_ENABLED)
39082     int mem_base;
39083     int ret_val;
39084     int code; /* UCS code point */
39085     int n_code;
39086 
39087     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39088         mem_base = xmlMemBlocks();
39089         code = gen_int(n_code, 0);
39090 
39091         ret_val = xmlUCSIsCypriotSyllabary(code);
39092         desret_int(ret_val);
39093         call_tests++;
39094         des_int(n_code, code, 0);
39095         xmlResetLastError();
39096         if (mem_base != xmlMemBlocks()) {
39097             printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39098 	           xmlMemBlocks() - mem_base);
39099 	    test_ret++;
39100             printf(" %d", n_code);
39101             printf("\n");
39102         }
39103     }
39104     function_tests++;
39105 #endif
39106 
39107     return(test_ret);
39108 }
39109 
39110 
39111 static int
test_xmlUCSIsCyrillic(void)39112 test_xmlUCSIsCyrillic(void) {
39113     int test_ret = 0;
39114 
39115 #if defined(LIBXML_UNICODE_ENABLED)
39116     int mem_base;
39117     int ret_val;
39118     int code; /* UCS code point */
39119     int n_code;
39120 
39121     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39122         mem_base = xmlMemBlocks();
39123         code = gen_int(n_code, 0);
39124 
39125         ret_val = xmlUCSIsCyrillic(code);
39126         desret_int(ret_val);
39127         call_tests++;
39128         des_int(n_code, code, 0);
39129         xmlResetLastError();
39130         if (mem_base != xmlMemBlocks()) {
39131             printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39132 	           xmlMemBlocks() - mem_base);
39133 	    test_ret++;
39134             printf(" %d", n_code);
39135             printf("\n");
39136         }
39137     }
39138     function_tests++;
39139 #endif
39140 
39141     return(test_ret);
39142 }
39143 
39144 
39145 static int
test_xmlUCSIsCyrillicSupplement(void)39146 test_xmlUCSIsCyrillicSupplement(void) {
39147     int test_ret = 0;
39148 
39149 #if defined(LIBXML_UNICODE_ENABLED)
39150     int mem_base;
39151     int ret_val;
39152     int code; /* UCS code point */
39153     int n_code;
39154 
39155     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39156         mem_base = xmlMemBlocks();
39157         code = gen_int(n_code, 0);
39158 
39159         ret_val = xmlUCSIsCyrillicSupplement(code);
39160         desret_int(ret_val);
39161         call_tests++;
39162         des_int(n_code, code, 0);
39163         xmlResetLastError();
39164         if (mem_base != xmlMemBlocks()) {
39165             printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39166 	           xmlMemBlocks() - mem_base);
39167 	    test_ret++;
39168             printf(" %d", n_code);
39169             printf("\n");
39170         }
39171     }
39172     function_tests++;
39173 #endif
39174 
39175     return(test_ret);
39176 }
39177 
39178 
39179 static int
test_xmlUCSIsDeseret(void)39180 test_xmlUCSIsDeseret(void) {
39181     int test_ret = 0;
39182 
39183 #if defined(LIBXML_UNICODE_ENABLED)
39184     int mem_base;
39185     int ret_val;
39186     int code; /* UCS code point */
39187     int n_code;
39188 
39189     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39190         mem_base = xmlMemBlocks();
39191         code = gen_int(n_code, 0);
39192 
39193         ret_val = xmlUCSIsDeseret(code);
39194         desret_int(ret_val);
39195         call_tests++;
39196         des_int(n_code, code, 0);
39197         xmlResetLastError();
39198         if (mem_base != xmlMemBlocks()) {
39199             printf("Leak of %d blocks found in xmlUCSIsDeseret",
39200 	           xmlMemBlocks() - mem_base);
39201 	    test_ret++;
39202             printf(" %d", n_code);
39203             printf("\n");
39204         }
39205     }
39206     function_tests++;
39207 #endif
39208 
39209     return(test_ret);
39210 }
39211 
39212 
39213 static int
test_xmlUCSIsDevanagari(void)39214 test_xmlUCSIsDevanagari(void) {
39215     int test_ret = 0;
39216 
39217 #if defined(LIBXML_UNICODE_ENABLED)
39218     int mem_base;
39219     int ret_val;
39220     int code; /* UCS code point */
39221     int n_code;
39222 
39223     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39224         mem_base = xmlMemBlocks();
39225         code = gen_int(n_code, 0);
39226 
39227         ret_val = xmlUCSIsDevanagari(code);
39228         desret_int(ret_val);
39229         call_tests++;
39230         des_int(n_code, code, 0);
39231         xmlResetLastError();
39232         if (mem_base != xmlMemBlocks()) {
39233             printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39234 	           xmlMemBlocks() - mem_base);
39235 	    test_ret++;
39236             printf(" %d", n_code);
39237             printf("\n");
39238         }
39239     }
39240     function_tests++;
39241 #endif
39242 
39243     return(test_ret);
39244 }
39245 
39246 
39247 static int
test_xmlUCSIsDingbats(void)39248 test_xmlUCSIsDingbats(void) {
39249     int test_ret = 0;
39250 
39251 #if defined(LIBXML_UNICODE_ENABLED)
39252     int mem_base;
39253     int ret_val;
39254     int code; /* UCS code point */
39255     int n_code;
39256 
39257     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39258         mem_base = xmlMemBlocks();
39259         code = gen_int(n_code, 0);
39260 
39261         ret_val = xmlUCSIsDingbats(code);
39262         desret_int(ret_val);
39263         call_tests++;
39264         des_int(n_code, code, 0);
39265         xmlResetLastError();
39266         if (mem_base != xmlMemBlocks()) {
39267             printf("Leak of %d blocks found in xmlUCSIsDingbats",
39268 	           xmlMemBlocks() - mem_base);
39269 	    test_ret++;
39270             printf(" %d", n_code);
39271             printf("\n");
39272         }
39273     }
39274     function_tests++;
39275 #endif
39276 
39277     return(test_ret);
39278 }
39279 
39280 
39281 static int
test_xmlUCSIsEnclosedAlphanumerics(void)39282 test_xmlUCSIsEnclosedAlphanumerics(void) {
39283     int test_ret = 0;
39284 
39285 #if defined(LIBXML_UNICODE_ENABLED)
39286     int mem_base;
39287     int ret_val;
39288     int code; /* UCS code point */
39289     int n_code;
39290 
39291     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39292         mem_base = xmlMemBlocks();
39293         code = gen_int(n_code, 0);
39294 
39295         ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39296         desret_int(ret_val);
39297         call_tests++;
39298         des_int(n_code, code, 0);
39299         xmlResetLastError();
39300         if (mem_base != xmlMemBlocks()) {
39301             printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39302 	           xmlMemBlocks() - mem_base);
39303 	    test_ret++;
39304             printf(" %d", n_code);
39305             printf("\n");
39306         }
39307     }
39308     function_tests++;
39309 #endif
39310 
39311     return(test_ret);
39312 }
39313 
39314 
39315 static int
test_xmlUCSIsEnclosedCJKLettersandMonths(void)39316 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39317     int test_ret = 0;
39318 
39319 #if defined(LIBXML_UNICODE_ENABLED)
39320     int mem_base;
39321     int ret_val;
39322     int code; /* UCS code point */
39323     int n_code;
39324 
39325     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39326         mem_base = xmlMemBlocks();
39327         code = gen_int(n_code, 0);
39328 
39329         ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39330         desret_int(ret_val);
39331         call_tests++;
39332         des_int(n_code, code, 0);
39333         xmlResetLastError();
39334         if (mem_base != xmlMemBlocks()) {
39335             printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39336 	           xmlMemBlocks() - mem_base);
39337 	    test_ret++;
39338             printf(" %d", n_code);
39339             printf("\n");
39340         }
39341     }
39342     function_tests++;
39343 #endif
39344 
39345     return(test_ret);
39346 }
39347 
39348 
39349 static int
test_xmlUCSIsEthiopic(void)39350 test_xmlUCSIsEthiopic(void) {
39351     int test_ret = 0;
39352 
39353 #if defined(LIBXML_UNICODE_ENABLED)
39354     int mem_base;
39355     int ret_val;
39356     int code; /* UCS code point */
39357     int n_code;
39358 
39359     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39360         mem_base = xmlMemBlocks();
39361         code = gen_int(n_code, 0);
39362 
39363         ret_val = xmlUCSIsEthiopic(code);
39364         desret_int(ret_val);
39365         call_tests++;
39366         des_int(n_code, code, 0);
39367         xmlResetLastError();
39368         if (mem_base != xmlMemBlocks()) {
39369             printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39370 	           xmlMemBlocks() - mem_base);
39371 	    test_ret++;
39372             printf(" %d", n_code);
39373             printf("\n");
39374         }
39375     }
39376     function_tests++;
39377 #endif
39378 
39379     return(test_ret);
39380 }
39381 
39382 
39383 static int
test_xmlUCSIsGeneralPunctuation(void)39384 test_xmlUCSIsGeneralPunctuation(void) {
39385     int test_ret = 0;
39386 
39387 #if defined(LIBXML_UNICODE_ENABLED)
39388     int mem_base;
39389     int ret_val;
39390     int code; /* UCS code point */
39391     int n_code;
39392 
39393     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39394         mem_base = xmlMemBlocks();
39395         code = gen_int(n_code, 0);
39396 
39397         ret_val = xmlUCSIsGeneralPunctuation(code);
39398         desret_int(ret_val);
39399         call_tests++;
39400         des_int(n_code, code, 0);
39401         xmlResetLastError();
39402         if (mem_base != xmlMemBlocks()) {
39403             printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39404 	           xmlMemBlocks() - mem_base);
39405 	    test_ret++;
39406             printf(" %d", n_code);
39407             printf("\n");
39408         }
39409     }
39410     function_tests++;
39411 #endif
39412 
39413     return(test_ret);
39414 }
39415 
39416 
39417 static int
test_xmlUCSIsGeometricShapes(void)39418 test_xmlUCSIsGeometricShapes(void) {
39419     int test_ret = 0;
39420 
39421 #if defined(LIBXML_UNICODE_ENABLED)
39422     int mem_base;
39423     int ret_val;
39424     int code; /* UCS code point */
39425     int n_code;
39426 
39427     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39428         mem_base = xmlMemBlocks();
39429         code = gen_int(n_code, 0);
39430 
39431         ret_val = xmlUCSIsGeometricShapes(code);
39432         desret_int(ret_val);
39433         call_tests++;
39434         des_int(n_code, code, 0);
39435         xmlResetLastError();
39436         if (mem_base != xmlMemBlocks()) {
39437             printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39438 	           xmlMemBlocks() - mem_base);
39439 	    test_ret++;
39440             printf(" %d", n_code);
39441             printf("\n");
39442         }
39443     }
39444     function_tests++;
39445 #endif
39446 
39447     return(test_ret);
39448 }
39449 
39450 
39451 static int
test_xmlUCSIsGeorgian(void)39452 test_xmlUCSIsGeorgian(void) {
39453     int test_ret = 0;
39454 
39455 #if defined(LIBXML_UNICODE_ENABLED)
39456     int mem_base;
39457     int ret_val;
39458     int code; /* UCS code point */
39459     int n_code;
39460 
39461     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39462         mem_base = xmlMemBlocks();
39463         code = gen_int(n_code, 0);
39464 
39465         ret_val = xmlUCSIsGeorgian(code);
39466         desret_int(ret_val);
39467         call_tests++;
39468         des_int(n_code, code, 0);
39469         xmlResetLastError();
39470         if (mem_base != xmlMemBlocks()) {
39471             printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39472 	           xmlMemBlocks() - mem_base);
39473 	    test_ret++;
39474             printf(" %d", n_code);
39475             printf("\n");
39476         }
39477     }
39478     function_tests++;
39479 #endif
39480 
39481     return(test_ret);
39482 }
39483 
39484 
39485 static int
test_xmlUCSIsGothic(void)39486 test_xmlUCSIsGothic(void) {
39487     int test_ret = 0;
39488 
39489 #if defined(LIBXML_UNICODE_ENABLED)
39490     int mem_base;
39491     int ret_val;
39492     int code; /* UCS code point */
39493     int n_code;
39494 
39495     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39496         mem_base = xmlMemBlocks();
39497         code = gen_int(n_code, 0);
39498 
39499         ret_val = xmlUCSIsGothic(code);
39500         desret_int(ret_val);
39501         call_tests++;
39502         des_int(n_code, code, 0);
39503         xmlResetLastError();
39504         if (mem_base != xmlMemBlocks()) {
39505             printf("Leak of %d blocks found in xmlUCSIsGothic",
39506 	           xmlMemBlocks() - mem_base);
39507 	    test_ret++;
39508             printf(" %d", n_code);
39509             printf("\n");
39510         }
39511     }
39512     function_tests++;
39513 #endif
39514 
39515     return(test_ret);
39516 }
39517 
39518 
39519 static int
test_xmlUCSIsGreek(void)39520 test_xmlUCSIsGreek(void) {
39521     int test_ret = 0;
39522 
39523 #if defined(LIBXML_UNICODE_ENABLED)
39524     int mem_base;
39525     int ret_val;
39526     int code; /* UCS code point */
39527     int n_code;
39528 
39529     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39530         mem_base = xmlMemBlocks();
39531         code = gen_int(n_code, 0);
39532 
39533         ret_val = xmlUCSIsGreek(code);
39534         desret_int(ret_val);
39535         call_tests++;
39536         des_int(n_code, code, 0);
39537         xmlResetLastError();
39538         if (mem_base != xmlMemBlocks()) {
39539             printf("Leak of %d blocks found in xmlUCSIsGreek",
39540 	           xmlMemBlocks() - mem_base);
39541 	    test_ret++;
39542             printf(" %d", n_code);
39543             printf("\n");
39544         }
39545     }
39546     function_tests++;
39547 #endif
39548 
39549     return(test_ret);
39550 }
39551 
39552 
39553 static int
test_xmlUCSIsGreekExtended(void)39554 test_xmlUCSIsGreekExtended(void) {
39555     int test_ret = 0;
39556 
39557 #if defined(LIBXML_UNICODE_ENABLED)
39558     int mem_base;
39559     int ret_val;
39560     int code; /* UCS code point */
39561     int n_code;
39562 
39563     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39564         mem_base = xmlMemBlocks();
39565         code = gen_int(n_code, 0);
39566 
39567         ret_val = xmlUCSIsGreekExtended(code);
39568         desret_int(ret_val);
39569         call_tests++;
39570         des_int(n_code, code, 0);
39571         xmlResetLastError();
39572         if (mem_base != xmlMemBlocks()) {
39573             printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39574 	           xmlMemBlocks() - mem_base);
39575 	    test_ret++;
39576             printf(" %d", n_code);
39577             printf("\n");
39578         }
39579     }
39580     function_tests++;
39581 #endif
39582 
39583     return(test_ret);
39584 }
39585 
39586 
39587 static int
test_xmlUCSIsGreekandCoptic(void)39588 test_xmlUCSIsGreekandCoptic(void) {
39589     int test_ret = 0;
39590 
39591 #if defined(LIBXML_UNICODE_ENABLED)
39592     int mem_base;
39593     int ret_val;
39594     int code; /* UCS code point */
39595     int n_code;
39596 
39597     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39598         mem_base = xmlMemBlocks();
39599         code = gen_int(n_code, 0);
39600 
39601         ret_val = xmlUCSIsGreekandCoptic(code);
39602         desret_int(ret_val);
39603         call_tests++;
39604         des_int(n_code, code, 0);
39605         xmlResetLastError();
39606         if (mem_base != xmlMemBlocks()) {
39607             printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39608 	           xmlMemBlocks() - mem_base);
39609 	    test_ret++;
39610             printf(" %d", n_code);
39611             printf("\n");
39612         }
39613     }
39614     function_tests++;
39615 #endif
39616 
39617     return(test_ret);
39618 }
39619 
39620 
39621 static int
test_xmlUCSIsGujarati(void)39622 test_xmlUCSIsGujarati(void) {
39623     int test_ret = 0;
39624 
39625 #if defined(LIBXML_UNICODE_ENABLED)
39626     int mem_base;
39627     int ret_val;
39628     int code; /* UCS code point */
39629     int n_code;
39630 
39631     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39632         mem_base = xmlMemBlocks();
39633         code = gen_int(n_code, 0);
39634 
39635         ret_val = xmlUCSIsGujarati(code);
39636         desret_int(ret_val);
39637         call_tests++;
39638         des_int(n_code, code, 0);
39639         xmlResetLastError();
39640         if (mem_base != xmlMemBlocks()) {
39641             printf("Leak of %d blocks found in xmlUCSIsGujarati",
39642 	           xmlMemBlocks() - mem_base);
39643 	    test_ret++;
39644             printf(" %d", n_code);
39645             printf("\n");
39646         }
39647     }
39648     function_tests++;
39649 #endif
39650 
39651     return(test_ret);
39652 }
39653 
39654 
39655 static int
test_xmlUCSIsGurmukhi(void)39656 test_xmlUCSIsGurmukhi(void) {
39657     int test_ret = 0;
39658 
39659 #if defined(LIBXML_UNICODE_ENABLED)
39660     int mem_base;
39661     int ret_val;
39662     int code; /* UCS code point */
39663     int n_code;
39664 
39665     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39666         mem_base = xmlMemBlocks();
39667         code = gen_int(n_code, 0);
39668 
39669         ret_val = xmlUCSIsGurmukhi(code);
39670         desret_int(ret_val);
39671         call_tests++;
39672         des_int(n_code, code, 0);
39673         xmlResetLastError();
39674         if (mem_base != xmlMemBlocks()) {
39675             printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39676 	           xmlMemBlocks() - mem_base);
39677 	    test_ret++;
39678             printf(" %d", n_code);
39679             printf("\n");
39680         }
39681     }
39682     function_tests++;
39683 #endif
39684 
39685     return(test_ret);
39686 }
39687 
39688 
39689 static int
test_xmlUCSIsHalfwidthandFullwidthForms(void)39690 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39691     int test_ret = 0;
39692 
39693 #if defined(LIBXML_UNICODE_ENABLED)
39694     int mem_base;
39695     int ret_val;
39696     int code; /* UCS code point */
39697     int n_code;
39698 
39699     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39700         mem_base = xmlMemBlocks();
39701         code = gen_int(n_code, 0);
39702 
39703         ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39704         desret_int(ret_val);
39705         call_tests++;
39706         des_int(n_code, code, 0);
39707         xmlResetLastError();
39708         if (mem_base != xmlMemBlocks()) {
39709             printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39710 	           xmlMemBlocks() - mem_base);
39711 	    test_ret++;
39712             printf(" %d", n_code);
39713             printf("\n");
39714         }
39715     }
39716     function_tests++;
39717 #endif
39718 
39719     return(test_ret);
39720 }
39721 
39722 
39723 static int
test_xmlUCSIsHangulCompatibilityJamo(void)39724 test_xmlUCSIsHangulCompatibilityJamo(void) {
39725     int test_ret = 0;
39726 
39727 #if defined(LIBXML_UNICODE_ENABLED)
39728     int mem_base;
39729     int ret_val;
39730     int code; /* UCS code point */
39731     int n_code;
39732 
39733     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39734         mem_base = xmlMemBlocks();
39735         code = gen_int(n_code, 0);
39736 
39737         ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39738         desret_int(ret_val);
39739         call_tests++;
39740         des_int(n_code, code, 0);
39741         xmlResetLastError();
39742         if (mem_base != xmlMemBlocks()) {
39743             printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39744 	           xmlMemBlocks() - mem_base);
39745 	    test_ret++;
39746             printf(" %d", n_code);
39747             printf("\n");
39748         }
39749     }
39750     function_tests++;
39751 #endif
39752 
39753     return(test_ret);
39754 }
39755 
39756 
39757 static int
test_xmlUCSIsHangulJamo(void)39758 test_xmlUCSIsHangulJamo(void) {
39759     int test_ret = 0;
39760 
39761 #if defined(LIBXML_UNICODE_ENABLED)
39762     int mem_base;
39763     int ret_val;
39764     int code; /* UCS code point */
39765     int n_code;
39766 
39767     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39768         mem_base = xmlMemBlocks();
39769         code = gen_int(n_code, 0);
39770 
39771         ret_val = xmlUCSIsHangulJamo(code);
39772         desret_int(ret_val);
39773         call_tests++;
39774         des_int(n_code, code, 0);
39775         xmlResetLastError();
39776         if (mem_base != xmlMemBlocks()) {
39777             printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
39778 	           xmlMemBlocks() - mem_base);
39779 	    test_ret++;
39780             printf(" %d", n_code);
39781             printf("\n");
39782         }
39783     }
39784     function_tests++;
39785 #endif
39786 
39787     return(test_ret);
39788 }
39789 
39790 
39791 static int
test_xmlUCSIsHangulSyllables(void)39792 test_xmlUCSIsHangulSyllables(void) {
39793     int test_ret = 0;
39794 
39795 #if defined(LIBXML_UNICODE_ENABLED)
39796     int mem_base;
39797     int ret_val;
39798     int code; /* UCS code point */
39799     int n_code;
39800 
39801     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39802         mem_base = xmlMemBlocks();
39803         code = gen_int(n_code, 0);
39804 
39805         ret_val = xmlUCSIsHangulSyllables(code);
39806         desret_int(ret_val);
39807         call_tests++;
39808         des_int(n_code, code, 0);
39809         xmlResetLastError();
39810         if (mem_base != xmlMemBlocks()) {
39811             printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
39812 	           xmlMemBlocks() - mem_base);
39813 	    test_ret++;
39814             printf(" %d", n_code);
39815             printf("\n");
39816         }
39817     }
39818     function_tests++;
39819 #endif
39820 
39821     return(test_ret);
39822 }
39823 
39824 
39825 static int
test_xmlUCSIsHanunoo(void)39826 test_xmlUCSIsHanunoo(void) {
39827     int test_ret = 0;
39828 
39829 #if defined(LIBXML_UNICODE_ENABLED)
39830     int mem_base;
39831     int ret_val;
39832     int code; /* UCS code point */
39833     int n_code;
39834 
39835     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39836         mem_base = xmlMemBlocks();
39837         code = gen_int(n_code, 0);
39838 
39839         ret_val = xmlUCSIsHanunoo(code);
39840         desret_int(ret_val);
39841         call_tests++;
39842         des_int(n_code, code, 0);
39843         xmlResetLastError();
39844         if (mem_base != xmlMemBlocks()) {
39845             printf("Leak of %d blocks found in xmlUCSIsHanunoo",
39846 	           xmlMemBlocks() - mem_base);
39847 	    test_ret++;
39848             printf(" %d", n_code);
39849             printf("\n");
39850         }
39851     }
39852     function_tests++;
39853 #endif
39854 
39855     return(test_ret);
39856 }
39857 
39858 
39859 static int
test_xmlUCSIsHebrew(void)39860 test_xmlUCSIsHebrew(void) {
39861     int test_ret = 0;
39862 
39863 #if defined(LIBXML_UNICODE_ENABLED)
39864     int mem_base;
39865     int ret_val;
39866     int code; /* UCS code point */
39867     int n_code;
39868 
39869     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39870         mem_base = xmlMemBlocks();
39871         code = gen_int(n_code, 0);
39872 
39873         ret_val = xmlUCSIsHebrew(code);
39874         desret_int(ret_val);
39875         call_tests++;
39876         des_int(n_code, code, 0);
39877         xmlResetLastError();
39878         if (mem_base != xmlMemBlocks()) {
39879             printf("Leak of %d blocks found in xmlUCSIsHebrew",
39880 	           xmlMemBlocks() - mem_base);
39881 	    test_ret++;
39882             printf(" %d", n_code);
39883             printf("\n");
39884         }
39885     }
39886     function_tests++;
39887 #endif
39888 
39889     return(test_ret);
39890 }
39891 
39892 
39893 static int
test_xmlUCSIsHighPrivateUseSurrogates(void)39894 test_xmlUCSIsHighPrivateUseSurrogates(void) {
39895     int test_ret = 0;
39896 
39897 #if defined(LIBXML_UNICODE_ENABLED)
39898     int mem_base;
39899     int ret_val;
39900     int code; /* UCS code point */
39901     int n_code;
39902 
39903     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39904         mem_base = xmlMemBlocks();
39905         code = gen_int(n_code, 0);
39906 
39907         ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
39908         desret_int(ret_val);
39909         call_tests++;
39910         des_int(n_code, code, 0);
39911         xmlResetLastError();
39912         if (mem_base != xmlMemBlocks()) {
39913             printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
39914 	           xmlMemBlocks() - mem_base);
39915 	    test_ret++;
39916             printf(" %d", n_code);
39917             printf("\n");
39918         }
39919     }
39920     function_tests++;
39921 #endif
39922 
39923     return(test_ret);
39924 }
39925 
39926 
39927 static int
test_xmlUCSIsHighSurrogates(void)39928 test_xmlUCSIsHighSurrogates(void) {
39929     int test_ret = 0;
39930 
39931 #if defined(LIBXML_UNICODE_ENABLED)
39932     int mem_base;
39933     int ret_val;
39934     int code; /* UCS code point */
39935     int n_code;
39936 
39937     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39938         mem_base = xmlMemBlocks();
39939         code = gen_int(n_code, 0);
39940 
39941         ret_val = xmlUCSIsHighSurrogates(code);
39942         desret_int(ret_val);
39943         call_tests++;
39944         des_int(n_code, code, 0);
39945         xmlResetLastError();
39946         if (mem_base != xmlMemBlocks()) {
39947             printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
39948 	           xmlMemBlocks() - mem_base);
39949 	    test_ret++;
39950             printf(" %d", n_code);
39951             printf("\n");
39952         }
39953     }
39954     function_tests++;
39955 #endif
39956 
39957     return(test_ret);
39958 }
39959 
39960 
39961 static int
test_xmlUCSIsHiragana(void)39962 test_xmlUCSIsHiragana(void) {
39963     int test_ret = 0;
39964 
39965 #if defined(LIBXML_UNICODE_ENABLED)
39966     int mem_base;
39967     int ret_val;
39968     int code; /* UCS code point */
39969     int n_code;
39970 
39971     for (n_code = 0;n_code < gen_nb_int;n_code++) {
39972         mem_base = xmlMemBlocks();
39973         code = gen_int(n_code, 0);
39974 
39975         ret_val = xmlUCSIsHiragana(code);
39976         desret_int(ret_val);
39977         call_tests++;
39978         des_int(n_code, code, 0);
39979         xmlResetLastError();
39980         if (mem_base != xmlMemBlocks()) {
39981             printf("Leak of %d blocks found in xmlUCSIsHiragana",
39982 	           xmlMemBlocks() - mem_base);
39983 	    test_ret++;
39984             printf(" %d", n_code);
39985             printf("\n");
39986         }
39987     }
39988     function_tests++;
39989 #endif
39990 
39991     return(test_ret);
39992 }
39993 
39994 
39995 static int
test_xmlUCSIsIPAExtensions(void)39996 test_xmlUCSIsIPAExtensions(void) {
39997     int test_ret = 0;
39998 
39999 #if defined(LIBXML_UNICODE_ENABLED)
40000     int mem_base;
40001     int ret_val;
40002     int code; /* UCS code point */
40003     int n_code;
40004 
40005     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40006         mem_base = xmlMemBlocks();
40007         code = gen_int(n_code, 0);
40008 
40009         ret_val = xmlUCSIsIPAExtensions(code);
40010         desret_int(ret_val);
40011         call_tests++;
40012         des_int(n_code, code, 0);
40013         xmlResetLastError();
40014         if (mem_base != xmlMemBlocks()) {
40015             printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40016 	           xmlMemBlocks() - mem_base);
40017 	    test_ret++;
40018             printf(" %d", n_code);
40019             printf("\n");
40020         }
40021     }
40022     function_tests++;
40023 #endif
40024 
40025     return(test_ret);
40026 }
40027 
40028 
40029 static int
test_xmlUCSIsIdeographicDescriptionCharacters(void)40030 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40031     int test_ret = 0;
40032 
40033 #if defined(LIBXML_UNICODE_ENABLED)
40034     int mem_base;
40035     int ret_val;
40036     int code; /* UCS code point */
40037     int n_code;
40038 
40039     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40040         mem_base = xmlMemBlocks();
40041         code = gen_int(n_code, 0);
40042 
40043         ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40044         desret_int(ret_val);
40045         call_tests++;
40046         des_int(n_code, code, 0);
40047         xmlResetLastError();
40048         if (mem_base != xmlMemBlocks()) {
40049             printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40050 	           xmlMemBlocks() - mem_base);
40051 	    test_ret++;
40052             printf(" %d", n_code);
40053             printf("\n");
40054         }
40055     }
40056     function_tests++;
40057 #endif
40058 
40059     return(test_ret);
40060 }
40061 
40062 
40063 static int
test_xmlUCSIsKanbun(void)40064 test_xmlUCSIsKanbun(void) {
40065     int test_ret = 0;
40066 
40067 #if defined(LIBXML_UNICODE_ENABLED)
40068     int mem_base;
40069     int ret_val;
40070     int code; /* UCS code point */
40071     int n_code;
40072 
40073     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40074         mem_base = xmlMemBlocks();
40075         code = gen_int(n_code, 0);
40076 
40077         ret_val = xmlUCSIsKanbun(code);
40078         desret_int(ret_val);
40079         call_tests++;
40080         des_int(n_code, code, 0);
40081         xmlResetLastError();
40082         if (mem_base != xmlMemBlocks()) {
40083             printf("Leak of %d blocks found in xmlUCSIsKanbun",
40084 	           xmlMemBlocks() - mem_base);
40085 	    test_ret++;
40086             printf(" %d", n_code);
40087             printf("\n");
40088         }
40089     }
40090     function_tests++;
40091 #endif
40092 
40093     return(test_ret);
40094 }
40095 
40096 
40097 static int
test_xmlUCSIsKangxiRadicals(void)40098 test_xmlUCSIsKangxiRadicals(void) {
40099     int test_ret = 0;
40100 
40101 #if defined(LIBXML_UNICODE_ENABLED)
40102     int mem_base;
40103     int ret_val;
40104     int code; /* UCS code point */
40105     int n_code;
40106 
40107     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40108         mem_base = xmlMemBlocks();
40109         code = gen_int(n_code, 0);
40110 
40111         ret_val = xmlUCSIsKangxiRadicals(code);
40112         desret_int(ret_val);
40113         call_tests++;
40114         des_int(n_code, code, 0);
40115         xmlResetLastError();
40116         if (mem_base != xmlMemBlocks()) {
40117             printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40118 	           xmlMemBlocks() - mem_base);
40119 	    test_ret++;
40120             printf(" %d", n_code);
40121             printf("\n");
40122         }
40123     }
40124     function_tests++;
40125 #endif
40126 
40127     return(test_ret);
40128 }
40129 
40130 
40131 static int
test_xmlUCSIsKannada(void)40132 test_xmlUCSIsKannada(void) {
40133     int test_ret = 0;
40134 
40135 #if defined(LIBXML_UNICODE_ENABLED)
40136     int mem_base;
40137     int ret_val;
40138     int code; /* UCS code point */
40139     int n_code;
40140 
40141     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40142         mem_base = xmlMemBlocks();
40143         code = gen_int(n_code, 0);
40144 
40145         ret_val = xmlUCSIsKannada(code);
40146         desret_int(ret_val);
40147         call_tests++;
40148         des_int(n_code, code, 0);
40149         xmlResetLastError();
40150         if (mem_base != xmlMemBlocks()) {
40151             printf("Leak of %d blocks found in xmlUCSIsKannada",
40152 	           xmlMemBlocks() - mem_base);
40153 	    test_ret++;
40154             printf(" %d", n_code);
40155             printf("\n");
40156         }
40157     }
40158     function_tests++;
40159 #endif
40160 
40161     return(test_ret);
40162 }
40163 
40164 
40165 static int
test_xmlUCSIsKatakana(void)40166 test_xmlUCSIsKatakana(void) {
40167     int test_ret = 0;
40168 
40169 #if defined(LIBXML_UNICODE_ENABLED)
40170     int mem_base;
40171     int ret_val;
40172     int code; /* UCS code point */
40173     int n_code;
40174 
40175     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40176         mem_base = xmlMemBlocks();
40177         code = gen_int(n_code, 0);
40178 
40179         ret_val = xmlUCSIsKatakana(code);
40180         desret_int(ret_val);
40181         call_tests++;
40182         des_int(n_code, code, 0);
40183         xmlResetLastError();
40184         if (mem_base != xmlMemBlocks()) {
40185             printf("Leak of %d blocks found in xmlUCSIsKatakana",
40186 	           xmlMemBlocks() - mem_base);
40187 	    test_ret++;
40188             printf(" %d", n_code);
40189             printf("\n");
40190         }
40191     }
40192     function_tests++;
40193 #endif
40194 
40195     return(test_ret);
40196 }
40197 
40198 
40199 static int
test_xmlUCSIsKatakanaPhoneticExtensions(void)40200 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40201     int test_ret = 0;
40202 
40203 #if defined(LIBXML_UNICODE_ENABLED)
40204     int mem_base;
40205     int ret_val;
40206     int code; /* UCS code point */
40207     int n_code;
40208 
40209     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40210         mem_base = xmlMemBlocks();
40211         code = gen_int(n_code, 0);
40212 
40213         ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40214         desret_int(ret_val);
40215         call_tests++;
40216         des_int(n_code, code, 0);
40217         xmlResetLastError();
40218         if (mem_base != xmlMemBlocks()) {
40219             printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40220 	           xmlMemBlocks() - mem_base);
40221 	    test_ret++;
40222             printf(" %d", n_code);
40223             printf("\n");
40224         }
40225     }
40226     function_tests++;
40227 #endif
40228 
40229     return(test_ret);
40230 }
40231 
40232 
40233 static int
test_xmlUCSIsKhmer(void)40234 test_xmlUCSIsKhmer(void) {
40235     int test_ret = 0;
40236 
40237 #if defined(LIBXML_UNICODE_ENABLED)
40238     int mem_base;
40239     int ret_val;
40240     int code; /* UCS code point */
40241     int n_code;
40242 
40243     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40244         mem_base = xmlMemBlocks();
40245         code = gen_int(n_code, 0);
40246 
40247         ret_val = xmlUCSIsKhmer(code);
40248         desret_int(ret_val);
40249         call_tests++;
40250         des_int(n_code, code, 0);
40251         xmlResetLastError();
40252         if (mem_base != xmlMemBlocks()) {
40253             printf("Leak of %d blocks found in xmlUCSIsKhmer",
40254 	           xmlMemBlocks() - mem_base);
40255 	    test_ret++;
40256             printf(" %d", n_code);
40257             printf("\n");
40258         }
40259     }
40260     function_tests++;
40261 #endif
40262 
40263     return(test_ret);
40264 }
40265 
40266 
40267 static int
test_xmlUCSIsKhmerSymbols(void)40268 test_xmlUCSIsKhmerSymbols(void) {
40269     int test_ret = 0;
40270 
40271 #if defined(LIBXML_UNICODE_ENABLED)
40272     int mem_base;
40273     int ret_val;
40274     int code; /* UCS code point */
40275     int n_code;
40276 
40277     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40278         mem_base = xmlMemBlocks();
40279         code = gen_int(n_code, 0);
40280 
40281         ret_val = xmlUCSIsKhmerSymbols(code);
40282         desret_int(ret_val);
40283         call_tests++;
40284         des_int(n_code, code, 0);
40285         xmlResetLastError();
40286         if (mem_base != xmlMemBlocks()) {
40287             printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40288 	           xmlMemBlocks() - mem_base);
40289 	    test_ret++;
40290             printf(" %d", n_code);
40291             printf("\n");
40292         }
40293     }
40294     function_tests++;
40295 #endif
40296 
40297     return(test_ret);
40298 }
40299 
40300 
40301 static int
test_xmlUCSIsLao(void)40302 test_xmlUCSIsLao(void) {
40303     int test_ret = 0;
40304 
40305 #if defined(LIBXML_UNICODE_ENABLED)
40306     int mem_base;
40307     int ret_val;
40308     int code; /* UCS code point */
40309     int n_code;
40310 
40311     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40312         mem_base = xmlMemBlocks();
40313         code = gen_int(n_code, 0);
40314 
40315         ret_val = xmlUCSIsLao(code);
40316         desret_int(ret_val);
40317         call_tests++;
40318         des_int(n_code, code, 0);
40319         xmlResetLastError();
40320         if (mem_base != xmlMemBlocks()) {
40321             printf("Leak of %d blocks found in xmlUCSIsLao",
40322 	           xmlMemBlocks() - mem_base);
40323 	    test_ret++;
40324             printf(" %d", n_code);
40325             printf("\n");
40326         }
40327     }
40328     function_tests++;
40329 #endif
40330 
40331     return(test_ret);
40332 }
40333 
40334 
40335 static int
test_xmlUCSIsLatin1Supplement(void)40336 test_xmlUCSIsLatin1Supplement(void) {
40337     int test_ret = 0;
40338 
40339 #if defined(LIBXML_UNICODE_ENABLED)
40340     int mem_base;
40341     int ret_val;
40342     int code; /* UCS code point */
40343     int n_code;
40344 
40345     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40346         mem_base = xmlMemBlocks();
40347         code = gen_int(n_code, 0);
40348 
40349         ret_val = xmlUCSIsLatin1Supplement(code);
40350         desret_int(ret_val);
40351         call_tests++;
40352         des_int(n_code, code, 0);
40353         xmlResetLastError();
40354         if (mem_base != xmlMemBlocks()) {
40355             printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40356 	           xmlMemBlocks() - mem_base);
40357 	    test_ret++;
40358             printf(" %d", n_code);
40359             printf("\n");
40360         }
40361     }
40362     function_tests++;
40363 #endif
40364 
40365     return(test_ret);
40366 }
40367 
40368 
40369 static int
test_xmlUCSIsLatinExtendedA(void)40370 test_xmlUCSIsLatinExtendedA(void) {
40371     int test_ret = 0;
40372 
40373 #if defined(LIBXML_UNICODE_ENABLED)
40374     int mem_base;
40375     int ret_val;
40376     int code; /* UCS code point */
40377     int n_code;
40378 
40379     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40380         mem_base = xmlMemBlocks();
40381         code = gen_int(n_code, 0);
40382 
40383         ret_val = xmlUCSIsLatinExtendedA(code);
40384         desret_int(ret_val);
40385         call_tests++;
40386         des_int(n_code, code, 0);
40387         xmlResetLastError();
40388         if (mem_base != xmlMemBlocks()) {
40389             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40390 	           xmlMemBlocks() - mem_base);
40391 	    test_ret++;
40392             printf(" %d", n_code);
40393             printf("\n");
40394         }
40395     }
40396     function_tests++;
40397 #endif
40398 
40399     return(test_ret);
40400 }
40401 
40402 
40403 static int
test_xmlUCSIsLatinExtendedAdditional(void)40404 test_xmlUCSIsLatinExtendedAdditional(void) {
40405     int test_ret = 0;
40406 
40407 #if defined(LIBXML_UNICODE_ENABLED)
40408     int mem_base;
40409     int ret_val;
40410     int code; /* UCS code point */
40411     int n_code;
40412 
40413     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40414         mem_base = xmlMemBlocks();
40415         code = gen_int(n_code, 0);
40416 
40417         ret_val = xmlUCSIsLatinExtendedAdditional(code);
40418         desret_int(ret_val);
40419         call_tests++;
40420         des_int(n_code, code, 0);
40421         xmlResetLastError();
40422         if (mem_base != xmlMemBlocks()) {
40423             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40424 	           xmlMemBlocks() - mem_base);
40425 	    test_ret++;
40426             printf(" %d", n_code);
40427             printf("\n");
40428         }
40429     }
40430     function_tests++;
40431 #endif
40432 
40433     return(test_ret);
40434 }
40435 
40436 
40437 static int
test_xmlUCSIsLatinExtendedB(void)40438 test_xmlUCSIsLatinExtendedB(void) {
40439     int test_ret = 0;
40440 
40441 #if defined(LIBXML_UNICODE_ENABLED)
40442     int mem_base;
40443     int ret_val;
40444     int code; /* UCS code point */
40445     int n_code;
40446 
40447     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40448         mem_base = xmlMemBlocks();
40449         code = gen_int(n_code, 0);
40450 
40451         ret_val = xmlUCSIsLatinExtendedB(code);
40452         desret_int(ret_val);
40453         call_tests++;
40454         des_int(n_code, code, 0);
40455         xmlResetLastError();
40456         if (mem_base != xmlMemBlocks()) {
40457             printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40458 	           xmlMemBlocks() - mem_base);
40459 	    test_ret++;
40460             printf(" %d", n_code);
40461             printf("\n");
40462         }
40463     }
40464     function_tests++;
40465 #endif
40466 
40467     return(test_ret);
40468 }
40469 
40470 
40471 static int
test_xmlUCSIsLetterlikeSymbols(void)40472 test_xmlUCSIsLetterlikeSymbols(void) {
40473     int test_ret = 0;
40474 
40475 #if defined(LIBXML_UNICODE_ENABLED)
40476     int mem_base;
40477     int ret_val;
40478     int code; /* UCS code point */
40479     int n_code;
40480 
40481     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40482         mem_base = xmlMemBlocks();
40483         code = gen_int(n_code, 0);
40484 
40485         ret_val = xmlUCSIsLetterlikeSymbols(code);
40486         desret_int(ret_val);
40487         call_tests++;
40488         des_int(n_code, code, 0);
40489         xmlResetLastError();
40490         if (mem_base != xmlMemBlocks()) {
40491             printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40492 	           xmlMemBlocks() - mem_base);
40493 	    test_ret++;
40494             printf(" %d", n_code);
40495             printf("\n");
40496         }
40497     }
40498     function_tests++;
40499 #endif
40500 
40501     return(test_ret);
40502 }
40503 
40504 
40505 static int
test_xmlUCSIsLimbu(void)40506 test_xmlUCSIsLimbu(void) {
40507     int test_ret = 0;
40508 
40509 #if defined(LIBXML_UNICODE_ENABLED)
40510     int mem_base;
40511     int ret_val;
40512     int code; /* UCS code point */
40513     int n_code;
40514 
40515     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40516         mem_base = xmlMemBlocks();
40517         code = gen_int(n_code, 0);
40518 
40519         ret_val = xmlUCSIsLimbu(code);
40520         desret_int(ret_val);
40521         call_tests++;
40522         des_int(n_code, code, 0);
40523         xmlResetLastError();
40524         if (mem_base != xmlMemBlocks()) {
40525             printf("Leak of %d blocks found in xmlUCSIsLimbu",
40526 	           xmlMemBlocks() - mem_base);
40527 	    test_ret++;
40528             printf(" %d", n_code);
40529             printf("\n");
40530         }
40531     }
40532     function_tests++;
40533 #endif
40534 
40535     return(test_ret);
40536 }
40537 
40538 
40539 static int
test_xmlUCSIsLinearBIdeograms(void)40540 test_xmlUCSIsLinearBIdeograms(void) {
40541     int test_ret = 0;
40542 
40543 #if defined(LIBXML_UNICODE_ENABLED)
40544     int mem_base;
40545     int ret_val;
40546     int code; /* UCS code point */
40547     int n_code;
40548 
40549     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40550         mem_base = xmlMemBlocks();
40551         code = gen_int(n_code, 0);
40552 
40553         ret_val = xmlUCSIsLinearBIdeograms(code);
40554         desret_int(ret_val);
40555         call_tests++;
40556         des_int(n_code, code, 0);
40557         xmlResetLastError();
40558         if (mem_base != xmlMemBlocks()) {
40559             printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40560 	           xmlMemBlocks() - mem_base);
40561 	    test_ret++;
40562             printf(" %d", n_code);
40563             printf("\n");
40564         }
40565     }
40566     function_tests++;
40567 #endif
40568 
40569     return(test_ret);
40570 }
40571 
40572 
40573 static int
test_xmlUCSIsLinearBSyllabary(void)40574 test_xmlUCSIsLinearBSyllabary(void) {
40575     int test_ret = 0;
40576 
40577 #if defined(LIBXML_UNICODE_ENABLED)
40578     int mem_base;
40579     int ret_val;
40580     int code; /* UCS code point */
40581     int n_code;
40582 
40583     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40584         mem_base = xmlMemBlocks();
40585         code = gen_int(n_code, 0);
40586 
40587         ret_val = xmlUCSIsLinearBSyllabary(code);
40588         desret_int(ret_val);
40589         call_tests++;
40590         des_int(n_code, code, 0);
40591         xmlResetLastError();
40592         if (mem_base != xmlMemBlocks()) {
40593             printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40594 	           xmlMemBlocks() - mem_base);
40595 	    test_ret++;
40596             printf(" %d", n_code);
40597             printf("\n");
40598         }
40599     }
40600     function_tests++;
40601 #endif
40602 
40603     return(test_ret);
40604 }
40605 
40606 
40607 static int
test_xmlUCSIsLowSurrogates(void)40608 test_xmlUCSIsLowSurrogates(void) {
40609     int test_ret = 0;
40610 
40611 #if defined(LIBXML_UNICODE_ENABLED)
40612     int mem_base;
40613     int ret_val;
40614     int code; /* UCS code point */
40615     int n_code;
40616 
40617     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40618         mem_base = xmlMemBlocks();
40619         code = gen_int(n_code, 0);
40620 
40621         ret_val = xmlUCSIsLowSurrogates(code);
40622         desret_int(ret_val);
40623         call_tests++;
40624         des_int(n_code, code, 0);
40625         xmlResetLastError();
40626         if (mem_base != xmlMemBlocks()) {
40627             printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40628 	           xmlMemBlocks() - mem_base);
40629 	    test_ret++;
40630             printf(" %d", n_code);
40631             printf("\n");
40632         }
40633     }
40634     function_tests++;
40635 #endif
40636 
40637     return(test_ret);
40638 }
40639 
40640 
40641 static int
test_xmlUCSIsMalayalam(void)40642 test_xmlUCSIsMalayalam(void) {
40643     int test_ret = 0;
40644 
40645 #if defined(LIBXML_UNICODE_ENABLED)
40646     int mem_base;
40647     int ret_val;
40648     int code; /* UCS code point */
40649     int n_code;
40650 
40651     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40652         mem_base = xmlMemBlocks();
40653         code = gen_int(n_code, 0);
40654 
40655         ret_val = xmlUCSIsMalayalam(code);
40656         desret_int(ret_val);
40657         call_tests++;
40658         des_int(n_code, code, 0);
40659         xmlResetLastError();
40660         if (mem_base != xmlMemBlocks()) {
40661             printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40662 	           xmlMemBlocks() - mem_base);
40663 	    test_ret++;
40664             printf(" %d", n_code);
40665             printf("\n");
40666         }
40667     }
40668     function_tests++;
40669 #endif
40670 
40671     return(test_ret);
40672 }
40673 
40674 
40675 static int
test_xmlUCSIsMathematicalAlphanumericSymbols(void)40676 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40677     int test_ret = 0;
40678 
40679 #if defined(LIBXML_UNICODE_ENABLED)
40680     int mem_base;
40681     int ret_val;
40682     int code; /* UCS code point */
40683     int n_code;
40684 
40685     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40686         mem_base = xmlMemBlocks();
40687         code = gen_int(n_code, 0);
40688 
40689         ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40690         desret_int(ret_val);
40691         call_tests++;
40692         des_int(n_code, code, 0);
40693         xmlResetLastError();
40694         if (mem_base != xmlMemBlocks()) {
40695             printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40696 	           xmlMemBlocks() - mem_base);
40697 	    test_ret++;
40698             printf(" %d", n_code);
40699             printf("\n");
40700         }
40701     }
40702     function_tests++;
40703 #endif
40704 
40705     return(test_ret);
40706 }
40707 
40708 
40709 static int
test_xmlUCSIsMathematicalOperators(void)40710 test_xmlUCSIsMathematicalOperators(void) {
40711     int test_ret = 0;
40712 
40713 #if defined(LIBXML_UNICODE_ENABLED)
40714     int mem_base;
40715     int ret_val;
40716     int code; /* UCS code point */
40717     int n_code;
40718 
40719     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40720         mem_base = xmlMemBlocks();
40721         code = gen_int(n_code, 0);
40722 
40723         ret_val = xmlUCSIsMathematicalOperators(code);
40724         desret_int(ret_val);
40725         call_tests++;
40726         des_int(n_code, code, 0);
40727         xmlResetLastError();
40728         if (mem_base != xmlMemBlocks()) {
40729             printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40730 	           xmlMemBlocks() - mem_base);
40731 	    test_ret++;
40732             printf(" %d", n_code);
40733             printf("\n");
40734         }
40735     }
40736     function_tests++;
40737 #endif
40738 
40739     return(test_ret);
40740 }
40741 
40742 
40743 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void)40744 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40745     int test_ret = 0;
40746 
40747 #if defined(LIBXML_UNICODE_ENABLED)
40748     int mem_base;
40749     int ret_val;
40750     int code; /* UCS code point */
40751     int n_code;
40752 
40753     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40754         mem_base = xmlMemBlocks();
40755         code = gen_int(n_code, 0);
40756 
40757         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
40758         desret_int(ret_val);
40759         call_tests++;
40760         des_int(n_code, code, 0);
40761         xmlResetLastError();
40762         if (mem_base != xmlMemBlocks()) {
40763             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
40764 	           xmlMemBlocks() - mem_base);
40765 	    test_ret++;
40766             printf(" %d", n_code);
40767             printf("\n");
40768         }
40769     }
40770     function_tests++;
40771 #endif
40772 
40773     return(test_ret);
40774 }
40775 
40776 
40777 static int
test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void)40778 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
40779     int test_ret = 0;
40780 
40781 #if defined(LIBXML_UNICODE_ENABLED)
40782     int mem_base;
40783     int ret_val;
40784     int code; /* UCS code point */
40785     int n_code;
40786 
40787     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40788         mem_base = xmlMemBlocks();
40789         code = gen_int(n_code, 0);
40790 
40791         ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
40792         desret_int(ret_val);
40793         call_tests++;
40794         des_int(n_code, code, 0);
40795         xmlResetLastError();
40796         if (mem_base != xmlMemBlocks()) {
40797             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
40798 	           xmlMemBlocks() - mem_base);
40799 	    test_ret++;
40800             printf(" %d", n_code);
40801             printf("\n");
40802         }
40803     }
40804     function_tests++;
40805 #endif
40806 
40807     return(test_ret);
40808 }
40809 
40810 
40811 static int
test_xmlUCSIsMiscellaneousSymbols(void)40812 test_xmlUCSIsMiscellaneousSymbols(void) {
40813     int test_ret = 0;
40814 
40815 #if defined(LIBXML_UNICODE_ENABLED)
40816     int mem_base;
40817     int ret_val;
40818     int code; /* UCS code point */
40819     int n_code;
40820 
40821     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40822         mem_base = xmlMemBlocks();
40823         code = gen_int(n_code, 0);
40824 
40825         ret_val = xmlUCSIsMiscellaneousSymbols(code);
40826         desret_int(ret_val);
40827         call_tests++;
40828         des_int(n_code, code, 0);
40829         xmlResetLastError();
40830         if (mem_base != xmlMemBlocks()) {
40831             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
40832 	           xmlMemBlocks() - mem_base);
40833 	    test_ret++;
40834             printf(" %d", n_code);
40835             printf("\n");
40836         }
40837     }
40838     function_tests++;
40839 #endif
40840 
40841     return(test_ret);
40842 }
40843 
40844 
40845 static int
test_xmlUCSIsMiscellaneousSymbolsandArrows(void)40846 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
40847     int test_ret = 0;
40848 
40849 #if defined(LIBXML_UNICODE_ENABLED)
40850     int mem_base;
40851     int ret_val;
40852     int code; /* UCS code point */
40853     int n_code;
40854 
40855     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40856         mem_base = xmlMemBlocks();
40857         code = gen_int(n_code, 0);
40858 
40859         ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
40860         desret_int(ret_val);
40861         call_tests++;
40862         des_int(n_code, code, 0);
40863         xmlResetLastError();
40864         if (mem_base != xmlMemBlocks()) {
40865             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
40866 	           xmlMemBlocks() - mem_base);
40867 	    test_ret++;
40868             printf(" %d", n_code);
40869             printf("\n");
40870         }
40871     }
40872     function_tests++;
40873 #endif
40874 
40875     return(test_ret);
40876 }
40877 
40878 
40879 static int
test_xmlUCSIsMiscellaneousTechnical(void)40880 test_xmlUCSIsMiscellaneousTechnical(void) {
40881     int test_ret = 0;
40882 
40883 #if defined(LIBXML_UNICODE_ENABLED)
40884     int mem_base;
40885     int ret_val;
40886     int code; /* UCS code point */
40887     int n_code;
40888 
40889     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40890         mem_base = xmlMemBlocks();
40891         code = gen_int(n_code, 0);
40892 
40893         ret_val = xmlUCSIsMiscellaneousTechnical(code);
40894         desret_int(ret_val);
40895         call_tests++;
40896         des_int(n_code, code, 0);
40897         xmlResetLastError();
40898         if (mem_base != xmlMemBlocks()) {
40899             printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
40900 	           xmlMemBlocks() - mem_base);
40901 	    test_ret++;
40902             printf(" %d", n_code);
40903             printf("\n");
40904         }
40905     }
40906     function_tests++;
40907 #endif
40908 
40909     return(test_ret);
40910 }
40911 
40912 
40913 static int
test_xmlUCSIsMongolian(void)40914 test_xmlUCSIsMongolian(void) {
40915     int test_ret = 0;
40916 
40917 #if defined(LIBXML_UNICODE_ENABLED)
40918     int mem_base;
40919     int ret_val;
40920     int code; /* UCS code point */
40921     int n_code;
40922 
40923     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40924         mem_base = xmlMemBlocks();
40925         code = gen_int(n_code, 0);
40926 
40927         ret_val = xmlUCSIsMongolian(code);
40928         desret_int(ret_val);
40929         call_tests++;
40930         des_int(n_code, code, 0);
40931         xmlResetLastError();
40932         if (mem_base != xmlMemBlocks()) {
40933             printf("Leak of %d blocks found in xmlUCSIsMongolian",
40934 	           xmlMemBlocks() - mem_base);
40935 	    test_ret++;
40936             printf(" %d", n_code);
40937             printf("\n");
40938         }
40939     }
40940     function_tests++;
40941 #endif
40942 
40943     return(test_ret);
40944 }
40945 
40946 
40947 static int
test_xmlUCSIsMusicalSymbols(void)40948 test_xmlUCSIsMusicalSymbols(void) {
40949     int test_ret = 0;
40950 
40951 #if defined(LIBXML_UNICODE_ENABLED)
40952     int mem_base;
40953     int ret_val;
40954     int code; /* UCS code point */
40955     int n_code;
40956 
40957     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40958         mem_base = xmlMemBlocks();
40959         code = gen_int(n_code, 0);
40960 
40961         ret_val = xmlUCSIsMusicalSymbols(code);
40962         desret_int(ret_val);
40963         call_tests++;
40964         des_int(n_code, code, 0);
40965         xmlResetLastError();
40966         if (mem_base != xmlMemBlocks()) {
40967             printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
40968 	           xmlMemBlocks() - mem_base);
40969 	    test_ret++;
40970             printf(" %d", n_code);
40971             printf("\n");
40972         }
40973     }
40974     function_tests++;
40975 #endif
40976 
40977     return(test_ret);
40978 }
40979 
40980 
40981 static int
test_xmlUCSIsMyanmar(void)40982 test_xmlUCSIsMyanmar(void) {
40983     int test_ret = 0;
40984 
40985 #if defined(LIBXML_UNICODE_ENABLED)
40986     int mem_base;
40987     int ret_val;
40988     int code; /* UCS code point */
40989     int n_code;
40990 
40991     for (n_code = 0;n_code < gen_nb_int;n_code++) {
40992         mem_base = xmlMemBlocks();
40993         code = gen_int(n_code, 0);
40994 
40995         ret_val = xmlUCSIsMyanmar(code);
40996         desret_int(ret_val);
40997         call_tests++;
40998         des_int(n_code, code, 0);
40999         xmlResetLastError();
41000         if (mem_base != xmlMemBlocks()) {
41001             printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41002 	           xmlMemBlocks() - mem_base);
41003 	    test_ret++;
41004             printf(" %d", n_code);
41005             printf("\n");
41006         }
41007     }
41008     function_tests++;
41009 #endif
41010 
41011     return(test_ret);
41012 }
41013 
41014 
41015 static int
test_xmlUCSIsNumberForms(void)41016 test_xmlUCSIsNumberForms(void) {
41017     int test_ret = 0;
41018 
41019 #if defined(LIBXML_UNICODE_ENABLED)
41020     int mem_base;
41021     int ret_val;
41022     int code; /* UCS code point */
41023     int n_code;
41024 
41025     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41026         mem_base = xmlMemBlocks();
41027         code = gen_int(n_code, 0);
41028 
41029         ret_val = xmlUCSIsNumberForms(code);
41030         desret_int(ret_val);
41031         call_tests++;
41032         des_int(n_code, code, 0);
41033         xmlResetLastError();
41034         if (mem_base != xmlMemBlocks()) {
41035             printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41036 	           xmlMemBlocks() - mem_base);
41037 	    test_ret++;
41038             printf(" %d", n_code);
41039             printf("\n");
41040         }
41041     }
41042     function_tests++;
41043 #endif
41044 
41045     return(test_ret);
41046 }
41047 
41048 
41049 static int
test_xmlUCSIsOgham(void)41050 test_xmlUCSIsOgham(void) {
41051     int test_ret = 0;
41052 
41053 #if defined(LIBXML_UNICODE_ENABLED)
41054     int mem_base;
41055     int ret_val;
41056     int code; /* UCS code point */
41057     int n_code;
41058 
41059     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41060         mem_base = xmlMemBlocks();
41061         code = gen_int(n_code, 0);
41062 
41063         ret_val = xmlUCSIsOgham(code);
41064         desret_int(ret_val);
41065         call_tests++;
41066         des_int(n_code, code, 0);
41067         xmlResetLastError();
41068         if (mem_base != xmlMemBlocks()) {
41069             printf("Leak of %d blocks found in xmlUCSIsOgham",
41070 	           xmlMemBlocks() - mem_base);
41071 	    test_ret++;
41072             printf(" %d", n_code);
41073             printf("\n");
41074         }
41075     }
41076     function_tests++;
41077 #endif
41078 
41079     return(test_ret);
41080 }
41081 
41082 
41083 static int
test_xmlUCSIsOldItalic(void)41084 test_xmlUCSIsOldItalic(void) {
41085     int test_ret = 0;
41086 
41087 #if defined(LIBXML_UNICODE_ENABLED)
41088     int mem_base;
41089     int ret_val;
41090     int code; /* UCS code point */
41091     int n_code;
41092 
41093     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41094         mem_base = xmlMemBlocks();
41095         code = gen_int(n_code, 0);
41096 
41097         ret_val = xmlUCSIsOldItalic(code);
41098         desret_int(ret_val);
41099         call_tests++;
41100         des_int(n_code, code, 0);
41101         xmlResetLastError();
41102         if (mem_base != xmlMemBlocks()) {
41103             printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41104 	           xmlMemBlocks() - mem_base);
41105 	    test_ret++;
41106             printf(" %d", n_code);
41107             printf("\n");
41108         }
41109     }
41110     function_tests++;
41111 #endif
41112 
41113     return(test_ret);
41114 }
41115 
41116 
41117 static int
test_xmlUCSIsOpticalCharacterRecognition(void)41118 test_xmlUCSIsOpticalCharacterRecognition(void) {
41119     int test_ret = 0;
41120 
41121 #if defined(LIBXML_UNICODE_ENABLED)
41122     int mem_base;
41123     int ret_val;
41124     int code; /* UCS code point */
41125     int n_code;
41126 
41127     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41128         mem_base = xmlMemBlocks();
41129         code = gen_int(n_code, 0);
41130 
41131         ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41132         desret_int(ret_val);
41133         call_tests++;
41134         des_int(n_code, code, 0);
41135         xmlResetLastError();
41136         if (mem_base != xmlMemBlocks()) {
41137             printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41138 	           xmlMemBlocks() - mem_base);
41139 	    test_ret++;
41140             printf(" %d", n_code);
41141             printf("\n");
41142         }
41143     }
41144     function_tests++;
41145 #endif
41146 
41147     return(test_ret);
41148 }
41149 
41150 
41151 static int
test_xmlUCSIsOriya(void)41152 test_xmlUCSIsOriya(void) {
41153     int test_ret = 0;
41154 
41155 #if defined(LIBXML_UNICODE_ENABLED)
41156     int mem_base;
41157     int ret_val;
41158     int code; /* UCS code point */
41159     int n_code;
41160 
41161     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41162         mem_base = xmlMemBlocks();
41163         code = gen_int(n_code, 0);
41164 
41165         ret_val = xmlUCSIsOriya(code);
41166         desret_int(ret_val);
41167         call_tests++;
41168         des_int(n_code, code, 0);
41169         xmlResetLastError();
41170         if (mem_base != xmlMemBlocks()) {
41171             printf("Leak of %d blocks found in xmlUCSIsOriya",
41172 	           xmlMemBlocks() - mem_base);
41173 	    test_ret++;
41174             printf(" %d", n_code);
41175             printf("\n");
41176         }
41177     }
41178     function_tests++;
41179 #endif
41180 
41181     return(test_ret);
41182 }
41183 
41184 
41185 static int
test_xmlUCSIsOsmanya(void)41186 test_xmlUCSIsOsmanya(void) {
41187     int test_ret = 0;
41188 
41189 #if defined(LIBXML_UNICODE_ENABLED)
41190     int mem_base;
41191     int ret_val;
41192     int code; /* UCS code point */
41193     int n_code;
41194 
41195     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41196         mem_base = xmlMemBlocks();
41197         code = gen_int(n_code, 0);
41198 
41199         ret_val = xmlUCSIsOsmanya(code);
41200         desret_int(ret_val);
41201         call_tests++;
41202         des_int(n_code, code, 0);
41203         xmlResetLastError();
41204         if (mem_base != xmlMemBlocks()) {
41205             printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41206 	           xmlMemBlocks() - mem_base);
41207 	    test_ret++;
41208             printf(" %d", n_code);
41209             printf("\n");
41210         }
41211     }
41212     function_tests++;
41213 #endif
41214 
41215     return(test_ret);
41216 }
41217 
41218 
41219 static int
test_xmlUCSIsPhoneticExtensions(void)41220 test_xmlUCSIsPhoneticExtensions(void) {
41221     int test_ret = 0;
41222 
41223 #if defined(LIBXML_UNICODE_ENABLED)
41224     int mem_base;
41225     int ret_val;
41226     int code; /* UCS code point */
41227     int n_code;
41228 
41229     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41230         mem_base = xmlMemBlocks();
41231         code = gen_int(n_code, 0);
41232 
41233         ret_val = xmlUCSIsPhoneticExtensions(code);
41234         desret_int(ret_val);
41235         call_tests++;
41236         des_int(n_code, code, 0);
41237         xmlResetLastError();
41238         if (mem_base != xmlMemBlocks()) {
41239             printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41240 	           xmlMemBlocks() - mem_base);
41241 	    test_ret++;
41242             printf(" %d", n_code);
41243             printf("\n");
41244         }
41245     }
41246     function_tests++;
41247 #endif
41248 
41249     return(test_ret);
41250 }
41251 
41252 
41253 static int
test_xmlUCSIsPrivateUse(void)41254 test_xmlUCSIsPrivateUse(void) {
41255     int test_ret = 0;
41256 
41257 #if defined(LIBXML_UNICODE_ENABLED)
41258     int mem_base;
41259     int ret_val;
41260     int code; /* UCS code point */
41261     int n_code;
41262 
41263     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41264         mem_base = xmlMemBlocks();
41265         code = gen_int(n_code, 0);
41266 
41267         ret_val = xmlUCSIsPrivateUse(code);
41268         desret_int(ret_val);
41269         call_tests++;
41270         des_int(n_code, code, 0);
41271         xmlResetLastError();
41272         if (mem_base != xmlMemBlocks()) {
41273             printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41274 	           xmlMemBlocks() - mem_base);
41275 	    test_ret++;
41276             printf(" %d", n_code);
41277             printf("\n");
41278         }
41279     }
41280     function_tests++;
41281 #endif
41282 
41283     return(test_ret);
41284 }
41285 
41286 
41287 static int
test_xmlUCSIsPrivateUseArea(void)41288 test_xmlUCSIsPrivateUseArea(void) {
41289     int test_ret = 0;
41290 
41291 #if defined(LIBXML_UNICODE_ENABLED)
41292     int mem_base;
41293     int ret_val;
41294     int code; /* UCS code point */
41295     int n_code;
41296 
41297     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41298         mem_base = xmlMemBlocks();
41299         code = gen_int(n_code, 0);
41300 
41301         ret_val = xmlUCSIsPrivateUseArea(code);
41302         desret_int(ret_val);
41303         call_tests++;
41304         des_int(n_code, code, 0);
41305         xmlResetLastError();
41306         if (mem_base != xmlMemBlocks()) {
41307             printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41308 	           xmlMemBlocks() - mem_base);
41309 	    test_ret++;
41310             printf(" %d", n_code);
41311             printf("\n");
41312         }
41313     }
41314     function_tests++;
41315 #endif
41316 
41317     return(test_ret);
41318 }
41319 
41320 
41321 static int
test_xmlUCSIsRunic(void)41322 test_xmlUCSIsRunic(void) {
41323     int test_ret = 0;
41324 
41325 #if defined(LIBXML_UNICODE_ENABLED)
41326     int mem_base;
41327     int ret_val;
41328     int code; /* UCS code point */
41329     int n_code;
41330 
41331     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41332         mem_base = xmlMemBlocks();
41333         code = gen_int(n_code, 0);
41334 
41335         ret_val = xmlUCSIsRunic(code);
41336         desret_int(ret_val);
41337         call_tests++;
41338         des_int(n_code, code, 0);
41339         xmlResetLastError();
41340         if (mem_base != xmlMemBlocks()) {
41341             printf("Leak of %d blocks found in xmlUCSIsRunic",
41342 	           xmlMemBlocks() - mem_base);
41343 	    test_ret++;
41344             printf(" %d", n_code);
41345             printf("\n");
41346         }
41347     }
41348     function_tests++;
41349 #endif
41350 
41351     return(test_ret);
41352 }
41353 
41354 
41355 static int
test_xmlUCSIsShavian(void)41356 test_xmlUCSIsShavian(void) {
41357     int test_ret = 0;
41358 
41359 #if defined(LIBXML_UNICODE_ENABLED)
41360     int mem_base;
41361     int ret_val;
41362     int code; /* UCS code point */
41363     int n_code;
41364 
41365     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41366         mem_base = xmlMemBlocks();
41367         code = gen_int(n_code, 0);
41368 
41369         ret_val = xmlUCSIsShavian(code);
41370         desret_int(ret_val);
41371         call_tests++;
41372         des_int(n_code, code, 0);
41373         xmlResetLastError();
41374         if (mem_base != xmlMemBlocks()) {
41375             printf("Leak of %d blocks found in xmlUCSIsShavian",
41376 	           xmlMemBlocks() - mem_base);
41377 	    test_ret++;
41378             printf(" %d", n_code);
41379             printf("\n");
41380         }
41381     }
41382     function_tests++;
41383 #endif
41384 
41385     return(test_ret);
41386 }
41387 
41388 
41389 static int
test_xmlUCSIsSinhala(void)41390 test_xmlUCSIsSinhala(void) {
41391     int test_ret = 0;
41392 
41393 #if defined(LIBXML_UNICODE_ENABLED)
41394     int mem_base;
41395     int ret_val;
41396     int code; /* UCS code point */
41397     int n_code;
41398 
41399     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41400         mem_base = xmlMemBlocks();
41401         code = gen_int(n_code, 0);
41402 
41403         ret_val = xmlUCSIsSinhala(code);
41404         desret_int(ret_val);
41405         call_tests++;
41406         des_int(n_code, code, 0);
41407         xmlResetLastError();
41408         if (mem_base != xmlMemBlocks()) {
41409             printf("Leak of %d blocks found in xmlUCSIsSinhala",
41410 	           xmlMemBlocks() - mem_base);
41411 	    test_ret++;
41412             printf(" %d", n_code);
41413             printf("\n");
41414         }
41415     }
41416     function_tests++;
41417 #endif
41418 
41419     return(test_ret);
41420 }
41421 
41422 
41423 static int
test_xmlUCSIsSmallFormVariants(void)41424 test_xmlUCSIsSmallFormVariants(void) {
41425     int test_ret = 0;
41426 
41427 #if defined(LIBXML_UNICODE_ENABLED)
41428     int mem_base;
41429     int ret_val;
41430     int code; /* UCS code point */
41431     int n_code;
41432 
41433     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41434         mem_base = xmlMemBlocks();
41435         code = gen_int(n_code, 0);
41436 
41437         ret_val = xmlUCSIsSmallFormVariants(code);
41438         desret_int(ret_val);
41439         call_tests++;
41440         des_int(n_code, code, 0);
41441         xmlResetLastError();
41442         if (mem_base != xmlMemBlocks()) {
41443             printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41444 	           xmlMemBlocks() - mem_base);
41445 	    test_ret++;
41446             printf(" %d", n_code);
41447             printf("\n");
41448         }
41449     }
41450     function_tests++;
41451 #endif
41452 
41453     return(test_ret);
41454 }
41455 
41456 
41457 static int
test_xmlUCSIsSpacingModifierLetters(void)41458 test_xmlUCSIsSpacingModifierLetters(void) {
41459     int test_ret = 0;
41460 
41461 #if defined(LIBXML_UNICODE_ENABLED)
41462     int mem_base;
41463     int ret_val;
41464     int code; /* UCS code point */
41465     int n_code;
41466 
41467     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41468         mem_base = xmlMemBlocks();
41469         code = gen_int(n_code, 0);
41470 
41471         ret_val = xmlUCSIsSpacingModifierLetters(code);
41472         desret_int(ret_val);
41473         call_tests++;
41474         des_int(n_code, code, 0);
41475         xmlResetLastError();
41476         if (mem_base != xmlMemBlocks()) {
41477             printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41478 	           xmlMemBlocks() - mem_base);
41479 	    test_ret++;
41480             printf(" %d", n_code);
41481             printf("\n");
41482         }
41483     }
41484     function_tests++;
41485 #endif
41486 
41487     return(test_ret);
41488 }
41489 
41490 
41491 static int
test_xmlUCSIsSpecials(void)41492 test_xmlUCSIsSpecials(void) {
41493     int test_ret = 0;
41494 
41495 #if defined(LIBXML_UNICODE_ENABLED)
41496     int mem_base;
41497     int ret_val;
41498     int code; /* UCS code point */
41499     int n_code;
41500 
41501     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41502         mem_base = xmlMemBlocks();
41503         code = gen_int(n_code, 0);
41504 
41505         ret_val = xmlUCSIsSpecials(code);
41506         desret_int(ret_val);
41507         call_tests++;
41508         des_int(n_code, code, 0);
41509         xmlResetLastError();
41510         if (mem_base != xmlMemBlocks()) {
41511             printf("Leak of %d blocks found in xmlUCSIsSpecials",
41512 	           xmlMemBlocks() - mem_base);
41513 	    test_ret++;
41514             printf(" %d", n_code);
41515             printf("\n");
41516         }
41517     }
41518     function_tests++;
41519 #endif
41520 
41521     return(test_ret);
41522 }
41523 
41524 
41525 static int
test_xmlUCSIsSuperscriptsandSubscripts(void)41526 test_xmlUCSIsSuperscriptsandSubscripts(void) {
41527     int test_ret = 0;
41528 
41529 #if defined(LIBXML_UNICODE_ENABLED)
41530     int mem_base;
41531     int ret_val;
41532     int code; /* UCS code point */
41533     int n_code;
41534 
41535     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41536         mem_base = xmlMemBlocks();
41537         code = gen_int(n_code, 0);
41538 
41539         ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41540         desret_int(ret_val);
41541         call_tests++;
41542         des_int(n_code, code, 0);
41543         xmlResetLastError();
41544         if (mem_base != xmlMemBlocks()) {
41545             printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41546 	           xmlMemBlocks() - mem_base);
41547 	    test_ret++;
41548             printf(" %d", n_code);
41549             printf("\n");
41550         }
41551     }
41552     function_tests++;
41553 #endif
41554 
41555     return(test_ret);
41556 }
41557 
41558 
41559 static int
test_xmlUCSIsSupplementalArrowsA(void)41560 test_xmlUCSIsSupplementalArrowsA(void) {
41561     int test_ret = 0;
41562 
41563 #if defined(LIBXML_UNICODE_ENABLED)
41564     int mem_base;
41565     int ret_val;
41566     int code; /* UCS code point */
41567     int n_code;
41568 
41569     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41570         mem_base = xmlMemBlocks();
41571         code = gen_int(n_code, 0);
41572 
41573         ret_val = xmlUCSIsSupplementalArrowsA(code);
41574         desret_int(ret_val);
41575         call_tests++;
41576         des_int(n_code, code, 0);
41577         xmlResetLastError();
41578         if (mem_base != xmlMemBlocks()) {
41579             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41580 	           xmlMemBlocks() - mem_base);
41581 	    test_ret++;
41582             printf(" %d", n_code);
41583             printf("\n");
41584         }
41585     }
41586     function_tests++;
41587 #endif
41588 
41589     return(test_ret);
41590 }
41591 
41592 
41593 static int
test_xmlUCSIsSupplementalArrowsB(void)41594 test_xmlUCSIsSupplementalArrowsB(void) {
41595     int test_ret = 0;
41596 
41597 #if defined(LIBXML_UNICODE_ENABLED)
41598     int mem_base;
41599     int ret_val;
41600     int code; /* UCS code point */
41601     int n_code;
41602 
41603     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41604         mem_base = xmlMemBlocks();
41605         code = gen_int(n_code, 0);
41606 
41607         ret_val = xmlUCSIsSupplementalArrowsB(code);
41608         desret_int(ret_val);
41609         call_tests++;
41610         des_int(n_code, code, 0);
41611         xmlResetLastError();
41612         if (mem_base != xmlMemBlocks()) {
41613             printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41614 	           xmlMemBlocks() - mem_base);
41615 	    test_ret++;
41616             printf(" %d", n_code);
41617             printf("\n");
41618         }
41619     }
41620     function_tests++;
41621 #endif
41622 
41623     return(test_ret);
41624 }
41625 
41626 
41627 static int
test_xmlUCSIsSupplementalMathematicalOperators(void)41628 test_xmlUCSIsSupplementalMathematicalOperators(void) {
41629     int test_ret = 0;
41630 
41631 #if defined(LIBXML_UNICODE_ENABLED)
41632     int mem_base;
41633     int ret_val;
41634     int code; /* UCS code point */
41635     int n_code;
41636 
41637     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41638         mem_base = xmlMemBlocks();
41639         code = gen_int(n_code, 0);
41640 
41641         ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41642         desret_int(ret_val);
41643         call_tests++;
41644         des_int(n_code, code, 0);
41645         xmlResetLastError();
41646         if (mem_base != xmlMemBlocks()) {
41647             printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41648 	           xmlMemBlocks() - mem_base);
41649 	    test_ret++;
41650             printf(" %d", n_code);
41651             printf("\n");
41652         }
41653     }
41654     function_tests++;
41655 #endif
41656 
41657     return(test_ret);
41658 }
41659 
41660 
41661 static int
test_xmlUCSIsSupplementaryPrivateUseAreaA(void)41662 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41663     int test_ret = 0;
41664 
41665 #if defined(LIBXML_UNICODE_ENABLED)
41666     int mem_base;
41667     int ret_val;
41668     int code; /* UCS code point */
41669     int n_code;
41670 
41671     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41672         mem_base = xmlMemBlocks();
41673         code = gen_int(n_code, 0);
41674 
41675         ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41676         desret_int(ret_val);
41677         call_tests++;
41678         des_int(n_code, code, 0);
41679         xmlResetLastError();
41680         if (mem_base != xmlMemBlocks()) {
41681             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41682 	           xmlMemBlocks() - mem_base);
41683 	    test_ret++;
41684             printf(" %d", n_code);
41685             printf("\n");
41686         }
41687     }
41688     function_tests++;
41689 #endif
41690 
41691     return(test_ret);
41692 }
41693 
41694 
41695 static int
test_xmlUCSIsSupplementaryPrivateUseAreaB(void)41696 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41697     int test_ret = 0;
41698 
41699 #if defined(LIBXML_UNICODE_ENABLED)
41700     int mem_base;
41701     int ret_val;
41702     int code; /* UCS code point */
41703     int n_code;
41704 
41705     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41706         mem_base = xmlMemBlocks();
41707         code = gen_int(n_code, 0);
41708 
41709         ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41710         desret_int(ret_val);
41711         call_tests++;
41712         des_int(n_code, code, 0);
41713         xmlResetLastError();
41714         if (mem_base != xmlMemBlocks()) {
41715             printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41716 	           xmlMemBlocks() - mem_base);
41717 	    test_ret++;
41718             printf(" %d", n_code);
41719             printf("\n");
41720         }
41721     }
41722     function_tests++;
41723 #endif
41724 
41725     return(test_ret);
41726 }
41727 
41728 
41729 static int
test_xmlUCSIsSyriac(void)41730 test_xmlUCSIsSyriac(void) {
41731     int test_ret = 0;
41732 
41733 #if defined(LIBXML_UNICODE_ENABLED)
41734     int mem_base;
41735     int ret_val;
41736     int code; /* UCS code point */
41737     int n_code;
41738 
41739     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41740         mem_base = xmlMemBlocks();
41741         code = gen_int(n_code, 0);
41742 
41743         ret_val = xmlUCSIsSyriac(code);
41744         desret_int(ret_val);
41745         call_tests++;
41746         des_int(n_code, code, 0);
41747         xmlResetLastError();
41748         if (mem_base != xmlMemBlocks()) {
41749             printf("Leak of %d blocks found in xmlUCSIsSyriac",
41750 	           xmlMemBlocks() - mem_base);
41751 	    test_ret++;
41752             printf(" %d", n_code);
41753             printf("\n");
41754         }
41755     }
41756     function_tests++;
41757 #endif
41758 
41759     return(test_ret);
41760 }
41761 
41762 
41763 static int
test_xmlUCSIsTagalog(void)41764 test_xmlUCSIsTagalog(void) {
41765     int test_ret = 0;
41766 
41767 #if defined(LIBXML_UNICODE_ENABLED)
41768     int mem_base;
41769     int ret_val;
41770     int code; /* UCS code point */
41771     int n_code;
41772 
41773     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41774         mem_base = xmlMemBlocks();
41775         code = gen_int(n_code, 0);
41776 
41777         ret_val = xmlUCSIsTagalog(code);
41778         desret_int(ret_val);
41779         call_tests++;
41780         des_int(n_code, code, 0);
41781         xmlResetLastError();
41782         if (mem_base != xmlMemBlocks()) {
41783             printf("Leak of %d blocks found in xmlUCSIsTagalog",
41784 	           xmlMemBlocks() - mem_base);
41785 	    test_ret++;
41786             printf(" %d", n_code);
41787             printf("\n");
41788         }
41789     }
41790     function_tests++;
41791 #endif
41792 
41793     return(test_ret);
41794 }
41795 
41796 
41797 static int
test_xmlUCSIsTagbanwa(void)41798 test_xmlUCSIsTagbanwa(void) {
41799     int test_ret = 0;
41800 
41801 #if defined(LIBXML_UNICODE_ENABLED)
41802     int mem_base;
41803     int ret_val;
41804     int code; /* UCS code point */
41805     int n_code;
41806 
41807     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41808         mem_base = xmlMemBlocks();
41809         code = gen_int(n_code, 0);
41810 
41811         ret_val = xmlUCSIsTagbanwa(code);
41812         desret_int(ret_val);
41813         call_tests++;
41814         des_int(n_code, code, 0);
41815         xmlResetLastError();
41816         if (mem_base != xmlMemBlocks()) {
41817             printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
41818 	           xmlMemBlocks() - mem_base);
41819 	    test_ret++;
41820             printf(" %d", n_code);
41821             printf("\n");
41822         }
41823     }
41824     function_tests++;
41825 #endif
41826 
41827     return(test_ret);
41828 }
41829 
41830 
41831 static int
test_xmlUCSIsTags(void)41832 test_xmlUCSIsTags(void) {
41833     int test_ret = 0;
41834 
41835 #if defined(LIBXML_UNICODE_ENABLED)
41836     int mem_base;
41837     int ret_val;
41838     int code; /* UCS code point */
41839     int n_code;
41840 
41841     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41842         mem_base = xmlMemBlocks();
41843         code = gen_int(n_code, 0);
41844 
41845         ret_val = xmlUCSIsTags(code);
41846         desret_int(ret_val);
41847         call_tests++;
41848         des_int(n_code, code, 0);
41849         xmlResetLastError();
41850         if (mem_base != xmlMemBlocks()) {
41851             printf("Leak of %d blocks found in xmlUCSIsTags",
41852 	           xmlMemBlocks() - mem_base);
41853 	    test_ret++;
41854             printf(" %d", n_code);
41855             printf("\n");
41856         }
41857     }
41858     function_tests++;
41859 #endif
41860 
41861     return(test_ret);
41862 }
41863 
41864 
41865 static int
test_xmlUCSIsTaiLe(void)41866 test_xmlUCSIsTaiLe(void) {
41867     int test_ret = 0;
41868 
41869 #if defined(LIBXML_UNICODE_ENABLED)
41870     int mem_base;
41871     int ret_val;
41872     int code; /* UCS code point */
41873     int n_code;
41874 
41875     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41876         mem_base = xmlMemBlocks();
41877         code = gen_int(n_code, 0);
41878 
41879         ret_val = xmlUCSIsTaiLe(code);
41880         desret_int(ret_val);
41881         call_tests++;
41882         des_int(n_code, code, 0);
41883         xmlResetLastError();
41884         if (mem_base != xmlMemBlocks()) {
41885             printf("Leak of %d blocks found in xmlUCSIsTaiLe",
41886 	           xmlMemBlocks() - mem_base);
41887 	    test_ret++;
41888             printf(" %d", n_code);
41889             printf("\n");
41890         }
41891     }
41892     function_tests++;
41893 #endif
41894 
41895     return(test_ret);
41896 }
41897 
41898 
41899 static int
test_xmlUCSIsTaiXuanJingSymbols(void)41900 test_xmlUCSIsTaiXuanJingSymbols(void) {
41901     int test_ret = 0;
41902 
41903 #if defined(LIBXML_UNICODE_ENABLED)
41904     int mem_base;
41905     int ret_val;
41906     int code; /* UCS code point */
41907     int n_code;
41908 
41909     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41910         mem_base = xmlMemBlocks();
41911         code = gen_int(n_code, 0);
41912 
41913         ret_val = xmlUCSIsTaiXuanJingSymbols(code);
41914         desret_int(ret_val);
41915         call_tests++;
41916         des_int(n_code, code, 0);
41917         xmlResetLastError();
41918         if (mem_base != xmlMemBlocks()) {
41919             printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
41920 	           xmlMemBlocks() - mem_base);
41921 	    test_ret++;
41922             printf(" %d", n_code);
41923             printf("\n");
41924         }
41925     }
41926     function_tests++;
41927 #endif
41928 
41929     return(test_ret);
41930 }
41931 
41932 
41933 static int
test_xmlUCSIsTamil(void)41934 test_xmlUCSIsTamil(void) {
41935     int test_ret = 0;
41936 
41937 #if defined(LIBXML_UNICODE_ENABLED)
41938     int mem_base;
41939     int ret_val;
41940     int code; /* UCS code point */
41941     int n_code;
41942 
41943     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41944         mem_base = xmlMemBlocks();
41945         code = gen_int(n_code, 0);
41946 
41947         ret_val = xmlUCSIsTamil(code);
41948         desret_int(ret_val);
41949         call_tests++;
41950         des_int(n_code, code, 0);
41951         xmlResetLastError();
41952         if (mem_base != xmlMemBlocks()) {
41953             printf("Leak of %d blocks found in xmlUCSIsTamil",
41954 	           xmlMemBlocks() - mem_base);
41955 	    test_ret++;
41956             printf(" %d", n_code);
41957             printf("\n");
41958         }
41959     }
41960     function_tests++;
41961 #endif
41962 
41963     return(test_ret);
41964 }
41965 
41966 
41967 static int
test_xmlUCSIsTelugu(void)41968 test_xmlUCSIsTelugu(void) {
41969     int test_ret = 0;
41970 
41971 #if defined(LIBXML_UNICODE_ENABLED)
41972     int mem_base;
41973     int ret_val;
41974     int code; /* UCS code point */
41975     int n_code;
41976 
41977     for (n_code = 0;n_code < gen_nb_int;n_code++) {
41978         mem_base = xmlMemBlocks();
41979         code = gen_int(n_code, 0);
41980 
41981         ret_val = xmlUCSIsTelugu(code);
41982         desret_int(ret_val);
41983         call_tests++;
41984         des_int(n_code, code, 0);
41985         xmlResetLastError();
41986         if (mem_base != xmlMemBlocks()) {
41987             printf("Leak of %d blocks found in xmlUCSIsTelugu",
41988 	           xmlMemBlocks() - mem_base);
41989 	    test_ret++;
41990             printf(" %d", n_code);
41991             printf("\n");
41992         }
41993     }
41994     function_tests++;
41995 #endif
41996 
41997     return(test_ret);
41998 }
41999 
42000 
42001 static int
test_xmlUCSIsThaana(void)42002 test_xmlUCSIsThaana(void) {
42003     int test_ret = 0;
42004 
42005 #if defined(LIBXML_UNICODE_ENABLED)
42006     int mem_base;
42007     int ret_val;
42008     int code; /* UCS code point */
42009     int n_code;
42010 
42011     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42012         mem_base = xmlMemBlocks();
42013         code = gen_int(n_code, 0);
42014 
42015         ret_val = xmlUCSIsThaana(code);
42016         desret_int(ret_val);
42017         call_tests++;
42018         des_int(n_code, code, 0);
42019         xmlResetLastError();
42020         if (mem_base != xmlMemBlocks()) {
42021             printf("Leak of %d blocks found in xmlUCSIsThaana",
42022 	           xmlMemBlocks() - mem_base);
42023 	    test_ret++;
42024             printf(" %d", n_code);
42025             printf("\n");
42026         }
42027     }
42028     function_tests++;
42029 #endif
42030 
42031     return(test_ret);
42032 }
42033 
42034 
42035 static int
test_xmlUCSIsThai(void)42036 test_xmlUCSIsThai(void) {
42037     int test_ret = 0;
42038 
42039 #if defined(LIBXML_UNICODE_ENABLED)
42040     int mem_base;
42041     int ret_val;
42042     int code; /* UCS code point */
42043     int n_code;
42044 
42045     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42046         mem_base = xmlMemBlocks();
42047         code = gen_int(n_code, 0);
42048 
42049         ret_val = xmlUCSIsThai(code);
42050         desret_int(ret_val);
42051         call_tests++;
42052         des_int(n_code, code, 0);
42053         xmlResetLastError();
42054         if (mem_base != xmlMemBlocks()) {
42055             printf("Leak of %d blocks found in xmlUCSIsThai",
42056 	           xmlMemBlocks() - mem_base);
42057 	    test_ret++;
42058             printf(" %d", n_code);
42059             printf("\n");
42060         }
42061     }
42062     function_tests++;
42063 #endif
42064 
42065     return(test_ret);
42066 }
42067 
42068 
42069 static int
test_xmlUCSIsTibetan(void)42070 test_xmlUCSIsTibetan(void) {
42071     int test_ret = 0;
42072 
42073 #if defined(LIBXML_UNICODE_ENABLED)
42074     int mem_base;
42075     int ret_val;
42076     int code; /* UCS code point */
42077     int n_code;
42078 
42079     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42080         mem_base = xmlMemBlocks();
42081         code = gen_int(n_code, 0);
42082 
42083         ret_val = xmlUCSIsTibetan(code);
42084         desret_int(ret_val);
42085         call_tests++;
42086         des_int(n_code, code, 0);
42087         xmlResetLastError();
42088         if (mem_base != xmlMemBlocks()) {
42089             printf("Leak of %d blocks found in xmlUCSIsTibetan",
42090 	           xmlMemBlocks() - mem_base);
42091 	    test_ret++;
42092             printf(" %d", n_code);
42093             printf("\n");
42094         }
42095     }
42096     function_tests++;
42097 #endif
42098 
42099     return(test_ret);
42100 }
42101 
42102 
42103 static int
test_xmlUCSIsUgaritic(void)42104 test_xmlUCSIsUgaritic(void) {
42105     int test_ret = 0;
42106 
42107 #if defined(LIBXML_UNICODE_ENABLED)
42108     int mem_base;
42109     int ret_val;
42110     int code; /* UCS code point */
42111     int n_code;
42112 
42113     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42114         mem_base = xmlMemBlocks();
42115         code = gen_int(n_code, 0);
42116 
42117         ret_val = xmlUCSIsUgaritic(code);
42118         desret_int(ret_val);
42119         call_tests++;
42120         des_int(n_code, code, 0);
42121         xmlResetLastError();
42122         if (mem_base != xmlMemBlocks()) {
42123             printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42124 	           xmlMemBlocks() - mem_base);
42125 	    test_ret++;
42126             printf(" %d", n_code);
42127             printf("\n");
42128         }
42129     }
42130     function_tests++;
42131 #endif
42132 
42133     return(test_ret);
42134 }
42135 
42136 
42137 static int
test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void)42138 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42139     int test_ret = 0;
42140 
42141 #if defined(LIBXML_UNICODE_ENABLED)
42142     int mem_base;
42143     int ret_val;
42144     int code; /* UCS code point */
42145     int n_code;
42146 
42147     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42148         mem_base = xmlMemBlocks();
42149         code = gen_int(n_code, 0);
42150 
42151         ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42152         desret_int(ret_val);
42153         call_tests++;
42154         des_int(n_code, code, 0);
42155         xmlResetLastError();
42156         if (mem_base != xmlMemBlocks()) {
42157             printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42158 	           xmlMemBlocks() - mem_base);
42159 	    test_ret++;
42160             printf(" %d", n_code);
42161             printf("\n");
42162         }
42163     }
42164     function_tests++;
42165 #endif
42166 
42167     return(test_ret);
42168 }
42169 
42170 
42171 static int
test_xmlUCSIsVariationSelectors(void)42172 test_xmlUCSIsVariationSelectors(void) {
42173     int test_ret = 0;
42174 
42175 #if defined(LIBXML_UNICODE_ENABLED)
42176     int mem_base;
42177     int ret_val;
42178     int code; /* UCS code point */
42179     int n_code;
42180 
42181     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42182         mem_base = xmlMemBlocks();
42183         code = gen_int(n_code, 0);
42184 
42185         ret_val = xmlUCSIsVariationSelectors(code);
42186         desret_int(ret_val);
42187         call_tests++;
42188         des_int(n_code, code, 0);
42189         xmlResetLastError();
42190         if (mem_base != xmlMemBlocks()) {
42191             printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42192 	           xmlMemBlocks() - mem_base);
42193 	    test_ret++;
42194             printf(" %d", n_code);
42195             printf("\n");
42196         }
42197     }
42198     function_tests++;
42199 #endif
42200 
42201     return(test_ret);
42202 }
42203 
42204 
42205 static int
test_xmlUCSIsVariationSelectorsSupplement(void)42206 test_xmlUCSIsVariationSelectorsSupplement(void) {
42207     int test_ret = 0;
42208 
42209 #if defined(LIBXML_UNICODE_ENABLED)
42210     int mem_base;
42211     int ret_val;
42212     int code; /* UCS code point */
42213     int n_code;
42214 
42215     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42216         mem_base = xmlMemBlocks();
42217         code = gen_int(n_code, 0);
42218 
42219         ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42220         desret_int(ret_val);
42221         call_tests++;
42222         des_int(n_code, code, 0);
42223         xmlResetLastError();
42224         if (mem_base != xmlMemBlocks()) {
42225             printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42226 	           xmlMemBlocks() - mem_base);
42227 	    test_ret++;
42228             printf(" %d", n_code);
42229             printf("\n");
42230         }
42231     }
42232     function_tests++;
42233 #endif
42234 
42235     return(test_ret);
42236 }
42237 
42238 
42239 static int
test_xmlUCSIsYiRadicals(void)42240 test_xmlUCSIsYiRadicals(void) {
42241     int test_ret = 0;
42242 
42243 #if defined(LIBXML_UNICODE_ENABLED)
42244     int mem_base;
42245     int ret_val;
42246     int code; /* UCS code point */
42247     int n_code;
42248 
42249     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42250         mem_base = xmlMemBlocks();
42251         code = gen_int(n_code, 0);
42252 
42253         ret_val = xmlUCSIsYiRadicals(code);
42254         desret_int(ret_val);
42255         call_tests++;
42256         des_int(n_code, code, 0);
42257         xmlResetLastError();
42258         if (mem_base != xmlMemBlocks()) {
42259             printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42260 	           xmlMemBlocks() - mem_base);
42261 	    test_ret++;
42262             printf(" %d", n_code);
42263             printf("\n");
42264         }
42265     }
42266     function_tests++;
42267 #endif
42268 
42269     return(test_ret);
42270 }
42271 
42272 
42273 static int
test_xmlUCSIsYiSyllables(void)42274 test_xmlUCSIsYiSyllables(void) {
42275     int test_ret = 0;
42276 
42277 #if defined(LIBXML_UNICODE_ENABLED)
42278     int mem_base;
42279     int ret_val;
42280     int code; /* UCS code point */
42281     int n_code;
42282 
42283     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42284         mem_base = xmlMemBlocks();
42285         code = gen_int(n_code, 0);
42286 
42287         ret_val = xmlUCSIsYiSyllables(code);
42288         desret_int(ret_val);
42289         call_tests++;
42290         des_int(n_code, code, 0);
42291         xmlResetLastError();
42292         if (mem_base != xmlMemBlocks()) {
42293             printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42294 	           xmlMemBlocks() - mem_base);
42295 	    test_ret++;
42296             printf(" %d", n_code);
42297             printf("\n");
42298         }
42299     }
42300     function_tests++;
42301 #endif
42302 
42303     return(test_ret);
42304 }
42305 
42306 
42307 static int
test_xmlUCSIsYijingHexagramSymbols(void)42308 test_xmlUCSIsYijingHexagramSymbols(void) {
42309     int test_ret = 0;
42310 
42311 #if defined(LIBXML_UNICODE_ENABLED)
42312     int mem_base;
42313     int ret_val;
42314     int code; /* UCS code point */
42315     int n_code;
42316 
42317     for (n_code = 0;n_code < gen_nb_int;n_code++) {
42318         mem_base = xmlMemBlocks();
42319         code = gen_int(n_code, 0);
42320 
42321         ret_val = xmlUCSIsYijingHexagramSymbols(code);
42322         desret_int(ret_val);
42323         call_tests++;
42324         des_int(n_code, code, 0);
42325         xmlResetLastError();
42326         if (mem_base != xmlMemBlocks()) {
42327             printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42328 	           xmlMemBlocks() - mem_base);
42329 	    test_ret++;
42330             printf(" %d", n_code);
42331             printf("\n");
42332         }
42333     }
42334     function_tests++;
42335 #endif
42336 
42337     return(test_ret);
42338 }
42339 
42340 static int
test_xmlunicode(void)42341 test_xmlunicode(void) {
42342     int test_ret = 0;
42343 
42344     if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42345     test_ret += test_xmlUCSIsAegeanNumbers();
42346     test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42347     test_ret += test_xmlUCSIsArabic();
42348     test_ret += test_xmlUCSIsArabicPresentationFormsA();
42349     test_ret += test_xmlUCSIsArabicPresentationFormsB();
42350     test_ret += test_xmlUCSIsArmenian();
42351     test_ret += test_xmlUCSIsArrows();
42352     test_ret += test_xmlUCSIsBasicLatin();
42353     test_ret += test_xmlUCSIsBengali();
42354     test_ret += test_xmlUCSIsBlock();
42355     test_ret += test_xmlUCSIsBlockElements();
42356     test_ret += test_xmlUCSIsBopomofo();
42357     test_ret += test_xmlUCSIsBopomofoExtended();
42358     test_ret += test_xmlUCSIsBoxDrawing();
42359     test_ret += test_xmlUCSIsBraillePatterns();
42360     test_ret += test_xmlUCSIsBuhid();
42361     test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42362     test_ret += test_xmlUCSIsCJKCompatibility();
42363     test_ret += test_xmlUCSIsCJKCompatibilityForms();
42364     test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42365     test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42366     test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42367     test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42368     test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42369     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42370     test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42371     test_ret += test_xmlUCSIsCat();
42372     test_ret += test_xmlUCSIsCatC();
42373     test_ret += test_xmlUCSIsCatCc();
42374     test_ret += test_xmlUCSIsCatCf();
42375     test_ret += test_xmlUCSIsCatCo();
42376     test_ret += test_xmlUCSIsCatCs();
42377     test_ret += test_xmlUCSIsCatL();
42378     test_ret += test_xmlUCSIsCatLl();
42379     test_ret += test_xmlUCSIsCatLm();
42380     test_ret += test_xmlUCSIsCatLo();
42381     test_ret += test_xmlUCSIsCatLt();
42382     test_ret += test_xmlUCSIsCatLu();
42383     test_ret += test_xmlUCSIsCatM();
42384     test_ret += test_xmlUCSIsCatMc();
42385     test_ret += test_xmlUCSIsCatMe();
42386     test_ret += test_xmlUCSIsCatMn();
42387     test_ret += test_xmlUCSIsCatN();
42388     test_ret += test_xmlUCSIsCatNd();
42389     test_ret += test_xmlUCSIsCatNl();
42390     test_ret += test_xmlUCSIsCatNo();
42391     test_ret += test_xmlUCSIsCatP();
42392     test_ret += test_xmlUCSIsCatPc();
42393     test_ret += test_xmlUCSIsCatPd();
42394     test_ret += test_xmlUCSIsCatPe();
42395     test_ret += test_xmlUCSIsCatPf();
42396     test_ret += test_xmlUCSIsCatPi();
42397     test_ret += test_xmlUCSIsCatPo();
42398     test_ret += test_xmlUCSIsCatPs();
42399     test_ret += test_xmlUCSIsCatS();
42400     test_ret += test_xmlUCSIsCatSc();
42401     test_ret += test_xmlUCSIsCatSk();
42402     test_ret += test_xmlUCSIsCatSm();
42403     test_ret += test_xmlUCSIsCatSo();
42404     test_ret += test_xmlUCSIsCatZ();
42405     test_ret += test_xmlUCSIsCatZl();
42406     test_ret += test_xmlUCSIsCatZp();
42407     test_ret += test_xmlUCSIsCatZs();
42408     test_ret += test_xmlUCSIsCherokee();
42409     test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42410     test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42411     test_ret += test_xmlUCSIsCombiningHalfMarks();
42412     test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42413     test_ret += test_xmlUCSIsControlPictures();
42414     test_ret += test_xmlUCSIsCurrencySymbols();
42415     test_ret += test_xmlUCSIsCypriotSyllabary();
42416     test_ret += test_xmlUCSIsCyrillic();
42417     test_ret += test_xmlUCSIsCyrillicSupplement();
42418     test_ret += test_xmlUCSIsDeseret();
42419     test_ret += test_xmlUCSIsDevanagari();
42420     test_ret += test_xmlUCSIsDingbats();
42421     test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42422     test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42423     test_ret += test_xmlUCSIsEthiopic();
42424     test_ret += test_xmlUCSIsGeneralPunctuation();
42425     test_ret += test_xmlUCSIsGeometricShapes();
42426     test_ret += test_xmlUCSIsGeorgian();
42427     test_ret += test_xmlUCSIsGothic();
42428     test_ret += test_xmlUCSIsGreek();
42429     test_ret += test_xmlUCSIsGreekExtended();
42430     test_ret += test_xmlUCSIsGreekandCoptic();
42431     test_ret += test_xmlUCSIsGujarati();
42432     test_ret += test_xmlUCSIsGurmukhi();
42433     test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42434     test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42435     test_ret += test_xmlUCSIsHangulJamo();
42436     test_ret += test_xmlUCSIsHangulSyllables();
42437     test_ret += test_xmlUCSIsHanunoo();
42438     test_ret += test_xmlUCSIsHebrew();
42439     test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42440     test_ret += test_xmlUCSIsHighSurrogates();
42441     test_ret += test_xmlUCSIsHiragana();
42442     test_ret += test_xmlUCSIsIPAExtensions();
42443     test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42444     test_ret += test_xmlUCSIsKanbun();
42445     test_ret += test_xmlUCSIsKangxiRadicals();
42446     test_ret += test_xmlUCSIsKannada();
42447     test_ret += test_xmlUCSIsKatakana();
42448     test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42449     test_ret += test_xmlUCSIsKhmer();
42450     test_ret += test_xmlUCSIsKhmerSymbols();
42451     test_ret += test_xmlUCSIsLao();
42452     test_ret += test_xmlUCSIsLatin1Supplement();
42453     test_ret += test_xmlUCSIsLatinExtendedA();
42454     test_ret += test_xmlUCSIsLatinExtendedAdditional();
42455     test_ret += test_xmlUCSIsLatinExtendedB();
42456     test_ret += test_xmlUCSIsLetterlikeSymbols();
42457     test_ret += test_xmlUCSIsLimbu();
42458     test_ret += test_xmlUCSIsLinearBIdeograms();
42459     test_ret += test_xmlUCSIsLinearBSyllabary();
42460     test_ret += test_xmlUCSIsLowSurrogates();
42461     test_ret += test_xmlUCSIsMalayalam();
42462     test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42463     test_ret += test_xmlUCSIsMathematicalOperators();
42464     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42465     test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42466     test_ret += test_xmlUCSIsMiscellaneousSymbols();
42467     test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42468     test_ret += test_xmlUCSIsMiscellaneousTechnical();
42469     test_ret += test_xmlUCSIsMongolian();
42470     test_ret += test_xmlUCSIsMusicalSymbols();
42471     test_ret += test_xmlUCSIsMyanmar();
42472     test_ret += test_xmlUCSIsNumberForms();
42473     test_ret += test_xmlUCSIsOgham();
42474     test_ret += test_xmlUCSIsOldItalic();
42475     test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42476     test_ret += test_xmlUCSIsOriya();
42477     test_ret += test_xmlUCSIsOsmanya();
42478     test_ret += test_xmlUCSIsPhoneticExtensions();
42479     test_ret += test_xmlUCSIsPrivateUse();
42480     test_ret += test_xmlUCSIsPrivateUseArea();
42481     test_ret += test_xmlUCSIsRunic();
42482     test_ret += test_xmlUCSIsShavian();
42483     test_ret += test_xmlUCSIsSinhala();
42484     test_ret += test_xmlUCSIsSmallFormVariants();
42485     test_ret += test_xmlUCSIsSpacingModifierLetters();
42486     test_ret += test_xmlUCSIsSpecials();
42487     test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42488     test_ret += test_xmlUCSIsSupplementalArrowsA();
42489     test_ret += test_xmlUCSIsSupplementalArrowsB();
42490     test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42491     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42492     test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42493     test_ret += test_xmlUCSIsSyriac();
42494     test_ret += test_xmlUCSIsTagalog();
42495     test_ret += test_xmlUCSIsTagbanwa();
42496     test_ret += test_xmlUCSIsTags();
42497     test_ret += test_xmlUCSIsTaiLe();
42498     test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42499     test_ret += test_xmlUCSIsTamil();
42500     test_ret += test_xmlUCSIsTelugu();
42501     test_ret += test_xmlUCSIsThaana();
42502     test_ret += test_xmlUCSIsThai();
42503     test_ret += test_xmlUCSIsTibetan();
42504     test_ret += test_xmlUCSIsUgaritic();
42505     test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42506     test_ret += test_xmlUCSIsVariationSelectors();
42507     test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42508     test_ret += test_xmlUCSIsYiRadicals();
42509     test_ret += test_xmlUCSIsYiSyllables();
42510     test_ret += test_xmlUCSIsYijingHexagramSymbols();
42511 
42512     if (test_ret != 0)
42513 	printf("Module xmlunicode: %d errors\n", test_ret);
42514     return(test_ret);
42515 }
42516 
42517 static int
test_xmlNewTextWriter(void)42518 test_xmlNewTextWriter(void) {
42519     int test_ret = 0;
42520 
42521 #if defined(LIBXML_WRITER_ENABLED)
42522     int mem_base;
42523     xmlTextWriterPtr ret_val;
42524     xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42525     int n_out;
42526 
42527     for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42528         mem_base = xmlMemBlocks();
42529         out = gen_xmlOutputBufferPtr(n_out, 0);
42530 
42531         ret_val = xmlNewTextWriter(out);
42532         if (ret_val != NULL) out = NULL;
42533         desret_xmlTextWriterPtr(ret_val);
42534         call_tests++;
42535         des_xmlOutputBufferPtr(n_out, out, 0);
42536         xmlResetLastError();
42537         if (mem_base != xmlMemBlocks()) {
42538             printf("Leak of %d blocks found in xmlNewTextWriter",
42539 	           xmlMemBlocks() - mem_base);
42540 	    test_ret++;
42541             printf(" %d", n_out);
42542             printf("\n");
42543         }
42544     }
42545     function_tests++;
42546 #endif
42547 
42548     return(test_ret);
42549 }
42550 
42551 
42552 static int
test_xmlNewTextWriterFilename(void)42553 test_xmlNewTextWriterFilename(void) {
42554     int test_ret = 0;
42555 
42556 #if defined(LIBXML_WRITER_ENABLED)
42557     int mem_base;
42558     xmlTextWriterPtr ret_val;
42559     const char * uri; /* the URI of the resource for the output */
42560     int n_uri;
42561     int compression; /* compress the output? */
42562     int n_compression;
42563 
42564     for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42565     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42566         mem_base = xmlMemBlocks();
42567         uri = gen_fileoutput(n_uri, 0);
42568         compression = gen_int(n_compression, 1);
42569 
42570         ret_val = xmlNewTextWriterFilename(uri, compression);
42571         desret_xmlTextWriterPtr(ret_val);
42572         call_tests++;
42573         des_fileoutput(n_uri, uri, 0);
42574         des_int(n_compression, compression, 1);
42575         xmlResetLastError();
42576         if (mem_base != xmlMemBlocks()) {
42577             printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42578 	           xmlMemBlocks() - mem_base);
42579 	    test_ret++;
42580             printf(" %d", n_uri);
42581             printf(" %d", n_compression);
42582             printf("\n");
42583         }
42584     }
42585     }
42586     function_tests++;
42587 #endif
42588 
42589     return(test_ret);
42590 }
42591 
42592 
42593 static int
test_xmlNewTextWriterMemory(void)42594 test_xmlNewTextWriterMemory(void) {
42595     int test_ret = 0;
42596 
42597 #if defined(LIBXML_WRITER_ENABLED)
42598     int mem_base;
42599     xmlTextWriterPtr ret_val;
42600     xmlBufferPtr buf; /* xmlBufferPtr */
42601     int n_buf;
42602     int compression; /* compress the output? */
42603     int n_compression;
42604 
42605     for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42606     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42607         mem_base = xmlMemBlocks();
42608         buf = gen_xmlBufferPtr(n_buf, 0);
42609         compression = gen_int(n_compression, 1);
42610 
42611         ret_val = xmlNewTextWriterMemory(buf, compression);
42612         desret_xmlTextWriterPtr(ret_val);
42613         call_tests++;
42614         des_xmlBufferPtr(n_buf, buf, 0);
42615         des_int(n_compression, compression, 1);
42616         xmlResetLastError();
42617         if (mem_base != xmlMemBlocks()) {
42618             printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42619 	           xmlMemBlocks() - mem_base);
42620 	    test_ret++;
42621             printf(" %d", n_buf);
42622             printf(" %d", n_compression);
42623             printf("\n");
42624         }
42625     }
42626     }
42627     function_tests++;
42628 #endif
42629 
42630     return(test_ret);
42631 }
42632 
42633 
42634 static int
test_xmlNewTextWriterPushParser(void)42635 test_xmlNewTextWriterPushParser(void) {
42636     int test_ret = 0;
42637 
42638 #if defined(LIBXML_WRITER_ENABLED)
42639     int mem_base;
42640     xmlTextWriterPtr ret_val;
42641     xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42642     int n_ctxt;
42643     int compression; /* compress the output? */
42644     int n_compression;
42645 
42646     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42647     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42648         mem_base = xmlMemBlocks();
42649         ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42650         compression = gen_int(n_compression, 1);
42651 
42652         ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42653         if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42654         desret_xmlTextWriterPtr(ret_val);
42655         call_tests++;
42656         des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42657         des_int(n_compression, compression, 1);
42658         xmlResetLastError();
42659         if (mem_base != xmlMemBlocks()) {
42660             printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42661 	           xmlMemBlocks() - mem_base);
42662 	    test_ret++;
42663             printf(" %d", n_ctxt);
42664             printf(" %d", n_compression);
42665             printf("\n");
42666         }
42667     }
42668     }
42669     function_tests++;
42670 #endif
42671 
42672     return(test_ret);
42673 }
42674 
42675 
42676 static int
test_xmlNewTextWriterTree(void)42677 test_xmlNewTextWriterTree(void) {
42678     int test_ret = 0;
42679 
42680 #if defined(LIBXML_WRITER_ENABLED)
42681     int mem_base;
42682     xmlTextWriterPtr ret_val;
42683     xmlDocPtr doc; /* xmlDocPtr */
42684     int n_doc;
42685     xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42686     int n_node;
42687     int compression; /* compress the output? */
42688     int n_compression;
42689 
42690     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42691     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42692     for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42693         mem_base = xmlMemBlocks();
42694         doc = gen_xmlDocPtr(n_doc, 0);
42695         node = gen_xmlNodePtr(n_node, 1);
42696         compression = gen_int(n_compression, 2);
42697 
42698         ret_val = xmlNewTextWriterTree(doc, node, compression);
42699         desret_xmlTextWriterPtr(ret_val);
42700         call_tests++;
42701         des_xmlDocPtr(n_doc, doc, 0);
42702         des_xmlNodePtr(n_node, node, 1);
42703         des_int(n_compression, compression, 2);
42704         xmlResetLastError();
42705         if (mem_base != xmlMemBlocks()) {
42706             printf("Leak of %d blocks found in xmlNewTextWriterTree",
42707 	           xmlMemBlocks() - mem_base);
42708 	    test_ret++;
42709             printf(" %d", n_doc);
42710             printf(" %d", n_node);
42711             printf(" %d", n_compression);
42712             printf("\n");
42713         }
42714     }
42715     }
42716     }
42717     function_tests++;
42718 #endif
42719 
42720     return(test_ret);
42721 }
42722 
42723 
42724 static int
test_xmlTextWriterEndAttribute(void)42725 test_xmlTextWriterEndAttribute(void) {
42726     int test_ret = 0;
42727 
42728 #if defined(LIBXML_WRITER_ENABLED)
42729     int mem_base;
42730     int ret_val;
42731     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42732     int n_writer;
42733 
42734     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42735         mem_base = xmlMemBlocks();
42736         writer = gen_xmlTextWriterPtr(n_writer, 0);
42737 
42738         ret_val = xmlTextWriterEndAttribute(writer);
42739         desret_int(ret_val);
42740         call_tests++;
42741         des_xmlTextWriterPtr(n_writer, writer, 0);
42742         xmlResetLastError();
42743         if (mem_base != xmlMemBlocks()) {
42744             printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42745 	           xmlMemBlocks() - mem_base);
42746 	    test_ret++;
42747             printf(" %d", n_writer);
42748             printf("\n");
42749         }
42750     }
42751     function_tests++;
42752 #endif
42753 
42754     return(test_ret);
42755 }
42756 
42757 
42758 static int
test_xmlTextWriterEndCDATA(void)42759 test_xmlTextWriterEndCDATA(void) {
42760     int test_ret = 0;
42761 
42762 #if defined(LIBXML_WRITER_ENABLED)
42763     int mem_base;
42764     int ret_val;
42765     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42766     int n_writer;
42767 
42768     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42769         mem_base = xmlMemBlocks();
42770         writer = gen_xmlTextWriterPtr(n_writer, 0);
42771 
42772         ret_val = xmlTextWriterEndCDATA(writer);
42773         desret_int(ret_val);
42774         call_tests++;
42775         des_xmlTextWriterPtr(n_writer, writer, 0);
42776         xmlResetLastError();
42777         if (mem_base != xmlMemBlocks()) {
42778             printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42779 	           xmlMemBlocks() - mem_base);
42780 	    test_ret++;
42781             printf(" %d", n_writer);
42782             printf("\n");
42783         }
42784     }
42785     function_tests++;
42786 #endif
42787 
42788     return(test_ret);
42789 }
42790 
42791 
42792 static int
test_xmlTextWriterEndComment(void)42793 test_xmlTextWriterEndComment(void) {
42794     int test_ret = 0;
42795 
42796 #if defined(LIBXML_WRITER_ENABLED)
42797     int mem_base;
42798     int ret_val;
42799     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42800     int n_writer;
42801 
42802     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42803         mem_base = xmlMemBlocks();
42804         writer = gen_xmlTextWriterPtr(n_writer, 0);
42805 
42806         ret_val = xmlTextWriterEndComment(writer);
42807         desret_int(ret_val);
42808         call_tests++;
42809         des_xmlTextWriterPtr(n_writer, writer, 0);
42810         xmlResetLastError();
42811         if (mem_base != xmlMemBlocks()) {
42812             printf("Leak of %d blocks found in xmlTextWriterEndComment",
42813 	           xmlMemBlocks() - mem_base);
42814 	    test_ret++;
42815             printf(" %d", n_writer);
42816             printf("\n");
42817         }
42818     }
42819     function_tests++;
42820 #endif
42821 
42822     return(test_ret);
42823 }
42824 
42825 
42826 static int
test_xmlTextWriterEndDTD(void)42827 test_xmlTextWriterEndDTD(void) {
42828     int test_ret = 0;
42829 
42830 #if defined(LIBXML_WRITER_ENABLED)
42831     int mem_base;
42832     int ret_val;
42833     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42834     int n_writer;
42835 
42836     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42837         mem_base = xmlMemBlocks();
42838         writer = gen_xmlTextWriterPtr(n_writer, 0);
42839 
42840         ret_val = xmlTextWriterEndDTD(writer);
42841         desret_int(ret_val);
42842         call_tests++;
42843         des_xmlTextWriterPtr(n_writer, writer, 0);
42844         xmlResetLastError();
42845         if (mem_base != xmlMemBlocks()) {
42846             printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42847 	           xmlMemBlocks() - mem_base);
42848 	    test_ret++;
42849             printf(" %d", n_writer);
42850             printf("\n");
42851         }
42852     }
42853     function_tests++;
42854 #endif
42855 
42856     return(test_ret);
42857 }
42858 
42859 
42860 static int
test_xmlTextWriterEndDTDAttlist(void)42861 test_xmlTextWriterEndDTDAttlist(void) {
42862     int test_ret = 0;
42863 
42864 #if defined(LIBXML_WRITER_ENABLED)
42865     int mem_base;
42866     int ret_val;
42867     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42868     int n_writer;
42869 
42870     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42871         mem_base = xmlMemBlocks();
42872         writer = gen_xmlTextWriterPtr(n_writer, 0);
42873 
42874         ret_val = xmlTextWriterEndDTDAttlist(writer);
42875         desret_int(ret_val);
42876         call_tests++;
42877         des_xmlTextWriterPtr(n_writer, writer, 0);
42878         xmlResetLastError();
42879         if (mem_base != xmlMemBlocks()) {
42880             printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42881 	           xmlMemBlocks() - mem_base);
42882 	    test_ret++;
42883             printf(" %d", n_writer);
42884             printf("\n");
42885         }
42886     }
42887     function_tests++;
42888 #endif
42889 
42890     return(test_ret);
42891 }
42892 
42893 
42894 static int
test_xmlTextWriterEndDTDElement(void)42895 test_xmlTextWriterEndDTDElement(void) {
42896     int test_ret = 0;
42897 
42898 #if defined(LIBXML_WRITER_ENABLED)
42899     int mem_base;
42900     int ret_val;
42901     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42902     int n_writer;
42903 
42904     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42905         mem_base = xmlMemBlocks();
42906         writer = gen_xmlTextWriterPtr(n_writer, 0);
42907 
42908         ret_val = xmlTextWriterEndDTDElement(writer);
42909         desret_int(ret_val);
42910         call_tests++;
42911         des_xmlTextWriterPtr(n_writer, writer, 0);
42912         xmlResetLastError();
42913         if (mem_base != xmlMemBlocks()) {
42914             printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
42915 	           xmlMemBlocks() - mem_base);
42916 	    test_ret++;
42917             printf(" %d", n_writer);
42918             printf("\n");
42919         }
42920     }
42921     function_tests++;
42922 #endif
42923 
42924     return(test_ret);
42925 }
42926 
42927 
42928 static int
test_xmlTextWriterEndDTDEntity(void)42929 test_xmlTextWriterEndDTDEntity(void) {
42930     int test_ret = 0;
42931 
42932 #if defined(LIBXML_WRITER_ENABLED)
42933     int mem_base;
42934     int ret_val;
42935     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42936     int n_writer;
42937 
42938     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42939         mem_base = xmlMemBlocks();
42940         writer = gen_xmlTextWriterPtr(n_writer, 0);
42941 
42942         ret_val = xmlTextWriterEndDTDEntity(writer);
42943         desret_int(ret_val);
42944         call_tests++;
42945         des_xmlTextWriterPtr(n_writer, writer, 0);
42946         xmlResetLastError();
42947         if (mem_base != xmlMemBlocks()) {
42948             printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
42949 	           xmlMemBlocks() - mem_base);
42950 	    test_ret++;
42951             printf(" %d", n_writer);
42952             printf("\n");
42953         }
42954     }
42955     function_tests++;
42956 #endif
42957 
42958     return(test_ret);
42959 }
42960 
42961 
42962 static int
test_xmlTextWriterEndDocument(void)42963 test_xmlTextWriterEndDocument(void) {
42964     int test_ret = 0;
42965 
42966 #if defined(LIBXML_WRITER_ENABLED)
42967     int mem_base;
42968     int ret_val;
42969     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42970     int n_writer;
42971 
42972     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42973         mem_base = xmlMemBlocks();
42974         writer = gen_xmlTextWriterPtr(n_writer, 0);
42975 
42976         ret_val = xmlTextWriterEndDocument(writer);
42977         desret_int(ret_val);
42978         call_tests++;
42979         des_xmlTextWriterPtr(n_writer, writer, 0);
42980         xmlResetLastError();
42981         if (mem_base != xmlMemBlocks()) {
42982             printf("Leak of %d blocks found in xmlTextWriterEndDocument",
42983 	           xmlMemBlocks() - mem_base);
42984 	    test_ret++;
42985             printf(" %d", n_writer);
42986             printf("\n");
42987         }
42988     }
42989     function_tests++;
42990 #endif
42991 
42992     return(test_ret);
42993 }
42994 
42995 
42996 static int
test_xmlTextWriterEndElement(void)42997 test_xmlTextWriterEndElement(void) {
42998     int test_ret = 0;
42999 
43000 #if defined(LIBXML_WRITER_ENABLED)
43001     int mem_base;
43002     int ret_val;
43003     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43004     int n_writer;
43005 
43006     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43007         mem_base = xmlMemBlocks();
43008         writer = gen_xmlTextWriterPtr(n_writer, 0);
43009 
43010         ret_val = xmlTextWriterEndElement(writer);
43011         desret_int(ret_val);
43012         call_tests++;
43013         des_xmlTextWriterPtr(n_writer, writer, 0);
43014         xmlResetLastError();
43015         if (mem_base != xmlMemBlocks()) {
43016             printf("Leak of %d blocks found in xmlTextWriterEndElement",
43017 	           xmlMemBlocks() - mem_base);
43018 	    test_ret++;
43019             printf(" %d", n_writer);
43020             printf("\n");
43021         }
43022     }
43023     function_tests++;
43024 #endif
43025 
43026     return(test_ret);
43027 }
43028 
43029 
43030 static int
test_xmlTextWriterEndPI(void)43031 test_xmlTextWriterEndPI(void) {
43032     int test_ret = 0;
43033 
43034 #if defined(LIBXML_WRITER_ENABLED)
43035     int mem_base;
43036     int ret_val;
43037     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43038     int n_writer;
43039 
43040     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43041         mem_base = xmlMemBlocks();
43042         writer = gen_xmlTextWriterPtr(n_writer, 0);
43043 
43044         ret_val = xmlTextWriterEndPI(writer);
43045         desret_int(ret_val);
43046         call_tests++;
43047         des_xmlTextWriterPtr(n_writer, writer, 0);
43048         xmlResetLastError();
43049         if (mem_base != xmlMemBlocks()) {
43050             printf("Leak of %d blocks found in xmlTextWriterEndPI",
43051 	           xmlMemBlocks() - mem_base);
43052 	    test_ret++;
43053             printf(" %d", n_writer);
43054             printf("\n");
43055         }
43056     }
43057     function_tests++;
43058 #endif
43059 
43060     return(test_ret);
43061 }
43062 
43063 
43064 static int
test_xmlTextWriterFlush(void)43065 test_xmlTextWriterFlush(void) {
43066     int test_ret = 0;
43067 
43068 #if defined(LIBXML_WRITER_ENABLED)
43069     int mem_base;
43070     int ret_val;
43071     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43072     int n_writer;
43073 
43074     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43075         mem_base = xmlMemBlocks();
43076         writer = gen_xmlTextWriterPtr(n_writer, 0);
43077 
43078         ret_val = xmlTextWriterFlush(writer);
43079         desret_int(ret_val);
43080         call_tests++;
43081         des_xmlTextWriterPtr(n_writer, writer, 0);
43082         xmlResetLastError();
43083         if (mem_base != xmlMemBlocks()) {
43084             printf("Leak of %d blocks found in xmlTextWriterFlush",
43085 	           xmlMemBlocks() - mem_base);
43086 	    test_ret++;
43087             printf(" %d", n_writer);
43088             printf("\n");
43089         }
43090     }
43091     function_tests++;
43092 #endif
43093 
43094     return(test_ret);
43095 }
43096 
43097 
43098 static int
test_xmlTextWriterFullEndElement(void)43099 test_xmlTextWriterFullEndElement(void) {
43100     int test_ret = 0;
43101 
43102 #if defined(LIBXML_WRITER_ENABLED)
43103     int mem_base;
43104     int ret_val;
43105     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43106     int n_writer;
43107 
43108     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43109         mem_base = xmlMemBlocks();
43110         writer = gen_xmlTextWriterPtr(n_writer, 0);
43111 
43112         ret_val = xmlTextWriterFullEndElement(writer);
43113         desret_int(ret_val);
43114         call_tests++;
43115         des_xmlTextWriterPtr(n_writer, writer, 0);
43116         xmlResetLastError();
43117         if (mem_base != xmlMemBlocks()) {
43118             printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43119 	           xmlMemBlocks() - mem_base);
43120 	    test_ret++;
43121             printf(" %d", n_writer);
43122             printf("\n");
43123         }
43124     }
43125     function_tests++;
43126 #endif
43127 
43128     return(test_ret);
43129 }
43130 
43131 
43132 static int
test_xmlTextWriterSetIndent(void)43133 test_xmlTextWriterSetIndent(void) {
43134     int test_ret = 0;
43135 
43136 #if defined(LIBXML_WRITER_ENABLED)
43137     int mem_base;
43138     int ret_val;
43139     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43140     int n_writer;
43141     int indent; /* do indentation? */
43142     int n_indent;
43143 
43144     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43145     for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43146         mem_base = xmlMemBlocks();
43147         writer = gen_xmlTextWriterPtr(n_writer, 0);
43148         indent = gen_int(n_indent, 1);
43149 
43150         ret_val = xmlTextWriterSetIndent(writer, indent);
43151         desret_int(ret_val);
43152         call_tests++;
43153         des_xmlTextWriterPtr(n_writer, writer, 0);
43154         des_int(n_indent, indent, 1);
43155         xmlResetLastError();
43156         if (mem_base != xmlMemBlocks()) {
43157             printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43158 	           xmlMemBlocks() - mem_base);
43159 	    test_ret++;
43160             printf(" %d", n_writer);
43161             printf(" %d", n_indent);
43162             printf("\n");
43163         }
43164     }
43165     }
43166     function_tests++;
43167 #endif
43168 
43169     return(test_ret);
43170 }
43171 
43172 
43173 static int
test_xmlTextWriterSetIndentString(void)43174 test_xmlTextWriterSetIndentString(void) {
43175     int test_ret = 0;
43176 
43177 #if defined(LIBXML_WRITER_ENABLED)
43178     int mem_base;
43179     int ret_val;
43180     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43181     int n_writer;
43182     xmlChar * str; /* the xmlChar string */
43183     int n_str;
43184 
43185     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43186     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43187         mem_base = xmlMemBlocks();
43188         writer = gen_xmlTextWriterPtr(n_writer, 0);
43189         str = gen_const_xmlChar_ptr(n_str, 1);
43190 
43191         ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43192         desret_int(ret_val);
43193         call_tests++;
43194         des_xmlTextWriterPtr(n_writer, writer, 0);
43195         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43196         xmlResetLastError();
43197         if (mem_base != xmlMemBlocks()) {
43198             printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43199 	           xmlMemBlocks() - mem_base);
43200 	    test_ret++;
43201             printf(" %d", n_writer);
43202             printf(" %d", n_str);
43203             printf("\n");
43204         }
43205     }
43206     }
43207     function_tests++;
43208 #endif
43209 
43210     return(test_ret);
43211 }
43212 
43213 
43214 static int
test_xmlTextWriterStartAttribute(void)43215 test_xmlTextWriterStartAttribute(void) {
43216     int test_ret = 0;
43217 
43218 #if defined(LIBXML_WRITER_ENABLED)
43219     int mem_base;
43220     int ret_val;
43221     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43222     int n_writer;
43223     xmlChar * name; /* element name */
43224     int n_name;
43225 
43226     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43227     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43228         mem_base = xmlMemBlocks();
43229         writer = gen_xmlTextWriterPtr(n_writer, 0);
43230         name = gen_const_xmlChar_ptr(n_name, 1);
43231 
43232         ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43233         desret_int(ret_val);
43234         call_tests++;
43235         des_xmlTextWriterPtr(n_writer, writer, 0);
43236         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43237         xmlResetLastError();
43238         if (mem_base != xmlMemBlocks()) {
43239             printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43240 	           xmlMemBlocks() - mem_base);
43241 	    test_ret++;
43242             printf(" %d", n_writer);
43243             printf(" %d", n_name);
43244             printf("\n");
43245         }
43246     }
43247     }
43248     function_tests++;
43249 #endif
43250 
43251     return(test_ret);
43252 }
43253 
43254 
43255 static int
test_xmlTextWriterStartAttributeNS(void)43256 test_xmlTextWriterStartAttributeNS(void) {
43257     int test_ret = 0;
43258 
43259 #if defined(LIBXML_WRITER_ENABLED)
43260     int mem_base;
43261     int ret_val;
43262     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43263     int n_writer;
43264     xmlChar * prefix; /* namespace prefix or NULL */
43265     int n_prefix;
43266     xmlChar * name; /* element local name */
43267     int n_name;
43268     xmlChar * namespaceURI; /* namespace URI or NULL */
43269     int n_namespaceURI;
43270 
43271     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43272     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43273     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43274     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43275         mem_base = xmlMemBlocks();
43276         writer = gen_xmlTextWriterPtr(n_writer, 0);
43277         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43278         name = gen_const_xmlChar_ptr(n_name, 2);
43279         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43280 
43281         ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43282         desret_int(ret_val);
43283         call_tests++;
43284         des_xmlTextWriterPtr(n_writer, writer, 0);
43285         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43286         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43287         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43288         xmlResetLastError();
43289         if (mem_base != xmlMemBlocks()) {
43290             printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43291 	           xmlMemBlocks() - mem_base);
43292 	    test_ret++;
43293             printf(" %d", n_writer);
43294             printf(" %d", n_prefix);
43295             printf(" %d", n_name);
43296             printf(" %d", n_namespaceURI);
43297             printf("\n");
43298         }
43299     }
43300     }
43301     }
43302     }
43303     function_tests++;
43304 #endif
43305 
43306     return(test_ret);
43307 }
43308 
43309 
43310 static int
test_xmlTextWriterStartCDATA(void)43311 test_xmlTextWriterStartCDATA(void) {
43312     int test_ret = 0;
43313 
43314 #if defined(LIBXML_WRITER_ENABLED)
43315     int mem_base;
43316     int ret_val;
43317     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43318     int n_writer;
43319 
43320     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43321         mem_base = xmlMemBlocks();
43322         writer = gen_xmlTextWriterPtr(n_writer, 0);
43323 
43324         ret_val = xmlTextWriterStartCDATA(writer);
43325         desret_int(ret_val);
43326         call_tests++;
43327         des_xmlTextWriterPtr(n_writer, writer, 0);
43328         xmlResetLastError();
43329         if (mem_base != xmlMemBlocks()) {
43330             printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43331 	           xmlMemBlocks() - mem_base);
43332 	    test_ret++;
43333             printf(" %d", n_writer);
43334             printf("\n");
43335         }
43336     }
43337     function_tests++;
43338 #endif
43339 
43340     return(test_ret);
43341 }
43342 
43343 
43344 static int
test_xmlTextWriterStartComment(void)43345 test_xmlTextWriterStartComment(void) {
43346     int test_ret = 0;
43347 
43348 #if defined(LIBXML_WRITER_ENABLED)
43349     int mem_base;
43350     int ret_val;
43351     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43352     int n_writer;
43353 
43354     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43355         mem_base = xmlMemBlocks();
43356         writer = gen_xmlTextWriterPtr(n_writer, 0);
43357 
43358         ret_val = xmlTextWriterStartComment(writer);
43359         desret_int(ret_val);
43360         call_tests++;
43361         des_xmlTextWriterPtr(n_writer, writer, 0);
43362         xmlResetLastError();
43363         if (mem_base != xmlMemBlocks()) {
43364             printf("Leak of %d blocks found in xmlTextWriterStartComment",
43365 	           xmlMemBlocks() - mem_base);
43366 	    test_ret++;
43367             printf(" %d", n_writer);
43368             printf("\n");
43369         }
43370     }
43371     function_tests++;
43372 #endif
43373 
43374     return(test_ret);
43375 }
43376 
43377 
43378 static int
test_xmlTextWriterStartDTD(void)43379 test_xmlTextWriterStartDTD(void) {
43380     int test_ret = 0;
43381 
43382 #if defined(LIBXML_WRITER_ENABLED)
43383     int mem_base;
43384     int ret_val;
43385     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43386     int n_writer;
43387     xmlChar * name; /* the name of the DTD */
43388     int n_name;
43389     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43390     int n_pubid;
43391     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43392     int n_sysid;
43393 
43394     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43395     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43396     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43397     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43398         mem_base = xmlMemBlocks();
43399         writer = gen_xmlTextWriterPtr(n_writer, 0);
43400         name = gen_const_xmlChar_ptr(n_name, 1);
43401         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43402         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43403 
43404         ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43405         desret_int(ret_val);
43406         call_tests++;
43407         des_xmlTextWriterPtr(n_writer, writer, 0);
43408         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43409         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43410         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43411         xmlResetLastError();
43412         if (mem_base != xmlMemBlocks()) {
43413             printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43414 	           xmlMemBlocks() - mem_base);
43415 	    test_ret++;
43416             printf(" %d", n_writer);
43417             printf(" %d", n_name);
43418             printf(" %d", n_pubid);
43419             printf(" %d", n_sysid);
43420             printf("\n");
43421         }
43422     }
43423     }
43424     }
43425     }
43426     function_tests++;
43427 #endif
43428 
43429     return(test_ret);
43430 }
43431 
43432 
43433 static int
test_xmlTextWriterStartDTDAttlist(void)43434 test_xmlTextWriterStartDTDAttlist(void) {
43435     int test_ret = 0;
43436 
43437 #if defined(LIBXML_WRITER_ENABLED)
43438     int mem_base;
43439     int ret_val;
43440     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43441     int n_writer;
43442     xmlChar * name; /* the name of the DTD ATTLIST */
43443     int n_name;
43444 
43445     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43446     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43447         mem_base = xmlMemBlocks();
43448         writer = gen_xmlTextWriterPtr(n_writer, 0);
43449         name = gen_const_xmlChar_ptr(n_name, 1);
43450 
43451         ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43452         desret_int(ret_val);
43453         call_tests++;
43454         des_xmlTextWriterPtr(n_writer, writer, 0);
43455         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43456         xmlResetLastError();
43457         if (mem_base != xmlMemBlocks()) {
43458             printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43459 	           xmlMemBlocks() - mem_base);
43460 	    test_ret++;
43461             printf(" %d", n_writer);
43462             printf(" %d", n_name);
43463             printf("\n");
43464         }
43465     }
43466     }
43467     function_tests++;
43468 #endif
43469 
43470     return(test_ret);
43471 }
43472 
43473 
43474 static int
test_xmlTextWriterStartDTDElement(void)43475 test_xmlTextWriterStartDTDElement(void) {
43476     int test_ret = 0;
43477 
43478 #if defined(LIBXML_WRITER_ENABLED)
43479     int mem_base;
43480     int ret_val;
43481     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43482     int n_writer;
43483     xmlChar * name; /* the name of the DTD element */
43484     int n_name;
43485 
43486     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43487     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43488         mem_base = xmlMemBlocks();
43489         writer = gen_xmlTextWriterPtr(n_writer, 0);
43490         name = gen_const_xmlChar_ptr(n_name, 1);
43491 
43492         ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43493         desret_int(ret_val);
43494         call_tests++;
43495         des_xmlTextWriterPtr(n_writer, writer, 0);
43496         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43497         xmlResetLastError();
43498         if (mem_base != xmlMemBlocks()) {
43499             printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43500 	           xmlMemBlocks() - mem_base);
43501 	    test_ret++;
43502             printf(" %d", n_writer);
43503             printf(" %d", n_name);
43504             printf("\n");
43505         }
43506     }
43507     }
43508     function_tests++;
43509 #endif
43510 
43511     return(test_ret);
43512 }
43513 
43514 
43515 static int
test_xmlTextWriterStartDTDEntity(void)43516 test_xmlTextWriterStartDTDEntity(void) {
43517     int test_ret = 0;
43518 
43519 #if defined(LIBXML_WRITER_ENABLED)
43520     int mem_base;
43521     int ret_val;
43522     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43523     int n_writer;
43524     int pe; /* TRUE if this is a parameter entity, FALSE if not */
43525     int n_pe;
43526     xmlChar * name; /* the name of the DTD ATTLIST */
43527     int n_name;
43528 
43529     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43530     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43531     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43532         mem_base = xmlMemBlocks();
43533         writer = gen_xmlTextWriterPtr(n_writer, 0);
43534         pe = gen_int(n_pe, 1);
43535         name = gen_const_xmlChar_ptr(n_name, 2);
43536 
43537         ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43538         desret_int(ret_val);
43539         call_tests++;
43540         des_xmlTextWriterPtr(n_writer, writer, 0);
43541         des_int(n_pe, pe, 1);
43542         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43543         xmlResetLastError();
43544         if (mem_base != xmlMemBlocks()) {
43545             printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43546 	           xmlMemBlocks() - mem_base);
43547 	    test_ret++;
43548             printf(" %d", n_writer);
43549             printf(" %d", n_pe);
43550             printf(" %d", n_name);
43551             printf("\n");
43552         }
43553     }
43554     }
43555     }
43556     function_tests++;
43557 #endif
43558 
43559     return(test_ret);
43560 }
43561 
43562 
43563 static int
test_xmlTextWriterStartDocument(void)43564 test_xmlTextWriterStartDocument(void) {
43565     int test_ret = 0;
43566 
43567 #if defined(LIBXML_WRITER_ENABLED)
43568     int mem_base;
43569     int ret_val;
43570     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43571     int n_writer;
43572     char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43573     int n_version;
43574     char * encoding; /* the encoding or NULL for default */
43575     int n_encoding;
43576     char * standalone; /* "yes" or "no" or NULL for default */
43577     int n_standalone;
43578 
43579     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43580     for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43581     for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43582     for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43583         mem_base = xmlMemBlocks();
43584         writer = gen_xmlTextWriterPtr(n_writer, 0);
43585         version = gen_const_char_ptr(n_version, 1);
43586         encoding = gen_const_char_ptr(n_encoding, 2);
43587         standalone = gen_const_char_ptr(n_standalone, 3);
43588 
43589         ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43590         desret_int(ret_val);
43591         call_tests++;
43592         des_xmlTextWriterPtr(n_writer, writer, 0);
43593         des_const_char_ptr(n_version, (const char *)version, 1);
43594         des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43595         des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43596         xmlResetLastError();
43597         if (mem_base != xmlMemBlocks()) {
43598             printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43599 	           xmlMemBlocks() - mem_base);
43600 	    test_ret++;
43601             printf(" %d", n_writer);
43602             printf(" %d", n_version);
43603             printf(" %d", n_encoding);
43604             printf(" %d", n_standalone);
43605             printf("\n");
43606         }
43607     }
43608     }
43609     }
43610     }
43611     function_tests++;
43612 #endif
43613 
43614     return(test_ret);
43615 }
43616 
43617 
43618 static int
test_xmlTextWriterStartElement(void)43619 test_xmlTextWriterStartElement(void) {
43620     int test_ret = 0;
43621 
43622 #if defined(LIBXML_WRITER_ENABLED)
43623     int mem_base;
43624     int ret_val;
43625     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43626     int n_writer;
43627     xmlChar * name; /* element name */
43628     int n_name;
43629 
43630     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43631     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43632         mem_base = xmlMemBlocks();
43633         writer = gen_xmlTextWriterPtr(n_writer, 0);
43634         name = gen_const_xmlChar_ptr(n_name, 1);
43635 
43636         ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43637         desret_int(ret_val);
43638         call_tests++;
43639         des_xmlTextWriterPtr(n_writer, writer, 0);
43640         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43641         xmlResetLastError();
43642         if (mem_base != xmlMemBlocks()) {
43643             printf("Leak of %d blocks found in xmlTextWriterStartElement",
43644 	           xmlMemBlocks() - mem_base);
43645 	    test_ret++;
43646             printf(" %d", n_writer);
43647             printf(" %d", n_name);
43648             printf("\n");
43649         }
43650     }
43651     }
43652     function_tests++;
43653 #endif
43654 
43655     return(test_ret);
43656 }
43657 
43658 
43659 static int
test_xmlTextWriterStartElementNS(void)43660 test_xmlTextWriterStartElementNS(void) {
43661     int test_ret = 0;
43662 
43663 #if defined(LIBXML_WRITER_ENABLED)
43664     int mem_base;
43665     int ret_val;
43666     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43667     int n_writer;
43668     xmlChar * prefix; /* namespace prefix or NULL */
43669     int n_prefix;
43670     xmlChar * name; /* element local name */
43671     int n_name;
43672     xmlChar * namespaceURI; /* namespace URI or NULL */
43673     int n_namespaceURI;
43674 
43675     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43676     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43677     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43678     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43679         mem_base = xmlMemBlocks();
43680         writer = gen_xmlTextWriterPtr(n_writer, 0);
43681         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43682         name = gen_const_xmlChar_ptr(n_name, 2);
43683         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43684 
43685         ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43686         desret_int(ret_val);
43687         call_tests++;
43688         des_xmlTextWriterPtr(n_writer, writer, 0);
43689         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43690         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43691         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43692         xmlResetLastError();
43693         if (mem_base != xmlMemBlocks()) {
43694             printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43695 	           xmlMemBlocks() - mem_base);
43696 	    test_ret++;
43697             printf(" %d", n_writer);
43698             printf(" %d", n_prefix);
43699             printf(" %d", n_name);
43700             printf(" %d", n_namespaceURI);
43701             printf("\n");
43702         }
43703     }
43704     }
43705     }
43706     }
43707     function_tests++;
43708 #endif
43709 
43710     return(test_ret);
43711 }
43712 
43713 
43714 static int
test_xmlTextWriterStartPI(void)43715 test_xmlTextWriterStartPI(void) {
43716     int test_ret = 0;
43717 
43718 #if defined(LIBXML_WRITER_ENABLED)
43719     int mem_base;
43720     int ret_val;
43721     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43722     int n_writer;
43723     xmlChar * target; /* PI target */
43724     int n_target;
43725 
43726     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43727     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43728         mem_base = xmlMemBlocks();
43729         writer = gen_xmlTextWriterPtr(n_writer, 0);
43730         target = gen_const_xmlChar_ptr(n_target, 1);
43731 
43732         ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43733         desret_int(ret_val);
43734         call_tests++;
43735         des_xmlTextWriterPtr(n_writer, writer, 0);
43736         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43737         xmlResetLastError();
43738         if (mem_base != xmlMemBlocks()) {
43739             printf("Leak of %d blocks found in xmlTextWriterStartPI",
43740 	           xmlMemBlocks() - mem_base);
43741 	    test_ret++;
43742             printf(" %d", n_writer);
43743             printf(" %d", n_target);
43744             printf("\n");
43745         }
43746     }
43747     }
43748     function_tests++;
43749 #endif
43750 
43751     return(test_ret);
43752 }
43753 
43754 
43755 static int
test_xmlTextWriterWriteAttribute(void)43756 test_xmlTextWriterWriteAttribute(void) {
43757     int test_ret = 0;
43758 
43759 #if defined(LIBXML_WRITER_ENABLED)
43760     int mem_base;
43761     int ret_val;
43762     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43763     int n_writer;
43764     xmlChar * name; /* attribute name */
43765     int n_name;
43766     xmlChar * content; /* attribute content */
43767     int n_content;
43768 
43769     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43770     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43771     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43772         mem_base = xmlMemBlocks();
43773         writer = gen_xmlTextWriterPtr(n_writer, 0);
43774         name = gen_const_xmlChar_ptr(n_name, 1);
43775         content = gen_const_xmlChar_ptr(n_content, 2);
43776 
43777         ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43778         desret_int(ret_val);
43779         call_tests++;
43780         des_xmlTextWriterPtr(n_writer, writer, 0);
43781         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43782         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43783         xmlResetLastError();
43784         if (mem_base != xmlMemBlocks()) {
43785             printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43786 	           xmlMemBlocks() - mem_base);
43787 	    test_ret++;
43788             printf(" %d", n_writer);
43789             printf(" %d", n_name);
43790             printf(" %d", n_content);
43791             printf("\n");
43792         }
43793     }
43794     }
43795     }
43796     function_tests++;
43797 #endif
43798 
43799     return(test_ret);
43800 }
43801 
43802 
43803 static int
test_xmlTextWriterWriteAttributeNS(void)43804 test_xmlTextWriterWriteAttributeNS(void) {
43805     int test_ret = 0;
43806 
43807 #if defined(LIBXML_WRITER_ENABLED)
43808     int mem_base;
43809     int ret_val;
43810     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43811     int n_writer;
43812     xmlChar * prefix; /* namespace prefix */
43813     int n_prefix;
43814     xmlChar * name; /* attribute local name */
43815     int n_name;
43816     xmlChar * namespaceURI; /* namespace URI */
43817     int n_namespaceURI;
43818     xmlChar * content; /* attribute content */
43819     int n_content;
43820 
43821     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43822     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43823     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43824     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43825     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43826         mem_base = xmlMemBlocks();
43827         writer = gen_xmlTextWriterPtr(n_writer, 0);
43828         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43829         name = gen_const_xmlChar_ptr(n_name, 2);
43830         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43831         content = gen_const_xmlChar_ptr(n_content, 4);
43832 
43833         ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43834         desret_int(ret_val);
43835         call_tests++;
43836         des_xmlTextWriterPtr(n_writer, writer, 0);
43837         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43838         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43839         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43840         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43841         xmlResetLastError();
43842         if (mem_base != xmlMemBlocks()) {
43843             printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43844 	           xmlMemBlocks() - mem_base);
43845 	    test_ret++;
43846             printf(" %d", n_writer);
43847             printf(" %d", n_prefix);
43848             printf(" %d", n_name);
43849             printf(" %d", n_namespaceURI);
43850             printf(" %d", n_content);
43851             printf("\n");
43852         }
43853     }
43854     }
43855     }
43856     }
43857     }
43858     function_tests++;
43859 #endif
43860 
43861     return(test_ret);
43862 }
43863 
43864 
43865 static int
test_xmlTextWriterWriteBase64(void)43866 test_xmlTextWriterWriteBase64(void) {
43867     int test_ret = 0;
43868 
43869 #if defined(LIBXML_WRITER_ENABLED)
43870     int mem_base;
43871     int ret_val;
43872     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43873     int n_writer;
43874     char * data; /* binary data */
43875     int n_data;
43876     int start; /* the position within the data of the first byte to encode */
43877     int n_start;
43878     int len; /* the number of bytes to encode */
43879     int n_len;
43880 
43881     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43882     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43883     for (n_start = 0;n_start < gen_nb_int;n_start++) {
43884     for (n_len = 0;n_len < gen_nb_int;n_len++) {
43885         mem_base = xmlMemBlocks();
43886         writer = gen_xmlTextWriterPtr(n_writer, 0);
43887         data = gen_const_char_ptr(n_data, 1);
43888         start = gen_int(n_start, 2);
43889         len = gen_int(n_len, 3);
43890 
43891         ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43892         desret_int(ret_val);
43893         call_tests++;
43894         des_xmlTextWriterPtr(n_writer, writer, 0);
43895         des_const_char_ptr(n_data, (const char *)data, 1);
43896         des_int(n_start, start, 2);
43897         des_int(n_len, len, 3);
43898         xmlResetLastError();
43899         if (mem_base != xmlMemBlocks()) {
43900             printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43901 	           xmlMemBlocks() - mem_base);
43902 	    test_ret++;
43903             printf(" %d", n_writer);
43904             printf(" %d", n_data);
43905             printf(" %d", n_start);
43906             printf(" %d", n_len);
43907             printf("\n");
43908         }
43909     }
43910     }
43911     }
43912     }
43913     function_tests++;
43914 #endif
43915 
43916     return(test_ret);
43917 }
43918 
43919 
43920 static int
test_xmlTextWriterWriteBinHex(void)43921 test_xmlTextWriterWriteBinHex(void) {
43922     int test_ret = 0;
43923 
43924 #if defined(LIBXML_WRITER_ENABLED)
43925     int mem_base;
43926     int ret_val;
43927     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43928     int n_writer;
43929     char * data; /* binary data */
43930     int n_data;
43931     int start; /* the position within the data of the first byte to encode */
43932     int n_start;
43933     int len; /* the number of bytes to encode */
43934     int n_len;
43935 
43936     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43937     for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43938     for (n_start = 0;n_start < gen_nb_int;n_start++) {
43939     for (n_len = 0;n_len < gen_nb_int;n_len++) {
43940         mem_base = xmlMemBlocks();
43941         writer = gen_xmlTextWriterPtr(n_writer, 0);
43942         data = gen_const_char_ptr(n_data, 1);
43943         start = gen_int(n_start, 2);
43944         len = gen_int(n_len, 3);
43945 
43946         ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
43947         desret_int(ret_val);
43948         call_tests++;
43949         des_xmlTextWriterPtr(n_writer, writer, 0);
43950         des_const_char_ptr(n_data, (const char *)data, 1);
43951         des_int(n_start, start, 2);
43952         des_int(n_len, len, 3);
43953         xmlResetLastError();
43954         if (mem_base != xmlMemBlocks()) {
43955             printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
43956 	           xmlMemBlocks() - mem_base);
43957 	    test_ret++;
43958             printf(" %d", n_writer);
43959             printf(" %d", n_data);
43960             printf(" %d", n_start);
43961             printf(" %d", n_len);
43962             printf("\n");
43963         }
43964     }
43965     }
43966     }
43967     }
43968     function_tests++;
43969 #endif
43970 
43971     return(test_ret);
43972 }
43973 
43974 
43975 static int
test_xmlTextWriterWriteCDATA(void)43976 test_xmlTextWriterWriteCDATA(void) {
43977     int test_ret = 0;
43978 
43979 #if defined(LIBXML_WRITER_ENABLED)
43980     int mem_base;
43981     int ret_val;
43982     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43983     int n_writer;
43984     xmlChar * content; /* CDATA content */
43985     int n_content;
43986 
43987     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43988     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43989         mem_base = xmlMemBlocks();
43990         writer = gen_xmlTextWriterPtr(n_writer, 0);
43991         content = gen_const_xmlChar_ptr(n_content, 1);
43992 
43993         ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
43994         desret_int(ret_val);
43995         call_tests++;
43996         des_xmlTextWriterPtr(n_writer, writer, 0);
43997         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
43998         xmlResetLastError();
43999         if (mem_base != xmlMemBlocks()) {
44000             printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44001 	           xmlMemBlocks() - mem_base);
44002 	    test_ret++;
44003             printf(" %d", n_writer);
44004             printf(" %d", n_content);
44005             printf("\n");
44006         }
44007     }
44008     }
44009     function_tests++;
44010 #endif
44011 
44012     return(test_ret);
44013 }
44014 
44015 
44016 static int
test_xmlTextWriterWriteComment(void)44017 test_xmlTextWriterWriteComment(void) {
44018     int test_ret = 0;
44019 
44020 #if defined(LIBXML_WRITER_ENABLED)
44021     int mem_base;
44022     int ret_val;
44023     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44024     int n_writer;
44025     xmlChar * content; /* comment string */
44026     int n_content;
44027 
44028     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44029     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44030         mem_base = xmlMemBlocks();
44031         writer = gen_xmlTextWriterPtr(n_writer, 0);
44032         content = gen_const_xmlChar_ptr(n_content, 1);
44033 
44034         ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44035         desret_int(ret_val);
44036         call_tests++;
44037         des_xmlTextWriterPtr(n_writer, writer, 0);
44038         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44039         xmlResetLastError();
44040         if (mem_base != xmlMemBlocks()) {
44041             printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44042 	           xmlMemBlocks() - mem_base);
44043 	    test_ret++;
44044             printf(" %d", n_writer);
44045             printf(" %d", n_content);
44046             printf("\n");
44047         }
44048     }
44049     }
44050     function_tests++;
44051 #endif
44052 
44053     return(test_ret);
44054 }
44055 
44056 
44057 static int
test_xmlTextWriterWriteDTD(void)44058 test_xmlTextWriterWriteDTD(void) {
44059     int test_ret = 0;
44060 
44061 #if defined(LIBXML_WRITER_ENABLED)
44062     int mem_base;
44063     int ret_val;
44064     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44065     int n_writer;
44066     xmlChar * name; /* the name of the DTD */
44067     int n_name;
44068     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44069     int n_pubid;
44070     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44071     int n_sysid;
44072     xmlChar * subset; /* string content of the DTD */
44073     int n_subset;
44074 
44075     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44076     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44077     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44078     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44079     for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44080         mem_base = xmlMemBlocks();
44081         writer = gen_xmlTextWriterPtr(n_writer, 0);
44082         name = gen_const_xmlChar_ptr(n_name, 1);
44083         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44084         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44085         subset = gen_const_xmlChar_ptr(n_subset, 4);
44086 
44087         ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44088         desret_int(ret_val);
44089         call_tests++;
44090         des_xmlTextWriterPtr(n_writer, writer, 0);
44091         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44092         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44093         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44094         des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44095         xmlResetLastError();
44096         if (mem_base != xmlMemBlocks()) {
44097             printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44098 	           xmlMemBlocks() - mem_base);
44099 	    test_ret++;
44100             printf(" %d", n_writer);
44101             printf(" %d", n_name);
44102             printf(" %d", n_pubid);
44103             printf(" %d", n_sysid);
44104             printf(" %d", n_subset);
44105             printf("\n");
44106         }
44107     }
44108     }
44109     }
44110     }
44111     }
44112     function_tests++;
44113 #endif
44114 
44115     return(test_ret);
44116 }
44117 
44118 
44119 static int
test_xmlTextWriterWriteDTDAttlist(void)44120 test_xmlTextWriterWriteDTDAttlist(void) {
44121     int test_ret = 0;
44122 
44123 #if defined(LIBXML_WRITER_ENABLED)
44124     int mem_base;
44125     int ret_val;
44126     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44127     int n_writer;
44128     xmlChar * name; /* the name of the DTD ATTLIST */
44129     int n_name;
44130     xmlChar * content; /* content of the ATTLIST */
44131     int n_content;
44132 
44133     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44134     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44135     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44136         mem_base = xmlMemBlocks();
44137         writer = gen_xmlTextWriterPtr(n_writer, 0);
44138         name = gen_const_xmlChar_ptr(n_name, 1);
44139         content = gen_const_xmlChar_ptr(n_content, 2);
44140 
44141         ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44142         desret_int(ret_val);
44143         call_tests++;
44144         des_xmlTextWriterPtr(n_writer, writer, 0);
44145         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44146         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44147         xmlResetLastError();
44148         if (mem_base != xmlMemBlocks()) {
44149             printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44150 	           xmlMemBlocks() - mem_base);
44151 	    test_ret++;
44152             printf(" %d", n_writer);
44153             printf(" %d", n_name);
44154             printf(" %d", n_content);
44155             printf("\n");
44156         }
44157     }
44158     }
44159     }
44160     function_tests++;
44161 #endif
44162 
44163     return(test_ret);
44164 }
44165 
44166 
44167 static int
test_xmlTextWriterWriteDTDElement(void)44168 test_xmlTextWriterWriteDTDElement(void) {
44169     int test_ret = 0;
44170 
44171 #if defined(LIBXML_WRITER_ENABLED)
44172     int mem_base;
44173     int ret_val;
44174     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44175     int n_writer;
44176     xmlChar * name; /* the name of the DTD element */
44177     int n_name;
44178     xmlChar * content; /* content of the element */
44179     int n_content;
44180 
44181     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44182     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44183     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44184         mem_base = xmlMemBlocks();
44185         writer = gen_xmlTextWriterPtr(n_writer, 0);
44186         name = gen_const_xmlChar_ptr(n_name, 1);
44187         content = gen_const_xmlChar_ptr(n_content, 2);
44188 
44189         ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44190         desret_int(ret_val);
44191         call_tests++;
44192         des_xmlTextWriterPtr(n_writer, writer, 0);
44193         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44194         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44195         xmlResetLastError();
44196         if (mem_base != xmlMemBlocks()) {
44197             printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44198 	           xmlMemBlocks() - mem_base);
44199 	    test_ret++;
44200             printf(" %d", n_writer);
44201             printf(" %d", n_name);
44202             printf(" %d", n_content);
44203             printf("\n");
44204         }
44205     }
44206     }
44207     }
44208     function_tests++;
44209 #endif
44210 
44211     return(test_ret);
44212 }
44213 
44214 
44215 static int
test_xmlTextWriterWriteDTDEntity(void)44216 test_xmlTextWriterWriteDTDEntity(void) {
44217     int test_ret = 0;
44218 
44219 #if defined(LIBXML_WRITER_ENABLED)
44220     int mem_base;
44221     int ret_val;
44222     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44223     int n_writer;
44224     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44225     int n_pe;
44226     xmlChar * name; /* the name of the DTD entity */
44227     int n_name;
44228     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44229     int n_pubid;
44230     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44231     int n_sysid;
44232     xmlChar * ndataid; /* the xml notation name. */
44233     int n_ndataid;
44234     xmlChar * content; /* content of the entity */
44235     int n_content;
44236 
44237     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44238     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44239     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44240     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44241     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44242     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44243     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44244         mem_base = xmlMemBlocks();
44245         writer = gen_xmlTextWriterPtr(n_writer, 0);
44246         pe = gen_int(n_pe, 1);
44247         name = gen_const_xmlChar_ptr(n_name, 2);
44248         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44249         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44250         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44251         content = gen_const_xmlChar_ptr(n_content, 6);
44252 
44253         ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44254         desret_int(ret_val);
44255         call_tests++;
44256         des_xmlTextWriterPtr(n_writer, writer, 0);
44257         des_int(n_pe, pe, 1);
44258         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44259         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44260         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44261         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44262         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44263         xmlResetLastError();
44264         if (mem_base != xmlMemBlocks()) {
44265             printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44266 	           xmlMemBlocks() - mem_base);
44267 	    test_ret++;
44268             printf(" %d", n_writer);
44269             printf(" %d", n_pe);
44270             printf(" %d", n_name);
44271             printf(" %d", n_pubid);
44272             printf(" %d", n_sysid);
44273             printf(" %d", n_ndataid);
44274             printf(" %d", n_content);
44275             printf("\n");
44276         }
44277     }
44278     }
44279     }
44280     }
44281     }
44282     }
44283     }
44284     function_tests++;
44285 #endif
44286 
44287     return(test_ret);
44288 }
44289 
44290 
44291 static int
test_xmlTextWriterWriteDTDExternalEntity(void)44292 test_xmlTextWriterWriteDTDExternalEntity(void) {
44293     int test_ret = 0;
44294 
44295 #if defined(LIBXML_WRITER_ENABLED)
44296     int mem_base;
44297     int ret_val;
44298     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44299     int n_writer;
44300     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44301     int n_pe;
44302     xmlChar * name; /* the name of the DTD entity */
44303     int n_name;
44304     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44305     int n_pubid;
44306     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44307     int n_sysid;
44308     xmlChar * ndataid; /* the xml notation name. */
44309     int n_ndataid;
44310 
44311     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44312     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44313     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44314     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44315     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44316     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44317         mem_base = xmlMemBlocks();
44318         writer = gen_xmlTextWriterPtr(n_writer, 0);
44319         pe = gen_int(n_pe, 1);
44320         name = gen_const_xmlChar_ptr(n_name, 2);
44321         pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44322         sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44323         ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44324 
44325         ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44326         desret_int(ret_val);
44327         call_tests++;
44328         des_xmlTextWriterPtr(n_writer, writer, 0);
44329         des_int(n_pe, pe, 1);
44330         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44331         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44332         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44333         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44334         xmlResetLastError();
44335         if (mem_base != xmlMemBlocks()) {
44336             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44337 	           xmlMemBlocks() - mem_base);
44338 	    test_ret++;
44339             printf(" %d", n_writer);
44340             printf(" %d", n_pe);
44341             printf(" %d", n_name);
44342             printf(" %d", n_pubid);
44343             printf(" %d", n_sysid);
44344             printf(" %d", n_ndataid);
44345             printf("\n");
44346         }
44347     }
44348     }
44349     }
44350     }
44351     }
44352     }
44353     function_tests++;
44354 #endif
44355 
44356     return(test_ret);
44357 }
44358 
44359 
44360 static int
test_xmlTextWriterWriteDTDExternalEntityContents(void)44361 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44362     int test_ret = 0;
44363 
44364 #if defined(LIBXML_WRITER_ENABLED)
44365     int mem_base;
44366     int ret_val;
44367     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44368     int n_writer;
44369     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44370     int n_pubid;
44371     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44372     int n_sysid;
44373     xmlChar * ndataid; /* the xml notation name. */
44374     int n_ndataid;
44375 
44376     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44377     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44378     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44379     for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44380         mem_base = xmlMemBlocks();
44381         writer = gen_xmlTextWriterPtr(n_writer, 0);
44382         pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44383         sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44384         ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44385 
44386         ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44387         desret_int(ret_val);
44388         call_tests++;
44389         des_xmlTextWriterPtr(n_writer, writer, 0);
44390         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44391         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44392         des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44393         xmlResetLastError();
44394         if (mem_base != xmlMemBlocks()) {
44395             printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44396 	           xmlMemBlocks() - mem_base);
44397 	    test_ret++;
44398             printf(" %d", n_writer);
44399             printf(" %d", n_pubid);
44400             printf(" %d", n_sysid);
44401             printf(" %d", n_ndataid);
44402             printf("\n");
44403         }
44404     }
44405     }
44406     }
44407     }
44408     function_tests++;
44409 #endif
44410 
44411     return(test_ret);
44412 }
44413 
44414 
44415 static int
test_xmlTextWriterWriteDTDInternalEntity(void)44416 test_xmlTextWriterWriteDTDInternalEntity(void) {
44417     int test_ret = 0;
44418 
44419 #if defined(LIBXML_WRITER_ENABLED)
44420     int mem_base;
44421     int ret_val;
44422     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44423     int n_writer;
44424     int pe; /* TRUE if this is a parameter entity, FALSE if not */
44425     int n_pe;
44426     xmlChar * name; /* the name of the DTD entity */
44427     int n_name;
44428     xmlChar * content; /* content of the entity */
44429     int n_content;
44430 
44431     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44432     for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44433     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44434     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44435         mem_base = xmlMemBlocks();
44436         writer = gen_xmlTextWriterPtr(n_writer, 0);
44437         pe = gen_int(n_pe, 1);
44438         name = gen_const_xmlChar_ptr(n_name, 2);
44439         content = gen_const_xmlChar_ptr(n_content, 3);
44440 
44441         ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44442         desret_int(ret_val);
44443         call_tests++;
44444         des_xmlTextWriterPtr(n_writer, writer, 0);
44445         des_int(n_pe, pe, 1);
44446         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44447         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44448         xmlResetLastError();
44449         if (mem_base != xmlMemBlocks()) {
44450             printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44451 	           xmlMemBlocks() - mem_base);
44452 	    test_ret++;
44453             printf(" %d", n_writer);
44454             printf(" %d", n_pe);
44455             printf(" %d", n_name);
44456             printf(" %d", n_content);
44457             printf("\n");
44458         }
44459     }
44460     }
44461     }
44462     }
44463     function_tests++;
44464 #endif
44465 
44466     return(test_ret);
44467 }
44468 
44469 
44470 static int
test_xmlTextWriterWriteDTDNotation(void)44471 test_xmlTextWriterWriteDTDNotation(void) {
44472     int test_ret = 0;
44473 
44474 #if defined(LIBXML_WRITER_ENABLED)
44475     int mem_base;
44476     int ret_val;
44477     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44478     int n_writer;
44479     xmlChar * name; /* the name of the xml notation */
44480     int n_name;
44481     xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44482     int n_pubid;
44483     xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44484     int n_sysid;
44485 
44486     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44487     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44488     for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44489     for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44490         mem_base = xmlMemBlocks();
44491         writer = gen_xmlTextWriterPtr(n_writer, 0);
44492         name = gen_const_xmlChar_ptr(n_name, 1);
44493         pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44494         sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44495 
44496         ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44497         desret_int(ret_val);
44498         call_tests++;
44499         des_xmlTextWriterPtr(n_writer, writer, 0);
44500         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44501         des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44502         des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44503         xmlResetLastError();
44504         if (mem_base != xmlMemBlocks()) {
44505             printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44506 	           xmlMemBlocks() - mem_base);
44507 	    test_ret++;
44508             printf(" %d", n_writer);
44509             printf(" %d", n_name);
44510             printf(" %d", n_pubid);
44511             printf(" %d", n_sysid);
44512             printf("\n");
44513         }
44514     }
44515     }
44516     }
44517     }
44518     function_tests++;
44519 #endif
44520 
44521     return(test_ret);
44522 }
44523 
44524 
44525 static int
test_xmlTextWriterWriteElement(void)44526 test_xmlTextWriterWriteElement(void) {
44527     int test_ret = 0;
44528 
44529 #if defined(LIBXML_WRITER_ENABLED)
44530     int mem_base;
44531     int ret_val;
44532     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44533     int n_writer;
44534     xmlChar * name; /* element name */
44535     int n_name;
44536     xmlChar * content; /* element content */
44537     int n_content;
44538 
44539     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44540     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44541     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44542         mem_base = xmlMemBlocks();
44543         writer = gen_xmlTextWriterPtr(n_writer, 0);
44544         name = gen_const_xmlChar_ptr(n_name, 1);
44545         content = gen_const_xmlChar_ptr(n_content, 2);
44546 
44547         ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44548         desret_int(ret_val);
44549         call_tests++;
44550         des_xmlTextWriterPtr(n_writer, writer, 0);
44551         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44552         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44553         xmlResetLastError();
44554         if (mem_base != xmlMemBlocks()) {
44555             printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44556 	           xmlMemBlocks() - mem_base);
44557 	    test_ret++;
44558             printf(" %d", n_writer);
44559             printf(" %d", n_name);
44560             printf(" %d", n_content);
44561             printf("\n");
44562         }
44563     }
44564     }
44565     }
44566     function_tests++;
44567 #endif
44568 
44569     return(test_ret);
44570 }
44571 
44572 
44573 static int
test_xmlTextWriterWriteElementNS(void)44574 test_xmlTextWriterWriteElementNS(void) {
44575     int test_ret = 0;
44576 
44577 #if defined(LIBXML_WRITER_ENABLED)
44578     int mem_base;
44579     int ret_val;
44580     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44581     int n_writer;
44582     xmlChar * prefix; /* namespace prefix */
44583     int n_prefix;
44584     xmlChar * name; /* element local name */
44585     int n_name;
44586     xmlChar * namespaceURI; /* namespace URI */
44587     int n_namespaceURI;
44588     xmlChar * content; /* element content */
44589     int n_content;
44590 
44591     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44592     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44593     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44594     for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44595     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44596         mem_base = xmlMemBlocks();
44597         writer = gen_xmlTextWriterPtr(n_writer, 0);
44598         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44599         name = gen_const_xmlChar_ptr(n_name, 2);
44600         namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44601         content = gen_const_xmlChar_ptr(n_content, 4);
44602 
44603         ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44604         desret_int(ret_val);
44605         call_tests++;
44606         des_xmlTextWriterPtr(n_writer, writer, 0);
44607         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44608         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44609         des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44610         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44611         xmlResetLastError();
44612         if (mem_base != xmlMemBlocks()) {
44613             printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44614 	           xmlMemBlocks() - mem_base);
44615 	    test_ret++;
44616             printf(" %d", n_writer);
44617             printf(" %d", n_prefix);
44618             printf(" %d", n_name);
44619             printf(" %d", n_namespaceURI);
44620             printf(" %d", n_content);
44621             printf("\n");
44622         }
44623     }
44624     }
44625     }
44626     }
44627     }
44628     function_tests++;
44629 #endif
44630 
44631     return(test_ret);
44632 }
44633 
44634 
44635 static int
test_xmlTextWriterWriteFormatAttribute(void)44636 test_xmlTextWriterWriteFormatAttribute(void) {
44637     int test_ret = 0;
44638 
44639 
44640     /* missing type support */
44641     return(test_ret);
44642 }
44643 
44644 
44645 static int
test_xmlTextWriterWriteFormatAttributeNS(void)44646 test_xmlTextWriterWriteFormatAttributeNS(void) {
44647     int test_ret = 0;
44648 
44649 
44650     /* missing type support */
44651     return(test_ret);
44652 }
44653 
44654 
44655 static int
test_xmlTextWriterWriteFormatCDATA(void)44656 test_xmlTextWriterWriteFormatCDATA(void) {
44657     int test_ret = 0;
44658 
44659 
44660     /* missing type support */
44661     return(test_ret);
44662 }
44663 
44664 
44665 static int
test_xmlTextWriterWriteFormatComment(void)44666 test_xmlTextWriterWriteFormatComment(void) {
44667     int test_ret = 0;
44668 
44669 
44670     /* missing type support */
44671     return(test_ret);
44672 }
44673 
44674 
44675 static int
test_xmlTextWriterWriteFormatDTD(void)44676 test_xmlTextWriterWriteFormatDTD(void) {
44677     int test_ret = 0;
44678 
44679 
44680     /* missing type support */
44681     return(test_ret);
44682 }
44683 
44684 
44685 static int
test_xmlTextWriterWriteFormatDTDAttlist(void)44686 test_xmlTextWriterWriteFormatDTDAttlist(void) {
44687     int test_ret = 0;
44688 
44689 
44690     /* missing type support */
44691     return(test_ret);
44692 }
44693 
44694 
44695 static int
test_xmlTextWriterWriteFormatDTDElement(void)44696 test_xmlTextWriterWriteFormatDTDElement(void) {
44697     int test_ret = 0;
44698 
44699 
44700     /* missing type support */
44701     return(test_ret);
44702 }
44703 
44704 
44705 static int
test_xmlTextWriterWriteFormatDTDInternalEntity(void)44706 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44707     int test_ret = 0;
44708 
44709 
44710     /* missing type support */
44711     return(test_ret);
44712 }
44713 
44714 
44715 static int
test_xmlTextWriterWriteFormatElement(void)44716 test_xmlTextWriterWriteFormatElement(void) {
44717     int test_ret = 0;
44718 
44719 
44720     /* missing type support */
44721     return(test_ret);
44722 }
44723 
44724 
44725 static int
test_xmlTextWriterWriteFormatElementNS(void)44726 test_xmlTextWriterWriteFormatElementNS(void) {
44727     int test_ret = 0;
44728 
44729 
44730     /* missing type support */
44731     return(test_ret);
44732 }
44733 
44734 
44735 static int
test_xmlTextWriterWriteFormatPI(void)44736 test_xmlTextWriterWriteFormatPI(void) {
44737     int test_ret = 0;
44738 
44739 
44740     /* missing type support */
44741     return(test_ret);
44742 }
44743 
44744 
44745 static int
test_xmlTextWriterWriteFormatRaw(void)44746 test_xmlTextWriterWriteFormatRaw(void) {
44747     int test_ret = 0;
44748 
44749 
44750     /* missing type support */
44751     return(test_ret);
44752 }
44753 
44754 
44755 static int
test_xmlTextWriterWriteFormatString(void)44756 test_xmlTextWriterWriteFormatString(void) {
44757     int test_ret = 0;
44758 
44759 
44760     /* missing type support */
44761     return(test_ret);
44762 }
44763 
44764 
44765 static int
test_xmlTextWriterWritePI(void)44766 test_xmlTextWriterWritePI(void) {
44767     int test_ret = 0;
44768 
44769 #if defined(LIBXML_WRITER_ENABLED)
44770     int mem_base;
44771     int ret_val;
44772     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44773     int n_writer;
44774     xmlChar * target; /* PI target */
44775     int n_target;
44776     xmlChar * content; /* PI content */
44777     int n_content;
44778 
44779     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44780     for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44781     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44782         mem_base = xmlMemBlocks();
44783         writer = gen_xmlTextWriterPtr(n_writer, 0);
44784         target = gen_const_xmlChar_ptr(n_target, 1);
44785         content = gen_const_xmlChar_ptr(n_content, 2);
44786 
44787         ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44788         desret_int(ret_val);
44789         call_tests++;
44790         des_xmlTextWriterPtr(n_writer, writer, 0);
44791         des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44792         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44793         xmlResetLastError();
44794         if (mem_base != xmlMemBlocks()) {
44795             printf("Leak of %d blocks found in xmlTextWriterWritePI",
44796 	           xmlMemBlocks() - mem_base);
44797 	    test_ret++;
44798             printf(" %d", n_writer);
44799             printf(" %d", n_target);
44800             printf(" %d", n_content);
44801             printf("\n");
44802         }
44803     }
44804     }
44805     }
44806     function_tests++;
44807 #endif
44808 
44809     return(test_ret);
44810 }
44811 
44812 
44813 static int
test_xmlTextWriterWriteRaw(void)44814 test_xmlTextWriterWriteRaw(void) {
44815     int test_ret = 0;
44816 
44817 #if defined(LIBXML_WRITER_ENABLED)
44818     int mem_base;
44819     int ret_val;
44820     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44821     int n_writer;
44822     xmlChar * content; /* text string */
44823     int n_content;
44824 
44825     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44826     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44827         mem_base = xmlMemBlocks();
44828         writer = gen_xmlTextWriterPtr(n_writer, 0);
44829         content = gen_const_xmlChar_ptr(n_content, 1);
44830 
44831         ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44832         desret_int(ret_val);
44833         call_tests++;
44834         des_xmlTextWriterPtr(n_writer, writer, 0);
44835         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44836         xmlResetLastError();
44837         if (mem_base != xmlMemBlocks()) {
44838             printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44839 	           xmlMemBlocks() - mem_base);
44840 	    test_ret++;
44841             printf(" %d", n_writer);
44842             printf(" %d", n_content);
44843             printf("\n");
44844         }
44845     }
44846     }
44847     function_tests++;
44848 #endif
44849 
44850     return(test_ret);
44851 }
44852 
44853 
44854 static int
test_xmlTextWriterWriteRawLen(void)44855 test_xmlTextWriterWriteRawLen(void) {
44856     int test_ret = 0;
44857 
44858 #if defined(LIBXML_WRITER_ENABLED)
44859     int mem_base;
44860     int ret_val;
44861     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44862     int n_writer;
44863     xmlChar * content; /* text string */
44864     int n_content;
44865     int len; /* length of the text string */
44866     int n_len;
44867 
44868     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44869     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44870     for (n_len = 0;n_len < gen_nb_int;n_len++) {
44871         mem_base = xmlMemBlocks();
44872         writer = gen_xmlTextWriterPtr(n_writer, 0);
44873         content = gen_const_xmlChar_ptr(n_content, 1);
44874         len = gen_int(n_len, 2);
44875 
44876         ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44877         desret_int(ret_val);
44878         call_tests++;
44879         des_xmlTextWriterPtr(n_writer, writer, 0);
44880         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44881         des_int(n_len, len, 2);
44882         xmlResetLastError();
44883         if (mem_base != xmlMemBlocks()) {
44884             printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44885 	           xmlMemBlocks() - mem_base);
44886 	    test_ret++;
44887             printf(" %d", n_writer);
44888             printf(" %d", n_content);
44889             printf(" %d", n_len);
44890             printf("\n");
44891         }
44892     }
44893     }
44894     }
44895     function_tests++;
44896 #endif
44897 
44898     return(test_ret);
44899 }
44900 
44901 
44902 static int
test_xmlTextWriterWriteString(void)44903 test_xmlTextWriterWriteString(void) {
44904     int test_ret = 0;
44905 
44906 #if defined(LIBXML_WRITER_ENABLED)
44907     int mem_base;
44908     int ret_val;
44909     xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44910     int n_writer;
44911     xmlChar * content; /* text string */
44912     int n_content;
44913 
44914     for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44915     for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44916         mem_base = xmlMemBlocks();
44917         writer = gen_xmlTextWriterPtr(n_writer, 0);
44918         content = gen_const_xmlChar_ptr(n_content, 1);
44919 
44920         ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
44921         desret_int(ret_val);
44922         call_tests++;
44923         des_xmlTextWriterPtr(n_writer, writer, 0);
44924         des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44925         xmlResetLastError();
44926         if (mem_base != xmlMemBlocks()) {
44927             printf("Leak of %d blocks found in xmlTextWriterWriteString",
44928 	           xmlMemBlocks() - mem_base);
44929 	    test_ret++;
44930             printf(" %d", n_writer);
44931             printf(" %d", n_content);
44932             printf("\n");
44933         }
44934     }
44935     }
44936     function_tests++;
44937 #endif
44938 
44939     return(test_ret);
44940 }
44941 
44942 
44943 static int
test_xmlTextWriterWriteVFormatAttribute(void)44944 test_xmlTextWriterWriteVFormatAttribute(void) {
44945     int test_ret = 0;
44946 
44947 
44948     /* missing type support */
44949     return(test_ret);
44950 }
44951 
44952 
44953 static int
test_xmlTextWriterWriteVFormatAttributeNS(void)44954 test_xmlTextWriterWriteVFormatAttributeNS(void) {
44955     int test_ret = 0;
44956 
44957 
44958     /* missing type support */
44959     return(test_ret);
44960 }
44961 
44962 
44963 static int
test_xmlTextWriterWriteVFormatCDATA(void)44964 test_xmlTextWriterWriteVFormatCDATA(void) {
44965     int test_ret = 0;
44966 
44967 
44968     /* missing type support */
44969     return(test_ret);
44970 }
44971 
44972 
44973 static int
test_xmlTextWriterWriteVFormatComment(void)44974 test_xmlTextWriterWriteVFormatComment(void) {
44975     int test_ret = 0;
44976 
44977 
44978     /* missing type support */
44979     return(test_ret);
44980 }
44981 
44982 
44983 static int
test_xmlTextWriterWriteVFormatDTD(void)44984 test_xmlTextWriterWriteVFormatDTD(void) {
44985     int test_ret = 0;
44986 
44987 
44988     /* missing type support */
44989     return(test_ret);
44990 }
44991 
44992 
44993 static int
test_xmlTextWriterWriteVFormatDTDAttlist(void)44994 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
44995     int test_ret = 0;
44996 
44997 
44998     /* missing type support */
44999     return(test_ret);
45000 }
45001 
45002 
45003 static int
test_xmlTextWriterWriteVFormatDTDElement(void)45004 test_xmlTextWriterWriteVFormatDTDElement(void) {
45005     int test_ret = 0;
45006 
45007 
45008     /* missing type support */
45009     return(test_ret);
45010 }
45011 
45012 
45013 static int
test_xmlTextWriterWriteVFormatDTDInternalEntity(void)45014 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45015     int test_ret = 0;
45016 
45017 
45018     /* missing type support */
45019     return(test_ret);
45020 }
45021 
45022 
45023 static int
test_xmlTextWriterWriteVFormatElement(void)45024 test_xmlTextWriterWriteVFormatElement(void) {
45025     int test_ret = 0;
45026 
45027 
45028     /* missing type support */
45029     return(test_ret);
45030 }
45031 
45032 
45033 static int
test_xmlTextWriterWriteVFormatElementNS(void)45034 test_xmlTextWriterWriteVFormatElementNS(void) {
45035     int test_ret = 0;
45036 
45037 
45038     /* missing type support */
45039     return(test_ret);
45040 }
45041 
45042 
45043 static int
test_xmlTextWriterWriteVFormatPI(void)45044 test_xmlTextWriterWriteVFormatPI(void) {
45045     int test_ret = 0;
45046 
45047 
45048     /* missing type support */
45049     return(test_ret);
45050 }
45051 
45052 
45053 static int
test_xmlTextWriterWriteVFormatRaw(void)45054 test_xmlTextWriterWriteVFormatRaw(void) {
45055     int test_ret = 0;
45056 
45057 
45058     /* missing type support */
45059     return(test_ret);
45060 }
45061 
45062 
45063 static int
test_xmlTextWriterWriteVFormatString(void)45064 test_xmlTextWriterWriteVFormatString(void) {
45065     int test_ret = 0;
45066 
45067 
45068     /* missing type support */
45069     return(test_ret);
45070 }
45071 
45072 static int
test_xmlwriter(void)45073 test_xmlwriter(void) {
45074     int test_ret = 0;
45075 
45076     if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45077     test_ret += test_xmlNewTextWriter();
45078     test_ret += test_xmlNewTextWriterFilename();
45079     test_ret += test_xmlNewTextWriterMemory();
45080     test_ret += test_xmlNewTextWriterPushParser();
45081     test_ret += test_xmlNewTextWriterTree();
45082     test_ret += test_xmlTextWriterEndAttribute();
45083     test_ret += test_xmlTextWriterEndCDATA();
45084     test_ret += test_xmlTextWriterEndComment();
45085     test_ret += test_xmlTextWriterEndDTD();
45086     test_ret += test_xmlTextWriterEndDTDAttlist();
45087     test_ret += test_xmlTextWriterEndDTDElement();
45088     test_ret += test_xmlTextWriterEndDTDEntity();
45089     test_ret += test_xmlTextWriterEndDocument();
45090     test_ret += test_xmlTextWriterEndElement();
45091     test_ret += test_xmlTextWriterEndPI();
45092     test_ret += test_xmlTextWriterFlush();
45093     test_ret += test_xmlTextWriterFullEndElement();
45094     test_ret += test_xmlTextWriterSetIndent();
45095     test_ret += test_xmlTextWriterSetIndentString();
45096     test_ret += test_xmlTextWriterStartAttribute();
45097     test_ret += test_xmlTextWriterStartAttributeNS();
45098     test_ret += test_xmlTextWriterStartCDATA();
45099     test_ret += test_xmlTextWriterStartComment();
45100     test_ret += test_xmlTextWriterStartDTD();
45101     test_ret += test_xmlTextWriterStartDTDAttlist();
45102     test_ret += test_xmlTextWriterStartDTDElement();
45103     test_ret += test_xmlTextWriterStartDTDEntity();
45104     test_ret += test_xmlTextWriterStartDocument();
45105     test_ret += test_xmlTextWriterStartElement();
45106     test_ret += test_xmlTextWriterStartElementNS();
45107     test_ret += test_xmlTextWriterStartPI();
45108     test_ret += test_xmlTextWriterWriteAttribute();
45109     test_ret += test_xmlTextWriterWriteAttributeNS();
45110     test_ret += test_xmlTextWriterWriteBase64();
45111     test_ret += test_xmlTextWriterWriteBinHex();
45112     test_ret += test_xmlTextWriterWriteCDATA();
45113     test_ret += test_xmlTextWriterWriteComment();
45114     test_ret += test_xmlTextWriterWriteDTD();
45115     test_ret += test_xmlTextWriterWriteDTDAttlist();
45116     test_ret += test_xmlTextWriterWriteDTDElement();
45117     test_ret += test_xmlTextWriterWriteDTDEntity();
45118     test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45119     test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45120     test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45121     test_ret += test_xmlTextWriterWriteDTDNotation();
45122     test_ret += test_xmlTextWriterWriteElement();
45123     test_ret += test_xmlTextWriterWriteElementNS();
45124     test_ret += test_xmlTextWriterWriteFormatAttribute();
45125     test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45126     test_ret += test_xmlTextWriterWriteFormatCDATA();
45127     test_ret += test_xmlTextWriterWriteFormatComment();
45128     test_ret += test_xmlTextWriterWriteFormatDTD();
45129     test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45130     test_ret += test_xmlTextWriterWriteFormatDTDElement();
45131     test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45132     test_ret += test_xmlTextWriterWriteFormatElement();
45133     test_ret += test_xmlTextWriterWriteFormatElementNS();
45134     test_ret += test_xmlTextWriterWriteFormatPI();
45135     test_ret += test_xmlTextWriterWriteFormatRaw();
45136     test_ret += test_xmlTextWriterWriteFormatString();
45137     test_ret += test_xmlTextWriterWritePI();
45138     test_ret += test_xmlTextWriterWriteRaw();
45139     test_ret += test_xmlTextWriterWriteRawLen();
45140     test_ret += test_xmlTextWriterWriteString();
45141     test_ret += test_xmlTextWriterWriteVFormatAttribute();
45142     test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45143     test_ret += test_xmlTextWriterWriteVFormatCDATA();
45144     test_ret += test_xmlTextWriterWriteVFormatComment();
45145     test_ret += test_xmlTextWriterWriteVFormatDTD();
45146     test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45147     test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45148     test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45149     test_ret += test_xmlTextWriterWriteVFormatElement();
45150     test_ret += test_xmlTextWriterWriteVFormatElementNS();
45151     test_ret += test_xmlTextWriterWriteVFormatPI();
45152     test_ret += test_xmlTextWriterWriteVFormatRaw();
45153     test_ret += test_xmlTextWriterWriteVFormatString();
45154 
45155     if (test_ret != 0)
45156 	printf("Module xmlwriter: %d errors\n", test_ret);
45157     return(test_ret);
45158 }
45159 
45160 static int
test_xmlXPathCastBooleanToNumber(void)45161 test_xmlXPathCastBooleanToNumber(void) {
45162     int test_ret = 0;
45163 
45164 #if defined(LIBXML_XPATH_ENABLED)
45165     int mem_base;
45166     double ret_val;
45167     int val; /* a boolean */
45168     int n_val;
45169 
45170     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45171         mem_base = xmlMemBlocks();
45172         val = gen_int(n_val, 0);
45173 
45174         ret_val = xmlXPathCastBooleanToNumber(val);
45175         desret_double(ret_val);
45176         call_tests++;
45177         des_int(n_val, val, 0);
45178         xmlResetLastError();
45179         if (mem_base != xmlMemBlocks()) {
45180             printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45181 	           xmlMemBlocks() - mem_base);
45182 	    test_ret++;
45183             printf(" %d", n_val);
45184             printf("\n");
45185         }
45186     }
45187     function_tests++;
45188 #endif
45189 
45190     return(test_ret);
45191 }
45192 
45193 
45194 static int
test_xmlXPathCastBooleanToString(void)45195 test_xmlXPathCastBooleanToString(void) {
45196     int test_ret = 0;
45197 
45198 #if defined(LIBXML_XPATH_ENABLED)
45199     int mem_base;
45200     xmlChar * ret_val;
45201     int val; /* a boolean */
45202     int n_val;
45203 
45204     for (n_val = 0;n_val < gen_nb_int;n_val++) {
45205         mem_base = xmlMemBlocks();
45206         val = gen_int(n_val, 0);
45207 
45208         ret_val = xmlXPathCastBooleanToString(val);
45209         desret_xmlChar_ptr(ret_val);
45210         call_tests++;
45211         des_int(n_val, val, 0);
45212         xmlResetLastError();
45213         if (mem_base != xmlMemBlocks()) {
45214             printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45215 	           xmlMemBlocks() - mem_base);
45216 	    test_ret++;
45217             printf(" %d", n_val);
45218             printf("\n");
45219         }
45220     }
45221     function_tests++;
45222 #endif
45223 
45224     return(test_ret);
45225 }
45226 
45227 
45228 static int
test_xmlXPathCastNodeSetToBoolean(void)45229 test_xmlXPathCastNodeSetToBoolean(void) {
45230     int test_ret = 0;
45231 
45232 #if defined(LIBXML_XPATH_ENABLED)
45233     int mem_base;
45234     int ret_val;
45235     xmlNodeSetPtr ns; /* a node-set */
45236     int n_ns;
45237 
45238     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45239         mem_base = xmlMemBlocks();
45240         ns = gen_xmlNodeSetPtr(n_ns, 0);
45241 
45242         ret_val = xmlXPathCastNodeSetToBoolean(ns);
45243         desret_int(ret_val);
45244         call_tests++;
45245         des_xmlNodeSetPtr(n_ns, ns, 0);
45246         xmlResetLastError();
45247         if (mem_base != xmlMemBlocks()) {
45248             printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45249 	           xmlMemBlocks() - mem_base);
45250 	    test_ret++;
45251             printf(" %d", n_ns);
45252             printf("\n");
45253         }
45254     }
45255     function_tests++;
45256 #endif
45257 
45258     return(test_ret);
45259 }
45260 
45261 
45262 static int
test_xmlXPathCastNodeSetToNumber(void)45263 test_xmlXPathCastNodeSetToNumber(void) {
45264     int test_ret = 0;
45265 
45266 #if defined(LIBXML_XPATH_ENABLED)
45267     int mem_base;
45268     double ret_val;
45269     xmlNodeSetPtr ns; /* a node-set */
45270     int n_ns;
45271 
45272     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45273         mem_base = xmlMemBlocks();
45274         ns = gen_xmlNodeSetPtr(n_ns, 0);
45275 
45276         ret_val = xmlXPathCastNodeSetToNumber(ns);
45277         desret_double(ret_val);
45278         call_tests++;
45279         des_xmlNodeSetPtr(n_ns, ns, 0);
45280         xmlResetLastError();
45281         if (mem_base != xmlMemBlocks()) {
45282             printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45283 	           xmlMemBlocks() - mem_base);
45284 	    test_ret++;
45285             printf(" %d", n_ns);
45286             printf("\n");
45287         }
45288     }
45289     function_tests++;
45290 #endif
45291 
45292     return(test_ret);
45293 }
45294 
45295 
45296 static int
test_xmlXPathCastNodeSetToString(void)45297 test_xmlXPathCastNodeSetToString(void) {
45298     int test_ret = 0;
45299 
45300 #if defined(LIBXML_XPATH_ENABLED)
45301     int mem_base;
45302     xmlChar * ret_val;
45303     xmlNodeSetPtr ns; /* a node-set */
45304     int n_ns;
45305 
45306     for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45307         mem_base = xmlMemBlocks();
45308         ns = gen_xmlNodeSetPtr(n_ns, 0);
45309 
45310         ret_val = xmlXPathCastNodeSetToString(ns);
45311         desret_xmlChar_ptr(ret_val);
45312         call_tests++;
45313         des_xmlNodeSetPtr(n_ns, ns, 0);
45314         xmlResetLastError();
45315         if (mem_base != xmlMemBlocks()) {
45316             printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45317 	           xmlMemBlocks() - mem_base);
45318 	    test_ret++;
45319             printf(" %d", n_ns);
45320             printf("\n");
45321         }
45322     }
45323     function_tests++;
45324 #endif
45325 
45326     return(test_ret);
45327 }
45328 
45329 
45330 static int
test_xmlXPathCastNodeToNumber(void)45331 test_xmlXPathCastNodeToNumber(void) {
45332     int test_ret = 0;
45333 
45334 #if defined(LIBXML_XPATH_ENABLED)
45335     int mem_base;
45336     double ret_val;
45337     xmlNodePtr node; /* a node */
45338     int n_node;
45339 
45340     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45341         mem_base = xmlMemBlocks();
45342         node = gen_xmlNodePtr(n_node, 0);
45343 
45344         ret_val = xmlXPathCastNodeToNumber(node);
45345         desret_double(ret_val);
45346         call_tests++;
45347         des_xmlNodePtr(n_node, node, 0);
45348         xmlResetLastError();
45349         if (mem_base != xmlMemBlocks()) {
45350             printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45351 	           xmlMemBlocks() - mem_base);
45352 	    test_ret++;
45353             printf(" %d", n_node);
45354             printf("\n");
45355         }
45356     }
45357     function_tests++;
45358 #endif
45359 
45360     return(test_ret);
45361 }
45362 
45363 
45364 static int
test_xmlXPathCastNodeToString(void)45365 test_xmlXPathCastNodeToString(void) {
45366     int test_ret = 0;
45367 
45368 #if defined(LIBXML_XPATH_ENABLED)
45369     int mem_base;
45370     xmlChar * ret_val;
45371     xmlNodePtr node; /* a node */
45372     int n_node;
45373 
45374     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45375         mem_base = xmlMemBlocks();
45376         node = gen_xmlNodePtr(n_node, 0);
45377 
45378         ret_val = xmlXPathCastNodeToString(node);
45379         desret_xmlChar_ptr(ret_val);
45380         call_tests++;
45381         des_xmlNodePtr(n_node, node, 0);
45382         xmlResetLastError();
45383         if (mem_base != xmlMemBlocks()) {
45384             printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45385 	           xmlMemBlocks() - mem_base);
45386 	    test_ret++;
45387             printf(" %d", n_node);
45388             printf("\n");
45389         }
45390     }
45391     function_tests++;
45392 #endif
45393 
45394     return(test_ret);
45395 }
45396 
45397 
45398 static int
test_xmlXPathCastNumberToBoolean(void)45399 test_xmlXPathCastNumberToBoolean(void) {
45400     int test_ret = 0;
45401 
45402 #if defined(LIBXML_XPATH_ENABLED)
45403     int mem_base;
45404     int ret_val;
45405     double val; /* a number */
45406     int n_val;
45407 
45408     for (n_val = 0;n_val < gen_nb_double;n_val++) {
45409         mem_base = xmlMemBlocks();
45410         val = gen_double(n_val, 0);
45411 
45412         ret_val = xmlXPathCastNumberToBoolean(val);
45413         desret_int(ret_val);
45414         call_tests++;
45415         des_double(n_val, val, 0);
45416         xmlResetLastError();
45417         if (mem_base != xmlMemBlocks()) {
45418             printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45419 	           xmlMemBlocks() - mem_base);
45420 	    test_ret++;
45421             printf(" %d", n_val);
45422             printf("\n");
45423         }
45424     }
45425     function_tests++;
45426 #endif
45427 
45428     return(test_ret);
45429 }
45430 
45431 
45432 static int
test_xmlXPathCastNumberToString(void)45433 test_xmlXPathCastNumberToString(void) {
45434     int test_ret = 0;
45435 
45436 #if defined(LIBXML_XPATH_ENABLED)
45437     int mem_base;
45438     xmlChar * ret_val;
45439     double val; /* a number */
45440     int n_val;
45441 
45442     for (n_val = 0;n_val < gen_nb_double;n_val++) {
45443         mem_base = xmlMemBlocks();
45444         val = gen_double(n_val, 0);
45445 
45446         ret_val = xmlXPathCastNumberToString(val);
45447         desret_xmlChar_ptr(ret_val);
45448         call_tests++;
45449         des_double(n_val, val, 0);
45450         xmlResetLastError();
45451         if (mem_base != xmlMemBlocks()) {
45452             printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45453 	           xmlMemBlocks() - mem_base);
45454 	    test_ret++;
45455             printf(" %d", n_val);
45456             printf("\n");
45457         }
45458     }
45459     function_tests++;
45460 #endif
45461 
45462     return(test_ret);
45463 }
45464 
45465 
45466 static int
test_xmlXPathCastStringToBoolean(void)45467 test_xmlXPathCastStringToBoolean(void) {
45468     int test_ret = 0;
45469 
45470 #if defined(LIBXML_XPATH_ENABLED)
45471     int mem_base;
45472     int ret_val;
45473     xmlChar * val; /* a string */
45474     int n_val;
45475 
45476     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45477         mem_base = xmlMemBlocks();
45478         val = gen_const_xmlChar_ptr(n_val, 0);
45479 
45480         ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45481         desret_int(ret_val);
45482         call_tests++;
45483         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45484         xmlResetLastError();
45485         if (mem_base != xmlMemBlocks()) {
45486             printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45487 	           xmlMemBlocks() - mem_base);
45488 	    test_ret++;
45489             printf(" %d", n_val);
45490             printf("\n");
45491         }
45492     }
45493     function_tests++;
45494 #endif
45495 
45496     return(test_ret);
45497 }
45498 
45499 
45500 static int
test_xmlXPathCastStringToNumber(void)45501 test_xmlXPathCastStringToNumber(void) {
45502     int test_ret = 0;
45503 
45504 #if defined(LIBXML_XPATH_ENABLED)
45505     int mem_base;
45506     double ret_val;
45507     xmlChar * val; /* a string */
45508     int n_val;
45509 
45510     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45511         mem_base = xmlMemBlocks();
45512         val = gen_const_xmlChar_ptr(n_val, 0);
45513 
45514         ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45515         desret_double(ret_val);
45516         call_tests++;
45517         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45518         xmlResetLastError();
45519         if (mem_base != xmlMemBlocks()) {
45520             printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45521 	           xmlMemBlocks() - mem_base);
45522 	    test_ret++;
45523             printf(" %d", n_val);
45524             printf("\n");
45525         }
45526     }
45527     function_tests++;
45528 #endif
45529 
45530     return(test_ret);
45531 }
45532 
45533 
45534 static int
test_xmlXPathCastToBoolean(void)45535 test_xmlXPathCastToBoolean(void) {
45536     int test_ret = 0;
45537 
45538 #if defined(LIBXML_XPATH_ENABLED)
45539     int mem_base;
45540     int ret_val;
45541     xmlXPathObjectPtr val; /* an XPath object */
45542     int n_val;
45543 
45544     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45545         mem_base = xmlMemBlocks();
45546         val = gen_xmlXPathObjectPtr(n_val, 0);
45547 
45548         ret_val = xmlXPathCastToBoolean(val);
45549         desret_int(ret_val);
45550         call_tests++;
45551         des_xmlXPathObjectPtr(n_val, val, 0);
45552         xmlResetLastError();
45553         if (mem_base != xmlMemBlocks()) {
45554             printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45555 	           xmlMemBlocks() - mem_base);
45556 	    test_ret++;
45557             printf(" %d", n_val);
45558             printf("\n");
45559         }
45560     }
45561     function_tests++;
45562 #endif
45563 
45564     return(test_ret);
45565 }
45566 
45567 
45568 static int
test_xmlXPathCastToNumber(void)45569 test_xmlXPathCastToNumber(void) {
45570     int test_ret = 0;
45571 
45572 #if defined(LIBXML_XPATH_ENABLED)
45573     int mem_base;
45574     double ret_val;
45575     xmlXPathObjectPtr val; /* an XPath object */
45576     int n_val;
45577 
45578     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45579         mem_base = xmlMemBlocks();
45580         val = gen_xmlXPathObjectPtr(n_val, 0);
45581 
45582         ret_val = xmlXPathCastToNumber(val);
45583         desret_double(ret_val);
45584         call_tests++;
45585         des_xmlXPathObjectPtr(n_val, val, 0);
45586         xmlResetLastError();
45587         if (mem_base != xmlMemBlocks()) {
45588             printf("Leak of %d blocks found in xmlXPathCastToNumber",
45589 	           xmlMemBlocks() - mem_base);
45590 	    test_ret++;
45591             printf(" %d", n_val);
45592             printf("\n");
45593         }
45594     }
45595     function_tests++;
45596 #endif
45597 
45598     return(test_ret);
45599 }
45600 
45601 
45602 static int
test_xmlXPathCastToString(void)45603 test_xmlXPathCastToString(void) {
45604     int test_ret = 0;
45605 
45606 #if defined(LIBXML_XPATH_ENABLED)
45607     int mem_base;
45608     xmlChar * ret_val;
45609     xmlXPathObjectPtr val; /* an XPath object */
45610     int n_val;
45611 
45612     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45613         mem_base = xmlMemBlocks();
45614         val = gen_xmlXPathObjectPtr(n_val, 0);
45615 
45616         ret_val = xmlXPathCastToString(val);
45617         desret_xmlChar_ptr(ret_val);
45618         call_tests++;
45619         des_xmlXPathObjectPtr(n_val, val, 0);
45620         xmlResetLastError();
45621         if (mem_base != xmlMemBlocks()) {
45622             printf("Leak of %d blocks found in xmlXPathCastToString",
45623 	           xmlMemBlocks() - mem_base);
45624 	    test_ret++;
45625             printf(" %d", n_val);
45626             printf("\n");
45627         }
45628     }
45629     function_tests++;
45630 #endif
45631 
45632     return(test_ret);
45633 }
45634 
45635 
45636 static int
test_xmlXPathCmpNodes(void)45637 test_xmlXPathCmpNodes(void) {
45638     int test_ret = 0;
45639 
45640 #if defined(LIBXML_XPATH_ENABLED)
45641     int mem_base;
45642     int ret_val;
45643     xmlNodePtr node1; /* the first node */
45644     int n_node1;
45645     xmlNodePtr node2; /* the second node */
45646     int n_node2;
45647 
45648     for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45649     for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45650         mem_base = xmlMemBlocks();
45651         node1 = gen_xmlNodePtr(n_node1, 0);
45652         node2 = gen_xmlNodePtr(n_node2, 1);
45653 
45654         ret_val = xmlXPathCmpNodes(node1, node2);
45655         desret_int(ret_val);
45656         call_tests++;
45657         des_xmlNodePtr(n_node1, node1, 0);
45658         des_xmlNodePtr(n_node2, node2, 1);
45659         xmlResetLastError();
45660         if (mem_base != xmlMemBlocks()) {
45661             printf("Leak of %d blocks found in xmlXPathCmpNodes",
45662 	           xmlMemBlocks() - mem_base);
45663 	    test_ret++;
45664             printf(" %d", n_node1);
45665             printf(" %d", n_node2);
45666             printf("\n");
45667         }
45668     }
45669     }
45670     function_tests++;
45671 #endif
45672 
45673     return(test_ret);
45674 }
45675 
45676 
45677 static int
test_xmlXPathCompile(void)45678 test_xmlXPathCompile(void) {
45679     int test_ret = 0;
45680 
45681 
45682     /* missing type support */
45683     return(test_ret);
45684 }
45685 
45686 #ifdef LIBXML_XPATH_ENABLED
45687 
45688 #define gen_nb_xmlXPathCompExprPtr 1
gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)45689 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45690     return(NULL);
45691 }
des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED,xmlXPathCompExprPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)45692 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45693 }
45694 #endif
45695 
45696 #ifdef LIBXML_XPATH_ENABLED
45697 
45698 #define gen_nb_xmlXPathContextPtr 1
gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)45699 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45700     return(NULL);
45701 }
des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED,xmlXPathContextPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)45702 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45703 }
45704 #endif
45705 
45706 
45707 static int
test_xmlXPathCompiledEval(void)45708 test_xmlXPathCompiledEval(void) {
45709     int test_ret = 0;
45710 
45711 #if defined(LIBXML_XPATH_ENABLED)
45712     int mem_base;
45713     xmlXPathObjectPtr ret_val;
45714     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45715     int n_comp;
45716     xmlXPathContextPtr ctx; /* the XPath context */
45717     int n_ctx;
45718 
45719     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45720     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45721         mem_base = xmlMemBlocks();
45722         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45723         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45724 
45725         ret_val = xmlXPathCompiledEval(comp, ctx);
45726         desret_xmlXPathObjectPtr(ret_val);
45727         call_tests++;
45728         des_xmlXPathCompExprPtr(n_comp, comp, 0);
45729         des_xmlXPathContextPtr(n_ctx, ctx, 1);
45730         xmlResetLastError();
45731         if (mem_base != xmlMemBlocks()) {
45732             printf("Leak of %d blocks found in xmlXPathCompiledEval",
45733 	           xmlMemBlocks() - mem_base);
45734 	    test_ret++;
45735             printf(" %d", n_comp);
45736             printf(" %d", n_ctx);
45737             printf("\n");
45738         }
45739     }
45740     }
45741     function_tests++;
45742 #endif
45743 
45744     return(test_ret);
45745 }
45746 
45747 
45748 static int
test_xmlXPathCompiledEvalToBoolean(void)45749 test_xmlXPathCompiledEvalToBoolean(void) {
45750     int test_ret = 0;
45751 
45752 #if defined(LIBXML_XPATH_ENABLED)
45753     int mem_base;
45754     int ret_val;
45755     xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45756     int n_comp;
45757     xmlXPathContextPtr ctxt; /* the XPath context */
45758     int n_ctxt;
45759 
45760     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45761     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45762         mem_base = xmlMemBlocks();
45763         comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45764         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45765 
45766         ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
45767         desret_int(ret_val);
45768         call_tests++;
45769         des_xmlXPathCompExprPtr(n_comp, comp, 0);
45770         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45771         xmlResetLastError();
45772         if (mem_base != xmlMemBlocks()) {
45773             printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
45774 	           xmlMemBlocks() - mem_base);
45775 	    test_ret++;
45776             printf(" %d", n_comp);
45777             printf(" %d", n_ctxt);
45778             printf("\n");
45779         }
45780     }
45781     }
45782     function_tests++;
45783 #endif
45784 
45785     return(test_ret);
45786 }
45787 
45788 
45789 static int
test_xmlXPathContextSetCache(void)45790 test_xmlXPathContextSetCache(void) {
45791     int test_ret = 0;
45792 
45793 #if defined(LIBXML_XPATH_ENABLED)
45794     int mem_base;
45795     int ret_val;
45796     xmlXPathContextPtr ctxt; /* the XPath context */
45797     int n_ctxt;
45798     int active; /* enables/disables (creates/frees) the cache */
45799     int n_active;
45800     int value; /* a value with semantics dependant on @options */
45801     int n_value;
45802     int options; /* options (currently only the value 0 is used) */
45803     int n_options;
45804 
45805     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45806     for (n_active = 0;n_active < gen_nb_int;n_active++) {
45807     for (n_value = 0;n_value < gen_nb_int;n_value++) {
45808     for (n_options = 0;n_options < gen_nb_int;n_options++) {
45809         mem_base = xmlMemBlocks();
45810         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45811         active = gen_int(n_active, 1);
45812         value = gen_int(n_value, 2);
45813         options = gen_int(n_options, 3);
45814 
45815         ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
45816         desret_int(ret_val);
45817         call_tests++;
45818         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45819         des_int(n_active, active, 1);
45820         des_int(n_value, value, 2);
45821         des_int(n_options, options, 3);
45822         xmlResetLastError();
45823         if (mem_base != xmlMemBlocks()) {
45824             printf("Leak of %d blocks found in xmlXPathContextSetCache",
45825 	           xmlMemBlocks() - mem_base);
45826 	    test_ret++;
45827             printf(" %d", n_ctxt);
45828             printf(" %d", n_active);
45829             printf(" %d", n_value);
45830             printf(" %d", n_options);
45831             printf("\n");
45832         }
45833     }
45834     }
45835     }
45836     }
45837     function_tests++;
45838 #endif
45839 
45840     return(test_ret);
45841 }
45842 
45843 
45844 static int
test_xmlXPathConvertBoolean(void)45845 test_xmlXPathConvertBoolean(void) {
45846     int test_ret = 0;
45847 
45848 #if defined(LIBXML_XPATH_ENABLED)
45849     int mem_base;
45850     xmlXPathObjectPtr ret_val;
45851     xmlXPathObjectPtr val; /* an XPath object */
45852     int n_val;
45853 
45854     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45855         mem_base = xmlMemBlocks();
45856         val = gen_xmlXPathObjectPtr(n_val, 0);
45857 
45858         ret_val = xmlXPathConvertBoolean(val);
45859         val = NULL;
45860         desret_xmlXPathObjectPtr(ret_val);
45861         call_tests++;
45862         des_xmlXPathObjectPtr(n_val, val, 0);
45863         xmlResetLastError();
45864         if (mem_base != xmlMemBlocks()) {
45865             printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45866 	           xmlMemBlocks() - mem_base);
45867 	    test_ret++;
45868             printf(" %d", n_val);
45869             printf("\n");
45870         }
45871     }
45872     function_tests++;
45873 #endif
45874 
45875     return(test_ret);
45876 }
45877 
45878 
45879 static int
test_xmlXPathConvertNumber(void)45880 test_xmlXPathConvertNumber(void) {
45881     int test_ret = 0;
45882 
45883 #if defined(LIBXML_XPATH_ENABLED)
45884     int mem_base;
45885     xmlXPathObjectPtr ret_val;
45886     xmlXPathObjectPtr val; /* an XPath object */
45887     int n_val;
45888 
45889     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45890         mem_base = xmlMemBlocks();
45891         val = gen_xmlXPathObjectPtr(n_val, 0);
45892 
45893         ret_val = xmlXPathConvertNumber(val);
45894         val = NULL;
45895         desret_xmlXPathObjectPtr(ret_val);
45896         call_tests++;
45897         des_xmlXPathObjectPtr(n_val, val, 0);
45898         xmlResetLastError();
45899         if (mem_base != xmlMemBlocks()) {
45900             printf("Leak of %d blocks found in xmlXPathConvertNumber",
45901 	           xmlMemBlocks() - mem_base);
45902 	    test_ret++;
45903             printf(" %d", n_val);
45904             printf("\n");
45905         }
45906     }
45907     function_tests++;
45908 #endif
45909 
45910     return(test_ret);
45911 }
45912 
45913 
45914 static int
test_xmlXPathConvertString(void)45915 test_xmlXPathConvertString(void) {
45916     int test_ret = 0;
45917 
45918 #if defined(LIBXML_XPATH_ENABLED)
45919     int mem_base;
45920     xmlXPathObjectPtr ret_val;
45921     xmlXPathObjectPtr val; /* an XPath object */
45922     int n_val;
45923 
45924     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45925         mem_base = xmlMemBlocks();
45926         val = gen_xmlXPathObjectPtr(n_val, 0);
45927 
45928         ret_val = xmlXPathConvertString(val);
45929         val = NULL;
45930         desret_xmlXPathObjectPtr(ret_val);
45931         call_tests++;
45932         des_xmlXPathObjectPtr(n_val, val, 0);
45933         xmlResetLastError();
45934         if (mem_base != xmlMemBlocks()) {
45935             printf("Leak of %d blocks found in xmlXPathConvertString",
45936 	           xmlMemBlocks() - mem_base);
45937 	    test_ret++;
45938             printf(" %d", n_val);
45939             printf("\n");
45940         }
45941     }
45942     function_tests++;
45943 #endif
45944 
45945     return(test_ret);
45946 }
45947 
45948 
45949 static int
test_xmlXPathCtxtCompile(void)45950 test_xmlXPathCtxtCompile(void) {
45951     int test_ret = 0;
45952 
45953 
45954     /* missing type support */
45955     return(test_ret);
45956 }
45957 
45958 
45959 static int
test_xmlXPathEval(void)45960 test_xmlXPathEval(void) {
45961     int test_ret = 0;
45962 
45963 #if defined(LIBXML_XPATH_ENABLED)
45964     int mem_base;
45965     xmlXPathObjectPtr ret_val;
45966     xmlChar * str; /* the XPath expression */
45967     int n_str;
45968     xmlXPathContextPtr ctx; /* the XPath context */
45969     int n_ctx;
45970 
45971     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
45972     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45973         mem_base = xmlMemBlocks();
45974         str = gen_const_xmlChar_ptr(n_str, 0);
45975         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45976 
45977         ret_val = xmlXPathEval((const xmlChar *)str, ctx);
45978         desret_xmlXPathObjectPtr(ret_val);
45979         call_tests++;
45980         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
45981         des_xmlXPathContextPtr(n_ctx, ctx, 1);
45982         xmlResetLastError();
45983         if (mem_base != xmlMemBlocks()) {
45984             printf("Leak of %d blocks found in xmlXPathEval",
45985 	           xmlMemBlocks() - mem_base);
45986 	    test_ret++;
45987             printf(" %d", n_str);
45988             printf(" %d", n_ctx);
45989             printf("\n");
45990         }
45991     }
45992     }
45993     function_tests++;
45994 #endif
45995 
45996     return(test_ret);
45997 }
45998 
45999 
46000 static int
test_xmlXPathEvalExpression(void)46001 test_xmlXPathEvalExpression(void) {
46002     int test_ret = 0;
46003 
46004 #if defined(LIBXML_XPATH_ENABLED)
46005     int mem_base;
46006     xmlXPathObjectPtr ret_val;
46007     xmlChar * str; /* the XPath expression */
46008     int n_str;
46009     xmlXPathContextPtr ctxt; /* the XPath context */
46010     int n_ctxt;
46011 
46012     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46013     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46014         mem_base = xmlMemBlocks();
46015         str = gen_const_xmlChar_ptr(n_str, 0);
46016         ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46017 
46018         ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46019         desret_xmlXPathObjectPtr(ret_val);
46020         call_tests++;
46021         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46022         des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46023         xmlResetLastError();
46024         if (mem_base != xmlMemBlocks()) {
46025             printf("Leak of %d blocks found in xmlXPathEvalExpression",
46026 	           xmlMemBlocks() - mem_base);
46027 	    test_ret++;
46028             printf(" %d", n_str);
46029             printf(" %d", n_ctxt);
46030             printf("\n");
46031         }
46032     }
46033     }
46034     function_tests++;
46035 #endif
46036 
46037     return(test_ret);
46038 }
46039 
46040 
46041 static int
test_xmlXPathEvalPredicate(void)46042 test_xmlXPathEvalPredicate(void) {
46043     int test_ret = 0;
46044 
46045 #if defined(LIBXML_XPATH_ENABLED)
46046     int mem_base;
46047     int ret_val;
46048     xmlXPathContextPtr ctxt; /* the XPath context */
46049     int n_ctxt;
46050     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46051     int n_res;
46052 
46053     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46054     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46055         mem_base = xmlMemBlocks();
46056         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46057         res = gen_xmlXPathObjectPtr(n_res, 1);
46058 
46059         ret_val = xmlXPathEvalPredicate(ctxt, res);
46060         desret_int(ret_val);
46061         call_tests++;
46062         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46063         des_xmlXPathObjectPtr(n_res, res, 1);
46064         xmlResetLastError();
46065         if (mem_base != xmlMemBlocks()) {
46066             printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46067 	           xmlMemBlocks() - mem_base);
46068 	    test_ret++;
46069             printf(" %d", n_ctxt);
46070             printf(" %d", n_res);
46071             printf("\n");
46072         }
46073     }
46074     }
46075     function_tests++;
46076 #endif
46077 
46078     return(test_ret);
46079 }
46080 
46081 
46082 static int
test_xmlXPathInit(void)46083 test_xmlXPathInit(void) {
46084     int test_ret = 0;
46085 
46086 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46087     int mem_base;
46088 
46089         mem_base = xmlMemBlocks();
46090 
46091         xmlXPathInit();
46092         call_tests++;
46093         xmlResetLastError();
46094         if (mem_base != xmlMemBlocks()) {
46095             printf("Leak of %d blocks found in xmlXPathInit",
46096 	           xmlMemBlocks() - mem_base);
46097 	    test_ret++;
46098             printf("\n");
46099         }
46100     function_tests++;
46101 #endif
46102 
46103     return(test_ret);
46104 }
46105 
46106 
46107 static int
test_xmlXPathIsInf(void)46108 test_xmlXPathIsInf(void) {
46109     int test_ret = 0;
46110 
46111 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46112     int mem_base;
46113     int ret_val;
46114     double val; /* a double value */
46115     int n_val;
46116 
46117     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46118         mem_base = xmlMemBlocks();
46119         val = gen_double(n_val, 0);
46120 
46121         ret_val = xmlXPathIsInf(val);
46122         desret_int(ret_val);
46123         call_tests++;
46124         des_double(n_val, val, 0);
46125         xmlResetLastError();
46126         if (mem_base != xmlMemBlocks()) {
46127             printf("Leak of %d blocks found in xmlXPathIsInf",
46128 	           xmlMemBlocks() - mem_base);
46129 	    test_ret++;
46130             printf(" %d", n_val);
46131             printf("\n");
46132         }
46133     }
46134     function_tests++;
46135 #endif
46136 
46137     return(test_ret);
46138 }
46139 
46140 
46141 static int
test_xmlXPathIsNaN(void)46142 test_xmlXPathIsNaN(void) {
46143     int test_ret = 0;
46144 
46145 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46146     int mem_base;
46147     int ret_val;
46148     double val; /* a double value */
46149     int n_val;
46150 
46151     for (n_val = 0;n_val < gen_nb_double;n_val++) {
46152         mem_base = xmlMemBlocks();
46153         val = gen_double(n_val, 0);
46154 
46155         ret_val = xmlXPathIsNaN(val);
46156         desret_int(ret_val);
46157         call_tests++;
46158         des_double(n_val, val, 0);
46159         xmlResetLastError();
46160         if (mem_base != xmlMemBlocks()) {
46161             printf("Leak of %d blocks found in xmlXPathIsNaN",
46162 	           xmlMemBlocks() - mem_base);
46163 	    test_ret++;
46164             printf(" %d", n_val);
46165             printf("\n");
46166         }
46167     }
46168     function_tests++;
46169 #endif
46170 
46171     return(test_ret);
46172 }
46173 
46174 
46175 static int
test_xmlXPathNewContext(void)46176 test_xmlXPathNewContext(void) {
46177     int test_ret = 0;
46178 
46179 
46180     /* missing type support */
46181     return(test_ret);
46182 }
46183 
46184 
46185 static int
test_xmlXPathNodeSetCreate(void)46186 test_xmlXPathNodeSetCreate(void) {
46187     int test_ret = 0;
46188 
46189 #if defined(LIBXML_XPATH_ENABLED)
46190     int mem_base;
46191     xmlNodeSetPtr ret_val;
46192     xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46193     int n_val;
46194 
46195     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46196         mem_base = xmlMemBlocks();
46197         val = gen_xmlNodePtr(n_val, 0);
46198 
46199         ret_val = xmlXPathNodeSetCreate(val);
46200         desret_xmlNodeSetPtr(ret_val);
46201         call_tests++;
46202         des_xmlNodePtr(n_val, val, 0);
46203         xmlResetLastError();
46204         if (mem_base != xmlMemBlocks()) {
46205             printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46206 	           xmlMemBlocks() - mem_base);
46207 	    test_ret++;
46208             printf(" %d", n_val);
46209             printf("\n");
46210         }
46211     }
46212     function_tests++;
46213 #endif
46214 
46215     return(test_ret);
46216 }
46217 
46218 
46219 static int
test_xmlXPathObjectCopy(void)46220 test_xmlXPathObjectCopy(void) {
46221     int test_ret = 0;
46222 
46223 #if defined(LIBXML_XPATH_ENABLED)
46224     int mem_base;
46225     xmlXPathObjectPtr ret_val;
46226     xmlXPathObjectPtr val; /* the original object */
46227     int n_val;
46228 
46229     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46230         mem_base = xmlMemBlocks();
46231         val = gen_xmlXPathObjectPtr(n_val, 0);
46232 
46233         ret_val = xmlXPathObjectCopy(val);
46234         desret_xmlXPathObjectPtr(ret_val);
46235         call_tests++;
46236         des_xmlXPathObjectPtr(n_val, val, 0);
46237         xmlResetLastError();
46238         if (mem_base != xmlMemBlocks()) {
46239             printf("Leak of %d blocks found in xmlXPathObjectCopy",
46240 	           xmlMemBlocks() - mem_base);
46241 	    test_ret++;
46242             printf(" %d", n_val);
46243             printf("\n");
46244         }
46245     }
46246     function_tests++;
46247 #endif
46248 
46249     return(test_ret);
46250 }
46251 
46252 
46253 static int
test_xmlXPathOrderDocElems(void)46254 test_xmlXPathOrderDocElems(void) {
46255     int test_ret = 0;
46256 
46257 #if defined(LIBXML_XPATH_ENABLED)
46258     int mem_base;
46259     long ret_val;
46260     xmlDocPtr doc; /* an input document */
46261     int n_doc;
46262 
46263     for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46264         mem_base = xmlMemBlocks();
46265         doc = gen_xmlDocPtr(n_doc, 0);
46266 
46267         ret_val = xmlXPathOrderDocElems(doc);
46268         desret_long(ret_val);
46269         call_tests++;
46270         des_xmlDocPtr(n_doc, doc, 0);
46271         xmlResetLastError();
46272         if (mem_base != xmlMemBlocks()) {
46273             printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46274 	           xmlMemBlocks() - mem_base);
46275 	    test_ret++;
46276             printf(" %d", n_doc);
46277             printf("\n");
46278         }
46279     }
46280     function_tests++;
46281 #endif
46282 
46283     return(test_ret);
46284 }
46285 
46286 static int
test_xpath(void)46287 test_xpath(void) {
46288     int test_ret = 0;
46289 
46290     if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46291     test_ret += test_xmlXPathCastBooleanToNumber();
46292     test_ret += test_xmlXPathCastBooleanToString();
46293     test_ret += test_xmlXPathCastNodeSetToBoolean();
46294     test_ret += test_xmlXPathCastNodeSetToNumber();
46295     test_ret += test_xmlXPathCastNodeSetToString();
46296     test_ret += test_xmlXPathCastNodeToNumber();
46297     test_ret += test_xmlXPathCastNodeToString();
46298     test_ret += test_xmlXPathCastNumberToBoolean();
46299     test_ret += test_xmlXPathCastNumberToString();
46300     test_ret += test_xmlXPathCastStringToBoolean();
46301     test_ret += test_xmlXPathCastStringToNumber();
46302     test_ret += test_xmlXPathCastToBoolean();
46303     test_ret += test_xmlXPathCastToNumber();
46304     test_ret += test_xmlXPathCastToString();
46305     test_ret += test_xmlXPathCmpNodes();
46306     test_ret += test_xmlXPathCompile();
46307     test_ret += test_xmlXPathCompiledEval();
46308     test_ret += test_xmlXPathCompiledEvalToBoolean();
46309     test_ret += test_xmlXPathContextSetCache();
46310     test_ret += test_xmlXPathConvertBoolean();
46311     test_ret += test_xmlXPathConvertNumber();
46312     test_ret += test_xmlXPathConvertString();
46313     test_ret += test_xmlXPathCtxtCompile();
46314     test_ret += test_xmlXPathEval();
46315     test_ret += test_xmlXPathEvalExpression();
46316     test_ret += test_xmlXPathEvalPredicate();
46317     test_ret += test_xmlXPathInit();
46318     test_ret += test_xmlXPathIsInf();
46319     test_ret += test_xmlXPathIsNaN();
46320     test_ret += test_xmlXPathNewContext();
46321     test_ret += test_xmlXPathNodeSetCreate();
46322     test_ret += test_xmlXPathObjectCopy();
46323     test_ret += test_xmlXPathOrderDocElems();
46324 
46325     if (test_ret != 0)
46326 	printf("Module xpath: %d errors\n", test_ret);
46327     return(test_ret);
46328 }
46329 #ifdef LIBXML_XPATH_ENABLED
46330 
46331 #define gen_nb_xmlXPathParserContextPtr 1
gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46332 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46333     return(NULL);
46334 }
des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED,xmlXPathParserContextPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)46335 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46336 }
46337 #endif
46338 
46339 
46340 static int
test_valuePop(void)46341 test_valuePop(void) {
46342     int test_ret = 0;
46343 
46344 #if defined(LIBXML_XPATH_ENABLED)
46345     int mem_base;
46346     xmlXPathObjectPtr ret_val;
46347     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46348     int n_ctxt;
46349 
46350     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46351         mem_base = xmlMemBlocks();
46352         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46353 
46354         ret_val = valuePop(ctxt);
46355         desret_xmlXPathObjectPtr(ret_val);
46356         call_tests++;
46357         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46358         xmlResetLastError();
46359         if (mem_base != xmlMemBlocks()) {
46360             printf("Leak of %d blocks found in valuePop",
46361 	           xmlMemBlocks() - mem_base);
46362 	    test_ret++;
46363             printf(" %d", n_ctxt);
46364             printf("\n");
46365         }
46366     }
46367     function_tests++;
46368 #endif
46369 
46370     return(test_ret);
46371 }
46372 
46373 
46374 static int
test_valuePush(void)46375 test_valuePush(void) {
46376     int test_ret = 0;
46377 
46378 #if defined(LIBXML_XPATH_ENABLED)
46379     int mem_base;
46380     int ret_val;
46381     xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46382     int n_ctxt;
46383     xmlXPathObjectPtr value; /* the XPath object */
46384     int n_value;
46385 
46386     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46387     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46388         mem_base = xmlMemBlocks();
46389         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46390         value = gen_xmlXPathObjectPtr(n_value, 1);
46391 
46392         ret_val = valuePush(ctxt, value);
46393         desret_int(ret_val);
46394         call_tests++;
46395         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46396         des_xmlXPathObjectPtr(n_value, value, 1);
46397         xmlResetLastError();
46398         if (mem_base != xmlMemBlocks()) {
46399             printf("Leak of %d blocks found in valuePush",
46400 	           xmlMemBlocks() - mem_base);
46401 	    test_ret++;
46402             printf(" %d", n_ctxt);
46403             printf(" %d", n_value);
46404             printf("\n");
46405         }
46406     }
46407     }
46408     function_tests++;
46409 #endif
46410 
46411     return(test_ret);
46412 }
46413 
46414 
46415 static int
test_xmlXPathAddValues(void)46416 test_xmlXPathAddValues(void) {
46417     int test_ret = 0;
46418 
46419 #if defined(LIBXML_XPATH_ENABLED)
46420     int mem_base;
46421     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46422     int n_ctxt;
46423 
46424     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46425         mem_base = xmlMemBlocks();
46426         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46427 
46428         xmlXPathAddValues(ctxt);
46429         call_tests++;
46430         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46431         xmlResetLastError();
46432         if (mem_base != xmlMemBlocks()) {
46433             printf("Leak of %d blocks found in xmlXPathAddValues",
46434 	           xmlMemBlocks() - mem_base);
46435 	    test_ret++;
46436             printf(" %d", n_ctxt);
46437             printf("\n");
46438         }
46439     }
46440     function_tests++;
46441 #endif
46442 
46443     return(test_ret);
46444 }
46445 
46446 
46447 static int
test_xmlXPathBooleanFunction(void)46448 test_xmlXPathBooleanFunction(void) {
46449     int test_ret = 0;
46450 
46451 #if defined(LIBXML_XPATH_ENABLED)
46452     int mem_base;
46453     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46454     int n_ctxt;
46455     int nargs; /* the number of arguments */
46456     int n_nargs;
46457 
46458     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46459     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46460         mem_base = xmlMemBlocks();
46461         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46462         nargs = gen_int(n_nargs, 1);
46463 
46464         xmlXPathBooleanFunction(ctxt, nargs);
46465         call_tests++;
46466         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46467         des_int(n_nargs, nargs, 1);
46468         xmlResetLastError();
46469         if (mem_base != xmlMemBlocks()) {
46470             printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46471 	           xmlMemBlocks() - mem_base);
46472 	    test_ret++;
46473             printf(" %d", n_ctxt);
46474             printf(" %d", n_nargs);
46475             printf("\n");
46476         }
46477     }
46478     }
46479     function_tests++;
46480 #endif
46481 
46482     return(test_ret);
46483 }
46484 
46485 
46486 static int
test_xmlXPathCeilingFunction(void)46487 test_xmlXPathCeilingFunction(void) {
46488     int test_ret = 0;
46489 
46490 #if defined(LIBXML_XPATH_ENABLED)
46491     int mem_base;
46492     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46493     int n_ctxt;
46494     int nargs; /* the number of arguments */
46495     int n_nargs;
46496 
46497     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46498     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46499         mem_base = xmlMemBlocks();
46500         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46501         nargs = gen_int(n_nargs, 1);
46502 
46503         xmlXPathCeilingFunction(ctxt, nargs);
46504         call_tests++;
46505         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46506         des_int(n_nargs, nargs, 1);
46507         xmlResetLastError();
46508         if (mem_base != xmlMemBlocks()) {
46509             printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46510 	           xmlMemBlocks() - mem_base);
46511 	    test_ret++;
46512             printf(" %d", n_ctxt);
46513             printf(" %d", n_nargs);
46514             printf("\n");
46515         }
46516     }
46517     }
46518     function_tests++;
46519 #endif
46520 
46521     return(test_ret);
46522 }
46523 
46524 
46525 static int
test_xmlXPathCompareValues(void)46526 test_xmlXPathCompareValues(void) {
46527     int test_ret = 0;
46528 
46529 #if defined(LIBXML_XPATH_ENABLED)
46530     int mem_base;
46531     int ret_val;
46532     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46533     int n_ctxt;
46534     int inf; /* less than (1) or greater than (0) */
46535     int n_inf;
46536     int strict; /* is the comparison strict */
46537     int n_strict;
46538 
46539     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46540     for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46541     for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46542         mem_base = xmlMemBlocks();
46543         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46544         inf = gen_int(n_inf, 1);
46545         strict = gen_int(n_strict, 2);
46546 
46547         ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46548         desret_int(ret_val);
46549         call_tests++;
46550         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46551         des_int(n_inf, inf, 1);
46552         des_int(n_strict, strict, 2);
46553         xmlResetLastError();
46554         if (mem_base != xmlMemBlocks()) {
46555             printf("Leak of %d blocks found in xmlXPathCompareValues",
46556 	           xmlMemBlocks() - mem_base);
46557 	    test_ret++;
46558             printf(" %d", n_ctxt);
46559             printf(" %d", n_inf);
46560             printf(" %d", n_strict);
46561             printf("\n");
46562         }
46563     }
46564     }
46565     }
46566     function_tests++;
46567 #endif
46568 
46569     return(test_ret);
46570 }
46571 
46572 
46573 static int
test_xmlXPathConcatFunction(void)46574 test_xmlXPathConcatFunction(void) {
46575     int test_ret = 0;
46576 
46577 #if defined(LIBXML_XPATH_ENABLED)
46578     int mem_base;
46579     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46580     int n_ctxt;
46581     int nargs; /* the number of arguments */
46582     int n_nargs;
46583 
46584     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46585     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46586         mem_base = xmlMemBlocks();
46587         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46588         nargs = gen_int(n_nargs, 1);
46589 
46590         xmlXPathConcatFunction(ctxt, nargs);
46591         call_tests++;
46592         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46593         des_int(n_nargs, nargs, 1);
46594         xmlResetLastError();
46595         if (mem_base != xmlMemBlocks()) {
46596             printf("Leak of %d blocks found in xmlXPathConcatFunction",
46597 	           xmlMemBlocks() - mem_base);
46598 	    test_ret++;
46599             printf(" %d", n_ctxt);
46600             printf(" %d", n_nargs);
46601             printf("\n");
46602         }
46603     }
46604     }
46605     function_tests++;
46606 #endif
46607 
46608     return(test_ret);
46609 }
46610 
46611 
46612 static int
test_xmlXPathContainsFunction(void)46613 test_xmlXPathContainsFunction(void) {
46614     int test_ret = 0;
46615 
46616 #if defined(LIBXML_XPATH_ENABLED)
46617     int mem_base;
46618     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46619     int n_ctxt;
46620     int nargs; /* the number of arguments */
46621     int n_nargs;
46622 
46623     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46624     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46625         mem_base = xmlMemBlocks();
46626         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46627         nargs = gen_int(n_nargs, 1);
46628 
46629         xmlXPathContainsFunction(ctxt, nargs);
46630         call_tests++;
46631         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46632         des_int(n_nargs, nargs, 1);
46633         xmlResetLastError();
46634         if (mem_base != xmlMemBlocks()) {
46635             printf("Leak of %d blocks found in xmlXPathContainsFunction",
46636 	           xmlMemBlocks() - mem_base);
46637 	    test_ret++;
46638             printf(" %d", n_ctxt);
46639             printf(" %d", n_nargs);
46640             printf("\n");
46641         }
46642     }
46643     }
46644     function_tests++;
46645 #endif
46646 
46647     return(test_ret);
46648 }
46649 
46650 
46651 static int
test_xmlXPathCountFunction(void)46652 test_xmlXPathCountFunction(void) {
46653     int test_ret = 0;
46654 
46655 #if defined(LIBXML_XPATH_ENABLED)
46656     int mem_base;
46657     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46658     int n_ctxt;
46659     int nargs; /* the number of arguments */
46660     int n_nargs;
46661 
46662     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46663     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46664         mem_base = xmlMemBlocks();
46665         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46666         nargs = gen_int(n_nargs, 1);
46667 
46668         xmlXPathCountFunction(ctxt, nargs);
46669         call_tests++;
46670         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46671         des_int(n_nargs, nargs, 1);
46672         xmlResetLastError();
46673         if (mem_base != xmlMemBlocks()) {
46674             printf("Leak of %d blocks found in xmlXPathCountFunction",
46675 	           xmlMemBlocks() - mem_base);
46676 	    test_ret++;
46677             printf(" %d", n_ctxt);
46678             printf(" %d", n_nargs);
46679             printf("\n");
46680         }
46681     }
46682     }
46683     function_tests++;
46684 #endif
46685 
46686     return(test_ret);
46687 }
46688 
46689 
46690 static int
test_xmlXPathDebugDumpCompExpr(void)46691 test_xmlXPathDebugDumpCompExpr(void) {
46692     int test_ret = 0;
46693 
46694 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46695     int mem_base;
46696     FILE * output; /* the FILE * for the output */
46697     int n_output;
46698     xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46699     int n_comp;
46700     int depth; /* the indentation level. */
46701     int n_depth;
46702 
46703     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46704     for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46705     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46706         mem_base = xmlMemBlocks();
46707         output = gen_FILE_ptr(n_output, 0);
46708         comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46709         depth = gen_int(n_depth, 2);
46710 
46711         xmlXPathDebugDumpCompExpr(output, comp, depth);
46712         call_tests++;
46713         des_FILE_ptr(n_output, output, 0);
46714         des_xmlXPathCompExprPtr(n_comp, comp, 1);
46715         des_int(n_depth, depth, 2);
46716         xmlResetLastError();
46717         if (mem_base != xmlMemBlocks()) {
46718             printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46719 	           xmlMemBlocks() - mem_base);
46720 	    test_ret++;
46721             printf(" %d", n_output);
46722             printf(" %d", n_comp);
46723             printf(" %d", n_depth);
46724             printf("\n");
46725         }
46726     }
46727     }
46728     }
46729     function_tests++;
46730 #endif
46731 
46732     return(test_ret);
46733 }
46734 
46735 
46736 static int
test_xmlXPathDebugDumpObject(void)46737 test_xmlXPathDebugDumpObject(void) {
46738     int test_ret = 0;
46739 
46740 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46741     int mem_base;
46742     FILE * output; /* the FILE * to dump the output */
46743     int n_output;
46744     xmlXPathObjectPtr cur; /* the object to inspect */
46745     int n_cur;
46746     int depth; /* indentation level */
46747     int n_depth;
46748 
46749     for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46750     for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46751     for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46752         mem_base = xmlMemBlocks();
46753         output = gen_FILE_ptr(n_output, 0);
46754         cur = gen_xmlXPathObjectPtr(n_cur, 1);
46755         depth = gen_int(n_depth, 2);
46756 
46757         xmlXPathDebugDumpObject(output, cur, depth);
46758         call_tests++;
46759         des_FILE_ptr(n_output, output, 0);
46760         des_xmlXPathObjectPtr(n_cur, cur, 1);
46761         des_int(n_depth, depth, 2);
46762         xmlResetLastError();
46763         if (mem_base != xmlMemBlocks()) {
46764             printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46765 	           xmlMemBlocks() - mem_base);
46766 	    test_ret++;
46767             printf(" %d", n_output);
46768             printf(" %d", n_cur);
46769             printf(" %d", n_depth);
46770             printf("\n");
46771         }
46772     }
46773     }
46774     }
46775     function_tests++;
46776 #endif
46777 
46778     return(test_ret);
46779 }
46780 
46781 
46782 static int
test_xmlXPathDifference(void)46783 test_xmlXPathDifference(void) {
46784     int test_ret = 0;
46785 
46786 #if defined(LIBXML_XPATH_ENABLED)
46787     int mem_base;
46788     xmlNodeSetPtr ret_val;
46789     xmlNodeSetPtr nodes1; /* a node-set */
46790     int n_nodes1;
46791     xmlNodeSetPtr nodes2; /* a node-set */
46792     int n_nodes2;
46793 
46794     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46795     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46796         mem_base = xmlMemBlocks();
46797         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46798         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46799 
46800         ret_val = xmlXPathDifference(nodes1, nodes2);
46801         desret_xmlNodeSetPtr(ret_val);
46802         call_tests++;
46803         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46804         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46805         xmlResetLastError();
46806         if (mem_base != xmlMemBlocks()) {
46807             printf("Leak of %d blocks found in xmlXPathDifference",
46808 	           xmlMemBlocks() - mem_base);
46809 	    test_ret++;
46810             printf(" %d", n_nodes1);
46811             printf(" %d", n_nodes2);
46812             printf("\n");
46813         }
46814     }
46815     }
46816     function_tests++;
46817 #endif
46818 
46819     return(test_ret);
46820 }
46821 
46822 
46823 static int
test_xmlXPathDistinct(void)46824 test_xmlXPathDistinct(void) {
46825     int test_ret = 0;
46826 
46827 #if defined(LIBXML_XPATH_ENABLED)
46828     int mem_base;
46829     xmlNodeSetPtr ret_val;
46830     xmlNodeSetPtr nodes; /* a node-set */
46831     int n_nodes;
46832 
46833     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46834         mem_base = xmlMemBlocks();
46835         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46836 
46837         ret_val = xmlXPathDistinct(nodes);
46838         desret_xmlNodeSetPtr(ret_val);
46839         call_tests++;
46840         des_xmlNodeSetPtr(n_nodes, nodes, 0);
46841         xmlResetLastError();
46842         if (mem_base != xmlMemBlocks()) {
46843             printf("Leak of %d blocks found in xmlXPathDistinct",
46844 	           xmlMemBlocks() - mem_base);
46845 	    test_ret++;
46846             printf(" %d", n_nodes);
46847             printf("\n");
46848         }
46849     }
46850     function_tests++;
46851 #endif
46852 
46853     return(test_ret);
46854 }
46855 
46856 
46857 static int
test_xmlXPathDistinctSorted(void)46858 test_xmlXPathDistinctSorted(void) {
46859     int test_ret = 0;
46860 
46861 #if defined(LIBXML_XPATH_ENABLED)
46862     int mem_base;
46863     xmlNodeSetPtr ret_val;
46864     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46865     int n_nodes;
46866 
46867     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46868         mem_base = xmlMemBlocks();
46869         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46870 
46871         ret_val = xmlXPathDistinctSorted(nodes);
46872         desret_xmlNodeSetPtr(ret_val);
46873         call_tests++;
46874         des_xmlNodeSetPtr(n_nodes, nodes, 0);
46875         xmlResetLastError();
46876         if (mem_base != xmlMemBlocks()) {
46877             printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46878 	           xmlMemBlocks() - mem_base);
46879 	    test_ret++;
46880             printf(" %d", n_nodes);
46881             printf("\n");
46882         }
46883     }
46884     function_tests++;
46885 #endif
46886 
46887     return(test_ret);
46888 }
46889 
46890 
46891 static int
test_xmlXPathDivValues(void)46892 test_xmlXPathDivValues(void) {
46893     int test_ret = 0;
46894 
46895 #if defined(LIBXML_XPATH_ENABLED)
46896     int mem_base;
46897     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46898     int n_ctxt;
46899 
46900     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46901         mem_base = xmlMemBlocks();
46902         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46903 
46904         xmlXPathDivValues(ctxt);
46905         call_tests++;
46906         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46907         xmlResetLastError();
46908         if (mem_base != xmlMemBlocks()) {
46909             printf("Leak of %d blocks found in xmlXPathDivValues",
46910 	           xmlMemBlocks() - mem_base);
46911 	    test_ret++;
46912             printf(" %d", n_ctxt);
46913             printf("\n");
46914         }
46915     }
46916     function_tests++;
46917 #endif
46918 
46919     return(test_ret);
46920 }
46921 
46922 
46923 static int
test_xmlXPathEqualValues(void)46924 test_xmlXPathEqualValues(void) {
46925     int test_ret = 0;
46926 
46927 #if defined(LIBXML_XPATH_ENABLED)
46928     int mem_base;
46929     int ret_val;
46930     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46931     int n_ctxt;
46932 
46933     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46934         mem_base = xmlMemBlocks();
46935         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46936 
46937         ret_val = xmlXPathEqualValues(ctxt);
46938         desret_int(ret_val);
46939         call_tests++;
46940         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46941         xmlResetLastError();
46942         if (mem_base != xmlMemBlocks()) {
46943             printf("Leak of %d blocks found in xmlXPathEqualValues",
46944 	           xmlMemBlocks() - mem_base);
46945 	    test_ret++;
46946             printf(" %d", n_ctxt);
46947             printf("\n");
46948         }
46949     }
46950     function_tests++;
46951 #endif
46952 
46953     return(test_ret);
46954 }
46955 
46956 
46957 static int
test_xmlXPathErr(void)46958 test_xmlXPathErr(void) {
46959     int test_ret = 0;
46960 
46961 #if defined(LIBXML_XPATH_ENABLED)
46962     int mem_base;
46963     xmlXPathParserContextPtr ctxt; /* a XPath parser context */
46964     int n_ctxt;
46965     int error; /* the error code */
46966     int n_error;
46967 
46968     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46969     for (n_error = 0;n_error < gen_nb_int;n_error++) {
46970         mem_base = xmlMemBlocks();
46971         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46972         error = gen_int(n_error, 1);
46973 
46974         xmlXPathErr(ctxt, error);
46975         call_tests++;
46976         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46977         des_int(n_error, error, 1);
46978         xmlResetLastError();
46979         if (mem_base != xmlMemBlocks()) {
46980             printf("Leak of %d blocks found in xmlXPathErr",
46981 	           xmlMemBlocks() - mem_base);
46982 	    test_ret++;
46983             printf(" %d", n_ctxt);
46984             printf(" %d", n_error);
46985             printf("\n");
46986         }
46987     }
46988     }
46989     function_tests++;
46990 #endif
46991 
46992     return(test_ret);
46993 }
46994 
46995 
46996 static int
test_xmlXPathEvalExpr(void)46997 test_xmlXPathEvalExpr(void) {
46998     int test_ret = 0;
46999 
47000 #if defined(LIBXML_XPATH_ENABLED)
47001     int mem_base;
47002     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47003     int n_ctxt;
47004 
47005     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47006         mem_base = xmlMemBlocks();
47007         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47008 
47009         xmlXPathEvalExpr(ctxt);
47010         call_tests++;
47011         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47012         xmlResetLastError();
47013         if (mem_base != xmlMemBlocks()) {
47014             printf("Leak of %d blocks found in xmlXPathEvalExpr",
47015 	           xmlMemBlocks() - mem_base);
47016 	    test_ret++;
47017             printf(" %d", n_ctxt);
47018             printf("\n");
47019         }
47020     }
47021     function_tests++;
47022 #endif
47023 
47024     return(test_ret);
47025 }
47026 
47027 
47028 static int
test_xmlXPathEvaluatePredicateResult(void)47029 test_xmlXPathEvaluatePredicateResult(void) {
47030     int test_ret = 0;
47031 
47032 #if defined(LIBXML_XPATH_ENABLED)
47033     int mem_base;
47034     int ret_val;
47035     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47036     int n_ctxt;
47037     xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47038     int n_res;
47039 
47040     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47041     for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47042         mem_base = xmlMemBlocks();
47043         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47044         res = gen_xmlXPathObjectPtr(n_res, 1);
47045 
47046         ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47047         desret_int(ret_val);
47048         call_tests++;
47049         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47050         des_xmlXPathObjectPtr(n_res, res, 1);
47051         xmlResetLastError();
47052         if (mem_base != xmlMemBlocks()) {
47053             printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47054 	           xmlMemBlocks() - mem_base);
47055 	    test_ret++;
47056             printf(" %d", n_ctxt);
47057             printf(" %d", n_res);
47058             printf("\n");
47059         }
47060     }
47061     }
47062     function_tests++;
47063 #endif
47064 
47065     return(test_ret);
47066 }
47067 
47068 
47069 static int
test_xmlXPathFalseFunction(void)47070 test_xmlXPathFalseFunction(void) {
47071     int test_ret = 0;
47072 
47073 #if defined(LIBXML_XPATH_ENABLED)
47074     int mem_base;
47075     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47076     int n_ctxt;
47077     int nargs; /* the number of arguments */
47078     int n_nargs;
47079 
47080     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47081     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47082         mem_base = xmlMemBlocks();
47083         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47084         nargs = gen_int(n_nargs, 1);
47085 
47086         xmlXPathFalseFunction(ctxt, nargs);
47087         call_tests++;
47088         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47089         des_int(n_nargs, nargs, 1);
47090         xmlResetLastError();
47091         if (mem_base != xmlMemBlocks()) {
47092             printf("Leak of %d blocks found in xmlXPathFalseFunction",
47093 	           xmlMemBlocks() - mem_base);
47094 	    test_ret++;
47095             printf(" %d", n_ctxt);
47096             printf(" %d", n_nargs);
47097             printf("\n");
47098         }
47099     }
47100     }
47101     function_tests++;
47102 #endif
47103 
47104     return(test_ret);
47105 }
47106 
47107 
47108 static int
test_xmlXPathFloorFunction(void)47109 test_xmlXPathFloorFunction(void) {
47110     int test_ret = 0;
47111 
47112 #if defined(LIBXML_XPATH_ENABLED)
47113     int mem_base;
47114     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47115     int n_ctxt;
47116     int nargs; /* the number of arguments */
47117     int n_nargs;
47118 
47119     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47120     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47121         mem_base = xmlMemBlocks();
47122         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47123         nargs = gen_int(n_nargs, 1);
47124 
47125         xmlXPathFloorFunction(ctxt, nargs);
47126         call_tests++;
47127         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47128         des_int(n_nargs, nargs, 1);
47129         xmlResetLastError();
47130         if (mem_base != xmlMemBlocks()) {
47131             printf("Leak of %d blocks found in xmlXPathFloorFunction",
47132 	           xmlMemBlocks() - mem_base);
47133 	    test_ret++;
47134             printf(" %d", n_ctxt);
47135             printf(" %d", n_nargs);
47136             printf("\n");
47137         }
47138     }
47139     }
47140     function_tests++;
47141 #endif
47142 
47143     return(test_ret);
47144 }
47145 
47146 
47147 static int
test_xmlXPathFunctionLookup(void)47148 test_xmlXPathFunctionLookup(void) {
47149     int test_ret = 0;
47150 
47151 
47152     /* missing type support */
47153     return(test_ret);
47154 }
47155 
47156 
47157 static int
test_xmlXPathFunctionLookupNS(void)47158 test_xmlXPathFunctionLookupNS(void) {
47159     int test_ret = 0;
47160 
47161 
47162     /* missing type support */
47163     return(test_ret);
47164 }
47165 
47166 
47167 static int
test_xmlXPathHasSameNodes(void)47168 test_xmlXPathHasSameNodes(void) {
47169     int test_ret = 0;
47170 
47171 #if defined(LIBXML_XPATH_ENABLED)
47172     int mem_base;
47173     int ret_val;
47174     xmlNodeSetPtr nodes1; /* a node-set */
47175     int n_nodes1;
47176     xmlNodeSetPtr nodes2; /* a node-set */
47177     int n_nodes2;
47178 
47179     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47180     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47181         mem_base = xmlMemBlocks();
47182         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47183         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47184 
47185         ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47186         desret_int(ret_val);
47187         call_tests++;
47188         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47189         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47190         xmlResetLastError();
47191         if (mem_base != xmlMemBlocks()) {
47192             printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47193 	           xmlMemBlocks() - mem_base);
47194 	    test_ret++;
47195             printf(" %d", n_nodes1);
47196             printf(" %d", n_nodes2);
47197             printf("\n");
47198         }
47199     }
47200     }
47201     function_tests++;
47202 #endif
47203 
47204     return(test_ret);
47205 }
47206 
47207 
47208 static int
test_xmlXPathIdFunction(void)47209 test_xmlXPathIdFunction(void) {
47210     int test_ret = 0;
47211 
47212 #if defined(LIBXML_XPATH_ENABLED)
47213     int mem_base;
47214     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47215     int n_ctxt;
47216     int nargs; /* the number of arguments */
47217     int n_nargs;
47218 
47219     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47220     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47221         mem_base = xmlMemBlocks();
47222         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47223         nargs = gen_int(n_nargs, 1);
47224 
47225         xmlXPathIdFunction(ctxt, nargs);
47226         call_tests++;
47227         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47228         des_int(n_nargs, nargs, 1);
47229         xmlResetLastError();
47230         if (mem_base != xmlMemBlocks()) {
47231             printf("Leak of %d blocks found in xmlXPathIdFunction",
47232 	           xmlMemBlocks() - mem_base);
47233 	    test_ret++;
47234             printf(" %d", n_ctxt);
47235             printf(" %d", n_nargs);
47236             printf("\n");
47237         }
47238     }
47239     }
47240     function_tests++;
47241 #endif
47242 
47243     return(test_ret);
47244 }
47245 
47246 
47247 static int
test_xmlXPathIntersection(void)47248 test_xmlXPathIntersection(void) {
47249     int test_ret = 0;
47250 
47251 #if defined(LIBXML_XPATH_ENABLED)
47252     int mem_base;
47253     xmlNodeSetPtr ret_val;
47254     xmlNodeSetPtr nodes1; /* a node-set */
47255     int n_nodes1;
47256     xmlNodeSetPtr nodes2; /* a node-set */
47257     int n_nodes2;
47258 
47259     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47260     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47261         mem_base = xmlMemBlocks();
47262         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47263         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47264 
47265         ret_val = xmlXPathIntersection(nodes1, nodes2);
47266         desret_xmlNodeSetPtr(ret_val);
47267         call_tests++;
47268         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47269         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47270         xmlResetLastError();
47271         if (mem_base != xmlMemBlocks()) {
47272             printf("Leak of %d blocks found in xmlXPathIntersection",
47273 	           xmlMemBlocks() - mem_base);
47274 	    test_ret++;
47275             printf(" %d", n_nodes1);
47276             printf(" %d", n_nodes2);
47277             printf("\n");
47278         }
47279     }
47280     }
47281     function_tests++;
47282 #endif
47283 
47284     return(test_ret);
47285 }
47286 
47287 
47288 static int
test_xmlXPathIsNodeType(void)47289 test_xmlXPathIsNodeType(void) {
47290     int test_ret = 0;
47291 
47292 #if defined(LIBXML_XPATH_ENABLED)
47293     int mem_base;
47294     int ret_val;
47295     xmlChar * name; /* a name string */
47296     int n_name;
47297 
47298     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47299         mem_base = xmlMemBlocks();
47300         name = gen_const_xmlChar_ptr(n_name, 0);
47301 
47302         ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47303         desret_int(ret_val);
47304         call_tests++;
47305         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47306         xmlResetLastError();
47307         if (mem_base != xmlMemBlocks()) {
47308             printf("Leak of %d blocks found in xmlXPathIsNodeType",
47309 	           xmlMemBlocks() - mem_base);
47310 	    test_ret++;
47311             printf(" %d", n_name);
47312             printf("\n");
47313         }
47314     }
47315     function_tests++;
47316 #endif
47317 
47318     return(test_ret);
47319 }
47320 
47321 
47322 static int
test_xmlXPathLangFunction(void)47323 test_xmlXPathLangFunction(void) {
47324     int test_ret = 0;
47325 
47326 #if defined(LIBXML_XPATH_ENABLED)
47327     int mem_base;
47328     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47329     int n_ctxt;
47330     int nargs; /* the number of arguments */
47331     int n_nargs;
47332 
47333     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47334     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47335         mem_base = xmlMemBlocks();
47336         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47337         nargs = gen_int(n_nargs, 1);
47338 
47339         xmlXPathLangFunction(ctxt, nargs);
47340         call_tests++;
47341         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47342         des_int(n_nargs, nargs, 1);
47343         xmlResetLastError();
47344         if (mem_base != xmlMemBlocks()) {
47345             printf("Leak of %d blocks found in xmlXPathLangFunction",
47346 	           xmlMemBlocks() - mem_base);
47347 	    test_ret++;
47348             printf(" %d", n_ctxt);
47349             printf(" %d", n_nargs);
47350             printf("\n");
47351         }
47352     }
47353     }
47354     function_tests++;
47355 #endif
47356 
47357     return(test_ret);
47358 }
47359 
47360 
47361 static int
test_xmlXPathLastFunction(void)47362 test_xmlXPathLastFunction(void) {
47363     int test_ret = 0;
47364 
47365 #if defined(LIBXML_XPATH_ENABLED)
47366     int mem_base;
47367     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47368     int n_ctxt;
47369     int nargs; /* the number of arguments */
47370     int n_nargs;
47371 
47372     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47373     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47374         mem_base = xmlMemBlocks();
47375         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47376         nargs = gen_int(n_nargs, 1);
47377 
47378         xmlXPathLastFunction(ctxt, nargs);
47379         call_tests++;
47380         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47381         des_int(n_nargs, nargs, 1);
47382         xmlResetLastError();
47383         if (mem_base != xmlMemBlocks()) {
47384             printf("Leak of %d blocks found in xmlXPathLastFunction",
47385 	           xmlMemBlocks() - mem_base);
47386 	    test_ret++;
47387             printf(" %d", n_ctxt);
47388             printf(" %d", n_nargs);
47389             printf("\n");
47390         }
47391     }
47392     }
47393     function_tests++;
47394 #endif
47395 
47396     return(test_ret);
47397 }
47398 
47399 
47400 static int
test_xmlXPathLeading(void)47401 test_xmlXPathLeading(void) {
47402     int test_ret = 0;
47403 
47404 #if defined(LIBXML_XPATH_ENABLED)
47405     int mem_base;
47406     xmlNodeSetPtr ret_val;
47407     xmlNodeSetPtr nodes1; /* a node-set */
47408     int n_nodes1;
47409     xmlNodeSetPtr nodes2; /* a node-set */
47410     int n_nodes2;
47411 
47412     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47413     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47414         mem_base = xmlMemBlocks();
47415         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47416         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47417 
47418         ret_val = xmlXPathLeading(nodes1, nodes2);
47419         desret_xmlNodeSetPtr(ret_val);
47420         call_tests++;
47421         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47422         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47423         xmlResetLastError();
47424         if (mem_base != xmlMemBlocks()) {
47425             printf("Leak of %d blocks found in xmlXPathLeading",
47426 	           xmlMemBlocks() - mem_base);
47427 	    test_ret++;
47428             printf(" %d", n_nodes1);
47429             printf(" %d", n_nodes2);
47430             printf("\n");
47431         }
47432     }
47433     }
47434     function_tests++;
47435 #endif
47436 
47437     return(test_ret);
47438 }
47439 
47440 
47441 static int
test_xmlXPathLeadingSorted(void)47442 test_xmlXPathLeadingSorted(void) {
47443     int test_ret = 0;
47444 
47445 #if defined(LIBXML_XPATH_ENABLED)
47446     int mem_base;
47447     xmlNodeSetPtr ret_val;
47448     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47449     int n_nodes1;
47450     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47451     int n_nodes2;
47452 
47453     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47454     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47455         mem_base = xmlMemBlocks();
47456         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47457         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47458 
47459         ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47460         desret_xmlNodeSetPtr(ret_val);
47461         call_tests++;
47462         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47463         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47464         xmlResetLastError();
47465         if (mem_base != xmlMemBlocks()) {
47466             printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47467 	           xmlMemBlocks() - mem_base);
47468 	    test_ret++;
47469             printf(" %d", n_nodes1);
47470             printf(" %d", n_nodes2);
47471             printf("\n");
47472         }
47473     }
47474     }
47475     function_tests++;
47476 #endif
47477 
47478     return(test_ret);
47479 }
47480 
47481 
47482 static int
test_xmlXPathLocalNameFunction(void)47483 test_xmlXPathLocalNameFunction(void) {
47484     int test_ret = 0;
47485 
47486 #if defined(LIBXML_XPATH_ENABLED)
47487     int mem_base;
47488     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47489     int n_ctxt;
47490     int nargs; /* the number of arguments */
47491     int n_nargs;
47492 
47493     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47494     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47495         mem_base = xmlMemBlocks();
47496         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47497         nargs = gen_int(n_nargs, 1);
47498 
47499         xmlXPathLocalNameFunction(ctxt, nargs);
47500         call_tests++;
47501         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47502         des_int(n_nargs, nargs, 1);
47503         xmlResetLastError();
47504         if (mem_base != xmlMemBlocks()) {
47505             printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47506 	           xmlMemBlocks() - mem_base);
47507 	    test_ret++;
47508             printf(" %d", n_ctxt);
47509             printf(" %d", n_nargs);
47510             printf("\n");
47511         }
47512     }
47513     }
47514     function_tests++;
47515 #endif
47516 
47517     return(test_ret);
47518 }
47519 
47520 
47521 static int
test_xmlXPathModValues(void)47522 test_xmlXPathModValues(void) {
47523     int test_ret = 0;
47524 
47525 #if defined(LIBXML_XPATH_ENABLED)
47526     int mem_base;
47527     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47528     int n_ctxt;
47529 
47530     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47531         mem_base = xmlMemBlocks();
47532         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47533 
47534         xmlXPathModValues(ctxt);
47535         call_tests++;
47536         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47537         xmlResetLastError();
47538         if (mem_base != xmlMemBlocks()) {
47539             printf("Leak of %d blocks found in xmlXPathModValues",
47540 	           xmlMemBlocks() - mem_base);
47541 	    test_ret++;
47542             printf(" %d", n_ctxt);
47543             printf("\n");
47544         }
47545     }
47546     function_tests++;
47547 #endif
47548 
47549     return(test_ret);
47550 }
47551 
47552 
47553 static int
test_xmlXPathMultValues(void)47554 test_xmlXPathMultValues(void) {
47555     int test_ret = 0;
47556 
47557 #if defined(LIBXML_XPATH_ENABLED)
47558     int mem_base;
47559     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47560     int n_ctxt;
47561 
47562     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47563         mem_base = xmlMemBlocks();
47564         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47565 
47566         xmlXPathMultValues(ctxt);
47567         call_tests++;
47568         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47569         xmlResetLastError();
47570         if (mem_base != xmlMemBlocks()) {
47571             printf("Leak of %d blocks found in xmlXPathMultValues",
47572 	           xmlMemBlocks() - mem_base);
47573 	    test_ret++;
47574             printf(" %d", n_ctxt);
47575             printf("\n");
47576         }
47577     }
47578     function_tests++;
47579 #endif
47580 
47581     return(test_ret);
47582 }
47583 
47584 
47585 static int
test_xmlXPathNamespaceURIFunction(void)47586 test_xmlXPathNamespaceURIFunction(void) {
47587     int test_ret = 0;
47588 
47589 #if defined(LIBXML_XPATH_ENABLED)
47590     int mem_base;
47591     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47592     int n_ctxt;
47593     int nargs; /* the number of arguments */
47594     int n_nargs;
47595 
47596     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47597     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47598         mem_base = xmlMemBlocks();
47599         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47600         nargs = gen_int(n_nargs, 1);
47601 
47602         xmlXPathNamespaceURIFunction(ctxt, nargs);
47603         call_tests++;
47604         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47605         des_int(n_nargs, nargs, 1);
47606         xmlResetLastError();
47607         if (mem_base != xmlMemBlocks()) {
47608             printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47609 	           xmlMemBlocks() - mem_base);
47610 	    test_ret++;
47611             printf(" %d", n_ctxt);
47612             printf(" %d", n_nargs);
47613             printf("\n");
47614         }
47615     }
47616     }
47617     function_tests++;
47618 #endif
47619 
47620     return(test_ret);
47621 }
47622 
47623 
47624 static int
test_xmlXPathNewBoolean(void)47625 test_xmlXPathNewBoolean(void) {
47626     int test_ret = 0;
47627 
47628 #if defined(LIBXML_XPATH_ENABLED)
47629     int mem_base;
47630     xmlXPathObjectPtr ret_val;
47631     int val; /* the boolean value */
47632     int n_val;
47633 
47634     for (n_val = 0;n_val < gen_nb_int;n_val++) {
47635         mem_base = xmlMemBlocks();
47636         val = gen_int(n_val, 0);
47637 
47638         ret_val = xmlXPathNewBoolean(val);
47639         desret_xmlXPathObjectPtr(ret_val);
47640         call_tests++;
47641         des_int(n_val, val, 0);
47642         xmlResetLastError();
47643         if (mem_base != xmlMemBlocks()) {
47644             printf("Leak of %d blocks found in xmlXPathNewBoolean",
47645 	           xmlMemBlocks() - mem_base);
47646 	    test_ret++;
47647             printf(" %d", n_val);
47648             printf("\n");
47649         }
47650     }
47651     function_tests++;
47652 #endif
47653 
47654     return(test_ret);
47655 }
47656 
47657 
47658 static int
test_xmlXPathNewCString(void)47659 test_xmlXPathNewCString(void) {
47660     int test_ret = 0;
47661 
47662 #if defined(LIBXML_XPATH_ENABLED)
47663     int mem_base;
47664     xmlXPathObjectPtr ret_val;
47665     char * val; /* the char * value */
47666     int n_val;
47667 
47668     for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47669         mem_base = xmlMemBlocks();
47670         val = gen_const_char_ptr(n_val, 0);
47671 
47672         ret_val = xmlXPathNewCString((const char *)val);
47673         desret_xmlXPathObjectPtr(ret_val);
47674         call_tests++;
47675         des_const_char_ptr(n_val, (const char *)val, 0);
47676         xmlResetLastError();
47677         if (mem_base != xmlMemBlocks()) {
47678             printf("Leak of %d blocks found in xmlXPathNewCString",
47679 	           xmlMemBlocks() - mem_base);
47680 	    test_ret++;
47681             printf(" %d", n_val);
47682             printf("\n");
47683         }
47684     }
47685     function_tests++;
47686 #endif
47687 
47688     return(test_ret);
47689 }
47690 
47691 
47692 static int
test_xmlXPathNewFloat(void)47693 test_xmlXPathNewFloat(void) {
47694     int test_ret = 0;
47695 
47696 #if defined(LIBXML_XPATH_ENABLED)
47697     int mem_base;
47698     xmlXPathObjectPtr ret_val;
47699     double val; /* the double value */
47700     int n_val;
47701 
47702     for (n_val = 0;n_val < gen_nb_double;n_val++) {
47703         mem_base = xmlMemBlocks();
47704         val = gen_double(n_val, 0);
47705 
47706         ret_val = xmlXPathNewFloat(val);
47707         desret_xmlXPathObjectPtr(ret_val);
47708         call_tests++;
47709         des_double(n_val, val, 0);
47710         xmlResetLastError();
47711         if (mem_base != xmlMemBlocks()) {
47712             printf("Leak of %d blocks found in xmlXPathNewFloat",
47713 	           xmlMemBlocks() - mem_base);
47714 	    test_ret++;
47715             printf(" %d", n_val);
47716             printf("\n");
47717         }
47718     }
47719     function_tests++;
47720 #endif
47721 
47722     return(test_ret);
47723 }
47724 
47725 
47726 static int
test_xmlXPathNewNodeSet(void)47727 test_xmlXPathNewNodeSet(void) {
47728     int test_ret = 0;
47729 
47730 #if defined(LIBXML_XPATH_ENABLED)
47731     int mem_base;
47732     xmlXPathObjectPtr ret_val;
47733     xmlNodePtr val; /* the NodePtr value */
47734     int n_val;
47735 
47736     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47737         mem_base = xmlMemBlocks();
47738         val = gen_xmlNodePtr(n_val, 0);
47739 
47740         ret_val = xmlXPathNewNodeSet(val);
47741         desret_xmlXPathObjectPtr(ret_val);
47742         call_tests++;
47743         des_xmlNodePtr(n_val, val, 0);
47744         xmlResetLastError();
47745         if (mem_base != xmlMemBlocks()) {
47746             printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47747 	           xmlMemBlocks() - mem_base);
47748 	    test_ret++;
47749             printf(" %d", n_val);
47750             printf("\n");
47751         }
47752     }
47753     function_tests++;
47754 #endif
47755 
47756     return(test_ret);
47757 }
47758 
47759 
47760 static int
test_xmlXPathNewNodeSetList(void)47761 test_xmlXPathNewNodeSetList(void) {
47762     int test_ret = 0;
47763 
47764 #if defined(LIBXML_XPATH_ENABLED)
47765     int mem_base;
47766     xmlXPathObjectPtr ret_val;
47767     xmlNodeSetPtr val; /* an existing NodeSet */
47768     int n_val;
47769 
47770     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47771         mem_base = xmlMemBlocks();
47772         val = gen_xmlNodeSetPtr(n_val, 0);
47773 
47774         ret_val = xmlXPathNewNodeSetList(val);
47775         desret_xmlXPathObjectPtr(ret_val);
47776         call_tests++;
47777         des_xmlNodeSetPtr(n_val, val, 0);
47778         xmlResetLastError();
47779         if (mem_base != xmlMemBlocks()) {
47780             printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47781 	           xmlMemBlocks() - mem_base);
47782 	    test_ret++;
47783             printf(" %d", n_val);
47784             printf("\n");
47785         }
47786     }
47787     function_tests++;
47788 #endif
47789 
47790     return(test_ret);
47791 }
47792 
47793 
47794 static int
test_xmlXPathNewParserContext(void)47795 test_xmlXPathNewParserContext(void) {
47796     int test_ret = 0;
47797 
47798 
47799     /* missing type support */
47800     return(test_ret);
47801 }
47802 
47803 
47804 static int
test_xmlXPathNewString(void)47805 test_xmlXPathNewString(void) {
47806     int test_ret = 0;
47807 
47808 #if defined(LIBXML_XPATH_ENABLED)
47809     int mem_base;
47810     xmlXPathObjectPtr ret_val;
47811     xmlChar * val; /* the xmlChar * value */
47812     int n_val;
47813 
47814     for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47815         mem_base = xmlMemBlocks();
47816         val = gen_const_xmlChar_ptr(n_val, 0);
47817 
47818         ret_val = xmlXPathNewString((const xmlChar *)val);
47819         desret_xmlXPathObjectPtr(ret_val);
47820         call_tests++;
47821         des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47822         xmlResetLastError();
47823         if (mem_base != xmlMemBlocks()) {
47824             printf("Leak of %d blocks found in xmlXPathNewString",
47825 	           xmlMemBlocks() - mem_base);
47826 	    test_ret++;
47827             printf(" %d", n_val);
47828             printf("\n");
47829         }
47830     }
47831     function_tests++;
47832 #endif
47833 
47834     return(test_ret);
47835 }
47836 
47837 
47838 static int
test_xmlXPathNextAncestor(void)47839 test_xmlXPathNextAncestor(void) {
47840     int test_ret = 0;
47841 
47842 #if defined(LIBXML_XPATH_ENABLED)
47843     int mem_base;
47844     xmlNodePtr ret_val;
47845     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47846     int n_ctxt;
47847     xmlNodePtr cur; /* the current node in the traversal */
47848     int n_cur;
47849 
47850     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47851     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47852         mem_base = xmlMemBlocks();
47853         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47854         cur = gen_xmlNodePtr(n_cur, 1);
47855 
47856         ret_val = xmlXPathNextAncestor(ctxt, cur);
47857         desret_xmlNodePtr(ret_val);
47858         call_tests++;
47859         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47860         des_xmlNodePtr(n_cur, cur, 1);
47861         xmlResetLastError();
47862         if (mem_base != xmlMemBlocks()) {
47863             printf("Leak of %d blocks found in xmlXPathNextAncestor",
47864 	           xmlMemBlocks() - mem_base);
47865 	    test_ret++;
47866             printf(" %d", n_ctxt);
47867             printf(" %d", n_cur);
47868             printf("\n");
47869         }
47870     }
47871     }
47872     function_tests++;
47873 #endif
47874 
47875     return(test_ret);
47876 }
47877 
47878 
47879 static int
test_xmlXPathNextAncestorOrSelf(void)47880 test_xmlXPathNextAncestorOrSelf(void) {
47881     int test_ret = 0;
47882 
47883 #if defined(LIBXML_XPATH_ENABLED)
47884     int mem_base;
47885     xmlNodePtr ret_val;
47886     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47887     int n_ctxt;
47888     xmlNodePtr cur; /* the current node in the traversal */
47889     int n_cur;
47890 
47891     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47892     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47893         mem_base = xmlMemBlocks();
47894         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47895         cur = gen_xmlNodePtr(n_cur, 1);
47896 
47897         ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47898         desret_xmlNodePtr(ret_val);
47899         call_tests++;
47900         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47901         des_xmlNodePtr(n_cur, cur, 1);
47902         xmlResetLastError();
47903         if (mem_base != xmlMemBlocks()) {
47904             printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47905 	           xmlMemBlocks() - mem_base);
47906 	    test_ret++;
47907             printf(" %d", n_ctxt);
47908             printf(" %d", n_cur);
47909             printf("\n");
47910         }
47911     }
47912     }
47913     function_tests++;
47914 #endif
47915 
47916     return(test_ret);
47917 }
47918 
47919 
47920 static int
test_xmlXPathNextAttribute(void)47921 test_xmlXPathNextAttribute(void) {
47922     int test_ret = 0;
47923 
47924 #if defined(LIBXML_XPATH_ENABLED)
47925     int mem_base;
47926     xmlNodePtr ret_val;
47927     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47928     int n_ctxt;
47929     xmlNodePtr cur; /* the current attribute in the traversal */
47930     int n_cur;
47931 
47932     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47933     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47934         mem_base = xmlMemBlocks();
47935         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47936         cur = gen_xmlNodePtr(n_cur, 1);
47937 
47938         ret_val = xmlXPathNextAttribute(ctxt, cur);
47939         desret_xmlNodePtr(ret_val);
47940         call_tests++;
47941         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47942         des_xmlNodePtr(n_cur, cur, 1);
47943         xmlResetLastError();
47944         if (mem_base != xmlMemBlocks()) {
47945             printf("Leak of %d blocks found in xmlXPathNextAttribute",
47946 	           xmlMemBlocks() - mem_base);
47947 	    test_ret++;
47948             printf(" %d", n_ctxt);
47949             printf(" %d", n_cur);
47950             printf("\n");
47951         }
47952     }
47953     }
47954     function_tests++;
47955 #endif
47956 
47957     return(test_ret);
47958 }
47959 
47960 
47961 static int
test_xmlXPathNextChild(void)47962 test_xmlXPathNextChild(void) {
47963     int test_ret = 0;
47964 
47965 #if defined(LIBXML_XPATH_ENABLED)
47966     int mem_base;
47967     xmlNodePtr ret_val;
47968     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47969     int n_ctxt;
47970     xmlNodePtr cur; /* the current node in the traversal */
47971     int n_cur;
47972 
47973     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47974     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47975         mem_base = xmlMemBlocks();
47976         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47977         cur = gen_xmlNodePtr(n_cur, 1);
47978 
47979         ret_val = xmlXPathNextChild(ctxt, cur);
47980         desret_xmlNodePtr(ret_val);
47981         call_tests++;
47982         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47983         des_xmlNodePtr(n_cur, cur, 1);
47984         xmlResetLastError();
47985         if (mem_base != xmlMemBlocks()) {
47986             printf("Leak of %d blocks found in xmlXPathNextChild",
47987 	           xmlMemBlocks() - mem_base);
47988 	    test_ret++;
47989             printf(" %d", n_ctxt);
47990             printf(" %d", n_cur);
47991             printf("\n");
47992         }
47993     }
47994     }
47995     function_tests++;
47996 #endif
47997 
47998     return(test_ret);
47999 }
48000 
48001 
48002 static int
test_xmlXPathNextDescendant(void)48003 test_xmlXPathNextDescendant(void) {
48004     int test_ret = 0;
48005 
48006 #if defined(LIBXML_XPATH_ENABLED)
48007     int mem_base;
48008     xmlNodePtr ret_val;
48009     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48010     int n_ctxt;
48011     xmlNodePtr cur; /* the current node in the traversal */
48012     int n_cur;
48013 
48014     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48015     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48016         mem_base = xmlMemBlocks();
48017         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48018         cur = gen_xmlNodePtr(n_cur, 1);
48019 
48020         ret_val = xmlXPathNextDescendant(ctxt, cur);
48021         desret_xmlNodePtr(ret_val);
48022         call_tests++;
48023         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48024         des_xmlNodePtr(n_cur, cur, 1);
48025         xmlResetLastError();
48026         if (mem_base != xmlMemBlocks()) {
48027             printf("Leak of %d blocks found in xmlXPathNextDescendant",
48028 	           xmlMemBlocks() - mem_base);
48029 	    test_ret++;
48030             printf(" %d", n_ctxt);
48031             printf(" %d", n_cur);
48032             printf("\n");
48033         }
48034     }
48035     }
48036     function_tests++;
48037 #endif
48038 
48039     return(test_ret);
48040 }
48041 
48042 
48043 static int
test_xmlXPathNextDescendantOrSelf(void)48044 test_xmlXPathNextDescendantOrSelf(void) {
48045     int test_ret = 0;
48046 
48047 #if defined(LIBXML_XPATH_ENABLED)
48048     int mem_base;
48049     xmlNodePtr ret_val;
48050     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48051     int n_ctxt;
48052     xmlNodePtr cur; /* the current node in the traversal */
48053     int n_cur;
48054 
48055     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48056     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48057         mem_base = xmlMemBlocks();
48058         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48059         cur = gen_xmlNodePtr(n_cur, 1);
48060 
48061         ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48062         desret_xmlNodePtr(ret_val);
48063         call_tests++;
48064         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48065         des_xmlNodePtr(n_cur, cur, 1);
48066         xmlResetLastError();
48067         if (mem_base != xmlMemBlocks()) {
48068             printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48069 	           xmlMemBlocks() - mem_base);
48070 	    test_ret++;
48071             printf(" %d", n_ctxt);
48072             printf(" %d", n_cur);
48073             printf("\n");
48074         }
48075     }
48076     }
48077     function_tests++;
48078 #endif
48079 
48080     return(test_ret);
48081 }
48082 
48083 
48084 static int
test_xmlXPathNextFollowing(void)48085 test_xmlXPathNextFollowing(void) {
48086     int test_ret = 0;
48087 
48088 #if defined(LIBXML_XPATH_ENABLED)
48089     int mem_base;
48090     xmlNodePtr ret_val;
48091     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48092     int n_ctxt;
48093     xmlNodePtr cur; /* the current node in the traversal */
48094     int n_cur;
48095 
48096     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48097     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48098         mem_base = xmlMemBlocks();
48099         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48100         cur = gen_xmlNodePtr(n_cur, 1);
48101 
48102         ret_val = xmlXPathNextFollowing(ctxt, cur);
48103         desret_xmlNodePtr(ret_val);
48104         call_tests++;
48105         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48106         des_xmlNodePtr(n_cur, cur, 1);
48107         xmlResetLastError();
48108         if (mem_base != xmlMemBlocks()) {
48109             printf("Leak of %d blocks found in xmlXPathNextFollowing",
48110 	           xmlMemBlocks() - mem_base);
48111 	    test_ret++;
48112             printf(" %d", n_ctxt);
48113             printf(" %d", n_cur);
48114             printf("\n");
48115         }
48116     }
48117     }
48118     function_tests++;
48119 #endif
48120 
48121     return(test_ret);
48122 }
48123 
48124 
48125 static int
test_xmlXPathNextFollowingSibling(void)48126 test_xmlXPathNextFollowingSibling(void) {
48127     int test_ret = 0;
48128 
48129 #if defined(LIBXML_XPATH_ENABLED)
48130     int mem_base;
48131     xmlNodePtr ret_val;
48132     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48133     int n_ctxt;
48134     xmlNodePtr cur; /* the current node in the traversal */
48135     int n_cur;
48136 
48137     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48138     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48139         mem_base = xmlMemBlocks();
48140         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48141         cur = gen_xmlNodePtr(n_cur, 1);
48142 
48143         ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48144         desret_xmlNodePtr(ret_val);
48145         call_tests++;
48146         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48147         des_xmlNodePtr(n_cur, cur, 1);
48148         xmlResetLastError();
48149         if (mem_base != xmlMemBlocks()) {
48150             printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48151 	           xmlMemBlocks() - mem_base);
48152 	    test_ret++;
48153             printf(" %d", n_ctxt);
48154             printf(" %d", n_cur);
48155             printf("\n");
48156         }
48157     }
48158     }
48159     function_tests++;
48160 #endif
48161 
48162     return(test_ret);
48163 }
48164 
48165 
48166 static int
test_xmlXPathNextNamespace(void)48167 test_xmlXPathNextNamespace(void) {
48168     int test_ret = 0;
48169 
48170 #if defined(LIBXML_XPATH_ENABLED)
48171     int mem_base;
48172     xmlNodePtr ret_val;
48173     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48174     int n_ctxt;
48175     xmlNodePtr cur; /* the current attribute in the traversal */
48176     int n_cur;
48177 
48178     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48179     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48180         mem_base = xmlMemBlocks();
48181         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48182         cur = gen_xmlNodePtr(n_cur, 1);
48183 
48184         ret_val = xmlXPathNextNamespace(ctxt, cur);
48185         desret_xmlNodePtr(ret_val);
48186         call_tests++;
48187         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48188         des_xmlNodePtr(n_cur, cur, 1);
48189         xmlResetLastError();
48190         if (mem_base != xmlMemBlocks()) {
48191             printf("Leak of %d blocks found in xmlXPathNextNamespace",
48192 	           xmlMemBlocks() - mem_base);
48193 	    test_ret++;
48194             printf(" %d", n_ctxt);
48195             printf(" %d", n_cur);
48196             printf("\n");
48197         }
48198     }
48199     }
48200     function_tests++;
48201 #endif
48202 
48203     return(test_ret);
48204 }
48205 
48206 
48207 static int
test_xmlXPathNextParent(void)48208 test_xmlXPathNextParent(void) {
48209     int test_ret = 0;
48210 
48211 #if defined(LIBXML_XPATH_ENABLED)
48212     int mem_base;
48213     xmlNodePtr ret_val;
48214     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48215     int n_ctxt;
48216     xmlNodePtr cur; /* the current node in the traversal */
48217     int n_cur;
48218 
48219     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48220     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48221         mem_base = xmlMemBlocks();
48222         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48223         cur = gen_xmlNodePtr(n_cur, 1);
48224 
48225         ret_val = xmlXPathNextParent(ctxt, cur);
48226         desret_xmlNodePtr(ret_val);
48227         call_tests++;
48228         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48229         des_xmlNodePtr(n_cur, cur, 1);
48230         xmlResetLastError();
48231         if (mem_base != xmlMemBlocks()) {
48232             printf("Leak of %d blocks found in xmlXPathNextParent",
48233 	           xmlMemBlocks() - mem_base);
48234 	    test_ret++;
48235             printf(" %d", n_ctxt);
48236             printf(" %d", n_cur);
48237             printf("\n");
48238         }
48239     }
48240     }
48241     function_tests++;
48242 #endif
48243 
48244     return(test_ret);
48245 }
48246 
48247 
48248 static int
test_xmlXPathNextPreceding(void)48249 test_xmlXPathNextPreceding(void) {
48250     int test_ret = 0;
48251 
48252 #if defined(LIBXML_XPATH_ENABLED)
48253     int mem_base;
48254     xmlNodePtr ret_val;
48255     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48256     int n_ctxt;
48257     xmlNodePtr cur; /* the current node in the traversal */
48258     int n_cur;
48259 
48260     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48261     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48262         mem_base = xmlMemBlocks();
48263         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48264         cur = gen_xmlNodePtr(n_cur, 1);
48265 
48266         ret_val = xmlXPathNextPreceding(ctxt, cur);
48267         desret_xmlNodePtr(ret_val);
48268         call_tests++;
48269         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48270         des_xmlNodePtr(n_cur, cur, 1);
48271         xmlResetLastError();
48272         if (mem_base != xmlMemBlocks()) {
48273             printf("Leak of %d blocks found in xmlXPathNextPreceding",
48274 	           xmlMemBlocks() - mem_base);
48275 	    test_ret++;
48276             printf(" %d", n_ctxt);
48277             printf(" %d", n_cur);
48278             printf("\n");
48279         }
48280     }
48281     }
48282     function_tests++;
48283 #endif
48284 
48285     return(test_ret);
48286 }
48287 
48288 
48289 static int
test_xmlXPathNextPrecedingSibling(void)48290 test_xmlXPathNextPrecedingSibling(void) {
48291     int test_ret = 0;
48292 
48293 #if defined(LIBXML_XPATH_ENABLED)
48294     int mem_base;
48295     xmlNodePtr ret_val;
48296     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48297     int n_ctxt;
48298     xmlNodePtr cur; /* the current node in the traversal */
48299     int n_cur;
48300 
48301     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48302     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48303         mem_base = xmlMemBlocks();
48304         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48305         cur = gen_xmlNodePtr(n_cur, 1);
48306 
48307         ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48308         desret_xmlNodePtr(ret_val);
48309         call_tests++;
48310         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48311         des_xmlNodePtr(n_cur, cur, 1);
48312         xmlResetLastError();
48313         if (mem_base != xmlMemBlocks()) {
48314             printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48315 	           xmlMemBlocks() - mem_base);
48316 	    test_ret++;
48317             printf(" %d", n_ctxt);
48318             printf(" %d", n_cur);
48319             printf("\n");
48320         }
48321     }
48322     }
48323     function_tests++;
48324 #endif
48325 
48326     return(test_ret);
48327 }
48328 
48329 
48330 static int
test_xmlXPathNextSelf(void)48331 test_xmlXPathNextSelf(void) {
48332     int test_ret = 0;
48333 
48334 #if defined(LIBXML_XPATH_ENABLED)
48335     int mem_base;
48336     xmlNodePtr ret_val;
48337     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48338     int n_ctxt;
48339     xmlNodePtr cur; /* the current node in the traversal */
48340     int n_cur;
48341 
48342     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48343     for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48344         mem_base = xmlMemBlocks();
48345         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48346         cur = gen_xmlNodePtr(n_cur, 1);
48347 
48348         ret_val = xmlXPathNextSelf(ctxt, cur);
48349         desret_xmlNodePtr(ret_val);
48350         call_tests++;
48351         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48352         des_xmlNodePtr(n_cur, cur, 1);
48353         xmlResetLastError();
48354         if (mem_base != xmlMemBlocks()) {
48355             printf("Leak of %d blocks found in xmlXPathNextSelf",
48356 	           xmlMemBlocks() - mem_base);
48357 	    test_ret++;
48358             printf(" %d", n_ctxt);
48359             printf(" %d", n_cur);
48360             printf("\n");
48361         }
48362     }
48363     }
48364     function_tests++;
48365 #endif
48366 
48367     return(test_ret);
48368 }
48369 
48370 
48371 static int
test_xmlXPathNodeLeading(void)48372 test_xmlXPathNodeLeading(void) {
48373     int test_ret = 0;
48374 
48375 #if defined(LIBXML_XPATH_ENABLED)
48376     int mem_base;
48377     xmlNodeSetPtr ret_val;
48378     xmlNodeSetPtr nodes; /* a node-set */
48379     int n_nodes;
48380     xmlNodePtr node; /* a node */
48381     int n_node;
48382 
48383     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48384     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48385         mem_base = xmlMemBlocks();
48386         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48387         node = gen_xmlNodePtr(n_node, 1);
48388 
48389         ret_val = xmlXPathNodeLeading(nodes, node);
48390         desret_xmlNodeSetPtr(ret_val);
48391         call_tests++;
48392         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48393         des_xmlNodePtr(n_node, node, 1);
48394         xmlResetLastError();
48395         if (mem_base != xmlMemBlocks()) {
48396             printf("Leak of %d blocks found in xmlXPathNodeLeading",
48397 	           xmlMemBlocks() - mem_base);
48398 	    test_ret++;
48399             printf(" %d", n_nodes);
48400             printf(" %d", n_node);
48401             printf("\n");
48402         }
48403     }
48404     }
48405     function_tests++;
48406 #endif
48407 
48408     return(test_ret);
48409 }
48410 
48411 
48412 static int
test_xmlXPathNodeLeadingSorted(void)48413 test_xmlXPathNodeLeadingSorted(void) {
48414     int test_ret = 0;
48415 
48416 #if defined(LIBXML_XPATH_ENABLED)
48417     int mem_base;
48418     xmlNodeSetPtr ret_val;
48419     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48420     int n_nodes;
48421     xmlNodePtr node; /* a node */
48422     int n_node;
48423 
48424     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48425     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48426         mem_base = xmlMemBlocks();
48427         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48428         node = gen_xmlNodePtr(n_node, 1);
48429 
48430         ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48431         desret_xmlNodeSetPtr(ret_val);
48432         call_tests++;
48433         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48434         des_xmlNodePtr(n_node, node, 1);
48435         xmlResetLastError();
48436         if (mem_base != xmlMemBlocks()) {
48437             printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48438 	           xmlMemBlocks() - mem_base);
48439 	    test_ret++;
48440             printf(" %d", n_nodes);
48441             printf(" %d", n_node);
48442             printf("\n");
48443         }
48444     }
48445     }
48446     function_tests++;
48447 #endif
48448 
48449     return(test_ret);
48450 }
48451 
48452 
48453 static int
test_xmlXPathNodeSetAdd(void)48454 test_xmlXPathNodeSetAdd(void) {
48455     int test_ret = 0;
48456 
48457 #if defined(LIBXML_XPATH_ENABLED)
48458     int mem_base;
48459     xmlNodeSetPtr cur; /* the initial node set */
48460     int n_cur;
48461     xmlNodePtr val; /* a new xmlNodePtr */
48462     int n_val;
48463 
48464     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48465     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48466         mem_base = xmlMemBlocks();
48467         cur = gen_xmlNodeSetPtr(n_cur, 0);
48468         val = gen_xmlNodePtr(n_val, 1);
48469 
48470         xmlXPathNodeSetAdd(cur, val);
48471         call_tests++;
48472         des_xmlNodeSetPtr(n_cur, cur, 0);
48473         des_xmlNodePtr(n_val, val, 1);
48474         xmlResetLastError();
48475         if (mem_base != xmlMemBlocks()) {
48476             printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48477 	           xmlMemBlocks() - mem_base);
48478 	    test_ret++;
48479             printf(" %d", n_cur);
48480             printf(" %d", n_val);
48481             printf("\n");
48482         }
48483     }
48484     }
48485     function_tests++;
48486 #endif
48487 
48488     return(test_ret);
48489 }
48490 
48491 
48492 static int
test_xmlXPathNodeSetAddNs(void)48493 test_xmlXPathNodeSetAddNs(void) {
48494     int test_ret = 0;
48495 
48496 #if defined(LIBXML_XPATH_ENABLED)
48497     int mem_base;
48498     xmlNodeSetPtr cur; /* the initial node set */
48499     int n_cur;
48500     xmlNodePtr node; /* the hosting node */
48501     int n_node;
48502     xmlNsPtr ns; /* a the namespace node */
48503     int n_ns;
48504 
48505     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48506     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48507     for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48508         mem_base = xmlMemBlocks();
48509         cur = gen_xmlNodeSetPtr(n_cur, 0);
48510         node = gen_xmlNodePtr(n_node, 1);
48511         ns = gen_xmlNsPtr(n_ns, 2);
48512 
48513         xmlXPathNodeSetAddNs(cur, node, ns);
48514         call_tests++;
48515         des_xmlNodeSetPtr(n_cur, cur, 0);
48516         des_xmlNodePtr(n_node, node, 1);
48517         des_xmlNsPtr(n_ns, ns, 2);
48518         xmlResetLastError();
48519         if (mem_base != xmlMemBlocks()) {
48520             printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48521 	           xmlMemBlocks() - mem_base);
48522 	    test_ret++;
48523             printf(" %d", n_cur);
48524             printf(" %d", n_node);
48525             printf(" %d", n_ns);
48526             printf("\n");
48527         }
48528     }
48529     }
48530     }
48531     function_tests++;
48532 #endif
48533 
48534     return(test_ret);
48535 }
48536 
48537 
48538 static int
test_xmlXPathNodeSetAddUnique(void)48539 test_xmlXPathNodeSetAddUnique(void) {
48540     int test_ret = 0;
48541 
48542 #if defined(LIBXML_XPATH_ENABLED)
48543     int mem_base;
48544     xmlNodeSetPtr cur; /* the initial node set */
48545     int n_cur;
48546     xmlNodePtr val; /* a new xmlNodePtr */
48547     int n_val;
48548 
48549     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48550     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48551         mem_base = xmlMemBlocks();
48552         cur = gen_xmlNodeSetPtr(n_cur, 0);
48553         val = gen_xmlNodePtr(n_val, 1);
48554 
48555         xmlXPathNodeSetAddUnique(cur, val);
48556         call_tests++;
48557         des_xmlNodeSetPtr(n_cur, cur, 0);
48558         des_xmlNodePtr(n_val, val, 1);
48559         xmlResetLastError();
48560         if (mem_base != xmlMemBlocks()) {
48561             printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48562 	           xmlMemBlocks() - mem_base);
48563 	    test_ret++;
48564             printf(" %d", n_cur);
48565             printf(" %d", n_val);
48566             printf("\n");
48567         }
48568     }
48569     }
48570     function_tests++;
48571 #endif
48572 
48573     return(test_ret);
48574 }
48575 
48576 
48577 static int
test_xmlXPathNodeSetContains(void)48578 test_xmlXPathNodeSetContains(void) {
48579     int test_ret = 0;
48580 
48581 #if defined(LIBXML_XPATH_ENABLED)
48582     int mem_base;
48583     int ret_val;
48584     xmlNodeSetPtr cur; /* the node-set */
48585     int n_cur;
48586     xmlNodePtr val; /* the node */
48587     int n_val;
48588 
48589     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48590     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48591         mem_base = xmlMemBlocks();
48592         cur = gen_xmlNodeSetPtr(n_cur, 0);
48593         val = gen_xmlNodePtr(n_val, 1);
48594 
48595         ret_val = xmlXPathNodeSetContains(cur, val);
48596         desret_int(ret_val);
48597         call_tests++;
48598         des_xmlNodeSetPtr(n_cur, cur, 0);
48599         des_xmlNodePtr(n_val, val, 1);
48600         xmlResetLastError();
48601         if (mem_base != xmlMemBlocks()) {
48602             printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48603 	           xmlMemBlocks() - mem_base);
48604 	    test_ret++;
48605             printf(" %d", n_cur);
48606             printf(" %d", n_val);
48607             printf("\n");
48608         }
48609     }
48610     }
48611     function_tests++;
48612 #endif
48613 
48614     return(test_ret);
48615 }
48616 
48617 
48618 static int
test_xmlXPathNodeSetDel(void)48619 test_xmlXPathNodeSetDel(void) {
48620     int test_ret = 0;
48621 
48622 #if defined(LIBXML_XPATH_ENABLED)
48623     int mem_base;
48624     xmlNodeSetPtr cur; /* the initial node set */
48625     int n_cur;
48626     xmlNodePtr val; /* an xmlNodePtr */
48627     int n_val;
48628 
48629     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48630     for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48631         mem_base = xmlMemBlocks();
48632         cur = gen_xmlNodeSetPtr(n_cur, 0);
48633         val = gen_xmlNodePtr(n_val, 1);
48634 
48635         xmlXPathNodeSetDel(cur, val);
48636         call_tests++;
48637         des_xmlNodeSetPtr(n_cur, cur, 0);
48638         des_xmlNodePtr(n_val, val, 1);
48639         xmlResetLastError();
48640         if (mem_base != xmlMemBlocks()) {
48641             printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48642 	           xmlMemBlocks() - mem_base);
48643 	    test_ret++;
48644             printf(" %d", n_cur);
48645             printf(" %d", n_val);
48646             printf("\n");
48647         }
48648     }
48649     }
48650     function_tests++;
48651 #endif
48652 
48653     return(test_ret);
48654 }
48655 
48656 
48657 static int
test_xmlXPathNodeSetMerge(void)48658 test_xmlXPathNodeSetMerge(void) {
48659     int test_ret = 0;
48660 
48661 #if defined(LIBXML_XPATH_ENABLED)
48662     int mem_base;
48663     xmlNodeSetPtr ret_val;
48664     xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48665     int n_val1;
48666     xmlNodeSetPtr val2; /* the second NodeSet */
48667     int n_val2;
48668 
48669     for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48670     for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48671         mem_base = xmlMemBlocks();
48672         val1 = gen_xmlNodeSetPtr(n_val1, 0);
48673         val2 = gen_xmlNodeSetPtr(n_val2, 1);
48674 
48675         ret_val = xmlXPathNodeSetMerge(val1, val2);
48676         desret_xmlNodeSetPtr(ret_val);
48677         call_tests++;
48678         des_xmlNodeSetPtr(n_val1, val1, 0);
48679         des_xmlNodeSetPtr(n_val2, val2, 1);
48680         xmlResetLastError();
48681         if (mem_base != xmlMemBlocks()) {
48682             printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48683 	           xmlMemBlocks() - mem_base);
48684 	    test_ret++;
48685             printf(" %d", n_val1);
48686             printf(" %d", n_val2);
48687             printf("\n");
48688         }
48689     }
48690     }
48691     function_tests++;
48692 #endif
48693 
48694     return(test_ret);
48695 }
48696 
48697 
48698 static int
test_xmlXPathNodeSetRemove(void)48699 test_xmlXPathNodeSetRemove(void) {
48700     int test_ret = 0;
48701 
48702 #if defined(LIBXML_XPATH_ENABLED)
48703     int mem_base;
48704     xmlNodeSetPtr cur; /* the initial node set */
48705     int n_cur;
48706     int val; /* the index to remove */
48707     int n_val;
48708 
48709     for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48710     for (n_val = 0;n_val < gen_nb_int;n_val++) {
48711         mem_base = xmlMemBlocks();
48712         cur = gen_xmlNodeSetPtr(n_cur, 0);
48713         val = gen_int(n_val, 1);
48714 
48715         xmlXPathNodeSetRemove(cur, val);
48716         call_tests++;
48717         des_xmlNodeSetPtr(n_cur, cur, 0);
48718         des_int(n_val, val, 1);
48719         xmlResetLastError();
48720         if (mem_base != xmlMemBlocks()) {
48721             printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48722 	           xmlMemBlocks() - mem_base);
48723 	    test_ret++;
48724             printf(" %d", n_cur);
48725             printf(" %d", n_val);
48726             printf("\n");
48727         }
48728     }
48729     }
48730     function_tests++;
48731 #endif
48732 
48733     return(test_ret);
48734 }
48735 
48736 
48737 static int
test_xmlXPathNodeSetSort(void)48738 test_xmlXPathNodeSetSort(void) {
48739     int test_ret = 0;
48740 
48741 #if defined(LIBXML_XPATH_ENABLED)
48742     int mem_base;
48743     xmlNodeSetPtr set; /* the node set */
48744     int n_set;
48745 
48746     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48747         mem_base = xmlMemBlocks();
48748         set = gen_xmlNodeSetPtr(n_set, 0);
48749 
48750         xmlXPathNodeSetSort(set);
48751         call_tests++;
48752         des_xmlNodeSetPtr(n_set, set, 0);
48753         xmlResetLastError();
48754         if (mem_base != xmlMemBlocks()) {
48755             printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48756 	           xmlMemBlocks() - mem_base);
48757 	    test_ret++;
48758             printf(" %d", n_set);
48759             printf("\n");
48760         }
48761     }
48762     function_tests++;
48763 #endif
48764 
48765     return(test_ret);
48766 }
48767 
48768 
48769 static int
test_xmlXPathNodeTrailing(void)48770 test_xmlXPathNodeTrailing(void) {
48771     int test_ret = 0;
48772 
48773 #if defined(LIBXML_XPATH_ENABLED)
48774     int mem_base;
48775     xmlNodeSetPtr ret_val;
48776     xmlNodeSetPtr nodes; /* a node-set */
48777     int n_nodes;
48778     xmlNodePtr node; /* a node */
48779     int n_node;
48780 
48781     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48782     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48783         mem_base = xmlMemBlocks();
48784         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48785         node = gen_xmlNodePtr(n_node, 1);
48786 
48787         ret_val = xmlXPathNodeTrailing(nodes, node);
48788         desret_xmlNodeSetPtr(ret_val);
48789         call_tests++;
48790         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48791         des_xmlNodePtr(n_node, node, 1);
48792         xmlResetLastError();
48793         if (mem_base != xmlMemBlocks()) {
48794             printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48795 	           xmlMemBlocks() - mem_base);
48796 	    test_ret++;
48797             printf(" %d", n_nodes);
48798             printf(" %d", n_node);
48799             printf("\n");
48800         }
48801     }
48802     }
48803     function_tests++;
48804 #endif
48805 
48806     return(test_ret);
48807 }
48808 
48809 
48810 static int
test_xmlXPathNodeTrailingSorted(void)48811 test_xmlXPathNodeTrailingSorted(void) {
48812     int test_ret = 0;
48813 
48814 #if defined(LIBXML_XPATH_ENABLED)
48815     int mem_base;
48816     xmlNodeSetPtr ret_val;
48817     xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48818     int n_nodes;
48819     xmlNodePtr node; /* a node */
48820     int n_node;
48821 
48822     for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48823     for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48824         mem_base = xmlMemBlocks();
48825         nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48826         node = gen_xmlNodePtr(n_node, 1);
48827 
48828         ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48829         desret_xmlNodeSetPtr(ret_val);
48830         call_tests++;
48831         des_xmlNodeSetPtr(n_nodes, nodes, 0);
48832         des_xmlNodePtr(n_node, node, 1);
48833         xmlResetLastError();
48834         if (mem_base != xmlMemBlocks()) {
48835             printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48836 	           xmlMemBlocks() - mem_base);
48837 	    test_ret++;
48838             printf(" %d", n_nodes);
48839             printf(" %d", n_node);
48840             printf("\n");
48841         }
48842     }
48843     }
48844     function_tests++;
48845 #endif
48846 
48847     return(test_ret);
48848 }
48849 
48850 
48851 static int
test_xmlXPathNormalizeFunction(void)48852 test_xmlXPathNormalizeFunction(void) {
48853     int test_ret = 0;
48854 
48855 #if defined(LIBXML_XPATH_ENABLED)
48856     int mem_base;
48857     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48858     int n_ctxt;
48859     int nargs; /* the number of arguments */
48860     int n_nargs;
48861 
48862     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48863     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48864         mem_base = xmlMemBlocks();
48865         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48866         nargs = gen_int(n_nargs, 1);
48867 
48868         xmlXPathNormalizeFunction(ctxt, nargs);
48869         call_tests++;
48870         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48871         des_int(n_nargs, nargs, 1);
48872         xmlResetLastError();
48873         if (mem_base != xmlMemBlocks()) {
48874             printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48875 	           xmlMemBlocks() - mem_base);
48876 	    test_ret++;
48877             printf(" %d", n_ctxt);
48878             printf(" %d", n_nargs);
48879             printf("\n");
48880         }
48881     }
48882     }
48883     function_tests++;
48884 #endif
48885 
48886     return(test_ret);
48887 }
48888 
48889 
48890 static int
test_xmlXPathNotEqualValues(void)48891 test_xmlXPathNotEqualValues(void) {
48892     int test_ret = 0;
48893 
48894 #if defined(LIBXML_XPATH_ENABLED)
48895     int mem_base;
48896     int ret_val;
48897     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48898     int n_ctxt;
48899 
48900     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48901         mem_base = xmlMemBlocks();
48902         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48903 
48904         ret_val = xmlXPathNotEqualValues(ctxt);
48905         desret_int(ret_val);
48906         call_tests++;
48907         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48908         xmlResetLastError();
48909         if (mem_base != xmlMemBlocks()) {
48910             printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48911 	           xmlMemBlocks() - mem_base);
48912 	    test_ret++;
48913             printf(" %d", n_ctxt);
48914             printf("\n");
48915         }
48916     }
48917     function_tests++;
48918 #endif
48919 
48920     return(test_ret);
48921 }
48922 
48923 
48924 static int
test_xmlXPathNotFunction(void)48925 test_xmlXPathNotFunction(void) {
48926     int test_ret = 0;
48927 
48928 #if defined(LIBXML_XPATH_ENABLED)
48929     int mem_base;
48930     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48931     int n_ctxt;
48932     int nargs; /* the number of arguments */
48933     int n_nargs;
48934 
48935     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48936     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48937         mem_base = xmlMemBlocks();
48938         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48939         nargs = gen_int(n_nargs, 1);
48940 
48941         xmlXPathNotFunction(ctxt, nargs);
48942         call_tests++;
48943         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48944         des_int(n_nargs, nargs, 1);
48945         xmlResetLastError();
48946         if (mem_base != xmlMemBlocks()) {
48947             printf("Leak of %d blocks found in xmlXPathNotFunction",
48948 	           xmlMemBlocks() - mem_base);
48949 	    test_ret++;
48950             printf(" %d", n_ctxt);
48951             printf(" %d", n_nargs);
48952             printf("\n");
48953         }
48954     }
48955     }
48956     function_tests++;
48957 #endif
48958 
48959     return(test_ret);
48960 }
48961 
48962 
48963 static int
test_xmlXPathNsLookup(void)48964 test_xmlXPathNsLookup(void) {
48965     int test_ret = 0;
48966 
48967 #if defined(LIBXML_XPATH_ENABLED)
48968     int mem_base;
48969     const xmlChar * ret_val;
48970     xmlXPathContextPtr ctxt; /* the XPath context */
48971     int n_ctxt;
48972     xmlChar * prefix; /* the namespace prefix value */
48973     int n_prefix;
48974 
48975     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
48976     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
48977         mem_base = xmlMemBlocks();
48978         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
48979         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
48980 
48981         ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
48982         desret_const_xmlChar_ptr(ret_val);
48983         call_tests++;
48984         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
48985         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
48986         xmlResetLastError();
48987         if (mem_base != xmlMemBlocks()) {
48988             printf("Leak of %d blocks found in xmlXPathNsLookup",
48989 	           xmlMemBlocks() - mem_base);
48990 	    test_ret++;
48991             printf(" %d", n_ctxt);
48992             printf(" %d", n_prefix);
48993             printf("\n");
48994         }
48995     }
48996     }
48997     function_tests++;
48998 #endif
48999 
49000     return(test_ret);
49001 }
49002 
49003 
49004 static int
test_xmlXPathNumberFunction(void)49005 test_xmlXPathNumberFunction(void) {
49006     int test_ret = 0;
49007 
49008 #if defined(LIBXML_XPATH_ENABLED)
49009     int mem_base;
49010     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49011     int n_ctxt;
49012     int nargs; /* the number of arguments */
49013     int n_nargs;
49014 
49015     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49016     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49017         mem_base = xmlMemBlocks();
49018         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49019         nargs = gen_int(n_nargs, 1);
49020 
49021         xmlXPathNumberFunction(ctxt, nargs);
49022         call_tests++;
49023         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49024         des_int(n_nargs, nargs, 1);
49025         xmlResetLastError();
49026         if (mem_base != xmlMemBlocks()) {
49027             printf("Leak of %d blocks found in xmlXPathNumberFunction",
49028 	           xmlMemBlocks() - mem_base);
49029 	    test_ret++;
49030             printf(" %d", n_ctxt);
49031             printf(" %d", n_nargs);
49032             printf("\n");
49033         }
49034     }
49035     }
49036     function_tests++;
49037 #endif
49038 
49039     return(test_ret);
49040 }
49041 
49042 
49043 static int
test_xmlXPathParseNCName(void)49044 test_xmlXPathParseNCName(void) {
49045     int test_ret = 0;
49046 
49047 #if defined(LIBXML_XPATH_ENABLED)
49048     int mem_base;
49049     xmlChar * ret_val;
49050     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49051     int n_ctxt;
49052 
49053     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49054         mem_base = xmlMemBlocks();
49055         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49056 
49057         ret_val = xmlXPathParseNCName(ctxt);
49058         desret_xmlChar_ptr(ret_val);
49059         call_tests++;
49060         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49061         xmlResetLastError();
49062         if (mem_base != xmlMemBlocks()) {
49063             printf("Leak of %d blocks found in xmlXPathParseNCName",
49064 	           xmlMemBlocks() - mem_base);
49065 	    test_ret++;
49066             printf(" %d", n_ctxt);
49067             printf("\n");
49068         }
49069     }
49070     function_tests++;
49071 #endif
49072 
49073     return(test_ret);
49074 }
49075 
49076 
49077 static int
test_xmlXPathParseName(void)49078 test_xmlXPathParseName(void) {
49079     int test_ret = 0;
49080 
49081 #if defined(LIBXML_XPATH_ENABLED)
49082     int mem_base;
49083     xmlChar * ret_val;
49084     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49085     int n_ctxt;
49086 
49087     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49088         mem_base = xmlMemBlocks();
49089         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49090 
49091         ret_val = xmlXPathParseName(ctxt);
49092         desret_xmlChar_ptr(ret_val);
49093         call_tests++;
49094         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49095         xmlResetLastError();
49096         if (mem_base != xmlMemBlocks()) {
49097             printf("Leak of %d blocks found in xmlXPathParseName",
49098 	           xmlMemBlocks() - mem_base);
49099 	    test_ret++;
49100             printf(" %d", n_ctxt);
49101             printf("\n");
49102         }
49103     }
49104     function_tests++;
49105 #endif
49106 
49107     return(test_ret);
49108 }
49109 
49110 
49111 static int
test_xmlXPathPopBoolean(void)49112 test_xmlXPathPopBoolean(void) {
49113     int test_ret = 0;
49114 
49115 #if defined(LIBXML_XPATH_ENABLED)
49116     int mem_base;
49117     int ret_val;
49118     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49119     int n_ctxt;
49120 
49121     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49122         mem_base = xmlMemBlocks();
49123         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49124 
49125         ret_val = xmlXPathPopBoolean(ctxt);
49126         desret_int(ret_val);
49127         call_tests++;
49128         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49129         xmlResetLastError();
49130         if (mem_base != xmlMemBlocks()) {
49131             printf("Leak of %d blocks found in xmlXPathPopBoolean",
49132 	           xmlMemBlocks() - mem_base);
49133 	    test_ret++;
49134             printf(" %d", n_ctxt);
49135             printf("\n");
49136         }
49137     }
49138     function_tests++;
49139 #endif
49140 
49141     return(test_ret);
49142 }
49143 
49144 
49145 static int
test_xmlXPathPopExternal(void)49146 test_xmlXPathPopExternal(void) {
49147     int test_ret = 0;
49148 
49149 #if defined(LIBXML_XPATH_ENABLED)
49150     int mem_base;
49151     void * ret_val;
49152     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49153     int n_ctxt;
49154 
49155     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49156         mem_base = xmlMemBlocks();
49157         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49158 
49159         ret_val = xmlXPathPopExternal(ctxt);
49160         desret_void_ptr(ret_val);
49161         call_tests++;
49162         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49163         xmlResetLastError();
49164         if (mem_base != xmlMemBlocks()) {
49165             printf("Leak of %d blocks found in xmlXPathPopExternal",
49166 	           xmlMemBlocks() - mem_base);
49167 	    test_ret++;
49168             printf(" %d", n_ctxt);
49169             printf("\n");
49170         }
49171     }
49172     function_tests++;
49173 #endif
49174 
49175     return(test_ret);
49176 }
49177 
49178 
49179 static int
test_xmlXPathPopNodeSet(void)49180 test_xmlXPathPopNodeSet(void) {
49181     int test_ret = 0;
49182 
49183 #if defined(LIBXML_XPATH_ENABLED)
49184     int mem_base;
49185     xmlNodeSetPtr ret_val;
49186     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49187     int n_ctxt;
49188 
49189     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49190         mem_base = xmlMemBlocks();
49191         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49192 
49193         ret_val = xmlXPathPopNodeSet(ctxt);
49194         desret_xmlNodeSetPtr(ret_val);
49195         call_tests++;
49196         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49197         xmlResetLastError();
49198         if (mem_base != xmlMemBlocks()) {
49199             printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49200 	           xmlMemBlocks() - mem_base);
49201 	    test_ret++;
49202             printf(" %d", n_ctxt);
49203             printf("\n");
49204         }
49205     }
49206     function_tests++;
49207 #endif
49208 
49209     return(test_ret);
49210 }
49211 
49212 
49213 static int
test_xmlXPathPopNumber(void)49214 test_xmlXPathPopNumber(void) {
49215     int test_ret = 0;
49216 
49217 #if defined(LIBXML_XPATH_ENABLED)
49218     int mem_base;
49219     double ret_val;
49220     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49221     int n_ctxt;
49222 
49223     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49224         mem_base = xmlMemBlocks();
49225         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49226 
49227         ret_val = xmlXPathPopNumber(ctxt);
49228         desret_double(ret_val);
49229         call_tests++;
49230         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49231         xmlResetLastError();
49232         if (mem_base != xmlMemBlocks()) {
49233             printf("Leak of %d blocks found in xmlXPathPopNumber",
49234 	           xmlMemBlocks() - mem_base);
49235 	    test_ret++;
49236             printf(" %d", n_ctxt);
49237             printf("\n");
49238         }
49239     }
49240     function_tests++;
49241 #endif
49242 
49243     return(test_ret);
49244 }
49245 
49246 
49247 static int
test_xmlXPathPopString(void)49248 test_xmlXPathPopString(void) {
49249     int test_ret = 0;
49250 
49251 #if defined(LIBXML_XPATH_ENABLED)
49252     int mem_base;
49253     xmlChar * ret_val;
49254     xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49255     int n_ctxt;
49256 
49257     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49258         mem_base = xmlMemBlocks();
49259         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49260 
49261         ret_val = xmlXPathPopString(ctxt);
49262         desret_xmlChar_ptr(ret_val);
49263         call_tests++;
49264         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49265         xmlResetLastError();
49266         if (mem_base != xmlMemBlocks()) {
49267             printf("Leak of %d blocks found in xmlXPathPopString",
49268 	           xmlMemBlocks() - mem_base);
49269 	    test_ret++;
49270             printf(" %d", n_ctxt);
49271             printf("\n");
49272         }
49273     }
49274     function_tests++;
49275 #endif
49276 
49277     return(test_ret);
49278 }
49279 
49280 
49281 static int
test_xmlXPathPositionFunction(void)49282 test_xmlXPathPositionFunction(void) {
49283     int test_ret = 0;
49284 
49285 #if defined(LIBXML_XPATH_ENABLED)
49286     int mem_base;
49287     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49288     int n_ctxt;
49289     int nargs; /* the number of arguments */
49290     int n_nargs;
49291 
49292     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49293     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49294         mem_base = xmlMemBlocks();
49295         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49296         nargs = gen_int(n_nargs, 1);
49297 
49298         xmlXPathPositionFunction(ctxt, nargs);
49299         call_tests++;
49300         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49301         des_int(n_nargs, nargs, 1);
49302         xmlResetLastError();
49303         if (mem_base != xmlMemBlocks()) {
49304             printf("Leak of %d blocks found in xmlXPathPositionFunction",
49305 	           xmlMemBlocks() - mem_base);
49306 	    test_ret++;
49307             printf(" %d", n_ctxt);
49308             printf(" %d", n_nargs);
49309             printf("\n");
49310         }
49311     }
49312     }
49313     function_tests++;
49314 #endif
49315 
49316     return(test_ret);
49317 }
49318 
49319 
49320 static int
test_xmlXPathRegisterAllFunctions(void)49321 test_xmlXPathRegisterAllFunctions(void) {
49322     int test_ret = 0;
49323 
49324 #if defined(LIBXML_XPATH_ENABLED)
49325     int mem_base;
49326     xmlXPathContextPtr ctxt; /* the XPath context */
49327     int n_ctxt;
49328 
49329     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49330         mem_base = xmlMemBlocks();
49331         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49332 
49333         xmlXPathRegisterAllFunctions(ctxt);
49334         call_tests++;
49335         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49336         xmlResetLastError();
49337         if (mem_base != xmlMemBlocks()) {
49338             printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49339 	           xmlMemBlocks() - mem_base);
49340 	    test_ret++;
49341             printf(" %d", n_ctxt);
49342             printf("\n");
49343         }
49344     }
49345     function_tests++;
49346 #endif
49347 
49348     return(test_ret);
49349 }
49350 
49351 
49352 static int
test_xmlXPathRegisterFunc(void)49353 test_xmlXPathRegisterFunc(void) {
49354     int test_ret = 0;
49355 
49356 
49357     /* missing type support */
49358     return(test_ret);
49359 }
49360 
49361 
49362 static int
test_xmlXPathRegisterFuncLookup(void)49363 test_xmlXPathRegisterFuncLookup(void) {
49364     int test_ret = 0;
49365 
49366 
49367     /* missing type support */
49368     return(test_ret);
49369 }
49370 
49371 
49372 static int
test_xmlXPathRegisterFuncNS(void)49373 test_xmlXPathRegisterFuncNS(void) {
49374     int test_ret = 0;
49375 
49376 
49377     /* missing type support */
49378     return(test_ret);
49379 }
49380 
49381 
49382 static int
test_xmlXPathRegisterNs(void)49383 test_xmlXPathRegisterNs(void) {
49384     int test_ret = 0;
49385 
49386 #if defined(LIBXML_XPATH_ENABLED)
49387     int mem_base;
49388     int ret_val;
49389     xmlXPathContextPtr ctxt; /* the XPath context */
49390     int n_ctxt;
49391     xmlChar * prefix; /* the namespace prefix */
49392     int n_prefix;
49393     xmlChar * ns_uri; /* the namespace name */
49394     int n_ns_uri;
49395 
49396     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49397     for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49398     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49399         mem_base = xmlMemBlocks();
49400         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49401         prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49402         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49403 
49404         ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49405         desret_int(ret_val);
49406         call_tests++;
49407         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49408         des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49409         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49410         xmlResetLastError();
49411         if (mem_base != xmlMemBlocks()) {
49412             printf("Leak of %d blocks found in xmlXPathRegisterNs",
49413 	           xmlMemBlocks() - mem_base);
49414 	    test_ret++;
49415             printf(" %d", n_ctxt);
49416             printf(" %d", n_prefix);
49417             printf(" %d", n_ns_uri);
49418             printf("\n");
49419         }
49420     }
49421     }
49422     }
49423     function_tests++;
49424 #endif
49425 
49426     return(test_ret);
49427 }
49428 
49429 
49430 static int
test_xmlXPathRegisterVariable(void)49431 test_xmlXPathRegisterVariable(void) {
49432     int test_ret = 0;
49433 
49434 #if defined(LIBXML_XPATH_ENABLED)
49435     int mem_base;
49436     int ret_val;
49437     xmlXPathContextPtr ctxt; /* the XPath context */
49438     int n_ctxt;
49439     xmlChar * name; /* the variable name */
49440     int n_name;
49441     xmlXPathObjectPtr value; /* the variable value or NULL */
49442     int n_value;
49443 
49444     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49445     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49446     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49447         mem_base = xmlMemBlocks();
49448         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49449         name = gen_const_xmlChar_ptr(n_name, 1);
49450         value = gen_xmlXPathObjectPtr(n_value, 2);
49451 
49452         ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49453         desret_int(ret_val);
49454         call_tests++;
49455         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49456         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49457         des_xmlXPathObjectPtr(n_value, value, 2);
49458         xmlResetLastError();
49459         if (mem_base != xmlMemBlocks()) {
49460             printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49461 	           xmlMemBlocks() - mem_base);
49462 	    test_ret++;
49463             printf(" %d", n_ctxt);
49464             printf(" %d", n_name);
49465             printf(" %d", n_value);
49466             printf("\n");
49467         }
49468     }
49469     }
49470     }
49471     function_tests++;
49472 #endif
49473 
49474     return(test_ret);
49475 }
49476 
49477 
49478 static int
test_xmlXPathRegisterVariableLookup(void)49479 test_xmlXPathRegisterVariableLookup(void) {
49480     int test_ret = 0;
49481 
49482 
49483     /* missing type support */
49484     return(test_ret);
49485 }
49486 
49487 
49488 static int
test_xmlXPathRegisterVariableNS(void)49489 test_xmlXPathRegisterVariableNS(void) {
49490     int test_ret = 0;
49491 
49492 #if defined(LIBXML_XPATH_ENABLED)
49493     int mem_base;
49494     int ret_val;
49495     xmlXPathContextPtr ctxt; /* the XPath context */
49496     int n_ctxt;
49497     xmlChar * name; /* the variable name */
49498     int n_name;
49499     xmlChar * ns_uri; /* the variable namespace URI */
49500     int n_ns_uri;
49501     xmlXPathObjectPtr value; /* the variable value or NULL */
49502     int n_value;
49503 
49504     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49505     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49506     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49507     for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49508         mem_base = xmlMemBlocks();
49509         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49510         name = gen_const_xmlChar_ptr(n_name, 1);
49511         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49512         value = gen_xmlXPathObjectPtr(n_value, 3);
49513 
49514         ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49515         desret_int(ret_val);
49516         call_tests++;
49517         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49518         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49519         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49520         des_xmlXPathObjectPtr(n_value, value, 3);
49521         xmlResetLastError();
49522         if (mem_base != xmlMemBlocks()) {
49523             printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49524 	           xmlMemBlocks() - mem_base);
49525 	    test_ret++;
49526             printf(" %d", n_ctxt);
49527             printf(" %d", n_name);
49528             printf(" %d", n_ns_uri);
49529             printf(" %d", n_value);
49530             printf("\n");
49531         }
49532     }
49533     }
49534     }
49535     }
49536     function_tests++;
49537 #endif
49538 
49539     return(test_ret);
49540 }
49541 
49542 
49543 static int
test_xmlXPathRegisteredFuncsCleanup(void)49544 test_xmlXPathRegisteredFuncsCleanup(void) {
49545     int test_ret = 0;
49546 
49547 #if defined(LIBXML_XPATH_ENABLED)
49548     int mem_base;
49549     xmlXPathContextPtr ctxt; /* the XPath context */
49550     int n_ctxt;
49551 
49552     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49553         mem_base = xmlMemBlocks();
49554         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49555 
49556         xmlXPathRegisteredFuncsCleanup(ctxt);
49557         call_tests++;
49558         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49559         xmlResetLastError();
49560         if (mem_base != xmlMemBlocks()) {
49561             printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49562 	           xmlMemBlocks() - mem_base);
49563 	    test_ret++;
49564             printf(" %d", n_ctxt);
49565             printf("\n");
49566         }
49567     }
49568     function_tests++;
49569 #endif
49570 
49571     return(test_ret);
49572 }
49573 
49574 
49575 static int
test_xmlXPathRegisteredNsCleanup(void)49576 test_xmlXPathRegisteredNsCleanup(void) {
49577     int test_ret = 0;
49578 
49579 #if defined(LIBXML_XPATH_ENABLED)
49580     int mem_base;
49581     xmlXPathContextPtr ctxt; /* the XPath context */
49582     int n_ctxt;
49583 
49584     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49585         mem_base = xmlMemBlocks();
49586         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49587 
49588         xmlXPathRegisteredNsCleanup(ctxt);
49589         call_tests++;
49590         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49591         xmlResetLastError();
49592         if (mem_base != xmlMemBlocks()) {
49593             printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49594 	           xmlMemBlocks() - mem_base);
49595 	    test_ret++;
49596             printf(" %d", n_ctxt);
49597             printf("\n");
49598         }
49599     }
49600     function_tests++;
49601 #endif
49602 
49603     return(test_ret);
49604 }
49605 
49606 
49607 static int
test_xmlXPathRegisteredVariablesCleanup(void)49608 test_xmlXPathRegisteredVariablesCleanup(void) {
49609     int test_ret = 0;
49610 
49611 #if defined(LIBXML_XPATH_ENABLED)
49612     int mem_base;
49613     xmlXPathContextPtr ctxt; /* the XPath context */
49614     int n_ctxt;
49615 
49616     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49617         mem_base = xmlMemBlocks();
49618         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49619 
49620         xmlXPathRegisteredVariablesCleanup(ctxt);
49621         call_tests++;
49622         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49623         xmlResetLastError();
49624         if (mem_base != xmlMemBlocks()) {
49625             printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49626 	           xmlMemBlocks() - mem_base);
49627 	    test_ret++;
49628             printf(" %d", n_ctxt);
49629             printf("\n");
49630         }
49631     }
49632     function_tests++;
49633 #endif
49634 
49635     return(test_ret);
49636 }
49637 
49638 
49639 static int
test_xmlXPathRoot(void)49640 test_xmlXPathRoot(void) {
49641     int test_ret = 0;
49642 
49643 #if defined(LIBXML_XPATH_ENABLED)
49644     int mem_base;
49645     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49646     int n_ctxt;
49647 
49648     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49649         mem_base = xmlMemBlocks();
49650         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49651 
49652         xmlXPathRoot(ctxt);
49653         call_tests++;
49654         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49655         xmlResetLastError();
49656         if (mem_base != xmlMemBlocks()) {
49657             printf("Leak of %d blocks found in xmlXPathRoot",
49658 	           xmlMemBlocks() - mem_base);
49659 	    test_ret++;
49660             printf(" %d", n_ctxt);
49661             printf("\n");
49662         }
49663     }
49664     function_tests++;
49665 #endif
49666 
49667     return(test_ret);
49668 }
49669 
49670 
49671 static int
test_xmlXPathRoundFunction(void)49672 test_xmlXPathRoundFunction(void) {
49673     int test_ret = 0;
49674 
49675 #if defined(LIBXML_XPATH_ENABLED)
49676     int mem_base;
49677     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49678     int n_ctxt;
49679     int nargs; /* the number of arguments */
49680     int n_nargs;
49681 
49682     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49683     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49684         mem_base = xmlMemBlocks();
49685         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49686         nargs = gen_int(n_nargs, 1);
49687 
49688         xmlXPathRoundFunction(ctxt, nargs);
49689         call_tests++;
49690         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49691         des_int(n_nargs, nargs, 1);
49692         xmlResetLastError();
49693         if (mem_base != xmlMemBlocks()) {
49694             printf("Leak of %d blocks found in xmlXPathRoundFunction",
49695 	           xmlMemBlocks() - mem_base);
49696 	    test_ret++;
49697             printf(" %d", n_ctxt);
49698             printf(" %d", n_nargs);
49699             printf("\n");
49700         }
49701     }
49702     }
49703     function_tests++;
49704 #endif
49705 
49706     return(test_ret);
49707 }
49708 
49709 
49710 static int
test_xmlXPathStartsWithFunction(void)49711 test_xmlXPathStartsWithFunction(void) {
49712     int test_ret = 0;
49713 
49714 #if defined(LIBXML_XPATH_ENABLED)
49715     int mem_base;
49716     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49717     int n_ctxt;
49718     int nargs; /* the number of arguments */
49719     int n_nargs;
49720 
49721     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49722     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49723         mem_base = xmlMemBlocks();
49724         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49725         nargs = gen_int(n_nargs, 1);
49726 
49727         xmlXPathStartsWithFunction(ctxt, nargs);
49728         call_tests++;
49729         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49730         des_int(n_nargs, nargs, 1);
49731         xmlResetLastError();
49732         if (mem_base != xmlMemBlocks()) {
49733             printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49734 	           xmlMemBlocks() - mem_base);
49735 	    test_ret++;
49736             printf(" %d", n_ctxt);
49737             printf(" %d", n_nargs);
49738             printf("\n");
49739         }
49740     }
49741     }
49742     function_tests++;
49743 #endif
49744 
49745     return(test_ret);
49746 }
49747 
49748 
49749 static int
test_xmlXPathStringEvalNumber(void)49750 test_xmlXPathStringEvalNumber(void) {
49751     int test_ret = 0;
49752 
49753 #if defined(LIBXML_XPATH_ENABLED)
49754     int mem_base;
49755     double ret_val;
49756     xmlChar * str; /* A string to scan */
49757     int n_str;
49758 
49759     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49760         mem_base = xmlMemBlocks();
49761         str = gen_const_xmlChar_ptr(n_str, 0);
49762 
49763         ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49764         desret_double(ret_val);
49765         call_tests++;
49766         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49767         xmlResetLastError();
49768         if (mem_base != xmlMemBlocks()) {
49769             printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49770 	           xmlMemBlocks() - mem_base);
49771 	    test_ret++;
49772             printf(" %d", n_str);
49773             printf("\n");
49774         }
49775     }
49776     function_tests++;
49777 #endif
49778 
49779     return(test_ret);
49780 }
49781 
49782 
49783 static int
test_xmlXPathStringFunction(void)49784 test_xmlXPathStringFunction(void) {
49785     int test_ret = 0;
49786 
49787 #if defined(LIBXML_XPATH_ENABLED)
49788     int mem_base;
49789     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49790     int n_ctxt;
49791     int nargs; /* the number of arguments */
49792     int n_nargs;
49793 
49794     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49795     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49796         mem_base = xmlMemBlocks();
49797         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49798         nargs = gen_int(n_nargs, 1);
49799 
49800         xmlXPathStringFunction(ctxt, nargs);
49801         call_tests++;
49802         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49803         des_int(n_nargs, nargs, 1);
49804         xmlResetLastError();
49805         if (mem_base != xmlMemBlocks()) {
49806             printf("Leak of %d blocks found in xmlXPathStringFunction",
49807 	           xmlMemBlocks() - mem_base);
49808 	    test_ret++;
49809             printf(" %d", n_ctxt);
49810             printf(" %d", n_nargs);
49811             printf("\n");
49812         }
49813     }
49814     }
49815     function_tests++;
49816 #endif
49817 
49818     return(test_ret);
49819 }
49820 
49821 
49822 static int
test_xmlXPathStringLengthFunction(void)49823 test_xmlXPathStringLengthFunction(void) {
49824     int test_ret = 0;
49825 
49826 #if defined(LIBXML_XPATH_ENABLED)
49827     int mem_base;
49828     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49829     int n_ctxt;
49830     int nargs; /* the number of arguments */
49831     int n_nargs;
49832 
49833     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49834     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49835         mem_base = xmlMemBlocks();
49836         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49837         nargs = gen_int(n_nargs, 1);
49838 
49839         xmlXPathStringLengthFunction(ctxt, nargs);
49840         call_tests++;
49841         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49842         des_int(n_nargs, nargs, 1);
49843         xmlResetLastError();
49844         if (mem_base != xmlMemBlocks()) {
49845             printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49846 	           xmlMemBlocks() - mem_base);
49847 	    test_ret++;
49848             printf(" %d", n_ctxt);
49849             printf(" %d", n_nargs);
49850             printf("\n");
49851         }
49852     }
49853     }
49854     function_tests++;
49855 #endif
49856 
49857     return(test_ret);
49858 }
49859 
49860 
49861 static int
test_xmlXPathSubValues(void)49862 test_xmlXPathSubValues(void) {
49863     int test_ret = 0;
49864 
49865 #if defined(LIBXML_XPATH_ENABLED)
49866     int mem_base;
49867     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49868     int n_ctxt;
49869 
49870     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49871         mem_base = xmlMemBlocks();
49872         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49873 
49874         xmlXPathSubValues(ctxt);
49875         call_tests++;
49876         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49877         xmlResetLastError();
49878         if (mem_base != xmlMemBlocks()) {
49879             printf("Leak of %d blocks found in xmlXPathSubValues",
49880 	           xmlMemBlocks() - mem_base);
49881 	    test_ret++;
49882             printf(" %d", n_ctxt);
49883             printf("\n");
49884         }
49885     }
49886     function_tests++;
49887 #endif
49888 
49889     return(test_ret);
49890 }
49891 
49892 
49893 static int
test_xmlXPathSubstringAfterFunction(void)49894 test_xmlXPathSubstringAfterFunction(void) {
49895     int test_ret = 0;
49896 
49897 #if defined(LIBXML_XPATH_ENABLED)
49898     int mem_base;
49899     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49900     int n_ctxt;
49901     int nargs; /* the number of arguments */
49902     int n_nargs;
49903 
49904     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49905     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49906         mem_base = xmlMemBlocks();
49907         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49908         nargs = gen_int(n_nargs, 1);
49909 
49910         xmlXPathSubstringAfterFunction(ctxt, nargs);
49911         call_tests++;
49912         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49913         des_int(n_nargs, nargs, 1);
49914         xmlResetLastError();
49915         if (mem_base != xmlMemBlocks()) {
49916             printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
49917 	           xmlMemBlocks() - mem_base);
49918 	    test_ret++;
49919             printf(" %d", n_ctxt);
49920             printf(" %d", n_nargs);
49921             printf("\n");
49922         }
49923     }
49924     }
49925     function_tests++;
49926 #endif
49927 
49928     return(test_ret);
49929 }
49930 
49931 
49932 static int
test_xmlXPathSubstringBeforeFunction(void)49933 test_xmlXPathSubstringBeforeFunction(void) {
49934     int test_ret = 0;
49935 
49936 #if defined(LIBXML_XPATH_ENABLED)
49937     int mem_base;
49938     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49939     int n_ctxt;
49940     int nargs; /* the number of arguments */
49941     int n_nargs;
49942 
49943     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49944     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49945         mem_base = xmlMemBlocks();
49946         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49947         nargs = gen_int(n_nargs, 1);
49948 
49949         xmlXPathSubstringBeforeFunction(ctxt, nargs);
49950         call_tests++;
49951         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49952         des_int(n_nargs, nargs, 1);
49953         xmlResetLastError();
49954         if (mem_base != xmlMemBlocks()) {
49955             printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
49956 	           xmlMemBlocks() - mem_base);
49957 	    test_ret++;
49958             printf(" %d", n_ctxt);
49959             printf(" %d", n_nargs);
49960             printf("\n");
49961         }
49962     }
49963     }
49964     function_tests++;
49965 #endif
49966 
49967     return(test_ret);
49968 }
49969 
49970 
49971 static int
test_xmlXPathSubstringFunction(void)49972 test_xmlXPathSubstringFunction(void) {
49973     int test_ret = 0;
49974 
49975 #if defined(LIBXML_XPATH_ENABLED)
49976     int mem_base;
49977     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49978     int n_ctxt;
49979     int nargs; /* the number of arguments */
49980     int n_nargs;
49981 
49982     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49983     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49984         mem_base = xmlMemBlocks();
49985         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49986         nargs = gen_int(n_nargs, 1);
49987 
49988         xmlXPathSubstringFunction(ctxt, nargs);
49989         call_tests++;
49990         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49991         des_int(n_nargs, nargs, 1);
49992         xmlResetLastError();
49993         if (mem_base != xmlMemBlocks()) {
49994             printf("Leak of %d blocks found in xmlXPathSubstringFunction",
49995 	           xmlMemBlocks() - mem_base);
49996 	    test_ret++;
49997             printf(" %d", n_ctxt);
49998             printf(" %d", n_nargs);
49999             printf("\n");
50000         }
50001     }
50002     }
50003     function_tests++;
50004 #endif
50005 
50006     return(test_ret);
50007 }
50008 
50009 
50010 static int
test_xmlXPathSumFunction(void)50011 test_xmlXPathSumFunction(void) {
50012     int test_ret = 0;
50013 
50014 #if defined(LIBXML_XPATH_ENABLED)
50015     int mem_base;
50016     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50017     int n_ctxt;
50018     int nargs; /* the number of arguments */
50019     int n_nargs;
50020 
50021     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50022     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50023         mem_base = xmlMemBlocks();
50024         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50025         nargs = gen_int(n_nargs, 1);
50026 
50027         xmlXPathSumFunction(ctxt, nargs);
50028         call_tests++;
50029         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50030         des_int(n_nargs, nargs, 1);
50031         xmlResetLastError();
50032         if (mem_base != xmlMemBlocks()) {
50033             printf("Leak of %d blocks found in xmlXPathSumFunction",
50034 	           xmlMemBlocks() - mem_base);
50035 	    test_ret++;
50036             printf(" %d", n_ctxt);
50037             printf(" %d", n_nargs);
50038             printf("\n");
50039         }
50040     }
50041     }
50042     function_tests++;
50043 #endif
50044 
50045     return(test_ret);
50046 }
50047 
50048 
50049 static int
test_xmlXPathTrailing(void)50050 test_xmlXPathTrailing(void) {
50051     int test_ret = 0;
50052 
50053 #if defined(LIBXML_XPATH_ENABLED)
50054     int mem_base;
50055     xmlNodeSetPtr ret_val;
50056     xmlNodeSetPtr nodes1; /* a node-set */
50057     int n_nodes1;
50058     xmlNodeSetPtr nodes2; /* a node-set */
50059     int n_nodes2;
50060 
50061     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50062     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50063         mem_base = xmlMemBlocks();
50064         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50065         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50066 
50067         ret_val = xmlXPathTrailing(nodes1, nodes2);
50068         desret_xmlNodeSetPtr(ret_val);
50069         call_tests++;
50070         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50071         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50072         xmlResetLastError();
50073         if (mem_base != xmlMemBlocks()) {
50074             printf("Leak of %d blocks found in xmlXPathTrailing",
50075 	           xmlMemBlocks() - mem_base);
50076 	    test_ret++;
50077             printf(" %d", n_nodes1);
50078             printf(" %d", n_nodes2);
50079             printf("\n");
50080         }
50081     }
50082     }
50083     function_tests++;
50084 #endif
50085 
50086     return(test_ret);
50087 }
50088 
50089 
50090 static int
test_xmlXPathTrailingSorted(void)50091 test_xmlXPathTrailingSorted(void) {
50092     int test_ret = 0;
50093 
50094 #if defined(LIBXML_XPATH_ENABLED)
50095     int mem_base;
50096     xmlNodeSetPtr ret_val;
50097     xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50098     int n_nodes1;
50099     xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50100     int n_nodes2;
50101 
50102     for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50103     for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50104         mem_base = xmlMemBlocks();
50105         nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50106         nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50107 
50108         ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50109         desret_xmlNodeSetPtr(ret_val);
50110         call_tests++;
50111         des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50112         des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50113         xmlResetLastError();
50114         if (mem_base != xmlMemBlocks()) {
50115             printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50116 	           xmlMemBlocks() - mem_base);
50117 	    test_ret++;
50118             printf(" %d", n_nodes1);
50119             printf(" %d", n_nodes2);
50120             printf("\n");
50121         }
50122     }
50123     }
50124     function_tests++;
50125 #endif
50126 
50127     return(test_ret);
50128 }
50129 
50130 
50131 static int
test_xmlXPathTranslateFunction(void)50132 test_xmlXPathTranslateFunction(void) {
50133     int test_ret = 0;
50134 
50135 #if defined(LIBXML_XPATH_ENABLED)
50136     int mem_base;
50137     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50138     int n_ctxt;
50139     int nargs; /* the number of arguments */
50140     int n_nargs;
50141 
50142     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50143     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50144         mem_base = xmlMemBlocks();
50145         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50146         nargs = gen_int(n_nargs, 1);
50147 
50148         xmlXPathTranslateFunction(ctxt, nargs);
50149         call_tests++;
50150         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50151         des_int(n_nargs, nargs, 1);
50152         xmlResetLastError();
50153         if (mem_base != xmlMemBlocks()) {
50154             printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50155 	           xmlMemBlocks() - mem_base);
50156 	    test_ret++;
50157             printf(" %d", n_ctxt);
50158             printf(" %d", n_nargs);
50159             printf("\n");
50160         }
50161     }
50162     }
50163     function_tests++;
50164 #endif
50165 
50166     return(test_ret);
50167 }
50168 
50169 
50170 static int
test_xmlXPathTrueFunction(void)50171 test_xmlXPathTrueFunction(void) {
50172     int test_ret = 0;
50173 
50174 #if defined(LIBXML_XPATH_ENABLED)
50175     int mem_base;
50176     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50177     int n_ctxt;
50178     int nargs; /* the number of arguments */
50179     int n_nargs;
50180 
50181     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50182     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50183         mem_base = xmlMemBlocks();
50184         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50185         nargs = gen_int(n_nargs, 1);
50186 
50187         xmlXPathTrueFunction(ctxt, nargs);
50188         call_tests++;
50189         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50190         des_int(n_nargs, nargs, 1);
50191         xmlResetLastError();
50192         if (mem_base != xmlMemBlocks()) {
50193             printf("Leak of %d blocks found in xmlXPathTrueFunction",
50194 	           xmlMemBlocks() - mem_base);
50195 	    test_ret++;
50196             printf(" %d", n_ctxt);
50197             printf(" %d", n_nargs);
50198             printf("\n");
50199         }
50200     }
50201     }
50202     function_tests++;
50203 #endif
50204 
50205     return(test_ret);
50206 }
50207 
50208 
50209 static int
test_xmlXPathValueFlipSign(void)50210 test_xmlXPathValueFlipSign(void) {
50211     int test_ret = 0;
50212 
50213 #if defined(LIBXML_XPATH_ENABLED)
50214     int mem_base;
50215     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50216     int n_ctxt;
50217 
50218     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50219         mem_base = xmlMemBlocks();
50220         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50221 
50222         xmlXPathValueFlipSign(ctxt);
50223         call_tests++;
50224         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50225         xmlResetLastError();
50226         if (mem_base != xmlMemBlocks()) {
50227             printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50228 	           xmlMemBlocks() - mem_base);
50229 	    test_ret++;
50230             printf(" %d", n_ctxt);
50231             printf("\n");
50232         }
50233     }
50234     function_tests++;
50235 #endif
50236 
50237     return(test_ret);
50238 }
50239 
50240 
50241 static int
test_xmlXPathVariableLookup(void)50242 test_xmlXPathVariableLookup(void) {
50243     int test_ret = 0;
50244 
50245 #if defined(LIBXML_XPATH_ENABLED)
50246     int mem_base;
50247     xmlXPathObjectPtr ret_val;
50248     xmlXPathContextPtr ctxt; /* the XPath context */
50249     int n_ctxt;
50250     xmlChar * name; /* the variable name */
50251     int n_name;
50252 
50253     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50254     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50255         mem_base = xmlMemBlocks();
50256         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50257         name = gen_const_xmlChar_ptr(n_name, 1);
50258 
50259         ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50260         desret_xmlXPathObjectPtr(ret_val);
50261         call_tests++;
50262         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50263         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50264         xmlResetLastError();
50265         if (mem_base != xmlMemBlocks()) {
50266             printf("Leak of %d blocks found in xmlXPathVariableLookup",
50267 	           xmlMemBlocks() - mem_base);
50268 	    test_ret++;
50269             printf(" %d", n_ctxt);
50270             printf(" %d", n_name);
50271             printf("\n");
50272         }
50273     }
50274     }
50275     function_tests++;
50276 #endif
50277 
50278     return(test_ret);
50279 }
50280 
50281 
50282 static int
test_xmlXPathVariableLookupNS(void)50283 test_xmlXPathVariableLookupNS(void) {
50284     int test_ret = 0;
50285 
50286 #if defined(LIBXML_XPATH_ENABLED)
50287     int mem_base;
50288     xmlXPathObjectPtr ret_val;
50289     xmlXPathContextPtr ctxt; /* the XPath context */
50290     int n_ctxt;
50291     xmlChar * name; /* the variable name */
50292     int n_name;
50293     xmlChar * ns_uri; /* the variable namespace URI */
50294     int n_ns_uri;
50295 
50296     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50297     for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50298     for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50299         mem_base = xmlMemBlocks();
50300         ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50301         name = gen_const_xmlChar_ptr(n_name, 1);
50302         ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50303 
50304         ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50305         desret_xmlXPathObjectPtr(ret_val);
50306         call_tests++;
50307         des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50308         des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50309         des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50310         xmlResetLastError();
50311         if (mem_base != xmlMemBlocks()) {
50312             printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50313 	           xmlMemBlocks() - mem_base);
50314 	    test_ret++;
50315             printf(" %d", n_ctxt);
50316             printf(" %d", n_name);
50317             printf(" %d", n_ns_uri);
50318             printf("\n");
50319         }
50320     }
50321     }
50322     }
50323     function_tests++;
50324 #endif
50325 
50326     return(test_ret);
50327 }
50328 
50329 
50330 static int
test_xmlXPathWrapCString(void)50331 test_xmlXPathWrapCString(void) {
50332     int test_ret = 0;
50333 
50334 #if defined(LIBXML_XPATH_ENABLED)
50335     int mem_base;
50336     xmlXPathObjectPtr ret_val;
50337     char * val; /* the char * value */
50338     int n_val;
50339 
50340     for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50341         mem_base = xmlMemBlocks();
50342         val = gen_char_ptr(n_val, 0);
50343 
50344         ret_val = xmlXPathWrapCString(val);
50345         desret_xmlXPathObjectPtr(ret_val);
50346         call_tests++;
50347         des_char_ptr(n_val, val, 0);
50348         xmlResetLastError();
50349         if (mem_base != xmlMemBlocks()) {
50350             printf("Leak of %d blocks found in xmlXPathWrapCString",
50351 	           xmlMemBlocks() - mem_base);
50352 	    test_ret++;
50353             printf(" %d", n_val);
50354             printf("\n");
50355         }
50356     }
50357     function_tests++;
50358 #endif
50359 
50360     return(test_ret);
50361 }
50362 
50363 
50364 static int
test_xmlXPathWrapExternal(void)50365 test_xmlXPathWrapExternal(void) {
50366     int test_ret = 0;
50367 
50368 #if defined(LIBXML_XPATH_ENABLED)
50369     int mem_base;
50370     xmlXPathObjectPtr ret_val;
50371     void * val; /* the user data */
50372     int n_val;
50373 
50374     for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50375         mem_base = xmlMemBlocks();
50376         val = gen_void_ptr(n_val, 0);
50377 
50378         ret_val = xmlXPathWrapExternal(val);
50379         desret_xmlXPathObjectPtr(ret_val);
50380         call_tests++;
50381         des_void_ptr(n_val, val, 0);
50382         xmlResetLastError();
50383         if (mem_base != xmlMemBlocks()) {
50384             printf("Leak of %d blocks found in xmlXPathWrapExternal",
50385 	           xmlMemBlocks() - mem_base);
50386 	    test_ret++;
50387             printf(" %d", n_val);
50388             printf("\n");
50389         }
50390     }
50391     function_tests++;
50392 #endif
50393 
50394     return(test_ret);
50395 }
50396 
50397 
50398 static int
test_xmlXPathWrapNodeSet(void)50399 test_xmlXPathWrapNodeSet(void) {
50400     int test_ret = 0;
50401 
50402 #if defined(LIBXML_XPATH_ENABLED)
50403     int mem_base;
50404     xmlXPathObjectPtr ret_val;
50405     xmlNodeSetPtr val; /* the NodePtr value */
50406     int n_val;
50407 
50408     for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50409         mem_base = xmlMemBlocks();
50410         val = gen_xmlNodeSetPtr(n_val, 0);
50411 
50412         ret_val = xmlXPathWrapNodeSet(val);
50413         desret_xmlXPathObjectPtr(ret_val);
50414         call_tests++;
50415         des_xmlNodeSetPtr(n_val, val, 0);
50416         xmlResetLastError();
50417         if (mem_base != xmlMemBlocks()) {
50418             printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50419 	           xmlMemBlocks() - mem_base);
50420 	    test_ret++;
50421             printf(" %d", n_val);
50422             printf("\n");
50423         }
50424     }
50425     function_tests++;
50426 #endif
50427 
50428     return(test_ret);
50429 }
50430 
50431 
50432 static int
test_xmlXPatherror(void)50433 test_xmlXPatherror(void) {
50434     int test_ret = 0;
50435 
50436 #if defined(LIBXML_XPATH_ENABLED)
50437     int mem_base;
50438     xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50439     int n_ctxt;
50440     const char * file; /* the file name */
50441     int n_file;
50442     int line; /* the line number */
50443     int n_line;
50444     int no; /* the error number */
50445     int n_no;
50446 
50447     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50448     for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50449     for (n_line = 0;n_line < gen_nb_int;n_line++) {
50450     for (n_no = 0;n_no < gen_nb_int;n_no++) {
50451         mem_base = xmlMemBlocks();
50452         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50453         file = gen_filepath(n_file, 1);
50454         line = gen_int(n_line, 2);
50455         no = gen_int(n_no, 3);
50456 
50457         xmlXPatherror(ctxt, file, line, no);
50458         call_tests++;
50459         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50460         des_filepath(n_file, file, 1);
50461         des_int(n_line, line, 2);
50462         des_int(n_no, no, 3);
50463         xmlResetLastError();
50464         if (mem_base != xmlMemBlocks()) {
50465             printf("Leak of %d blocks found in xmlXPatherror",
50466 	           xmlMemBlocks() - mem_base);
50467 	    test_ret++;
50468             printf(" %d", n_ctxt);
50469             printf(" %d", n_file);
50470             printf(" %d", n_line);
50471             printf(" %d", n_no);
50472             printf("\n");
50473         }
50474     }
50475     }
50476     }
50477     }
50478     function_tests++;
50479 #endif
50480 
50481     return(test_ret);
50482 }
50483 
50484 static int
test_xpathInternals(void)50485 test_xpathInternals(void) {
50486     int test_ret = 0;
50487 
50488     if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50489     test_ret += test_valuePop();
50490     test_ret += test_valuePush();
50491     test_ret += test_xmlXPathAddValues();
50492     test_ret += test_xmlXPathBooleanFunction();
50493     test_ret += test_xmlXPathCeilingFunction();
50494     test_ret += test_xmlXPathCompareValues();
50495     test_ret += test_xmlXPathConcatFunction();
50496     test_ret += test_xmlXPathContainsFunction();
50497     test_ret += test_xmlXPathCountFunction();
50498     test_ret += test_xmlXPathDebugDumpCompExpr();
50499     test_ret += test_xmlXPathDebugDumpObject();
50500     test_ret += test_xmlXPathDifference();
50501     test_ret += test_xmlXPathDistinct();
50502     test_ret += test_xmlXPathDistinctSorted();
50503     test_ret += test_xmlXPathDivValues();
50504     test_ret += test_xmlXPathEqualValues();
50505     test_ret += test_xmlXPathErr();
50506     test_ret += test_xmlXPathEvalExpr();
50507     test_ret += test_xmlXPathEvaluatePredicateResult();
50508     test_ret += test_xmlXPathFalseFunction();
50509     test_ret += test_xmlXPathFloorFunction();
50510     test_ret += test_xmlXPathFunctionLookup();
50511     test_ret += test_xmlXPathFunctionLookupNS();
50512     test_ret += test_xmlXPathHasSameNodes();
50513     test_ret += test_xmlXPathIdFunction();
50514     test_ret += test_xmlXPathIntersection();
50515     test_ret += test_xmlXPathIsNodeType();
50516     test_ret += test_xmlXPathLangFunction();
50517     test_ret += test_xmlXPathLastFunction();
50518     test_ret += test_xmlXPathLeading();
50519     test_ret += test_xmlXPathLeadingSorted();
50520     test_ret += test_xmlXPathLocalNameFunction();
50521     test_ret += test_xmlXPathModValues();
50522     test_ret += test_xmlXPathMultValues();
50523     test_ret += test_xmlXPathNamespaceURIFunction();
50524     test_ret += test_xmlXPathNewBoolean();
50525     test_ret += test_xmlXPathNewCString();
50526     test_ret += test_xmlXPathNewFloat();
50527     test_ret += test_xmlXPathNewNodeSet();
50528     test_ret += test_xmlXPathNewNodeSetList();
50529     test_ret += test_xmlXPathNewParserContext();
50530     test_ret += test_xmlXPathNewString();
50531     test_ret += test_xmlXPathNextAncestor();
50532     test_ret += test_xmlXPathNextAncestorOrSelf();
50533     test_ret += test_xmlXPathNextAttribute();
50534     test_ret += test_xmlXPathNextChild();
50535     test_ret += test_xmlXPathNextDescendant();
50536     test_ret += test_xmlXPathNextDescendantOrSelf();
50537     test_ret += test_xmlXPathNextFollowing();
50538     test_ret += test_xmlXPathNextFollowingSibling();
50539     test_ret += test_xmlXPathNextNamespace();
50540     test_ret += test_xmlXPathNextParent();
50541     test_ret += test_xmlXPathNextPreceding();
50542     test_ret += test_xmlXPathNextPrecedingSibling();
50543     test_ret += test_xmlXPathNextSelf();
50544     test_ret += test_xmlXPathNodeLeading();
50545     test_ret += test_xmlXPathNodeLeadingSorted();
50546     test_ret += test_xmlXPathNodeSetAdd();
50547     test_ret += test_xmlXPathNodeSetAddNs();
50548     test_ret += test_xmlXPathNodeSetAddUnique();
50549     test_ret += test_xmlXPathNodeSetContains();
50550     test_ret += test_xmlXPathNodeSetDel();
50551     test_ret += test_xmlXPathNodeSetMerge();
50552     test_ret += test_xmlXPathNodeSetRemove();
50553     test_ret += test_xmlXPathNodeSetSort();
50554     test_ret += test_xmlXPathNodeTrailing();
50555     test_ret += test_xmlXPathNodeTrailingSorted();
50556     test_ret += test_xmlXPathNormalizeFunction();
50557     test_ret += test_xmlXPathNotEqualValues();
50558     test_ret += test_xmlXPathNotFunction();
50559     test_ret += test_xmlXPathNsLookup();
50560     test_ret += test_xmlXPathNumberFunction();
50561     test_ret += test_xmlXPathParseNCName();
50562     test_ret += test_xmlXPathParseName();
50563     test_ret += test_xmlXPathPopBoolean();
50564     test_ret += test_xmlXPathPopExternal();
50565     test_ret += test_xmlXPathPopNodeSet();
50566     test_ret += test_xmlXPathPopNumber();
50567     test_ret += test_xmlXPathPopString();
50568     test_ret += test_xmlXPathPositionFunction();
50569     test_ret += test_xmlXPathRegisterAllFunctions();
50570     test_ret += test_xmlXPathRegisterFunc();
50571     test_ret += test_xmlXPathRegisterFuncLookup();
50572     test_ret += test_xmlXPathRegisterFuncNS();
50573     test_ret += test_xmlXPathRegisterNs();
50574     test_ret += test_xmlXPathRegisterVariable();
50575     test_ret += test_xmlXPathRegisterVariableLookup();
50576     test_ret += test_xmlXPathRegisterVariableNS();
50577     test_ret += test_xmlXPathRegisteredFuncsCleanup();
50578     test_ret += test_xmlXPathRegisteredNsCleanup();
50579     test_ret += test_xmlXPathRegisteredVariablesCleanup();
50580     test_ret += test_xmlXPathRoot();
50581     test_ret += test_xmlXPathRoundFunction();
50582     test_ret += test_xmlXPathStartsWithFunction();
50583     test_ret += test_xmlXPathStringEvalNumber();
50584     test_ret += test_xmlXPathStringFunction();
50585     test_ret += test_xmlXPathStringLengthFunction();
50586     test_ret += test_xmlXPathSubValues();
50587     test_ret += test_xmlXPathSubstringAfterFunction();
50588     test_ret += test_xmlXPathSubstringBeforeFunction();
50589     test_ret += test_xmlXPathSubstringFunction();
50590     test_ret += test_xmlXPathSumFunction();
50591     test_ret += test_xmlXPathTrailing();
50592     test_ret += test_xmlXPathTrailingSorted();
50593     test_ret += test_xmlXPathTranslateFunction();
50594     test_ret += test_xmlXPathTrueFunction();
50595     test_ret += test_xmlXPathValueFlipSign();
50596     test_ret += test_xmlXPathVariableLookup();
50597     test_ret += test_xmlXPathVariableLookupNS();
50598     test_ret += test_xmlXPathWrapCString();
50599     test_ret += test_xmlXPathWrapExternal();
50600     test_ret += test_xmlXPathWrapNodeSet();
50601     test_ret += test_xmlXPatherror();
50602 
50603     if (test_ret != 0)
50604 	printf("Module xpathInternals: %d errors\n", test_ret);
50605     return(test_ret);
50606 }
50607 
50608 static int
test_xmlXPtrBuildNodeList(void)50609 test_xmlXPtrBuildNodeList(void) {
50610     int test_ret = 0;
50611 
50612 #if defined(LIBXML_XPTR_ENABLED)
50613     int mem_base;
50614     xmlNodePtr ret_val;
50615     xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50616     int n_obj;
50617 
50618     for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50619         mem_base = xmlMemBlocks();
50620         obj = gen_xmlXPathObjectPtr(n_obj, 0);
50621 
50622         ret_val = xmlXPtrBuildNodeList(obj);
50623         desret_xmlNodePtr(ret_val);
50624         call_tests++;
50625         des_xmlXPathObjectPtr(n_obj, obj, 0);
50626         xmlResetLastError();
50627         if (mem_base != xmlMemBlocks()) {
50628             printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50629 	           xmlMemBlocks() - mem_base);
50630 	    test_ret++;
50631             printf(" %d", n_obj);
50632             printf("\n");
50633         }
50634     }
50635     function_tests++;
50636 #endif
50637 
50638     return(test_ret);
50639 }
50640 
50641 
50642 static int
test_xmlXPtrEval(void)50643 test_xmlXPtrEval(void) {
50644     int test_ret = 0;
50645 
50646 #if defined(LIBXML_XPTR_ENABLED)
50647     int mem_base;
50648     xmlXPathObjectPtr ret_val;
50649     xmlChar * str; /* the XPointer expression */
50650     int n_str;
50651     xmlXPathContextPtr ctx; /* the XPointer context */
50652     int n_ctx;
50653 
50654     for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50655     for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50656         mem_base = xmlMemBlocks();
50657         str = gen_const_xmlChar_ptr(n_str, 0);
50658         ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50659 
50660         ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50661         desret_xmlXPathObjectPtr(ret_val);
50662         call_tests++;
50663         des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50664         des_xmlXPathContextPtr(n_ctx, ctx, 1);
50665         xmlResetLastError();
50666         if (mem_base != xmlMemBlocks()) {
50667             printf("Leak of %d blocks found in xmlXPtrEval",
50668 	           xmlMemBlocks() - mem_base);
50669 	    test_ret++;
50670             printf(" %d", n_str);
50671             printf(" %d", n_ctx);
50672             printf("\n");
50673         }
50674     }
50675     }
50676     function_tests++;
50677 #endif
50678 
50679     return(test_ret);
50680 }
50681 
50682 
50683 static int
test_xmlXPtrEvalRangePredicate(void)50684 test_xmlXPtrEvalRangePredicate(void) {
50685     int test_ret = 0;
50686 
50687 #if defined(LIBXML_XPTR_ENABLED)
50688     int mem_base;
50689     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50690     int n_ctxt;
50691 
50692     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50693         mem_base = xmlMemBlocks();
50694         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50695 
50696         xmlXPtrEvalRangePredicate(ctxt);
50697         call_tests++;
50698         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50699         xmlResetLastError();
50700         if (mem_base != xmlMemBlocks()) {
50701             printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50702 	           xmlMemBlocks() - mem_base);
50703 	    test_ret++;
50704             printf(" %d", n_ctxt);
50705             printf("\n");
50706         }
50707     }
50708     function_tests++;
50709 #endif
50710 
50711     return(test_ret);
50712 }
50713 
50714 #ifdef LIBXML_XPTR_ENABLED
50715 
50716 #define gen_nb_xmlLocationSetPtr 1
gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)50717 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50718     return(NULL);
50719 }
des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED,xmlLocationSetPtr val ATTRIBUTE_UNUSED,int nr ATTRIBUTE_UNUSED)50720 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50721 }
50722 #endif
50723 
50724 
50725 static int
test_xmlXPtrLocationSetAdd(void)50726 test_xmlXPtrLocationSetAdd(void) {
50727     int test_ret = 0;
50728 
50729 #if defined(LIBXML_XPTR_ENABLED)
50730     int mem_base;
50731     xmlLocationSetPtr cur; /* the initial range set */
50732     int n_cur;
50733     xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50734     int n_val;
50735 
50736     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50737     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50738         mem_base = xmlMemBlocks();
50739         cur = gen_xmlLocationSetPtr(n_cur, 0);
50740         val = gen_xmlXPathObjectPtr(n_val, 1);
50741 
50742         xmlXPtrLocationSetAdd(cur, val);
50743         call_tests++;
50744         des_xmlLocationSetPtr(n_cur, cur, 0);
50745         des_xmlXPathObjectPtr(n_val, val, 1);
50746         xmlResetLastError();
50747         if (mem_base != xmlMemBlocks()) {
50748             printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50749 	           xmlMemBlocks() - mem_base);
50750 	    test_ret++;
50751             printf(" %d", n_cur);
50752             printf(" %d", n_val);
50753             printf("\n");
50754         }
50755     }
50756     }
50757     function_tests++;
50758 #endif
50759 
50760     return(test_ret);
50761 }
50762 
50763 
50764 static int
test_xmlXPtrLocationSetCreate(void)50765 test_xmlXPtrLocationSetCreate(void) {
50766     int test_ret = 0;
50767 
50768 
50769     /* missing type support */
50770     return(test_ret);
50771 }
50772 
50773 
50774 static int
test_xmlXPtrLocationSetDel(void)50775 test_xmlXPtrLocationSetDel(void) {
50776     int test_ret = 0;
50777 
50778 #if defined(LIBXML_XPTR_ENABLED)
50779     int mem_base;
50780     xmlLocationSetPtr cur; /* the initial range set */
50781     int n_cur;
50782     xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50783     int n_val;
50784 
50785     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50786     for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50787         mem_base = xmlMemBlocks();
50788         cur = gen_xmlLocationSetPtr(n_cur, 0);
50789         val = gen_xmlXPathObjectPtr(n_val, 1);
50790 
50791         xmlXPtrLocationSetDel(cur, val);
50792         call_tests++;
50793         des_xmlLocationSetPtr(n_cur, cur, 0);
50794         des_xmlXPathObjectPtr(n_val, val, 1);
50795         xmlResetLastError();
50796         if (mem_base != xmlMemBlocks()) {
50797             printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50798 	           xmlMemBlocks() - mem_base);
50799 	    test_ret++;
50800             printf(" %d", n_cur);
50801             printf(" %d", n_val);
50802             printf("\n");
50803         }
50804     }
50805     }
50806     function_tests++;
50807 #endif
50808 
50809     return(test_ret);
50810 }
50811 
50812 
50813 static int
test_xmlXPtrLocationSetMerge(void)50814 test_xmlXPtrLocationSetMerge(void) {
50815     int test_ret = 0;
50816 
50817 
50818     /* missing type support */
50819     return(test_ret);
50820 }
50821 
50822 
50823 static int
test_xmlXPtrLocationSetRemove(void)50824 test_xmlXPtrLocationSetRemove(void) {
50825     int test_ret = 0;
50826 
50827 #if defined(LIBXML_XPTR_ENABLED)
50828     int mem_base;
50829     xmlLocationSetPtr cur; /* the initial range set */
50830     int n_cur;
50831     int val; /* the index to remove */
50832     int n_val;
50833 
50834     for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50835     for (n_val = 0;n_val < gen_nb_int;n_val++) {
50836         mem_base = xmlMemBlocks();
50837         cur = gen_xmlLocationSetPtr(n_cur, 0);
50838         val = gen_int(n_val, 1);
50839 
50840         xmlXPtrLocationSetRemove(cur, val);
50841         call_tests++;
50842         des_xmlLocationSetPtr(n_cur, cur, 0);
50843         des_int(n_val, val, 1);
50844         xmlResetLastError();
50845         if (mem_base != xmlMemBlocks()) {
50846             printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50847 	           xmlMemBlocks() - mem_base);
50848 	    test_ret++;
50849             printf(" %d", n_cur);
50850             printf(" %d", n_val);
50851             printf("\n");
50852         }
50853     }
50854     }
50855     function_tests++;
50856 #endif
50857 
50858     return(test_ret);
50859 }
50860 
50861 
50862 static int
test_xmlXPtrNewCollapsedRange(void)50863 test_xmlXPtrNewCollapsedRange(void) {
50864     int test_ret = 0;
50865 
50866 #if defined(LIBXML_XPTR_ENABLED)
50867     int mem_base;
50868     xmlXPathObjectPtr ret_val;
50869     xmlNodePtr start; /* the starting and ending node */
50870     int n_start;
50871 
50872     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50873         mem_base = xmlMemBlocks();
50874         start = gen_xmlNodePtr(n_start, 0);
50875 
50876         ret_val = xmlXPtrNewCollapsedRange(start);
50877         desret_xmlXPathObjectPtr(ret_val);
50878         call_tests++;
50879         des_xmlNodePtr(n_start, start, 0);
50880         xmlResetLastError();
50881         if (mem_base != xmlMemBlocks()) {
50882             printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50883 	           xmlMemBlocks() - mem_base);
50884 	    test_ret++;
50885             printf(" %d", n_start);
50886             printf("\n");
50887         }
50888     }
50889     function_tests++;
50890 #endif
50891 
50892     return(test_ret);
50893 }
50894 
50895 
50896 static int
test_xmlXPtrNewContext(void)50897 test_xmlXPtrNewContext(void) {
50898     int test_ret = 0;
50899 
50900 
50901     /* missing type support */
50902     return(test_ret);
50903 }
50904 
50905 
50906 static int
test_xmlXPtrNewLocationSetNodeSet(void)50907 test_xmlXPtrNewLocationSetNodeSet(void) {
50908     int test_ret = 0;
50909 
50910 #if defined(LIBXML_XPTR_ENABLED)
50911     int mem_base;
50912     xmlXPathObjectPtr ret_val;
50913     xmlNodeSetPtr set; /* a node set */
50914     int n_set;
50915 
50916     for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50917         mem_base = xmlMemBlocks();
50918         set = gen_xmlNodeSetPtr(n_set, 0);
50919 
50920         ret_val = xmlXPtrNewLocationSetNodeSet(set);
50921         desret_xmlXPathObjectPtr(ret_val);
50922         call_tests++;
50923         des_xmlNodeSetPtr(n_set, set, 0);
50924         xmlResetLastError();
50925         if (mem_base != xmlMemBlocks()) {
50926             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
50927 	           xmlMemBlocks() - mem_base);
50928 	    test_ret++;
50929             printf(" %d", n_set);
50930             printf("\n");
50931         }
50932     }
50933     function_tests++;
50934 #endif
50935 
50936     return(test_ret);
50937 }
50938 
50939 
50940 static int
test_xmlXPtrNewLocationSetNodes(void)50941 test_xmlXPtrNewLocationSetNodes(void) {
50942     int test_ret = 0;
50943 
50944 #if defined(LIBXML_XPTR_ENABLED)
50945     int mem_base;
50946     xmlXPathObjectPtr ret_val;
50947     xmlNodePtr start; /* the start NodePtr value */
50948     int n_start;
50949     xmlNodePtr end; /* the end NodePtr value or NULL */
50950     int n_end;
50951 
50952     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50953     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
50954         mem_base = xmlMemBlocks();
50955         start = gen_xmlNodePtr(n_start, 0);
50956         end = gen_xmlNodePtr(n_end, 1);
50957 
50958         ret_val = xmlXPtrNewLocationSetNodes(start, end);
50959         desret_xmlXPathObjectPtr(ret_val);
50960         call_tests++;
50961         des_xmlNodePtr(n_start, start, 0);
50962         des_xmlNodePtr(n_end, end, 1);
50963         xmlResetLastError();
50964         if (mem_base != xmlMemBlocks()) {
50965             printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
50966 	           xmlMemBlocks() - mem_base);
50967 	    test_ret++;
50968             printf(" %d", n_start);
50969             printf(" %d", n_end);
50970             printf("\n");
50971         }
50972     }
50973     }
50974     function_tests++;
50975 #endif
50976 
50977     return(test_ret);
50978 }
50979 
50980 
50981 static int
test_xmlXPtrNewRange(void)50982 test_xmlXPtrNewRange(void) {
50983     int test_ret = 0;
50984 
50985 #if defined(LIBXML_XPTR_ENABLED)
50986     int mem_base;
50987     xmlXPathObjectPtr ret_val;
50988     xmlNodePtr start; /* the starting node */
50989     int n_start;
50990     int startindex; /* the start index */
50991     int n_startindex;
50992     xmlNodePtr end; /* the ending point */
50993     int n_end;
50994     int endindex; /* the ending index */
50995     int n_endindex;
50996 
50997     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50998     for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
50999     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51000     for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51001         mem_base = xmlMemBlocks();
51002         start = gen_xmlNodePtr(n_start, 0);
51003         startindex = gen_int(n_startindex, 1);
51004         end = gen_xmlNodePtr(n_end, 2);
51005         endindex = gen_int(n_endindex, 3);
51006 
51007         ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51008         desret_xmlXPathObjectPtr(ret_val);
51009         call_tests++;
51010         des_xmlNodePtr(n_start, start, 0);
51011         des_int(n_startindex, startindex, 1);
51012         des_xmlNodePtr(n_end, end, 2);
51013         des_int(n_endindex, endindex, 3);
51014         xmlResetLastError();
51015         if (mem_base != xmlMemBlocks()) {
51016             printf("Leak of %d blocks found in xmlXPtrNewRange",
51017 	           xmlMemBlocks() - mem_base);
51018 	    test_ret++;
51019             printf(" %d", n_start);
51020             printf(" %d", n_startindex);
51021             printf(" %d", n_end);
51022             printf(" %d", n_endindex);
51023             printf("\n");
51024         }
51025     }
51026     }
51027     }
51028     }
51029     function_tests++;
51030 #endif
51031 
51032     return(test_ret);
51033 }
51034 
51035 
51036 static int
test_xmlXPtrNewRangeNodeObject(void)51037 test_xmlXPtrNewRangeNodeObject(void) {
51038     int test_ret = 0;
51039 
51040 #if defined(LIBXML_XPTR_ENABLED)
51041     int mem_base;
51042     xmlXPathObjectPtr ret_val;
51043     xmlNodePtr start; /* the starting node */
51044     int n_start;
51045     xmlXPathObjectPtr end; /* the ending object */
51046     int n_end;
51047 
51048     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51049     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51050         mem_base = xmlMemBlocks();
51051         start = gen_xmlNodePtr(n_start, 0);
51052         end = gen_xmlXPathObjectPtr(n_end, 1);
51053 
51054         ret_val = xmlXPtrNewRangeNodeObject(start, end);
51055         desret_xmlXPathObjectPtr(ret_val);
51056         call_tests++;
51057         des_xmlNodePtr(n_start, start, 0);
51058         des_xmlXPathObjectPtr(n_end, end, 1);
51059         xmlResetLastError();
51060         if (mem_base != xmlMemBlocks()) {
51061             printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51062 	           xmlMemBlocks() - mem_base);
51063 	    test_ret++;
51064             printf(" %d", n_start);
51065             printf(" %d", n_end);
51066             printf("\n");
51067         }
51068     }
51069     }
51070     function_tests++;
51071 #endif
51072 
51073     return(test_ret);
51074 }
51075 
51076 
51077 static int
test_xmlXPtrNewRangeNodePoint(void)51078 test_xmlXPtrNewRangeNodePoint(void) {
51079     int test_ret = 0;
51080 
51081 #if defined(LIBXML_XPTR_ENABLED)
51082     int mem_base;
51083     xmlXPathObjectPtr ret_val;
51084     xmlNodePtr start; /* the starting node */
51085     int n_start;
51086     xmlXPathObjectPtr end; /* the ending point */
51087     int n_end;
51088 
51089     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51090     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51091         mem_base = xmlMemBlocks();
51092         start = gen_xmlNodePtr(n_start, 0);
51093         end = gen_xmlXPathObjectPtr(n_end, 1);
51094 
51095         ret_val = xmlXPtrNewRangeNodePoint(start, end);
51096         desret_xmlXPathObjectPtr(ret_val);
51097         call_tests++;
51098         des_xmlNodePtr(n_start, start, 0);
51099         des_xmlXPathObjectPtr(n_end, end, 1);
51100         xmlResetLastError();
51101         if (mem_base != xmlMemBlocks()) {
51102             printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51103 	           xmlMemBlocks() - mem_base);
51104 	    test_ret++;
51105             printf(" %d", n_start);
51106             printf(" %d", n_end);
51107             printf("\n");
51108         }
51109     }
51110     }
51111     function_tests++;
51112 #endif
51113 
51114     return(test_ret);
51115 }
51116 
51117 
51118 static int
test_xmlXPtrNewRangeNodes(void)51119 test_xmlXPtrNewRangeNodes(void) {
51120     int test_ret = 0;
51121 
51122 #if defined(LIBXML_XPTR_ENABLED)
51123     int mem_base;
51124     xmlXPathObjectPtr ret_val;
51125     xmlNodePtr start; /* the starting node */
51126     int n_start;
51127     xmlNodePtr end; /* the ending node */
51128     int n_end;
51129 
51130     for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51131     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51132         mem_base = xmlMemBlocks();
51133         start = gen_xmlNodePtr(n_start, 0);
51134         end = gen_xmlNodePtr(n_end, 1);
51135 
51136         ret_val = xmlXPtrNewRangeNodes(start, end);
51137         desret_xmlXPathObjectPtr(ret_val);
51138         call_tests++;
51139         des_xmlNodePtr(n_start, start, 0);
51140         des_xmlNodePtr(n_end, end, 1);
51141         xmlResetLastError();
51142         if (mem_base != xmlMemBlocks()) {
51143             printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51144 	           xmlMemBlocks() - mem_base);
51145 	    test_ret++;
51146             printf(" %d", n_start);
51147             printf(" %d", n_end);
51148             printf("\n");
51149         }
51150     }
51151     }
51152     function_tests++;
51153 #endif
51154 
51155     return(test_ret);
51156 }
51157 
51158 
51159 static int
test_xmlXPtrNewRangePointNode(void)51160 test_xmlXPtrNewRangePointNode(void) {
51161     int test_ret = 0;
51162 
51163 #if defined(LIBXML_XPTR_ENABLED)
51164     int mem_base;
51165     xmlXPathObjectPtr ret_val;
51166     xmlXPathObjectPtr start; /* the starting point */
51167     int n_start;
51168     xmlNodePtr end; /* the ending node */
51169     int n_end;
51170 
51171     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51172     for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51173         mem_base = xmlMemBlocks();
51174         start = gen_xmlXPathObjectPtr(n_start, 0);
51175         end = gen_xmlNodePtr(n_end, 1);
51176 
51177         ret_val = xmlXPtrNewRangePointNode(start, end);
51178         desret_xmlXPathObjectPtr(ret_val);
51179         call_tests++;
51180         des_xmlXPathObjectPtr(n_start, start, 0);
51181         des_xmlNodePtr(n_end, end, 1);
51182         xmlResetLastError();
51183         if (mem_base != xmlMemBlocks()) {
51184             printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51185 	           xmlMemBlocks() - mem_base);
51186 	    test_ret++;
51187             printf(" %d", n_start);
51188             printf(" %d", n_end);
51189             printf("\n");
51190         }
51191     }
51192     }
51193     function_tests++;
51194 #endif
51195 
51196     return(test_ret);
51197 }
51198 
51199 
51200 static int
test_xmlXPtrNewRangePoints(void)51201 test_xmlXPtrNewRangePoints(void) {
51202     int test_ret = 0;
51203 
51204 #if defined(LIBXML_XPTR_ENABLED)
51205     int mem_base;
51206     xmlXPathObjectPtr ret_val;
51207     xmlXPathObjectPtr start; /* the starting point */
51208     int n_start;
51209     xmlXPathObjectPtr end; /* the ending point */
51210     int n_end;
51211 
51212     for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51213     for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51214         mem_base = xmlMemBlocks();
51215         start = gen_xmlXPathObjectPtr(n_start, 0);
51216         end = gen_xmlXPathObjectPtr(n_end, 1);
51217 
51218         ret_val = xmlXPtrNewRangePoints(start, end);
51219         desret_xmlXPathObjectPtr(ret_val);
51220         call_tests++;
51221         des_xmlXPathObjectPtr(n_start, start, 0);
51222         des_xmlXPathObjectPtr(n_end, end, 1);
51223         xmlResetLastError();
51224         if (mem_base != xmlMemBlocks()) {
51225             printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51226 	           xmlMemBlocks() - mem_base);
51227 	    test_ret++;
51228             printf(" %d", n_start);
51229             printf(" %d", n_end);
51230             printf("\n");
51231         }
51232     }
51233     }
51234     function_tests++;
51235 #endif
51236 
51237     return(test_ret);
51238 }
51239 
51240 
51241 static int
test_xmlXPtrRangeToFunction(void)51242 test_xmlXPtrRangeToFunction(void) {
51243     int test_ret = 0;
51244 
51245 #if defined(LIBXML_XPTR_ENABLED)
51246     int mem_base;
51247     xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51248     int n_ctxt;
51249     int nargs; /* the number of args */
51250     int n_nargs;
51251 
51252     for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51253     for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51254         mem_base = xmlMemBlocks();
51255         ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51256         nargs = gen_int(n_nargs, 1);
51257 
51258         xmlXPtrRangeToFunction(ctxt, nargs);
51259         call_tests++;
51260         des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51261         des_int(n_nargs, nargs, 1);
51262         xmlResetLastError();
51263         if (mem_base != xmlMemBlocks()) {
51264             printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51265 	           xmlMemBlocks() - mem_base);
51266 	    test_ret++;
51267             printf(" %d", n_ctxt);
51268             printf(" %d", n_nargs);
51269             printf("\n");
51270         }
51271     }
51272     }
51273     function_tests++;
51274 #endif
51275 
51276     return(test_ret);
51277 }
51278 
51279 
51280 static int
test_xmlXPtrWrapLocationSet(void)51281 test_xmlXPtrWrapLocationSet(void) {
51282     int test_ret = 0;
51283 
51284 #if defined(LIBXML_XPTR_ENABLED)
51285     int mem_base;
51286     xmlXPathObjectPtr ret_val;
51287     xmlLocationSetPtr val; /* the LocationSet value */
51288     int n_val;
51289 
51290     for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51291         mem_base = xmlMemBlocks();
51292         val = gen_xmlLocationSetPtr(n_val, 0);
51293 
51294         ret_val = xmlXPtrWrapLocationSet(val);
51295         desret_xmlXPathObjectPtr(ret_val);
51296         call_tests++;
51297         des_xmlLocationSetPtr(n_val, val, 0);
51298         xmlResetLastError();
51299         if (mem_base != xmlMemBlocks()) {
51300             printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51301 	           xmlMemBlocks() - mem_base);
51302 	    test_ret++;
51303             printf(" %d", n_val);
51304             printf("\n");
51305         }
51306     }
51307     function_tests++;
51308 #endif
51309 
51310     return(test_ret);
51311 }
51312 
51313 static int
test_xpointer(void)51314 test_xpointer(void) {
51315     int test_ret = 0;
51316 
51317     if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51318     test_ret += test_xmlXPtrBuildNodeList();
51319     test_ret += test_xmlXPtrEval();
51320     test_ret += test_xmlXPtrEvalRangePredicate();
51321     test_ret += test_xmlXPtrLocationSetAdd();
51322     test_ret += test_xmlXPtrLocationSetCreate();
51323     test_ret += test_xmlXPtrLocationSetDel();
51324     test_ret += test_xmlXPtrLocationSetMerge();
51325     test_ret += test_xmlXPtrLocationSetRemove();
51326     test_ret += test_xmlXPtrNewCollapsedRange();
51327     test_ret += test_xmlXPtrNewContext();
51328     test_ret += test_xmlXPtrNewLocationSetNodeSet();
51329     test_ret += test_xmlXPtrNewLocationSetNodes();
51330     test_ret += test_xmlXPtrNewRange();
51331     test_ret += test_xmlXPtrNewRangeNodeObject();
51332     test_ret += test_xmlXPtrNewRangeNodePoint();
51333     test_ret += test_xmlXPtrNewRangeNodes();
51334     test_ret += test_xmlXPtrNewRangePointNode();
51335     test_ret += test_xmlXPtrNewRangePoints();
51336     test_ret += test_xmlXPtrRangeToFunction();
51337     test_ret += test_xmlXPtrWrapLocationSet();
51338 
51339     if (test_ret != 0)
51340 	printf("Module xpointer: %d errors\n", test_ret);
51341     return(test_ret);
51342 }
51343 static int
test_module(const char * module)51344 test_module(const char *module) {
51345     if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51346     if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51347     if (!strcmp(module, "SAX2")) return(test_SAX2());
51348     if (!strcmp(module, "c14n")) return(test_c14n());
51349     if (!strcmp(module, "catalog")) return(test_catalog());
51350     if (!strcmp(module, "chvalid")) return(test_chvalid());
51351     if (!strcmp(module, "debugXML")) return(test_debugXML());
51352     if (!strcmp(module, "dict")) return(test_dict());
51353     if (!strcmp(module, "encoding")) return(test_encoding());
51354     if (!strcmp(module, "entities")) return(test_entities());
51355     if (!strcmp(module, "hash")) return(test_hash());
51356     if (!strcmp(module, "list")) return(test_list());
51357     if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51358     if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51359     if (!strcmp(module, "parser")) return(test_parser());
51360     if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51361     if (!strcmp(module, "pattern")) return(test_pattern());
51362     if (!strcmp(module, "relaxng")) return(test_relaxng());
51363     if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51364     if (!strcmp(module, "schematron")) return(test_schematron());
51365     if (!strcmp(module, "tree")) return(test_tree());
51366     if (!strcmp(module, "uri")) return(test_uri());
51367     if (!strcmp(module, "valid")) return(test_valid());
51368     if (!strcmp(module, "xinclude")) return(test_xinclude());
51369     if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51370     if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51371     if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51372     if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51373     if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51374     if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51375     if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51376     if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51377     if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51378     if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51379     if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51380     if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51381     if (!strcmp(module, "xpath")) return(test_xpath());
51382     if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51383     if (!strcmp(module, "xpointer")) return(test_xpointer());
51384     return(0);
51385 }
51386